From 8106bb2f98ac27a26ed0ebbc7527e2dda19cf5d9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 19:12:27 +0000 Subject: [PATCH 1/3] Update @github/copilot to 1.0.66 - Updated nodejs and test harness dependencies - Re-ran code generators - Formatted generated code --- dotnet/src/Generated/Rpc.cs | 350 +++++++++++++- dotnet/src/Generated/SessionEvents.cs | 250 ++++++++-- go/rpc/zrpc.go | 237 +++++++++- go/rpc/zrpc_encoding.go | 6 +- go/rpc/zsession_encoding.go | 30 +- go/rpc/zsession_events.go | 107 ++++- go/zsession_events.go | 18 +- java/pom.xml | 2 +- java/scripts/codegen/package-lock.json | 72 +-- java/scripts/codegen/package.json | 2 +- .../generated/AssistantMessageEvent.java | 2 + .../copilot/generated/SessionEvent.java | 10 +- ...tsConfig.java => SessionLimitsConfig.java} | 6 +- .../SessionLimitsExhaustedCompletedEvent.java | 43 ++ .../SessionLimitsExhaustedRequestedEvent.java | 45 ++ .../SessionLimitsExhaustedResponse.java | 31 ++ .../SessionLimitsExhaustedResponseAction.java | 39 ++ .../copilot/generated/SessionResumeEvent.java | 4 +- ... => SessionSessionLimitsChangedEvent.java} | 20 +- .../copilot/generated/SessionStartEvent.java | 4 +- .../SessionUsageCheckpointEvent.java | 43 ++ .../rpc/AdaptiveThinkingSupport.java | 37 ++ .../ModelCapabilitiesOverrideSupports.java | 4 +- .../rpc/ModelCapabilitiesSupports.java | 4 +- .../generated/rpc/SessionCompletionItem.java | 35 ++ .../generated/rpc/SessionCompletionsApi.java | 60 +++ ...CompletionsGetTriggerCharactersParams.java | 30 ++ ...CompletionsGetTriggerCharactersResult.java | 31 ++ .../rpc/SessionCompletionsRequestParams.java | 34 ++ .../rpc/SessionCompletionsRequestResult.java | 31 ++ ...SessionEventLogRegisterInterestParams.java | 2 +- ...tsConfig.java => SessionLimitsConfig.java} | 6 +- .../rpc/SessionMetadataSnapshotResult.java | 4 +- .../rpc/SessionOptionsUpdateParams.java | 6 +- .../copilot/generated/rpc/SessionRpc.java | 3 + .../copilot/generated/rpc/SessionUiApi.java | 16 + ...lePendingSessionLimitsExhaustedParams.java | 34 ++ ...lePendingSessionLimitsExhaustedResult.java | 30 ++ .../rpc/UISessionLimitsExhaustedResponse.java | 31 ++ ...ISessionLimitsExhaustedResponseAction.java | 39 ++ nodejs/package-lock.json | 72 +-- nodejs/package.json | 2 +- nodejs/samples/package-lock.json | 2 +- nodejs/src/generated/rpc.ts | 186 +++++++- nodejs/src/generated/session-events.ts | 209 ++++++++- python/copilot/generated/rpc.py | 432 +++++++++++++++--- python/copilot/generated/session_events.py | 250 +++++++--- rust/src/generated/api_types.rs | 269 ++++++++++- rust/src/generated/rpc.rs | 114 +++++ rust/src/generated/session_events.rs | 124 ++++- test/harness/package-lock.json | 72 +-- test/harness/package.json | 2 +- 52 files changed, 3077 insertions(+), 415 deletions(-) rename java/src/generated/java/com/github/copilot/generated/{ResponseLimitsConfig.java => SessionLimitsConfig.java} (84%) create mode 100644 java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedCompletedEvent.java create mode 100644 java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedRequestedEvent.java create mode 100644 java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedResponse.java create mode 100644 java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedResponseAction.java rename java/src/generated/java/com/github/copilot/generated/{SessionResponseLimitsChangedEvent.java => SessionSessionLimitsChangedEvent.java} (54%) create mode 100644 java/src/generated/java/com/github/copilot/generated/SessionUsageCheckpointEvent.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/AdaptiveThinkingSupport.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionItem.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsApi.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsGetTriggerCharactersParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsGetTriggerCharactersResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsRequestParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsRequestResult.java rename java/src/generated/java/com/github/copilot/generated/rpc/{ResponseLimitsConfig.java => SessionLimitsConfig.java} (84%) create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSessionLimitsExhaustedParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSessionLimitsExhaustedResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/UISessionLimitsExhaustedResponse.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/UISessionLimitsExhaustedResponseAction.java diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index e5d830ada5..f995ffa234 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -219,6 +219,10 @@ public sealed class ModelCapabilitiesLimits [Experimental(Diagnostics.Experimental)] public sealed class ModelCapabilitiesSupports { + /// Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). + [JsonPropertyName("adaptive_thinking")] + public AdaptiveThinkingSupport? AdaptiveThinking { get; set; } + /// Whether this model supports reasoning effort configuration. [JsonPropertyName("reasoningEffort")] public bool? ReasoningEffort { get; set; } @@ -3794,6 +3798,10 @@ public sealed class ModelCapabilitiesOverrideLimits [Experimental(Diagnostics.Experimental)] public sealed class ModelCapabilitiesOverrideSupports { + /// Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). + [JsonPropertyName("adaptive_thinking")] + public AdaptiveThinkingSupport? AdaptiveThinking { get; set; } + /// Whether this model supports reasoning effort configuration. [JsonPropertyName("reasoningEffort")] public bool? ReasoningEffort { get; set; } @@ -4417,6 +4425,75 @@ internal sealed class WorkspacesDiffRequest public string SessionId { get; set; } = string.Empty; } +/// Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). +[Experimental(Diagnostics.Experimental)] +public sealed class CompletionsGetTriggerCharactersResult +{ + /// Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven completions for the session. + [JsonPropertyName("triggerCharacters")] + public IList TriggerCharacters { get => field ??= []; set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionCompletionsGetTriggerCharactersRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced. +[Experimental(Diagnostics.Experimental)] +public sealed class SessionCompletionItem +{ + /// Text spliced into the composer when the item is accepted. + [JsonPropertyName("insertText")] + public string InsertText { get; set; } = string.Empty; + + /// Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the host's display kind. + [JsonPropertyName("kind")] + public string? Kind { get; set; } + + /// Primary display label for the picker row. Falls back to `insertText` when absent. + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// End (exclusive) of the replacement range in `text`, in UTF-16 code units. + [JsonPropertyName("rangeEnd")] + public long? RangeEnd { get; set; } + + /// Start of the replacement range in `text`, in UTF-16 code units. + [JsonPropertyName("rangeStart")] + public long? RangeStart { get; set; } +} + +/// Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. +[Experimental(Diagnostics.Experimental)] +public sealed class CompletionsRequestResult +{ + /// Completion items in host-ranked order. + [JsonPropertyName("items")] + public IList Items { get => field ??= []; set; } +} + +/// Request host-driven completions for the current composer input. +[Experimental(Diagnostics.Experimental)] +internal sealed class CompletionsRequestRequest +{ + /// Cursor offset within `text`, in UTF-16 code units. + [JsonPropertyName("offset")] + public long Offset { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// The full composed composer input. + [JsonPropertyName("text")] + public string Text { get; set; } = string.Empty; +} + /// Instruction sources loaded for the session, in merge order. [Experimental(Diagnostics.Experimental)] public sealed class InstructionsGetSourcesResult @@ -6826,6 +6903,10 @@ internal sealed class SessionUpdateOptionsParams [JsonPropertyName("eventsLogDirectory")] public string? EventsLogDirectory { get; set; } + /// Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. + [JsonPropertyName("excludedBuiltinAgents")] + public IList? ExcludedBuiltinAgents { get; set; } + /// Denylist of tool names for this session. [JsonPropertyName("excludedTools")] public IList? ExcludedTools { get; set; } @@ -6886,10 +6967,6 @@ internal sealed class SessionUpdateOptionsParams [JsonPropertyName("reasoningSummary")] public OptionsUpdateReasoningSummary? ReasoningSummary { get; set; } - /// Optional response limits. Pass null to clear the response limits. - [JsonPropertyName("responseLimits")] - public ResponseLimitsConfig? ResponseLimits { get; set; } - /// Whether the session is running in an interactive UI. [JsonPropertyName("runningInInteractiveMode")] public bool? RunningInInteractiveMode { get; set; } @@ -6906,6 +6983,10 @@ internal sealed class SessionUpdateOptionsParams [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; + /// Optional session limits. Pass null to clear the session limits. + [JsonPropertyName("sessionLimits")] + public SessionLimitsConfig? SessionLimits { get; set; } + /// Shell init profile (`None` or `NonInteractive`). [JsonPropertyName("shellInitProfile")] public string? ShellInitProfile { get; set; } @@ -8302,6 +8383,40 @@ internal sealed class UIHandlePendingAutoModeSwitchRequest public string SessionId { get; set; } = string.Empty; } +/// The user's selected action for an exhausted session limit. +[Experimental(Diagnostics.Experimental)] +public sealed class UISessionLimitsExhaustedResponse +{ + /// Action selected by the user. + [JsonPropertyName("action")] + public UISessionLimitsExhaustedResponseAction Action { get; set; } + + /// AI Credits to add to the current max when action is 'add'. + [JsonPropertyName("additionalAiCredits")] + public double? AdditionalAiCredits { get; set; } + + /// New absolute max AI Credits when action is 'set'. + [JsonPropertyName("maxAiCredits")] + public double? MaxAiCredits { get; set; } +} + +/// Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action. +[Experimental(Diagnostics.Experimental)] +internal sealed class UIHandlePendingSessionLimitsExhaustedRequest +{ + /// The unique request ID from the session_limits_exhausted.requested event. + [JsonPropertyName("requestId")] + public string RequestId { get; set; } = string.Empty; + + /// The selected session-limit action. + [JsonPropertyName("response")] + public UISessionLimitsExhaustedResponse Response { get => field ??= new(); set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Schema for the `UIExitPlanModeResponse` type. [Experimental(Diagnostics.Experimental)] public sealed class UIExitPlanModeResponse @@ -9814,10 +9929,6 @@ public sealed class SessionMetadataSnapshot [JsonPropertyName("remoteMetadata")] public MetadataSnapshotRemoteMetadata? RemoteMetadata { get; set; } - /// Current response limits for the session, or null when no limits are active. - [JsonPropertyName("responseLimits")] - public ResponseLimitsConfig? ResponseLimits { get; set; } - /// Currently selected model identifier, if any. [JsonPropertyName("selectedModel")] public string? SelectedModel { get; set; } @@ -9826,6 +9937,10 @@ public sealed class SessionMetadataSnapshot [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; + /// Current session limits, or null when no limits are active. + [JsonPropertyName("sessionLimits")] + public SessionLimitsConfig? SessionLimits { get; set; } + /// ISO 8601 timestamp of when the session started. [JsonPropertyName("startTime")] public DateTimeOffset StartTime { get; set; } @@ -10499,7 +10614,7 @@ public sealed class RegisterEventInterestResult [Experimental(Diagnostics.Experimental)] internal sealed class RegisterEventInterestParams { - /// The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. + /// The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. [JsonPropertyName("eventType")] public string EventType { get; set; } = string.Empty; @@ -11456,6 +11571,72 @@ public sealed class LlmInferenceHttpRequestChunkRequest public string RequestId { get; set; } = string.Empty; } +/// Resolved Anthropic adaptive-thinking capability for a model. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct AdaptiveThinkingSupport : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public AdaptiveThinkingSupport(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The model does not accept thinking.type='adaptive'. + public static AdaptiveThinkingSupport Unsupported { get; } = new("unsupported"); + + /// The model accepts adaptive thinking but also accepts thinking.type='enabled'. + public static AdaptiveThinkingSupport Optional { get; } = new("optional"); + + /// The model only accepts adaptive thinking and rejects thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). + public static AdaptiveThinkingSupport Required { get; } = new("required"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(AdaptiveThinkingSupport left, AdaptiveThinkingSupport right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(AdaptiveThinkingSupport left, AdaptiveThinkingSupport right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is AdaptiveThinkingSupport other && Equals(other); + + /// + public bool Equals(AdaptiveThinkingSupport other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override AdaptiveThinkingSupport Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, AdaptiveThinkingSupport value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AdaptiveThinkingSupport)); + } + } +} + + /// Model capability category for grouping in the model picker. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -15989,6 +16170,75 @@ public override void Write(Utf8JsonWriter writer, UIAutoModeSwitchResponse value } +/// User action selected for an exhausted session limit. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct UISessionLimitsExhaustedResponseAction : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public UISessionLimitsExhaustedResponseAction(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Increase the current max by an exact AI Credits amount. + public static UISessionLimitsExhaustedResponseAction Add { get; } = new("add"); + + /// Set a new absolute max AI Credits value. + public static UISessionLimitsExhaustedResponseAction Set { get; } = new("set"); + + /// Remove the current session limit. + public static UISessionLimitsExhaustedResponseAction Unset { get; } = new("unset"); + + /// Leave the limit unchanged and cancel the blocked model request. + public static UISessionLimitsExhaustedResponseAction Cancel { get; } = new("cancel"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(UISessionLimitsExhaustedResponseAction left, UISessionLimitsExhaustedResponseAction right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(UISessionLimitsExhaustedResponseAction left, UISessionLimitsExhaustedResponseAction right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is UISessionLimitsExhaustedResponseAction other && Equals(other); + + /// + public bool Equals(UISessionLimitsExhaustedResponseAction other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override UISessionLimitsExhaustedResponseAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, UISessionLimitsExhaustedResponseAction value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(UISessionLimitsExhaustedResponseAction)); + } + } +} + + /// The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -18536,6 +18786,12 @@ internal SessionRpc(CopilotSession session) Interlocked.CompareExchange(ref field, new(_session), null) ?? field; + /// Completions APIs. + public CompletionsApi Completions => + field ?? + Interlocked.CompareExchange(ref field, new(_session), null) ?? + field; + /// Instructions APIs. public InstructionsApi Instructions => field ?? @@ -19225,6 +19481,43 @@ public async Task DiffAsync(WorkspaceDiffMode mode, bool? i } } +/// Provides session-scoped Completions APIs. +[Experimental(Diagnostics.Experimental)] +public sealed class CompletionsApi +{ + private readonly CopilotSession _session; + + internal CompletionsApi(CopilotSession session) + { + _session = session; + } + + /// Gets the characters that should trigger host-driven completions for the session. Empty disables host-driven completions (e.g. local sessions, or a relay host that does not advertise them). + /// The to monitor for cancellation requests. The default is . + /// Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). + public async Task GetTriggerCharactersAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionCompletionsGetTriggerCharactersRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.completions.getTriggerCharacters", [request], cancellationToken); + } + + /// Requests host-driven completion items for the current composer input. Returns an empty list when the host has no items or does not support completions. + /// The full composed composer input. + /// Cursor offset within `text`, in UTF-16 code units. + /// The to monitor for cancellation requests. The default is . + /// Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. + public async Task RequestAsync(string text, long offset, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(text); + _session.ThrowIfDisposed(); + + var request = new CompletionsRequestRequest { SessionId = _session.SessionId, Text = text, Offset = offset }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.completions.request", [request], cancellationToken); + } +} + /// Provides session-scoped Instructions APIs. [Experimental(Diagnostics.Experimental)] public sealed class InstructionsApi @@ -20106,6 +20399,7 @@ internal OptionsApi(CopilotSession session) /// Absolute working-directory path for shell tools. /// Allowlist of tool names available to this session. /// Denylist of tool names for this session. + /// Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. /// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set. /// Whether shell-script safety heuristics are enabled. /// Shell init profile (`None` or `NonInteractive`). @@ -20143,14 +20437,14 @@ internal OptionsApi(CopilotSession session) /// Whether to enable cross-session store writes and reads. /// Whether to enable skill directory scanning and loading. Falls back to enableConfigDiscovery when unset. /// Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier. - /// Optional response limits. Pass null to clear the response limits. + /// Optional session limits. Pass null to clear the session limits. /// The to monitor for cancellation requests. The default is . /// Indicates whether the session options patch was applied successfully. - public async Task UpdateAsync(string? model = null, ModelCapabilitiesOverride? modelCapabilitiesOverrides = null, string? reasoningEffort = null, OptionsUpdateReasoningSummary? reasoningSummary = null, string? clientName = null, string? lspClientName = null, string? integrationId = null, IDictionary? featureFlags = null, bool? isExperimentalMode = null, ProviderConfig? provider = null, CapiSessionOptions? capi = null, string? workingDirectory = null, IList? availableTools = null, IList? excludedTools = null, OptionsUpdateToolFilterPrecedence? toolFilterPrecedence = null, bool? enableScriptSafety = null, string? shellInitProfile = null, IList? shellProcessFlags = null, SandboxConfig? sandboxConfig = null, bool? logInteractiveShells = null, OptionsUpdateEnvValueMode? envValueMode = null, bool? allowAllMcpServerInstructions = null, IList? skillDirectories = null, IList? disabledSkills = null, bool? enableOnDemandInstructionDiscovery = null, long? maxInlineBinaryBytes = null, IList? installedPlugins = null, bool? customAgentsLocalOnly = null, bool? suppressCustomAgentPrompt = null, bool? skipCustomInstructions = null, IList? disabledInstructionSources = null, bool? coauthorEnabled = null, string? trajectoryFile = null, bool? enableStreaming = null, string? copilotUrl = null, bool? askUserDisabled = null, bool? continueOnAutoMode = null, bool? runningInInteractiveMode = null, bool? enableReasoningSummaries = null, string? agentContext = null, string? eventsLogDirectory = null, IList? additionalContentExclusionPolicies = null, bool? manageScheduleEnabled = null, IList? sessionCapabilities = null, bool? skipEmbeddingRetrieval = null, string? organizationCustomInstructions = null, bool? enableFileHooks = null, bool? enableHostGitOperations = null, bool? enableSessionStore = null, bool? enableSkills = null, OptionsUpdateContextTier? contextTier = null, ResponseLimitsConfig? responseLimits = null, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string? model = null, ModelCapabilitiesOverride? modelCapabilitiesOverrides = null, string? reasoningEffort = null, OptionsUpdateReasoningSummary? reasoningSummary = null, string? clientName = null, string? lspClientName = null, string? integrationId = null, IDictionary? featureFlags = null, bool? isExperimentalMode = null, ProviderConfig? provider = null, CapiSessionOptions? capi = null, string? workingDirectory = null, IList? availableTools = null, IList? excludedTools = null, IList? excludedBuiltinAgents = null, OptionsUpdateToolFilterPrecedence? toolFilterPrecedence = null, bool? enableScriptSafety = null, string? shellInitProfile = null, IList? shellProcessFlags = null, SandboxConfig? sandboxConfig = null, bool? logInteractiveShells = null, OptionsUpdateEnvValueMode? envValueMode = null, bool? allowAllMcpServerInstructions = null, IList? skillDirectories = null, IList? disabledSkills = null, bool? enableOnDemandInstructionDiscovery = null, long? maxInlineBinaryBytes = null, IList? installedPlugins = null, bool? customAgentsLocalOnly = null, bool? suppressCustomAgentPrompt = null, bool? skipCustomInstructions = null, IList? disabledInstructionSources = null, bool? coauthorEnabled = null, string? trajectoryFile = null, bool? enableStreaming = null, string? copilotUrl = null, bool? askUserDisabled = null, bool? continueOnAutoMode = null, bool? runningInInteractiveMode = null, bool? enableReasoningSummaries = null, string? agentContext = null, string? eventsLogDirectory = null, IList? additionalContentExclusionPolicies = null, bool? manageScheduleEnabled = null, IList? sessionCapabilities = null, bool? skipEmbeddingRetrieval = null, string? organizationCustomInstructions = null, bool? enableFileHooks = null, bool? enableHostGitOperations = null, bool? enableSessionStore = null, bool? enableSkills = null, OptionsUpdateContextTier? contextTier = null, SessionLimitsConfig? sessionLimits = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); - var request = new SessionUpdateOptionsParams { SessionId = _session.SessionId, Model = model, ModelCapabilitiesOverrides = modelCapabilitiesOverrides, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, ClientName = clientName, LspClientName = lspClientName, IntegrationId = integrationId, FeatureFlags = featureFlags, IsExperimentalMode = isExperimentalMode, Provider = provider, Capi = capi, WorkingDirectory = workingDirectory, AvailableTools = availableTools, ExcludedTools = excludedTools, ToolFilterPrecedence = toolFilterPrecedence, EnableScriptSafety = enableScriptSafety, ShellInitProfile = shellInitProfile, ShellProcessFlags = shellProcessFlags, SandboxConfig = sandboxConfig, LogInteractiveShells = logInteractiveShells, EnvValueMode = envValueMode, AllowAllMcpServerInstructions = allowAllMcpServerInstructions, SkillDirectories = skillDirectories, DisabledSkills = disabledSkills, EnableOnDemandInstructionDiscovery = enableOnDemandInstructionDiscovery, MaxInlineBinaryBytes = maxInlineBinaryBytes, InstalledPlugins = installedPlugins, CustomAgentsLocalOnly = customAgentsLocalOnly, SuppressCustomAgentPrompt = suppressCustomAgentPrompt, SkipCustomInstructions = skipCustomInstructions, DisabledInstructionSources = disabledInstructionSources, CoauthorEnabled = coauthorEnabled, TrajectoryFile = trajectoryFile, EnableStreaming = enableStreaming, CopilotUrl = copilotUrl, AskUserDisabled = askUserDisabled, ContinueOnAutoMode = continueOnAutoMode, RunningInInteractiveMode = runningInInteractiveMode, EnableReasoningSummaries = enableReasoningSummaries, AgentContext = agentContext, EventsLogDirectory = eventsLogDirectory, AdditionalContentExclusionPolicies = additionalContentExclusionPolicies, ManageScheduleEnabled = manageScheduleEnabled, SessionCapabilities = sessionCapabilities, SkipEmbeddingRetrieval = skipEmbeddingRetrieval, OrganizationCustomInstructions = organizationCustomInstructions, EnableFileHooks = enableFileHooks, EnableHostGitOperations = enableHostGitOperations, EnableSessionStore = enableSessionStore, EnableSkills = enableSkills, ContextTier = contextTier, ResponseLimits = responseLimits }; + var request = new SessionUpdateOptionsParams { SessionId = _session.SessionId, Model = model, ModelCapabilitiesOverrides = modelCapabilitiesOverrides, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, ClientName = clientName, LspClientName = lspClientName, IntegrationId = integrationId, FeatureFlags = featureFlags, IsExperimentalMode = isExperimentalMode, Provider = provider, Capi = capi, WorkingDirectory = workingDirectory, AvailableTools = availableTools, ExcludedTools = excludedTools, ExcludedBuiltinAgents = excludedBuiltinAgents, ToolFilterPrecedence = toolFilterPrecedence, EnableScriptSafety = enableScriptSafety, ShellInitProfile = shellInitProfile, ShellProcessFlags = shellProcessFlags, SandboxConfig = sandboxConfig, LogInteractiveShells = logInteractiveShells, EnvValueMode = envValueMode, AllowAllMcpServerInstructions = allowAllMcpServerInstructions, SkillDirectories = skillDirectories, DisabledSkills = disabledSkills, EnableOnDemandInstructionDiscovery = enableOnDemandInstructionDiscovery, MaxInlineBinaryBytes = maxInlineBinaryBytes, InstalledPlugins = installedPlugins, CustomAgentsLocalOnly = customAgentsLocalOnly, SuppressCustomAgentPrompt = suppressCustomAgentPrompt, SkipCustomInstructions = skipCustomInstructions, DisabledInstructionSources = disabledInstructionSources, CoauthorEnabled = coauthorEnabled, TrajectoryFile = trajectoryFile, EnableStreaming = enableStreaming, CopilotUrl = copilotUrl, AskUserDisabled = askUserDisabled, ContinueOnAutoMode = continueOnAutoMode, RunningInInteractiveMode = runningInInteractiveMode, EnableReasoningSummaries = enableReasoningSummaries, AgentContext = agentContext, EventsLogDirectory = eventsLogDirectory, AdditionalContentExclusionPolicies = additionalContentExclusionPolicies, ManageScheduleEnabled = manageScheduleEnabled, SessionCapabilities = sessionCapabilities, SkipEmbeddingRetrieval = skipEmbeddingRetrieval, OrganizationCustomInstructions = organizationCustomInstructions, EnableFileHooks = enableFileHooks, EnableHostGitOperations = enableHostGitOperations, EnableSessionStore = enableSessionStore, EnableSkills = enableSkills, ContextTier = contextTier, SessionLimits = sessionLimits }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.options.update", [request], cancellationToken); } } @@ -20540,6 +20834,21 @@ public async Task HandlePendingAutoModeSwitchAsync(string return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.handlePendingAutoModeSwitch", [request], cancellationToken); } + /// Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action. + /// The unique request ID from the session_limits_exhausted.requested event. + /// The selected session-limit action. + /// The to monitor for cancellation requests. The default is . + /// Indicates whether the pending UI request was resolved by this call. + public async Task HandlePendingSessionLimitsExhaustedAsync(string requestId, UISessionLimitsExhaustedResponse response, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(requestId); + ArgumentNullException.ThrowIfNull(response); + _session.ThrowIfDisposed(); + + var request = new UIHandlePendingSessionLimitsExhaustedRequest { SessionId = _session.SessionId, RequestId = requestId, Response = response }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.handlePendingSessionLimitsExhausted", [request], cancellationToken); + } + /// Resolves a pending `exit_plan_mode.requested` event with the user's response. /// The unique request ID from the exit_plan_mode.requested event. /// Schema for the `UIExitPlanModeResponse` type. @@ -21257,7 +21566,7 @@ public async Task TailAsync(CancellationToken cancellationTo } /// Registers consumer interest in an event type for runtime gating purposes. - /// The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. + /// The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. /// The to monitor for cancellation requests. The default is . /// Opaque handle representing an event-type interest registration. public async Task RegisterInterestAsync(string eventType, CancellationToken cancellationToken = default) @@ -21892,12 +22201,18 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.PersistedBinaryResult), TypeInfoPropertyName = "SessionEventsPersistedBinaryResult")] [JsonSerializable(typeof(GitHub.Copilot.PlanChangedOperation), TypeInfoPropertyName = "SessionEventsPlanChangedOperation")] [JsonSerializable(typeof(GitHub.Copilot.ReasoningSummary), TypeInfoPropertyName = "SessionEventsReasoningSummary")] -[JsonSerializable(typeof(GitHub.Copilot.ResponseLimitsConfig), TypeInfoPropertyName = "SessionEventsResponseLimitsConfig")] [JsonSerializable(typeof(GitHub.Copilot.SamplingCompletedData), TypeInfoPropertyName = "SessionEventsSamplingCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.SamplingCompletedEvent), TypeInfoPropertyName = "SessionEventsSamplingCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SamplingRequestedData), TypeInfoPropertyName = "SessionEventsSamplingRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.SamplingRequestedEvent), TypeInfoPropertyName = "SessionEventsSamplingRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SessionEvent), TypeInfoPropertyName = "SessionEventsSessionEvent")] +[JsonSerializable(typeof(GitHub.Copilot.SessionLimitsConfig), TypeInfoPropertyName = "SessionEventsSessionLimitsConfig")] +[JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedCompletedData), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedCompletedData")] +[JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedCompletedEvent), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedCompletedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedRequestedData), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedRequestedData")] +[JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedRequestedEvent), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedRequestedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedResponse), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedResponse")] +[JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedResponseAction), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedResponseAction")] [JsonSerializable(typeof(GitHub.Copilot.SessionMode), TypeInfoPropertyName = "SessionEventsSessionMode")] [JsonSerializable(typeof(GitHub.Copilot.ShutdownCodeChanges), TypeInfoPropertyName = "SessionEventsShutdownCodeChanges")] [JsonSerializable(typeof(GitHub.Copilot.ShutdownModelMetric), TypeInfoPropertyName = "SessionEventsShutdownModelMetric")] @@ -22047,6 +22362,9 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(CommandsListRequestWithSession))] [JsonSerializable(typeof(CommandsRespondToQueuedCommandRequest))] [JsonSerializable(typeof(CommandsRespondToQueuedCommandResult))] +[JsonSerializable(typeof(CompletionsGetTriggerCharactersResult))] +[JsonSerializable(typeof(CompletionsRequestRequest))] +[JsonSerializable(typeof(CompletionsRequestResult))] [JsonSerializable(typeof(ConfigureSessionExtensionsParams))] [JsonSerializable(typeof(ConnectRemoteSessionParams))] [JsonSerializable(typeof(ConnectRequest))] @@ -22374,6 +22692,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionBulkDeleteResult))] [JsonSerializable(typeof(SessionCanvasListOpenRequest))] [JsonSerializable(typeof(SessionCanvasListRequest))] +[JsonSerializable(typeof(SessionCompletionItem))] +[JsonSerializable(typeof(SessionCompletionsGetTriggerCharactersRequest))] [JsonSerializable(typeof(SessionContext))] [JsonSerializable(typeof(SessionEnrichMetadataResult))] [JsonSerializable(typeof(SessionEventLogTailRequest))] @@ -22567,8 +22887,10 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(UIHandlePendingResult))] [JsonSerializable(typeof(UIHandlePendingSamplingRequest))] [JsonSerializable(typeof(UIHandlePendingSamplingResponse))] +[JsonSerializable(typeof(UIHandlePendingSessionLimitsExhaustedRequest))] [JsonSerializable(typeof(UIHandlePendingUserInputRequest))] [JsonSerializable(typeof(UIRegisterDirectAutoModeSwitchHandlerResult))] +[JsonSerializable(typeof(UISessionLimitsExhaustedResponse))] [JsonSerializable(typeof(UIUnregisterDirectAutoModeSwitchHandlerRequest))] [JsonSerializable(typeof(UIUnregisterDirectAutoModeSwitchHandlerResult))] [JsonSerializable(typeof(UIUserInputResponse))] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index a125ec003f..1d9dfdceca 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -63,6 +63,8 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(PermissionRequestedEvent), "permission.requested")] [JsonDerivedType(typeof(SamplingCompletedEvent), "sampling.completed")] [JsonDerivedType(typeof(SamplingRequestedEvent), "sampling.requested")] +[JsonDerivedType(typeof(SessionLimitsExhaustedCompletedEvent), "session_limits_exhausted.completed")] +[JsonDerivedType(typeof(SessionLimitsExhaustedRequestedEvent), "session_limits_exhausted.requested")] [JsonDerivedType(typeof(SessionAutopilotObjectiveChangedEvent), "session.autopilot_objective_changed")] [JsonDerivedType(typeof(SessionBackgroundTasksChangedEvent), "session.background_tasks_changed")] [JsonDerivedType(typeof(SessionBinaryAssetEvent), "session.binary_asset")] @@ -90,11 +92,11 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionPermissionsChangedEvent), "session.permissions_changed")] [JsonDerivedType(typeof(SessionPlanChangedEvent), "session.plan_changed")] [JsonDerivedType(typeof(SessionRemoteSteerableChangedEvent), "session.remote_steerable_changed")] -[JsonDerivedType(typeof(SessionResponseLimitsChangedEvent), "session.response_limits_changed")] [JsonDerivedType(typeof(SessionResumeEvent), "session.resume")] [JsonDerivedType(typeof(SessionScheduleCancelledEvent), "session.schedule_cancelled")] [JsonDerivedType(typeof(SessionScheduleCreatedEvent), "session.schedule_created")] [JsonDerivedType(typeof(SessionScheduleRearmedEvent), "session.schedule_rearmed")] +[JsonDerivedType(typeof(SessionSessionLimitsChangedEvent), "session.session_limits_changed")] [JsonDerivedType(typeof(SessionShutdownEvent), "session.shutdown")] [JsonDerivedType(typeof(SessionSkillsLoadedEvent), "session.skills_loaded")] [JsonDerivedType(typeof(SessionSnapshotRewindEvent), "session.snapshot_rewind")] @@ -104,6 +106,7 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionTodosChangedEvent), "session.todos_changed")] [JsonDerivedType(typeof(SessionToolsUpdatedEvent), "session.tools_updated")] [JsonDerivedType(typeof(SessionTruncationEvent), "session.truncation")] +[JsonDerivedType(typeof(SessionUsageCheckpointEvent), "session.usage_checkpoint")] [JsonDerivedType(typeof(SessionUsageInfoEvent), "session.usage_info")] [JsonDerivedType(typeof(SessionWarningEvent), "session.warning")] [JsonDerivedType(typeof(SessionWorkspaceFileChangedEvent), "session.workspace_file_changed")] @@ -347,17 +350,17 @@ public sealed partial class SessionModeChangedEvent : SessionEvent public required SessionModeChangedData Data { get; set; } } -/// Response limits update details. Null clears the limits. -/// Represents the session.response_limits_changed event. -public sealed partial class SessionResponseLimitsChangedEvent : SessionEvent +/// Session limits update details. Null clears the limits. +/// Represents the session.session_limits_changed event. +public sealed partial class SessionSessionLimitsChangedEvent : SessionEvent { /// [JsonIgnore] - public override string Type => "session.response_limits_changed"; + public override string Type => "session.session_limits_changed"; - /// The session.response_limits_changed event payload. + /// The session.session_limits_changed event payload. [JsonPropertyName("data")] - public required SessionResponseLimitsChangedData Data { get; set; } + public required SessionSessionLimitsChangedData Data { get; set; } } /// Permissions change details carrying the aggregate allow-all boolean transition. @@ -464,6 +467,19 @@ public sealed partial class SessionShutdownEvent : SessionEvent public required SessionShutdownData Data { get; set; } } +/// Durable session usage checkpoint for reconstructing aggregate accounting on resume. +/// Represents the session.usage_checkpoint event. +public sealed partial class SessionUsageCheckpointEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.usage_checkpoint"; + + /// The session.usage_checkpoint event payload. + [JsonPropertyName("data")] + public required SessionUsageCheckpointData Data { get; set; } +} + /// Working directory and git context at session start. /// Represents the session.context_changed event. public sealed partial class SessionContextChangedEvent : SessionEvent @@ -1206,6 +1222,32 @@ public sealed partial class AutoModeSwitchCompletedEvent : SessionEvent public required AutoModeSwitchCompletedData Data { get; set; } } +/// Session limit exhaustion notification requiring user action. +/// Represents the session_limits_exhausted.requested event. +public sealed partial class SessionLimitsExhaustedRequestedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session_limits_exhausted.requested"; + + /// The session_limits_exhausted.requested event payload. + [JsonPropertyName("data")] + public required SessionLimitsExhaustedRequestedData Data { get; set; } +} + +/// Session limit exhaustion prompt completion notification. +/// Represents the session_limits_exhausted.completed event. +public sealed partial class SessionLimitsExhaustedCompletedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session_limits_exhausted.completed"; + + /// The session_limits_exhausted.completed event payload. + [JsonPropertyName("data")] + public required SessionLimitsExhaustedCompletedData Data { get; set; } +} + /// SDK command registration change notification. /// Represents the commands.changed event. public sealed partial class CommandsChangedEvent : SessionEvent @@ -1505,11 +1547,6 @@ public sealed partial class SessionStartData [JsonPropertyName("remoteSteerable")] public bool? RemoteSteerable { get; set; } - /// Response limits configured at session creation time, if any. - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonPropertyName("responseLimits")] - public ResponseLimitsConfig? ResponseLimits { get; set; } - /// Model selected at session creation time, if any. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("selectedModel")] @@ -1519,6 +1556,11 @@ public sealed partial class SessionStartData [JsonPropertyName("sessionId")] public required string SessionId { get; set; } + /// Session limits configured at session creation time, if any. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("sessionLimits")] + public SessionLimitsConfig? SessionLimits { get; set; } + /// ISO 8601 timestamp when the session was created. [JsonPropertyName("startTime")] public required DateTimeOffset StartTime { get; set; } @@ -1575,11 +1617,6 @@ public sealed partial class SessionResumeData [JsonPropertyName("remoteSteerable")] public bool? RemoteSteerable { get; set; } - /// Response limits currently configured at resume time; null when no limits are active. - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonPropertyName("responseLimits")] - public ResponseLimitsConfig? ResponseLimits { get; set; } - /// ISO 8601 timestamp when the session was resumed. [JsonPropertyName("resumeTime")] public required DateTimeOffset ResumeTime { get; set; } @@ -1589,6 +1626,11 @@ public sealed partial class SessionResumeData [JsonPropertyName("selectedModel")] public string? SelectedModel { get; set; } + /// Session limits currently configured at resume time; null when no limits are active. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("sessionLimits")] + public SessionLimitsConfig? SessionLimits { get; set; } + /// True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("sessionWasActive")] @@ -1847,12 +1889,12 @@ public sealed partial class SessionModeChangedData public required SessionMode PreviousMode { get; set; } } -/// Response limits update details. Null clears the limits. -public sealed partial class SessionResponseLimitsChangedData +/// Session limits update details. Null clears the limits. +public sealed partial class SessionSessionLimitsChangedData { - /// Current response limits for the session, or null when no limits are active. - [JsonPropertyName("responseLimits")] - public ResponseLimitsConfig? ResponseLimits { get; set; } + /// Current session limits, or null when no limits are active. + [JsonPropertyName("sessionLimits")] + public SessionLimitsConfig? SessionLimits { get; set; } } /// Permissions change details carrying the aggregate allow-all boolean transition. @@ -2054,6 +2096,20 @@ public sealed partial class SessionShutdownData internal double? TotalPremiumRequests { get; set; } } +/// Durable session usage checkpoint for reconstructing aggregate accounting on resume. +public sealed partial class SessionUsageCheckpointData +{ + /// Session-wide accumulated nano-AI units cost at checkpoint time. + [JsonPropertyName("totalNanoAiu")] + public required double TotalNanoAiu { get; set; } + + /// Total number of premium API requests used at checkpoint time. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("totalPremiumRequests")] + internal double? TotalPremiumRequests { get; set; } +} + /// Working directory and git context at session start. public sealed partial class SessionContextChangedData { @@ -2441,6 +2497,11 @@ public sealed partial class AssistantMessageData [JsonPropertyName("reasoningText")] public string? ReasoningText { get; set; } + /// OpenAI-compatible wire field the provider used for reasoning (e.g. reasoning_content/reasoning). Populated only when non-canonical, so the dialect round-trips across turns. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("reasoningWireField")] + public string? ReasoningWireField { get; set; } + /// GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("requestId")] @@ -3571,6 +3632,34 @@ public sealed partial class AutoModeSwitchCompletedData public required AutoModeSwitchResponse Response { get; set; } } +/// Session limit exhaustion notification requiring user action. +public sealed partial class SessionLimitsExhaustedRequestedData +{ + /// Configured max AI Credits for the current accounting window. + [JsonPropertyName("maxAiCredits")] + public required double MaxAiCredits { get; set; } + + /// Unique identifier for this request; used to respond via session.ui.handlePendingSessionLimitsExhausted(). + [JsonPropertyName("requestId")] + public required string RequestId { get; set; } + + /// AI Credits already consumed in the current accounting window. + [JsonPropertyName("usedAiCredits")] + public required double UsedAiCredits { get; set; } +} + +/// Session limit exhaustion prompt completion notification. +public sealed partial class SessionLimitsExhaustedCompletedData +{ + /// Request ID of the resolved request; clients should dismiss any UI for this request. + [JsonPropertyName("requestId")] + public required string RequestId { get; set; } + + /// The user's selected session-limit action. + [JsonPropertyName("response")] + public required SessionLimitsExhaustedResponse Response { get; set; } +} + /// SDK command registration change notification. public sealed partial class CommandsChangedData { @@ -3939,11 +4028,11 @@ public sealed partial class WorkingDirectoryContext public string? RepositoryHost { get; set; } } -/// Optional response limits. -/// Nested data type for ResponseLimitsConfig. -public sealed partial class ResponseLimitsConfig +/// Optional session limits. +/// Nested data type for SessionLimitsConfig. +public sealed partial class SessionLimitsConfig { - /// Maximum AI Credits allowed while responding to one top-level user message. + /// Maximum AI Credits allowed across the session's current accounting window. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("maxAiCredits")] public double? MaxAiCredits { get; set; } @@ -6226,6 +6315,16 @@ public sealed partial class PermissionRequestRead : PermissionRequest [JsonPropertyName("path")] public required string Path { get; set; } + /// True when the model has requested to run this search outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the search runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("requestSandboxBypass")] + public bool? RequestSandboxBypass { get; set; } + + /// Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("requestSandboxBypassReason")] + public string? RequestSandboxBypassReason { get; set; } + /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] @@ -7134,6 +7233,25 @@ public sealed partial class McpOauthWWWAuthenticateParams public string? Scope { get; set; } } +/// The user's selected action for an exhausted session limit. +/// Nested data type for SessionLimitsExhaustedResponse. +public sealed partial class SessionLimitsExhaustedResponse +{ + /// Action selected by the user. + [JsonPropertyName("action")] + public required SessionLimitsExhaustedResponseAction Action { get; set; } + + /// AI Credits to add to the current max when action is 'add'. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("additionalAiCredits")] + public double? AdditionalAiCredits { get; set; } + + /// New absolute max AI Credits when action is 'set'. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("maxAiCredits")] + public double? MaxAiCredits { get; set; } +} + /// Schema for the `CommandsChangedCommand` type. /// Nested data type for CommandsChangedCommand. public sealed partial class CommandsChangedCommand @@ -9903,6 +10021,73 @@ public override void Write(Utf8JsonWriter writer, AutoModeSwitchResponse value, } } +/// User action selected for an exhausted session limit. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct SessionLimitsExhaustedResponseAction : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public SessionLimitsExhaustedResponseAction(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Increase the current max by an exact AI Credits amount. + public static SessionLimitsExhaustedResponseAction Add { get; } = new("add"); + + /// Set a new absolute max AI Credits value. + public static SessionLimitsExhaustedResponseAction Set { get; } = new("set"); + + /// Remove the current session limit. + public static SessionLimitsExhaustedResponseAction Unset { get; } = new("unset"); + + /// Leave the limit unchanged and cancel the blocked model request. + public static SessionLimitsExhaustedResponseAction Cancel { get; } = new("cancel"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(SessionLimitsExhaustedResponseAction left, SessionLimitsExhaustedResponseAction right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(SessionLimitsExhaustedResponseAction left, SessionLimitsExhaustedResponseAction right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is SessionLimitsExhaustedResponseAction other && Equals(other); + + /// + public bool Equals(SessionLimitsExhaustedResponseAction 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 SessionLimitsExhaustedResponseAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, SessionLimitsExhaustedResponseAction value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionLimitsExhaustedResponseAction)); + } + } +} + /// Exit plan mode action. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -10564,7 +10749,6 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(PermissionRule))] [JsonSerializable(typeof(PersistedBinaryImage))] [JsonSerializable(typeof(PersistedBinaryResult))] -[JsonSerializable(typeof(ResponseLimitsConfig))] [JsonSerializable(typeof(SamplingCompletedData))] [JsonSerializable(typeof(SamplingCompletedEvent))] [JsonSerializable(typeof(SamplingRequestedData))] @@ -10610,6 +10794,12 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SessionIdleEvent))] [JsonSerializable(typeof(SessionInfoData))] [JsonSerializable(typeof(SessionInfoEvent))] +[JsonSerializable(typeof(SessionLimitsConfig))] +[JsonSerializable(typeof(SessionLimitsExhaustedCompletedData))] +[JsonSerializable(typeof(SessionLimitsExhaustedCompletedEvent))] +[JsonSerializable(typeof(SessionLimitsExhaustedRequestedData))] +[JsonSerializable(typeof(SessionLimitsExhaustedRequestedEvent))] +[JsonSerializable(typeof(SessionLimitsExhaustedResponse))] [JsonSerializable(typeof(SessionMcpServerStatusChangedData))] [JsonSerializable(typeof(SessionMcpServerStatusChangedEvent))] [JsonSerializable(typeof(SessionMcpServersLoadedData))] @@ -10624,8 +10814,6 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SessionPlanChangedEvent))] [JsonSerializable(typeof(SessionRemoteSteerableChangedData))] [JsonSerializable(typeof(SessionRemoteSteerableChangedEvent))] -[JsonSerializable(typeof(SessionResponseLimitsChangedData))] -[JsonSerializable(typeof(SessionResponseLimitsChangedEvent))] [JsonSerializable(typeof(SessionResumeData))] [JsonSerializable(typeof(SessionResumeEvent))] [JsonSerializable(typeof(SessionScheduleCancelledData))] @@ -10634,6 +10822,8 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SessionScheduleCreatedEvent))] [JsonSerializable(typeof(SessionScheduleRearmedData))] [JsonSerializable(typeof(SessionScheduleRearmedEvent))] +[JsonSerializable(typeof(SessionSessionLimitsChangedData))] +[JsonSerializable(typeof(SessionSessionLimitsChangedEvent))] [JsonSerializable(typeof(SessionShutdownData))] [JsonSerializable(typeof(SessionShutdownEvent))] [JsonSerializable(typeof(SessionSkillsLoadedData))] @@ -10652,6 +10842,8 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SessionToolsUpdatedEvent))] [JsonSerializable(typeof(SessionTruncationData))] [JsonSerializable(typeof(SessionTruncationEvent))] +[JsonSerializable(typeof(SessionUsageCheckpointData))] +[JsonSerializable(typeof(SessionUsageCheckpointEvent))] [JsonSerializable(typeof(SessionUsageInfoData))] [JsonSerializable(typeof(SessionUsageInfoEvent))] [JsonSerializable(typeof(SessionWarningData))] diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 69569144f6..f0cec5ee47 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -1247,6 +1247,36 @@ type CommandsRespondToQueuedCommandResult struct { Success bool `json:"success"` } +// Characters that, when typed in the composer, should trigger a `completions.request`. +// Empty when the session has no host-driven completions (e.g. local sessions, or a relay +// host that does not advertise `completionTriggerCharacters`). +// Experimental: CompletionsGetTriggerCharactersResult is part of an experimental API and +// may change or be removed. +type CompletionsGetTriggerCharactersResult struct { + // Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven + // completions for the session. + TriggerCharacters []string `json:"triggerCharacters"` +} + +// Request host-driven completions for the current composer input. +// Experimental: CompletionsRequestRequest is part of an experimental API and may change or +// be removed. +type CompletionsRequestRequest struct { + // Cursor offset within `text`, in UTF-16 code units. + Offset int64 `json:"offset"` + // The full composed composer input. + Text string `json:"text"` +} + +// Host-driven completion items for the current composer input. Empty when the host returns +// no items or does not support completions. +// Experimental: CompletionsRequestResult is part of an experimental API and may change or +// be removed. +type CompletionsRequestResult struct { + // Completion items in host-ranked order. + Items []SessionCompletionItem `json:"items"` +} + // Params to attach or detach an in-process ExtensionController delegate. // Experimental: ConfigureSessionExtensionsParams is part of an experimental API and may // change or be removed. @@ -3742,6 +3772,9 @@ type ModelCapabilitiesOverrideLimitsVision struct { // Experimental: ModelCapabilitiesOverrideSupports is part of an experimental API and may // change or be removed. type ModelCapabilitiesOverrideSupports struct { + // Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. + // 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). + AdaptiveThinking *AdaptiveThinkingSupport `json:"adaptive_thinking,omitempty"` // Whether this model supports reasoning effort configuration ReasoningEffort *bool `json:"reasoningEffort,omitempty"` // Whether this model supports vision/image input @@ -3752,6 +3785,9 @@ type ModelCapabilitiesOverrideSupports struct { // Experimental: ModelCapabilitiesSupports is part of an experimental API and may change or // be removed. type ModelCapabilitiesSupports struct { + // Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. + // 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). + AdaptiveThinking *AdaptiveThinkingSupport `json:"adaptive_thinking,omitempty"` // Whether this model supports reasoning effort configuration ReasoningEffort *bool `json:"reasoningEffort,omitempty"` // Whether this model supports vision/image input @@ -5969,8 +6005,8 @@ type RegisterEventInterestParams struct { // count as having a consumer. Multiple registrations for the same event type from the same // or different consumers are tracked independently and must each be released. See: // `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, - // `user_input.requested`, `elicitation.requested`, `command.queued`, - // `exit_plan_mode.requested`. + // `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, + // `command.queued`, `exit_plan_mode.requested`. EventType string `json:"eventType"` } @@ -6237,14 +6273,6 @@ type RemoteSessionRepository struct { Owner string `json:"owner"` } -// Optional response limits. -// Experimental: ResponseLimitsConfig is part of an experimental API and may change or be -// removed. -type ResponseLimitsConfig struct { - // Maximum AI Credits allowed while responding to one top-level user message. - MaxAiCredits *float64 `json:"maxAiCredits,omitempty"` -} - // Experimental: RuntimeShutdownResult is part of an experimental API and may change or be // removed. type RuntimeShutdownResult struct { @@ -6552,6 +6580,25 @@ type SessionBulkDeleteResult struct { type SessionCanvasCloseResult struct { } +// A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` +// (UTF-16 code units) in the composer with `insertText`; when the range is absent, the +// active token around the cursor is replaced. +// Experimental: SessionCompletionItem is part of an experimental API and may change or be +// removed. +type SessionCompletionItem struct { + // Text spliced into the composer when the item is accepted. + InsertText string `json:"insertText"` + // Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the + // host's display kind. + Kind *string `json:"kind,omitempty"` + // Primary display label for the picker row. Falls back to `insertText` when absent. + Label *string `json:"label,omitempty"` + // End (exclusive) of the replacement range in `text`, in UTF-16 code units. + RangeEnd *int64 `json:"rangeEnd,omitempty"` + // Start of the replacement range in `text`, in UTF-16 code units. + RangeStart *int64 `json:"rangeStart,omitempty"` +} + // Pre-resolved working-directory context for session startup. // Experimental: SessionContext is part of an experimental API and may change or be removed. type SessionContext struct { @@ -6965,6 +7012,14 @@ type SessionInstalledPluginSourceURL struct { URL string `json:"url"` } +// Optional session limits. +// Experimental: SessionLimitsConfig is part of an experimental API and may change or be +// removed. +type SessionLimitsConfig struct { + // Maximum AI Credits allowed across the session's current accounting window. + MaxAiCredits *float64 `json:"maxAiCredits,omitempty"` +} + // Sessions matching the filter, ordered most-recently-modified first. // Experimental: SessionList is part of an experimental API and may change or be removed. type SessionList struct { @@ -7131,12 +7186,12 @@ type SessionMetadataSnapshot struct { // Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are // immutable for the lifetime of the session. RemoteMetadata *MetadataSnapshotRemoteMetadata `json:"remoteMetadata,omitempty"` - // Current response limits for the session, or null when no limits are active - ResponseLimits *ResponseLimitsConfig `json:"responseLimits"` // Currently selected model identifier, if any SelectedModel *string `json:"selectedModel,omitempty"` // The unique identifier of the session SessionID string `json:"sessionId"` + // Current session limits, or null when no limits are active + SessionLimits *SessionLimitsConfig `json:"sessionLimits"` // ISO 8601 timestamp of when the session started StartTime time.Time `json:"startTime"` // Short human-readable summary of the session, if known. Omitted when no summary has been @@ -7233,6 +7288,10 @@ type SessionOpenOptions struct { EnvValueMode *SessionOpenOptionsEnvValueMode `json:"envValueMode,omitempty"` // Override directory for session event logs. EventsLogDirectory *string `json:"eventsLogDirectory,omitempty"` + // Built-in subagent names to exclude from this session. Excluded built-ins are hidden from + // agent discovery and cannot be dispatched unless a custom agent with the same name is + // available. + ExcludedBuiltinAgents []string `json:"excludedBuiltinAgents,omitzero"` // Denylist of tool names. ExcludedTools []string `json:"excludedTools,omitzero"` // ExP assignment ('flight') data injected by an SDK integrator, in the same JSON shape the @@ -7285,8 +7344,6 @@ type SessionOpenOptions struct { RemoteExporting *bool `json:"remoteExporting,omitempty"` // Whether this session supports remote steering. RemoteSteerable *bool `json:"remoteSteerable,omitempty"` - // Initial response limits for the session. - ResponseLimits *ResponseLimitsConfig `json:"responseLimits,omitempty"` // Whether the host is an interactive UI. RunningInInteractiveMode *bool `json:"runningInInteractiveMode,omitempty"` // Resolved sandbox configuration. @@ -7295,6 +7352,8 @@ type SessionOpenOptions struct { SessionCapabilities []SessionCapability `json:"sessionCapabilities,omitzero"` // Optional stable session identifier to use for a new session. SessionID *string `json:"sessionId,omitempty"` + // Initial session limits. + SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"` // Shell init profile. ShellInitProfile *string `json:"shellInitProfile,omitempty"` // Per-shell process flags. @@ -8076,6 +8135,10 @@ type SessionUpdateOptionsParams struct { // Override directory for the session-events log. When unset, the runtime's default events // log directory is used. EventsLogDirectory *string `json:"eventsLogDirectory,omitempty"` + // Built-in subagent names to exclude from this session. Excluded built-ins are hidden from + // agent discovery and cannot be dispatched unless a custom agent with the same name is + // available. + ExcludedBuiltinAgents []string `json:"excludedBuiltinAgents,omitzero"` // Denylist of tool names for this session. ExcludedTools []string `json:"excludedTools,omitzero"` // Map of feature-flag IDs to their boolean enabled state. @@ -8112,8 +8175,6 @@ type SessionUpdateOptionsParams struct { ReasoningEffort *string `json:"reasoningEffort,omitempty"` // Reasoning summary mode for supported model clients. ReasoningSummary *OptionsUpdateReasoningSummary `json:"reasoningSummary,omitempty"` - // Optional response limits. Pass null to clear the response limits. - ResponseLimits *ResponseLimitsConfig `json:"responseLimits,omitempty"` // Whether the session is running in an interactive UI. RunningInInteractiveMode *bool `json:"runningInInteractiveMode,omitempty"` // Resolved sandbox configuration. @@ -8122,6 +8183,8 @@ type SessionUpdateOptionsParams struct { // capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the // field to leave the existing capability set unchanged. SessionCapabilities []SessionCapability `json:"sessionCapabilities,omitzero"` + // Optional session limits. Pass null to clear the session limits. + SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"` // Shell init profile (`None` or `NonInteractive`). ShellInitProfile *string `json:"shellInitProfile,omitempty"` // Per-shell process flags (e.g., `pwsh` arguments). @@ -9321,6 +9384,17 @@ type UIHandlePendingSamplingRequest struct { type UIHandlePendingSamplingResponse struct { } +// Request ID of a pending `session_limits_exhausted.requested` event and the user's +// selected limit action. +// Experimental: UIHandlePendingSessionLimitsExhaustedRequest is part of an experimental API +// and may change or be removed. +type UIHandlePendingSessionLimitsExhaustedRequest struct { + // The unique request ID from the session_limits_exhausted.requested event + RequestID string `json:"requestId"` + // The selected session-limit action. + Response UISessionLimitsExhaustedResponse `json:"response"` +} + // Request ID of a pending `user_input.requested` event and the user's response. // Experimental: UIHandlePendingUserInputRequest is part of an experimental API and may // change or be removed. @@ -9345,6 +9419,18 @@ type UIRegisterDirectAutoModeSwitchHandlerResult struct { Handle string `json:"handle"` } +// The user's selected action for an exhausted session limit. +// Experimental: UISessionLimitsExhaustedResponse is part of an experimental API and may +// change or be removed. +type UISessionLimitsExhaustedResponse struct { + // Action selected by the user. + Action UISessionLimitsExhaustedResponseAction `json:"action"` + // AI Credits to add to the current max when action is 'add'. + AdditionalAiCredits *float64 `json:"additionalAiCredits,omitempty"` + // New absolute max AI Credits when action is 'set'. + MaxAiCredits *float64 `json:"maxAiCredits,omitempty"` +} + // Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release. // Experimental: UIUnregisterDirectAutoModeSwitchHandlerRequest is part of an experimental // API and may change or be removed. @@ -9916,6 +10002,21 @@ const ( AbortReasonUserInitiated AbortReason = "user_initiated" ) +// Resolved Anthropic adaptive-thinking capability for a model. +// Experimental: AdaptiveThinkingSupport is part of an experimental API and may change or be +// removed. +type AdaptiveThinkingSupport string + +const ( + // The model accepts adaptive thinking but also accepts thinking.type='enabled' + AdaptiveThinkingSupportOptional AdaptiveThinkingSupport = "optional" + // The model only accepts adaptive thinking and rejects thinking.type='enabled' with HTTP + // 400 (e.g. opus-4.7/4.8) + AdaptiveThinkingSupportRequired AdaptiveThinkingSupport = "required" + // The model does not accept thinking.type='adaptive' + AdaptiveThinkingSupportUnsupported AdaptiveThinkingSupport = "unsupported" +) + // Which tier this directory belongs to // Experimental: AgentDiscoveryPathScope is part of an experimental API and may change or be // removed. @@ -11705,6 +11806,22 @@ const ( UIExitPlanModeActionInteractive UIExitPlanModeAction = "interactive" ) +// User action selected for an exhausted session limit. +// Experimental: UISessionLimitsExhaustedResponseAction is part of an experimental API and +// may change or be removed. +type UISessionLimitsExhaustedResponseAction string + +const ( + // Increase the current max by an exact AI Credits amount. + UISessionLimitsExhaustedResponseActionAdd UISessionLimitsExhaustedResponseAction = "add" + // Leave the limit unchanged and cancel the blocked model request. + UISessionLimitsExhaustedResponseActionCancel UISessionLimitsExhaustedResponseAction = "cancel" + // Set a new absolute max AI Credits value. + UISessionLimitsExhaustedResponseActionSet UISessionLimitsExhaustedResponseAction = "set" + // Remove the current session limit. + UISessionLimitsExhaustedResponseActionUnset UISessionLimitsExhaustedResponseAction = "unset" +) + // Kind discriminator for UserToolSessionApproval. type UserToolSessionApprovalKind string @@ -13837,6 +13954,57 @@ func (a *CommandsAPI) RespondToQueuedCommand(ctx context.Context, params *Comman return &result, nil } +// Experimental: CompletionsAPI contains experimental APIs that may change or be removed. +type CompletionsAPI sessionAPI + +// GetTriggerCharacters gets the characters that should trigger host-driven completions for +// the session. Empty disables host-driven completions (e.g. local sessions, or a relay host +// that does not advertise them). +// +// RPC method: session.completions.getTriggerCharacters. +// +// Returns: Characters that, when typed in the composer, should trigger a +// `completions.request`. Empty when the session has no host-driven completions (e.g. local +// sessions, or a relay host that does not advertise `completionTriggerCharacters`). +func (a *CompletionsAPI) GetTriggerCharacters(ctx context.Context) (*CompletionsGetTriggerCharactersResult, error) { + req := map[string]any{"sessionId": a.sessionID} + raw, err := a.client.Request(ctx, "session.completions.getTriggerCharacters", req) + if err != nil { + return nil, err + } + var result CompletionsGetTriggerCharactersResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// Requests host-driven completion items for the current composer input. Returns an empty +// list when the host has no items or does not support completions. +// +// RPC method: session.completions.request. +// +// Parameters: Request host-driven completions for the current composer input. +// +// Returns: Host-driven completion items for the current composer input. Empty when the host +// returns no items or does not support completions. +func (a *CompletionsAPI) Request(ctx context.Context, params *CompletionsRequestRequest) (*CompletionsRequestResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["offset"] = params.Offset + req["text"] = params.Text + } + raw, err := a.client.Request(ctx, "session.completions.request", req) + if err != nil { + return nil, err + } + var result CompletionsRequestResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Experimental: EventLogAPI contains experimental APIs that may change or be removed. type EventLogAPI sessionAPI @@ -15288,6 +15456,9 @@ func (a *OptionsAPI) Update(ctx context.Context, params *SessionUpdateOptionsPar if params.EventsLogDirectory != nil { req["eventsLogDirectory"] = *params.EventsLogDirectory } + if params.ExcludedBuiltinAgents != nil { + req["excludedBuiltinAgents"] = params.ExcludedBuiltinAgents + } if params.ExcludedTools != nil { req["excludedTools"] = params.ExcludedTools } @@ -15333,9 +15504,6 @@ func (a *OptionsAPI) Update(ctx context.Context, params *SessionUpdateOptionsPar if params.ReasoningSummary != nil { req["reasoningSummary"] = *params.ReasoningSummary } - if params.ResponseLimits != nil { - req["responseLimits"] = *params.ResponseLimits - } if params.RunningInInteractiveMode != nil { req["runningInInteractiveMode"] = *params.RunningInInteractiveMode } @@ -15345,6 +15513,9 @@ func (a *OptionsAPI) Update(ctx context.Context, params *SessionUpdateOptionsPar if params.SessionCapabilities != nil { req["sessionCapabilities"] = params.SessionCapabilities } + if params.SessionLimits != nil { + req["sessionLimits"] = *params.SessionLimits + } if params.ShellInitProfile != nil { req["shellInitProfile"] = *params.ShellInitProfile } @@ -17136,6 +17307,32 @@ func (a *UIAPI) HandlePendingSampling(ctx context.Context, params *UIHandlePendi return &result, nil } +// HandlePendingSessionLimitsExhausted resolves a pending +// `session_limits_exhausted.requested` event with the user's selected limit action. +// +// RPC method: session.ui.handlePendingSessionLimitsExhausted. +// +// Parameters: Request ID of a pending `session_limits_exhausted.requested` event and the +// user's selected limit action. +// +// Returns: Indicates whether the pending UI request was resolved by this call. +func (a *UIAPI) HandlePendingSessionLimitsExhausted(ctx context.Context, params *UIHandlePendingSessionLimitsExhaustedRequest) (*UIHandlePendingResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["requestId"] = params.RequestID + req["response"] = params.Response + } + raw, err := a.client.Request(ctx, "session.ui.handlePendingSessionLimitsExhausted", req) + if err != nil { + return nil, err + } + var result UIHandlePendingResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // HandlePendingUserInput resolves a pending `user_input.requested` event with the user's // response. // @@ -17465,6 +17662,7 @@ type SessionRPC struct { Agent *AgentAPI Canvas *CanvasAPI Commands *CommandsAPI + Completions *CompletionsAPI EventLog *EventLogAPI Extensions *ExtensionsAPI Fleet *FleetAPI @@ -17677,6 +17875,7 @@ func NewSessionRPC(client *jsonrpc2.Client, sessionID string) *SessionRPC { r.Agent = (*AgentAPI)(&r.common) r.Canvas = (*CanvasAPI)(&r.common) r.Commands = (*CommandsAPI)(&r.common) + r.Completions = (*CompletionsAPI)(&r.common) r.EventLog = (*EventLogAPI)(&r.common) r.Extensions = (*ExtensionsAPI)(&r.common) r.Fleet = (*FleetAPI)(&r.common) diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go index 954b288459..aeccd99805 100644 --- a/go/rpc/zrpc_encoding.go +++ b/go/rpc/zrpc_encoding.go @@ -3247,6 +3247,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { EnableStreaming *bool `json:"enableStreaming,omitempty"` EnvValueMode *SessionOpenOptionsEnvValueMode `json:"envValueMode,omitempty"` EventsLogDirectory *string `json:"eventsLogDirectory,omitempty"` + ExcludedBuiltinAgents []string `json:"excludedBuiltinAgents,omitzero"` ExcludedTools []string `json:"excludedTools,omitzero"` ExpAssignments any `json:"expAssignments,omitempty"` FeatureFlags map[string]bool `json:"featureFlags,omitzero"` @@ -3268,11 +3269,11 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { RemoteDefaultedOn *bool `json:"remoteDefaultedOn,omitempty"` RemoteExporting *bool `json:"remoteExporting,omitempty"` RemoteSteerable *bool `json:"remoteSteerable,omitempty"` - ResponseLimits *ResponseLimitsConfig `json:"responseLimits,omitempty"` RunningInInteractiveMode *bool `json:"runningInInteractiveMode,omitempty"` SandboxConfig *SandboxConfig `json:"sandboxConfig,omitempty"` SessionCapabilities []SessionCapability `json:"sessionCapabilities,omitzero"` SessionID *string `json:"sessionId,omitempty"` + SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"` ShellInitProfile *string `json:"shellInitProfile,omitempty"` ShellProcessFlags []string `json:"shellProcessFlags,omitzero"` SkillDirectories []string `json:"skillDirectories,omitzero"` @@ -3315,6 +3316,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { r.EnableStreaming = raw.EnableStreaming r.EnvValueMode = raw.EnvValueMode r.EventsLogDirectory = raw.EventsLogDirectory + r.ExcludedBuiltinAgents = raw.ExcludedBuiltinAgents r.ExcludedTools = raw.ExcludedTools r.ExpAssignments = raw.ExpAssignments r.FeatureFlags = raw.FeatureFlags @@ -3336,11 +3338,11 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { r.RemoteDefaultedOn = raw.RemoteDefaultedOn r.RemoteExporting = raw.RemoteExporting r.RemoteSteerable = raw.RemoteSteerable - r.ResponseLimits = raw.ResponseLimits r.RunningInInteractiveMode = raw.RunningInInteractiveMode r.SandboxConfig = raw.SandboxConfig r.SessionCapabilities = raw.SessionCapabilities r.SessionID = raw.SessionID + r.SessionLimits = raw.SessionLimits r.ShellInitProfile = raw.ShellInitProfile r.ShellProcessFlags = raw.ShellProcessFlags r.SkillDirectories = raw.SkillDirectories diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index 2768730ac3..85c1bd4497 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -389,6 +389,18 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionLimitsExhaustedCompleted: + var d SessionLimitsExhaustedCompletedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeSessionLimitsExhaustedRequested: + var d SessionLimitsExhaustedRequestedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionMCPServersLoaded: var d SessionMCPServersLoadedData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -431,12 +443,6 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d - case SessionEventTypeSessionResponseLimitsChanged: - var d SessionResponseLimitsChangedData - if err := json.Unmarshal(raw.Data, &d); err != nil { - return err - } - e.Data = &d case SessionEventTypeSessionResume: var d SessionResumeData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -461,6 +467,12 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionSessionLimitsChanged: + var d SessionSessionLimitsChangedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionShutdown: var d SessionShutdownData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -515,6 +527,12 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionUsageCheckpoint: + var d SessionUsageCheckpointData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionUsageInfo: var d SessionUsageInfoData if err := json.Unmarshal(raw.Data, &d); err != nil { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 05b1846405..7d2a230a66 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -126,6 +126,8 @@ const ( SessionEventTypeSessionHandoff SessionEventType = "session.handoff" SessionEventTypeSessionIdle SessionEventType = "session.idle" SessionEventTypeSessionInfo SessionEventType = "session.info" + SessionEventTypeSessionLimitsExhaustedCompleted SessionEventType = "session_limits_exhausted.completed" + SessionEventTypeSessionLimitsExhaustedRequested SessionEventType = "session_limits_exhausted.requested" SessionEventTypeSessionMCPServersLoaded SessionEventType = "session.mcp_servers_loaded" SessionEventTypeSessionMCPServerStatusChanged SessionEventType = "session.mcp_server_status_changed" SessionEventTypeSessionModeChanged SessionEventType = "session.mode_changed" @@ -133,11 +135,11 @@ const ( SessionEventTypeSessionPermissionsChanged SessionEventType = "session.permissions_changed" SessionEventTypeSessionPlanChanged SessionEventType = "session.plan_changed" SessionEventTypeSessionRemoteSteerableChanged SessionEventType = "session.remote_steerable_changed" - SessionEventTypeSessionResponseLimitsChanged SessionEventType = "session.response_limits_changed" SessionEventTypeSessionResume SessionEventType = "session.resume" SessionEventTypeSessionScheduleCancelled SessionEventType = "session.schedule_cancelled" SessionEventTypeSessionScheduleCreated SessionEventType = "session.schedule_created" SessionEventTypeSessionScheduleRearmed SessionEventType = "session.schedule_rearmed" + SessionEventTypeSessionSessionLimitsChanged SessionEventType = "session.session_limits_changed" SessionEventTypeSessionShutdown SessionEventType = "session.shutdown" SessionEventTypeSessionSkillsLoaded SessionEventType = "session.skills_loaded" SessionEventTypeSessionSnapshotRewind SessionEventType = "session.snapshot_rewind" @@ -147,6 +149,7 @@ const ( SessionEventTypeSessionTodosChanged SessionEventType = "session.todos_changed" SessionEventTypeSessionToolsUpdated SessionEventType = "session.tools_updated" SessionEventTypeSessionTruncation SessionEventType = "session.truncation" + SessionEventTypeSessionUsageCheckpoint SessionEventType = "session.usage_checkpoint" SessionEventTypeSessionUsageInfo SessionEventType = "session.usage_info" SessionEventTypeSessionWarning SessionEventType = "session.warning" SessionEventTypeSessionWorkspaceFileChanged SessionEventType = "session.workspace_file_changed" @@ -227,6 +230,8 @@ type AssistantMessageData struct { ReasoningOpaque *string `json:"reasoningOpaque,omitempty"` // Readable reasoning text from the model's extended thinking ReasoningText *string `json:"reasoningText,omitempty"` + // OpenAI-compatible wire field the provider used for reasoning (e.g. reasoning_content/reasoning). Populated only when non-canonical, so the dialect round-trips across turns. + ReasoningWireField *string `json:"reasoningWireField,omitempty"` // GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs RequestID *string `json:"requestId,omitempty"` // Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping @@ -457,6 +462,20 @@ type SessionCanvasRemovedData struct { func (*SessionCanvasRemovedData) sessionEventData() {} func (*SessionCanvasRemovedData) Type() SessionEventType { return SessionEventTypeSessionCanvasRemoved } +// Durable session usage checkpoint for reconstructing aggregate accounting on resume +type SessionUsageCheckpointData struct { + // Session-wide accumulated nano-AI units cost at checkpoint time + TotalNanoAiu float64 `json:"totalNanoAiu"` + // Total number of premium API requests used at checkpoint time + // Internal: TotalPremiumRequests is part of the SDK's internal API surface and is not intended for external use. + TotalPremiumRequests *float64 `json:"totalPremiumRequests,omitempty"` +} + +func (*SessionUsageCheckpointData) sessionEventData() {} +func (*SessionUsageCheckpointData) Type() SessionEventType { + return SessionEventTypeSessionUsageCheckpoint +} + // Dynamic headers refresh request for a remote MCP server type MCPHeadersRefreshRequiredData struct { // Why dynamic headers are being requested. @@ -993,17 +1012,6 @@ type CommandExecuteData struct { func (*CommandExecuteData) sessionEventData() {} func (*CommandExecuteData) Type() SessionEventType { return SessionEventTypeCommandExecute } -// Response limits update details. Null clears the limits. -type SessionResponseLimitsChangedData struct { - // Current response limits for the session, or null when no limits are active - ResponseLimits *ResponseLimitsConfig `json:"responseLimits"` -} - -func (*SessionResponseLimitsChangedData) sessionEventData() {} -func (*SessionResponseLimitsChangedData) Type() SessionEventType { - return SessionEventTypeSessionResponseLimitsChanged -} - // SDK command registration change notification type CommandsChangedData struct { // Current list of registered SDK commands @@ -1305,12 +1313,12 @@ type SessionStartData struct { ReasoningSummary *ReasoningSummary `json:"reasoningSummary,omitempty"` // Whether this session supports remote steering via GitHub RemoteSteerable *bool `json:"remoteSteerable,omitempty"` - // Response limits configured at session creation time, if any - ResponseLimits *ResponseLimitsConfig `json:"responseLimits,omitempty"` // Model selected at session creation time, if any SelectedModel *string `json:"selectedModel,omitempty"` // Unique identifier for the session SessionID string `json:"sessionId"` + // Session limits configured at session creation time, if any + SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"` // ISO 8601 timestamp when the session was created StartTime time.Time `json:"startTime"` // Schema version number for the session event format @@ -1320,6 +1328,45 @@ type SessionStartData struct { func (*SessionStartData) sessionEventData() {} func (*SessionStartData) Type() SessionEventType { return SessionEventTypeSessionStart } +// Session limit exhaustion notification requiring user action. +type SessionLimitsExhaustedRequestedData struct { + // Configured max AI Credits for the current accounting window. + MaxAiCredits float64 `json:"maxAiCredits"` + // Unique identifier for this request; used to respond via session.ui.handlePendingSessionLimitsExhausted(). + RequestID string `json:"requestId"` + // AI Credits already consumed in the current accounting window. + UsedAiCredits float64 `json:"usedAiCredits"` +} + +func (*SessionLimitsExhaustedRequestedData) sessionEventData() {} +func (*SessionLimitsExhaustedRequestedData) Type() SessionEventType { + return SessionEventTypeSessionLimitsExhaustedRequested +} + +// Session limit exhaustion prompt completion notification. +type SessionLimitsExhaustedCompletedData struct { + // Request ID of the resolved request; clients should dismiss any UI for this request. + RequestID string `json:"requestId"` + // The user's selected session-limit action. + Response SessionLimitsExhaustedResponse `json:"response"` +} + +func (*SessionLimitsExhaustedCompletedData) sessionEventData() {} +func (*SessionLimitsExhaustedCompletedData) Type() SessionEventType { + return SessionEventTypeSessionLimitsExhaustedCompleted +} + +// Session limits update details. Null clears the limits. +type SessionSessionLimitsChangedData struct { + // Current session limits, or null when no limits are active + SessionLimits *SessionLimitsConfig `json:"sessionLimits"` +} + +func (*SessionSessionLimitsChangedData) sessionEventData() {} +func (*SessionSessionLimitsChangedData) Type() SessionEventType { + return SessionEventTypeSessionSessionLimitsChanged +} + // Session resume metadata including current context and event count type SessionResumeData struct { // Whether the session was already in use by another client at resume time @@ -1340,12 +1387,12 @@ type SessionResumeData struct { ReasoningSummary *ReasoningSummary `json:"reasoningSummary,omitempty"` // Whether this session supports remote steering via GitHub RemoteSteerable *bool `json:"remoteSteerable,omitempty"` - // Response limits currently configured at resume time; null when no limits are active - ResponseLimits *ResponseLimitsConfig `json:"responseLimits,omitempty"` // ISO 8601 timestamp when the session was resumed ResumeTime time.Time `json:"resumeTime"` // Model currently selected at resume time SelectedModel *string `json:"selectedModel,omitempty"` + // Session limits currently configured at resume time; null when no limits are active + SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"` // True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. SessionWasActive *bool `json:"sessionWasActive,omitempty"` } @@ -2602,6 +2649,10 @@ type PermissionRequestRead struct { Intention string `json:"intention"` // Path of the file or directory being read Path string `json:"path"` + // True when the model has requested to run this search outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the search runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + RequestSandboxBypass *bool `json:"requestSandboxBypass,omitempty"` + // Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + RequestSandboxBypassReason *string `json:"requestSandboxBypassReason,omitempty"` // Tool call ID that triggered this permission request ToolCallID *string `json:"toolCallId,omitempty"` } @@ -2895,6 +2946,16 @@ func (r PersistedBinaryImage) Type() PersistedBinaryResultType { return PersistedBinaryResultType(r.Discriminator) } +// The user's selected action for an exhausted session limit. +type SessionLimitsExhaustedResponse struct { + // Action selected by the user. + Action SessionLimitsExhaustedResponseAction `json:"action"` + // AI Credits to add to the current max when action is 'add'. + AdditionalAiCredits *float64 `json:"additionalAiCredits,omitempty"` + // New absolute max AI Credits when action is 'set'. + MaxAiCredits *float64 `json:"maxAiCredits,omitempty"` +} + // Aggregate code change metrics for the session type ShutdownCodeChanges struct { // List of file paths that were modified during the session @@ -3799,6 +3860,20 @@ const ( PlanChangedOperationUpdate PlanChangedOperation = "update" ) +// User action selected for an exhausted session limit. +type SessionLimitsExhaustedResponseAction string + +const ( + // Increase the current max by an exact AI Credits amount. + SessionLimitsExhaustedResponseActionAdd SessionLimitsExhaustedResponseAction = "add" + // Leave the limit unchanged and cancel the blocked model request. + SessionLimitsExhaustedResponseActionCancel SessionLimitsExhaustedResponseAction = "cancel" + // Set a new absolute max AI Credits value. + SessionLimitsExhaustedResponseActionSet SessionLimitsExhaustedResponseAction = "set" + // Remove the current session limit. + SessionLimitsExhaustedResponseActionUnset SessionLimitsExhaustedResponseAction = "unset" +) + // What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent) type SkillInvokedTrigger string diff --git a/go/zsession_events.go b/go/zsession_events.go index 86aeab5bab..8d11d4da54 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -192,7 +192,6 @@ type ( RawSystemNotification = rpc.RawSystemNotification RawToolExecutionCompleteContent = rpc.RawToolExecutionCompleteContent ReasoningSummary = rpc.ReasoningSummary - ResponseLimitsConfig = rpc.ResponseLimitsConfig SamplingCompletedData = rpc.SamplingCompletedData SamplingRequestedData = rpc.SamplingRequestedData SessionAutopilotObjectiveChangedData = rpc.SessionAutopilotObjectiveChangedData @@ -218,6 +217,11 @@ type ( SessionHandoffData = rpc.SessionHandoffData SessionIdleData = rpc.SessionIdleData SessionInfoData = rpc.SessionInfoData + SessionLimitsConfig = rpc.SessionLimitsConfig + SessionLimitsExhaustedCompletedData = rpc.SessionLimitsExhaustedCompletedData + SessionLimitsExhaustedRequestedData = rpc.SessionLimitsExhaustedRequestedData + SessionLimitsExhaustedResponse = rpc.SessionLimitsExhaustedResponse + SessionLimitsExhaustedResponseAction = rpc.SessionLimitsExhaustedResponseAction SessionMCPServersLoadedData = rpc.SessionMCPServersLoadedData SessionMCPServerStatusChangedData = rpc.SessionMCPServerStatusChangedData SessionMode = rpc.SessionMode @@ -226,11 +230,11 @@ type ( SessionPermissionsChangedData = rpc.SessionPermissionsChangedData SessionPlanChangedData = rpc.SessionPlanChangedData SessionRemoteSteerableChangedData = rpc.SessionRemoteSteerableChangedData - SessionResponseLimitsChangedData = rpc.SessionResponseLimitsChangedData SessionResumeData = rpc.SessionResumeData SessionScheduleCancelledData = rpc.SessionScheduleCancelledData SessionScheduleCreatedData = rpc.SessionScheduleCreatedData SessionScheduleRearmedData = rpc.SessionScheduleRearmedData + SessionSessionLimitsChangedData = rpc.SessionSessionLimitsChangedData SessionShutdownData = rpc.SessionShutdownData SessionSkillsLoadedData = rpc.SessionSkillsLoadedData SessionSnapshotRewindData = rpc.SessionSnapshotRewindData @@ -240,6 +244,7 @@ type ( SessionTodosChangedData = rpc.SessionTodosChangedData SessionToolsUpdatedData = rpc.SessionToolsUpdatedData SessionTruncationData = rpc.SessionTruncationData + SessionUsageCheckpointData = rpc.SessionUsageCheckpointData SessionUsageInfoData = rpc.SessionUsageInfoData SessionWarningData = rpc.SessionWarningData SessionWorkspaceFileChangedData = rpc.SessionWorkspaceFileChangedData @@ -542,6 +547,8 @@ const ( SessionEventTypeSessionHandoff = rpc.SessionEventTypeSessionHandoff SessionEventTypeSessionIdle = rpc.SessionEventTypeSessionIdle SessionEventTypeSessionInfo = rpc.SessionEventTypeSessionInfo + SessionEventTypeSessionLimitsExhaustedCompleted = rpc.SessionEventTypeSessionLimitsExhaustedCompleted + SessionEventTypeSessionLimitsExhaustedRequested = rpc.SessionEventTypeSessionLimitsExhaustedRequested SessionEventTypeSessionMCPServersLoaded = rpc.SessionEventTypeSessionMCPServersLoaded SessionEventTypeSessionMCPServerStatusChanged = rpc.SessionEventTypeSessionMCPServerStatusChanged SessionEventTypeSessionModeChanged = rpc.SessionEventTypeSessionModeChanged @@ -549,11 +556,11 @@ const ( SessionEventTypeSessionPermissionsChanged = rpc.SessionEventTypeSessionPermissionsChanged SessionEventTypeSessionPlanChanged = rpc.SessionEventTypeSessionPlanChanged SessionEventTypeSessionRemoteSteerableChanged = rpc.SessionEventTypeSessionRemoteSteerableChanged - SessionEventTypeSessionResponseLimitsChanged = rpc.SessionEventTypeSessionResponseLimitsChanged SessionEventTypeSessionResume = rpc.SessionEventTypeSessionResume SessionEventTypeSessionScheduleCancelled = rpc.SessionEventTypeSessionScheduleCancelled SessionEventTypeSessionScheduleCreated = rpc.SessionEventTypeSessionScheduleCreated SessionEventTypeSessionScheduleRearmed = rpc.SessionEventTypeSessionScheduleRearmed + SessionEventTypeSessionSessionLimitsChanged = rpc.SessionEventTypeSessionSessionLimitsChanged SessionEventTypeSessionShutdown = rpc.SessionEventTypeSessionShutdown SessionEventTypeSessionSkillsLoaded = rpc.SessionEventTypeSessionSkillsLoaded SessionEventTypeSessionSnapshotRewind = rpc.SessionEventTypeSessionSnapshotRewind @@ -563,6 +570,7 @@ const ( SessionEventTypeSessionTodosChanged = rpc.SessionEventTypeSessionTodosChanged SessionEventTypeSessionToolsUpdated = rpc.SessionEventTypeSessionToolsUpdated SessionEventTypeSessionTruncation = rpc.SessionEventTypeSessionTruncation + SessionEventTypeSessionUsageCheckpoint = rpc.SessionEventTypeSessionUsageCheckpoint SessionEventTypeSessionUsageInfo = rpc.SessionEventTypeSessionUsageInfo SessionEventTypeSessionWarning = rpc.SessionEventTypeSessionWarning SessionEventTypeSessionWorkspaceFileChanged = rpc.SessionEventTypeSessionWorkspaceFileChanged @@ -582,6 +590,10 @@ const ( SessionEventTypeUserInputCompleted = rpc.SessionEventTypeUserInputCompleted SessionEventTypeUserInputRequested = rpc.SessionEventTypeUserInputRequested SessionEventTypeUserMessage = rpc.SessionEventTypeUserMessage + SessionLimitsExhaustedResponseActionAdd = rpc.SessionLimitsExhaustedResponseActionAdd + SessionLimitsExhaustedResponseActionCancel = rpc.SessionLimitsExhaustedResponseActionCancel + SessionLimitsExhaustedResponseActionSet = rpc.SessionLimitsExhaustedResponseActionSet + SessionLimitsExhaustedResponseActionUnset = rpc.SessionLimitsExhaustedResponseActionUnset SessionModeAutopilot = rpc.SessionModeAutopilot SessionModeInteractive = rpc.SessionModeInteractive SessionModePlan = rpc.SessionModePlan diff --git a/java/pom.xml b/java/pom.xml index 8163a1cd9c..d5f3fa54b7 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -86,7 +86,7 @@ DO NOT EDIT MANUALLY. Updated by the update-copilot-dependency workflow. --> - ^1.0.66-2 + ^1.0.66 diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index a604992bbb..20e659152d 100644 --- a/java/scripts/codegen/package-lock.json +++ b/java/scripts/codegen/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "copilot-sdk-java-codegen", "dependencies": { - "@github/copilot": "^1.0.66-2", + "@github/copilot": "^1.0.66", "json-schema": "^0.4.0", "tsx": "^4.22.4" } @@ -428,9 +428,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.66-2.tgz", - "integrity": "sha512-nAhhtfjpryklyombieuu18NK2g+BmEk4/8qvXVj8k+w/63tiVpLxFh865Vf6NQiVh/S7hbjMghTbrptsspYg2w==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.66.tgz", + "integrity": "sha512-m3+3FLSgum90xN4+eiwnLvdrDvM+oZzur5DfhOH88duNDKBcLQvKQY9fG/I1l1t8a1iBwjpgtRpsBwykE8k3Zw==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -439,20 +439,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.66-2", - "@github/copilot-darwin-x64": "1.0.66-2", - "@github/copilot-linux-arm64": "1.0.66-2", - "@github/copilot-linux-x64": "1.0.66-2", - "@github/copilot-linuxmusl-arm64": "1.0.66-2", - "@github/copilot-linuxmusl-x64": "1.0.66-2", - "@github/copilot-win32-arm64": "1.0.66-2", - "@github/copilot-win32-x64": "1.0.66-2" + "@github/copilot-darwin-arm64": "1.0.66", + "@github/copilot-darwin-x64": "1.0.66", + "@github/copilot-linux-arm64": "1.0.66", + "@github/copilot-linux-x64": "1.0.66", + "@github/copilot-linuxmusl-arm64": "1.0.66", + "@github/copilot-linuxmusl-x64": "1.0.66", + "@github/copilot-win32-arm64": "1.0.66", + "@github/copilot-win32-x64": "1.0.66" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.66-2.tgz", - "integrity": "sha512-gjLRtAQOdFQUOTm7nYi+zufkGxMlQlTzUyncQ3W4u1+WdGQbx5fWqMg/yd+j1yMN9PEETyF/ZHZqAaFWkEpQww==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.66.tgz", + "integrity": "sha512-cJPXE2rWSjR+B8GRBUUd0k9PM4euWRUe3xgHoJqi9o/jJjtRYn6DZMrmFt9xgjoYWf0WZOyrlDgedqO1V+zDAg==", "cpu": [ "arm64" ], @@ -466,9 +466,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.66-2.tgz", - "integrity": "sha512-wWWBsVwJtRTXqCK8lVpzwbJd3Tm1F23avf942K+PmsGYiZZYNcS5pt4umQRRj0sHKgO/muuA4eg/tMfGNi5fgA==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.66.tgz", + "integrity": "sha512-44mpx2ZcRFHDx4B9xlrL5OQyTgaD/Hn+bAkeStXgcG8UkkfYSsRtLhnaxqUEQrtIEiVQrw++XWvUO0AscRrX+w==", "cpu": [ "x64" ], @@ -482,9 +482,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.66-2.tgz", - "integrity": "sha512-j0hjx77JNFR3ZS8z3flY2j5SfGZMfKigYVFpDlTJM8FhfkMCUJ5IUhsZwSTimhHlxrsXuI31S6g0WsZLmBUe6A==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.66.tgz", + "integrity": "sha512-uXtTs/rYjk6kacNs/T0s/lxn0JBvAgu78pBoZeWpU5APhICkPy9kC+lNAzLYoZujVVDOHT05IoeifHppFpQ8+w==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.66-2.tgz", - "integrity": "sha512-vWaNbh4WdwkiI40Thcfbwi8tZFKo06r+Dm9Zfb8uY4wAz3X5PaGeSq+8XrNoV3uaRWltI0ncSIrq5tSOyDtRPg==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.66.tgz", + "integrity": "sha512-tXn3OuJCx/YEDNgYg8mdOGSFiIjmLJtTEyZ/VoEA86ffUIPxrunc0wnapEFk2zOW1unwdJeBuVIkzlB3RS1/eA==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.66-2.tgz", - "integrity": "sha512-LbWy5NlWasBeV/i+Xol+8dW7kbAQr6MF46apbseRNHYkhwyF/417WtLfirP8O2hPuqyU72q/HAQziFXkz14pIQ==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.66.tgz", + "integrity": "sha512-sHRag7W5CG0kbbX3j9v9cUmIafk/0N8MGGr2knvPeIHtxwZQYYjx397gT1nN6xagLWt5mvchkYybfQFCyCBaxg==", "cpu": [ "arm64" ], @@ -530,9 +530,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.66-2.tgz", - "integrity": "sha512-djOu52fGIU7eUhQdUS0K5xB2eFdi8LTTbxvphHWlrN1AD1BdZ+VX9Pk2avt6yCfW+Hh0loh2pNsCbTfNyxvULA==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.66.tgz", + "integrity": "sha512-bdIgHOaVZlvsF/4awzMxsby6T+4k7aWe9HZr+sr+qU8tuG19jwi/1LXGB6tKdlFeFgY78yX0lR+ywByVJc5loA==", "cpu": [ "x64" ], @@ -546,9 +546,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.66-2.tgz", - "integrity": "sha512-YQu01atiwoz8XfrHKqvI1xNjnc2IIIxgJDkQ6PxwrWPZ4IO320izwlXbW2ZaOz9yDgjWNis6EJ4Ryz8K+mM6kg==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.66.tgz", + "integrity": "sha512-T7FGONCVWIPjjAxp22cu4WKqNogq56FknHGAvj7Ryn5ZoanFAR3vXXlXDsYnDKLBcshjRYGxocl2UnmRTMxgvg==", "cpu": [ "arm64" ], @@ -562,9 +562,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.66-2.tgz", - "integrity": "sha512-4/kTs+lKc67f7KEAQ+Gt3sEBFDSEGoUxJujddV/+fS8EAg9uF2g6e3NzS1I4+htyRM4Oq/Z6xfWjGUgQsi9rfw==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.66.tgz", + "integrity": "sha512-eroxRUSJZOJCk0luLyX6A1qqGIWs8p4w0EjZFhCzvdFvJ0abIovGyt3R/gN9DeyJM8Qs7ROPGvqevUlXh6DhCg==", "cpu": [ "x64" ], diff --git a/java/scripts/codegen/package.json b/java/scripts/codegen/package.json index a83a2d46c0..601f5cc179 100644 --- a/java/scripts/codegen/package.json +++ b/java/scripts/codegen/package.json @@ -7,7 +7,7 @@ "generate:java": "tsx java.ts" }, "dependencies": { - "@github/copilot": "^1.0.66-2", + "@github/copilot": "^1.0.66", "json-schema": "^0.4.0", "tsx": "^4.22.4" } diff --git a/java/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java b/java/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java index e4680a54ce..4fce0133e9 100644 --- a/java/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java @@ -47,6 +47,8 @@ public record AssistantMessageEventData( @JsonProperty("reasoningOpaque") String reasoningOpaque, /** Readable reasoning text from the model's extended thinking */ @JsonProperty("reasoningText") String reasoningText, + /** OpenAI-compatible wire field the provider used for reasoning (e.g. reasoning_content/reasoning). Populated only when non-canonical, so the dialect round-trips across turns. */ + @JsonProperty("reasoningWireField") String reasoningWireField, /** Encrypted reasoning content from OpenAI models. Session-bound and stripped on resume. */ @JsonProperty("encryptedContent") String encryptedContent, /** Generation phase for phased-output models (e.g., thinking vs. response phases) */ diff --git a/java/src/generated/java/com/github/copilot/generated/SessionEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionEvent.java index f648828327..7bf0660f6c 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionEvent.java @@ -39,7 +39,7 @@ @JsonSubTypes.Type(value = SessionWarningEvent.class, name = "session.warning"), @JsonSubTypes.Type(value = SessionModelChangeEvent.class, name = "session.model_change"), @JsonSubTypes.Type(value = SessionModeChangedEvent.class, name = "session.mode_changed"), - @JsonSubTypes.Type(value = SessionResponseLimitsChangedEvent.class, name = "session.response_limits_changed"), + @JsonSubTypes.Type(value = SessionSessionLimitsChangedEvent.class, name = "session.session_limits_changed"), @JsonSubTypes.Type(value = SessionPermissionsChangedEvent.class, name = "session.permissions_changed"), @JsonSubTypes.Type(value = SessionPlanChangedEvent.class, name = "session.plan_changed"), @JsonSubTypes.Type(value = SessionTodosChangedEvent.class, name = "session.todos_changed"), @@ -48,6 +48,7 @@ @JsonSubTypes.Type(value = SessionTruncationEvent.class, name = "session.truncation"), @JsonSubTypes.Type(value = SessionSnapshotRewindEvent.class, name = "session.snapshot_rewind"), @JsonSubTypes.Type(value = SessionShutdownEvent.class, name = "session.shutdown"), + @JsonSubTypes.Type(value = SessionUsageCheckpointEvent.class, name = "session.usage_checkpoint"), @JsonSubTypes.Type(value = SessionContextChangedEvent.class, name = "session.context_changed"), @JsonSubTypes.Type(value = SessionUsageInfoEvent.class, name = "session.usage_info"), @JsonSubTypes.Type(value = SessionCompactionStartEvent.class, name = "session.compaction_start"), @@ -105,6 +106,8 @@ @JsonSubTypes.Type(value = CommandCompletedEvent.class, name = "command.completed"), @JsonSubTypes.Type(value = AutoModeSwitchRequestedEvent.class, name = "auto_mode_switch.requested"), @JsonSubTypes.Type(value = AutoModeSwitchCompletedEvent.class, name = "auto_mode_switch.completed"), + @JsonSubTypes.Type(value = SessionLimitsExhaustedRequestedEvent.class, name = "session_limits_exhausted.requested"), + @JsonSubTypes.Type(value = SessionLimitsExhaustedCompletedEvent.class, name = "session_limits_exhausted.completed"), @JsonSubTypes.Type(value = CommandsChangedEvent.class, name = "commands.changed"), @JsonSubTypes.Type(value = CapabilitiesChangedEvent.class, name = "capabilities.changed"), @JsonSubTypes.Type(value = ExitPlanModeRequestedEvent.class, name = "exit_plan_mode.requested"), @@ -141,7 +144,7 @@ public abstract sealed class SessionEvent permits SessionWarningEvent, SessionModelChangeEvent, SessionModeChangedEvent, - SessionResponseLimitsChangedEvent, + SessionSessionLimitsChangedEvent, SessionPermissionsChangedEvent, SessionPlanChangedEvent, SessionTodosChangedEvent, @@ -150,6 +153,7 @@ public abstract sealed class SessionEvent permits SessionTruncationEvent, SessionSnapshotRewindEvent, SessionShutdownEvent, + SessionUsageCheckpointEvent, SessionContextChangedEvent, SessionUsageInfoEvent, SessionCompactionStartEvent, @@ -207,6 +211,8 @@ public abstract sealed class SessionEvent permits CommandCompletedEvent, AutoModeSwitchRequestedEvent, AutoModeSwitchCompletedEvent, + SessionLimitsExhaustedRequestedEvent, + SessionLimitsExhaustedCompletedEvent, CommandsChangedEvent, CapabilitiesChangedEvent, ExitPlanModeRequestedEvent, diff --git a/java/src/generated/java/com/github/copilot/generated/ResponseLimitsConfig.java b/java/src/generated/java/com/github/copilot/generated/SessionLimitsConfig.java similarity index 84% rename from java/src/generated/java/com/github/copilot/generated/ResponseLimitsConfig.java rename to java/src/generated/java/com/github/copilot/generated/SessionLimitsConfig.java index 0b12b8ba47..e566d630b7 100644 --- a/java/src/generated/java/com/github/copilot/generated/ResponseLimitsConfig.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionLimitsConfig.java @@ -13,15 +13,15 @@ import javax.annotation.processing.Generated; /** - * Optional response limits. + * Optional session limits. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public record ResponseLimitsConfig( - /** Maximum AI Credits allowed while responding to one top-level user message. */ +public record SessionLimitsConfig( + /** Maximum AI Credits allowed across the session's current accounting window. */ @JsonProperty("maxAiCredits") Double maxAiCredits ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedCompletedEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedCompletedEvent.java new file mode 100644 index 0000000000..f23ae9a733 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedCompletedEvent.java @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session_limits_exhausted.completed". Session limit exhaustion prompt completion notification. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionLimitsExhaustedCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "session_limits_exhausted.completed"; } + + @JsonProperty("data") + private SessionLimitsExhaustedCompletedEventData data; + + public SessionLimitsExhaustedCompletedEventData getData() { return data; } + public void setData(SessionLimitsExhaustedCompletedEventData data) { this.data = data; } + + /** Data payload for {@link SessionLimitsExhaustedCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionLimitsExhaustedCompletedEventData( + /** Request ID of the resolved request; clients should dismiss any UI for this request. */ + @JsonProperty("requestId") String requestId, + /** The user's selected session-limit action. */ + @JsonProperty("response") SessionLimitsExhaustedResponse response + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedRequestedEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedRequestedEvent.java new file mode 100644 index 0000000000..3bde1f3347 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedRequestedEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session_limits_exhausted.requested". Session limit exhaustion notification requiring user action. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionLimitsExhaustedRequestedEvent extends SessionEvent { + + @Override + public String getType() { return "session_limits_exhausted.requested"; } + + @JsonProperty("data") + private SessionLimitsExhaustedRequestedEventData data; + + public SessionLimitsExhaustedRequestedEventData getData() { return data; } + public void setData(SessionLimitsExhaustedRequestedEventData data) { this.data = data; } + + /** Data payload for {@link SessionLimitsExhaustedRequestedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionLimitsExhaustedRequestedEventData( + /** Unique identifier for this request; used to respond via session.ui.handlePendingSessionLimitsExhausted(). */ + @JsonProperty("requestId") String requestId, + /** AI Credits already consumed in the current accounting window. */ + @JsonProperty("usedAiCredits") Double usedAiCredits, + /** Configured max AI Credits for the current accounting window. */ + @JsonProperty("maxAiCredits") Double maxAiCredits + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedResponse.java b/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedResponse.java new file mode 100644 index 0000000000..5bbc7ffef6 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedResponse.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * The user's selected action for an exhausted session limit. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionLimitsExhaustedResponse( + /** Action selected by the user. */ + @JsonProperty("action") SessionLimitsExhaustedResponseAction action, + /** AI Credits to add to the current max when action is 'add'. */ + @JsonProperty("additionalAiCredits") Double additionalAiCredits, + /** New absolute max AI Credits when action is 'set'. */ + @JsonProperty("maxAiCredits") Double maxAiCredits +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedResponseAction.java b/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedResponseAction.java new file mode 100644 index 0000000000..706d3bf9df --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/SessionLimitsExhaustedResponseAction.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * User action selected for an exhausted session limit. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SessionLimitsExhaustedResponseAction { + /** The {@code add} variant. */ + ADD("add"), + /** The {@code set} variant. */ + SET("set"), + /** The {@code unset} variant. */ + UNSET("unset"), + /** The {@code cancel} variant. */ + CANCEL("cancel"); + + private final String value; + SessionLimitsExhaustedResponseAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionLimitsExhaustedResponseAction fromValue(String value) { + for (SessionLimitsExhaustedResponseAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionLimitsExhaustedResponseAction value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java index a4282d16ee..b70e24ed34 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java @@ -49,8 +49,8 @@ public record SessionResumeEventData( @JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary, /** Context tier currently selected at resume time; null when no tier is active */ @JsonProperty("contextTier") ContextTier contextTier, - /** Response limits currently configured at resume time; null when no limits are active */ - @JsonProperty("responseLimits") ResponseLimitsConfig responseLimits, + /** Session limits currently configured at resume time; null when no limits are active */ + @JsonProperty("sessionLimits") SessionLimitsConfig sessionLimits, /** Updated working directory and git context at resume time */ @JsonProperty("context") WorkingDirectoryContext context, /** Whether the session was already in use by another client at resume time */ diff --git a/java/src/generated/java/com/github/copilot/generated/SessionResponseLimitsChangedEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionSessionLimitsChangedEvent.java similarity index 54% rename from java/src/generated/java/com/github/copilot/generated/SessionResponseLimitsChangedEvent.java rename to java/src/generated/java/com/github/copilot/generated/SessionSessionLimitsChangedEvent.java index 170e26d4be..1612aa74f0 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionResponseLimitsChangedEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionSessionLimitsChangedEvent.java @@ -13,29 +13,29 @@ import javax.annotation.processing.Generated; /** - * Session event "session.response_limits_changed". Response limits update details. Null clears the limits. + * Session event "session.session_limits_changed". Session limits update details. Null clears the limits. * @since 1.0.0 */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @javax.annotation.processing.Generated("copilot-sdk-codegen") -public final class SessionResponseLimitsChangedEvent extends SessionEvent { +public final class SessionSessionLimitsChangedEvent extends SessionEvent { @Override - public String getType() { return "session.response_limits_changed"; } + public String getType() { return "session.session_limits_changed"; } @JsonProperty("data") - private SessionResponseLimitsChangedEventData data; + private SessionSessionLimitsChangedEventData data; - public SessionResponseLimitsChangedEventData getData() { return data; } - public void setData(SessionResponseLimitsChangedEventData data) { this.data = data; } + public SessionSessionLimitsChangedEventData getData() { return data; } + public void setData(SessionSessionLimitsChangedEventData data) { this.data = data; } - /** Data payload for {@link SessionResponseLimitsChangedEvent}. */ + /** Data payload for {@link SessionSessionLimitsChangedEvent}. */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) - public record SessionResponseLimitsChangedEventData( - /** Current response limits for the session, or null when no limits are active */ - @JsonProperty("responseLimits") ResponseLimitsConfig responseLimits + public record SessionSessionLimitsChangedEventData( + /** Current session limits, or null when no limits are active */ + @JsonProperty("sessionLimits") SessionLimitsConfig sessionLimits ) { } } diff --git a/java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java index 4823fcff52..fcd1928874 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java @@ -53,8 +53,8 @@ public record SessionStartEventData( @JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary, /** Context tier selected at session creation time for models with tiered context pricing; null when no tier is selected (e.g., non-tiered model) */ @JsonProperty("contextTier") ContextTier contextTier, - /** Response limits configured at session creation time, if any */ - @JsonProperty("responseLimits") ResponseLimitsConfig responseLimits, + /** Session limits configured at session creation time, if any */ + @JsonProperty("sessionLimits") SessionLimitsConfig sessionLimits, /** Working directory and git context at session start */ @JsonProperty("context") WorkingDirectoryContext context, /** Whether the session was already in use by another client at start time */ diff --git a/java/src/generated/java/com/github/copilot/generated/SessionUsageCheckpointEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionUsageCheckpointEvent.java new file mode 100644 index 0000000000..312cb196b4 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/SessionUsageCheckpointEvent.java @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.usage_checkpoint". Durable session usage checkpoint for reconstructing aggregate accounting on resume + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionUsageCheckpointEvent extends SessionEvent { + + @Override + public String getType() { return "session.usage_checkpoint"; } + + @JsonProperty("data") + private SessionUsageCheckpointEventData data; + + public SessionUsageCheckpointEventData getData() { return data; } + public void setData(SessionUsageCheckpointEventData data) { this.data = data; } + + /** Data payload for {@link SessionUsageCheckpointEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionUsageCheckpointEventData( + /** Session-wide accumulated nano-AI units cost at checkpoint time */ + @JsonProperty("totalNanoAiu") Double totalNanoAiu, + /** Total number of premium API requests used at checkpoint time */ + @JsonProperty("totalPremiumRequests") Double totalPremiumRequests + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/AdaptiveThinkingSupport.java b/java/src/generated/java/com/github/copilot/generated/rpc/AdaptiveThinkingSupport.java new file mode 100644 index 0000000000..6ec806fb1a --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/AdaptiveThinkingSupport.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Resolved Anthropic adaptive-thinking capability for a model. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AdaptiveThinkingSupport { + /** The {@code unsupported} variant. */ + UNSUPPORTED("unsupported"), + /** The {@code optional} variant. */ + OPTIONAL("optional"), + /** The {@code required} variant. */ + REQUIRED("required"); + + private final String value; + AdaptiveThinkingSupport(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AdaptiveThinkingSupport fromValue(String value) { + for (AdaptiveThinkingSupport v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AdaptiveThinkingSupport value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideSupports.java b/java/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideSupports.java index ec1da750d8..d210460d73 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideSupports.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideSupports.java @@ -24,6 +24,8 @@ public record ModelCapabilitiesOverrideSupports( /** Whether this model supports vision/image input */ @JsonProperty("vision") Boolean vision, /** Whether this model supports reasoning effort configuration */ - @JsonProperty("reasoningEffort") Boolean reasoningEffort + @JsonProperty("reasoningEffort") Boolean reasoningEffort, + /** Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). */ + @JsonProperty("adaptive_thinking") AdaptiveThinkingSupport adaptiveThinking ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesSupports.java b/java/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesSupports.java index 91a98b423d..b66ba8aa7d 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesSupports.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesSupports.java @@ -24,6 +24,8 @@ public record ModelCapabilitiesSupports( /** Whether this model supports vision/image input */ @JsonProperty("vision") Boolean vision, /** Whether this model supports reasoning effort configuration */ - @JsonProperty("reasoningEffort") Boolean reasoningEffort + @JsonProperty("reasoningEffort") Boolean reasoningEffort, + /** Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). */ + @JsonProperty("adaptive_thinking") AdaptiveThinkingSupport adaptiveThinking ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionItem.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionItem.java new file mode 100644 index 0000000000..107e43d64e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionItem.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCompletionItem( + /** Text spliced into the composer when the item is accepted. */ + @JsonProperty("insertText") String insertText, + /** Start of the replacement range in `text`, in UTF-16 code units. */ + @JsonProperty("rangeStart") Long rangeStart, + /** End (exclusive) of the replacement range in `text`, in UTF-16 code units. */ + @JsonProperty("rangeEnd") Long rangeEnd, + /** Primary display label for the picker row. Falls back to `insertText` when absent. */ + @JsonProperty("label") String label, + /** Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the host's display kind. */ + @JsonProperty("kind") String kind +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsApi.java new file mode 100644 index 0000000000..6b9d8aa252 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsApi.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.github.copilot.CopilotExperimental; +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code completions} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCompletionsApi { + + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + + private final RpcCaller caller; + private final String sessionId; + + /** @param caller the RPC transport function */ + SessionCompletionsApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture getTriggerCharacters() { + return caller.invoke("session.completions.getTriggerCharacters", java.util.Map.of("sessionId", this.sessionId), SessionCompletionsGetTriggerCharactersResult.class); + } + + /** + * Request host-driven completions for the current composer input. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture request(SessionCompletionsRequestParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.completions.request", _p, SessionCompletionsRequestResult.class); + } + +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsGetTriggerCharactersParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsGetTriggerCharactersParams.java new file mode 100644 index 0000000000..6a40aa402e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsGetTriggerCharactersParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCompletionsGetTriggerCharactersParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsGetTriggerCharactersResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsGetTriggerCharactersResult.java new file mode 100644 index 0000000000..03c28665e6 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsGetTriggerCharactersResult.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCompletionsGetTriggerCharactersResult( + /** Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven completions for the session. */ + @JsonProperty("triggerCharacters") List triggerCharacters +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsRequestParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsRequestParams.java new file mode 100644 index 0000000000..02ccd7b12e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsRequestParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Request host-driven completions for the current composer input. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCompletionsRequestParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The full composed composer input. */ + @JsonProperty("text") String text, + /** Cursor offset within `text`, in UTF-16 code units. */ + @JsonProperty("offset") Long offset +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsRequestResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsRequestResult.java new file mode 100644 index 0000000000..ff450a8c9e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCompletionsRequestResult.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCompletionsRequestResult( + /** Completion items in host-ranked order. */ + @JsonProperty("items") List items +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogRegisterInterestParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogRegisterInterestParams.java index af0bca43ea..d6f522ed12 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogRegisterInterestParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogRegisterInterestParams.java @@ -26,7 +26,7 @@ public record SessionEventLogRegisterInterestParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, - /** The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. */ + /** The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. */ @JsonProperty("eventType") String eventType ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ResponseLimitsConfig.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitsConfig.java similarity index 84% rename from java/src/generated/java/com/github/copilot/generated/rpc/ResponseLimitsConfig.java rename to java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitsConfig.java index ddb6a68a38..10b625f8a8 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ResponseLimitsConfig.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitsConfig.java @@ -13,15 +13,15 @@ import javax.annotation.processing.Generated; /** - * Optional response limits. + * Optional session limits. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public record ResponseLimitsConfig( - /** Maximum AI Credits allowed while responding to one top-level user message. */ +public record SessionLimitsConfig( + /** Maximum AI Credits allowed across the session's current accounting window. */ @JsonProperty("maxAiCredits") Double maxAiCredits ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java index 774bcad981..6c29e07b6e 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java @@ -51,8 +51,8 @@ public record SessionMetadataSnapshotResult( @JsonProperty("currentMode") MetadataSnapshotCurrentMode currentMode, /** Currently selected model identifier, if any */ @JsonProperty("selectedModel") String selectedModel, - /** Current response limits for the session, or null when no limits are active */ - @JsonProperty("responseLimits") ResponseLimitsConfig responseLimits, + /** Current session limits, or null when no limits are active */ + @JsonProperty("sessionLimits") SessionLimitsConfig sessionLimits, /** Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags). */ @JsonProperty("workspace") SessionMetadataSnapshotResultWorkspace workspace ) { diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java index 930b6ec636..9cede57d35 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java @@ -56,6 +56,8 @@ public record SessionOptionsUpdateParams( @JsonProperty("availableTools") List availableTools, /** Denylist of tool names for this session. */ @JsonProperty("excludedTools") List excludedTools, + /** Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. */ + @JsonProperty("excludedBuiltinAgents") List excludedBuiltinAgents, /** Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set. */ @JsonProperty("toolFilterPrecedence") OptionsUpdateToolFilterPrecedence toolFilterPrecedence, /** Whether shell-script safety heuristics are enabled. */ @@ -130,7 +132,7 @@ public record SessionOptionsUpdateParams( @JsonProperty("enableSkills") Boolean enableSkills, /** Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier. */ @JsonProperty("contextTier") OptionsUpdateContextTier contextTier, - /** Optional response limits. Pass null to clear the response limits. */ - @JsonProperty("responseLimits") ResponseLimitsConfig responseLimits + /** Optional session limits. Pass null to clear the session limits. */ + @JsonProperty("sessionLimits") SessionLimitsConfig sessionLimits ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java index bcac24e699..3881140bb1 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java @@ -43,6 +43,8 @@ public final class SessionRpc { public final SessionPlanApi plan; /** API methods for the {@code workspaces} namespace. */ public final SessionWorkspacesApi workspaces; + /** API methods for the {@code completions} namespace. */ + public final SessionCompletionsApi completions; /** API methods for the {@code instructions} namespace. */ public final SessionInstructionsApi instructions; /** API methods for the {@code fleet} namespace. */ @@ -110,6 +112,7 @@ public SessionRpc(RpcCaller caller, String sessionId) { this.name = new SessionNameApi(caller, sessionId); this.plan = new SessionPlanApi(caller, sessionId); this.workspaces = new SessionWorkspacesApi(caller, sessionId); + this.completions = new SessionCompletionsApi(caller, sessionId); this.instructions = new SessionInstructionsApi(caller, sessionId); this.fleet = new SessionFleetApi(caller, sessionId); this.agent = new SessionAgentApi(caller, sessionId); diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionUiApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionUiApi.java index 63d90266ef..b3e16d7c27 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionUiApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionUiApi.java @@ -126,6 +126,22 @@ public CompletableFuture handlePendi return caller.invoke("session.ui.handlePendingAutoModeSwitch", _p, SessionUiHandlePendingAutoModeSwitchResult.class); } + /** + * Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture handlePendingSessionLimitsExhausted(SessionUiHandlePendingSessionLimitsExhaustedParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.ui.handlePendingSessionLimitsExhausted", _p, SessionUiHandlePendingSessionLimitsExhaustedResult.class); + } + /** * Request ID of a pending `exit_plan_mode.requested` event and the user's response. *

diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSessionLimitsExhaustedParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSessionLimitsExhaustedParams.java new file mode 100644 index 0000000000..93ff195373 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSessionLimitsExhaustedParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingSessionLimitsExhaustedParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The unique request ID from the session_limits_exhausted.requested event */ + @JsonProperty("requestId") String requestId, + /** The selected session-limit action. */ + @JsonProperty("response") UISessionLimitsExhaustedResponse response +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSessionLimitsExhaustedResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSessionLimitsExhaustedResult.java new file mode 100644 index 0000000000..79eeeebbf1 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSessionLimitsExhaustedResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Indicates whether the pending UI request was resolved by this call. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingSessionLimitsExhaustedResult( + /** True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending. */ + @JsonProperty("success") Boolean success +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/UISessionLimitsExhaustedResponse.java b/java/src/generated/java/com/github/copilot/generated/rpc/UISessionLimitsExhaustedResponse.java new file mode 100644 index 0000000000..53991d9d7f --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/UISessionLimitsExhaustedResponse.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * The user's selected action for an exhausted session limit. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record UISessionLimitsExhaustedResponse( + /** Action selected by the user. */ + @JsonProperty("action") UISessionLimitsExhaustedResponseAction action, + /** AI Credits to add to the current max when action is 'add'. */ + @JsonProperty("additionalAiCredits") Double additionalAiCredits, + /** New absolute max AI Credits when action is 'set'. */ + @JsonProperty("maxAiCredits") Double maxAiCredits +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/UISessionLimitsExhaustedResponseAction.java b/java/src/generated/java/com/github/copilot/generated/rpc/UISessionLimitsExhaustedResponseAction.java new file mode 100644 index 0000000000..6f4e48e6f3 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/UISessionLimitsExhaustedResponseAction.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * User action selected for an exhausted session limit. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum UISessionLimitsExhaustedResponseAction { + /** The {@code add} variant. */ + ADD("add"), + /** The {@code set} variant. */ + SET("set"), + /** The {@code unset} variant. */ + UNSET("unset"), + /** The {@code cancel} variant. */ + CANCEL("cancel"); + + private final String value; + UISessionLimitsExhaustedResponseAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static UISessionLimitsExhaustedResponseAction fromValue(String value) { + for (UISessionLimitsExhaustedResponseAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown UISessionLimitsExhaustedResponseAction value: " + value); + } +} diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 3d8adc8534..d902fbc1d2 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0-dev", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.66-2", + "@github/copilot": "^1.0.66", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, @@ -699,9 +699,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.66-2.tgz", - "integrity": "sha512-nAhhtfjpryklyombieuu18NK2g+BmEk4/8qvXVj8k+w/63tiVpLxFh865Vf6NQiVh/S7hbjMghTbrptsspYg2w==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.66.tgz", + "integrity": "sha512-m3+3FLSgum90xN4+eiwnLvdrDvM+oZzur5DfhOH88duNDKBcLQvKQY9fG/I1l1t8a1iBwjpgtRpsBwykE8k3Zw==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -710,20 +710,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.66-2", - "@github/copilot-darwin-x64": "1.0.66-2", - "@github/copilot-linux-arm64": "1.0.66-2", - "@github/copilot-linux-x64": "1.0.66-2", - "@github/copilot-linuxmusl-arm64": "1.0.66-2", - "@github/copilot-linuxmusl-x64": "1.0.66-2", - "@github/copilot-win32-arm64": "1.0.66-2", - "@github/copilot-win32-x64": "1.0.66-2" + "@github/copilot-darwin-arm64": "1.0.66", + "@github/copilot-darwin-x64": "1.0.66", + "@github/copilot-linux-arm64": "1.0.66", + "@github/copilot-linux-x64": "1.0.66", + "@github/copilot-linuxmusl-arm64": "1.0.66", + "@github/copilot-linuxmusl-x64": "1.0.66", + "@github/copilot-win32-arm64": "1.0.66", + "@github/copilot-win32-x64": "1.0.66" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.66-2.tgz", - "integrity": "sha512-gjLRtAQOdFQUOTm7nYi+zufkGxMlQlTzUyncQ3W4u1+WdGQbx5fWqMg/yd+j1yMN9PEETyF/ZHZqAaFWkEpQww==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.66.tgz", + "integrity": "sha512-cJPXE2rWSjR+B8GRBUUd0k9PM4euWRUe3xgHoJqi9o/jJjtRYn6DZMrmFt9xgjoYWf0WZOyrlDgedqO1V+zDAg==", "cpu": [ "arm64" ], @@ -737,9 +737,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.66-2.tgz", - "integrity": "sha512-wWWBsVwJtRTXqCK8lVpzwbJd3Tm1F23avf942K+PmsGYiZZYNcS5pt4umQRRj0sHKgO/muuA4eg/tMfGNi5fgA==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.66.tgz", + "integrity": "sha512-44mpx2ZcRFHDx4B9xlrL5OQyTgaD/Hn+bAkeStXgcG8UkkfYSsRtLhnaxqUEQrtIEiVQrw++XWvUO0AscRrX+w==", "cpu": [ "x64" ], @@ -753,9 +753,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.66-2.tgz", - "integrity": "sha512-j0hjx77JNFR3ZS8z3flY2j5SfGZMfKigYVFpDlTJM8FhfkMCUJ5IUhsZwSTimhHlxrsXuI31S6g0WsZLmBUe6A==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.66.tgz", + "integrity": "sha512-uXtTs/rYjk6kacNs/T0s/lxn0JBvAgu78pBoZeWpU5APhICkPy9kC+lNAzLYoZujVVDOHT05IoeifHppFpQ8+w==", "cpu": [ "arm64" ], @@ -769,9 +769,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.66-2.tgz", - "integrity": "sha512-vWaNbh4WdwkiI40Thcfbwi8tZFKo06r+Dm9Zfb8uY4wAz3X5PaGeSq+8XrNoV3uaRWltI0ncSIrq5tSOyDtRPg==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.66.tgz", + "integrity": "sha512-tXn3OuJCx/YEDNgYg8mdOGSFiIjmLJtTEyZ/VoEA86ffUIPxrunc0wnapEFk2zOW1unwdJeBuVIkzlB3RS1/eA==", "cpu": [ "x64" ], @@ -785,9 +785,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.66-2.tgz", - "integrity": "sha512-LbWy5NlWasBeV/i+Xol+8dW7kbAQr6MF46apbseRNHYkhwyF/417WtLfirP8O2hPuqyU72q/HAQziFXkz14pIQ==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.66.tgz", + "integrity": "sha512-sHRag7W5CG0kbbX3j9v9cUmIafk/0N8MGGr2knvPeIHtxwZQYYjx397gT1nN6xagLWt5mvchkYybfQFCyCBaxg==", "cpu": [ "arm64" ], @@ -801,9 +801,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.66-2.tgz", - "integrity": "sha512-djOu52fGIU7eUhQdUS0K5xB2eFdi8LTTbxvphHWlrN1AD1BdZ+VX9Pk2avt6yCfW+Hh0loh2pNsCbTfNyxvULA==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.66.tgz", + "integrity": "sha512-bdIgHOaVZlvsF/4awzMxsby6T+4k7aWe9HZr+sr+qU8tuG19jwi/1LXGB6tKdlFeFgY78yX0lR+ywByVJc5loA==", "cpu": [ "x64" ], @@ -817,9 +817,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.66-2.tgz", - "integrity": "sha512-YQu01atiwoz8XfrHKqvI1xNjnc2IIIxgJDkQ6PxwrWPZ4IO320izwlXbW2ZaOz9yDgjWNis6EJ4Ryz8K+mM6kg==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.66.tgz", + "integrity": "sha512-T7FGONCVWIPjjAxp22cu4WKqNogq56FknHGAvj7Ryn5ZoanFAR3vXXlXDsYnDKLBcshjRYGxocl2UnmRTMxgvg==", "cpu": [ "arm64" ], @@ -833,9 +833,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.66-2.tgz", - "integrity": "sha512-4/kTs+lKc67f7KEAQ+Gt3sEBFDSEGoUxJujddV/+fS8EAg9uF2g6e3NzS1I4+htyRM4Oq/Z6xfWjGUgQsi9rfw==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.66.tgz", + "integrity": "sha512-eroxRUSJZOJCk0luLyX6A1qqGIWs8p4w0EjZFhCzvdFvJ0abIovGyt3R/gN9DeyJM8Qs7ROPGvqevUlXh6DhCg==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index 6777caae15..928acf24e6 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -56,7 +56,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.66-2", + "@github/copilot": "^1.0.66", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/samples/package-lock.json b/nodejs/samples/package-lock.json index aeb70b1c5d..527e3bb8e8 100644 --- a/nodejs/samples/package-lock.json +++ b/nodejs/samples/package-lock.json @@ -18,7 +18,7 @@ "version": "0.0.0-dev", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.66-2", + "@github/copilot": "^1.0.66", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 65df346401..f3188d41d7 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -5,7 +5,7 @@ import type { MessageConnection } from "vscode-jsonrpc/node.js"; -import type { AbortReason, Attachment, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpServerSource, McpServerStatus, PermissionPromptRequest, PermissionRule, ReasoningSummary, ResponseLimitsConfig, SessionEvent, SessionMode, ShutdownType, SkillSource, UserToolSessionApproval } from "./session-events.js"; +import type { AbortReason, Attachment, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpServerSource, McpServerStatus, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, UserToolSessionApproval } from "./session-events.js"; /** * Initial authentication info for the session. @@ -22,6 +22,20 @@ export type AuthInfo = | UserAuthInfo | GhCliAuthInfo | ApiKeyAuthInfo; +/** + * Resolved Anthropic adaptive-thinking capability for a model. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "AdaptiveThinkingSupport". + */ +/** @experimental */ +export type AdaptiveThinkingSupport = + /** The model does not accept thinking.type='adaptive' */ + | "unsupported" + /** The model accepts adaptive thinking but also accepts thinking.type='enabled' */ + | "optional" + /** The model only accepts adaptive thinking and rejects thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8) */ + | "required"; /** * Which tier this directory belongs to * @@ -1839,6 +1853,22 @@ export type UIExitPlanModeAction = | "autopilot" /** Exit plan mode and continue in autopilot mode with parallel subagent execution. */ | "autopilot_fleet"; +/** + * User action selected for an exhausted session limit. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "UISessionLimitsExhaustedResponseAction". + */ +/** @experimental */ +export type UISessionLimitsExhaustedResponseAction = + /** Increase the current max by an exact AI Credits amount. */ + | "add" + /** Set a new absolute max AI Credits value. */ + | "set" + /** Remove the current session limit. */ + | "unset" + /** Leave the limit unchanged and cancel the blocked model request. */ + | "cancel"; /** * Type of change represented by this file diff. * @@ -3406,6 +3436,78 @@ export interface CommandsRespondToQueuedCommandResult { */ success: boolean; } +/** + * Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "CompletionsGetTriggerCharactersResult". + */ +/** @experimental */ +export interface CompletionsGetTriggerCharactersResult { + /** + * Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven completions for the session. + */ + triggerCharacters: string[]; +} +/** + * Request host-driven completions for the current composer input. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "CompletionsRequestRequest". + */ +/** @experimental */ +export interface CompletionsRequestRequest { + /** + * The full composed composer input. + */ + text: string; + /** + * Cursor offset within `text`, in UTF-16 code units. + */ + offset: number; +} +/** + * Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "CompletionsRequestResult". + */ +/** @experimental */ +export interface CompletionsRequestResult { + /** + * Completion items in host-ranked order. + */ + items: SessionCompletionItem[]; +} +/** + * A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "SessionCompletionItem". + */ +/** @experimental */ +export interface SessionCompletionItem { + /** + * Text spliced into the composer when the item is accepted. + */ + insertText: string; + /** + * Start of the replacement range in `text`, in UTF-16 code units. + */ + rangeStart?: number; + /** + * End (exclusive) of the replacement range in `text`, in UTF-16 code units. + */ + rangeEnd?: number; + /** + * Primary display label for the picker row. Falls back to `insertText` when absent. + */ + label?: string; + /** + * Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the host's display kind. + */ + kind?: string; +} /** * Params to attach or detach an in-process ExtensionController delegate. * @@ -6453,6 +6555,7 @@ export interface ModelCapabilitiesSupports { * Whether this model supports reasoning effort configuration */ reasoningEffort?: boolean; + adaptive_thinking?: AdaptiveThinkingSupport; } /** * Token limits for prompts, outputs, and context window @@ -6639,6 +6742,7 @@ export interface ModelCapabilitiesOverrideSupports { * Whether this model supports reasoning effort configuration */ reasoningEffort?: boolean; + adaptive_thinking?: AdaptiveThinkingSupport; } /** * Token limits for prompts, outputs, and context window @@ -9425,7 +9529,7 @@ export interface QueueRemoveMostRecentResult { /** @experimental */ export interface RegisterEventInterestParams { /** - * The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. + * The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. */ eventType: string; } @@ -10934,9 +11038,9 @@ export interface SessionMetadataSnapshot { */ selectedModel?: string; /** - * Current response limits for the session, or null when no limits are active + * Current session limits, or null when no limits are active */ - responseLimits: ResponseLimitsConfig | null; + sessionLimits: SessionLimitsConfig | null; /** * Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags). */ @@ -11068,6 +11172,10 @@ export interface SessionOpenOptions { * Denylist of tool names. */ excludedTools?: string[]; + /** + * Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. + */ + excludedBuiltinAgents?: string[]; /** * Whether shell-script safety heuristics are enabled. */ @@ -11157,7 +11265,7 @@ export interface SessionOpenOptions { */ maxInlineBinaryBytes?: number; modelCapabilitiesOverrides?: ModelCapabilitiesOverride; - responseLimits?: ResponseLimitsConfig; + sessionLimits?: SessionLimitsConfig; /** * Runtime context discriminator for agent filtering. */ @@ -12039,6 +12147,10 @@ export interface SessionUpdateOptionsParams { * Denylist of tool names for this session. */ excludedTools?: string[]; + /** + * Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. + */ + excludedBuiltinAgents?: string[]; toolFilterPrecedence?: OptionsUpdateToolFilterPrecedence; /** * Whether shell-script safety heuristics are enabled. @@ -12178,9 +12290,9 @@ export interface SessionUpdateOptionsParams { enableSkills?: boolean; contextTier?: OptionsUpdateContextTier; /** - * Optional response limits. Pass null to clear the response limits. + * Optional session limits. Pass null to clear the session limits. */ - responseLimits?: ResponseLimitsConfig | null; + sessionLimits?: SessionLimitsConfig | null; } /** * Indicates whether the session options patch was applied successfully. @@ -13683,6 +13795,38 @@ export interface UIHandlePendingSamplingRequest { export interface UIHandlePendingSamplingResponse { [k: string]: unknown | undefined; } +/** + * Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "UIHandlePendingSessionLimitsExhaustedRequest". + */ +/** @experimental */ +export interface UIHandlePendingSessionLimitsExhaustedRequest { + /** + * The unique request ID from the session_limits_exhausted.requested event + */ + requestId: string; + response: UISessionLimitsExhaustedResponse; +} +/** + * The user's selected action for an exhausted session limit. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "UISessionLimitsExhaustedResponse". + */ +/** @experimental */ +export interface UISessionLimitsExhaustedResponse { + action: UISessionLimitsExhaustedResponseAction; + /** + * AI Credits to add to the current max when action is 'add'. + */ + additionalAiCredits?: number; + /** + * New absolute max AI Credits when action is 'set'. + */ + maxAiCredits?: number; +} /** * Request ID of a pending `user_input.requested` event and the user's response. * @@ -15350,6 +15494,25 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin connection.sendRequest("session.workspaces.diff", { sessionId, ...params }), }, /** @experimental */ + completions: { + /** + * Gets the characters that should trigger host-driven completions for the session. Empty disables host-driven completions (e.g. local sessions, or a relay host that does not advertise them). + * + * @returns Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). + */ + getTriggerCharacters: async (): Promise => + connection.sendRequest("session.completions.getTriggerCharacters", { sessionId }), + /** + * Requests host-driven completion items for the current composer input. Returns an empty list when the host has no items or does not support completions. + * + * @param params Request host-driven completions for the current composer input. + * + * @returns Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. + */ + request: async (params: CompletionsRequestRequest): Promise => + connection.sendRequest("session.completions.request", { sessionId, ...params }), + }, + /** @experimental */ instructions: { /** * Gets instruction sources loaded for the session. @@ -15979,6 +16142,15 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ handlePendingAutoModeSwitch: async (params: UIHandlePendingAutoModeSwitchRequest): Promise => connection.sendRequest("session.ui.handlePendingAutoModeSwitch", { sessionId, ...params }), + /** + * Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action. + * + * @param params Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action. + * + * @returns Indicates whether the pending UI request was resolved by this call. + */ + handlePendingSessionLimitsExhausted: async (params: UIHandlePendingSessionLimitsExhaustedRequest): Promise => + connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", { sessionId, ...params }), /** * Resolves a pending `exit_plan_mode.requested` event with the user's response. * diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 68462f20b1..5d7eac82da 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -21,7 +21,7 @@ export type SessionEvent = | WarningEvent | ModelChangeEvent | ModeChangedEvent - | ResponseLimitsChangedEvent + | SessionLimitsChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent @@ -30,6 +30,7 @@ export type SessionEvent = | TruncationEvent | SnapshotRewindEvent | ShutdownEvent + | UsageCheckpointEvent | ContextChangedEvent | UsageInfoEvent | CompactionStartEvent @@ -87,6 +88,8 @@ export type SessionEvent = | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent + | SessionLimitsExhaustedRequestedEvent + | SessionLimitsExhaustedCompletedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent @@ -581,6 +584,18 @@ export type AutoModeSwitchResponse = | "yes_always" /** Do not switch models. */ | "no"; +/** + * User action selected for an exhausted session limit. + */ +export type SessionLimitsExhaustedResponseAction = + /** Increase the current max by an exact AI Credits amount. */ + | "add" + /** Set a new absolute max AI Credits value. */ + | "set" + /** Remove the current session limit. */ + | "unset" + /** Leave the limit unchanged and cancel the blocked model request. */ + | "cancel"; /** * Exit plan mode action */ @@ -740,7 +755,6 @@ export interface StartData { * Whether this session supports remote steering via GitHub */ remoteSteerable?: boolean; - responseLimits?: ResponseLimitsConfig; /** * Model selected at session creation time, if any */ @@ -749,6 +763,7 @@ export interface StartData { * Unique identifier for the session */ sessionId: string; + sessionLimits?: SessionLimitsConfig; /** * ISO 8601 timestamp when the session was created */ @@ -793,11 +808,11 @@ export interface WorkingDirectoryContext { repositoryHost?: string; } /** - * Optional response limits. + * Optional session limits. */ -export interface ResponseLimitsConfig { +export interface SessionLimitsConfig { /** - * Maximum AI Credits allowed while responding to one top-level user message. + * Maximum AI Credits allowed across the session's current accounting window. */ maxAiCredits?: number; } @@ -865,10 +880,6 @@ export interface ResumeData { * Whether this session supports remote steering via GitHub */ remoteSteerable?: boolean; - /** - * Response limits currently configured at resume time; null when no limits are active - */ - responseLimits?: ResponseLimitsConfig | null; /** * ISO 8601 timestamp when the session was resumed */ @@ -877,6 +888,10 @@ export interface ResumeData { * Model currently selected at resume time */ selectedModel?: string; + /** + * Session limits currently configured at resume time; null when no limits are active + */ + sessionLimits?: SessionLimitsConfig | null; /** * True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. */ @@ -1461,14 +1476,14 @@ export interface ModeChangedData { previousMode: SessionMode; } /** - * Session event "session.response_limits_changed". Response limits update details. Null clears the limits. + * Session event "session.session_limits_changed". Session limits update details. Null clears the limits. */ -export interface ResponseLimitsChangedEvent { +export interface SessionLimitsChangedEvent { /** * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. */ agentId?: string; - data: ResponseLimitsChangedData; + data: SessionLimitsChangedData; /** * When true, the event is transient and not persisted to the session event log on disk */ @@ -1486,18 +1501,18 @@ export interface ResponseLimitsChangedEvent { */ timestamp: string; /** - * Type discriminator. Always "session.response_limits_changed". + * Type discriminator. Always "session.session_limits_changed". */ - type: "session.response_limits_changed"; + type: "session.session_limits_changed"; } /** - * Response limits update details. Null clears the limits. + * Session limits update details. Null clears the limits. */ -export interface ResponseLimitsChangedData { +export interface SessionLimitsChangedData { /** - * Current response limits for the session, or null when no limits are active + * Current session limits, or null when no limits are active */ - responseLimits: ResponseLimitsConfig | null; + sessionLimits: SessionLimitsConfig | null; } /** * Session event "session.permissions_changed". Permissions change details carrying the aggregate allow-all boolean transition. @@ -2029,6 +2044,51 @@ export interface ShutdownTokenDetail { */ tokenCount: number; } +/** + * Session event "session.usage_checkpoint". Durable session usage checkpoint for reconstructing aggregate accounting on resume + */ +export interface UsageCheckpointEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: UsageCheckpointData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.usage_checkpoint". + */ + type: "session.usage_checkpoint"; +} +/** + * Durable session usage checkpoint for reconstructing aggregate accounting on resume + */ +export interface UsageCheckpointData { + /** + * Session-wide accumulated nano-AI units cost at checkpoint time + */ + totalNanoAiu: number; + /** + * Total number of premium API requests used at checkpoint time + * + * @internal + */ + totalPremiumRequests?: number; +} /** * Session event "session.context_changed". Updated working directory and git context after the change */ @@ -3227,6 +3287,10 @@ export interface AssistantMessageData { * Readable reasoning text from the model's extended thinking */ reasoningText?: string; + /** + * OpenAI-compatible wire field the provider used for reasoning (e.g. reasoning_content/reasoning). Populated only when non-canonical, so the dialect round-trips across turns. + */ + reasoningWireField?: string; /** * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs */ @@ -5729,6 +5793,14 @@ export interface PermissionRequestRead { * Path of the file or directory being read */ path: string; + /** + * True when the model has requested to run this search outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the search runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + */ + requestSandboxBypass?: boolean; + /** + * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + */ + requestSandboxBypassReason?: string; /** * Tool call ID that triggered this permission request */ @@ -7400,6 +7472,107 @@ export interface AutoModeSwitchCompletedData { requestId: string; response: AutoModeSwitchResponse; } +/** + * Session event "session_limits_exhausted.requested". Session limit exhaustion notification requiring user action. + */ +export interface SessionLimitsExhaustedRequestedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SessionLimitsExhaustedRequestedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session_limits_exhausted.requested". + */ + type: "session_limits_exhausted.requested"; +} +/** + * Session limit exhaustion notification requiring user action. + */ +export interface SessionLimitsExhaustedRequestedData { + /** + * Configured max AI Credits for the current accounting window. + */ + maxAiCredits: number; + /** + * Unique identifier for this request; used to respond via session.ui.handlePendingSessionLimitsExhausted(). + */ + requestId: string; + /** + * AI Credits already consumed in the current accounting window. + */ + usedAiCredits: number; +} +/** + * Session event "session_limits_exhausted.completed". Session limit exhaustion prompt completion notification. + */ +export interface SessionLimitsExhaustedCompletedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SessionLimitsExhaustedCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session_limits_exhausted.completed". + */ + type: "session_limits_exhausted.completed"; +} +/** + * Session limit exhaustion prompt completion notification. + */ +export interface SessionLimitsExhaustedCompletedData { + /** + * Request ID of the resolved request; clients should dismiss any UI for this request. + */ + requestId: string; + response: SessionLimitsExhaustedResponse; +} +/** + * The user's selected action for an exhausted session limit. + */ +export interface SessionLimitsExhaustedResponse { + action: SessionLimitsExhaustedResponseAction; + /** + * AI Credits to add to the current max when action is 'add'. + */ + additionalAiCredits?: number; + /** + * New absolute max AI Credits when action is 'set'. + */ + maxAiCredits?: number; +} /** * Session event "commands.changed". SDK command registration change notification */ diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 1d3a7b2467..ba9c4c3102 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -6,7 +6,7 @@ from typing import ClassVar, TYPE_CHECKING -from .session_events import AbortReason, Attachment, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpServerSource, McpServerStatus, PermissionPromptRequest, PermissionRule, ReasoningSummary, ResponseLimitsConfig, SessionEvent, SessionMode, ShutdownType, SkillSource, UserToolSessionApproval +from .session_events import AbortReason, Attachment, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpServerSource, McpServerStatus, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, UserToolSessionApproval if TYPE_CHECKING: from .._jsonrpc import JsonRpcClient @@ -380,6 +380,17 @@ def to_dict(self) -> dict: result["hasMoreUsers"] = from_bool(self.has_more_users) return result +# Experimental: this type is part of an experimental API and may change or be removed. +class AdaptiveThinkingSupport(Enum): + """Resolved Anthropic adaptive-thinking capability for a model. + + Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. + 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). + """ + OPTIONAL = "optional" + REQUIRED = "required" + UNSUPPORTED = "unsupported" + # Experimental: this type is part of an experimental API and may change or be removed. class AgentDiscoveryPathScope(Enum): """Which tier this directory belongs to""" @@ -1047,6 +1058,99 @@ def to_dict(self) -> dict: result["success"] = from_bool(self.success) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class CompletionsGetTriggerCharactersResult: + """Characters that, when typed in the composer, should trigger a `completions.request`. + Empty when the session has no host-driven completions (e.g. local sessions, or a relay + host that does not advertise `completionTriggerCharacters`). + """ + trigger_characters: list[str] + """Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven + completions for the session. + """ + + @staticmethod + def from_dict(obj: Any) -> 'CompletionsGetTriggerCharactersResult': + assert isinstance(obj, dict) + trigger_characters = from_list(from_str, obj.get("triggerCharacters")) + return CompletionsGetTriggerCharactersResult(trigger_characters) + + def to_dict(self) -> dict: + result: dict = {} + result["triggerCharacters"] = from_list(from_str, self.trigger_characters) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class CompletionsRequestRequest: + """Request host-driven completions for the current composer input.""" + + offset: int + """Cursor offset within `text`, in UTF-16 code units.""" + + text: str + """The full composed composer input.""" + + @staticmethod + def from_dict(obj: Any) -> 'CompletionsRequestRequest': + assert isinstance(obj, dict) + offset = from_int(obj.get("offset")) + text = from_str(obj.get("text")) + return CompletionsRequestRequest(offset, text) + + def to_dict(self) -> dict: + result: dict = {} + result["offset"] = from_int(self.offset) + result["text"] = from_str(self.text) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionCompletionItem: + """A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` + (UTF-16 code units) in the composer with `insertText`; when the range is absent, the + active token around the cursor is replaced. + """ + insert_text: str + """Text spliced into the composer when the item is accepted.""" + + kind: str | None = None + """Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the + host's display kind. + """ + label: str | None = None + """Primary display label for the picker row. Falls back to `insertText` when absent.""" + + range_end: int | None = None + """End (exclusive) of the replacement range in `text`, in UTF-16 code units.""" + + range_start: int | None = None + """Start of the replacement range in `text`, in UTF-16 code units.""" + + @staticmethod + def from_dict(obj: Any) -> 'SessionCompletionItem': + assert isinstance(obj, dict) + insert_text = from_str(obj.get("insertText")) + kind = from_union([from_str, from_none], obj.get("kind")) + label = from_union([from_str, from_none], obj.get("label")) + range_end = from_union([from_int, from_none], obj.get("rangeEnd")) + range_start = from_union([from_int, from_none], obj.get("rangeStart")) + return SessionCompletionItem(insert_text, kind, label, range_end, range_start) + + def to_dict(self) -> dict: + result: dict = {} + result["insertText"] = from_str(self.insert_text) + if self.kind is not None: + result["kind"] = from_union([from_str, from_none], self.kind) + if self.label is not None: + result["label"] = from_union([from_str, from_none], self.label) + if self.range_end is not None: + result["rangeEnd"] = from_union([from_int, from_none], self.range_end) + if self.range_start is not None: + result["rangeStart"] = from_union([from_int, from_none], self.range_start) + return result + # Experimental: this type is part of an experimental API and may change or be removed. # Internal: this type is an internal SDK API and is not part of the public surface. @dataclass @@ -3669,32 +3773,6 @@ def to_dict(self) -> dict: result["supported_media_types"] = from_list(from_str, self.supported_media_types) return result -# Experimental: this type is part of an experimental API and may change or be removed. -@dataclass -class ModelCapabilitiesSupports: - """Feature flags indicating what the model supports""" - - reasoning_effort: bool | None = None - """Whether this model supports reasoning effort configuration""" - - vision: bool | None = None - """Whether this model supports vision/image input""" - - @staticmethod - def from_dict(obj: Any) -> 'ModelCapabilitiesSupports': - assert isinstance(obj, dict) - reasoning_effort = from_union([from_bool, from_none], obj.get("reasoningEffort")) - vision = from_union([from_bool, from_none], obj.get("vision")) - return ModelCapabilitiesSupports(reasoning_effort, vision) - - def to_dict(self) -> dict: - result: dict = {} - if self.reasoning_effort is not None: - result["reasoningEffort"] = from_union([from_bool, from_none], self.reasoning_effort) - if self.vision is not None: - 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. class ModelPickerPriceCategory(Enum): """Relative cost tier for token-based billing users""" @@ -3744,32 +3822,6 @@ def to_dict(self) -> dict: result["supported_media_types"] = from_union([lambda x: from_list(from_str, x), from_none], self.supported_media_types) return result -# Experimental: this type is part of an experimental API and may change or be removed. -@dataclass -class ModelCapabilitiesOverrideSupports: - """Feature flags indicating what the model supports""" - - reasoning_effort: bool | None = None - """Whether this model supports reasoning effort configuration""" - - vision: bool | None = None - """Whether this model supports vision/image input""" - - @staticmethod - def from_dict(obj: Any) -> 'ModelCapabilitiesOverrideSupports': - assert isinstance(obj, dict) - reasoning_effort = from_union([from_bool, from_none], obj.get("reasoningEffort")) - vision = from_union([from_bool, from_none], obj.get("vision")) - return ModelCapabilitiesOverrideSupports(reasoning_effort, vision) - - def to_dict(self) -> dict: - result: dict = {} - if self.reasoning_effort is not None: - result["reasoningEffort"] = from_union([from_bool, from_none], self.reasoning_effort) - if self.vision is not None: - 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: @@ -5547,8 +5599,8 @@ class RegisterEventInterestParams: count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, - `user_input.requested`, `elicitation.requested`, `command.queued`, - `exit_plan_mode.requested`. + `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, + `command.queued`, `exit_plan_mode.requested`. """ @staticmethod @@ -8923,6 +8975,17 @@ def to_dict(self) -> dict: result["response"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.response) return result +# Experimental: this type is part of an experimental API and may change or be removed. +class UISessionLimitsExhaustedResponseAction(Enum): + """Action selected by the user. + + User action selected for an exhausted session limit. + """ + ADD = "add" + CANCEL = "cancel" + SET = "set" + UNSET = "unset" + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class UIUserInputResponse: @@ -9509,6 +9572,72 @@ def to_dict(self) -> dict: result["quotaSnapshots"] = from_dict(lambda x: to_class(AccountQuotaSnapshot, x), self.quota_snapshots) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ModelCapabilitiesSupports: + """Feature flags indicating what the model supports""" + + adaptive_thinking: AdaptiveThinkingSupport | None = None + """Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. + 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). + """ + reasoning_effort: bool | None = None + """Whether this model supports reasoning effort configuration""" + + vision: bool | None = None + """Whether this model supports vision/image input""" + + @staticmethod + def from_dict(obj: Any) -> 'ModelCapabilitiesSupports': + assert isinstance(obj, dict) + adaptive_thinking = from_union([AdaptiveThinkingSupport, from_none], obj.get("adaptive_thinking")) + reasoning_effort = from_union([from_bool, from_none], obj.get("reasoningEffort")) + vision = from_union([from_bool, from_none], obj.get("vision")) + return ModelCapabilitiesSupports(adaptive_thinking, reasoning_effort, vision) + + def to_dict(self) -> dict: + result: dict = {} + if self.adaptive_thinking is not None: + result["adaptive_thinking"] = from_union([lambda x: to_enum(AdaptiveThinkingSupport, x), from_none], self.adaptive_thinking) + if self.reasoning_effort is not None: + result["reasoningEffort"] = from_union([from_bool, from_none], self.reasoning_effort) + if self.vision is not None: + 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 ModelCapabilitiesOverrideSupports: + """Feature flags indicating what the model supports""" + + adaptive_thinking: AdaptiveThinkingSupport | None = None + """Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. + 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). + """ + reasoning_effort: bool | None = None + """Whether this model supports reasoning effort configuration""" + + vision: bool | None = None + """Whether this model supports vision/image input""" + + @staticmethod + def from_dict(obj: Any) -> 'ModelCapabilitiesOverrideSupports': + assert isinstance(obj, dict) + adaptive_thinking = from_union([AdaptiveThinkingSupport, from_none], obj.get("adaptive_thinking")) + reasoning_effort = from_union([from_bool, from_none], obj.get("reasoningEffort")) + vision = from_union([from_bool, from_none], obj.get("vision")) + return ModelCapabilitiesOverrideSupports(adaptive_thinking, reasoning_effort, vision) + + def to_dict(self) -> dict: + result: dict = {} + if self.adaptive_thinking is not None: + result["adaptive_thinking"] = from_union([lambda x: to_enum(AdaptiveThinkingSupport, x), from_none], self.adaptive_thinking) + if self.reasoning_effort is not None: + result["reasoningEffort"] = from_union([from_bool, from_none], self.reasoning_effort) + if self.vision is not None: + 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 AgentDiscoveryPath: @@ -9882,6 +10011,26 @@ def to_dict(self) -> dict: result["canvases"] = from_union([from_bool, from_none], self.canvases) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class CompletionsRequestResult: + """Host-driven completion items for the current composer input. Empty when the host returns + no items or does not support completions. + """ + items: list[SessionCompletionItem] + """Completion items in host-ranked order.""" + + @staticmethod + def from_dict(obj: Any) -> 'CompletionsRequestResult': + assert isinstance(obj, dict) + items = from_list(SessionCompletionItem.from_dict, obj.get("items")) + return CompletionsRequestResult(items) + + def to_dict(self) -> dict: + result: dict = {} + result["items"] = from_list(lambda x: to_class(SessionCompletionItem, x), self.items) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class CopilotUserResponseQuotaSnapshots: @@ -16296,6 +16445,39 @@ def to_dict(self) -> dict: result["selectedAction"] = from_union([lambda x: to_enum(UIExitPlanModeAction, x), from_none], self.selected_action) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class UISessionLimitsExhaustedResponse: + """The selected session-limit action. + + The user's selected action for an exhausted session limit. + """ + action: UISessionLimitsExhaustedResponseAction + """Action selected by the user.""" + + additional_ai_credits: float | None = None + """AI Credits to add to the current max when action is 'add'.""" + + max_ai_credits: float | None = None + """New absolute max AI Credits when action is 'set'.""" + + @staticmethod + def from_dict(obj: Any) -> 'UISessionLimitsExhaustedResponse': + assert isinstance(obj, dict) + action = UISessionLimitsExhaustedResponseAction(obj.get("action")) + additional_ai_credits = from_union([from_float, from_none], obj.get("additionalAiCredits")) + max_ai_credits = from_union([from_float, from_none], obj.get("maxAiCredits")) + return UISessionLimitsExhaustedResponse(action, additional_ai_credits, max_ai_credits) + + def to_dict(self) -> dict: + result: dict = {} + result["action"] = to_enum(UISessionLimitsExhaustedResponseAction, self.action) + if self.additional_ai_credits is not None: + result["additionalAiCredits"] = from_union([to_float, from_none], self.additional_ai_credits) + if self.max_ai_credits is not None: + result["maxAiCredits"] = from_union([to_float, from_none], self.max_ai_credits) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class UIHandlePendingUserInputRequest: @@ -18826,6 +19008,31 @@ def to_dict(self) -> dict: result["response"] = to_class(UIExitPlanModeResponse, self.response) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class UIHandlePendingSessionLimitsExhaustedRequest: + """Request ID of a pending `session_limits_exhausted.requested` event and the user's + selected limit action. + """ + request_id: str + """The unique request ID from the session_limits_exhausted.requested event""" + + response: UISessionLimitsExhaustedResponse + """The selected session-limit action.""" + + @staticmethod + def from_dict(obj: Any) -> 'UIHandlePendingSessionLimitsExhaustedRequest': + assert isinstance(obj, dict) + request_id = from_str(obj.get("requestId")) + response = UISessionLimitsExhaustedResponse.from_dict(obj.get("response")) + return UIHandlePendingSessionLimitsExhaustedRequest(request_id, response) + + def to_dict(self) -> dict: + result: dict = {} + result["requestId"] = from_str(self.request_id) + result["response"] = to_class(UISessionLimitsExhaustedResponse, self.response) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class UsageGetMetricsResult: @@ -19787,12 +19994,12 @@ class SessionMetadataSnapshot: """Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session. """ - response_limits: ResponseLimitsConfig | None = None - """Current response limits for the session, or null when no limits are active""" - selected_model: str | None = None """Currently selected model identifier, if any""" + session_limits: SessionLimitsConfig | None = None + """Current session limits, or null when no limits are active""" + summary: str | None = None """Short human-readable summary of the session, if known. Omitted when no summary has been generated. @@ -19820,12 +20027,12 @@ def from_dict(obj: Any) -> 'SessionMetadataSnapshot': client_name = from_union([from_str, from_none], obj.get("clientName")) initial_name = from_union([from_str, from_none], obj.get("initialName")) remote_metadata = from_union([MetadataSnapshotRemoteMetadata.from_dict, from_none], obj.get("remoteMetadata")) - response_limits = from_union([ResponseLimitsConfig.from_dict, from_none], obj.get("responseLimits")) selected_model = from_union([from_str, from_none], obj.get("selectedModel")) + session_limits = from_union([SessionLimitsConfig.from_dict, from_none], obj.get("sessionLimits")) summary = from_union([from_str, from_none], obj.get("summary")) workspace = from_union([WorkspaceSummary.from_dict, from_none], obj.get("workspace")) workspace_path = from_union([from_none, from_str], obj.get("workspacePath")) - return SessionMetadataSnapshot(already_in_use, current_mode, is_remote, modified_time, session_id, start_time, working_directory, client_name, initial_name, remote_metadata, response_limits, selected_model, summary, workspace, workspace_path) + return SessionMetadataSnapshot(already_in_use, current_mode, is_remote, modified_time, session_id, start_time, working_directory, client_name, initial_name, remote_metadata, selected_model, session_limits, summary, workspace, workspace_path) def to_dict(self) -> dict: result: dict = {} @@ -19842,9 +20049,9 @@ def to_dict(self) -> dict: result["initialName"] = from_union([from_str, from_none], self.initial_name) if self.remote_metadata is not None: result["remoteMetadata"] = from_union([lambda x: to_class(MetadataSnapshotRemoteMetadata, x), from_none], self.remote_metadata) - result["responseLimits"] = from_union([lambda x: to_class(ResponseLimitsConfig, x), from_none], self.response_limits) if self.selected_model is not None: result["selectedModel"] = from_union([from_str, from_none], self.selected_model) + result["sessionLimits"] = from_union([lambda x: to_class(SessionLimitsConfig, x), from_none], self.session_limits) if self.summary is not None: result["summary"] = from_union([from_str, from_none], self.summary) if self.workspace is not None: @@ -20203,6 +20410,11 @@ class SessionOpenOptions: events_log_directory: str | None = None """Override directory for session event logs.""" + excluded_builtin_agents: list[str] | None = None + """Built-in subagent names to exclude from this session. Excluded built-ins are hidden from + agent discovery and cannot be dispatched unless a custom agent with the same name is + available. + """ excluded_tools: list[str] | None = None """Denylist of tool names.""" @@ -20273,9 +20485,6 @@ class SessionOpenOptions: remote_steerable: bool | None = None """Whether this session supports remote steering.""" - response_limits: ResponseLimitsConfig | None = None - """Initial response limits for the session.""" - running_in_interactive_mode: bool | None = None """Whether the host is an interactive UI.""" @@ -20288,6 +20497,9 @@ class SessionOpenOptions: session_id: str | None = None """Optional stable session identifier to use for a new session.""" + session_limits: SessionLimitsConfig | None = None + """Initial session limits.""" + shell_init_profile: str | None = None """Shell init profile.""" @@ -20336,6 +20548,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': enable_streaming = from_union([from_bool, from_none], obj.get("enableStreaming")) env_value_mode = from_union([MCPSetEnvValueModeDetails, from_none], obj.get("envValueMode")) events_log_directory = from_union([from_str, from_none], obj.get("eventsLogDirectory")) + excluded_builtin_agents = from_union([lambda x: from_list(from_str, x), from_none], obj.get("excludedBuiltinAgents")) excluded_tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("excludedTools")) exp_assignments = obj.get("expAssignments") feature_flags = from_union([lambda x: from_dict(from_bool, x), from_none], obj.get("featureFlags")) @@ -20357,11 +20570,11 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': remote_defaulted_on = from_union([from_bool, from_none], obj.get("remoteDefaultedOn")) remote_exporting = from_union([from_bool, from_none], obj.get("remoteExporting")) remote_steerable = from_union([from_bool, from_none], obj.get("remoteSteerable")) - response_limits = from_union([ResponseLimitsConfig.from_dict, from_none], obj.get("responseLimits")) running_in_interactive_mode = from_union([from_bool, from_none], obj.get("runningInInteractiveMode")) sandbox_config = from_union([SandboxConfig.from_dict, from_none], obj.get("sandboxConfig")) session_capabilities = from_union([lambda x: from_list(SessionCapability, x), from_none], obj.get("sessionCapabilities")) session_id = from_union([from_str, from_none], obj.get("sessionId")) + session_limits = from_union([SessionLimitsConfig.from_dict, from_none], obj.get("sessionLimits")) shell_init_profile = from_union([from_str, from_none], obj.get("shellInitProfile")) shell_process_flags = from_union([lambda x: from_list(from_str, x), from_none], obj.get("shellProcessFlags")) skill_directories = from_union([lambda x: from_list(from_str, x), from_none], obj.get("skillDirectories")) @@ -20369,7 +20582,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': trajectory_file = from_union([from_str, from_none], obj.get("trajectoryFile")) working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) working_directory_context = from_union([SessionContext.from_dict, from_none], obj.get("workingDirectoryContext")) - return SessionOpenOptions(additional_content_exclusion_policies, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_skills, enable_citations, enable_on_demand_instruction_discovery, enable_script_safety, enable_streaming, env_value_mode, events_log_directory, excluded_tools, exp_assignments, feature_flags, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, response_limits, running_in_interactive_mode, sandbox_config, session_capabilities, session_id, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, working_directory, working_directory_context) + return SessionOpenOptions(additional_content_exclusion_policies, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_skills, enable_citations, enable_on_demand_instruction_discovery, enable_script_safety, enable_streaming, env_value_mode, events_log_directory, excluded_builtin_agents, excluded_tools, exp_assignments, feature_flags, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, session_capabilities, session_id, session_limits, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, working_directory, working_directory_context) def to_dict(self) -> dict: result: dict = {} @@ -20421,6 +20634,8 @@ def to_dict(self) -> dict: result["envValueMode"] = from_union([lambda x: to_enum(MCPSetEnvValueModeDetails, x), from_none], self.env_value_mode) if self.events_log_directory is not None: result["eventsLogDirectory"] = from_union([from_str, from_none], self.events_log_directory) + if self.excluded_builtin_agents is not None: + result["excludedBuiltinAgents"] = from_union([lambda x: from_list(from_str, x), from_none], self.excluded_builtin_agents) if self.excluded_tools is not None: result["excludedTools"] = from_union([lambda x: from_list(from_str, x), from_none], self.excluded_tools) if self.exp_assignments is not None: @@ -20463,8 +20678,6 @@ def to_dict(self) -> dict: result["remoteExporting"] = from_union([from_bool, from_none], self.remote_exporting) if self.remote_steerable is not None: result["remoteSteerable"] = from_union([from_bool, from_none], self.remote_steerable) - if self.response_limits is not None: - result["responseLimits"] = from_union([lambda x: to_class(ResponseLimitsConfig, x), from_none], self.response_limits) if self.running_in_interactive_mode is not None: result["runningInInteractiveMode"] = from_union([from_bool, from_none], self.running_in_interactive_mode) if self.sandbox_config is not None: @@ -20473,6 +20686,8 @@ def to_dict(self) -> dict: result["sessionCapabilities"] = from_union([lambda x: from_list(lambda x: to_enum(SessionCapability, x), x), from_none], self.session_capabilities) if self.session_id is not None: result["sessionId"] = from_union([from_str, from_none], self.session_id) + if self.session_limits is not None: + result["sessionLimits"] = from_union([lambda x: to_class(SessionLimitsConfig, x), from_none], self.session_limits) if self.shell_init_profile is not None: result["shellInitProfile"] = from_union([from_str, from_none], self.shell_init_profile) if self.shell_process_flags is not None: @@ -20576,6 +20791,11 @@ class SessionUpdateOptionsParams: """Override directory for the session-events log. When unset, the runtime's default events log directory is used. """ + excluded_builtin_agents: list[str] | None = None + """Built-in subagent names to exclude from this session. Excluded built-ins are hidden from + agent discovery and cannot be dispatched unless a custom agent with the same name is + available. + """ excluded_tools: list[str] | None = None """Denylist of tool names for this session.""" @@ -20627,9 +20847,6 @@ class SessionUpdateOptionsParams: reasoning_summary: ReasoningSummary | None = None """Reasoning summary mode for supported model clients.""" - response_limits: ResponseLimitsConfig | None = None - """Optional response limits. Pass null to clear the response limits.""" - running_in_interactive_mode: bool | None = None """Whether the session is running in an interactive UI.""" @@ -20641,6 +20858,9 @@ class SessionUpdateOptionsParams: capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the field to leave the existing capability set unchanged. """ + session_limits: SessionLimitsConfig | None = None + """Optional session limits. Pass null to clear the session limits.""" + shell_init_profile: str | None = None """Shell init profile (`None` or `NonInteractive`).""" @@ -20698,6 +20918,7 @@ def from_dict(obj: Any) -> 'SessionUpdateOptionsParams': enable_streaming = from_union([from_bool, from_none], obj.get("enableStreaming")) env_value_mode = from_union([MCPSetEnvValueModeDetails, from_none], obj.get("envValueMode")) events_log_directory = from_union([from_str, from_none], obj.get("eventsLogDirectory")) + excluded_builtin_agents = from_union([lambda x: from_list(from_str, x), from_none], obj.get("excludedBuiltinAgents")) excluded_tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("excludedTools")) feature_flags = from_union([lambda x: from_dict(from_bool, x), from_none], obj.get("featureFlags")) installed_plugins = from_union([lambda x: from_list(SessionInstalledPlugin.from_dict, x), from_none], obj.get("installedPlugins")) @@ -20713,10 +20934,10 @@ def from_dict(obj: Any) -> 'SessionUpdateOptionsParams': provider = from_union([ProviderConfig.from_dict, from_none], obj.get("provider")) reasoning_effort = from_union([from_str, from_none], obj.get("reasoningEffort")) reasoning_summary = from_union([ReasoningSummary, from_none], obj.get("reasoningSummary")) - response_limits = from_union([ResponseLimitsConfig.from_dict, from_none], obj.get("responseLimits")) running_in_interactive_mode = from_union([from_bool, from_none], obj.get("runningInInteractiveMode")) sandbox_config = from_union([SandboxConfig.from_dict, from_none], obj.get("sandboxConfig")) session_capabilities = from_union([lambda x: from_list(SessionCapability, x), from_none], obj.get("sessionCapabilities")) + session_limits = from_union([SessionLimitsConfig.from_dict, from_none], obj.get("sessionLimits")) shell_init_profile = from_union([from_str, from_none], obj.get("shellInitProfile")) shell_process_flags = from_union([lambda x: from_list(from_str, x), from_none], obj.get("shellProcessFlags")) skill_directories = from_union([lambda x: from_list(from_str, x), from_none], obj.get("skillDirectories")) @@ -20726,7 +20947,7 @@ def from_dict(obj: Any) -> 'SessionUpdateOptionsParams': tool_filter_precedence = from_union([OptionsUpdateToolFilterPrecedence, from_none], obj.get("toolFilterPrecedence")) trajectory_file = from_union([from_str, from_none], obj.get("trajectoryFile")) working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) - return SessionUpdateOptionsParams(additional_content_exclusion_policies, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, available_tools, capi, client_name, coauthor_enabled, context_tier, continue_on_auto_mode, copilot_url, custom_agents_local_only, disabled_instruction_sources, disabled_skills, enable_file_hooks, enable_host_git_operations, enable_on_demand_instruction_discovery, enable_reasoning_summaries, enable_script_safety, enable_session_store, enable_skills, enable_streaming, env_value_mode, events_log_directory, excluded_tools, feature_flags, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, manage_schedule_enabled, max_inline_binary_bytes, model, model_capabilities_overrides, organization_custom_instructions, provider, reasoning_effort, reasoning_summary, response_limits, running_in_interactive_mode, sandbox_config, session_capabilities, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, skip_embedding_retrieval, suppress_custom_agent_prompt, tool_filter_precedence, trajectory_file, working_directory) + return SessionUpdateOptionsParams(additional_content_exclusion_policies, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, available_tools, capi, client_name, coauthor_enabled, context_tier, continue_on_auto_mode, copilot_url, custom_agents_local_only, disabled_instruction_sources, disabled_skills, enable_file_hooks, enable_host_git_operations, enable_on_demand_instruction_discovery, enable_reasoning_summaries, enable_script_safety, enable_session_store, enable_skills, enable_streaming, env_value_mode, events_log_directory, excluded_builtin_agents, excluded_tools, feature_flags, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, manage_schedule_enabled, max_inline_binary_bytes, model, model_capabilities_overrides, organization_custom_instructions, provider, reasoning_effort, reasoning_summary, running_in_interactive_mode, sandbox_config, session_capabilities, session_limits, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, skip_embedding_retrieval, suppress_custom_agent_prompt, tool_filter_precedence, trajectory_file, working_directory) def to_dict(self) -> dict: result: dict = {} @@ -20778,6 +20999,8 @@ def to_dict(self) -> dict: result["envValueMode"] = from_union([lambda x: to_enum(MCPSetEnvValueModeDetails, x), from_none], self.env_value_mode) if self.events_log_directory is not None: result["eventsLogDirectory"] = from_union([from_str, from_none], self.events_log_directory) + if self.excluded_builtin_agents is not None: + result["excludedBuiltinAgents"] = from_union([lambda x: from_list(from_str, x), from_none], self.excluded_builtin_agents) if self.excluded_tools is not None: result["excludedTools"] = from_union([lambda x: from_list(from_str, x), from_none], self.excluded_tools) if self.feature_flags is not None: @@ -20808,14 +21031,14 @@ def to_dict(self) -> dict: result["reasoningEffort"] = from_union([from_str, from_none], self.reasoning_effort) if self.reasoning_summary is not None: result["reasoningSummary"] = from_union([lambda x: to_enum(ReasoningSummary, x), from_none], self.reasoning_summary) - if self.response_limits is not None: - result["responseLimits"] = from_union([lambda x: to_class(ResponseLimitsConfig, x), from_none], self.response_limits) if self.running_in_interactive_mode is not None: result["runningInInteractiveMode"] = from_union([from_bool, from_none], self.running_in_interactive_mode) if self.sandbox_config is not None: result["sandboxConfig"] = from_union([lambda x: to_class(SandboxConfig, x), from_none], self.sandbox_config) if self.session_capabilities is not None: result["sessionCapabilities"] = from_union([lambda x: from_list(lambda x: to_enum(SessionCapability, x), x), from_none], self.session_capabilities) + if self.session_limits is not None: + result["sessionLimits"] = from_union([lambda x: to_class(SessionLimitsConfig, x), from_none], self.session_limits) if self.shell_init_profile is not None: result["shellInitProfile"] = from_union([from_str, from_none], self.shell_init_profile) if self.shell_process_flags is not None: @@ -21965,6 +22188,7 @@ class RPC: account_logout_request: AccountLogoutRequest account_logout_result: AccountLogoutResult account_quota_snapshot: AccountQuotaSnapshot + adaptive_thinking_support: AdaptiveThinkingSupport agent_discovery_path: AgentDiscoveryPath agent_discovery_path_list: AgentDiscoveryPathList agent_discovery_path_scope: AgentDiscoveryPathScope @@ -22022,6 +22246,9 @@ class RPC: commands_list_request: CommandsListRequest commands_respond_to_queued_command_request: CommandsRespondToQueuedCommandRequest commands_respond_to_queued_command_result: CommandsRespondToQueuedCommandResult + completions_get_trigger_characters_result: CompletionsGetTriggerCharactersResult + completions_request_request: CompletionsRequestRequest + completions_request_result: CompletionsRequestResult configure_session_extensions_params: _ConfigureSessionExtensionsParams connected_remote_session_metadata: ConnectedRemoteSessionMetadata connected_remote_session_metadata_kind: ConnectedRemoteSessionMetadataKind @@ -22487,6 +22714,7 @@ class RPC: session_auth_status: SessionAuthStatus session_bulk_delete_result: SessionBulkDeleteResult session_capability: SessionCapability + session_completion_item: SessionCompletionItem session_context: SessionContext session_context_host_type: HostType session_enrich_metadata_result: SessionEnrichMetadataResult @@ -22701,8 +22929,11 @@ class RPC: ui_handle_pending_result: UIHandlePendingResult ui_handle_pending_sampling_request: UIHandlePendingSamplingRequest ui_handle_pending_sampling_response: dict[str, Any] + ui_handle_pending_session_limits_exhausted_request: UIHandlePendingSessionLimitsExhaustedRequest ui_handle_pending_user_input_request: UIHandlePendingUserInputRequest ui_register_direct_auto_mode_switch_handler_result: UIRegisterDirectAutoModeSwitchHandlerResult + ui_session_limits_exhausted_response: UISessionLimitsExhaustedResponse + ui_session_limits_exhausted_response_action: UISessionLimitsExhaustedResponseAction ui_unregister_direct_auto_mode_switch_handler_request: UIUnregisterDirectAutoModeSwitchHandlerRequest ui_unregister_direct_auto_mode_switch_handler_result: UIUnregisterDirectAutoModeSwitchHandlerResult ui_user_input_response: UIUserInputResponse @@ -22761,6 +22992,7 @@ def from_dict(obj: Any) -> 'RPC': account_logout_request = AccountLogoutRequest.from_dict(obj.get("AccountLogoutRequest")) account_logout_result = AccountLogoutResult.from_dict(obj.get("AccountLogoutResult")) account_quota_snapshot = AccountQuotaSnapshot.from_dict(obj.get("AccountQuotaSnapshot")) + adaptive_thinking_support = AdaptiveThinkingSupport(obj.get("AdaptiveThinkingSupport")) agent_discovery_path = AgentDiscoveryPath.from_dict(obj.get("AgentDiscoveryPath")) agent_discovery_path_list = AgentDiscoveryPathList.from_dict(obj.get("AgentDiscoveryPathList")) agent_discovery_path_scope = AgentDiscoveryPathScope(obj.get("AgentDiscoveryPathScope")) @@ -22818,6 +23050,9 @@ def from_dict(obj: Any) -> 'RPC': commands_list_request = CommandsListRequest.from_dict(obj.get("CommandsListRequest")) commands_respond_to_queued_command_request = CommandsRespondToQueuedCommandRequest.from_dict(obj.get("CommandsRespondToQueuedCommandRequest")) commands_respond_to_queued_command_result = CommandsRespondToQueuedCommandResult.from_dict(obj.get("CommandsRespondToQueuedCommandResult")) + completions_get_trigger_characters_result = CompletionsGetTriggerCharactersResult.from_dict(obj.get("CompletionsGetTriggerCharactersResult")) + completions_request_request = CompletionsRequestRequest.from_dict(obj.get("CompletionsRequestRequest")) + completions_request_result = CompletionsRequestResult.from_dict(obj.get("CompletionsRequestResult")) configure_session_extensions_params = _ConfigureSessionExtensionsParams.from_dict(obj.get("ConfigureSessionExtensionsParams")) connected_remote_session_metadata = ConnectedRemoteSessionMetadata.from_dict(obj.get("ConnectedRemoteSessionMetadata")) connected_remote_session_metadata_kind = ConnectedRemoteSessionMetadataKind(obj.get("ConnectedRemoteSessionMetadataKind")) @@ -23283,6 +23518,7 @@ def from_dict(obj: Any) -> 'RPC': session_auth_status = SessionAuthStatus.from_dict(obj.get("SessionAuthStatus")) session_bulk_delete_result = SessionBulkDeleteResult.from_dict(obj.get("SessionBulkDeleteResult")) session_capability = SessionCapability(obj.get("SessionCapability")) + session_completion_item = SessionCompletionItem.from_dict(obj.get("SessionCompletionItem")) session_context = SessionContext.from_dict(obj.get("SessionContext")) session_context_host_type = HostType(obj.get("SessionContextHostType")) session_enrich_metadata_result = SessionEnrichMetadataResult.from_dict(obj.get("SessionEnrichMetadataResult")) @@ -23497,8 +23733,11 @@ def from_dict(obj: Any) -> 'RPC': ui_handle_pending_result = UIHandlePendingResult.from_dict(obj.get("UIHandlePendingResult")) ui_handle_pending_sampling_request = UIHandlePendingSamplingRequest.from_dict(obj.get("UIHandlePendingSamplingRequest")) ui_handle_pending_sampling_response = from_dict(lambda x: x, obj.get("UIHandlePendingSamplingResponse")) + ui_handle_pending_session_limits_exhausted_request = UIHandlePendingSessionLimitsExhaustedRequest.from_dict(obj.get("UIHandlePendingSessionLimitsExhaustedRequest")) ui_handle_pending_user_input_request = UIHandlePendingUserInputRequest.from_dict(obj.get("UIHandlePendingUserInputRequest")) ui_register_direct_auto_mode_switch_handler_result = UIRegisterDirectAutoModeSwitchHandlerResult.from_dict(obj.get("UIRegisterDirectAutoModeSwitchHandlerResult")) + ui_session_limits_exhausted_response = UISessionLimitsExhaustedResponse.from_dict(obj.get("UISessionLimitsExhaustedResponse")) + ui_session_limits_exhausted_response_action = UISessionLimitsExhaustedResponseAction(obj.get("UISessionLimitsExhaustedResponseAction")) ui_unregister_direct_auto_mode_switch_handler_request = UIUnregisterDirectAutoModeSwitchHandlerRequest.from_dict(obj.get("UIUnregisterDirectAutoModeSwitchHandlerRequest")) ui_unregister_direct_auto_mode_switch_handler_result = UIUnregisterDirectAutoModeSwitchHandlerResult.from_dict(obj.get("UIUnregisterDirectAutoModeSwitchHandlerResult")) ui_user_input_response = UIUserInputResponse.from_dict(obj.get("UIUserInputResponse")) @@ -23541,7 +23780,7 @@ def from_dict(obj: Any) -> 'RPC': subagent_settings = from_union([SubagentSettings.from_dict, from_none], obj.get("SubagentSettings")) task_progress = from_union([TaskProgress.from_dict, from_none], obj.get("TaskProgress")) workspace_summary = from_union([WorkspaceSummary.from_dict, from_none], obj.get("WorkspaceSummary")) - return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agents_get_discovery_paths_request, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_session_context, capi_session_options, command_list, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, configure_session_extensions_params, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_filter_mode, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, discovered_canvas, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_register_external_client_request, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_restart_server_request, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_tools, mcp_unregister_external_client_request, memory_configuration, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_billing, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_picker_category, model_picker_price_category, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_allow_all_source, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, poll_spawned_sessions_result, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queued_command_handled, queued_command_not_handled, queued_command_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_most_recent_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, sandbox_config, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_seatbelt, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_mode, send_request, send_result, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_auth_status, session_bulk_delete_result, session_capability, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_poll_spawned_sessions_event, sessions_poll_spawned_sessions_request, sessions_prune_old_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, shell_cancel_user_requested_request, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_diff_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspace_summary_host_type, workspaces_workspace_details_host_type, session_context_info, subagent_settings, task_progress, workspace_summary) + return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agents_get_discovery_paths_request, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_session_context, capi_session_options, command_list, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_filter_mode, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, discovered_canvas, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_register_external_client_request, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_restart_server_request, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_tools, mcp_unregister_external_client_request, memory_configuration, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_billing, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_picker_category, model_picker_price_category, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_allow_all_source, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, poll_spawned_sessions_result, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queued_command_handled, queued_command_not_handled, queued_command_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_most_recent_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, sandbox_config, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_seatbelt, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_mode, send_request, send_result, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_auth_status, session_bulk_delete_result, session_capability, session_completion_item, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_poll_spawned_sessions_event, sessions_poll_spawned_sessions_request, sessions_prune_old_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, shell_cancel_user_requested_request, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_diff_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspace_summary_host_type, workspaces_workspace_details_host_type, session_context_info, subagent_settings, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -23557,6 +23796,7 @@ def to_dict(self) -> dict: result["AccountLogoutRequest"] = to_class(AccountLogoutRequest, self.account_logout_request) result["AccountLogoutResult"] = to_class(AccountLogoutResult, self.account_logout_result) result["AccountQuotaSnapshot"] = to_class(AccountQuotaSnapshot, self.account_quota_snapshot) + result["AdaptiveThinkingSupport"] = to_enum(AdaptiveThinkingSupport, self.adaptive_thinking_support) result["AgentDiscoveryPath"] = to_class(AgentDiscoveryPath, self.agent_discovery_path) result["AgentDiscoveryPathList"] = to_class(AgentDiscoveryPathList, self.agent_discovery_path_list) result["AgentDiscoveryPathScope"] = to_enum(AgentDiscoveryPathScope, self.agent_discovery_path_scope) @@ -23614,6 +23854,9 @@ def to_dict(self) -> dict: result["CommandsListRequest"] = to_class(CommandsListRequest, self.commands_list_request) result["CommandsRespondToQueuedCommandRequest"] = to_class(CommandsRespondToQueuedCommandRequest, self.commands_respond_to_queued_command_request) result["CommandsRespondToQueuedCommandResult"] = to_class(CommandsRespondToQueuedCommandResult, self.commands_respond_to_queued_command_result) + result["CompletionsGetTriggerCharactersResult"] = to_class(CompletionsGetTriggerCharactersResult, self.completions_get_trigger_characters_result) + result["CompletionsRequestRequest"] = to_class(CompletionsRequestRequest, self.completions_request_request) + result["CompletionsRequestResult"] = to_class(CompletionsRequestResult, self.completions_request_result) result["ConfigureSessionExtensionsParams"] = to_class(_ConfigureSessionExtensionsParams, self.configure_session_extensions_params) result["ConnectedRemoteSessionMetadata"] = to_class(ConnectedRemoteSessionMetadata, self.connected_remote_session_metadata) result["ConnectedRemoteSessionMetadataKind"] = to_enum(ConnectedRemoteSessionMetadataKind, self.connected_remote_session_metadata_kind) @@ -24079,6 +24322,7 @@ def to_dict(self) -> dict: result["SessionAuthStatus"] = to_class(SessionAuthStatus, self.session_auth_status) result["SessionBulkDeleteResult"] = to_class(SessionBulkDeleteResult, self.session_bulk_delete_result) result["SessionCapability"] = to_enum(SessionCapability, self.session_capability) + result["SessionCompletionItem"] = to_class(SessionCompletionItem, self.session_completion_item) result["SessionContext"] = to_class(SessionContext, self.session_context) result["SessionContextHostType"] = to_enum(HostType, self.session_context_host_type) result["SessionEnrichMetadataResult"] = to_class(SessionEnrichMetadataResult, self.session_enrich_metadata_result) @@ -24293,8 +24537,11 @@ def to_dict(self) -> dict: result["UIHandlePendingResult"] = to_class(UIHandlePendingResult, self.ui_handle_pending_result) result["UIHandlePendingSamplingRequest"] = to_class(UIHandlePendingSamplingRequest, self.ui_handle_pending_sampling_request) result["UIHandlePendingSamplingResponse"] = from_dict(lambda x: x, self.ui_handle_pending_sampling_response) + result["UIHandlePendingSessionLimitsExhaustedRequest"] = to_class(UIHandlePendingSessionLimitsExhaustedRequest, self.ui_handle_pending_session_limits_exhausted_request) result["UIHandlePendingUserInputRequest"] = to_class(UIHandlePendingUserInputRequest, self.ui_handle_pending_user_input_request) result["UIRegisterDirectAutoModeSwitchHandlerResult"] = to_class(UIRegisterDirectAutoModeSwitchHandlerResult, self.ui_register_direct_auto_mode_switch_handler_result) + result["UISessionLimitsExhaustedResponse"] = to_class(UISessionLimitsExhaustedResponse, self.ui_session_limits_exhausted_response) + result["UISessionLimitsExhaustedResponseAction"] = to_enum(UISessionLimitsExhaustedResponseAction, self.ui_session_limits_exhausted_response_action) result["UIUnregisterDirectAutoModeSwitchHandlerRequest"] = to_class(UIUnregisterDirectAutoModeSwitchHandlerRequest, self.ui_unregister_direct_auto_mode_switch_handler_request) result["UIUnregisterDirectAutoModeSwitchHandlerResult"] = to_class(UIUnregisterDirectAutoModeSwitchHandlerResult, self.ui_unregister_direct_auto_mode_switch_handler_result) result["UIUserInputResponse"] = to_class(UIUserInputResponse, self.ui_user_input_response) @@ -25363,6 +25610,23 @@ async def diff(self, params: WorkspacesDiffRequest, *, timeout: float | None = N return WorkspaceDiffResult.from_dict(await self._client.request("session.workspaces.diff", params_dict, **_timeout_kwargs(timeout))) +# Experimental: this API group is experimental and may change or be removed. +class CompletionsApi: + def __init__(self, client: "JsonRpcClient", session_id: str): + self._client = client + self._session_id = session_id + + async def get_trigger_characters(self, *, timeout: float | None = None) -> CompletionsGetTriggerCharactersResult: + "Gets the characters that should trigger host-driven completions for the session. Empty disables host-driven completions (e.g. local sessions, or a relay host that does not advertise them).\n\nReturns:\n Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`)." + return CompletionsGetTriggerCharactersResult.from_dict(await self._client.request("session.completions.getTriggerCharacters", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def request(self, params: CompletionsRequestRequest, *, timeout: float | None = None) -> CompletionsRequestResult: + "Requests host-driven completion items for the current composer input. Returns an empty list when the host has no items or does not support completions.\n\nArgs:\n params: Request host-driven completions for the current composer input.\n\nReturns:\n Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions." + 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 CompletionsRequestResult.from_dict(await self._client.request("session.completions.request", params_dict, **_timeout_kwargs(timeout))) + + # Experimental: this API group is experimental and may change or be removed. class InstructionsApi: def __init__(self, client: "JsonRpcClient", session_id: str): @@ -25881,6 +26145,12 @@ async def handle_pending_auto_mode_switch(self, params: UIHandlePendingAutoModeS params_dict["sessionId"] = self._session_id return UIHandlePendingResult.from_dict(await self._client.request("session.ui.handlePendingAutoModeSwitch", params_dict, **_timeout_kwargs(timeout))) + async def handle_pending_session_limits_exhausted(self, params: UIHandlePendingSessionLimitsExhaustedRequest, *, timeout: float | None = None) -> UIHandlePendingResult: + "Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action.\n\nArgs:\n params: Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action.\n\nReturns:\n Indicates whether the pending UI request was resolved by this call." + 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 UIHandlePendingResult.from_dict(await self._client.request("session.ui.handlePendingSessionLimitsExhausted", params_dict, **_timeout_kwargs(timeout))) + async def handle_pending_exit_plan_mode(self, params: UIHandlePendingExitPlanModeRequest, *, timeout: float | None = None) -> UIHandlePendingResult: "Resolves a pending `exit_plan_mode.requested` event with the user's response.\n\nArgs:\n params: Request ID of a pending `exit_plan_mode.requested` event and the user's response.\n\nReturns:\n Indicates whether the pending UI request was resolved by this call." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} @@ -26288,6 +26558,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self.name = NameApi(client, session_id) self.plan = PlanApi(client, session_id) self.workspaces = WorkspacesApi(client, session_id) + self.completions = CompletionsApi(client, session_id) self.instructions = InstructionsApi(client, session_id) self.fleet = FleetApi(client, session_id) self.agent = AgentApi(client, session_id) @@ -26642,6 +26913,7 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "AccountLogoutRequest", "AccountLogoutResult", "AccountQuotaSnapshot", + "AdaptiveThinkingSupport", "AdditionalContentExclusionPolicyScope", "AgentApi", "AgentDiscoveryPath", @@ -26712,6 +26984,10 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "CommandsListRequest", "CommandsRespondToQueuedCommandRequest", "CommandsRespondToQueuedCommandResult", + "CompletionsApi", + "CompletionsGetTriggerCharactersResult", + "CompletionsRequestRequest", + "CompletionsRequestResult", "ConnectRemoteSessionParams", "ConnectedRemoteSessionMetadata", "ConnectedRemoteSessionMetadataKind", @@ -27295,6 +27571,7 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "SessionAuthStatus", "SessionBulkDeleteResult", "SessionCapability", + "SessionCompletionItem", "SessionContext", "SessionContextHostType", "SessionContextInfo", @@ -27543,8 +27820,11 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "UIHandlePendingExitPlanModeRequest", "UIHandlePendingResult", "UIHandlePendingSamplingRequest", + "UIHandlePendingSessionLimitsExhaustedRequest", "UIHandlePendingUserInputRequest", "UIRegisterDirectAutoModeSwitchHandlerResult", + "UISessionLimitsExhaustedResponse", + "UISessionLimitsExhaustedResponseAction", "UIUnregisterDirectAutoModeSwitchHandlerRequest", "UIUnregisterDirectAutoModeSwitchHandlerResult", "UIUserInputResponse", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index 7ad5e9af95..8dca9a5118 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -136,7 +136,7 @@ class SessionEventType(Enum): SESSION_WARNING = "session.warning" SESSION_MODEL_CHANGE = "session.model_change" SESSION_MODE_CHANGED = "session.mode_changed" - SESSION_RESPONSE_LIMITS_CHANGED = "session.response_limits_changed" + SESSION_SESSION_LIMITS_CHANGED = "session.session_limits_changed" SESSION_PERMISSIONS_CHANGED = "session.permissions_changed" SESSION_PLAN_CHANGED = "session.plan_changed" SESSION_TODOS_CHANGED = "session.todos_changed" @@ -145,6 +145,7 @@ class SessionEventType(Enum): SESSION_TRUNCATION = "session.truncation" SESSION_SNAPSHOT_REWIND = "session.snapshot_rewind" SESSION_SHUTDOWN = "session.shutdown" + SESSION_USAGE_CHECKPOINT = "session.usage_checkpoint" SESSION_CONTEXT_CHANGED = "session.context_changed" SESSION_USAGE_INFO = "session.usage_info" SESSION_COMPACTION_START = "session.compaction_start" @@ -203,6 +204,8 @@ class SessionEventType(Enum): COMMAND_COMPLETED = "command.completed" AUTO_MODE_SWITCH_REQUESTED = "auto_mode_switch.requested" AUTO_MODE_SWITCH_COMPLETED = "auto_mode_switch.completed" + SESSION_LIMITS_EXHAUSTED_REQUESTED = "session_limits_exhausted.requested" + SESSION_LIMITS_EXHAUSTED_COMPLETED = "session_limits_exhausted.completed" COMMANDS_CHANGED = "commands.changed" CAPABILITIES_CHANGED = "capabilities.changed" EXIT_PLAN_MODE_REQUESTED = "exit_plan_mode.requested" @@ -1049,6 +1052,7 @@ class AssistantMessageData: phase: str | None = None reasoning_opaque: str | None = None reasoning_text: str | None = None + reasoning_wire_field: str | None = None request_id: str | None = None server_tools: AssistantMessageServerTools | None = None service_request_id: str | None = None @@ -1070,6 +1074,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": phase = from_union([from_none, from_str], obj.get("phase")) reasoning_opaque = from_union([from_none, from_str], obj.get("reasoningOpaque")) reasoning_text = from_union([from_none, from_str], obj.get("reasoningText")) + reasoning_wire_field = from_union([from_none, from_str], obj.get("reasoningWireField")) request_id = from_union([from_none, from_str], obj.get("requestId")) server_tools = from_union([from_none, AssistantMessageServerTools.from_dict], obj.get("serverTools")) service_request_id = from_union([from_none, from_str], obj.get("serviceRequestId")) @@ -1088,6 +1093,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": phase=phase, reasoning_opaque=reasoning_opaque, reasoning_text=reasoning_text, + reasoning_wire_field=reasoning_wire_field, request_id=request_id, server_tools=server_tools, service_request_id=service_request_id, @@ -1119,6 +1125,8 @@ def to_dict(self) -> dict: result["reasoningOpaque"] = from_union([from_none, from_str], self.reasoning_opaque) if self.reasoning_text is not None: result["reasoningText"] = from_union([from_none, from_str], self.reasoning_text) + if self.reasoning_wire_field is not None: + result["reasoningWireField"] = from_union([from_none, from_str], self.reasoning_wire_field) if self.request_id is not None: result["requestId"] = from_union([from_none, from_str], self.request_id) if self.server_tools is not None: @@ -4513,6 +4521,8 @@ class PermissionRequestRead: intention: str kind: ClassVar[str] = "read" path: str + request_sandbox_bypass: bool | None = None + request_sandbox_bypass_reason: str | None = None tool_call_id: str | None = None @staticmethod @@ -4520,10 +4530,14 @@ def from_dict(obj: Any) -> "PermissionRequestRead": assert isinstance(obj, dict) intention = from_str(obj.get("intention")) path = from_str(obj.get("path")) + request_sandbox_bypass = from_union([from_none, from_bool], obj.get("requestSandboxBypass")) + request_sandbox_bypass_reason = from_union([from_none, from_str], obj.get("requestSandboxBypassReason")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) return PermissionRequestRead( intention=intention, path=path, + request_sandbox_bypass=request_sandbox_bypass, + request_sandbox_bypass_reason=request_sandbox_bypass_reason, tool_call_id=tool_call_id, ) @@ -4532,6 +4546,10 @@ def to_dict(self) -> dict: result["intention"] = from_str(self.intention) result["kind"] = self.kind result["path"] = from_str(self.path) + if self.request_sandbox_bypass is not None: + result["requestSandboxBypass"] = from_union([from_none, from_bool], self.request_sandbox_bypass) + if self.request_sandbox_bypass_reason is not None: + result["requestSandboxBypassReason"] = from_union([from_none, from_str], self.request_sandbox_bypass_reason) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) return result @@ -4810,26 +4828,6 @@ def to_dict(self) -> dict: return result -@dataclass -class ResponseLimitsConfig: - "Optional response limits." - max_ai_credits: float | None = None - - @staticmethod - def from_dict(obj: Any) -> "ResponseLimitsConfig": - assert isinstance(obj, dict) - max_ai_credits = from_union([from_none, from_float], obj.get("maxAiCredits")) - return ResponseLimitsConfig( - max_ai_credits=max_ai_credits, - ) - - def to_dict(self) -> dict: - result: dict = {} - if self.max_ai_credits is not None: - result["maxAiCredits"] = from_union([from_none, to_float], self.max_ai_credits) - return result - - @dataclass class SamplingCompletedData: "Sampling request completion notification signaling UI dismissal" @@ -5411,6 +5409,105 @@ def to_dict(self) -> dict: return result +@dataclass +class SessionLimitsConfig: + "Optional session limits." + max_ai_credits: float | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionLimitsConfig": + assert isinstance(obj, dict) + max_ai_credits = from_union([from_none, from_float], obj.get("maxAiCredits")) + return SessionLimitsConfig( + max_ai_credits=max_ai_credits, + ) + + def to_dict(self) -> dict: + result: dict = {} + if self.max_ai_credits is not None: + result["maxAiCredits"] = from_union([from_none, to_float], self.max_ai_credits) + return result + + +@dataclass +class SessionLimitsExhaustedCompletedData: + "Session limit exhaustion prompt completion notification." + request_id: str + response: SessionLimitsExhaustedResponse + + @staticmethod + def from_dict(obj: Any) -> "SessionLimitsExhaustedCompletedData": + assert isinstance(obj, dict) + request_id = from_str(obj.get("requestId")) + response = SessionLimitsExhaustedResponse.from_dict(obj.get("response")) + return SessionLimitsExhaustedCompletedData( + request_id=request_id, + response=response, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["requestId"] = from_str(self.request_id) + result["response"] = to_class(SessionLimitsExhaustedResponse, self.response) + return result + + +@dataclass +class SessionLimitsExhaustedRequestedData: + "Session limit exhaustion notification requiring user action." + max_ai_credits: float + request_id: str + used_ai_credits: float + + @staticmethod + def from_dict(obj: Any) -> "SessionLimitsExhaustedRequestedData": + assert isinstance(obj, dict) + max_ai_credits = from_float(obj.get("maxAiCredits")) + request_id = from_str(obj.get("requestId")) + used_ai_credits = from_float(obj.get("usedAiCredits")) + return SessionLimitsExhaustedRequestedData( + max_ai_credits=max_ai_credits, + request_id=request_id, + used_ai_credits=used_ai_credits, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["maxAiCredits"] = to_float(self.max_ai_credits) + result["requestId"] = from_str(self.request_id) + result["usedAiCredits"] = to_float(self.used_ai_credits) + return result + + +@dataclass +class SessionLimitsExhaustedResponse: + "The user's selected action for an exhausted session limit." + action: SessionLimitsExhaustedResponseAction + additional_ai_credits: float | None = None + max_ai_credits: float | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionLimitsExhaustedResponse": + assert isinstance(obj, dict) + action = parse_enum(SessionLimitsExhaustedResponseAction, obj.get("action")) + additional_ai_credits = from_union([from_none, from_float], obj.get("additionalAiCredits")) + max_ai_credits = from_union([from_none, from_float], obj.get("maxAiCredits")) + return SessionLimitsExhaustedResponse( + action=action, + additional_ai_credits=additional_ai_credits, + max_ai_credits=max_ai_credits, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["action"] = to_enum(SessionLimitsExhaustedResponseAction, self.action) + if self.additional_ai_credits is not None: + result["additionalAiCredits"] = from_union([from_none, to_float], self.additional_ai_credits) + if self.max_ai_credits is not None: + result["maxAiCredits"] = from_union([from_none, to_float], self.max_ai_credits) + return result + + @dataclass class SessionMcpServerStatusChangedData: "Schema for the `McpServerStatusChangedData` type." @@ -5596,25 +5693,6 @@ def to_dict(self) -> dict: return result -@dataclass -class SessionResponseLimitsChangedData: - "Response limits update details. Null clears the limits." - response_limits: ResponseLimitsConfig | None - - @staticmethod - def from_dict(obj: Any) -> "SessionResponseLimitsChangedData": - assert isinstance(obj, dict) - response_limits = from_union([from_none, ResponseLimitsConfig.from_dict], obj.get("responseLimits")) - return SessionResponseLimitsChangedData( - response_limits=response_limits, - ) - - def to_dict(self) -> dict: - result: dict = {} - result["responseLimits"] = from_union([from_none, lambda x: to_class(ResponseLimitsConfig, x)], self.response_limits) - return result - - @dataclass class SessionResumeData: "Session resume metadata including current context and event count" @@ -5628,8 +5706,8 @@ class SessionResumeData: reasoning_effort: str | None = None reasoning_summary: ReasoningSummary | None = None remote_steerable: bool | None = None - response_limits: ResponseLimitsConfig | None = None selected_model: str | None = None + session_limits: SessionLimitsConfig | None = None session_was_active: bool | None = None @staticmethod @@ -5645,8 +5723,8 @@ def from_dict(obj: Any) -> "SessionResumeData": reasoning_effort = from_union([from_none, from_str], obj.get("reasoningEffort")) reasoning_summary = from_union([from_none, lambda x: parse_enum(ReasoningSummary, x)], obj.get("reasoningSummary")) remote_steerable = from_union([from_none, from_bool], obj.get("remoteSteerable")) - response_limits = from_union([from_none, ResponseLimitsConfig.from_dict], obj.get("responseLimits")) selected_model = from_union([from_none, from_str], obj.get("selectedModel")) + session_limits = from_union([from_none, SessionLimitsConfig.from_dict], obj.get("sessionLimits")) session_was_active = from_union([from_none, from_bool], obj.get("sessionWasActive")) return SessionResumeData( event_count=event_count, @@ -5659,8 +5737,8 @@ def from_dict(obj: Any) -> "SessionResumeData": reasoning_effort=reasoning_effort, reasoning_summary=reasoning_summary, remote_steerable=remote_steerable, - response_limits=response_limits, selected_model=selected_model, + session_limits=session_limits, session_was_active=session_was_active, ) @@ -5684,10 +5762,10 @@ def to_dict(self) -> dict: result["reasoningSummary"] = from_union([from_none, lambda x: to_enum(ReasoningSummary, x)], self.reasoning_summary) if self.remote_steerable is not None: result["remoteSteerable"] = from_union([from_none, from_bool], self.remote_steerable) - if self.response_limits is not None: - result["responseLimits"] = from_union([from_none, lambda x: to_class(ResponseLimitsConfig, x)], self.response_limits) if self.selected_model is not None: result["selectedModel"] = from_union([from_none, from_str], self.selected_model) + if self.session_limits is not None: + result["sessionLimits"] = from_union([from_none, lambda x: to_class(SessionLimitsConfig, x)], self.session_limits) if self.session_was_active is not None: result["sessionWasActive"] = from_union([from_none, from_bool], self.session_was_active) return result @@ -5793,6 +5871,25 @@ def to_dict(self) -> dict: return result +@dataclass +class SessionSessionLimitsChangedData: + "Session limits update details. Null clears the limits." + session_limits: SessionLimitsConfig | None + + @staticmethod + def from_dict(obj: Any) -> "SessionSessionLimitsChangedData": + assert isinstance(obj, dict) + session_limits = from_union([from_none, SessionLimitsConfig.from_dict], obj.get("sessionLimits")) + return SessionSessionLimitsChangedData( + session_limits=session_limits, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["sessionLimits"] = from_union([from_none, lambda x: to_class(SessionLimitsConfig, x)], self.session_limits) + return result + + @dataclass class SessionShutdownData: "Session termination metrics including usage statistics, code changes, and shutdown reason" @@ -5937,8 +6034,8 @@ class SessionStartData: reasoning_effort: str | None = None reasoning_summary: ReasoningSummary | None = None remote_steerable: bool | None = None - response_limits: ResponseLimitsConfig | None = None selected_model: str | None = None + session_limits: SessionLimitsConfig | None = None @staticmethod def from_dict(obj: Any) -> "SessionStartData": @@ -5955,8 +6052,8 @@ def from_dict(obj: Any) -> "SessionStartData": reasoning_effort = from_union([from_none, from_str], obj.get("reasoningEffort")) reasoning_summary = from_union([from_none, lambda x: parse_enum(ReasoningSummary, x)], obj.get("reasoningSummary")) remote_steerable = from_union([from_none, from_bool], obj.get("remoteSteerable")) - response_limits = from_union([from_none, ResponseLimitsConfig.from_dict], obj.get("responseLimits")) selected_model = from_union([from_none, from_str], obj.get("selectedModel")) + session_limits = from_union([from_none, SessionLimitsConfig.from_dict], obj.get("sessionLimits")) return SessionStartData( copilot_version=copilot_version, producer=producer, @@ -5970,8 +6067,8 @@ def from_dict(obj: Any) -> "SessionStartData": reasoning_effort=reasoning_effort, reasoning_summary=reasoning_summary, remote_steerable=remote_steerable, - response_limits=response_limits, selected_model=selected_model, + session_limits=session_limits, ) def to_dict(self) -> dict: @@ -5995,10 +6092,10 @@ def to_dict(self) -> dict: result["reasoningSummary"] = from_union([from_none, lambda x: to_enum(ReasoningSummary, x)], self.reasoning_summary) if self.remote_steerable is not None: result["remoteSteerable"] = from_union([from_none, from_bool], self.remote_steerable) - if self.response_limits is not None: - result["responseLimits"] = from_union([from_none, lambda x: to_class(ResponseLimitsConfig, x)], self.response_limits) if self.selected_model is not None: result["selectedModel"] = from_union([from_none, from_str], self.selected_model) + if self.session_limits is not None: + result["sessionLimits"] = from_union([from_none, lambda x: to_class(SessionLimitsConfig, x)], self.session_limits) return result @@ -6124,6 +6221,31 @@ def to_dict(self) -> dict: return result +@dataclass +class SessionUsageCheckpointData: + "Durable session usage checkpoint for reconstructing aggregate accounting on resume" + total_nano_aiu: float + # Internal: this field is an internal SDK API and is not part of the public surface. + _total_premium_requests: float | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionUsageCheckpointData": + assert isinstance(obj, dict) + total_nano_aiu = from_float(obj.get("totalNanoAiu")) + _total_premium_requests = from_union([from_none, from_float], obj.get("totalPremiumRequests")) + return SessionUsageCheckpointData( + total_nano_aiu=total_nano_aiu, + _total_premium_requests=_total_premium_requests, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["totalNanoAiu"] = to_float(self.total_nano_aiu) + if self._total_premium_requests is not None: + result["totalPremiumRequests"] = from_union([from_none, to_float], self._total_premium_requests) + return result + + @dataclass class SessionUsageInfoData: "Current context window usage statistics including token and message counts" @@ -8676,6 +8798,18 @@ class ReasoningSummary(Enum): DETAILED = "detailed" +class SessionLimitsExhaustedResponseAction(Enum): + "User action selected for an exhausted session limit." + # Increase the current max by an exact AI Credits amount. + ADD = "add" + # Set a new absolute max AI Credits value. + SET = "set" + # Remove the current session limit. + UNSET = "unset" + # Leave the limit unchanged and cancel the blocked model request. + CANCEL = "cancel" + + class SessionMode(Enum): "The session mode the agent is operating in" # The agent is responding interactively to the user. @@ -8800,7 +8934,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionResponseLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionContextChangedData | SessionUsageInfoData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantIntentData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | ModelCallFailureData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | SkillInvokedData | SubagentStartedData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data +SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantIntentData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | ModelCallFailureData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | SkillInvokedData | SubagentStartedData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -8840,7 +8974,7 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_WARNING: data = SessionWarningData.from_dict(data_obj) case SessionEventType.SESSION_MODEL_CHANGE: data = SessionModelChangeData.from_dict(data_obj) case SessionEventType.SESSION_MODE_CHANGED: data = SessionModeChangedData.from_dict(data_obj) - case SessionEventType.SESSION_RESPONSE_LIMITS_CHANGED: data = SessionResponseLimitsChangedData.from_dict(data_obj) + case SessionEventType.SESSION_SESSION_LIMITS_CHANGED: data = SessionSessionLimitsChangedData.from_dict(data_obj) case SessionEventType.SESSION_PERMISSIONS_CHANGED: data = SessionPermissionsChangedData.from_dict(data_obj) case SessionEventType.SESSION_PLAN_CHANGED: data = SessionPlanChangedData.from_dict(data_obj) case SessionEventType.SESSION_TODOS_CHANGED: data = SessionTodosChangedData.from_dict(data_obj) @@ -8849,6 +8983,7 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_TRUNCATION: data = SessionTruncationData.from_dict(data_obj) case SessionEventType.SESSION_SNAPSHOT_REWIND: data = SessionSnapshotRewindData.from_dict(data_obj) case SessionEventType.SESSION_SHUTDOWN: data = SessionShutdownData.from_dict(data_obj) + case SessionEventType.SESSION_USAGE_CHECKPOINT: data = SessionUsageCheckpointData.from_dict(data_obj) case SessionEventType.SESSION_CONTEXT_CHANGED: data = SessionContextChangedData.from_dict(data_obj) case SessionEventType.SESSION_USAGE_INFO: data = SessionUsageInfoData.from_dict(data_obj) case SessionEventType.SESSION_COMPACTION_START: data = SessionCompactionStartData.from_dict(data_obj) @@ -8906,6 +9041,8 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.COMMAND_COMPLETED: data = CommandCompletedData.from_dict(data_obj) case SessionEventType.AUTO_MODE_SWITCH_REQUESTED: data = AutoModeSwitchRequestedData.from_dict(data_obj) case SessionEventType.AUTO_MODE_SWITCH_COMPLETED: data = AutoModeSwitchCompletedData.from_dict(data_obj) + case SessionEventType.SESSION_LIMITS_EXHAUSTED_REQUESTED: data = SessionLimitsExhaustedRequestedData.from_dict(data_obj) + case SessionEventType.SESSION_LIMITS_EXHAUSTED_COMPLETED: data = SessionLimitsExhaustedCompletedData.from_dict(data_obj) case SessionEventType.COMMANDS_CHANGED: data = CommandsChangedData.from_dict(data_obj) case SessionEventType.CAPABILITIES_CHANGED: data = CapabilitiesChangedData.from_dict(data_obj) case SessionEventType.EXIT_PLAN_MODE_REQUESTED: data = ExitPlanModeRequestedData.from_dict(data_obj) @@ -9128,7 +9265,6 @@ def session_event_to_dict(x: SessionEvent) -> Any: "PlanChangedOperation", "RawSessionEventData", "ReasoningSummary", - "ResponseLimitsConfig", "SamplingCompletedData", "SamplingRequestedData", "SessionAutopilotObjectiveChangedData", @@ -9154,6 +9290,11 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SessionHandoffData", "SessionIdleData", "SessionInfoData", + "SessionLimitsConfig", + "SessionLimitsExhaustedCompletedData", + "SessionLimitsExhaustedRequestedData", + "SessionLimitsExhaustedResponse", + "SessionLimitsExhaustedResponseAction", "SessionMcpServerStatusChangedData", "SessionMcpServersLoadedData", "SessionMode", @@ -9162,11 +9303,11 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SessionPermissionsChangedData", "SessionPlanChangedData", "SessionRemoteSteerableChangedData", - "SessionResponseLimitsChangedData", "SessionResumeData", "SessionScheduleCancelledData", "SessionScheduleCreatedData", "SessionScheduleRearmedData", + "SessionSessionLimitsChangedData", "SessionShutdownData", "SessionSkillsLoadedData", "SessionSnapshotRewindData", @@ -9176,6 +9317,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SessionTodosChangedData", "SessionToolsUpdatedData", "SessionTruncationData", + "SessionUsageCheckpointData", "SessionUsageInfoData", "SessionWarningData", "SessionWorkspaceFileChangedData", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 1e6caa15ea..18a877d3aa 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use super::session_events::{ AbortReason, ContextTier, McpServerSource, McpServerStatus, PermissionPromptRequest, - PermissionRule, ReasoningSummary, ResponseLimitsConfig, SessionMode, ShutdownType, SkillSource, + PermissionRule, ReasoningSummary, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, UserToolSessionApproval, }; use crate::types::{RequestId, SessionEvent, SessionId}; @@ -236,6 +236,11 @@ pub mod rpc_methods { pub const SESSION_WORKSPACES_SAVELARGEPASTE: &str = "session.workspaces.saveLargePaste"; /// `session.workspaces.diff` pub const SESSION_WORKSPACES_DIFF: &str = "session.workspaces.diff"; + /// `session.completions.getTriggerCharacters` + pub const SESSION_COMPLETIONS_GETTRIGGERCHARACTERS: &str = + "session.completions.getTriggerCharacters"; + /// `session.completions.request` + pub const SESSION_COMPLETIONS_REQUEST: &str = "session.completions.request"; /// `session.instructions.getSources` pub const SESSION_INSTRUCTIONS_GETSOURCES: &str = "session.instructions.getSources"; /// `session.fleet.start` @@ -402,6 +407,9 @@ pub mod rpc_methods { /// `session.ui.handlePendingAutoModeSwitch` pub const SESSION_UI_HANDLEPENDINGAUTOMODESWITCH: &str = "session.ui.handlePendingAutoModeSwitch"; + /// `session.ui.handlePendingSessionLimitsExhausted` + pub const SESSION_UI_HANDLEPENDINGSESSIONLIMITSEXHAUSTED: &str = + "session.ui.handlePendingSessionLimitsExhausted"; /// `session.ui.handlePendingExitPlanMode` pub const SESSION_UI_HANDLEPENDINGEXITPLANMODE: &str = "session.ui.handlePendingExitPlanMode"; /// `session.ui.registerDirectAutoModeSwitchHandler` @@ -2536,6 +2544,80 @@ pub struct CommandsRespondToQueuedCommandResult { pub success: bool, } +/// Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). +/// +///

+/// +/// **Experimental.** 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 CompletionsGetTriggerCharactersResult { + /// Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven completions for the session. + pub trigger_characters: Vec, +} + +/// Request host-driven completions for the current composer input. +/// +///
+/// +/// **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 CompletionsRequestRequest { + /// Cursor offset within `text`, in UTF-16 code units. + pub offset: i64, + /// The full composed composer input. + pub text: String, +} + +/// A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced. +/// +///
+/// +/// **Experimental.** 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 SessionCompletionItem { + /// Text spliced into the composer when the item is accepted. + pub insert_text: String, + /// Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the host's display kind. + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option, + /// Primary display label for the picker row. Falls back to `insertText` when absent. + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + /// End (exclusive) of the replacement range in `text`, in UTF-16 code units. + #[serde(skip_serializing_if = "Option::is_none")] + pub range_end: Option, + /// Start of the replacement range in `text`, in UTF-16 code units. + #[serde(skip_serializing_if = "Option::is_none")] + pub range_start: Option, +} + +/// Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. +/// +///
+/// +/// **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 CompletionsRequestResult { + /// Completion items in host-ranked order. + pub items: Vec, +} + /// Params to attach or detach an in-process ExtensionController delegate. /// ///
@@ -5902,6 +5984,9 @@ pub struct ModelCapabilitiesLimits { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ModelCapabilitiesSupports { + /// Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). + #[serde(rename = "adaptive_thinking", skip_serializing_if = "Option::is_none")] + pub adaptive_thinking: Option, /// Whether this model supports reasoning effort configuration #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_effort: Option, @@ -6051,6 +6136,9 @@ pub struct ModelCapabilitiesOverrideLimits { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ModelCapabilitiesOverrideSupports { + /// Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). + #[serde(rename = "adaptive_thinking", skip_serializing_if = "Option::is_none")] + pub adaptive_thinking: Option, /// Whether this model supports reasoning effort configuration #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_effort: Option, @@ -9075,7 +9163,7 @@ pub struct QueueRemoveMostRecentResult { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RegisterEventInterestParams { - /// The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. + /// The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. pub event_type: String, } @@ -10677,13 +10765,13 @@ pub struct SessionMetadataSnapshot { /// Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session. #[serde(skip_serializing_if = "Option::is_none")] pub remote_metadata: Option, - /// Current response limits for the session, or null when no limits are active - pub response_limits: Option, /// Currently selected model identifier, if any #[serde(skip_serializing_if = "Option::is_none")] pub selected_model: Option, /// The unique identifier of the session pub session_id: SessionId, + /// Current session limits, or null when no limits are active + pub session_limits: Option, /// ISO 8601 timestamp of when the session started pub start_time: String, /// Short human-readable summary of the session, if known. Omitted when no summary has been generated. @@ -10866,6 +10954,9 @@ pub struct SessionOpenOptions { /// Override directory for session event logs. #[serde(skip_serializing_if = "Option::is_none")] pub events_log_directory: Option, + /// Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. + #[serde(skip_serializing_if = "Option::is_none")] + pub excluded_builtin_agents: Option>, /// Denylist of tool names. #[serde(skip_serializing_if = "Option::is_none")] pub excluded_tools: Option>, @@ -10944,9 +11035,6 @@ pub struct SessionOpenOptions { /// Whether this session supports remote steering. #[serde(skip_serializing_if = "Option::is_none")] pub remote_steerable: Option, - /// Initial response limits for the session. - #[serde(skip_serializing_if = "Option::is_none")] - pub response_limits: Option, /// Whether the host is an interactive UI. #[serde(skip_serializing_if = "Option::is_none")] pub running_in_interactive_mode: Option, @@ -10959,6 +11047,9 @@ pub struct SessionOpenOptions { /// Optional stable session identifier to use for a new session. #[serde(skip_serializing_if = "Option::is_none")] pub session_id: Option, + /// Initial session limits. + #[serde(skip_serializing_if = "Option::is_none")] + pub session_limits: Option, /// Shell init profile. #[serde(skip_serializing_if = "Option::is_none")] pub shell_init_profile: Option, @@ -11959,6 +12050,9 @@ pub struct SessionUpdateOptionsParams { /// Override directory for the session-events log. When unset, the runtime's default events log directory is used. #[serde(skip_serializing_if = "Option::is_none")] pub events_log_directory: Option, + /// Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. + #[serde(skip_serializing_if = "Option::is_none")] + pub excluded_builtin_agents: Option>, /// Denylist of tool names for this session. #[serde(skip_serializing_if = "Option::is_none")] pub excluded_tools: Option>, @@ -12004,9 +12098,6 @@ pub struct SessionUpdateOptionsParams { /// Reasoning summary mode for supported model clients. #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_summary: Option, - /// Optional response limits. Pass null to clear the response limits. - #[serde(skip_serializing_if = "Option::is_none")] - pub response_limits: Option, /// Whether the session is running in an interactive UI. #[serde(skip_serializing_if = "Option::is_none")] pub running_in_interactive_mode: Option, @@ -12016,6 +12107,9 @@ pub struct SessionUpdateOptionsParams { /// Replaces the session's capability set with the given list. Use to enable or disable capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the field to leave the existing capability set unchanged. #[serde(skip_serializing_if = "Option::is_none")] pub session_capabilities: Option>, + /// Optional session limits. Pass null to clear the session limits. + #[serde(skip_serializing_if = "Option::is_none")] + pub session_limits: Option, /// Shell init profile (`None` or `NonInteractive`). #[serde(skip_serializing_if = "Option::is_none")] pub shell_init_profile: Option, @@ -13632,6 +13726,44 @@ pub struct UIHandlePendingSamplingRequest { pub response: Option, } +/// The user's selected action for an exhausted session limit. +/// +///
+/// +/// **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 UISessionLimitsExhaustedResponse { + /// Action selected by the user. + pub action: UISessionLimitsExhaustedResponseAction, + /// AI Credits to add to the current max when action is 'add'. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_ai_credits: Option, + /// New absolute max AI Credits when action is 'set'. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_ai_credits: Option, +} + +/// Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action. +/// +///
+/// +/// **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 UIHandlePendingSessionLimitsExhaustedRequest { + /// The unique request ID from the session_limits_exhausted.requested event + pub request_id: RequestId, + /// The selected session-limit action. + pub response: UISessionLimitsExhaustedResponse, +} + /// Schema for the `UIUserInputResponse` type. /// ///
@@ -15660,6 +15792,51 @@ pub struct SessionWorkspacesDiffResult { pub requested_mode: WorkspaceDiffMode, } +/// 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 SessionCompletionsGetTriggerCharactersParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). +/// +///
+/// +/// **Experimental.** 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 SessionCompletionsGetTriggerCharactersResult { + /// Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven completions for the session. + pub trigger_characters: Vec, +} + +/// Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. +/// +///
+/// +/// **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 SessionCompletionsRequestResult { + /// Completion items in host-ranked order. + pub items: Vec, +} + /// Identifies the target session. /// ///
@@ -16918,6 +17095,21 @@ pub struct SessionUiHandlePendingAutoModeSwitchResult { pub success: bool, } +/// Indicates whether the pending UI request was resolved by this call. +/// +///
+/// +/// **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 SessionUiHandlePendingSessionLimitsExhaustedResult { + /// True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending. + pub success: bool, +} + /// Indicates whether the pending UI request was resolved by this call. /// ///
@@ -17402,13 +17594,13 @@ pub struct SessionMetadataSnapshotResult { /// Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session. #[serde(skip_serializing_if = "Option::is_none")] pub remote_metadata: Option, - /// Current response limits for the session, or null when no limits are active - pub response_limits: Option, /// Currently selected model identifier, if any #[serde(skip_serializing_if = "Option::is_none")] pub selected_model: Option, /// The unique identifier of the session pub session_id: SessionId, + /// Current session limits, or null when no limits are active + pub session_limits: Option, /// ISO 8601 timestamp of when the session started pub start_time: String, /// Short human-readable summary of the session, if known. Omitted when no summary has been generated. @@ -18232,6 +18424,31 @@ pub type AccountGetAllUsersResult = Vec; ///
pub type SessionMcpAppsCallToolResult = HashMap; +/// Resolved Anthropic adaptive-thinking capability for a model. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum AdaptiveThinkingSupport { + /// The model does not accept thinking.type='adaptive' + #[serde(rename = "unsupported")] + Unsupported, + /// The model accepts adaptive thinking but also accepts thinking.type='enabled' + #[serde(rename = "optional")] + Optional, + /// The model only accepts adaptive thinking and rejects thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8) + #[serde(rename = "required")] + Required, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Which tier this directory belongs to /// ///
@@ -21869,6 +22086,34 @@ pub enum UIExitPlanModeAction { Unknown, } +/// User action selected for an exhausted session limit. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum UISessionLimitsExhaustedResponseAction { + /// Increase the current max by an exact AI Credits amount. + #[serde(rename = "add")] + Add, + /// Set a new absolute max AI Credits value. + #[serde(rename = "set")] + Set, + /// Remove the current session limit. + #[serde(rename = "unset")] + Unset, + /// Leave the limit unchanged and cancel the blocked model request. + #[serde(rename = "cancel")] + Cancel, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// OAuth user authentication. The token itself is held in the runtime's secret token store (keyed by host+login) and is NOT carried in this struct. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum UserAuthInfoType { diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index cb0df3490d..eb071cb1fb 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -2628,6 +2628,13 @@ impl<'a> SessionRpc<'a> { } } + /// `session.completions.*` sub-namespace. + pub fn completions(&self) -> SessionRpcCompletions<'a> { + SessionRpcCompletions { + session: self.session, + } + } + /// `session.eventLog.*` sub-namespace. pub fn event_log(&self) -> SessionRpcEventLog<'a> { SessionRpcEventLog { @@ -3502,6 +3509,77 @@ impl<'a> SessionRpcCommands<'a> { } } +/// `session.completions.*` RPCs. +#[derive(Clone, Copy)] +pub struct SessionRpcCompletions<'a> { + pub(crate) session: &'a Session, +} + +impl<'a> SessionRpcCompletions<'a> { + /// Gets the characters that should trigger host-driven completions for the session. Empty disables host-driven completions (e.g. local sessions, or a relay host that does not advertise them). + /// + /// Wire method: `session.completions.getTriggerCharacters`. + /// + /// # Returns + /// + /// Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). + /// + ///
+ /// + /// **Experimental.** 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_trigger_characters( + &self, + ) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_COMPLETIONS_GETTRIGGERCHARACTERS, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Requests host-driven completion items for the current composer input. Returns an empty list when the host has no items or does not support completions. + /// + /// Wire method: `session.completions.request`. + /// + /// # Parameters + /// + /// * `params` - Request host-driven completions for the current composer input. + /// + /// # Returns + /// + /// Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. + /// + ///
+ /// + /// **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 request( + &self, + params: CompletionsRequestRequest, + ) -> 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_COMPLETIONS_REQUEST, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } +} + /// `session.eventLog.*` RPCs. #[derive(Clone, Copy)] pub struct SessionRpcEventLog<'a> { @@ -7998,6 +8076,42 @@ impl<'a> SessionRpcUi<'a> { Ok(serde_json::from_value(_value)?) } + /// Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action. + /// + /// Wire method: `session.ui.handlePendingSessionLimitsExhausted`. + /// + /// # Parameters + /// + /// * `params` - Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action. + /// + /// # Returns + /// + /// Indicates whether the pending UI request was resolved by this call. + /// + ///
+ /// + /// **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 handle_pending_session_limits_exhausted( + &self, + params: UIHandlePendingSessionLimitsExhaustedRequest, + ) -> 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_UI_HANDLEPENDINGSESSIONLIMITSEXHAUSTED, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Resolves a pending `exit_plan_mode.requested` event with the user's response. /// /// Wire method: `session.ui.handlePendingExitPlanMode`. diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index c5f005f3dd..af5fac2a8b 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -39,8 +39,8 @@ pub enum SessionEventType { SessionModelChange, #[serde(rename = "session.mode_changed")] SessionModeChanged, - #[serde(rename = "session.response_limits_changed")] - SessionResponseLimitsChanged, + #[serde(rename = "session.session_limits_changed")] + SessionSessionLimitsChanged, #[serde(rename = "session.permissions_changed")] SessionPermissionsChanged, #[serde(rename = "session.plan_changed")] @@ -57,6 +57,8 @@ pub enum SessionEventType { SessionSnapshotRewind, #[serde(rename = "session.shutdown")] SessionShutdown, + #[serde(rename = "session.usage_checkpoint")] + SessionUsageCheckpoint, #[serde(rename = "session.context_changed")] SessionContextChanged, #[serde(rename = "session.usage_info")] @@ -178,6 +180,10 @@ pub enum SessionEventType { AutoModeSwitchRequested, #[serde(rename = "auto_mode_switch.completed")] AutoModeSwitchCompleted, + #[serde(rename = "session_limits_exhausted.requested")] + SessionLimitsExhaustedRequested, + #[serde(rename = "session_limits_exhausted.completed")] + SessionLimitsExhaustedCompleted, #[serde(rename = "commands.changed")] CommandsChanged, #[serde(rename = "capabilities.changed")] @@ -298,8 +304,8 @@ pub enum SessionEventData { SessionModelChange(SessionModelChangeData), #[serde(rename = "session.mode_changed")] SessionModeChanged(SessionModeChangedData), - #[serde(rename = "session.response_limits_changed")] - SessionResponseLimitsChanged(SessionResponseLimitsChangedData), + #[serde(rename = "session.session_limits_changed")] + SessionSessionLimitsChanged(SessionSessionLimitsChangedData), #[serde(rename = "session.permissions_changed")] SessionPermissionsChanged(SessionPermissionsChangedData), #[serde(rename = "session.plan_changed")] @@ -316,6 +322,8 @@ pub enum SessionEventData { SessionSnapshotRewind(SessionSnapshotRewindData), #[serde(rename = "session.shutdown")] SessionShutdown(SessionShutdownData), + #[serde(rename = "session.usage_checkpoint")] + SessionUsageCheckpoint(SessionUsageCheckpointData), #[serde(rename = "session.context_changed")] SessionContextChanged(SessionContextChangedData), #[serde(rename = "session.usage_info")] @@ -430,6 +438,10 @@ pub enum SessionEventData { AutoModeSwitchRequested(AutoModeSwitchRequestedData), #[serde(rename = "auto_mode_switch.completed")] AutoModeSwitchCompleted(AutoModeSwitchCompletedData), + #[serde(rename = "session_limits_exhausted.requested")] + SessionLimitsExhaustedRequested(SessionLimitsExhaustedRequestedData), + #[serde(rename = "session_limits_exhausted.completed")] + SessionLimitsExhaustedCompleted(SessionLimitsExhaustedCompletedData), #[serde(rename = "commands.changed")] CommandsChanged(CommandsChangedData), #[serde(rename = "capabilities.changed")] @@ -568,11 +580,11 @@ pub struct WorkingDirectoryContext { pub repository_host: Option, } -/// Optional response limits. +/// Optional session limits. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct ResponseLimitsConfig { - /// Maximum AI Credits allowed while responding to one top-level user message. +pub struct SessionLimitsConfig { + /// Maximum AI Credits allowed across the session's current accounting window. #[serde(skip_serializing_if = "Option::is_none")] pub max_ai_credits: Option, } @@ -606,14 +618,14 @@ pub struct SessionStartData { /// Whether this session supports remote steering via GitHub #[serde(skip_serializing_if = "Option::is_none")] pub remote_steerable: Option, - /// Response limits configured at session creation time, if any - #[serde(skip_serializing_if = "Option::is_none")] - pub response_limits: Option, /// Model selected at session creation time, if any #[serde(skip_serializing_if = "Option::is_none")] pub selected_model: Option, /// Unique identifier for the session pub session_id: SessionId, + /// Session limits configured at session creation time, if any + #[serde(skip_serializing_if = "Option::is_none")] + pub session_limits: Option, /// ISO 8601 timestamp when the session was created pub start_time: String, /// Schema version number for the session event format @@ -650,14 +662,14 @@ pub struct SessionResumeData { /// Whether this session supports remote steering via GitHub #[serde(skip_serializing_if = "Option::is_none")] pub remote_steerable: Option, - /// Response limits currently configured at resume time; null when no limits are active - #[serde(skip_serializing_if = "Option::is_none")] - pub response_limits: Option, /// ISO 8601 timestamp when the session was resumed pub resume_time: String, /// Model currently selected at resume time #[serde(skip_serializing_if = "Option::is_none")] pub selected_model: Option, + /// Session limits currently configured at resume time; null when no limits are active + #[serde(skip_serializing_if = "Option::is_none")] + pub session_limits: Option, /// True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. #[serde(skip_serializing_if = "Option::is_none")] pub session_was_active: Option, @@ -850,12 +862,12 @@ pub struct SessionModeChangedData { pub previous_mode: SessionMode, } -/// Session event "session.response_limits_changed". Response limits update details. Null clears the limits. +/// Session event "session.session_limits_changed". Session limits update details. Null clears the limits. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionResponseLimitsChangedData { - /// Current response limits for the session, or null when no limits are active - pub response_limits: Option, +pub struct SessionSessionLimitsChangedData { + /// Current session limits, or null when no limits are active + pub session_limits: Option, } /// Session event "session.permissions_changed". Permissions change details carrying the aggregate allow-all boolean transition. @@ -1109,6 +1121,18 @@ pub struct SessionShutdownData { pub(crate) total_premium_requests: Option, } +/// Session event "session.usage_checkpoint". Durable session usage checkpoint for reconstructing aggregate accounting on resume +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionUsageCheckpointData { + /// Session-wide accumulated nano-AI units cost at checkpoint time + pub total_nano_aiu: f64, + /// Total number of premium API requests used at checkpoint time + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) total_premium_requests: Option, +} + /// Session event "session.context_changed". Updated working directory and git context after the change #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -1576,6 +1600,9 @@ pub struct AssistantMessageData { /// Readable reasoning text from the model's extended thinking #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_text: Option, + /// OpenAI-compatible wire field the provider used for reasoning (e.g. reasoning_content/reasoning). Populated only when non-canonical, so the dialect round-trips across turns. + #[serde(skip_serializing_if = "Option::is_none")] + pub reasoning_wire_field: Option, /// GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs #[serde(skip_serializing_if = "Option::is_none")] pub request_id: Option, @@ -2694,6 +2721,12 @@ pub struct PermissionRequestRead { pub kind: PermissionRequestReadKind, /// Path of the file or directory being read pub path: String, + /// True when the model has requested to run this search outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the search runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_sandbox_bypass: Option, + /// Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_sandbox_bypass_reason: Option, /// Tool call ID that triggered this permission request #[serde(skip_serializing_if = "Option::is_none")] pub tool_call_id: Option, @@ -3554,6 +3587,42 @@ pub struct AutoModeSwitchCompletedData { pub response: AutoModeSwitchResponse, } +/// Session event "session_limits_exhausted.requested". Session limit exhaustion notification requiring user action. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionLimitsExhaustedRequestedData { + /// Configured max AI Credits for the current accounting window. + pub max_ai_credits: f64, + /// Unique identifier for this request; used to respond via session.ui.handlePendingSessionLimitsExhausted(). + pub request_id: RequestId, + /// AI Credits already consumed in the current accounting window. + pub used_ai_credits: f64, +} + +/// The user's selected action for an exhausted session limit. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionLimitsExhaustedResponse { + /// Action selected by the user. + pub action: SessionLimitsExhaustedResponseAction, + /// AI Credits to add to the current max when action is 'add'. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_ai_credits: Option, + /// New absolute max AI Credits when action is 'set'. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_ai_credits: Option, +} + +/// Session event "session_limits_exhausted.completed". Session limit exhaustion prompt completion notification. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionLimitsExhaustedCompletedData { + /// Request ID of the resolved request; clients should dismiss any UI for this request. + pub request_id: RequestId, + /// The user's selected session-limit action. + pub response: SessionLimitsExhaustedResponse, +} + /// Schema for the `CommandsChangedCommand` type. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -5068,6 +5137,27 @@ pub enum AutoModeSwitchResponse { Unknown, } +/// User action selected for an exhausted session limit. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum SessionLimitsExhaustedResponseAction { + /// Increase the current max by an exact AI Credits amount. + #[serde(rename = "add")] + Add, + /// Set a new absolute max AI Credits value. + #[serde(rename = "set")] + Set, + /// Remove the current session limit. + #[serde(rename = "unset")] + Unset, + /// Leave the limit unchanged and cancel the blocked model request. + #[serde(rename = "cancel")] + Cancel, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Exit plan mode action #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum ExitPlanModeAction { diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index 56ef29cc9d..770bae27a6 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.66-2", + "@github/copilot": "^1.0.66", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", @@ -501,9 +501,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.66-2.tgz", - "integrity": "sha512-nAhhtfjpryklyombieuu18NK2g+BmEk4/8qvXVj8k+w/63tiVpLxFh865Vf6NQiVh/S7hbjMghTbrptsspYg2w==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.66.tgz", + "integrity": "sha512-m3+3FLSgum90xN4+eiwnLvdrDvM+oZzur5DfhOH88duNDKBcLQvKQY9fG/I1l1t8a1iBwjpgtRpsBwykE8k3Zw==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { @@ -513,20 +513,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.66-2", - "@github/copilot-darwin-x64": "1.0.66-2", - "@github/copilot-linux-arm64": "1.0.66-2", - "@github/copilot-linux-x64": "1.0.66-2", - "@github/copilot-linuxmusl-arm64": "1.0.66-2", - "@github/copilot-linuxmusl-x64": "1.0.66-2", - "@github/copilot-win32-arm64": "1.0.66-2", - "@github/copilot-win32-x64": "1.0.66-2" + "@github/copilot-darwin-arm64": "1.0.66", + "@github/copilot-darwin-x64": "1.0.66", + "@github/copilot-linux-arm64": "1.0.66", + "@github/copilot-linux-x64": "1.0.66", + "@github/copilot-linuxmusl-arm64": "1.0.66", + "@github/copilot-linuxmusl-x64": "1.0.66", + "@github/copilot-win32-arm64": "1.0.66", + "@github/copilot-win32-x64": "1.0.66" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.66-2.tgz", - "integrity": "sha512-gjLRtAQOdFQUOTm7nYi+zufkGxMlQlTzUyncQ3W4u1+WdGQbx5fWqMg/yd+j1yMN9PEETyF/ZHZqAaFWkEpQww==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.66.tgz", + "integrity": "sha512-cJPXE2rWSjR+B8GRBUUd0k9PM4euWRUe3xgHoJqi9o/jJjtRYn6DZMrmFt9xgjoYWf0WZOyrlDgedqO1V+zDAg==", "cpu": [ "arm64" ], @@ -541,9 +541,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.66-2.tgz", - "integrity": "sha512-wWWBsVwJtRTXqCK8lVpzwbJd3Tm1F23avf942K+PmsGYiZZYNcS5pt4umQRRj0sHKgO/muuA4eg/tMfGNi5fgA==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.66.tgz", + "integrity": "sha512-44mpx2ZcRFHDx4B9xlrL5OQyTgaD/Hn+bAkeStXgcG8UkkfYSsRtLhnaxqUEQrtIEiVQrw++XWvUO0AscRrX+w==", "cpu": [ "x64" ], @@ -558,9 +558,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.66-2.tgz", - "integrity": "sha512-j0hjx77JNFR3ZS8z3flY2j5SfGZMfKigYVFpDlTJM8FhfkMCUJ5IUhsZwSTimhHlxrsXuI31S6g0WsZLmBUe6A==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.66.tgz", + "integrity": "sha512-uXtTs/rYjk6kacNs/T0s/lxn0JBvAgu78pBoZeWpU5APhICkPy9kC+lNAzLYoZujVVDOHT05IoeifHppFpQ8+w==", "cpu": [ "arm64" ], @@ -575,9 +575,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.66-2.tgz", - "integrity": "sha512-vWaNbh4WdwkiI40Thcfbwi8tZFKo06r+Dm9Zfb8uY4wAz3X5PaGeSq+8XrNoV3uaRWltI0ncSIrq5tSOyDtRPg==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.66.tgz", + "integrity": "sha512-tXn3OuJCx/YEDNgYg8mdOGSFiIjmLJtTEyZ/VoEA86ffUIPxrunc0wnapEFk2zOW1unwdJeBuVIkzlB3RS1/eA==", "cpu": [ "x64" ], @@ -592,9 +592,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.66-2.tgz", - "integrity": "sha512-LbWy5NlWasBeV/i+Xol+8dW7kbAQr6MF46apbseRNHYkhwyF/417WtLfirP8O2hPuqyU72q/HAQziFXkz14pIQ==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.66.tgz", + "integrity": "sha512-sHRag7W5CG0kbbX3j9v9cUmIafk/0N8MGGr2knvPeIHtxwZQYYjx397gT1nN6xagLWt5mvchkYybfQFCyCBaxg==", "cpu": [ "arm64" ], @@ -609,9 +609,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.66-2.tgz", - "integrity": "sha512-djOu52fGIU7eUhQdUS0K5xB2eFdi8LTTbxvphHWlrN1AD1BdZ+VX9Pk2avt6yCfW+Hh0loh2pNsCbTfNyxvULA==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.66.tgz", + "integrity": "sha512-bdIgHOaVZlvsF/4awzMxsby6T+4k7aWe9HZr+sr+qU8tuG19jwi/1LXGB6tKdlFeFgY78yX0lR+ywByVJc5loA==", "cpu": [ "x64" ], @@ -626,9 +626,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.66-2.tgz", - "integrity": "sha512-YQu01atiwoz8XfrHKqvI1xNjnc2IIIxgJDkQ6PxwrWPZ4IO320izwlXbW2ZaOz9yDgjWNis6EJ4Ryz8K+mM6kg==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.66.tgz", + "integrity": "sha512-T7FGONCVWIPjjAxp22cu4WKqNogq56FknHGAvj7Ryn5ZoanFAR3vXXlXDsYnDKLBcshjRYGxocl2UnmRTMxgvg==", "cpu": [ "arm64" ], @@ -643,9 +643,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.66-2", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.66-2.tgz", - "integrity": "sha512-4/kTs+lKc67f7KEAQ+Gt3sEBFDSEGoUxJujddV/+fS8EAg9uF2g6e3NzS1I4+htyRM4Oq/Z6xfWjGUgQsi9rfw==", + "version": "1.0.66", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.66.tgz", + "integrity": "sha512-eroxRUSJZOJCk0luLyX6A1qqGIWs8p4w0EjZFhCzvdFvJ0abIovGyt3R/gN9DeyJM8Qs7ROPGvqevUlXh6DhCg==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index 98193f99d5..3c59cb2357 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -14,7 +14,7 @@ "node": "^20.19.0 || >=22.12.0" }, "devDependencies": { - "@github/copilot": "^1.0.66-2", + "@github/copilot": "^1.0.66", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", From 481d101e387900172674ae9254f8b89fb3bce7e4 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 30 Jun 2026 15:26:36 -0400 Subject: [PATCH 2/3] Adapt Java handwritten code to generated schema Update handwritten Java constructor calls for generated 1.0.66 RPC type shape changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- java/src/main/java/com/github/copilot/CopilotClient.java | 3 ++- java/src/main/java/com/github/copilot/CopilotSession.java | 2 +- .../copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/java/src/main/java/com/github/copilot/CopilotClient.java b/java/src/main/java/com/github/copilot/CopilotClient.java index 9384bc708c..52c0cfa486 100644 --- a/java/src/main/java/com/github/copilot/CopilotClient.java +++ b/java/src/main/java/com/github/copilot/CopilotClient.java @@ -903,6 +903,7 @@ CompletableFuture updateSessionOptionsForMode(CopilotSession session, Bool null, // workingDirectory null, // availableTools null, // excludedTools + null, // excludedBuiltinAgents null, // toolFilterPrecedence null, // enableScriptSafety null, // shellInitProfile @@ -940,7 +941,7 @@ CompletableFuture updateSessionOptionsForMode(CopilotSession session, Bool null, // enableSessionStore null, // enableSkills null, // contextTier - null // responseBudget + null // sessionLimits ); return session.getRpc().options.update(params).thenCompose(result -> { diff --git a/java/src/main/java/com/github/copilot/CopilotSession.java b/java/src/main/java/com/github/copilot/CopilotSession.java index 194ce12773..5a597dcd9a 100644 --- a/java/src/main/java/com/github/copilot/CopilotSession.java +++ b/java/src/main/java/com/github/copilot/CopilotSession.java @@ -1995,7 +1995,7 @@ public CompletableFuture setModel(String model, String reasoningEffort, St if (modelCapabilities.getSupports() != null) { var s = modelCapabilities.getSupports(); supports = new ModelCapabilitiesOverrideSupports(s.getVision().orElse(null), - s.getReasoningEffort().orElse(null)); + s.getReasoningEffort().orElse(null), null); } ModelCapabilitiesOverrideLimits limits = null; if (modelCapabilities.getLimits() != null) { diff --git a/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java b/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java index 7df3562e32..bc9d623745 100644 --- a/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java +++ b/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java @@ -834,7 +834,7 @@ void toolsListResult_nested() { void sessionModelSwitchToParams_nested_records() { var limitsVision = new ModelCapabilitiesOverrideLimitsVision(List.of("image/png", "image/jpeg"), 10L, 5000000L); var limits = new ModelCapabilitiesOverrideLimits(100000L, 8192L, 128000L, limitsVision); - var supports = new ModelCapabilitiesOverrideSupports(true, true); + var supports = new ModelCapabilitiesOverrideSupports(true, true, null); var capabilities = new ModelCapabilitiesOverride(supports, limits); var params = new SessionModelSwitchToParams("sess-m", "gpt-5", null, null, capabilities, null); From 2a05dcd8c1723e89a190c02eaa23a1d94ae24f77 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 30 Jun 2026 15:46:30 -0400 Subject: [PATCH 3/3] Update Java tests for generated type arity Adapt test constructor calls to generated 1.0.66 schema additions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../test/java/com/github/copilot/SessionEventHandlingTest.java | 2 +- .../copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java b/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java index 6e80b7593c..2e54abf9d1 100644 --- a/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java +++ b/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java @@ -865,7 +865,7 @@ private SessionStartEvent createSessionStartEvent(String sessionId) { private AssistantMessageEvent createAssistantMessageEvent(String content) { var event = new AssistantMessageEvent(); var data = new AssistantMessageEvent.AssistantMessageEventData(null, null, content, null, null, null, null, - null, null, null, null, null, null, null, null, null, null); + null, null, null, null, null, null, null, null, null, null, null); event.setData(data); return event; } diff --git a/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java b/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java index bc9d623745..3fc22412e3 100644 --- a/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java +++ b/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java @@ -799,7 +799,7 @@ void mcpDiscoverResult_nested() { @Test void modelsListResult_nested() { - var supports = new ModelCapabilitiesSupports(true, false); + var supports = new ModelCapabilitiesSupports(true, false, null); var limits = new ModelCapabilitiesLimits(100000L, 8192L, 128000L, null); var capabilities = new ModelCapabilities(supports, limits); var policy = new ModelPolicy(ModelPolicyState.ENABLED, null);