From 545a011964c99e9ed20f2045d6a426226cd8aec8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 04:25:29 +0000 Subject: [PATCH 1/2] Update @github/copilot to 1.0.78-2 - Updated nodejs and test harness dependencies - Re-ran code generators - Formatted generated code --- dotnet/src/Generated/Rpc.cs | 474 ++++++++++++++++- dotnet/src/Generated/SessionEvents.cs | 427 +++++++++++++++ go/rpc/zrpc.go | 382 +++++++++++++- go/rpc/zrpc_encoding.go | 68 +++ go/rpc/zsession_encoding.go | 51 ++ go/rpc/zsession_events.go | 157 ++++++ go/zsession_events.go | 17 + java/pom.xml | 2 +- java/scripts/codegen/package-lock.json | 72 +-- java/scripts/codegen/package.json | 2 +- .../generated/AssistantMessageEvent.java | 4 + .../generated/GitHubMcpToolConfig.java | 34 ++ .../copilot/generated/SessionStartEvent.java | 2 + .../generated/rpc/DiscoveredExtension.java | 37 ++ .../rpc/DiscoveredExtensionMode.java | 37 ++ .../rpc/DiscoveredExtensionPlugin.java | 27 + .../rpc/DiscoveredExtensionSource.java | 35 ++ .../generated/rpc/EventsCursorStatus.java | 2 +- .../generated/rpc/EventsReadDirection.java | 35 ++ .../rpc/ExtensionsDisableParams.java | 31 ++ .../rpc/ExtensionsDiscoverResult.java | 33 ++ .../generated/rpc/ExtensionsEnableParams.java | 31 ++ .../copilot/generated/rpc/SandboxConfig.java | 4 +- .../generated/rpc/ServerExtensionsApi.java | 62 +++ .../copilot/generated/rpc/ServerRpc.java | 3 + .../generated/rpc/SessionAgentApi.java | 16 + .../rpc/SessionAgentSetPromptParams.java | 34 ++ .../rpc/SessionEventLogReadParams.java | 9 +- .../rpc/SessionEventLogReadResult.java | 8 +- .../generated/rpc/SessionMcpOauthApi.java | 16 + ...OauthAuthenticationStateChangedParams.java | 34 ++ .../SessionPermissionsSetAllowAllParams.java | 2 +- nodejs/package-lock.json | 72 +-- nodejs/package.json | 2 +- nodejs/samples/package-lock.json | 2 +- nodejs/src/generated/rpc.ts | 271 +++++++++- nodejs/src/generated/session-events.ts | 246 +++++++++ python/copilot/generated/rpc.py | 493 +++++++++++++++++- python/copilot/generated/session_events.py | 379 +++++++++++++- rust/src/generated/api_types.rs | 335 +++++++++++- rust/src/generated/rpc.rs | 147 +++++- rust/src/generated/session_events.rs | 190 +++++++ test/harness/package-lock.json | 72 +-- test/harness/package.json | 2 +- 44 files changed, 4173 insertions(+), 186 deletions(-) create mode 100644 java/src/generated/java/com/github/copilot/generated/GitHubMcpToolConfig.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtension.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionMode.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionPlugin.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionSource.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/EventsReadDirection.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsDisableParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsDiscoverResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsEnableParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ServerExtensionsApi.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionAgentSetPromptParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthAuthenticationStateChangedParams.java diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index 3001520999..dd501e66f4 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -1180,6 +1180,75 @@ internal sealed class McpConfigDisableRequest public IList Names { get => field ??= []; set; } } +/// Installed plugin that contributes a discovered extension. +[Experimental(Diagnostics.Experimental)] +public sealed class DiscoveredExtensionPlugin +{ + /// Installed plugin name. + [JsonPropertyName("name")] + public string Name { get; set; } = string.Empty; +} + +/// Discovered extension metadata and persistent enablement state. +[Experimental(Diagnostics.Experimental)] +public sealed class DiscoveredExtension +{ + /// Whether this extension's persistent per-ID preference is enabled. + [JsonPropertyName("enabled")] + public bool Enabled { get; set; } + + /// Source-qualified ID accepted by both server and session extension enablement methods. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; + + /// Human-readable extension name. + [JsonPropertyName("name")] + public string Name { get; set; } = string.Empty; + + /// Absolute path to the extension entry module, suitable for revealing it in a file manager. + [JsonPropertyName("path")] + public string Path { get; set; } = string.Empty; + + /// Containing plugin metadata for plugin-contributed extensions. + [JsonPropertyName("plugin")] + public DiscoveredExtensionPlugin? Plugin { get; set; } + + /// Discovery source. + [JsonPropertyName("source")] + public DiscoveredExtensionSource Source { get; set; } +} + +/// Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included. +[Experimental(Diagnostics.Experimental)] +public sealed class DiscoveredExtensions +{ + /// Discovered user and enabled installed-plugin extensions from persisted Copilot home state. + [JsonPropertyName("extensions")] + public IList Extensions { get => field ??= []; set; } + + /// Effective extension loading mode. Defaults to load_and_augment when unset. + [JsonPropertyName("mode")] + public DiscoveredExtensionMode Mode { get; set; } +} + +/// Source-qualified extension identifiers to persistently enable for future sessions. +[Experimental(Diagnostics.Experimental)] +internal sealed class DiscoveredExtensionsEnableRequest +{ + /// Source-qualified user or plugin extension IDs to enable. + [JsonPropertyName("ids")] + public IList Ids { get => field ??= []; set; } +} + +/// Source-qualified extension identifiers to persistently disable for future sessions. +[Experimental(Diagnostics.Experimental)] +internal sealed class DiscoveredExtensionsDisableRequest +{ + /// Source-qualified user or plugin extension IDs to disable. + [JsonPropertyName("ids")] + public IList Ids { get => field ??= []; set; } +} + /// Information about an installed plugin tracked in global state. [Experimental(Diagnostics.Experimental)] public sealed class InstalledPluginInfo @@ -6093,6 +6162,23 @@ internal sealed class SessionAgentListRequestWithSession public string SessionId { get; set; } = string.Empty; } +/// An in-memory authored prompt override for an available agent. +[Experimental(Diagnostics.Experimental)] +internal sealed class AgentSetPromptRequest +{ + /// Stable effective agent id. Plugin namespace separators are normalized. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; + + /// Replacement authored prompt. Empty text is valid. + [JsonPropertyName("prompt")] + public string Prompt { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// The currently selected custom agent, or null when using the default agent. [Experimental(Diagnostics.Experimental)] public sealed class AgentGetCurrentResult @@ -7384,6 +7470,23 @@ internal sealed class McpOauthHandlePendingRequest public string SessionId { get; set; } = string.Empty; } +/// Identifies the MCP server whose persisted OAuth credentials were updated. +[Experimental(Diagnostics.Experimental)] +internal sealed class McpOauthAuthenticationStateChangedRequest +{ + /// Whether the target session must mint a session-scoped access token instead of reusing a shared access token persisted by another session. + [JsonPropertyName("refreshSessionToken")] + public bool? RefreshSessionToken { get; set; } + + /// Name of the MCP server whose OAuth credentials were updated. Omit only when the host cannot identify the server. + [JsonPropertyName("serverName")] + public string? ServerName { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server. [Experimental(Diagnostics.Experimental)] public sealed class McpOauthLoginResult @@ -8628,6 +8731,10 @@ public sealed class SandboxConfig [JsonPropertyName("addCurrentWorkingDirectory")] public bool? AddCurrentWorkingDirectory { get; set; } + /// Whether to auto-grant read access to common developer-tool caches, registries, and toolchains in their default home locations (cargo, go, npm, Maven, and more), plus read-write access to (and, on Unix, up-front creation of) the scratch caches builds write on every run (go-build, ccache, sccache, Gradle caches, Cargo lock/tracker files), so builds work without exporting CARGO_HOME/GOPATH/etc. Default: true (enabled by default; set to false to opt out). + [JsonPropertyName("allowDevToolCaches")] + public bool? AllowDevToolCaches { get; set; } + /// Whether sandboxing is enabled for the session. [JsonPropertyName("enabled")] public bool Enabled { get; set; } @@ -10551,6 +10658,7 @@ public partial class PermissionDecisionApproveOnce : PermissionDecision [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMemory), "memory")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalCustomTool), "custom-tool")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalExtensionManagement), "extension-management")] +[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalFactory), "factory")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess), "extension-permission-access")] public partial class PermissionDecisionApproveForSessionApproval { @@ -10665,6 +10773,21 @@ public partial class PermissionDecisionApproveForSessionApprovalExtensionManagem public string? Operation { get; set; } } +/// Session-scoped factory approval, optionally narrowed by approval key. +/// The factory variant of . +[Experimental(Diagnostics.Experimental)] +public partial class PermissionDecisionApproveForSessionApprovalFactory : PermissionDecisionApproveForSessionApproval +{ + /// + [JsonIgnore] + public override string Kind => "factory"; + + /// Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("approvalKey")] + public string? ApprovalKey { get; set; } +} + /// Session-scoped approval details for an extension's permission-gated capability access, keyed by extension name. /// The extension-permission-access variant of . [Experimental(Diagnostics.Experimental)] @@ -10713,6 +10836,7 @@ public partial class PermissionDecisionApproveForSession : PermissionDecision [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMemory), "memory")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalCustomTool), "custom-tool")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalExtensionManagement), "extension-management")] +[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalFactory), "factory")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess), "extension-permission-access")] public partial class PermissionDecisionApproveForLocationApproval { @@ -10827,6 +10951,21 @@ public partial class PermissionDecisionApproveForLocationApprovalExtensionManage public string? Operation { get; set; } } +/// Location-scoped factory approval, optionally narrowed by approval key. +/// The factory variant of . +[Experimental(Diagnostics.Experimental)] +public partial class PermissionDecisionApproveForLocationApprovalFactory : PermissionDecisionApproveForLocationApproval +{ + /// + [JsonIgnore] + public override string Kind => "factory"; + + /// Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("approvalKey")] + public string? ApprovalKey { get; set; } +} + /// Location-scoped approval details for an extension's permission-gated capability access, keyed by extension name. /// The extension-permission-access variant of . [Experimental(Diagnostics.Experimental)] @@ -11140,7 +11279,7 @@ internal sealed class PermissionsSetAllowAllRequest [JsonPropertyName("mode")] public PermissionsAllowAllMode? Mode { get; set; } - /// Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session's active model is used. + /// Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session resolves a default judge model: `gpt-5.5` for CAPI sessions and the session's active model for BYOK sessions. [JsonPropertyName("model")] public string? Model { get; set; } @@ -11476,6 +11615,7 @@ public sealed class PermissionsLocationsAddToolApprovalResult [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsMemory), "memory")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsCustomTool), "custom-tool")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsExtensionManagement), "extension-management")] +[JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsFactory), "factory")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess), "extension-permission-access")] public partial class PermissionsLocationsAddToolApprovalDetails { @@ -11590,6 +11730,21 @@ public partial class PermissionsLocationsAddToolApprovalDetailsExtensionManageme public string? Operation { get; set; } } +/// Location-persisted factory approval, optionally narrowed by approval key. +/// The factory variant of . +[Experimental(Diagnostics.Experimental)] +public partial class PermissionsLocationsAddToolApprovalDetailsFactory : PermissionsLocationsAddToolApprovalDetails +{ + /// + [JsonIgnore] + public override string Kind => "factory"; + + /// Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("approvalKey")] + public string? ApprovalKey { get; set; } +} + /// Location-persisted tool approval details for an extension's permission-gated capability access, keyed by extension name. /// The extension-permission-access variant of . [Experimental(Diagnostics.Experimental)] @@ -13376,19 +13531,19 @@ internal sealed class SessionQueueProcessRequest [Experimental(Diagnostics.Experimental)] public sealed class EventsReadResult { - /// Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. + /// Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. For a backward read this cursor pages toward OLDER events; keep passing `direction: backward` with it (the cursor is also self-describing, so backward paging continues correctly). [JsonPropertyName("cursor")] public string Cursor { get; set; } = string.Empty; - /// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. + /// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history. For a forward read the fallback starts from the beginning of the remaining history; for a backward read it falls back to the tail (the newest window). Because the fallback page is a fresh boundary snapshot rather than a continuation of the requested cursor, it may overlap events the consumer has already rendered — a backward fallback to the tail in particular can repeat the newest window. On 'expired', consumers should reset or rebase their local pagination state (or deduplicate by event id) before continuing from the returned cursor rather than blindly appending/prepending the fallback page. [JsonPropertyName("cursorStatus")] public EventsCursorStatus CursorStatus { get; set; } - /// Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. + /// Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window contains persisted events only, still in chronological (oldest-to-newest) append order. [JsonPropertyName("events")] public IList Events { get => field ??= []; set; } - /// True when the read returned `max` events and more events are available immediately. When false, the next read with a non-zero `waitMs` will block until a new event arrives or the wait expires. + /// True when more events are available in the read's direction. For a forward read, true means the batch returned `max` events and more are available immediately. For a backward read, true means older persisted events remain before the returned window. [JsonPropertyName("hasMore")] public bool HasMore { get; set; } } @@ -13397,6 +13552,10 @@ public sealed class EventsReadResult [Experimental(Diagnostics.Experimental)] internal sealed class EventLogReadRequest { + /// Optional non-empty list of subagent identifiers. When provided, only events owned by one of these agents are returned; ownership recognizes the event envelope's agentId plus legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over agentScope. + [JsonPropertyName("agentIds")] + public IList? AgentIds { get; set; } + /// Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers. [JsonPropertyName("agentScope")] public EventsAgentScope? AgentScope { get; set; } @@ -13405,7 +13564,11 @@ internal sealed class EventLogReadRequest [JsonPropertyName("cursor")] public string? Cursor { get; set; } - /// When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). + /// Direction to page through the session's persisted event history. 'forward' (default) pages from the cursor toward newer events (or from the start of history when no cursor is given). 'backward' enables tail-first reads: with no cursor it returns the NEWEST `max` events, and the returned cursor pages toward OLDER events on subsequent backward reads. Events within a returned batch are always in chronological (oldest-to-newest) order, even for a backward read. Backward reads cover PERSISTED history only; ephemeral events are never returned by a backward read. `direction` selects the INITIAL read only: the returned cursor is self-describing, so a continuation read pages in the cursor's own direction regardless of the `direction` passed alongside it — a forward cursor always pages forward and a backward cursor always pages backward. Pass the direction that matches the cursor to avoid confusion. + [JsonPropertyName("direction")] + public EventsReadDirection? Direction { get; set; } + + /// When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). Ignored by backward reads, which always cover persisted history only. [JsonPropertyName("includeEphemeral")] public bool? IncludeEphemeral { get; set; } @@ -13421,7 +13584,7 @@ internal sealed class EventLogReadRequest [JsonPropertyName("types")] public JsonElement? Types { get; set; } - /// Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). + /// Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). This applies to forward reads only: a backward read always returns immediately and ignores `waitMs`, because backward paging covers persisted history only while new events append at the tail (the opposite end from a backward page), so no blocking or ephemeral delivery can occur. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonPropertyName("waitMs")] public TimeSpan? Wait { get; set; } @@ -15277,6 +15440,135 @@ public override void Write(Utf8JsonWriter writer, DiscoveredMcpServerType value, } +/// Persisted extension discovery source. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct DiscoveredExtensionSource : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public DiscoveredExtensionSource(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Extension discovered from the user's extensions directory. + public static DiscoveredExtensionSource User { get; } = new("user"); + + /// Extension contributed by an installed plugin. + public static DiscoveredExtensionSource Plugin { get; } = new("plugin"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(DiscoveredExtensionSource left, DiscoveredExtensionSource right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(DiscoveredExtensionSource left, DiscoveredExtensionSource right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is DiscoveredExtensionSource other && Equals(other); + + /// + public bool Equals(DiscoveredExtensionSource 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 DiscoveredExtensionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, DiscoveredExtensionSource value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(DiscoveredExtensionSource)); + } + } +} + + +/// Effective extension loading and agent-management mode. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct DiscoveredExtensionMode : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public DiscoveredExtensionMode(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Extensions are not loaded. + public static DiscoveredExtensionMode Disabled { get; } = new("disabled"); + + /// Extensions are loaded, but the agent cannot create, reload, or manage them. + public static DiscoveredExtensionMode LoadOnly { get; } = new("load_only"); + + /// Extensions are loaded and the agent can create, reload, and manage them. + public static DiscoveredExtensionMode LoadAndAugment { get; } = new("load_and_augment"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(DiscoveredExtensionMode left, DiscoveredExtensionMode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(DiscoveredExtensionMode left, DiscoveredExtensionMode right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is DiscoveredExtensionMode other && Equals(other); + + /// + public bool Equals(DiscoveredExtensionMode 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 DiscoveredExtensionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, DiscoveredExtensionMode value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(DiscoveredExtensionMode)); + } + } +} + + /// Which tier this directory belongs to. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -21780,7 +22072,7 @@ public override void Write(Utf8JsonWriter writer, QueuePendingItemsKind value, J } -/// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. +/// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history (the beginning for a forward read, the tail for a backward read). The fallback page is a fresh boundary snapshot, not a continuation of the requested cursor, so it may overlap already-rendered events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate by event id) before continuing from the returned cursor. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -21906,6 +22198,69 @@ public override void Write(Utf8JsonWriter writer, EventsAgentScope value, JsonSe } +/// Direction to page through the session's persisted event history. 'forward' pages from the cursor toward newer events; 'backward' returns the newest window first (tail-first) and pages toward older events. Events within a returned batch are always chronological (oldest-to-newest), even for a backward read. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct EventsReadDirection : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public EventsReadDirection(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Page from the cursor toward newer events (default). + public static EventsReadDirection Forward { get; } = new("forward"); + + /// Tail-first: return the newest events and page toward older events. + public static EventsReadDirection Backward { get; } = new("backward"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(EventsReadDirection left, EventsReadDirection right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(EventsReadDirection left, EventsReadDirection right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is EventsReadDirection other && Equals(other); + + /// + public bool Equals(EventsReadDirection 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 EventsReadDirection Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, EventsReadDirection value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(EventsReadDirection)); + } + } +} + + /// Client population used for the prediction baseline. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -22680,6 +23035,12 @@ internal async Task ConnectAsync(string? token = null, bool? enab Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; + /// Extensions APIs. + public ServerExtensionsApi Extensions => + field ?? + Interlocked.CompareExchange(ref field, new(_rpc), null) ?? + field; + /// Plugins APIs. public ServerPluginsApi Plugins => field ?? @@ -23003,6 +23364,48 @@ public async Task ReloadAsync(CancellationToken cancellationToken = default) } } +/// Provides server-scoped Extensions APIs. +[Experimental(Diagnostics.Experimental)] +public sealed class ServerExtensionsApi +{ + private readonly JsonRpc _rpc; + + internal ServerExtensionsApi(JsonRpc rpc) + { + _rpc = rpc; + } + + /// Discovers user and enabled installed-plugin extensions from persisted Copilot home state, including enablement preferences. Launch-scoped additional plugins are not included. + /// The to monitor for cancellation requests. The default is . + /// Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included. + public async Task DiscoverAsync(CancellationToken cancellationToken = default) + { + return await CopilotClient.InvokeRpcAsync(_rpc, "extensions.discover", [], cancellationToken); + } + + /// Persistently enables extension IDs for future sessions. Active sessions are unchanged; use session.extensions.enable to update them. + /// Source-qualified user or plugin extension IDs to enable. + /// The to monitor for cancellation requests. The default is . + public async Task EnableAsync(IList ids, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(ids); + + var request = new DiscoveredExtensionsEnableRequest { Ids = ids }; + await CopilotClient.InvokeRpcAsync(_rpc, "extensions.enable", [request], cancellationToken); + } + + /// Persistently disables extension IDs for future sessions. Active sessions are unchanged; use session.extensions.disable to update them. + /// Source-qualified user or plugin extension IDs to disable. + /// The to monitor for cancellation requests. The default is . + public async Task DisableAsync(IList ids, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(ids); + + var request = new DiscoveredExtensionsDisableRequest { Ids = ids }; + await CopilotClient.InvokeRpcAsync(_rpc, "extensions.disable", [request], cancellationToken); + } +} + /// Provides server-scoped Plugins APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerPluginsApi @@ -25152,6 +25555,20 @@ public async Task ListAsync(SessionAgentListRequest? request = null, return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.agent.list", [rpcRequest], cancellationToken); } + /// Sets an in-memory authored prompt override for an available agent. For built-in agents, this replaces only the static base prompt while preserving runtime-owned dynamic prompt composition and behavior. The special `general-purpose` agent is not overrideable. Overrides are not persisted; resumed and forked sessions start without them, so the host must re-apply them. + /// Stable effective agent id. Plugin namespace separators are normalized. + /// Replacement authored prompt. Empty text is valid. + /// The to monitor for cancellation requests. The default is . + public async Task SetPromptAsync(string id, string prompt, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(id); + ArgumentNullException.ThrowIfNull(prompt); + _session.ThrowIfDisposed(); + + var request = new AgentSetPromptRequest { SessionId = _session.SessionId, Id = id, Prompt = prompt }; + await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.agent.setPrompt", [request], cancellationToken); + } + /// Gets the currently selected custom agent for the session. /// The to monitor for cancellation requests. The default is . /// The currently selected custom agent, or null when using the default agent. @@ -25713,6 +26130,18 @@ public async Task HandlePendingRequestAsync(string return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.oauth.handlePendingRequest", [request], cancellationToken); } + /// Notifies the session that MCP OAuth authentication succeeded and updated credentials were persisted, so cached tool definitions can be refreshed. + /// Name of the MCP server whose OAuth credentials were updated. Omit only when the host cannot identify the server. + /// Whether the target session must mint a session-scoped access token instead of reusing a shared access token persisted by another session. + /// The to monitor for cancellation requests. The default is . + public async Task AuthenticationStateChangedAsync(string? serverName = null, bool? refreshSessionToken = null, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new McpOauthAuthenticationStateChangedRequest { SessionId = _session.SessionId, ServerName = serverName, RefreshSessionToken = refreshSessionToken }; + await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.oauth.authenticationStateChanged", [request], cancellationToken); + } + /// Starts OAuth authentication for a remote MCP server. /// Name of the remote MCP server to authenticate. /// When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck. @@ -26586,7 +27015,7 @@ public async Task SetApproveAllAsync(bool enable /// Sets the allow-all permission mode for the session. Used by attach-mode clients (e.g. LocalRpcSession's `/allow-all` forwarder) to flip the target session's permission state. The `on` mode swaps in unrestricted path and URL managers and emits `session.permissions_changed` on transition; the `auto` mode keeps normal prompt paths active while attaching LLM safety recommendations. The result returns the authoritative post-mutation state so callers can update their local mirrors without racing the `session.permissions_changed` notification on the same wire. /// Allow-all mode to apply. `on` enables full allow-all; `auto` enables advisory LLM auto-approval; `off` disables both. /// Legacy full allow-all toggle. Prefer `mode`; when `mode` is omitted, `enabled: true` is treated as `mode: "on"` and any other value is treated as `mode: "off"`. - /// Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session's active model is used. + /// Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session resolves a default judge model: `gpt-5.5` for CAPI sessions and the session's active model for BYOK sessions. /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded and reports the post-mutation state. @@ -27476,20 +27905,22 @@ internal EventLogApi(CopilotSession session) _session = session; } - /// Reads a batch of session events from a cursor, optionally waiting for new events. + /// Reads a batch of session events from a cursor, optionally waiting for new events. Supports tail-first reads via `direction: backward`. /// Opaque cursor returned by a previous read. Omit on the first call to start from the beginning of the session's persisted history. /// Maximum number of events to return in this batch (1–1000, default 200). - /// Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). + /// Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). This applies to forward reads only: a backward read always returns immediately and ignores `waitMs`, because backward paging covers persisted history only while new events append at the tail (the opposite end from a backward page), so no blocking or ephemeral delivery can occur. /// Either '*' to receive all event types, or a non-empty list of event types to receive. /// Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers. - /// When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). + /// Optional non-empty list of subagent identifiers. When provided, only events owned by one of these agents are returned; ownership recognizes the event envelope's agentId plus legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over agentScope. + /// Direction to page through the session's persisted event history. 'forward' (default) pages from the cursor toward newer events (or from the start of history when no cursor is given). 'backward' enables tail-first reads: with no cursor it returns the NEWEST `max` events, and the returned cursor pages toward OLDER events on subsequent backward reads. Events within a returned batch are always in chronological (oldest-to-newest) order, even for a backward read. Backward reads cover PERSISTED history only; ephemeral events are never returned by a backward read. `direction` selects the INITIAL read only: the returned cursor is self-describing, so a continuation read pages in the cursor's own direction regardless of the `direction` passed alongside it — a forward cursor always pages forward and a backward cursor always pages backward. Pass the direction that matches the cursor to avoid confusion. + /// When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). Ignored by backward reads, which always cover persisted history only. /// The to monitor for cancellation requests. The default is . /// Batch of session events returned by a read, with cursor and continuation metadata. - public async Task ReadAsync(string? cursor = null, long? max = null, TimeSpan? waitMs = null, object? types = null, EventsAgentScope? agentScope = null, bool? includeEphemeral = null, CancellationToken cancellationToken = default) + public async Task ReadAsync(string? cursor = null, long? max = null, TimeSpan? waitMs = null, object? types = null, EventsAgentScope? agentScope = null, IList? agentIds = null, EventsReadDirection? direction = null, bool? includeEphemeral = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); - var request = new EventLogReadRequest { SessionId = _session.SessionId, Cursor = cursor, Max = max, Wait = waitMs, Types = CopilotClient.ToJsonElementForWire(types), AgentScope = agentScope, IncludeEphemeral = includeEphemeral }; + var request = new EventLogReadRequest { SessionId = _session.SessionId, Cursor = cursor, Max = max, Wait = waitMs, Types = CopilotClient.ToJsonElementForWire(types), AgentScope = agentScope, AgentIds = agentIds, Direction = direction, IncludeEphemeral = includeEphemeral }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.eventLog.read", [request], cancellationToken); } @@ -28251,8 +28682,11 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.ExternalToolCompletedEvent), TypeInfoPropertyName = "SessionEventsExternalToolCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.ExternalToolRequestedData), TypeInfoPropertyName = "SessionEventsExternalToolRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.ExternalToolRequestedEvent), TypeInfoPropertyName = "SessionEventsExternalToolRequestedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.FactoryPermissionOperation), TypeInfoPropertyName = "SessionEventsFactoryPermissionOperation")] +[JsonSerializable(typeof(GitHub.Copilot.FactoryPermissionPhase), TypeInfoPropertyName = "SessionEventsFactoryPermissionPhase")] [JsonSerializable(typeof(GitHub.Copilot.FactoryRunUpdatedData), TypeInfoPropertyName = "SessionEventsFactoryRunUpdatedData")] [JsonSerializable(typeof(GitHub.Copilot.FactoryRunUpdatedEvent), TypeInfoPropertyName = "SessionEventsFactoryRunUpdatedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.GitHubMcpToolConfig), TypeInfoPropertyName = "SessionEventsGitHubMcpToolConfig")] [JsonSerializable(typeof(GitHub.Copilot.GitHubRepoRef), TypeInfoPropertyName = "SessionEventsGitHubRepoRef")] [JsonSerializable(typeof(GitHub.Copilot.HandoffRepository), TypeInfoPropertyName = "SessionEventsHandoffRepository")] [JsonSerializable(typeof(GitHub.Copilot.HandoffSourceType), TypeInfoPropertyName = "SessionEventsHandoffSourceType")] @@ -28317,6 +28751,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestCustomTool), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestCustomTool")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestExtensionManagement), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestExtensionManagement")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestExtensionPermissionAccess), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestExtensionPermissionAccess")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestFactory), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestFactory")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestHook), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestHook")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestMcp), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestMcp")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestMemory), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestMemory")] @@ -28329,6 +28764,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestCustomTool), TypeInfoPropertyName = "SessionEventsPermissionRequestCustomTool")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestExtensionManagement), TypeInfoPropertyName = "SessionEventsPermissionRequestExtensionManagement")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestExtensionPermissionAccess), TypeInfoPropertyName = "SessionEventsPermissionRequestExtensionPermissionAccess")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionRequestFactory), TypeInfoPropertyName = "SessionEventsPermissionRequestFactory")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestHook), TypeInfoPropertyName = "SessionEventsPermissionRequestHook")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestMcp), TypeInfoPropertyName = "SessionEventsPermissionRequestMcp")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestMemory), TypeInfoPropertyName = "SessionEventsPermissionRequestMemory")] @@ -28396,6 +28832,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationAgentIdle), TypeInfoPropertyName = "SessionEventsSystemNotificationAgentIdle")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationData), TypeInfoPropertyName = "SessionEventsSystemNotificationData")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationEvent), TypeInfoPropertyName = "SessionEventsSystemNotificationEvent")] +[JsonSerializable(typeof(GitHub.Copilot.SystemNotificationFactoryCompleted), TypeInfoPropertyName = "SessionEventsSystemNotificationFactoryCompleted")] +[JsonSerializable(typeof(GitHub.Copilot.SystemNotificationFactoryCompletedStatus), TypeInfoPropertyName = "SessionEventsSystemNotificationFactoryCompletedStatus")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationInstructionDiscovered), TypeInfoPropertyName = "SessionEventsSystemNotificationInstructionDiscovered")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationNewInboxMessage), TypeInfoPropertyName = "SessionEventsSystemNotificationNewInboxMessage")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationShellCompleted), TypeInfoPropertyName = "SessionEventsSystemNotificationShellCompleted")] @@ -28457,6 +28895,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalCustomTool), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalCustomTool")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalExtensionManagement), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalExtensionManagement")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalExtensionPermissionAccess), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalExtensionPermissionAccess")] +[JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalFactory), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalFactory")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalMcp), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalMcp")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalMemory), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalMemory")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalRead), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalRead")] @@ -28488,6 +28927,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(AgentReloadResult))] [JsonSerializable(typeof(AgentSelectRequest))] [JsonSerializable(typeof(AgentSelectResult))] +[JsonSerializable(typeof(AgentSetPromptRequest))] [JsonSerializable(typeof(AgentsDiscoverRequest))] [JsonSerializable(typeof(AgentsGetDiscoveryPathsRequest))] [JsonSerializable(typeof(AllowAllPermissionSetResult))] @@ -28547,6 +28987,11 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(DebugCollectLogsResult))] [JsonSerializable(typeof(DebugCollectLogsSkippedEntry))] [JsonSerializable(typeof(DiscoveredCanvas))] +[JsonSerializable(typeof(DiscoveredExtension))] +[JsonSerializable(typeof(DiscoveredExtensionPlugin))] +[JsonSerializable(typeof(DiscoveredExtensions))] +[JsonSerializable(typeof(DiscoveredExtensionsDisableRequest))] +[JsonSerializable(typeof(DiscoveredExtensionsEnableRequest))] [JsonSerializable(typeof(DiscoveredMcpServer))] [JsonSerializable(typeof(EnqueueCommandParams))] [JsonSerializable(typeof(EnqueueCommandResult))] @@ -28693,6 +29138,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(McpIsServerRunningResult))] [JsonSerializable(typeof(McpListToolsRequest))] [JsonSerializable(typeof(McpListToolsResult))] +[JsonSerializable(typeof(McpOauthAuthenticationStateChangedRequest))] [JsonSerializable(typeof(McpOauthHandlePendingRequest))] [JsonSerializable(typeof(McpOauthHandlePendingResult))] [JsonSerializable(typeof(McpOauthLoginRequest))] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index 6266daeec0..a9899b9e4f 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -1700,6 +1700,11 @@ public sealed partial class SessionStartData [JsonPropertyName("detachedFromSpawningParentSessionId")] public string? DetachedFromSpawningParentSessionId { get; set; } + /// Per-session GitHub MCP override persisted for cold resume. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("githubMcpToolConfig")] + public GitHubMcpToolConfig? GitHubMcpToolConfig { get; set; } + /// Identifier of the software producing the events (e.g., "copilot-agent"). [JsonPropertyName("producer")] public required string Producer { get; set; } @@ -2770,6 +2775,16 @@ public sealed partial class AssistantMessageData [JsonPropertyName("apiCallId")] public string? ApiCallId { get; set; } + /// Total messages the model call's response was split into, one per reasoning boundary. Absent for a single-message response; the last chunk is the one where chunkIndex is chunkCount - 1. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("chunkCount")] + public long? ChunkCount { get; set; } + + /// Zero-based position of this message within its model call's response. Absent when the response was not split into chunks. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("chunkIndex")] + public long? ChunkIndex { get; set; } + /// Provider-agnostic citations linking spans of this message's content to the sources that support them. Experimental; only populated when citation emission is enabled. [Experimental(Diagnostics.Experimental)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -4716,6 +4731,31 @@ public sealed partial class WorkingDirectoryContext public string? RepositoryHost { get; set; } } +/// Per-session configuration for the built-in GitHub MCP server. +/// Nested data type for GitHubMcpToolConfig. +public sealed partial class GitHubMcpToolConfig +{ + /// Additional GitHub MCP tools requested by the session. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("additionalTools")] + public string[]? AdditionalTools { get; set; } + + /// Additional GitHub MCP toolsets requested by the session. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("additionalToolsets")] + public string[]? AdditionalToolsets { get; set; } + + /// Whether to use the read-write endpoint and request all toolsets. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("enableAllTools")] + public bool? EnableAllTools { get; set; } + + /// Whether to request the GitHub MCP insiders build. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("enableInsidersMode")] + public bool? EnableInsidersMode { get; set; } +} + /// Optional session limits. /// Nested data type for SessionLimitsConfig. public sealed partial class SessionLimitsConfig @@ -6884,6 +6924,60 @@ public sealed partial class SystemNotificationInstructionDiscovered : SystemNoti public required string TriggerTool { get; set; } } +/// System notification metadata for a factory execution attempt that reached a terminal state. +/// The factory_completed variant of . +public sealed partial class SystemNotificationFactoryCompleted : SystemNotification +{ + /// + [JsonIgnore] + public override string Type => "factory_completed"; + + /// Execution attempt that reached this terminal state. + [JsonPropertyName("attempt")] + public required long Attempt { get; set; } + + /// Consumed AI usage in nano-AIU. + [JsonPropertyName("consumedNanoAiu")] + public required long ConsumedNanoAiu { get; set; } + + /// Subagents consumed by the run across all attempts. + [JsonPropertyName("consumedSubagents")] + public required long ConsumedSubagents { get; set; } + + /// Accumulated active execution time in milliseconds. + [JsonPropertyName("elapsedMs")] + public required long ElapsedMs { get; set; } + + /// Persisted factory name. + [JsonPropertyName("factoryName")] + public required string FactoryName { get; set; } + + /// Machine-readable terminal failure details, when present. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("failure")] + public JsonElement? Failure { get; set; } + + /// Bounded prompt-safe preview of the completed result. + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] + [MaxLength(256)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("resultPreview")] + public string? ResultPreview { get; set; } + + /// Actionable run_factory resume guidance for a resource-limit failure. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("retryGuidance")] + public string? RetryGuidance { get; set; } + + /// Factory run identifier. + [JsonPropertyName("runId")] + public required string RunId { get; set; } + + /// Terminal status reached by this execution attempt. + [JsonPropertyName("status")] + public required SystemNotificationFactoryCompletedStatus Status { get; set; } +} + /// System notification metadata from an external host that does not match a runtime-owned notification kind. /// The unclassified variant of . public sealed partial class SystemNotificationUnclassified : SystemNotification @@ -6909,6 +7003,7 @@ public sealed partial class SystemNotificationUnclassified : SystemNotification [JsonDerivedType(typeof(SystemNotificationShellCompleted), "shell_completed")] [JsonDerivedType(typeof(SystemNotificationShellDetachedCompleted), "shell_detached_completed")] [JsonDerivedType(typeof(SystemNotificationInstructionDiscovered), "instruction_discovered")] +[JsonDerivedType(typeof(SystemNotificationFactoryCompleted), "factory_completed")] [JsonDerivedType(typeof(SystemNotificationUnclassified), "unclassified")] public partial class SystemNotification { @@ -7321,6 +7416,98 @@ public sealed partial class PermissionRequestExtensionManagement : PermissionReq public string? ToolCallId { get; set; } } +/// A declared phase shown in a factory permission prompt. +/// Nested data type for FactoryPermissionPhase. +public sealed partial class FactoryPermissionPhase +{ + /// Optional phase detail. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("detail")] + public string? Detail { get; set; } + + /// Phase title. + [JsonPropertyName("title")] + public required string Title { get; set; } +} + +/// Factory run or authoring permission request. +/// The factory variant of . +public sealed partial class PermissionRequestFactory : PermissionRequest +{ + /// + [JsonIgnore] + public override string Kind => "factory"; + + /// Canonical key used for scoped factory approvals. + [JsonPropertyName("approvalKey")] + public required string ApprovalKey { get; set; } + + /// Whether this factory is eligible for persistent approval. + [JsonPropertyName("canPersistApproval")] + public required bool CanPersistApproval { get; set; } + + /// Gets or sets the declaredMaxAiCredits value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("declaredMaxAiCredits")] + public double? DeclaredMaxAiCredits { get; set; } + + /// Gets or sets the declaredMaxConcurrentSubagents value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("declaredMaxConcurrentSubagents")] + public long? DeclaredMaxConcurrentSubagents { get; set; } + + /// Gets or sets the declaredMaxTotalSubagents value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("declaredMaxTotalSubagents")] + public long? DeclaredMaxTotalSubagents { get; set; } + + /// Gets or sets the declaredTimeoutSeconds value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("declaredTimeoutSeconds")] + public double? DeclaredTimeoutSeconds { get; set; } + + /// Factory description. + [JsonPropertyName("description")] + public required string Description { get; set; } + + /// Effective AI-credit limit; omitted means unlimited. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("maxAiCredits")] + public double? MaxAiCredits { get; set; } + + /// Effective concurrent-subagent limit; omitted means unlimited. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("maxConcurrentSubagents")] + public long? MaxConcurrentSubagents { get; set; } + + /// Effective total-subagent limit; omitted means unlimited. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("maxTotalSubagents")] + public long? MaxTotalSubagents { get; set; } + + /// Factory name. + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// Factory operation, either run or author. + [JsonPropertyName("operation")] + public required FactoryPermissionOperation Operation { get; set; } + + /// Declared factory phases. + [JsonPropertyName("phases")] + public required FactoryPermissionPhase[] Phases { get; set; } + + /// Effective active-time limit in seconds; omitted means unlimited. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { get; set; } + + /// Tool call ID that triggered this permission request. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("toolCallId")] + public string? ToolCallId { get; set; } +} + /// Extension permission access request. /// The extension-permission-access variant of . public sealed partial class PermissionRequestExtensionPermissionAccess : PermissionRequest @@ -7357,6 +7544,7 @@ public sealed partial class PermissionRequestExtensionPermissionAccess : Permiss [JsonDerivedType(typeof(PermissionRequestCustomTool), "custom-tool")] [JsonDerivedType(typeof(PermissionRequestHook), "hook")] [JsonDerivedType(typeof(PermissionRequestExtensionManagement), "extension-management")] +[JsonDerivedType(typeof(PermissionRequestFactory), "factory")] [JsonDerivedType(typeof(PermissionRequestExtensionPermissionAccess), "extension-permission-access")] public partial class PermissionRequest { @@ -7779,6 +7967,95 @@ public sealed partial class PermissionPromptRequestExtensionManagement : Permiss public string? ToolCallId { get; set; } } +/// Factory run or authoring permission prompt. +/// The factory variant of . +public sealed partial class PermissionPromptRequestFactory : PermissionPromptRequest +{ + /// + [JsonIgnore] + public override string Kind => "factory"; + + /// Canonical key used for scoped factory approvals. + [JsonPropertyName("approvalKey")] + public required string ApprovalKey { get; set; } + + /// Auto-approval judge information for this request; present only when auto mode is enabled. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("autoApproval")] + public PermissionAutoApproval? AutoApproval { get; set; } + + /// Whether this factory is eligible for persistent approval. + [JsonPropertyName("canPersistApproval")] + public required bool CanPersistApproval { get; set; } + + /// Gets or sets the declaredMaxAiCredits value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("declaredMaxAiCredits")] + public double? DeclaredMaxAiCredits { get; set; } + + /// Gets or sets the declaredMaxConcurrentSubagents value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("declaredMaxConcurrentSubagents")] + public long? DeclaredMaxConcurrentSubagents { get; set; } + + /// Gets or sets the declaredMaxTotalSubagents value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("declaredMaxTotalSubagents")] + public long? DeclaredMaxTotalSubagents { get; set; } + + /// Gets or sets the declaredTimeoutSeconds value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("declaredTimeoutSeconds")] + public double? DeclaredTimeoutSeconds { get; set; } + + /// Factory description. + [JsonPropertyName("description")] + public required string Description { get; set; } + + /// Whether managed policy requires a human response and forbids host auto-approval. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("managedApprovalRequired")] + public bool? ManagedApprovalRequired { get; set; } + + /// Effective AI-credit limit; omitted means unlimited. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("maxAiCredits")] + public double? MaxAiCredits { get; set; } + + /// Effective concurrent-subagent limit; omitted means unlimited. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("maxConcurrentSubagents")] + public long? MaxConcurrentSubagents { get; set; } + + /// Effective total-subagent limit; omitted means unlimited. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("maxTotalSubagents")] + public long? MaxTotalSubagents { get; set; } + + /// Factory name. + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// Factory operation, either run or author. + [JsonPropertyName("operation")] + public required FactoryPermissionOperation Operation { get; set; } + + /// Declared factory phases. + [JsonPropertyName("phases")] + public required FactoryPermissionPhase[] Phases { get; set; } + + /// Effective active-time limit in seconds; omitted means unlimited. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { get; set; } + + /// Tool call ID that triggered this permission request. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("toolCallId")] + public string? ToolCallId { get; set; } +} + /// Extension permission access prompt. /// The extension-permission-access variant of . public sealed partial class PermissionPromptRequestExtensionPermissionAccess : PermissionPromptRequest @@ -7822,6 +8099,7 @@ public sealed partial class PermissionPromptRequestExtensionPermissionAccess : P [JsonDerivedType(typeof(PermissionPromptRequestPath), "path")] [JsonDerivedType(typeof(PermissionPromptRequestHook), "hook")] [JsonDerivedType(typeof(PermissionPromptRequestExtensionManagement), "extension-management")] +[JsonDerivedType(typeof(PermissionPromptRequestFactory), "factory")] [JsonDerivedType(typeof(PermissionPromptRequestExtensionPermissionAccess), "extension-permission-access")] public partial class PermissionPromptRequest { @@ -7924,6 +8202,20 @@ public sealed partial class UserToolSessionApprovalExtensionManagement : UserToo public string? Operation { get; set; } } +/// Session-scoped factory approval, optionally narrowed by approval key. +/// The factory variant of . +public sealed partial class UserToolSessionApprovalFactory : UserToolSessionApproval +{ + /// + [JsonIgnore] + public override string Kind => "factory"; + + /// Optional factory operation name or canonical approval key. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("approvalKey")] + public string? ApprovalKey { get; set; } +} + /// Session-scoped tool-approval rule for an extension's permission-gated capability access, keyed by extension name. /// The extension-permission-access variant of . public sealed partial class UserToolSessionApprovalExtensionPermissionAccess : UserToolSessionApproval @@ -7949,6 +8241,7 @@ public sealed partial class UserToolSessionApprovalExtensionPermissionAccess : U [JsonDerivedType(typeof(UserToolSessionApprovalMemory), "memory")] [JsonDerivedType(typeof(UserToolSessionApprovalCustomTool), "custom-tool")] [JsonDerivedType(typeof(UserToolSessionApprovalExtensionManagement), "extension-management")] +[JsonDerivedType(typeof(UserToolSessionApprovalFactory), "factory")] [JsonDerivedType(typeof(UserToolSessionApprovalExtensionPermissionAccess), "extension-permission-access")] public partial class UserToolSessionApproval { @@ -10818,6 +11111,73 @@ public override void Write(Utf8JsonWriter writer, SystemNotificationAgentComplet } } +/// Terminal status reached by a factory execution attempt. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct SystemNotificationFactoryCompletedStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public SystemNotificationFactoryCompletedStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The factory completed successfully. + public static SystemNotificationFactoryCompletedStatus Completed { get; } = new("completed"); + + /// The factory was halted. + public static SystemNotificationFactoryCompletedStatus Halted { get; } = new("halted"); + + /// The factory was cancelled. + public static SystemNotificationFactoryCompletedStatus Cancelled { get; } = new("cancelled"); + + /// The factory failed. + public static SystemNotificationFactoryCompletedStatus Error { get; } = new("error"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(SystemNotificationFactoryCompletedStatus left, SystemNotificationFactoryCompletedStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(SystemNotificationFactoryCompletedStatus left, SystemNotificationFactoryCompletedStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is SystemNotificationFactoryCompletedStatus other && Equals(other); + + /// + public bool Equals(SystemNotificationFactoryCompletedStatus 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 SystemNotificationFactoryCompletedStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, SystemNotificationFactoryCompletedStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SystemNotificationFactoryCompletedStatus)); + } + } +} + /// Whether this is a store or vote memory operation. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -10940,6 +11300,67 @@ public override void Write(Utf8JsonWriter writer, PermissionRequestMemoryDirecti } } +/// Operation gated by a factory permission request. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FactoryPermissionOperation : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FactoryPermissionOperation(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Running a registered factory, which spends subagents, active time, and AI credits under the approved limits. + public static FactoryPermissionOperation Run { get; } = new("run"); + + /// Authoring a factory, which writes JavaScript into a session-scoped extension and loads it. + public static FactoryPermissionOperation Author { get; } = new("author"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FactoryPermissionOperation left, FactoryPermissionOperation right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FactoryPermissionOperation left, FactoryPermissionOperation right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FactoryPermissionOperation other && Equals(other); + + /// + public bool Equals(FactoryPermissionOperation 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 FactoryPermissionOperation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FactoryPermissionOperation value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FactoryPermissionOperation)); + } + } +} + /// Why the auto-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -12508,8 +12929,10 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(ExternalToolCompletedEvent))] [JsonSerializable(typeof(ExternalToolRequestedData))] [JsonSerializable(typeof(ExternalToolRequestedEvent))] +[JsonSerializable(typeof(FactoryPermissionPhase))] [JsonSerializable(typeof(FactoryRunUpdatedData))] [JsonSerializable(typeof(FactoryRunUpdatedEvent))] +[JsonSerializable(typeof(GitHubMcpToolConfig))] [JsonSerializable(typeof(GitHubRepoRef))] [JsonSerializable(typeof(HandoffRepository))] [JsonSerializable(typeof(HeaderEntry))] @@ -12559,6 +12982,7 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(PermissionPromptRequestCustomTool))] [JsonSerializable(typeof(PermissionPromptRequestExtensionManagement))] [JsonSerializable(typeof(PermissionPromptRequestExtensionPermissionAccess))] +[JsonSerializable(typeof(PermissionPromptRequestFactory))] [JsonSerializable(typeof(PermissionPromptRequestHook))] [JsonSerializable(typeof(PermissionPromptRequestMcp))] [JsonSerializable(typeof(PermissionPromptRequestMemory))] @@ -12570,6 +12994,7 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(PermissionRequestCustomTool))] [JsonSerializable(typeof(PermissionRequestExtensionManagement))] [JsonSerializable(typeof(PermissionRequestExtensionPermissionAccess))] +[JsonSerializable(typeof(PermissionRequestFactory))] [JsonSerializable(typeof(PermissionRequestHook))] [JsonSerializable(typeof(PermissionRequestMcp))] [JsonSerializable(typeof(PermissionRequestMemory))] @@ -12729,6 +13154,7 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SystemNotificationAgentIdle))] [JsonSerializable(typeof(SystemNotificationData))] [JsonSerializable(typeof(SystemNotificationEvent))] +[JsonSerializable(typeof(SystemNotificationFactoryCompleted))] [JsonSerializable(typeof(SystemNotificationInstructionDiscovered))] [JsonSerializable(typeof(SystemNotificationNewInboxMessage))] [JsonSerializable(typeof(SystemNotificationShellCompleted))] @@ -12786,6 +13212,7 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(UserToolSessionApprovalCustomTool))] [JsonSerializable(typeof(UserToolSessionApprovalExtensionManagement))] [JsonSerializable(typeof(UserToolSessionApprovalExtensionPermissionAccess))] +[JsonSerializable(typeof(UserToolSessionApprovalFactory))] [JsonSerializable(typeof(UserToolSessionApprovalMcp))] [JsonSerializable(typeof(UserToolSessionApprovalMemory))] [JsonSerializable(typeof(UserToolSessionApprovalRead))] diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 15b7c0cd64..a34dccd2e9 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -433,6 +433,16 @@ type AgentSelectResult struct { Agent AgentInfo `json:"agent"` } +// An in-memory authored prompt override for an available agent. +// Experimental: AgentSetPromptRequest is part of an experimental API and may change or be +// removed. +type AgentSetPromptRequest struct { + // Stable effective agent id. Plugin namespace separators are normalized. + ID string `json:"id"` + // Replacement authored prompt. Empty text is valid. + Prompt string `json:"prompt"` +} + // Optional project paths to include when enumerating agent discovery directories. // Experimental: AgentsGetDiscoveryPathsRequest is part of an experimental API and may // change or be removed. @@ -1860,6 +1870,59 @@ type DiscoveredCanvas struct { InputSchema any `json:"inputSchema,omitempty"` } +// Discovered extension metadata and persistent enablement state. +// Experimental: DiscoveredExtension is part of an experimental API and may change or be +// removed. +type DiscoveredExtension struct { + // Whether this extension's persistent per-ID preference is enabled + Enabled bool `json:"enabled"` + // Source-qualified ID accepted by both server and session extension enablement methods + ID string `json:"id"` + // Human-readable extension name + Name string `json:"name"` + // Absolute path to the extension entry module, suitable for revealing it in a file manager + Path string `json:"path"` + // Containing plugin metadata for plugin-contributed extensions + Plugin *DiscoveredExtensionPlugin `json:"plugin,omitempty"` + // Discovery source + Source DiscoveredExtensionSource `json:"source"` +} + +// Installed plugin that contributes a discovered extension. +// Experimental: DiscoveredExtensionPlugin is part of an experimental API and may change or +// be removed. +type DiscoveredExtensionPlugin struct { + // Installed plugin name + Name string `json:"name"` +} + +// Extensions discovered from persisted Copilot home state and their effective loading mode. +// Launch-scoped additional plugins are not included. +// Experimental: DiscoveredExtensions is part of an experimental API and may change or be +// removed. +type DiscoveredExtensions struct { + // Discovered user and enabled installed-plugin extensions from persisted Copilot home state + Extensions []DiscoveredExtension `json:"extensions"` + // Effective extension loading mode. Defaults to load_and_augment when unset. + Mode DiscoveredExtensionMode `json:"mode"` +} + +// Source-qualified extension identifiers to persistently disable for future sessions. +// Experimental: DiscoveredExtensionsDisableRequest is part of an experimental API and may +// change or be removed. +type DiscoveredExtensionsDisableRequest struct { + // Source-qualified user or plugin extension IDs to disable + IDs []string `json:"ids"` +} + +// Source-qualified extension identifiers to persistently enable for future sessions. +// Experimental: DiscoveredExtensionsEnableRequest is part of an experimental API and may +// change or be removed. +type DiscoveredExtensionsEnableRequest struct { + // Source-qualified user or plugin extension IDs to enable + IDs []string `json:"ids"` +} + // MCP server discovered by `mcp.discover`, with config source, optional plugin source, // transport type, and enabled state. // Experimental: DiscoveredMCPServer is part of an experimental API and may change or be @@ -1901,6 +1964,11 @@ type EnqueueCommandResult struct { // Experimental: EventLogReadRequest is part of an experimental API and may change or be // removed. type EventLogReadRequest struct { + // Optional non-empty list of subagent identifiers. When provided, only events owned by one + // of these agents are returned; ownership recognizes the event envelope's agentId plus + // legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over + // agentScope. + AgentIDs []string `json:"agentIds,omitzero"` // Agent-scope filter: 'primary' returns only main-agent events plus events whose type // starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns // events from all agents (matching wildcard-subscription behavior). Default is 'all' to @@ -1909,10 +1977,23 @@ type EventLogReadRequest struct { // Opaque cursor returned by a previous read. Omit on the first call to start from the // beginning of the session's persisted history. Cursor *string `json:"cursor,omitempty"` + // Direction to page through the session's persisted event history. 'forward' (default) + // pages from the cursor toward newer events (or from the start of history when no cursor is + // given). 'backward' enables tail-first reads: with no cursor it returns the NEWEST `max` + // events, and the returned cursor pages toward OLDER events on subsequent backward reads. + // Events within a returned batch are always in chronological (oldest-to-newest) order, even + // for a backward read. Backward reads cover PERSISTED history only; ephemeral events are + // never returned by a backward read. `direction` selects the INITIAL read only: the + // returned cursor is self-describing, so a continuation read pages in the cursor's own + // direction regardless of the `direction` passed alongside it — a forward cursor always + // pages forward and a backward cursor always pages backward. Pass the direction that + // matches the cursor to avoid confusion. + Direction *EventsReadDirection `json:"direction,omitempty"` // When false, skip ephemeral events entirely and return only durable (persisted) events. // History-backfill callers that discard ephemerals anyway should set this so the read is // bounded by the durable log length instead of racing the ephemeral ring on a busy session. // Defaults to true (ephemerals are interleaved with durable events in creation order). + // Ignored by backward reads, which always cover persisted history only. IncludeEphemeral *bool `json:"includeEphemeral,omitempty"` // Maximum number of events to return in this batch (1–1000, default 200). Max *int64 `json:"max,omitempty"` @@ -1922,7 +2003,10 @@ type EventLogReadRequest struct { // (default) returns immediately even if no events are available. Capped at 30000ms. // Ephemeral events that arrive during the wait are delivered in this batch but are NOT // replayable on a subsequent read (use a non-zero waitMs in your next call to capture - // future ephemerals as they happen). + // future ephemerals as they happen). This applies to forward reads only: a backward read + // always returns immediately and ignores `waitMs`, because backward paging covers persisted + // history only while new events append at the tail (the opposite end from a backward page), + // so no blocking or ephemeral delivery can occur. WaitMs *int32 `json:"waitMs,omitempty"` } @@ -1960,21 +2044,31 @@ type EventLogTypes struct { // removed. type EventsReadResult struct { // Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue - // from where this read left off. Always present, even when no events were returned. + // from where this read left off. Always present, even when no events were returned. For a + // backward read this cursor pages toward OLDER events; keep passing `direction: backward` + // with it (the cursor is also self-describing, so backward paging continues correctly). Cursor string `json:"cursor"` // Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor // referred to an event that no longer exists in history (e.g. truncated or compacted away) - // and the read started from the beginning of the remaining history. + // and the read fell back to a boundary of the remaining history. For a forward read the + // fallback starts from the beginning of the remaining history; for a backward read it falls + // back to the tail (the newest window). Because the fallback page is a fresh boundary + // snapshot rather than a continuation of the requested cursor, it may overlap events the + // consumer has already rendered — a backward fallback to the tail in particular can repeat + // the newest window. On 'expired', consumers should reset or rebase their local pagination + // state (or deduplicate by event id) before continuing from the returned cursor rather than + // blindly appending/prepending the fallback page. CursorStatus EventsCursorStatus `json:"cursorStatus"` // Session events for this batch, merged into a single stream in creation order: durable // (persisted) events and ephemeral events interleave exactly as they were emitted. Set // `includeEphemeral: false` to receive only durable events. Ephemeral events are never // replayable once pruned from the in-memory ring, so a consumer that needs them should keep - // reading with a non-zero `waitMs`. + // reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window + // contains persisted events only, still in chronological (oldest-to-newest) append order. Events []SessionEvent `json:"events"` - // True when the read returned `max` events and more events are available immediately. When - // false, the next read with a non-zero `waitMs` will block until a new event arrives or the - // wait expires. + // True when more events are available in the read's direction. For a forward read, true + // means the batch returned `max` events and more are available immediately. For a backward + // read, true means older persisted events remain before the returned window. HasMore bool `json:"hasMore"` } @@ -2030,6 +2124,11 @@ type ExtensionsDisableRequest struct { ID string `json:"id"` } +// Experimental: ExtensionsDisableResult is part of an experimental API and may change or be +// removed. +type ExtensionsDisableResult struct { +} + // Source-qualified extension identifier to enable for the session. // Experimental: ExtensionsEnableRequest is part of an experimental API and may change or be // removed. @@ -2038,6 +2137,11 @@ type ExtensionsEnableRequest struct { ID string `json:"id"` } +// Experimental: ExtensionsEnableResult is part of an experimental API and may change or be +// removed. +type ExtensionsEnableResult struct { +} + // Tool call result (string or expanded result object) // Experimental: ExternalToolResult is part of an experimental API and may change or be // removed. @@ -4181,6 +4285,18 @@ type MCPListToolsResult struct { Tools []MCPTools `json:"tools"` } +// Identifies the MCP server whose persisted OAuth credentials were updated. +// Experimental: MCPOauthAuthenticationStateChangedRequest is part of an experimental API +// and may change or be removed. +type MCPOauthAuthenticationStateChangedRequest struct { + // Whether the target session must mint a session-scoped access token instead of reusing a + // shared access token persisted by another session. + RefreshSessionToken *bool `json:"refreshSessionToken,omitempty"` + // Name of the MCP server whose OAuth credentials were updated. Omit only when the host + // cannot identify the server. + ServerName *string `json:"serverName,omitempty"` +} + // Pending MCP OAuth request ID and host-provided token or cancellation response. // Experimental: MCPOauthHandlePendingRequest is part of an experimental API and may change // or be removed. @@ -5707,6 +5823,21 @@ func (PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess) Kin return PermissionDecisionApproveForLocationApprovalKindExtensionPermissionAccess } +// Location-scoped factory approval, optionally narrowed by approval key. +// Experimental: PermissionDecisionApproveForLocationApprovalFactory is part of an +// experimental API and may change or be removed. +type PermissionDecisionApproveForLocationApprovalFactory struct { + // Optional factory operation name or canonical approval key; when omitted, the approval + // covers all factory operations. + ApprovalKey *string `json:"approvalKey,omitempty"` +} + +func (PermissionDecisionApproveForLocationApprovalFactory) permissionDecisionApproveForLocationApproval() { +} +func (PermissionDecisionApproveForLocationApprovalFactory) Kind() PermissionDecisionApproveForLocationApprovalKind { + return PermissionDecisionApproveForLocationApprovalKindFactory +} + // Location-scoped approval details for an MCP server tool, or all tools on the server when // `toolName` is null. // Experimental: PermissionDecisionApproveForLocationApprovalMCP is part of an experimental @@ -5852,6 +5983,21 @@ func (PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess) Kind return PermissionDecisionApproveForSessionApprovalKindExtensionPermissionAccess } +// Session-scoped factory approval, optionally narrowed by approval key. +// Experimental: PermissionDecisionApproveForSessionApprovalFactory is part of an +// experimental API and may change or be removed. +type PermissionDecisionApproveForSessionApprovalFactory struct { + // Optional factory operation name or canonical approval key; when omitted, the approval + // covers all factory operations. + ApprovalKey *string `json:"approvalKey,omitempty"` +} + +func (PermissionDecisionApproveForSessionApprovalFactory) permissionDecisionApproveForSessionApproval() { +} +func (PermissionDecisionApproveForSessionApprovalFactory) Kind() PermissionDecisionApproveForSessionApprovalKind { + return PermissionDecisionApproveForSessionApprovalKindFactory +} + // Session-scoped approval details for an MCP server tool, or all tools on the server when // `toolName` is null. // Experimental: PermissionDecisionApproveForSessionApprovalMCP is part of an experimental @@ -6265,6 +6411,21 @@ func (PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess) Kind( return PermissionsLocationsAddToolApprovalDetailsKindExtensionPermissionAccess } +// Location-persisted factory approval, optionally narrowed by approval key. +// Experimental: PermissionsLocationsAddToolApprovalDetailsFactory is part of an +// experimental API and may change or be removed. +type PermissionsLocationsAddToolApprovalDetailsFactory struct { + // Optional factory operation name or canonical approval key; when omitted, the approval + // covers all factory operations. + ApprovalKey *string `json:"approvalKey,omitempty"` +} + +func (PermissionsLocationsAddToolApprovalDetailsFactory) permissionsLocationsAddToolApprovalDetails() { +} +func (PermissionsLocationsAddToolApprovalDetailsFactory) Kind() PermissionsLocationsAddToolApprovalDetailsKind { + return PermissionsLocationsAddToolApprovalDetailsKindFactory +} + // Location-persisted tool approval details for an MCP server tool, or all tools when // `toolName` is null. // Experimental: PermissionsLocationsAddToolApprovalDetailsMCP is part of an experimental @@ -6425,7 +6586,8 @@ type PermissionsSetAllowAllRequest struct { // auto-approval; `off` disables both. Mode *PermissionsAllowAllMode `json:"mode,omitempty"` // Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when - // `mode` is `auto`; ignored otherwise. When omitted, the session's active model is used. + // `mode` is `auto`; ignored otherwise. When omitted, the session resolves a default judge + // model: `gpt-5.5` for CAPI sessions and the session's active model for BYOK sessions. Model *string `json:"model,omitempty"` // Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. Source *PermissionsSetAllowAllSource `json:"source,omitempty"` @@ -7941,6 +8103,13 @@ type RuntimeShutdownResult struct { type SandboxConfig struct { // Whether to auto-add the current working directory to readwritePaths. Default: true. AddCurrentWorkingDirectory *bool `json:"addCurrentWorkingDirectory,omitempty"` + // Whether to auto-grant read access to common developer-tool caches, registries, and + // toolchains in their default home locations (cargo, go, npm, Maven, and more), plus + // read-write access to (and, on Unix, up-front creation of) the scratch caches builds write + // on every run (go-build, ccache, sccache, Gradle caches, Cargo lock/tracker files), so + // builds work without exporting CARGO_HOME/GOPATH/etc. Default: true (enabled by default; + // set to false to opt out). + AllowDevToolCaches *bool `json:"allowDevToolCaches,omitempty"` // Whether sandboxing is enabled for the session. Enabled bool `json:"enabled"` // Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the @@ -8428,6 +8597,11 @@ type SessionAgentListRequest struct { IncludePrompt *bool `json:"includePrompt,omitempty"` } +// Experimental: SessionAgentSetPromptResult is part of an experimental API and may change +// or be removed. +type SessionAgentSetPromptResult struct { +} + // Authentication status and account metadata for the session. // Experimental: SessionAuthStatus is part of an experimental API and may change or be // removed. @@ -9237,6 +9411,11 @@ type SessionMCPDisableResult struct { type SessionMCPEnableResult struct { } +// Experimental: SessionMCPOauthAuthenticationStateChangedResult is part of an experimental +// API and may change or be removed. +type SessionMCPOauthAuthenticationStateChangedResult struct { +} + // Experimental: SessionMCPRegisterExternalClientResult is part of an experimental API and // may change or be removed. type SessionMCPRegisterExternalClientResult struct { @@ -12161,6 +12340,19 @@ func (UserToolSessionApprovalExtensionPermissionAccess) Kind() UserToolSessionAp return UserToolSessionApprovalKindExtensionPermissionAccess } +// Session-scoped factory approval, optionally narrowed by approval key. +// Experimental: UserToolSessionApprovalFactory is part of an experimental API and may +// change or be removed. +type UserToolSessionApprovalFactory struct { + // Optional factory operation name or canonical approval key + ApprovalKey *string `json:"approvalKey,omitempty"` +} + +func (UserToolSessionApprovalFactory) userToolSessionApproval() {} +func (UserToolSessionApprovalFactory) Kind() UserToolSessionApprovalKind { + return UserToolSessionApprovalKindFactory +} + // Session-scoped tool-approval rule for an MCP server tool, or all tools on the server when // `toolName` is null. // Experimental: UserToolSessionApprovalMCP is part of an experimental API and may change or @@ -12898,6 +13090,32 @@ const ( DebugCollectLogsSourceShellLog DebugCollectLogsSource = "shell-log" ) +// Effective extension loading and agent-management mode +// Experimental: DiscoveredExtensionMode is part of an experimental API and may change or be +// removed. +type DiscoveredExtensionMode string + +const ( + // Extensions are not loaded. + DiscoveredExtensionModeDisabled DiscoveredExtensionMode = "disabled" + // Extensions are loaded and the agent can create, reload, and manage them. + DiscoveredExtensionModeLoadAndAugment DiscoveredExtensionMode = "load_and_augment" + // Extensions are loaded, but the agent cannot create, reload, or manage them. + DiscoveredExtensionModeLoadOnly DiscoveredExtensionMode = "load_only" +) + +// Persisted extension discovery source +// Experimental: DiscoveredExtensionSource is part of an experimental API and may change or +// be removed. +type DiscoveredExtensionSource string + +const ( + // Extension contributed by an installed plugin. + DiscoveredExtensionSourcePlugin DiscoveredExtensionSource = "plugin" + // Extension discovered from the user's extensions directory. + DiscoveredExtensionSourceUser DiscoveredExtensionSource = "user" +) + // Server transport type: stdio, http, sse (deprecated), or memory // Experimental: DiscoveredMCPServerType is part of an experimental API and may change or be // removed. @@ -12937,7 +13155,11 @@ const ( // Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor // referred to an event that no longer exists in history (e.g. truncated or compacted away) -// and the read started from the beginning of the remaining history. +// and the read fell back to a boundary of the remaining history (the beginning for a +// forward read, the tail for a backward read). The fallback page is a fresh boundary +// snapshot, not a continuation of the requested cursor, so it may overlap already-rendered +// events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate +// by event id) before continuing from the returned cursor. // Experimental: EventsCursorStatus is part of an experimental API and may change or be // removed. type EventsCursorStatus string @@ -12949,6 +13171,21 @@ const ( EventsCursorStatusOk EventsCursorStatus = "ok" ) +// Direction to page through the session's persisted event history. 'forward' pages from the +// cursor toward newer events; 'backward' returns the newest window first (tail-first) and +// pages toward older events. Events within a returned batch are always chronological +// (oldest-to-newest), even for a backward read. +// Experimental: EventsReadDirection is part of an experimental API and may change or be +// removed. +type EventsReadDirection string + +const ( + // Tail-first: return the newest events and page toward older events. + EventsReadDirectionBackward EventsReadDirection = "backward" + // Page from the cursor toward newer events (default). + EventsReadDirectionForward EventsReadDirection = "forward" +) + // Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin // (installed plugin), or session (session-state//extensions/) // Experimental: ExtensionSource is part of an experimental API and may change or be removed. @@ -13796,6 +14033,7 @@ const ( PermissionDecisionApproveForLocationApprovalKindCustomTool PermissionDecisionApproveForLocationApprovalKind = "custom-tool" PermissionDecisionApproveForLocationApprovalKindExtensionManagement PermissionDecisionApproveForLocationApprovalKind = "extension-management" PermissionDecisionApproveForLocationApprovalKindExtensionPermissionAccess PermissionDecisionApproveForLocationApprovalKind = "extension-permission-access" + PermissionDecisionApproveForLocationApprovalKindFactory PermissionDecisionApproveForLocationApprovalKind = "factory" PermissionDecisionApproveForLocationApprovalKindMCP PermissionDecisionApproveForLocationApprovalKind = "mcp" PermissionDecisionApproveForLocationApprovalKindMCPSampling PermissionDecisionApproveForLocationApprovalKind = "mcp-sampling" PermissionDecisionApproveForLocationApprovalKindMemory PermissionDecisionApproveForLocationApprovalKind = "memory" @@ -13811,6 +14049,7 @@ const ( PermissionDecisionApproveForSessionApprovalKindCustomTool PermissionDecisionApproveForSessionApprovalKind = "custom-tool" PermissionDecisionApproveForSessionApprovalKindExtensionManagement PermissionDecisionApproveForSessionApprovalKind = "extension-management" PermissionDecisionApproveForSessionApprovalKindExtensionPermissionAccess PermissionDecisionApproveForSessionApprovalKind = "extension-permission-access" + PermissionDecisionApproveForSessionApprovalKindFactory PermissionDecisionApproveForSessionApprovalKind = "factory" PermissionDecisionApproveForSessionApprovalKindMCP PermissionDecisionApproveForSessionApprovalKind = "mcp" PermissionDecisionApproveForSessionApprovalKindMCPSampling PermissionDecisionApproveForSessionApprovalKind = "mcp-sampling" PermissionDecisionApproveForSessionApprovalKindMemory PermissionDecisionApproveForSessionApprovalKind = "memory" @@ -13887,6 +14126,7 @@ const ( PermissionsLocationsAddToolApprovalDetailsKindCustomTool PermissionsLocationsAddToolApprovalDetailsKind = "custom-tool" PermissionsLocationsAddToolApprovalDetailsKindExtensionManagement PermissionsLocationsAddToolApprovalDetailsKind = "extension-management" PermissionsLocationsAddToolApprovalDetailsKindExtensionPermissionAccess PermissionsLocationsAddToolApprovalDetailsKind = "extension-permission-access" + PermissionsLocationsAddToolApprovalDetailsKindFactory PermissionsLocationsAddToolApprovalDetailsKind = "factory" PermissionsLocationsAddToolApprovalDetailsKindMCP PermissionsLocationsAddToolApprovalDetailsKind = "mcp" PermissionsLocationsAddToolApprovalDetailsKindMCPSampling PermissionsLocationsAddToolApprovalDetailsKind = "mcp-sampling" PermissionsLocationsAddToolApprovalDetailsKindMemory PermissionsLocationsAddToolApprovalDetailsKind = "memory" @@ -14891,6 +15131,7 @@ const ( UserToolSessionApprovalKindCustomTool UserToolSessionApprovalKind = "custom-tool" UserToolSessionApprovalKindExtensionManagement UserToolSessionApprovalKind = "extension-management" UserToolSessionApprovalKindExtensionPermissionAccess UserToolSessionApprovalKind = "extension-permission-access" + UserToolSessionApprovalKindFactory UserToolSessionApprovalKind = "factory" UserToolSessionApprovalKindMCP UserToolSessionApprovalKind = "mcp" UserToolSessionApprovalKindMemory UserToolSessionApprovalKind = "memory" UserToolSessionApprovalKindRead UserToolSessionApprovalKind = "read" @@ -15159,6 +15400,67 @@ func (a *ServerCommandsAPI) List(ctx context.Context) (*CommandList, error) { return &result, nil } +// Experimental: ServerExtensionsAPI contains experimental APIs that may change or be +// removed. +type ServerExtensionsAPI serverAPI + +// Disable persistently disables extension IDs for future sessions. Active sessions are +// unchanged; use session.extensions.disable to update them. +// +// RPC method: extensions.disable. +// +// Parameters: Source-qualified extension identifiers to persistently disable for future +// sessions. +func (a *ServerExtensionsAPI) Disable(ctx context.Context, params *DiscoveredExtensionsDisableRequest) (*ExtensionsDisableResult, error) { + raw, err := a.client.Request(ctx, "extensions.disable", params) + if err != nil { + return nil, err + } + var result ExtensionsDisableResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// Discovers user and enabled installed-plugin extensions from persisted Copilot home state, +// including enablement preferences. Launch-scoped additional plugins are not included. +// +// RPC method: extensions.discover. +// +// Returns: Extensions discovered from persisted Copilot home state and their effective +// loading mode. Launch-scoped additional plugins are not included. +func (a *ServerExtensionsAPI) Discover(ctx context.Context) (*DiscoveredExtensions, error) { + raw, err := a.client.Request(ctx, "extensions.discover", nil) + if err != nil { + return nil, err + } + var result DiscoveredExtensions + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// Enable persistently enables extension IDs for future sessions. Active sessions are +// unchanged; use session.extensions.enable to update them. +// +// RPC method: extensions.enable. +// +// Parameters: Source-qualified extension identifiers to persistently enable for future +// sessions. +func (a *ServerExtensionsAPI) Enable(ctx context.Context, params *DiscoveredExtensionsEnableRequest) (*ExtensionsEnableResult, error) { + raw, err := a.client.Request(ctx, "extensions.enable", params) + if err != nil { + return nil, err + } + var result ExtensionsEnableResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Experimental: ServerInstructionsAPI contains experimental APIs that may change or be // removed. type ServerInstructionsAPI serverAPI @@ -16416,6 +16718,7 @@ type ServerRPC struct { AgentRegistry *ServerAgentRegistryAPI Agents *ServerAgentsAPI Commands *ServerCommandsAPI + Extensions *ServerExtensionsAPI Instructions *ServerInstructionsAPI LlmInference *ServerLlmInferenceAPI MCP *ServerMCPAPI @@ -16458,6 +16761,7 @@ func NewServerRPC(client *jsonrpc2.Client) *ServerRPC { r.AgentRegistry = (*ServerAgentRegistryAPI)(&r.common) r.Agents = (*ServerAgentsAPI)(&r.common) r.Commands = (*ServerCommandsAPI)(&r.common) + r.Extensions = (*ServerExtensionsAPI)(&r.common) r.Instructions = (*ServerInstructionsAPI)(&r.common) r.LlmInference = (*ServerLlmInferenceAPI)(&r.common) r.MCP = (*ServerMCPAPI)(&r.common) @@ -16835,6 +17139,32 @@ func (a *AgentAPI) Select(ctx context.Context, params *AgentSelectRequest) (*Age return &result, nil } +// SetPrompt sets an in-memory authored prompt override for an available agent. For built-in +// agents, this replaces only the static base prompt while preserving runtime-owned dynamic +// prompt composition and behavior. The special `general-purpose` agent is not overrideable. +// Overrides are not persisted; resumed and forked sessions start without them, so the host +// must re-apply them. +// +// RPC method: session.agent.setPrompt. +// +// Parameters: An in-memory authored prompt override for an available agent. +func (a *AgentAPI) SetPrompt(ctx context.Context, params *AgentSetPromptRequest) (*SessionAgentSetPromptResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["id"] = params.ID + req["prompt"] = params.Prompt + } + raw, err := a.client.Request(ctx, "session.agent.setPrompt", req) + if err != nil { + return nil, err + } + var result SessionAgentSetPromptResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Experimental: CanvasAPI contains experimental APIs that may change or be removed. type CanvasAPI sessionAPI @@ -17247,6 +17577,7 @@ func (a *DebugAPI) CollectLogs(ctx context.Context, params *DebugCollectLogsRequ type EventLogAPI sessionAPI // Reads a batch of session events from a cursor, optionally waiting for new events. +// Supports tail-first reads via `direction: backward`. // // RPC method: session.eventLog.read. // @@ -17258,12 +17589,18 @@ type EventLogAPI sessionAPI func (a *EventLogAPI) Read(ctx context.Context, params *EventLogReadRequest) (*EventsReadResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { + if params.AgentIDs != nil { + req["agentIds"] = params.AgentIDs + } if params.AgentScope != nil { req["agentScope"] = *params.AgentScope } if params.Cursor != nil { req["cursor"] = *params.Cursor } + if params.Direction != nil { + req["direction"] = *params.Direction + } if params.IncludeEphemeral != nil { req["includeEphemeral"] = *params.IncludeEphemeral } @@ -18614,6 +18951,33 @@ func (s *MCPAPI) Headers() *MCPHeadersAPI { // Experimental: MCPOauthAPI contains experimental APIs that may change or be removed. type MCPOauthAPI sessionAPI +// AuthenticationStateChanged notifies the session that MCP OAuth authentication succeeded +// and updated credentials were persisted, so cached tool definitions can be refreshed. +// +// RPC method: session.mcp.oauth.authenticationStateChanged. +// +// Parameters: Identifies the MCP server whose persisted OAuth credentials were updated. +func (a *MCPOauthAPI) AuthenticationStateChanged(ctx context.Context, params *MCPOauthAuthenticationStateChangedRequest) (*SessionMCPOauthAuthenticationStateChangedResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + if params.RefreshSessionToken != nil { + req["refreshSessionToken"] = *params.RefreshSessionToken + } + if params.ServerName != nil { + req["serverName"] = *params.ServerName + } + } + raw, err := a.client.Request(ctx, "session.mcp.oauth.authenticationStateChanged", req) + if err != nil { + return nil, err + } + var result SessionMCPOauthAuthenticationStateChangedResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // HandlePendingRequest resolves a pending MCP OAuth request with a host-provided token or // cancellation. The pending request is emitted as mcp.oauth_required with the data // necessary to authorize the request. diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go index 16cf00bab0..fdc76729b5 100644 --- a/go/rpc/zrpc_encoding.go +++ b/go/rpc/zrpc_encoding.go @@ -1906,6 +1906,12 @@ func unmarshalUserToolSessionApproval(data []byte) (UserToolSessionApproval, err return nil, err } return &d, nil + case UserToolSessionApprovalKindFactory: + var d UserToolSessionApprovalFactory + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case UserToolSessionApprovalKindMCP: var d UserToolSessionApprovalMCP if err := json.Unmarshal(data, &d); err != nil { @@ -1990,6 +1996,17 @@ func (r UserToolSessionApprovalExtensionPermissionAccess) MarshalJSON() ([]byte, }) } +func (r UserToolSessionApprovalFactory) MarshalJSON() ([]byte, error) { + type alias UserToolSessionApprovalFactory + return json.Marshal(struct { + Kind UserToolSessionApprovalKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + func (r UserToolSessionApprovalMCP) MarshalJSON() ([]byte, error) { type alias UserToolSessionApprovalMCP return json.Marshal(struct { @@ -2131,6 +2148,12 @@ func unmarshalPermissionDecisionApproveForLocationApproval(data []byte) (Permiss return nil, err } return &d, nil + case PermissionDecisionApproveForLocationApprovalKindFactory: + var d PermissionDecisionApproveForLocationApprovalFactory + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case PermissionDecisionApproveForLocationApprovalKindMCP: var d PermissionDecisionApproveForLocationApprovalMCP if err := json.Unmarshal(data, &d); err != nil { @@ -2221,6 +2244,17 @@ func (r PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess) M }) } +func (r PermissionDecisionApproveForLocationApprovalFactory) MarshalJSON() ([]byte, error) { + type alias PermissionDecisionApproveForLocationApprovalFactory + return json.Marshal(struct { + Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + func (r PermissionDecisionApproveForLocationApprovalMCP) MarshalJSON() ([]byte, error) { type alias PermissionDecisionApproveForLocationApprovalMCP return json.Marshal(struct { @@ -2344,6 +2378,12 @@ func unmarshalPermissionDecisionApproveForSessionApproval(data []byte) (Permissi return nil, err } return &d, nil + case PermissionDecisionApproveForSessionApprovalKindFactory: + var d PermissionDecisionApproveForSessionApprovalFactory + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case PermissionDecisionApproveForSessionApprovalKindMCP: var d PermissionDecisionApproveForSessionApprovalMCP if err := json.Unmarshal(data, &d); err != nil { @@ -2434,6 +2474,17 @@ func (r PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess) Ma }) } +func (r PermissionDecisionApproveForSessionApprovalFactory) MarshalJSON() ([]byte, error) { + type alias PermissionDecisionApproveForSessionApprovalFactory + return json.Marshal(struct { + Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + func (r PermissionDecisionApproveForSessionApprovalMCP) MarshalJSON() ([]byte, error) { type alias PermissionDecisionApproveForSessionApprovalMCP return json.Marshal(struct { @@ -2687,6 +2738,12 @@ func unmarshalPermissionsLocationsAddToolApprovalDetails(data []byte) (Permissio return nil, err } return &d, nil + case PermissionsLocationsAddToolApprovalDetailsKindFactory: + var d PermissionsLocationsAddToolApprovalDetailsFactory + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case PermissionsLocationsAddToolApprovalDetailsKindMCP: var d PermissionsLocationsAddToolApprovalDetailsMCP if err := json.Unmarshal(data, &d); err != nil { @@ -2777,6 +2834,17 @@ func (r PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess) Mar }) } +func (r PermissionsLocationsAddToolApprovalDetailsFactory) MarshalJSON() ([]byte, error) { + type alias PermissionsLocationsAddToolApprovalDetailsFactory + return json.Marshal(struct { + Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + func (r PermissionsLocationsAddToolApprovalDetailsMCP) MarshalJSON() ([]byte, error) { type alias PermissionsLocationsAddToolApprovalDetailsMCP return json.Marshal(struct { diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index e472ffe679..eae934e933 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -1352,6 +1352,12 @@ func unmarshalSystemNotification(data []byte) (SystemNotification, error) { return nil, err } return &d, nil + case SystemNotificationTypeFactoryCompleted: + var d SystemNotificationFactoryCompleted + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case SystemNotificationTypeInstructionDiscovered: var d SystemNotificationInstructionDiscovered if err := json.Unmarshal(data, &d); err != nil { @@ -1420,6 +1426,17 @@ func (r SystemNotificationAgentIdle) MarshalJSON() ([]byte, error) { }) } +func (r SystemNotificationFactoryCompleted) MarshalJSON() ([]byte, error) { + type alias SystemNotificationFactoryCompleted + return json.Marshal(struct { + Type SystemNotificationType `json:"type"` + alias + }{ + Type: r.Type(), + alias: alias(r), + }) +} + func (r SystemNotificationInstructionDiscovered) MarshalJSON() ([]byte, error) { type alias SystemNotificationInstructionDiscovered return json.Marshal(struct { @@ -1526,6 +1543,12 @@ func unmarshalPermissionRequest(data []byte) (PermissionRequest, error) { return nil, err } return &d, nil + case PermissionRequestKindFactory: + var d PermissionRequestFactory + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case PermissionRequestKindHook: var d PermissionRequestHook if err := json.Unmarshal(data, &d); err != nil { @@ -1617,6 +1640,17 @@ func (r PermissionRequestExtensionPermissionAccess) MarshalJSON() ([]byte, error }) } +func (r PermissionRequestFactory) MarshalJSON() ([]byte, error) { + type alias PermissionRequestFactory + return json.Marshal(struct { + Kind PermissionRequestKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + func (r PermissionRequestHook) MarshalJSON() ([]byte, error) { type alias PermissionRequestHook return json.Marshal(struct { @@ -1731,6 +1765,12 @@ func unmarshalPermissionPromptRequest(data []byte) (PermissionPromptRequest, err return nil, err } return &d, nil + case PermissionPromptRequestKindFactory: + var d PermissionPromptRequestFactory + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case PermissionPromptRequestKindHook: var d PermissionPromptRequestHook if err := json.Unmarshal(data, &d); err != nil { @@ -1833,6 +1873,17 @@ func (r PermissionPromptRequestExtensionPermissionAccess) MarshalJSON() ([]byte, }) } +func (r PermissionPromptRequestFactory) MarshalJSON() ([]byte, error) { + type alias PermissionPromptRequestFactory + return json.Marshal(struct { + Kind PermissionPromptRequestKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + func (r PermissionPromptRequestHook) MarshalJSON() ([]byte, error) { type alias PermissionPromptRequestHook return json.Marshal(struct { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 54b46e25ac..4551f98537 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -227,6 +227,10 @@ func (*AssistantReasoningData) Type() SessionEventType { return SessionEventType type AssistantMessageData struct { // Provider's completion / response identifier; shared across all chunks of a single API call. Used to group multi-chunk assistant utterances. APICallID *string `json:"apiCallId,omitempty"` + // Total messages the model call's response was split into, one per reasoning boundary. Absent for a single-message response; the last chunk is the one where chunkIndex is chunkCount - 1. + ChunkCount *int64 `json:"chunkCount,omitempty"` + // Zero-based position of this message within its model call's response. Absent when the response was not split into chunks. + ChunkIndex *int64 `json:"chunkIndex,omitempty"` // Provider-agnostic citations linking spans of this message's content to the sources that support them. Experimental; only populated when citation emission is enabled. // Experimental: Citations is part of an experimental API and may change or be removed. Citations *Citations `json:"citations,omitempty"` @@ -1577,6 +1581,8 @@ type SessionStartData struct { CopilotVersion string `json:"copilotVersion"` // When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id. DetachedFromSpawningParentSessionID *string `json:"detachedFromSpawningParentSessionId,omitempty"` + // Per-session GitHub MCP override persisted for cold resume + GitHubMCPToolConfig *GitHubMCPToolConfig `json:"githubMcpToolConfig,omitempty"` // Identifier of the software producing the events (e.g., "copilot-agent") Producer string `json:"producer"` // Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") @@ -2528,6 +2534,26 @@ type ExtensionsLoadedExtension struct { Status ExtensionsLoadedExtensionStatus `json:"status"` } +// A declared phase shown in a factory permission prompt. +type FactoryPermissionPhase struct { + // Optional phase detail + Detail *string `json:"detail,omitempty"` + // Phase title + Title string `json:"title"` +} + +// Per-session configuration for the built-in GitHub MCP server +type GitHubMCPToolConfig struct { + // Additional GitHub MCP tools requested by the session + AdditionalTools []string `json:"additionalTools,omitzero"` + // Additional GitHub MCP toolsets requested by the session + AdditionalToolsets []string `json:"additionalToolsets,omitzero"` + // Whether to use the read-write endpoint and request all toolsets + EnableAllTools *bool `json:"enableAllTools,omitempty"` + // Whether to request the GitHub MCP insiders build + EnableInsidersMode *bool `json:"enableInsidersMode,omitempty"` +} + // Repository context for the handed-off session type HandoffRepository struct { // Git branch name, if applicable @@ -2755,6 +2781,46 @@ func (PermissionPromptRequestExtensionPermissionAccess) Kind() PermissionPromptR return PermissionPromptRequestKindExtensionPermissionAccess } +// Factory run or authoring permission prompt +type PermissionPromptRequestFactory struct { + // Canonical key used for scoped factory approvals + ApprovalKey string `json:"approvalKey"` + // Auto-approval judge information for this request; present only when auto mode is enabled. + // Experimental: AutoApproval is part of an experimental API and may change or be removed. + AutoApproval *PermissionAutoApproval `json:"autoApproval,omitempty"` + // Whether this factory is eligible for persistent approval + CanPersistApproval bool `json:"canPersistApproval"` + DeclaredMaxAiCredits *float64 `json:"declaredMaxAiCredits,omitempty"` + DeclaredMaxConcurrentSubagents *int64 `json:"declaredMaxConcurrentSubagents,omitempty"` + DeclaredMaxTotalSubagents *int64 `json:"declaredMaxTotalSubagents,omitempty"` + DeclaredTimeoutSeconds *float64 `json:"declaredTimeoutSeconds,omitempty"` + // Factory description + Description string `json:"description"` + // Whether managed policy requires a human response and forbids host auto-approval + ManagedApprovalRequired *bool `json:"managedApprovalRequired,omitempty"` + // Effective AI-credit limit; omitted means unlimited + MaxAiCredits *float64 `json:"maxAiCredits,omitempty"` + // Effective concurrent-subagent limit; omitted means unlimited + MaxConcurrentSubagents *int64 `json:"maxConcurrentSubagents,omitempty"` + // Effective total-subagent limit; omitted means unlimited + MaxTotalSubagents *int64 `json:"maxTotalSubagents,omitempty"` + // Factory name + Name string `json:"name"` + // Factory operation, either run or author + Operation FactoryPermissionOperation `json:"operation"` + // Declared factory phases + Phases []FactoryPermissionPhase `json:"phases"` + // Effective active-time limit in seconds; omitted means unlimited + TimeoutSeconds *float64 `json:"timeoutSeconds,omitempty"` + // Tool call ID that triggered this permission request + ToolCallID *string `json:"toolCallId,omitempty"` +} + +func (PermissionPromptRequestFactory) permissionPromptRequest() {} +func (PermissionPromptRequestFactory) Kind() PermissionPromptRequestKind { + return PermissionPromptRequestKindFactory +} + // Hook confirmation permission prompt type PermissionPromptRequestHook struct { // Auto-approval judge information for this request; present only when auto mode is enabled. @@ -2983,6 +3049,41 @@ func (PermissionRequestExtensionPermissionAccess) Kind() PermissionRequestKind { return PermissionRequestKindExtensionPermissionAccess } +// Factory run or authoring permission request +type PermissionRequestFactory struct { + // Canonical key used for scoped factory approvals + ApprovalKey string `json:"approvalKey"` + // Whether this factory is eligible for persistent approval + CanPersistApproval bool `json:"canPersistApproval"` + DeclaredMaxAiCredits *float64 `json:"declaredMaxAiCredits,omitempty"` + DeclaredMaxConcurrentSubagents *int64 `json:"declaredMaxConcurrentSubagents,omitempty"` + DeclaredMaxTotalSubagents *int64 `json:"declaredMaxTotalSubagents,omitempty"` + DeclaredTimeoutSeconds *float64 `json:"declaredTimeoutSeconds,omitempty"` + // Factory description + Description string `json:"description"` + // Effective AI-credit limit; omitted means unlimited + MaxAiCredits *float64 `json:"maxAiCredits,omitempty"` + // Effective concurrent-subagent limit; omitted means unlimited + MaxConcurrentSubagents *int64 `json:"maxConcurrentSubagents,omitempty"` + // Effective total-subagent limit; omitted means unlimited + MaxTotalSubagents *int64 `json:"maxTotalSubagents,omitempty"` + // Factory name + Name string `json:"name"` + // Factory operation, either run or author + Operation FactoryPermissionOperation `json:"operation"` + // Declared factory phases + Phases []FactoryPermissionPhase `json:"phases"` + // Effective active-time limit in seconds; omitted means unlimited + TimeoutSeconds *float64 `json:"timeoutSeconds,omitempty"` + // Tool call ID that triggered this permission request + ToolCallID *string `json:"toolCallId,omitempty"` +} + +func (PermissionRequestFactory) permissionRequest() {} +func (PermissionRequestFactory) Kind() PermissionRequestKind { + return PermissionRequestKindFactory +} + // Hook confirmation permission request type PermissionRequestHook struct { // Optional message from the hook explaining why confirmation is needed @@ -3526,6 +3627,35 @@ func (SystemNotificationAgentIdle) Type() SystemNotificationType { return SystemNotificationTypeAgentIdle } +// System notification metadata for a factory execution attempt that reached a terminal state. +type SystemNotificationFactoryCompleted struct { + // Execution attempt that reached this terminal state. + Attempt int64 `json:"attempt"` + // Consumed AI usage in nano-AIU. + ConsumedNanoAiu int64 `json:"consumedNanoAiu"` + // Subagents consumed by the run across all attempts. + ConsumedSubagents int64 `json:"consumedSubagents"` + // Accumulated active execution time in milliseconds. + ElapsedMs int64 `json:"elapsedMs"` + // Persisted factory name. + FactoryName string `json:"factoryName"` + // Machine-readable terminal failure details, when present. + Failure any `json:"failure,omitempty"` + // Bounded prompt-safe preview of the completed result. + ResultPreview *string `json:"resultPreview,omitempty"` + // Actionable run_factory resume guidance for a resource-limit failure. + RetryGuidance *string `json:"retryGuidance,omitempty"` + // Factory run identifier. + RunID string `json:"runId"` + // Terminal status reached by this execution attempt. + Status SystemNotificationFactoryCompletedStatus `json:"status"` +} + +func (SystemNotificationFactoryCompleted) systemNotification() {} +func (SystemNotificationFactoryCompleted) Type() SystemNotificationType { + return SystemNotificationTypeFactoryCompleted +} + // System notification metadata for an instruction file discovered during tool access, including source, trigger file, and tool. type SystemNotificationInstructionDiscovered struct { // Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/') @@ -4164,6 +4294,16 @@ const ( ExtensionsLoadedExtensionStatusStarting ExtensionsLoadedExtensionStatus = "starting" ) +// Operation gated by a factory permission request. +type FactoryPermissionOperation string + +const ( + // Authoring a factory, which writes JavaScript into a session-scoped extension and loads it. + FactoryPermissionOperationAuthor FactoryPermissionOperation = "author" + // Running a registered factory, which spends subagents, active time, and AI credits under the approved limits. + FactoryPermissionOperationRun FactoryPermissionOperation = "run" +) + // Origin type of the session being handed off type HandoffSourceType string @@ -4352,6 +4492,7 @@ const ( PermissionPromptRequestKindCustomTool PermissionPromptRequestKind = "custom-tool" PermissionPromptRequestKindExtensionManagement PermissionPromptRequestKind = "extension-management" PermissionPromptRequestKindExtensionPermissionAccess PermissionPromptRequestKind = "extension-permission-access" + PermissionPromptRequestKindFactory PermissionPromptRequestKind = "factory" PermissionPromptRequestKindHook PermissionPromptRequestKind = "hook" PermissionPromptRequestKindMCP PermissionPromptRequestKind = "mcp" PermissionPromptRequestKindMemory PermissionPromptRequestKind = "memory" @@ -4380,6 +4521,7 @@ const ( PermissionRequestKindCustomTool PermissionRequestKind = "custom-tool" PermissionRequestKindExtensionManagement PermissionRequestKind = "extension-management" PermissionRequestKindExtensionPermissionAccess PermissionRequestKind = "extension-permission-access" + PermissionRequestKindFactory PermissionRequestKind = "factory" PermissionRequestKindHook PermissionRequestKind = "hook" PermissionRequestKindMCP PermissionRequestKind = "mcp" PermissionRequestKindMemory PermissionRequestKind = "memory" @@ -4511,12 +4653,27 @@ const ( SystemNotificationAgentCompletedStatusFailed SystemNotificationAgentCompletedStatus = "failed" ) +// Terminal status reached by a factory execution attempt. +type SystemNotificationFactoryCompletedStatus string + +const ( + // The factory was cancelled. + SystemNotificationFactoryCompletedStatusCancelled SystemNotificationFactoryCompletedStatus = "cancelled" + // The factory completed successfully. + SystemNotificationFactoryCompletedStatusCompleted SystemNotificationFactoryCompletedStatus = "completed" + // The factory failed. + SystemNotificationFactoryCompletedStatusError SystemNotificationFactoryCompletedStatus = "error" + // The factory was halted. + SystemNotificationFactoryCompletedStatusHalted SystemNotificationFactoryCompletedStatus = "halted" +) + // Type discriminator for SystemNotification. type SystemNotificationType string const ( SystemNotificationTypeAgentCompleted SystemNotificationType = "agent_completed" SystemNotificationTypeAgentIdle SystemNotificationType = "agent_idle" + SystemNotificationTypeFactoryCompleted SystemNotificationType = "factory_completed" SystemNotificationTypeInstructionDiscovered SystemNotificationType = "instruction_discovered" SystemNotificationTypeNewInboxMessage SystemNotificationType = "new_inbox_message" SystemNotificationTypeShellCompleted SystemNotificationType = "shell_completed" diff --git a/go/zsession_events.go b/go/zsession_events.go index c79814c9ef..a6bd1ed736 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -105,6 +105,8 @@ type ( ExtensionsLoadedExtensionStatus = rpc.ExtensionsLoadedExtensionStatus ExternalToolCompletedData = rpc.ExternalToolCompletedData ExternalToolRequestedData = rpc.ExternalToolRequestedData + FactoryPermissionOperation = rpc.FactoryPermissionOperation + FactoryPermissionPhase = rpc.FactoryPermissionPhase FactoryRunUpdatedData = rpc.FactoryRunUpdatedData GitHubRepoRef = rpc.GitHubRepoRef HandoffRepository = rpc.HandoffRepository @@ -168,6 +170,7 @@ type ( PermissionPromptRequestCustomTool = rpc.PermissionPromptRequestCustomTool PermissionPromptRequestExtensionManagement = rpc.PermissionPromptRequestExtensionManagement PermissionPromptRequestExtensionPermissionAccess = rpc.PermissionPromptRequestExtensionPermissionAccess + PermissionPromptRequestFactory = rpc.PermissionPromptRequestFactory PermissionPromptRequestHook = rpc.PermissionPromptRequestHook PermissionPromptRequestKind = rpc.PermissionPromptRequestKind PermissionPromptRequestMCP = rpc.PermissionPromptRequestMCP @@ -183,6 +186,7 @@ type ( PermissionRequestedData = rpc.PermissionRequestedData PermissionRequestExtensionManagement = rpc.PermissionRequestExtensionManagement PermissionRequestExtensionPermissionAccess = rpc.PermissionRequestExtensionPermissionAccess + PermissionRequestFactory = rpc.PermissionRequestFactory PermissionRequestHook = rpc.PermissionRequestHook PermissionRequestKind = rpc.PermissionRequestKind PermissionRequestMCP = rpc.PermissionRequestMCP @@ -298,6 +302,8 @@ type ( SystemNotificationAgentCompletedStatus = rpc.SystemNotificationAgentCompletedStatus SystemNotificationAgentIdle = rpc.SystemNotificationAgentIdle SystemNotificationData = rpc.SystemNotificationData + SystemNotificationFactoryCompleted = rpc.SystemNotificationFactoryCompleted + SystemNotificationFactoryCompletedStatus = rpc.SystemNotificationFactoryCompletedStatus SystemNotificationInstructionDiscovered = rpc.SystemNotificationInstructionDiscovered SystemNotificationNewInboxMessage = rpc.SystemNotificationNewInboxMessage SystemNotificationShellCompleted = rpc.SystemNotificationShellCompleted @@ -353,6 +359,7 @@ type ( UserToolSessionApprovalCustomTool = rpc.UserToolSessionApprovalCustomTool UserToolSessionApprovalExtensionManagement = rpc.UserToolSessionApprovalExtensionManagement UserToolSessionApprovalExtensionPermissionAccess = rpc.UserToolSessionApprovalExtensionPermissionAccess + UserToolSessionApprovalFactory = rpc.UserToolSessionApprovalFactory UserToolSessionApprovalKind = rpc.UserToolSessionApprovalKind UserToolSessionApprovalMCP = rpc.UserToolSessionApprovalMCP UserToolSessionApprovalMemory = rpc.UserToolSessionApprovalMemory @@ -451,6 +458,8 @@ const ( ExtensionsLoadedExtensionStatusFailed = rpc.ExtensionsLoadedExtensionStatusFailed ExtensionsLoadedExtensionStatusRunning = rpc.ExtensionsLoadedExtensionStatusRunning ExtensionsLoadedExtensionStatusStarting = rpc.ExtensionsLoadedExtensionStatusStarting + FactoryPermissionOperationAuthor = rpc.FactoryPermissionOperationAuthor + FactoryPermissionOperationRun = rpc.FactoryPermissionOperationRun HandoffSourceTypeLocal = rpc.HandoffSourceTypeLocal HandoffSourceTypeRemote = rpc.HandoffSourceTypeRemote ManagedSettingsEnforcedActionBypassPermissionsBlocked = rpc.ManagedSettingsEnforcedActionBypassPermissionsBlocked @@ -510,6 +519,7 @@ const ( PermissionPromptRequestKindCustomTool = rpc.PermissionPromptRequestKindCustomTool PermissionPromptRequestKindExtensionManagement = rpc.PermissionPromptRequestKindExtensionManagement PermissionPromptRequestKindExtensionPermissionAccess = rpc.PermissionPromptRequestKindExtensionPermissionAccess + PermissionPromptRequestKindFactory = rpc.PermissionPromptRequestKindFactory PermissionPromptRequestKindHook = rpc.PermissionPromptRequestKindHook PermissionPromptRequestKindMCP = rpc.PermissionPromptRequestKindMCP PermissionPromptRequestKindMemory = rpc.PermissionPromptRequestKindMemory @@ -523,6 +533,7 @@ const ( PermissionRequestKindCustomTool = rpc.PermissionRequestKindCustomTool PermissionRequestKindExtensionManagement = rpc.PermissionRequestKindExtensionManagement PermissionRequestKindExtensionPermissionAccess = rpc.PermissionRequestKindExtensionPermissionAccess + PermissionRequestKindFactory = rpc.PermissionRequestKindFactory PermissionRequestKindHook = rpc.PermissionRequestKindHook PermissionRequestKindMCP = rpc.PermissionRequestKindMCP PermissionRequestKindMemory = rpc.PermissionRequestKindMemory @@ -692,8 +703,13 @@ const ( SystemMessageRoleSystem = rpc.SystemMessageRoleSystem SystemNotificationAgentCompletedStatusCompleted = rpc.SystemNotificationAgentCompletedStatusCompleted SystemNotificationAgentCompletedStatusFailed = rpc.SystemNotificationAgentCompletedStatusFailed + SystemNotificationFactoryCompletedStatusCancelled = rpc.SystemNotificationFactoryCompletedStatusCancelled + SystemNotificationFactoryCompletedStatusCompleted = rpc.SystemNotificationFactoryCompletedStatusCompleted + SystemNotificationFactoryCompletedStatusError = rpc.SystemNotificationFactoryCompletedStatusError + SystemNotificationFactoryCompletedStatusHalted = rpc.SystemNotificationFactoryCompletedStatusHalted SystemNotificationTypeAgentCompleted = rpc.SystemNotificationTypeAgentCompleted SystemNotificationTypeAgentIdle = rpc.SystemNotificationTypeAgentIdle + SystemNotificationTypeFactoryCompleted = rpc.SystemNotificationTypeFactoryCompleted SystemNotificationTypeInstructionDiscovered = rpc.SystemNotificationTypeInstructionDiscovered SystemNotificationTypeNewInboxMessage = rpc.SystemNotificationTypeNewInboxMessage SystemNotificationTypeShellCompleted = rpc.SystemNotificationTypeShellCompleted @@ -726,6 +742,7 @@ const ( UserToolSessionApprovalKindCustomTool = rpc.UserToolSessionApprovalKindCustomTool UserToolSessionApprovalKindExtensionManagement = rpc.UserToolSessionApprovalKindExtensionManagement UserToolSessionApprovalKindExtensionPermissionAccess = rpc.UserToolSessionApprovalKindExtensionPermissionAccess + UserToolSessionApprovalKindFactory = rpc.UserToolSessionApprovalKindFactory UserToolSessionApprovalKindMCP = rpc.UserToolSessionApprovalKindMCP UserToolSessionApprovalKindMemory = rpc.UserToolSessionApprovalKindMemory UserToolSessionApprovalKindRead = rpc.UserToolSessionApprovalKindRead diff --git a/java/pom.xml b/java/pom.xml index 24765bad50..1e5c76beb6 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -88,7 +88,7 @@ DO NOT EDIT MANUALLY. Updated by the update-copilot-dependency workflow. --> - ^1.0.77 + ^1.0.78-2 diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index 3ddbf772b1..a071da4d73 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.77", + "@github/copilot": "^1.0.78-2", "json-schema": "^0.4.0", "tsx": "^4.23.1" } @@ -428,9 +428,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.77.tgz", - "integrity": "sha512-nkTtDPKvsClAByPPqnD/57vK7YIBK1dgiv7aVc9uO3rxKCyqiqYaBqwi8pMzesvGP3yl+//+iMzaBXNWEcZVWQ==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.78-2.tgz", + "integrity": "sha512-9MrssRFvYWFPnePZ8BFgMGv735awQ19KrKMZYr14u7Kp9j8l3jyUiSMKa5oCJD5V0mR52+1YE2jy4TCfF/mqlA==", "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.77", - "@github/copilot-darwin-x64": "1.0.77", - "@github/copilot-linux-arm64": "1.0.77", - "@github/copilot-linux-x64": "1.0.77", - "@github/copilot-linuxmusl-arm64": "1.0.77", - "@github/copilot-linuxmusl-x64": "1.0.77", - "@github/copilot-win32-arm64": "1.0.77", - "@github/copilot-win32-x64": "1.0.77" + "@github/copilot-darwin-arm64": "1.0.78-2", + "@github/copilot-darwin-x64": "1.0.78-2", + "@github/copilot-linux-arm64": "1.0.78-2", + "@github/copilot-linux-x64": "1.0.78-2", + "@github/copilot-linuxmusl-arm64": "1.0.78-2", + "@github/copilot-linuxmusl-x64": "1.0.78-2", + "@github/copilot-win32-arm64": "1.0.78-2", + "@github/copilot-win32-x64": "1.0.78-2" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.77.tgz", - "integrity": "sha512-sCWSH5+Flm/OxFe7dzsBfyj7ADBkzkR54Sz5NGw7dtcVVEOnVUkZLjEtNmZ1t5QRD4Sf1+g/DiwgJEbsR9xR1w==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.78-2.tgz", + "integrity": "sha512-tZ+53pbjdFzyIJHBhRhjbKTZZjBT2gJ2RF+MRqJKE9uv774rNxtWb3a9T3Yfu78smjusKjFf0dfJp2rabhxAKQ==", "cpu": [ "arm64" ], @@ -466,9 +466,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.77.tgz", - "integrity": "sha512-ReNlB+g+OBiqHwmY5leJBIyvHZQcjyWL/OY8aVimHyESn2ToPKP3eUNTzSUJvvbPM6+0LXwEpijLedkRd2Cn1g==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.78-2.tgz", + "integrity": "sha512-DpCSlK8u+k5bHeLpbYjJpDaIMlPulpDoTi5zJOcmKIBcxBUx5/RjPogq6DjumNSyLC09Fm9ddMPQgitvMxhDUw==", "cpu": [ "x64" ], @@ -482,9 +482,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.77.tgz", - "integrity": "sha512-A8j/WBPFvV5WfLbgnIIQLUVuFRAR7kLyc5WgId6XLCu1ARbkRM7353zz9mEXXwjc6LqotHVg80ooANJjNtmSPg==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.78-2.tgz", + "integrity": "sha512-ERhA6MoAL3yYRdYXN6IielJ8MJheSq7AnchCG92LWq7bRuFwmdQf0mQZzhZd/W6xHsistAQ9dByeVH/UAFB5mA==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.77.tgz", - "integrity": "sha512-2eefKkdUnQ1Y8oxyRyexHBXVpuSmrfEM8XJauquVjPc0JqF5nab9axwpFPzrRSF1GB+25F9tUK2sDQRyp08wag==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.78-2.tgz", + "integrity": "sha512-lbHfY2NrgPxhpJTnvbMWmtxDwSwkgIb9wqJGCQ50ofeX4RuONmBb1960rtmkECtGyN6zDUzIatX7MNBRRBFIpA==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.77.tgz", - "integrity": "sha512-YtltOZQp8plytSKSGTWWKbOx3QD8iZH04sLtKTrYs6nu5UalIgFPoMkwamy1gh7h5EBkeVxD2s3epVrlvP4X4w==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.78-2.tgz", + "integrity": "sha512-xXHza3RpX/RbTY7/DDK8Bt7kDU0pDEn1Nf1T08X9o06FhUjTeh7wTMUh/Ogfq9ocG5K4v8fuk1ONv63viQVeIA==", "cpu": [ "arm64" ], @@ -530,9 +530,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.77.tgz", - "integrity": "sha512-owINwPgHU/ZZBwFhVPgkgGjLkF6e4QbdofADvKMdKJWV2+7oWjXUIlPA4/PwraD2Gkuu583l7m0XLL27TN8oUA==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.78-2.tgz", + "integrity": "sha512-ihWyNGlyJHs1iAZsG+BLYzRxpKzRX+OV7E5HVIlAAxL6fxw2ymkgrfSAfx5FR8D2ZXWloY14ZKttFUbizAyJkg==", "cpu": [ "x64" ], @@ -546,9 +546,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.77.tgz", - "integrity": "sha512-l5oQaMLCRup0nmmpbqOAYEAJ5YWgNlaoO0psNaKDzvTbdzEJRZqib2t7+p3bgoDpK7SB/m8m1uxFC4XT3hlprg==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.78-2.tgz", + "integrity": "sha512-5rzE6ysT8ZMCZ8zhcgtExaaZ05UFo6KOCQZNYi+YGx8xpObR92vruZKKhBZH2vE51DM47dT1JQ9o0jS6eP7/dw==", "cpu": [ "arm64" ], @@ -562,9 +562,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.77.tgz", - "integrity": "sha512-8Mo9y3/8CVU2w35WqwSiRMTGH1kKHR3URPSJYF4J4OG8L7NOEy2fafXR9Tuq3H21Srg3OzFkl/A+Taunqz9KcA==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.78-2.tgz", + "integrity": "sha512-10bTnLdDXiLcjWTMAoEmSuqkmf8Q+no9B5pL3u5ks3WiFLGx/r9oDo8CeyYV965CEsfoRkBIxWaLUTMra1tlxQ==", "cpu": [ "x64" ], diff --git a/java/scripts/codegen/package.json b/java/scripts/codegen/package.json index f3a144cb14..0c8287d4c1 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.77", + "@github/copilot": "^1.0.78-2", "json-schema": "^0.4.0", "tsx": "^4.23.1" } 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 6c1a87324a..fee236ed2c 100644 --- a/java/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java @@ -53,6 +53,10 @@ public record AssistantMessageEventData( @JsonProperty("encryptedContent") String encryptedContent, /** Generation phase for phased-output models (e.g., thinking vs. response phases) */ @JsonProperty("phase") String phase, + /** Zero-based position of this message within its model call's response. Absent when the response was not split into chunks. */ + @JsonProperty("chunkIndex") Long chunkIndex, + /** Total messages the model call's response was split into, one per reasoning boundary. Absent for a single-message response; the last chunk is the one where chunkIndex is chunkCount - 1. */ + @JsonProperty("chunkCount") Long chunkCount, /** Actual output token count from the API response (completion_tokens), used for accurate token accounting */ @JsonProperty("outputTokens") Long outputTokens, /** CAPI interaction ID for correlating this message with upstream telemetry */ diff --git a/java/src/generated/java/com/github/copilot/generated/GitHubMcpToolConfig.java b/java/src/generated/java/com/github/copilot/generated/GitHubMcpToolConfig.java new file mode 100644 index 0000000000..afa69b9856 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/GitHubMcpToolConfig.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * 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 java.util.List; +import javax.annotation.processing.Generated; + +/** + * Per-session configuration for the built-in GitHub MCP server + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record GitHubMcpToolConfig( + /** Whether to use the read-write endpoint and request all toolsets */ + @JsonProperty("enableAllTools") Boolean enableAllTools, + /** Additional GitHub MCP toolsets requested by the session */ + @JsonProperty("additionalToolsets") List additionalToolsets, + /** Additional GitHub MCP tools requested by the session */ + @JsonProperty("additionalTools") List additionalTools, + /** Whether to request the GitHub MCP insiders build */ + @JsonProperty("enableInsidersMode") Boolean enableInsidersMode +) { +} 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 4beb487c31..bf8b4e91cf 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java @@ -59,6 +59,8 @@ public record SessionStartEventData( @JsonProperty("sessionLimits") SessionLimitsConfig sessionLimits, /** Working directory and git context at session start */ @JsonProperty("context") WorkingDirectoryContext context, + /** Per-session GitHub MCP override persisted for cold resume */ + @JsonProperty("githubMcpToolConfig") GitHubMcpToolConfig gitHubMcpToolConfig, /** Whether the session was already in use by another client at start time */ @JsonProperty("alreadyInUse") Boolean alreadyInUse, /** Whether this session supports remote steering via GitHub */ diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtension.java b/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtension.java new file mode 100644 index 0000000000..7bb2531fe8 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtension.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 com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Discovered extension metadata and persistent enablement state. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record DiscoveredExtension( + /** Source-qualified ID accepted by both server and session extension enablement methods */ + @JsonProperty("id") String id, + /** Human-readable extension name */ + @JsonProperty("name") String name, + /** Absolute path to the extension entry module, suitable for revealing it in a file manager */ + @JsonProperty("path") String path, + /** Discovery source */ + @JsonProperty("source") DiscoveredExtensionSource source, + /** Whether this extension's persistent per-ID preference is enabled */ + @JsonProperty("enabled") Boolean enabled, + /** Containing plugin metadata for plugin-contributed extensions */ + @JsonProperty("plugin") DiscoveredExtensionPlugin plugin +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionMode.java b/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionMode.java new file mode 100644 index 0000000000..23bc327780 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionMode.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; + +/** + * Effective extension loading and agent-management mode + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum DiscoveredExtensionMode { + /** The {@code disabled} variant. */ + DISABLED("disabled"), + /** The {@code load_only} variant. */ + LOAD_ONLY("load_only"), + /** The {@code load_and_augment} variant. */ + LOAD_AND_AUGMENT("load_and_augment"); + + private final String value; + DiscoveredExtensionMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static DiscoveredExtensionMode fromValue(String value) { + for (DiscoveredExtensionMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown DiscoveredExtensionMode value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionPlugin.java b/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionPlugin.java new file mode 100644 index 0000000000..8df0018ef6 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionPlugin.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Installed plugin that contributes a discovered extension. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record DiscoveredExtensionPlugin( + /** Installed plugin name */ + @JsonProperty("name") String name +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionSource.java b/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionSource.java new file mode 100644 index 0000000000..c38225167d --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/DiscoveredExtensionSource.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Persisted extension discovery source + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum DiscoveredExtensionSource { + /** The {@code user} variant. */ + USER("user"), + /** The {@code plugin} variant. */ + PLUGIN("plugin"); + + private final String value; + DiscoveredExtensionSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static DiscoveredExtensionSource fromValue(String value) { + for (DiscoveredExtensionSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown DiscoveredExtensionSource value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.java b/java/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.java index 31c1fcab01..20f37bdfa4 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.java @@ -10,7 +10,7 @@ import javax.annotation.processing.Generated; /** - * Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. + * Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history (the beginning for a forward read, the tail for a backward read). The fallback page is a fresh boundary snapshot, not a continuation of the requested cursor, so it may overlap already-rendered events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate by event id) before continuing from the returned cursor. * * @since 1.0.0 */ diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/EventsReadDirection.java b/java/src/generated/java/com/github/copilot/generated/rpc/EventsReadDirection.java new file mode 100644 index 0000000000..1df0ac8f7d --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/EventsReadDirection.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Direction to page through the session's persisted event history. 'forward' pages from the cursor toward newer events; 'backward' returns the newest window first (tail-first) and pages toward older events. Events within a returned batch are always chronological (oldest-to-newest), even for a backward read. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum EventsReadDirection { + /** The {@code forward} variant. */ + FORWARD("forward"), + /** The {@code backward} variant. */ + BACKWARD("backward"); + + private final String value; + EventsReadDirection(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static EventsReadDirection fromValue(String value) { + for (EventsReadDirection v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown EventsReadDirection value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsDisableParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsDisableParams.java new file mode 100644 index 0000000000..dc4ef9d6ca --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsDisableParams.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; + +/** + * Source-qualified extension identifiers to persistently disable for future sessions. + * + * @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 ExtensionsDisableParams( + /** Source-qualified user or plugin extension IDs to disable */ + @JsonProperty("ids") List ids +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsDiscoverResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsDiscoverResult.java new file mode 100644 index 0000000000..fa319d7fed --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsDiscoverResult.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included. + * + * @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 ExtensionsDiscoverResult( + /** Discovered user and enabled installed-plugin extensions from persisted Copilot home state */ + @JsonProperty("extensions") List extensions, + /** Effective extension loading mode. Defaults to load_and_augment when unset. */ + @JsonProperty("mode") DiscoveredExtensionMode mode +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsEnableParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsEnableParams.java new file mode 100644 index 0000000000..2e4351d3d9 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ExtensionsEnableParams.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; + +/** + * Source-qualified extension identifiers to persistently enable for future sessions. + * + * @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 ExtensionsEnableParams( + /** Source-qualified user or plugin extension IDs to enable */ + @JsonProperty("ids") List ids +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java b/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java index 3460560b28..be4f2abe20 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java @@ -30,6 +30,8 @@ public record SandboxConfig( /** Whether to inject the Copilot GitHub token as an `http..extraheader` so authenticated HTTPS git works inside the sandbox without the shell-based credential helper the sandbox blocks. Default: false (opt-in). */ @JsonProperty("gitAuth") Boolean gitAuth, /** Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the OS keyring the sandbox blocks. Default: false (opt-in). */ - @JsonProperty("ghAuth") Boolean ghAuth + @JsonProperty("ghAuth") Boolean ghAuth, + /** Whether to auto-grant read access to common developer-tool caches, registries, and toolchains in their default home locations (cargo, go, npm, Maven, and more), plus read-write access to (and, on Unix, up-front creation of) the scratch caches builds write on every run (go-build, ccache, sccache, Gradle caches, Cargo lock/tracker files), so builds work without exporting CARGO_HOME/GOPATH/etc. Default: true (enabled by default; set to false to opt out). */ + @JsonProperty("allowDevToolCaches") Boolean allowDevToolCaches ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ServerExtensionsApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/ServerExtensionsApi.java new file mode 100644 index 0000000000..7bc74b441f --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ServerExtensionsApi.java @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * 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 extensions} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ServerExtensionsApi { + + private final RpcCaller caller; + + /** @param caller the RPC transport function */ + ServerExtensionsApi(RpcCaller caller) { + this.caller = caller; + } + + /** + * Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture discover() { + return caller.invoke("extensions.discover", java.util.Map.of(), ExtensionsDiscoverResult.class); + } + + /** + * Source-qualified extension identifiers to persistently enable for future sessions. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture enable(ExtensionsEnableParams params) { + return caller.invoke("extensions.enable", params, Void.class); + } + + /** + * Source-qualified extension identifiers to persistently disable for future sessions. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture disable(ExtensionsDisableParams params) { + return caller.invoke("extensions.disable", params, Void.class); + } + +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java b/java/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java index 033fe8bf3e..e66f32737f 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java @@ -35,6 +35,8 @@ public final class ServerRpc { public final ServerSecretsApi secrets; /** API methods for the {@code mcp} namespace. */ public final ServerMcpApi mcp; + /** API methods for the {@code extensions} namespace. */ + public final ServerExtensionsApi extensions; /** API methods for the {@code plugins} namespace. */ public final ServerPluginsApi plugins; /** API methods for the {@code skills} namespace. */ @@ -70,6 +72,7 @@ public ServerRpc(RpcCaller caller) { this.account = new ServerAccountApi(caller); this.secrets = new ServerSecretsApi(caller); this.mcp = new ServerMcpApi(caller); + this.extensions = new ServerExtensionsApi(caller); this.plugins = new ServerPluginsApi(caller); this.skills = new ServerSkillsApi(caller); this.agents = new ServerAgentsApi(caller); diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionAgentApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionAgentApi.java index 3a17960749..d2499fe3a5 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionAgentApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionAgentApi.java @@ -59,6 +59,22 @@ public CompletableFuture list(SessionAgentListParams par return caller.invoke("session.agent.list", _p, SessionAgentListResult.class); } + /** + * An in-memory authored prompt override for an available agent. + *

+ * 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 setPrompt(SessionAgentSetPromptParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.agent.setPrompt", _p, Void.class); + } + /** * Identifies the target session. * diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionAgentSetPromptParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionAgentSetPromptParams.java new file mode 100644 index 0000000000..4395a195ed --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionAgentSetPromptParams.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; + +/** + * An in-memory authored prompt override for an available agent. + * + * @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 SessionAgentSetPromptParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Stable effective agent id. Plugin namespace separators are normalized. */ + @JsonProperty("id") String id, + /** Replacement authored prompt. Empty text is valid. */ + @JsonProperty("prompt") String prompt +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadParams.java index ad16d802b6..bbc5abb7c2 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadParams.java @@ -11,6 +11,7 @@ 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; /** @@ -30,13 +31,17 @@ public record SessionEventLogReadParams( @JsonProperty("cursor") String cursor, /** Maximum number of events to return in this batch (1–1000, default 200). */ @JsonProperty("max") Long max, - /** Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). */ + /** Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). This applies to forward reads only: a backward read always returns immediately and ignores `waitMs`, because backward paging covers persisted history only while new events append at the tail (the opposite end from a backward page), so no blocking or ephemeral delivery can occur. */ @JsonProperty("waitMs") Long waitMs, /** Either '*' to receive all event types, or a non-empty list of event types to receive */ @JsonProperty("types") Object types, /** Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers. */ @JsonProperty("agentScope") EventsAgentScope agentScope, - /** When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). */ + /** Optional non-empty list of subagent identifiers. When provided, only events owned by one of these agents are returned; ownership recognizes the event envelope's agentId plus legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over agentScope. */ + @JsonProperty("agentIds") List agentIds, + /** Direction to page through the session's persisted event history. 'forward' (default) pages from the cursor toward newer events (or from the start of history when no cursor is given). 'backward' enables tail-first reads: with no cursor it returns the NEWEST `max` events, and the returned cursor pages toward OLDER events on subsequent backward reads. Events within a returned batch are always in chronological (oldest-to-newest) order, even for a backward read. Backward reads cover PERSISTED history only; ephemeral events are never returned by a backward read. `direction` selects the INITIAL read only: the returned cursor is self-describing, so a continuation read pages in the cursor's own direction regardless of the `direction` passed alongside it — a forward cursor always pages forward and a backward cursor always pages backward. Pass the direction that matches the cursor to avoid confusion. */ + @JsonProperty("direction") EventsReadDirection direction, + /** When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). Ignored by backward reads, which always cover persisted history only. */ @JsonProperty("includeEphemeral") Boolean includeEphemeral ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.java index 240c385c0c..767acc8795 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.java @@ -25,13 +25,13 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record SessionEventLogReadResult( - /** Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. */ + /** Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window contains persisted events only, still in chronological (oldest-to-newest) append order. */ @JsonProperty("events") List events, - /** Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. */ + /** Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. For a backward read this cursor pages toward OLDER events; keep passing `direction: backward` with it (the cursor is also self-describing, so backward paging continues correctly). */ @JsonProperty("cursor") String cursor, - /** True when the read returned `max` events and more events are available immediately. When false, the next read with a non-zero `waitMs` will block until a new event arrives or the wait expires. */ + /** True when more events are available in the read's direction. For a forward read, true means the batch returned `max` events and more are available immediately. For a backward read, true means older persisted events remain before the returned window. */ @JsonProperty("hasMore") Boolean hasMore, - /** Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. */ + /** Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history. For a forward read the fallback starts from the beginning of the remaining history; for a backward read it falls back to the tail (the newest window). Because the fallback page is a fresh boundary snapshot rather than a continuation of the requested cursor, it may overlap events the consumer has already rendered — a backward fallback to the tail in particular can repeat the newest window. On 'expired', consumers should reset or rebase their local pagination state (or deduplicate by event id) before continuing from the returned cursor rather than blindly appending/prepending the fallback page. */ @JsonProperty("cursorStatus") EventsCursorStatus cursorStatus ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java index 4fb92cf145..1fdb292f84 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java @@ -46,6 +46,22 @@ public CompletableFuture handlePendin return caller.invoke("session.mcp.oauth.handlePendingRequest", _p, SessionMcpOauthHandlePendingRequestResult.class); } + /** + * Identifies the MCP server whose persisted OAuth credentials were updated. + *

+ * 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 authenticationStateChanged(SessionMcpOauthAuthenticationStateChangedParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.oauth.authenticationStateChanged", _p, Void.class); + } + /** * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection. *

diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthAuthenticationStateChangedParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthAuthenticationStateChangedParams.java new file mode 100644 index 0000000000..b773e1bf77 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthAuthenticationStateChangedParams.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; + +/** + * Identifies the MCP server whose persisted OAuth credentials were updated. + * + * @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 SessionMcpOauthAuthenticationStateChangedParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the MCP server whose OAuth credentials were updated. Omit only when the host cannot identify the server. */ + @JsonProperty("serverName") String serverName, + /** Whether the target session must mint a session-scoped access token instead of reusing a shared access token persisted by another session. */ + @JsonProperty("refreshSessionToken") Boolean refreshSessionToken +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java index 7bde47bc81..f31646f766 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java @@ -30,7 +30,7 @@ public record SessionPermissionsSetAllowAllParams( @JsonProperty("mode") PermissionsAllowAllMode mode, /** Legacy full allow-all toggle. Prefer `mode`; when `mode` is omitted, `enabled: true` is treated as `mode: "on"` and any other value is treated as `mode: "off"`. */ @JsonProperty("enabled") Boolean enabled, - /** Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session's active model is used. */ + /** Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session resolves a default judge model: `gpt-5.5` for CAPI sessions and the session's active model for BYOK sessions. */ @JsonProperty("model") String model, /** Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. */ @JsonProperty("source") PermissionsSetAllowAllSource source diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 42110e80e2..f936a0cbb7 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.77", + "@github/copilot": "^1.0.78-2", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" @@ -700,9 +700,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.77.tgz", - "integrity": "sha512-nkTtDPKvsClAByPPqnD/57vK7YIBK1dgiv7aVc9uO3rxKCyqiqYaBqwi8pMzesvGP3yl+//+iMzaBXNWEcZVWQ==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.78-2.tgz", + "integrity": "sha512-9MrssRFvYWFPnePZ8BFgMGv735awQ19KrKMZYr14u7Kp9j8l3jyUiSMKa5oCJD5V0mR52+1YE2jy4TCfF/mqlA==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -711,20 +711,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.77", - "@github/copilot-darwin-x64": "1.0.77", - "@github/copilot-linux-arm64": "1.0.77", - "@github/copilot-linux-x64": "1.0.77", - "@github/copilot-linuxmusl-arm64": "1.0.77", - "@github/copilot-linuxmusl-x64": "1.0.77", - "@github/copilot-win32-arm64": "1.0.77", - "@github/copilot-win32-x64": "1.0.77" + "@github/copilot-darwin-arm64": "1.0.78-2", + "@github/copilot-darwin-x64": "1.0.78-2", + "@github/copilot-linux-arm64": "1.0.78-2", + "@github/copilot-linux-x64": "1.0.78-2", + "@github/copilot-linuxmusl-arm64": "1.0.78-2", + "@github/copilot-linuxmusl-x64": "1.0.78-2", + "@github/copilot-win32-arm64": "1.0.78-2", + "@github/copilot-win32-x64": "1.0.78-2" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.77.tgz", - "integrity": "sha512-sCWSH5+Flm/OxFe7dzsBfyj7ADBkzkR54Sz5NGw7dtcVVEOnVUkZLjEtNmZ1t5QRD4Sf1+g/DiwgJEbsR9xR1w==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.78-2.tgz", + "integrity": "sha512-tZ+53pbjdFzyIJHBhRhjbKTZZjBT2gJ2RF+MRqJKE9uv774rNxtWb3a9T3Yfu78smjusKjFf0dfJp2rabhxAKQ==", "cpu": [ "arm64" ], @@ -738,9 +738,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.77.tgz", - "integrity": "sha512-ReNlB+g+OBiqHwmY5leJBIyvHZQcjyWL/OY8aVimHyESn2ToPKP3eUNTzSUJvvbPM6+0LXwEpijLedkRd2Cn1g==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.78-2.tgz", + "integrity": "sha512-DpCSlK8u+k5bHeLpbYjJpDaIMlPulpDoTi5zJOcmKIBcxBUx5/RjPogq6DjumNSyLC09Fm9ddMPQgitvMxhDUw==", "cpu": [ "x64" ], @@ -754,9 +754,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.77.tgz", - "integrity": "sha512-A8j/WBPFvV5WfLbgnIIQLUVuFRAR7kLyc5WgId6XLCu1ARbkRM7353zz9mEXXwjc6LqotHVg80ooANJjNtmSPg==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.78-2.tgz", + "integrity": "sha512-ERhA6MoAL3yYRdYXN6IielJ8MJheSq7AnchCG92LWq7bRuFwmdQf0mQZzhZd/W6xHsistAQ9dByeVH/UAFB5mA==", "cpu": [ "arm64" ], @@ -770,9 +770,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.77.tgz", - "integrity": "sha512-2eefKkdUnQ1Y8oxyRyexHBXVpuSmrfEM8XJauquVjPc0JqF5nab9axwpFPzrRSF1GB+25F9tUK2sDQRyp08wag==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.78-2.tgz", + "integrity": "sha512-lbHfY2NrgPxhpJTnvbMWmtxDwSwkgIb9wqJGCQ50ofeX4RuONmBb1960rtmkECtGyN6zDUzIatX7MNBRRBFIpA==", "cpu": [ "x64" ], @@ -786,9 +786,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.77.tgz", - "integrity": "sha512-YtltOZQp8plytSKSGTWWKbOx3QD8iZH04sLtKTrYs6nu5UalIgFPoMkwamy1gh7h5EBkeVxD2s3epVrlvP4X4w==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.78-2.tgz", + "integrity": "sha512-xXHza3RpX/RbTY7/DDK8Bt7kDU0pDEn1Nf1T08X9o06FhUjTeh7wTMUh/Ogfq9ocG5K4v8fuk1ONv63viQVeIA==", "cpu": [ "arm64" ], @@ -802,9 +802,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.77.tgz", - "integrity": "sha512-owINwPgHU/ZZBwFhVPgkgGjLkF6e4QbdofADvKMdKJWV2+7oWjXUIlPA4/PwraD2Gkuu583l7m0XLL27TN8oUA==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.78-2.tgz", + "integrity": "sha512-ihWyNGlyJHs1iAZsG+BLYzRxpKzRX+OV7E5HVIlAAxL6fxw2ymkgrfSAfx5FR8D2ZXWloY14ZKttFUbizAyJkg==", "cpu": [ "x64" ], @@ -818,9 +818,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.77.tgz", - "integrity": "sha512-l5oQaMLCRup0nmmpbqOAYEAJ5YWgNlaoO0psNaKDzvTbdzEJRZqib2t7+p3bgoDpK7SB/m8m1uxFC4XT3hlprg==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.78-2.tgz", + "integrity": "sha512-5rzE6ysT8ZMCZ8zhcgtExaaZ05UFo6KOCQZNYi+YGx8xpObR92vruZKKhBZH2vE51DM47dT1JQ9o0jS6eP7/dw==", "cpu": [ "arm64" ], @@ -834,9 +834,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.77.tgz", - "integrity": "sha512-8Mo9y3/8CVU2w35WqwSiRMTGH1kKHR3URPSJYF4J4OG8L7NOEy2fafXR9Tuq3H21Srg3OzFkl/A+Taunqz9KcA==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.78-2.tgz", + "integrity": "sha512-10bTnLdDXiLcjWTMAoEmSuqkmf8Q+no9B5pL3u5ks3WiFLGx/r9oDo8CeyYV965CEsfoRkBIxWaLUTMra1tlxQ==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index 8dbe3ac811..92a80eed69 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -56,7 +56,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.77", + "@github/copilot": "^1.0.78-2", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" diff --git a/nodejs/samples/package-lock.json b/nodejs/samples/package-lock.json index 9e6de6ebe6..4c0e09f2da 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.77", + "@github/copilot": "^1.0.78-2", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 1cedf34ccc..b45294a5d7 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -418,6 +418,32 @@ export type DebugCollectLogsResultKind = | "archive" /** A directory containing redacted files was written. */ | "directory"; +/** + * Persisted extension discovery source + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "DiscoveredExtensionSource". + */ +/** @experimental */ +export type DiscoveredExtensionSource = + /** Extension discovered from the user's extensions directory. */ + | "user" + /** Extension contributed by an installed plugin. */ + | "plugin"; +/** + * Effective extension loading and agent-management mode + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "DiscoveredExtensionMode". + */ +/** @experimental */ +export type DiscoveredExtensionMode = + /** Extensions are not loaded. */ + | "disabled" + /** Extensions are loaded, but the agent cannot create, reload, or manage them. */ + | "load_only" + /** Extensions are loaded and the agent can create, reload, and manage them. */ + | "load_and_augment"; /** * Server transport type: stdio, http, sse (deprecated), or memory * @@ -455,7 +481,19 @@ export type EventsAgentScope = /** Return events from all agents. */ | "all"; /** - * Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. + * Direction to page through the session's persisted event history. 'forward' pages from the cursor toward newer events; 'backward' returns the newest window first (tail-first) and pages toward older events. Events within a returned batch are always chronological (oldest-to-newest), even for a backward read. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "EventsReadDirection". + */ +/** @experimental */ +export type EventsReadDirection = + /** Page from the cursor toward newer events (default). */ + | "forward" + /** Tail-first: return the newest events and page toward older events. */ + | "backward"; +/** + * Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history (the beginning for a forward read, the tail for a backward read). The fallback page is a fresh boundary snapshot, not a continuation of the requested cursor, so it may overlap already-rendered events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate by event id) before continuing from the returned cursor. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "EventsCursorStatus". @@ -1561,6 +1599,7 @@ export type PermissionDecisionApproveForSessionApproval = | PermissionDecisionApproveForSessionApprovalMemory | PermissionDecisionApproveForSessionApprovalCustomTool | PermissionDecisionApproveForSessionApprovalExtensionManagement + | PermissionDecisionApproveForSessionApprovalFactory | PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess; /** * Approval to persist for this location @@ -1578,6 +1617,7 @@ export type PermissionDecisionApproveForLocationApproval = | PermissionDecisionApproveForLocationApprovalMemory | PermissionDecisionApproveForLocationApprovalCustomTool | PermissionDecisionApproveForLocationApprovalExtensionManagement + | PermissionDecisionApproveForLocationApprovalFactory | PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess; /** * Tool approval to persist and apply @@ -1595,6 +1635,7 @@ export type PermissionsLocationsAddToolApprovalDetails = | PermissionsLocationsAddToolApprovalDetailsMemory | PermissionsLocationsAddToolApprovalDetailsCustomTool | PermissionsLocationsAddToolApprovalDetailsExtensionManagement + | PermissionsLocationsAddToolApprovalDetailsFactory | PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess; /** * Whether the location is a git repo or directory @@ -3728,6 +3769,23 @@ export interface AgentSelectRequest { export interface AgentSelectResult { agent: AgentInfo; } +/** + * An in-memory authored prompt override for an available agent. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "AgentSetPromptRequest". + */ +/** @experimental */ +export interface AgentSetPromptRequest { + /** + * Stable effective agent id. Plugin namespace separators are normalized. + */ + id: string; + /** + * Replacement authored prompt. Empty text is valid. + */ + prompt: string; +} /** * Optional project paths to include when enumerating agent discovery directories. * @@ -4872,6 +4930,86 @@ export interface DebugCollectLogsSkippedEntry { */ reason: string; } +/** + * Discovered extension metadata and persistent enablement state. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "DiscoveredExtension". + */ +/** @experimental */ +export interface DiscoveredExtension { + /** + * Source-qualified ID accepted by both server and session extension enablement methods + */ + id: string; + /** + * Human-readable extension name + */ + name: string; + /** + * Absolute path to the extension entry module, suitable for revealing it in a file manager + */ + path: string; + source: DiscoveredExtensionSource; + /** + * Whether this extension's persistent per-ID preference is enabled + */ + enabled: boolean; + plugin?: DiscoveredExtensionPlugin; +} +/** + * Installed plugin that contributes a discovered extension. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "DiscoveredExtensionPlugin". + */ +/** @experimental */ +export interface DiscoveredExtensionPlugin { + /** + * Installed plugin name + */ + name: string; +} +/** + * Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "DiscoveredExtensions". + */ +/** @experimental */ +export interface DiscoveredExtensions { + /** + * Discovered user and enabled installed-plugin extensions from persisted Copilot home state + */ + extensions: DiscoveredExtension[]; + mode: DiscoveredExtensionMode; +} +/** + * Source-qualified extension identifiers to persistently disable for future sessions. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "DiscoveredExtensionsDisableRequest". + */ +/** @experimental */ +export interface DiscoveredExtensionsDisableRequest { + /** + * Source-qualified user or plugin extension IDs to disable + */ + ids: string[]; +} +/** + * Source-qualified extension identifiers to persistently enable for future sessions. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "DiscoveredExtensionsEnableRequest". + */ +/** @experimental */ +export interface DiscoveredExtensionsEnableRequest { + /** + * Source-qualified user or plugin extension IDs to enable + */ + ids: string[]; +} /** * MCP server discovered by `mcp.discover`, with config source, optional plugin source, transport type, and enabled state. * @@ -4942,13 +5080,20 @@ export interface EventLogReadRequest { */ max?: number; /** - * Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). + * Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). This applies to forward reads only: a backward read always returns immediately and ignores `waitMs`, because backward paging covers persisted history only while new events append at the tail (the opposite end from a backward page), so no blocking or ephemeral delivery can occur. */ waitMs?: number; types?: EventLogTypes; agentScope?: EventsAgentScope; /** - * When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). + * Optional non-empty list of subagent identifiers. When provided, only events owned by one of these agents are returned; ownership recognizes the event envelope's agentId plus legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over agentScope. + * + * @minItems 1 + */ + agentIds?: [string, ...string[]]; + direction?: EventsReadDirection; + /** + * When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). Ignored by backward reads, which always cover persisted history only. */ includeEphemeral?: boolean; } @@ -4987,15 +5132,15 @@ export interface EventLogTailResult { /** @experimental */ export interface EventsReadResult { /** - * Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. + * Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window contains persisted events only, still in chronological (oldest-to-newest) append order. */ events: SessionEvent[]; /** - * Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. + * Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. For a backward read this cursor pages toward OLDER events; keep passing `direction: backward` with it (the cursor is also self-describing, so backward paging continues correctly). */ cursor: string; /** - * True when the read returned `max` events and more events are available immediately. When false, the next read with a non-zero `waitMs` will block until a new event arrives or the wait expires. + * True when more events are available in the read's direction. For a forward read, true means the batch returned `max` events and more are available immediately. For a backward read, true means older persisted events remain before the returned window. */ hasMore: boolean; cursorStatus: EventsCursorStatus; @@ -8140,6 +8285,23 @@ export interface McpToolUi { */ visibility?: McpToolUiVisibility[]; } +/** + * Identifies the MCP server whose persisted OAuth credentials were updated. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpOauthAuthenticationStateChangedRequest". + */ +/** @experimental */ +export interface McpOauthAuthenticationStateChangedRequest { + /** + * Name of the MCP server whose OAuth credentials were updated. Omit only when the host cannot identify the server. + */ + serverName?: string; + /** + * Whether the target session must mint a session-scoped access token instead of reusing a shared access token persisted by another session. + */ + refreshSessionToken?: boolean; +} /** * Pending MCP OAuth request ID and host-provided token or cancellation response. * @@ -9743,6 +9905,23 @@ export interface PermissionDecisionApproveForSessionApprovalExtensionManagement */ operation?: string; } +/** + * Session-scoped factory approval, optionally narrowed by approval key. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "PermissionDecisionApproveForSessionApprovalFactory". + */ +/** @experimental */ +export interface PermissionDecisionApproveForSessionApprovalFactory { + /** + * Approval covering factory operations. + */ + kind: "factory"; + /** + * Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + */ + approvalKey?: string; +} /** * Session-scoped approval details for an extension's permission-gated capability access, keyed by extension name. * @@ -9906,6 +10085,23 @@ export interface PermissionDecisionApproveForLocationApprovalExtensionManagement */ operation?: string; } +/** + * Location-scoped factory approval, optionally narrowed by approval key. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "PermissionDecisionApproveForLocationApprovalFactory". + */ +/** @experimental */ +export interface PermissionDecisionApproveForLocationApprovalFactory { + /** + * Approval covering factory operations. + */ + kind: "factory"; + /** + * Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + */ + approvalKey?: string; +} /** * Location-scoped approval details for an extension's permission-gated capability access, keyed by extension name. * @@ -10281,6 +10477,23 @@ export interface PermissionsLocationsAddToolApprovalDetailsExtensionManagement { */ operation?: string; } +/** + * Location-persisted factory approval, optionally narrowed by approval key. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "PermissionsLocationsAddToolApprovalDetailsFactory". + */ +/** @experimental */ +export interface PermissionsLocationsAddToolApprovalDetailsFactory { + /** + * Approval covering factory operations. + */ + kind: "factory"; + /** + * Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + */ + approvalKey?: string; +} /** * Location-persisted tool approval details for an extension's permission-gated capability access, keyed by extension name. * @@ -10785,7 +10998,7 @@ export interface PermissionsSetAllowAllRequest { */ enabled?: boolean; /** - * Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session's active model is used. + * Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session resolves a default judge model: `gpt-5.5` for CAPI sessions and the session's active model for BYOK sessions. */ model?: string; source?: PermissionsSetAllowAllSource; @@ -12812,6 +13025,10 @@ export interface SandboxConfig { * Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the OS keyring the sandbox blocks. Default: false (opt-in). */ ghAuth?: boolean; + /** + * Whether to auto-grant read access to common developer-tool caches, registries, and toolchains in their default home locations (cargo, go, npm, Maven, and more), plus read-write access to (and, on Unix, up-front creation of) the scratch caches builds write on every run (go-build, ccache, sccache, Gradle caches, Cargo lock/tracker files), so builds work without exporting CARGO_HOME/GOPATH/etc. Default: true (enabled by default; set to false to opt out). + */ + allowDevToolCaches?: boolean; } /** * User-managed sandbox policy fragment merged into the auto-discovered base policy. @@ -18444,6 +18661,30 @@ export function createServerRpc(connection: MessageConnection) { connection.sendRequest("mcp.discover", params), }, /** @experimental */ + extensions: { + /** + * Discovers user and enabled installed-plugin extensions from persisted Copilot home state, including enablement preferences. Launch-scoped additional plugins are not included. + * + * @returns Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included. + */ + discover: async (): Promise => + connection.sendRequest("extensions.discover", {}), + /** + * Persistently enables extension IDs for future sessions. Active sessions are unchanged; use session.extensions.enable to update them. + * + * @param params Source-qualified extension identifiers to persistently enable for future sessions. + */ + enable: async (params: DiscoveredExtensionsEnableRequest): Promise => + connection.sendRequest("extensions.enable", params), + /** + * Persistently disables extension IDs for future sessions. Active sessions are unchanged; use session.extensions.disable to update them. + * + * @param params Source-qualified extension identifiers to persistently disable for future sessions. + */ + disable: async (params: DiscoveredExtensionsDisableRequest): Promise => + connection.sendRequest("extensions.disable", params), + }, + /** @experimental */ plugins: { /** * Lists plugins installed in user/global state. @@ -19568,6 +19809,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ list: async (params?: SessionAgentListRequest): Promise => connection.sendRequest("session.agent.list", { sessionId, ...params }), + /** + * Sets an in-memory authored prompt override for an available agent. For built-in agents, this replaces only the static base prompt while preserving runtime-owned dynamic prompt composition and behavior. The special `general-purpose` agent is not overrideable. Overrides are not persisted; resumed and forked sessions start without them, so the host must re-apply them. + * + * @param params An in-memory authored prompt override for an available agent. + */ + setPrompt: async (params: AgentSetPromptRequest): Promise => + connection.sendRequest("session.agent.setPrompt", { sessionId, ...params }), /** * Gets the currently selected custom agent for the session. * @@ -19844,6 +20092,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ handlePendingRequest: async (params: McpOauthHandlePendingRequest): Promise => connection.sendRequest("session.mcp.oauth.handlePendingRequest", { sessionId, ...params }), + /** + * Notifies the session that MCP OAuth authentication succeeded and updated credentials were persisted, so cached tool definitions can be refreshed. + * + * @param params Identifies the MCP server whose persisted OAuth credentials were updated. + */ + authenticationStateChanged: async (params: McpOauthAuthenticationStateChangedRequest): Promise => + connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { sessionId, ...params }), /** * Starts OAuth authentication for a remote MCP server. * @@ -20744,7 +20999,7 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin /** @experimental */ eventLog: { /** - * Reads a batch of session events from a cursor, optionally waiting for new events. + * Reads a batch of session events from a cursor, optionally waiting for new events. Supports tail-first reads via `direction: backward`. * * @param params Cursor, batch size, and optional long-poll/filter parameters for reading session events. * diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 4e5fb4274b..e6d059ab4b 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -509,6 +509,7 @@ export type SystemNotification = | SystemNotificationShellCompleted | SystemNotificationShellDetachedCompleted | SystemNotificationInstructionDiscovered + | SystemNotificationFactoryCompleted | SystemNotificationUnclassified; /** * Whether the agent completed successfully or failed @@ -518,6 +519,18 @@ export type SystemNotificationAgentCompletedStatus = | "completed" /** The agent failed. */ | "failed"; +/** + * Terminal status reached by a factory execution attempt. + */ +export type SystemNotificationFactoryCompletedStatus = + /** The factory completed successfully. */ + | "completed" + /** The factory was halted. */ + | "halted" + /** The factory was cancelled. */ + | "cancelled" + /** The factory failed. */ + | "error"; /** * Details of the permission being requested */ @@ -531,6 +544,7 @@ export type PermissionRequest = | PermissionRequestCustomTool | PermissionRequestHook | PermissionRequestExtensionManagement + | PermissionRequestFactory | PermissionRequestExtensionPermissionAccess; /** * Whether this is a store or vote memory operation @@ -548,6 +562,14 @@ export type PermissionRequestMemoryDirection = | "upvote" /** Vote that the memory is incorrect or outdated. */ | "downvote"; +/** + * Operation gated by a factory permission request. + */ +export type FactoryPermissionOperation = + /** Running a registered factory, which spends subagents, active time, and AI credits under the approved limits. */ + | "run" + /** Authoring a factory, which writes JavaScript into a session-scoped extension and loads it. */ + | "author"; /** * Derived user-facing permission prompt details for UI consumers */ @@ -562,6 +584,7 @@ export type PermissionPromptRequest = | PermissionPromptRequestPath | PermissionPromptRequestHook | PermissionPromptRequestExtensionManagement + | PermissionPromptRequestFactory | PermissionPromptRequestExtensionPermissionAccess; /** * Why the auto-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs. @@ -625,6 +648,7 @@ export type UserToolSessionApproval = | UserToolSessionApprovalMemory | UserToolSessionApprovalCustomTool | UserToolSessionApprovalExtensionManagement + | UserToolSessionApprovalFactory | UserToolSessionApprovalExtensionPermissionAccess; /** * Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent. @@ -894,6 +918,7 @@ export interface StartData { * When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id. */ detachedFromSpawningParentSessionId?: string; + githubMcpToolConfig?: GitHubMcpToolConfig; /** * Identifier of the software producing the events (e.g., "copilot-agent") */ @@ -964,6 +989,27 @@ export interface WorkingDirectoryContext { */ repositoryHost?: string; } +/** + * Per-session configuration for the built-in GitHub MCP server + */ +export interface GitHubMcpToolConfig { + /** + * Additional GitHub MCP tools requested by the session + */ + additionalTools?: string[]; + /** + * Additional GitHub MCP toolsets requested by the session + */ + additionalToolsets?: string[]; + /** + * Whether to use the read-write endpoint and request all toolsets + */ + enableAllTools?: boolean; + /** + * Whether to request the GitHub MCP insiders build + */ + enableInsidersMode?: boolean; +} /** * Optional session limits. */ @@ -3566,6 +3612,14 @@ export interface AssistantMessageData { * Provider's completion / response identifier; shared across all chunks of a single API call. Used to group multi-chunk assistant utterances. */ apiCallId?: string; + /** + * Total messages the model call's response was split into, one per reasoning boundary. Absent for a single-message response; the last chunk is the one where chunkIndex is chunkCount - 1. + */ + chunkCount?: number; + /** + * Zero-based position of this message within its model call's response. Absent when the response was not split into chunks. + */ + chunkIndex?: number; /** * Provider-agnostic citations linking spans of this message's content to the sources that support them. Experimental; only populated when citation emission is enabled. * @@ -6093,6 +6147,54 @@ export interface SystemNotificationInstructionDiscovered { */ type: "instruction_discovered"; } +/** + * System notification metadata for a factory execution attempt that reached a terminal state. + */ +export interface SystemNotificationFactoryCompleted { + /** + * Execution attempt that reached this terminal state. + */ + attempt: number; + /** + * Consumed AI usage in nano-AIU. + */ + consumedNanoAiu: number; + /** + * Subagents consumed by the run across all attempts. + */ + consumedSubagents: number; + /** + * Accumulated active execution time in milliseconds. + */ + elapsedMs: number; + /** + * Persisted factory name. + */ + factoryName: string; + /** + * Machine-readable terminal failure details, when present. + */ + failure?: { + [k: string]: unknown | undefined; + }; + /** + * Bounded prompt-safe preview of the completed result. + */ + resultPreview?: string; + /** + * Actionable run_factory resume guidance for a resource-limit failure. + */ + retryGuidance?: string; + /** + * Factory run identifier. + */ + runId: string; + status: SystemNotificationFactoryCompletedStatus; + /** + * Type discriminator. Always "factory_completed". + */ + type: "factory_completed"; +} /** * System notification metadata from an external host that does not match a runtime-owned notification kind. */ @@ -6511,6 +6613,73 @@ export interface PermissionRequestExtensionManagement { */ toolCallId?: string; } +/** + * Factory run or authoring permission request + */ +export interface PermissionRequestFactory { + /** + * Canonical key used for scoped factory approvals + */ + approvalKey: string; + /** + * Whether this factory is eligible for persistent approval + */ + canPersistApproval: boolean; + declaredMaxAiCredits?: number; + declaredMaxConcurrentSubagents?: number; + declaredMaxTotalSubagents?: number; + declaredTimeoutSeconds?: number; + /** + * Factory description + */ + description: string; + /** + * Permission kind discriminator + */ + kind: "factory"; + /** + * Effective AI-credit limit; omitted means unlimited + */ + maxAiCredits?: number; + /** + * Effective concurrent-subagent limit; omitted means unlimited + */ + maxConcurrentSubagents?: number; + /** + * Effective total-subagent limit; omitted means unlimited + */ + maxTotalSubagents?: number; + /** + * Factory name + */ + name: string; + operation: FactoryPermissionOperation; + /** + * Declared factory phases + */ + phases: FactoryPermissionPhase[]; + /** + * Effective active-time limit in seconds; omitted means unlimited + */ + timeoutSeconds?: number; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; +} +/** + * A declared phase shown in a factory permission prompt. + */ +export interface FactoryPermissionPhase { + /** + * Optional phase detail + */ + detail?: string; + /** + * Phase title + */ + title: string; +} /** * Extension permission access request */ @@ -6899,6 +7068,70 @@ export interface PermissionPromptRequestExtensionManagement { */ toolCallId?: string; } +/** + * Factory run or authoring permission prompt + */ +export interface PermissionPromptRequestFactory { + /** + * Canonical key used for scoped factory approvals + */ + approvalKey: string; + /** + * Auto-approval judge information for this request; present only when auto mode is enabled. + * + * @experimental + */ + autoApproval?: PermissionAutoApproval; + /** + * Whether this factory is eligible for persistent approval + */ + canPersistApproval: boolean; + declaredMaxAiCredits?: number; + declaredMaxConcurrentSubagents?: number; + declaredMaxTotalSubagents?: number; + declaredTimeoutSeconds?: number; + /** + * Factory description + */ + description: string; + /** + * Prompt kind discriminator + */ + kind: "factory"; + /** + * Whether managed policy requires a human response and forbids host auto-approval + */ + managedApprovalRequired?: boolean; + /** + * Effective AI-credit limit; omitted means unlimited + */ + maxAiCredits?: number; + /** + * Effective concurrent-subagent limit; omitted means unlimited + */ + maxConcurrentSubagents?: number; + /** + * Effective total-subagent limit; omitted means unlimited + */ + maxTotalSubagents?: number; + /** + * Factory name + */ + name: string; + operation: FactoryPermissionOperation; + /** + * Declared factory phases + */ + phases: FactoryPermissionPhase[]; + /** + * Effective active-time limit in seconds; omitted means unlimited + */ + timeoutSeconds?: number; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; +} /** * Extension permission access prompt */ @@ -7072,6 +7305,19 @@ export interface UserToolSessionApprovalExtensionManagement { */ operation?: string; } +/** + * Session-scoped factory approval, optionally narrowed by approval key. + */ +export interface UserToolSessionApprovalFactory { + /** + * Optional factory operation name or canonical approval key + */ + approvalKey?: string; + /** + * Factory approval kind + */ + kind: "factory"; +} /** * Session-scoped tool-approval rule for an extension's permission-gated capability access, keyed by extension name. */ diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index b8c8e395a7..fb9d586758 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -1809,6 +1809,84 @@ def to_dict(self) -> dict: result["path"] = from_union([from_str, from_none], self.path) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class DiscoveredExtensionPlugin: + """Containing plugin metadata for plugin-contributed extensions + + Installed plugin that contributes a discovered extension. + """ + name: str + """Installed plugin name""" + + @staticmethod + def from_dict(obj: Any) -> 'DiscoveredExtensionPlugin': + assert isinstance(obj, dict) + name = from_str(obj.get("name")) + return DiscoveredExtensionPlugin(name) + + def to_dict(self) -> dict: + result: dict = {} + result["name"] = from_str(self.name) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +class DiscoveredExtensionSource(Enum): + """Discovery source + + Persisted extension discovery source + """ + PLUGIN = "plugin" + USER = "user" + +# Experimental: this type is part of an experimental API and may change or be removed. +class DiscoveredExtensionMode(Enum): + """Effective extension loading and agent-management mode + + Effective extension loading mode. Defaults to load_and_augment when unset. + """ + DISABLED = "disabled" + LOAD_AND_AUGMENT = "load_and_augment" + LOAD_ONLY = "load_only" + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class DiscoveredExtensionsDisableRequest: + """Source-qualified extension identifiers to persistently disable for future sessions.""" + + ids: list[str] + """Source-qualified user or plugin extension IDs to disable""" + + @staticmethod + def from_dict(obj: Any) -> 'DiscoveredExtensionsDisableRequest': + assert isinstance(obj, dict) + ids = from_list(from_str, obj.get("ids")) + return DiscoveredExtensionsDisableRequest(ids) + + def to_dict(self) -> dict: + result: dict = {} + result["ids"] = from_list(from_str, self.ids) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class DiscoveredExtensionsEnableRequest: + """Source-qualified extension identifiers to persistently enable for future sessions.""" + + ids: list[str] + """Source-qualified user or plugin extension IDs to enable""" + + @staticmethod + def from_dict(obj: Any) -> 'DiscoveredExtensionsEnableRequest': + assert isinstance(obj, dict) + ids = from_list(from_str, obj.get("ids")) + return DiscoveredExtensionsEnableRequest(ids) + + def to_dict(self) -> dict: + result: dict = {} + result["ids"] = from_list(from_str, self.ids) + return result + # Experimental: this type is part of an experimental API and may change or be removed. class DiscoveredMCPServerType(Enum): """Server transport type: stdio, http, sse (deprecated), or memory""" @@ -1873,6 +1951,28 @@ class EventsAgentScope(Enum): ALL = "all" PRIMARY = "primary" +# Experimental: this type is part of an experimental API and may change or be removed. +class EventsReadDirection(Enum): + """Direction to page through the session's persisted event history. 'forward' (default) + pages from the cursor toward newer events (or from the start of history when no cursor is + given). 'backward' enables tail-first reads: with no cursor it returns the NEWEST `max` + events, and the returned cursor pages toward OLDER events on subsequent backward reads. + Events within a returned batch are always in chronological (oldest-to-newest) order, even + for a backward read. Backward reads cover PERSISTED history only; ephemeral events are + never returned by a backward read. `direction` selects the INITIAL read only: the + returned cursor is self-describing, so a continuation read pages in the cursor's own + direction regardless of the `direction` passed alongside it — a forward cursor always + pages forward and a backward cursor always pages backward. Pass the direction that + matches the cursor to avoid confusion. + + Direction to page through the session's persisted event history. 'forward' pages from the + cursor toward newer events; 'backward' returns the newest window first (tail-first) and + pages toward older events. Events within a returned batch are always chronological + (oldest-to-newest), even for a backward read. + """ + BACKWARD = "backward" + FORWARD = "forward" + # Experimental: this type is part of an experimental API and may change or be removed. class EventLogTypes(Enum): EMPTY = "*" @@ -1926,7 +2026,22 @@ def to_dict(self) -> dict: class EventsCursorStatus(Enum): """Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) - and the read started from the beginning of the remaining history. + and the read fell back to a boundary of the remaining history (the beginning for a + forward read, the tail for a backward read). The fallback page is a fresh boundary + snapshot, not a continuation of the requested cursor, so it may overlap already-rendered + events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate + by event id) before continuing from the returned cursor. + + Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor + referred to an event that no longer exists in history (e.g. truncated or compacted away) + and the read fell back to a boundary of the remaining history. For a forward read the + fallback starts from the beginning of the remaining history; for a backward read it falls + back to the tail (the newest window). Because the fallback page is a fresh boundary + snapshot rather than a continuation of the requested cursor, it may overlap events the + consumer has already rendered — a backward fallback to the tail in particular can repeat + the newest window. On 'expired', consumers should reset or rebase their local pagination + state (or deduplicate by event id) before continuing from the returned cursor rather than + blindly appending/prepending the fallback page. """ EXPIRED = "expired" OK = "ok" @@ -4415,6 +4530,35 @@ class MCPToolUIVisibility(Enum): APP = "app" MODEL = "model" +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPOauthAuthenticationStateChangedRequest: + """Identifies the MCP server whose persisted OAuth credentials were updated.""" + + refresh_session_token: bool | None = None + """Whether the target session must mint a session-scoped access token instead of reusing a + shared access token persisted by another session. + """ + server_name: str | None = None + """Name of the MCP server whose OAuth credentials were updated. Omit only when the host + cannot identify the server. + """ + + @staticmethod + def from_dict(obj: Any) -> 'MCPOauthAuthenticationStateChangedRequest': + assert isinstance(obj, dict) + refresh_session_token = from_union([from_bool, from_none], obj.get("refreshSessionToken")) + server_name = from_union([from_str, from_none], obj.get("serverName")) + return MCPOauthAuthenticationStateChangedRequest(refresh_session_token, server_name) + + def to_dict(self) -> dict: + result: dict = {} + if self.refresh_session_token is not None: + result["refreshSessionToken"] = from_union([from_bool, from_none], self.refresh_session_token) + if self.server_name is not None: + result["serverName"] = from_union([from_str, from_none], self.server_name) + return result + class MCPOauthPendingRequestResponseKind(Enum): CANCELLED = "cancelled" TOKEN = "token" @@ -5595,6 +5739,7 @@ class ApprovalKind(Enum): CUSTOM_TOOL = "custom-tool" EXTENSION_MANAGEMENT = "extension-management" EXTENSION_PERMISSION_ACCESS = "extension-permission-access" + FACTORY = "factory" MCP = "mcp" MCP_SAMPLING = "mcp-sampling" MEMORY = "memory" @@ -5633,6 +5778,9 @@ class PermissionDecisionApproveForLocationApprovalExtensionManagementKind(Enum): class PermissionDecisionApproveForLocationApprovalExtensionPermissionAccessKind(Enum): EXTENSION_PERMISSION_ACCESS = "extension-permission-access" +class PermissionDecisionApproveForLocationApprovalFactoryKind(Enum): + FACTORY = "factory" + class PermissionDecisionApproveForLocationApprovalMCPKind(Enum): MCP = "mcp" @@ -12999,11 +13147,62 @@ def to_dict(self) -> dict: result["outputDirectory"] = from_union([from_str, from_none], self.output_directory) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class DiscoveredExtension: + """Discovered extension metadata and persistent enablement state.""" + + enabled: bool + """Whether this extension's persistent per-ID preference is enabled""" + + id: str + """Source-qualified ID accepted by both server and session extension enablement methods""" + + name: str + """Human-readable extension name""" + + path: str + """Absolute path to the extension entry module, suitable for revealing it in a file manager""" + + source: DiscoveredExtensionSource + """Discovery source""" + + plugin: DiscoveredExtensionPlugin | None = None + """Containing plugin metadata for plugin-contributed extensions""" + + @staticmethod + def from_dict(obj: Any) -> 'DiscoveredExtension': + assert isinstance(obj, dict) + enabled = from_bool(obj.get("enabled")) + id = from_str(obj.get("id")) + name = from_str(obj.get("name")) + path = from_str(obj.get("path")) + source = DiscoveredExtensionSource(obj.get("source")) + plugin = from_union([DiscoveredExtensionPlugin.from_dict, from_none], obj.get("plugin")) + return DiscoveredExtension(enabled, id, name, path, source, plugin) + + def to_dict(self) -> dict: + result: dict = {} + result["enabled"] = from_bool(self.enabled) + result["id"] = from_str(self.id) + result["name"] = from_str(self.name) + result["path"] = from_str(self.path) + result["source"] = to_enum(DiscoveredExtensionSource, self.source) + if self.plugin is not None: + result["plugin"] = from_union([lambda x: to_class(DiscoveredExtensionPlugin, x), from_none], self.plugin) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class EventLogReadRequest: """Cursor, batch size, and optional long-poll/filter parameters for reading session events.""" + agent_ids: list[str] | None = None + """Optional non-empty list of subagent identifiers. When provided, only events owned by one + of these agents are returned; ownership recognizes the event envelope's agentId plus + legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over + agentScope. + """ agent_scope: EventsAgentScope | None = None """Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns @@ -13014,11 +13213,25 @@ class EventLogReadRequest: """Opaque cursor returned by a previous read. Omit on the first call to start from the beginning of the session's persisted history. """ + direction: EventsReadDirection | None = None + """Direction to page through the session's persisted event history. 'forward' (default) + pages from the cursor toward newer events (or from the start of history when no cursor is + given). 'backward' enables tail-first reads: with no cursor it returns the NEWEST `max` + events, and the returned cursor pages toward OLDER events on subsequent backward reads. + Events within a returned batch are always in chronological (oldest-to-newest) order, even + for a backward read. Backward reads cover PERSISTED history only; ephemeral events are + never returned by a backward read. `direction` selects the INITIAL read only: the + returned cursor is self-describing, so a continuation read pages in the cursor's own + direction regardless of the `direction` passed alongside it — a forward cursor always + pages forward and a backward cursor always pages backward. Pass the direction that + matches the cursor to avoid confusion. + """ include_ephemeral: bool | None = None """When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). + Ignored by backward reads, which always cover persisted history only. """ max: int | None = None """Maximum number of events to return in this batch (1–1000, default 200).""" @@ -13031,26 +13244,35 @@ class EventLogReadRequest: (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture - future ephemerals as they happen). + future ephemerals as they happen). This applies to forward reads only: a backward read + always returns immediately and ignores `waitMs`, because backward paging covers persisted + history only while new events append at the tail (the opposite end from a backward page), + so no blocking or ephemeral delivery can occur. """ @staticmethod def from_dict(obj: Any) -> 'EventLogReadRequest': assert isinstance(obj, dict) + agent_ids = from_union([lambda x: from_list(from_str, x), from_none], obj.get("agentIds")) agent_scope = from_union([EventsAgentScope, from_none], obj.get("agentScope")) cursor = from_union([from_str, from_none], obj.get("cursor")) + direction = from_union([EventsReadDirection, from_none], obj.get("direction")) include_ephemeral = from_union([from_bool, from_none], obj.get("includeEphemeral")) max = from_union([from_int, from_none], obj.get("max")) types = from_union([lambda x: from_list(from_str, x), EventLogTypes, from_none], obj.get("types")) wait_ms = from_union([from_int, from_none], obj.get("waitMs")) - return EventLogReadRequest(agent_scope, cursor, include_ephemeral, max, types, wait_ms) + return EventLogReadRequest(agent_ids, agent_scope, cursor, direction, include_ephemeral, max, types, wait_ms) def to_dict(self) -> dict: result: dict = {} + if self.agent_ids is not None: + result["agentIds"] = from_union([lambda x: from_list(from_str, x), from_none], self.agent_ids) if self.agent_scope is not None: result["agentScope"] = from_union([lambda x: to_enum(EventsAgentScope, x), from_none], self.agent_scope) if self.cursor is not None: result["cursor"] = from_union([from_str, from_none], self.cursor) + if self.direction is not None: + result["direction"] = from_union([lambda x: to_enum(EventsReadDirection, x), from_none], self.direction) if self.include_ephemeral is not None: result["includeEphemeral"] = from_union([from_bool, from_none], self.include_ephemeral) if self.max is not None: @@ -13068,24 +13290,34 @@ class EventsReadResult: cursor: str """Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue - from where this read left off. Always present, even when no events were returned. + from where this read left off. Always present, even when no events were returned. For a + backward read this cursor pages toward OLDER events; keep passing `direction: backward` + with it (the cursor is also self-describing, so backward paging continues correctly). """ cursor_status: EventsCursorStatus """Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) - and the read started from the beginning of the remaining history. + and the read fell back to a boundary of the remaining history. For a forward read the + fallback starts from the beginning of the remaining history; for a backward read it falls + back to the tail (the newest window). Because the fallback page is a fresh boundary + snapshot rather than a continuation of the requested cursor, it may overlap events the + consumer has already rendered — a backward fallback to the tail in particular can repeat + the newest window. On 'expired', consumers should reset or rebase their local pagination + state (or deduplicate by event id) before continuing from the returned cursor rather than + blindly appending/prepending the fallback page. """ events: list[SessionEvent] """Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep - reading with a non-zero `waitMs`. + reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window + contains persisted events only, still in chronological (oldest-to-newest) append order. """ has_more: bool - """True when the read returned `max` events and more events are available immediately. When - false, the next read with a non-zero `waitMs` will block until a new event arrives or the - wait expires. + """True when more events are available in the read's direction. For a forward read, true + means the batch returned `max` events and more are available immediately. For a backward + read, true means older persisted events remain before the returned window. """ @staticmethod @@ -16371,6 +16603,84 @@ def to_dict(self) -> dict: result["operation"] = from_union([from_str, from_none], self.operation) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class PermissionDecisionApproveForLocationApprovalFactory: + """Location-scoped factory approval, optionally narrowed by approval key.""" + + kind: ClassVar[str] = "factory" + """Approval covering factory operations.""" + + approval_key: str | None = None + """Optional factory operation name or canonical approval key; when omitted, the approval + covers all factory operations. + """ + + @staticmethod + def from_dict(obj: Any) -> 'PermissionDecisionApproveForLocationApprovalFactory': + assert isinstance(obj, dict) + approval_key = from_union([from_str, from_none], obj.get("approvalKey")) + return PermissionDecisionApproveForLocationApprovalFactory(approval_key) + + def to_dict(self) -> dict: + result: dict = {} + result["kind"] = self.kind + if self.approval_key is not None: + result["approvalKey"] = from_union([from_str, from_none], self.approval_key) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class PermissionDecisionApproveForSessionApprovalFactory: + """Session-scoped factory approval, optionally narrowed by approval key.""" + + kind: ClassVar[str] = "factory" + """Approval covering factory operations.""" + + approval_key: str | None = None + """Optional factory operation name or canonical approval key; when omitted, the approval + covers all factory operations. + """ + + @staticmethod + def from_dict(obj: Any) -> 'PermissionDecisionApproveForSessionApprovalFactory': + assert isinstance(obj, dict) + approval_key = from_union([from_str, from_none], obj.get("approvalKey")) + return PermissionDecisionApproveForSessionApprovalFactory(approval_key) + + def to_dict(self) -> dict: + result: dict = {} + result["kind"] = self.kind + if self.approval_key is not None: + result["approvalKey"] = from_union([from_str, from_none], self.approval_key) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class PermissionsLocationsAddToolApprovalDetailsFactory: + """Location-persisted factory approval, optionally narrowed by approval key.""" + + kind: ClassVar[str] = "factory" + """Approval covering factory operations.""" + + approval_key: str | None = None + """Optional factory operation name or canonical approval key; when omitted, the approval + covers all factory operations. + """ + + @staticmethod + def from_dict(obj: Any) -> 'PermissionsLocationsAddToolApprovalDetailsFactory': + assert isinstance(obj, dict) + approval_key = from_union([from_str, from_none], obj.get("approvalKey")) + return PermissionsLocationsAddToolApprovalDetailsFactory(approval_key) + + def to_dict(self) -> dict: + result: dict = {} + result["kind"] = self.kind + if self.approval_key is not None: + result["approvalKey"] = from_union([from_str, from_none], self.approval_key) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class PermissionDecisionApproveForLocationApprovalMCP: @@ -17229,6 +17539,30 @@ def to_dict(self) -> dict: result["rows"] = from_list(lambda x: to_class(PlanSQLTodosRow, x), self.rows) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class AgentSetPromptRequest: + """An in-memory authored prompt override for an available agent.""" + + id: str + """Stable effective agent id. Plugin namespace separators are normalized.""" + + prompt: str + """Replacement authored prompt. Empty text is valid.""" + + @staticmethod + def from_dict(obj: Any) -> 'AgentSetPromptRequest': + assert isinstance(obj, dict) + id = from_str(obj.get("id")) + prompt = from_str(obj.get("prompt")) + return AgentSetPromptRequest(id, prompt) + + def to_dict(self) -> dict: + result: dict = {} + result["id"] = from_str(self.id) + result["prompt"] = from_str(self.prompt) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class DiscoveredMCPServer: @@ -21051,6 +21385,31 @@ def to_dict(self) -> dict: result["skippedEntries"] = from_union([lambda x: from_list(lambda x: to_class(DebugCollectLogsSkippedEntry, x), x), from_none], self.skipped_entries) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class DiscoveredExtensions: + """Extensions discovered from persisted Copilot home state and their effective loading mode. + Launch-scoped additional plugins are not included. + """ + extensions: list[DiscoveredExtension] + """Discovered user and enabled installed-plugin extensions from persisted Copilot home state""" + + mode: DiscoveredExtensionMode + """Effective extension loading mode. Defaults to load_and_augment when unset.""" + + @staticmethod + def from_dict(obj: Any) -> 'DiscoveredExtensions': + assert isinstance(obj, dict) + extensions = from_list(DiscoveredExtension.from_dict, obj.get("extensions")) + mode = DiscoveredExtensionMode(obj.get("mode")) + return DiscoveredExtensions(extensions, mode) + + def to_dict(self) -> dict: + result: dict = {} + result["extensions"] = from_list(lambda x: to_class(DiscoveredExtension, x), self.extensions) + result["mode"] = to_enum(DiscoveredExtensionMode, self.mode) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ExtensionList: @@ -24843,6 +25202,14 @@ class SandboxConfig: add_current_working_directory: bool | None = None """Whether to auto-add the current working directory to readwritePaths. Default: true.""" + allow_dev_tool_caches: bool | None = None + """Whether to auto-grant read access to common developer-tool caches, registries, and + toolchains in their default home locations (cargo, go, npm, Maven, and more), plus + read-write access to (and, on Unix, up-front creation of) the scratch caches builds write + on every run (go-build, ccache, sccache, Gradle caches, Cargo lock/tracker files), so + builds work without exporting CARGO_HOME/GOPATH/etc. Default: true (enabled by default; + set to false to opt out). + """ gh_auth: bool | None = None """Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the OS keyring the sandbox blocks. Default: false (opt-in). @@ -24860,16 +25227,19 @@ def from_dict(obj: Any) -> 'SandboxConfig': assert isinstance(obj, dict) enabled = from_bool(obj.get("enabled")) add_current_working_directory = from_union([from_bool, from_none], obj.get("addCurrentWorkingDirectory")) + allow_dev_tool_caches = from_union([from_bool, from_none], obj.get("allowDevToolCaches")) gh_auth = from_union([from_bool, from_none], obj.get("ghAuth")) git_auth = from_union([from_bool, from_none], obj.get("gitAuth")) user_policy = from_union([SandboxConfigUserPolicy.from_dict, from_none], obj.get("userPolicy")) - return SandboxConfig(enabled, add_current_working_directory, gh_auth, git_auth, user_policy) + return SandboxConfig(enabled, add_current_working_directory, allow_dev_tool_caches, gh_auth, git_auth, user_policy) def to_dict(self) -> dict: result: dict = {} result["enabled"] = from_bool(self.enabled) if self.add_current_working_directory is not None: result["addCurrentWorkingDirectory"] = from_union([from_bool, from_none], self.add_current_working_directory) + if self.allow_dev_tool_caches is not None: + result["allowDevToolCaches"] = from_union([from_bool, from_none], self.allow_dev_tool_caches) if self.gh_auth is not None: result["ghAuth"] = from_union([from_bool, from_none], self.gh_auth) if self.git_auth is not None: @@ -27381,7 +27751,8 @@ class PermissionsSetAllowAllRequest: """ model: str | None = None """Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when - `mode` is `auto`; ignored otherwise. When omitted, the session's active model is used. + `mode` is `auto`; ignored otherwise. When omitted, the session resolves a default judge + model: `gpt-5.5` for CAPI sessions and the session's active model for BYOK sessions. """ source: PermissionsSetAAllSource | None = None """Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers.""" @@ -27944,6 +28315,7 @@ class RPC: agents_discover_request: AgentsDiscoverRequest agent_select_request: AgentSelectRequest agent_select_result: AgentSelectResult + agent_set_prompt_request: AgentSetPromptRequest agents_get_discovery_paths_request: AgentsGetDiscoveryPathsRequest allow_all_permission_set_result: AllowAllPermissionSetResult allow_all_permission_state: AllowAllPermissionState @@ -28012,6 +28384,13 @@ class RPC: debug_collect_logs_skipped_entry: DebugCollectLogsSkippedEntry debug_collect_logs_source: DebugCollectLogsSource discovered_canvas: DiscoveredCanvas + discovered_extension: DiscoveredExtension + discovered_extension_mode: DiscoveredExtensionMode + discovered_extension_plugin: DiscoveredExtensionPlugin + discovered_extensions: DiscoveredExtensions + discovered_extensions_disable_request: DiscoveredExtensionsDisableRequest + discovered_extensions_enable_request: DiscoveredExtensionsEnableRequest + discovered_extension_source: DiscoveredExtensionSource discovered_mcp_server: DiscoveredMCPServer discovered_mcp_server_type: DiscoveredMCPServerType enqueue_command_params: EnqueueCommandParams @@ -28023,6 +28402,7 @@ class RPC: event_log_types: list[str] | EventLogTypes events_agent_scope: EventsAgentScope events_cursor_status: EventsCursorStatus + events_read_direction: EventsReadDirection events_read_result: EventsReadResult execute_command_params: ExecuteCommandParams execute_command_result: ExecuteCommandResult @@ -28214,6 +28594,7 @@ class RPC: mcp_is_server_running_result: MCPIsServerRunningResult mcp_list_tools_request: MCPListToolsRequest mcp_list_tools_result: MCPListToolsResult + mcp_oauth_authentication_state_changed_request: MCPOauthAuthenticationStateChangedRequest mcp_oauth_handle_pending_request: MCPOauthHandlePendingRequest mcp_oauth_handle_pending_result: MCPOauthHandlePendingResult mcp_oauth_login_grant_type: MCPGrantType @@ -28329,6 +28710,7 @@ class RPC: permission_decision_approve_for_location_approval_custom_tool: PermissionDecisionApproveForLocationApprovalCustomTool permission_decision_approve_for_location_approval_extension_management: PermissionDecisionApproveForLocationApprovalExtensionManagement permission_decision_approve_for_location_approval_extension_permission_access: PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess + permission_decision_approve_for_location_approval_factory: PermissionDecisionApproveForLocationApprovalFactory permission_decision_approve_for_location_approval_mcp: PermissionDecisionApproveForLocationApprovalMCP permission_decision_approve_for_location_approval_mcp_sampling: PermissionDecisionApproveForLocationApprovalMCPSampling permission_decision_approve_for_location_approval_memory: PermissionDecisionApproveForLocationApprovalMemory @@ -28340,6 +28722,7 @@ class RPC: permission_decision_approve_for_session_approval_custom_tool: PermissionDecisionApproveForSessionApprovalCustomTool permission_decision_approve_for_session_approval_extension_management: PermissionDecisionApproveForSessionApprovalExtensionManagement permission_decision_approve_for_session_approval_extension_permission_access: PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess + permission_decision_approve_for_session_approval_factory: PermissionDecisionApproveForSessionApprovalFactory permission_decision_approve_for_session_approval_mcp: PermissionDecisionApproveForSessionApprovalMCP permission_decision_approve_for_session_approval_mcp_sampling: PermissionDecisionApproveForSessionApprovalMCPSampling permission_decision_approve_for_session_approval_memory: PermissionDecisionApproveForSessionApprovalMemory @@ -28387,6 +28770,7 @@ class RPC: permissions_locations_add_tool_approval_details_custom_tool: PermissionsLocationsAddToolApprovalDetailsCustomTool permissions_locations_add_tool_approval_details_extension_management: PermissionsLocationsAddToolApprovalDetailsExtensionManagement permissions_locations_add_tool_approval_details_extension_permission_access: PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess + permissions_locations_add_tool_approval_details_factory: PermissionsLocationsAddToolApprovalDetailsFactory permissions_locations_add_tool_approval_details_mcp: PermissionsLocationsAddToolApprovalDetailsMCP permissions_locations_add_tool_approval_details_mcp_sampling: PermissionsLocationsAddToolApprovalDetailsMCPSampling permissions_locations_add_tool_approval_details_memory: PermissionsLocationsAddToolApprovalDetailsMemory @@ -28930,6 +29314,7 @@ def from_dict(obj: Any) -> 'RPC': agents_discover_request = AgentsDiscoverRequest.from_dict(obj.get("AgentsDiscoverRequest")) agent_select_request = AgentSelectRequest.from_dict(obj.get("AgentSelectRequest")) agent_select_result = AgentSelectResult.from_dict(obj.get("AgentSelectResult")) + agent_set_prompt_request = AgentSetPromptRequest.from_dict(obj.get("AgentSetPromptRequest")) agents_get_discovery_paths_request = AgentsGetDiscoveryPathsRequest.from_dict(obj.get("AgentsGetDiscoveryPathsRequest")) allow_all_permission_set_result = AllowAllPermissionSetResult.from_dict(obj.get("AllowAllPermissionSetResult")) allow_all_permission_state = AllowAllPermissionState.from_dict(obj.get("AllowAllPermissionState")) @@ -28998,6 +29383,13 @@ def from_dict(obj: Any) -> 'RPC': debug_collect_logs_skipped_entry = DebugCollectLogsSkippedEntry.from_dict(obj.get("DebugCollectLogsSkippedEntry")) debug_collect_logs_source = DebugCollectLogsSource(obj.get("DebugCollectLogsSource")) discovered_canvas = DiscoveredCanvas.from_dict(obj.get("DiscoveredCanvas")) + discovered_extension = DiscoveredExtension.from_dict(obj.get("DiscoveredExtension")) + discovered_extension_mode = DiscoveredExtensionMode(obj.get("DiscoveredExtensionMode")) + discovered_extension_plugin = DiscoveredExtensionPlugin.from_dict(obj.get("DiscoveredExtensionPlugin")) + discovered_extensions = DiscoveredExtensions.from_dict(obj.get("DiscoveredExtensions")) + discovered_extensions_disable_request = DiscoveredExtensionsDisableRequest.from_dict(obj.get("DiscoveredExtensionsDisableRequest")) + discovered_extensions_enable_request = DiscoveredExtensionsEnableRequest.from_dict(obj.get("DiscoveredExtensionsEnableRequest")) + discovered_extension_source = DiscoveredExtensionSource(obj.get("DiscoveredExtensionSource")) discovered_mcp_server = DiscoveredMCPServer.from_dict(obj.get("DiscoveredMcpServer")) discovered_mcp_server_type = DiscoveredMCPServerType(obj.get("DiscoveredMcpServerType")) enqueue_command_params = EnqueueCommandParams.from_dict(obj.get("EnqueueCommandParams")) @@ -29009,6 +29401,7 @@ def from_dict(obj: Any) -> 'RPC': event_log_types = from_union([lambda x: from_list(from_str, x), EventLogTypes], obj.get("EventLogTypes")) events_agent_scope = EventsAgentScope(obj.get("EventsAgentScope")) events_cursor_status = EventsCursorStatus(obj.get("EventsCursorStatus")) + events_read_direction = EventsReadDirection(obj.get("EventsReadDirection")) events_read_result = EventsReadResult.from_dict(obj.get("EventsReadResult")) execute_command_params = ExecuteCommandParams.from_dict(obj.get("ExecuteCommandParams")) execute_command_result = ExecuteCommandResult.from_dict(obj.get("ExecuteCommandResult")) @@ -29200,6 +29593,7 @@ def from_dict(obj: Any) -> 'RPC': mcp_is_server_running_result = MCPIsServerRunningResult.from_dict(obj.get("McpIsServerRunningResult")) mcp_list_tools_request = MCPListToolsRequest.from_dict(obj.get("McpListToolsRequest")) mcp_list_tools_result = MCPListToolsResult.from_dict(obj.get("McpListToolsResult")) + mcp_oauth_authentication_state_changed_request = MCPOauthAuthenticationStateChangedRequest.from_dict(obj.get("McpOauthAuthenticationStateChangedRequest")) mcp_oauth_handle_pending_request = MCPOauthHandlePendingRequest.from_dict(obj.get("McpOauthHandlePendingRequest")) mcp_oauth_handle_pending_result = MCPOauthHandlePendingResult.from_dict(obj.get("McpOauthHandlePendingResult")) mcp_oauth_login_grant_type = MCPGrantType(obj.get("McpOauthLoginGrantType")) @@ -29315,6 +29709,7 @@ def from_dict(obj: Any) -> 'RPC': permission_decision_approve_for_location_approval_custom_tool = PermissionDecisionApproveForLocationApprovalCustomTool.from_dict(obj.get("PermissionDecisionApproveForLocationApprovalCustomTool")) permission_decision_approve_for_location_approval_extension_management = PermissionDecisionApproveForLocationApprovalExtensionManagement.from_dict(obj.get("PermissionDecisionApproveForLocationApprovalExtensionManagement")) permission_decision_approve_for_location_approval_extension_permission_access = PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess.from_dict(obj.get("PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess")) + permission_decision_approve_for_location_approval_factory = PermissionDecisionApproveForLocationApprovalFactory.from_dict(obj.get("PermissionDecisionApproveForLocationApprovalFactory")) permission_decision_approve_for_location_approval_mcp = PermissionDecisionApproveForLocationApprovalMCP.from_dict(obj.get("PermissionDecisionApproveForLocationApprovalMcp")) permission_decision_approve_for_location_approval_mcp_sampling = PermissionDecisionApproveForLocationApprovalMCPSampling.from_dict(obj.get("PermissionDecisionApproveForLocationApprovalMcpSampling")) permission_decision_approve_for_location_approval_memory = PermissionDecisionApproveForLocationApprovalMemory.from_dict(obj.get("PermissionDecisionApproveForLocationApprovalMemory")) @@ -29326,6 +29721,7 @@ def from_dict(obj: Any) -> 'RPC': permission_decision_approve_for_session_approval_custom_tool = PermissionDecisionApproveForSessionApprovalCustomTool.from_dict(obj.get("PermissionDecisionApproveForSessionApprovalCustomTool")) permission_decision_approve_for_session_approval_extension_management = PermissionDecisionApproveForSessionApprovalExtensionManagement.from_dict(obj.get("PermissionDecisionApproveForSessionApprovalExtensionManagement")) permission_decision_approve_for_session_approval_extension_permission_access = PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess.from_dict(obj.get("PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess")) + permission_decision_approve_for_session_approval_factory = PermissionDecisionApproveForSessionApprovalFactory.from_dict(obj.get("PermissionDecisionApproveForSessionApprovalFactory")) permission_decision_approve_for_session_approval_mcp = PermissionDecisionApproveForSessionApprovalMCP.from_dict(obj.get("PermissionDecisionApproveForSessionApprovalMcp")) permission_decision_approve_for_session_approval_mcp_sampling = PermissionDecisionApproveForSessionApprovalMCPSampling.from_dict(obj.get("PermissionDecisionApproveForSessionApprovalMcpSampling")) permission_decision_approve_for_session_approval_memory = PermissionDecisionApproveForSessionApprovalMemory.from_dict(obj.get("PermissionDecisionApproveForSessionApprovalMemory")) @@ -29373,6 +29769,7 @@ def from_dict(obj: Any) -> 'RPC': permissions_locations_add_tool_approval_details_custom_tool = PermissionsLocationsAddToolApprovalDetailsCustomTool.from_dict(obj.get("PermissionsLocationsAddToolApprovalDetailsCustomTool")) permissions_locations_add_tool_approval_details_extension_management = PermissionsLocationsAddToolApprovalDetailsExtensionManagement.from_dict(obj.get("PermissionsLocationsAddToolApprovalDetailsExtensionManagement")) permissions_locations_add_tool_approval_details_extension_permission_access = PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess.from_dict(obj.get("PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess")) + permissions_locations_add_tool_approval_details_factory = PermissionsLocationsAddToolApprovalDetailsFactory.from_dict(obj.get("PermissionsLocationsAddToolApprovalDetailsFactory")) permissions_locations_add_tool_approval_details_mcp = PermissionsLocationsAddToolApprovalDetailsMCP.from_dict(obj.get("PermissionsLocationsAddToolApprovalDetailsMcp")) permissions_locations_add_tool_approval_details_mcp_sampling = PermissionsLocationsAddToolApprovalDetailsMCPSampling.from_dict(obj.get("PermissionsLocationsAddToolApprovalDetailsMcpSampling")) permissions_locations_add_tool_approval_details_memory = PermissionsLocationsAddToolApprovalDetailsMemory.from_dict(obj.get("PermissionsLocationsAddToolApprovalDetailsMemory")) @@ -29871,7 +30268,7 @@ def from_dict(obj: Any) -> 'RPC': subagent_settings = from_union([SubagentSettings.from_dict, from_none], obj.get("SubagentSettings")) task_progress = from_union([TaskProgress.from_dict, from_none], obj.get("TaskProgress")) workspace_summary = from_union([WorkspaceSummary.from_dict, from_none], obj.get("WorkspaceSummary")) - return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_list_request, 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, built_in_model_catalog, built_in_model_catalog_entry, 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_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, discovered_canvas, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, factory_abort_request, factory_ack_result, factory_agent_options, factory_agent_request, factory_agent_result, factory_agent_summary, factory_cancel_request, factory_current_phase, factory_declared_limits, factory_durable_operation, factory_execute_request, factory_execute_result, factory_get_run_progress_request, factory_get_run_request, factory_journal_get_request, factory_journal_get_result, factory_journal_put_request, factory_list_runs_request, factory_list_runs_result, factory_log_line, factory_log_line_kind, factory_log_request, factory_phase_observation, factory_phase_status, factory_progress_line, factory_progress_page, factory_resume_request, factory_resume_result, factory_run_consumed, factory_run_detail, factory_run_failure, factory_run_failure_kind, factory_run_limits, factory_run_request, factory_run_result, factory_run_status, factory_run_summary, factory_run_terminal, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_type, 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, interrupt_main_turn_request, interrupt_main_turn_result, 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_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_picker_category, model_picker_price_category, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_allow_all_mode, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_allow_all_source, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_duplicate_at_request, queue_duplicate_at_result, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_insert_at_request, queue_insert_at_result, queue_insert_message, queue_move_item_request, queue_move_item_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_at_request, queue_remove_at_result, queue_remove_most_recent_result, queue_send_now_request, queue_send_now_result, queue_set_drain_paused_request, queue_snapshot_result, queue_update_text_request, queue_update_text_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, run_options, 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_network_proxy, sandbox_config_user_policy_seatbelt, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_agent_list_request, session_auth_status, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_commands_list_request, 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_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_history_compact_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_limit_prediction_baseline_data, session_limit_prediction_client_type, session_limit_prediction_details, session_limit_prediction_predict_request, session_limit_prediction_request, session_limit_prediction_result, session_limit_prediction_source, session_limit_prediction_tier, session_limit_prediction_tier_option, session_limit_prediction_unavailable_reason, 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_model_list_request, session_model_price_category, 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_plugins_reload_request, session_provider_get_endpoint_request, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, shell_cancel_user_requested_request, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_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, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) + return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_list_request, 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, agent_set_prompt_request, agents_get_discovery_paths_request, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, built_in_model_catalog, built_in_model_catalog_entry, 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_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, discovered_canvas, discovered_extension, discovered_extension_mode, discovered_extension_plugin, discovered_extensions, discovered_extensions_disable_request, discovered_extensions_enable_request, discovered_extension_source, 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_direction, 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, factory_abort_request, factory_ack_result, factory_agent_options, factory_agent_request, factory_agent_result, factory_agent_summary, factory_cancel_request, factory_current_phase, factory_declared_limits, factory_durable_operation, factory_execute_request, factory_execute_result, factory_get_run_progress_request, factory_get_run_request, factory_journal_get_request, factory_journal_get_result, factory_journal_put_request, factory_list_runs_request, factory_list_runs_result, factory_log_line, factory_log_line_kind, factory_log_request, factory_phase_observation, factory_phase_status, factory_progress_line, factory_progress_page, factory_resume_request, factory_resume_result, factory_run_consumed, factory_run_detail, factory_run_failure, factory_run_failure_kind, factory_run_limits, factory_run_request, factory_run_result, factory_run_status, factory_run_summary, factory_run_terminal, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_type, 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, interrupt_main_turn_request, interrupt_main_turn_result, 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_authentication_state_changed_request, 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_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_billing, model_billing_promo, 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_factory, 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_factory, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_allow_all_mode, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_factory, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_allow_all_source, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_duplicate_at_request, queue_duplicate_at_result, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_insert_at_request, queue_insert_at_result, queue_insert_message, queue_move_item_request, queue_move_item_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_at_request, queue_remove_at_result, queue_remove_most_recent_result, queue_send_now_request, queue_send_now_result, queue_set_drain_paused_request, queue_snapshot_result, queue_update_text_request, queue_update_text_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, run_options, 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_network_proxy, sandbox_config_user_policy_seatbelt, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_agent_list_request, session_auth_status, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_commands_list_request, 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_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_history_compact_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_limit_prediction_baseline_data, session_limit_prediction_client_type, session_limit_prediction_details, session_limit_prediction_predict_request, session_limit_prediction_request, session_limit_prediction_result, session_limit_prediction_source, session_limit_prediction_tier, session_limit_prediction_tier_option, session_limit_prediction_unavailable_reason, 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_model_list_request, session_model_price_category, 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_plugins_reload_request, session_provider_get_endpoint_request, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, shell_cancel_user_requested_request, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_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, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -29916,6 +30313,7 @@ def to_dict(self) -> dict: result["AgentsDiscoverRequest"] = to_class(AgentsDiscoverRequest, self.agents_discover_request) result["AgentSelectRequest"] = to_class(AgentSelectRequest, self.agent_select_request) result["AgentSelectResult"] = to_class(AgentSelectResult, self.agent_select_result) + result["AgentSetPromptRequest"] = to_class(AgentSetPromptRequest, self.agent_set_prompt_request) result["AgentsGetDiscoveryPathsRequest"] = to_class(AgentsGetDiscoveryPathsRequest, self.agents_get_discovery_paths_request) result["AllowAllPermissionSetResult"] = to_class(AllowAllPermissionSetResult, self.allow_all_permission_set_result) result["AllowAllPermissionState"] = to_class(AllowAllPermissionState, self.allow_all_permission_state) @@ -29984,6 +30382,13 @@ def to_dict(self) -> dict: result["DebugCollectLogsSkippedEntry"] = to_class(DebugCollectLogsSkippedEntry, self.debug_collect_logs_skipped_entry) result["DebugCollectLogsSource"] = to_enum(DebugCollectLogsSource, self.debug_collect_logs_source) result["DiscoveredCanvas"] = to_class(DiscoveredCanvas, self.discovered_canvas) + result["DiscoveredExtension"] = to_class(DiscoveredExtension, self.discovered_extension) + result["DiscoveredExtensionMode"] = to_enum(DiscoveredExtensionMode, self.discovered_extension_mode) + result["DiscoveredExtensionPlugin"] = to_class(DiscoveredExtensionPlugin, self.discovered_extension_plugin) + result["DiscoveredExtensions"] = to_class(DiscoveredExtensions, self.discovered_extensions) + result["DiscoveredExtensionsDisableRequest"] = to_class(DiscoveredExtensionsDisableRequest, self.discovered_extensions_disable_request) + result["DiscoveredExtensionsEnableRequest"] = to_class(DiscoveredExtensionsEnableRequest, self.discovered_extensions_enable_request) + result["DiscoveredExtensionSource"] = to_enum(DiscoveredExtensionSource, self.discovered_extension_source) result["DiscoveredMcpServer"] = to_class(DiscoveredMCPServer, self.discovered_mcp_server) result["DiscoveredMcpServerType"] = to_enum(DiscoveredMCPServerType, self.discovered_mcp_server_type) result["EnqueueCommandParams"] = to_class(EnqueueCommandParams, self.enqueue_command_params) @@ -29995,6 +30400,7 @@ def to_dict(self) -> dict: result["EventLogTypes"] = from_union([lambda x: from_list(from_str, x), lambda x: to_enum(EventLogTypes, x)], self.event_log_types) result["EventsAgentScope"] = to_enum(EventsAgentScope, self.events_agent_scope) result["EventsCursorStatus"] = to_enum(EventsCursorStatus, self.events_cursor_status) + result["EventsReadDirection"] = to_enum(EventsReadDirection, self.events_read_direction) result["EventsReadResult"] = to_class(EventsReadResult, self.events_read_result) result["ExecuteCommandParams"] = to_class(ExecuteCommandParams, self.execute_command_params) result["ExecuteCommandResult"] = to_class(ExecuteCommandResult, self.execute_command_result) @@ -30186,6 +30592,7 @@ def to_dict(self) -> dict: result["McpIsServerRunningResult"] = to_class(MCPIsServerRunningResult, self.mcp_is_server_running_result) result["McpListToolsRequest"] = to_class(MCPListToolsRequest, self.mcp_list_tools_request) result["McpListToolsResult"] = to_class(MCPListToolsResult, self.mcp_list_tools_result) + result["McpOauthAuthenticationStateChangedRequest"] = to_class(MCPOauthAuthenticationStateChangedRequest, self.mcp_oauth_authentication_state_changed_request) result["McpOauthHandlePendingRequest"] = to_class(MCPOauthHandlePendingRequest, self.mcp_oauth_handle_pending_request) result["McpOauthHandlePendingResult"] = to_class(MCPOauthHandlePendingResult, self.mcp_oauth_handle_pending_result) result["McpOauthLoginGrantType"] = to_enum(MCPGrantType, self.mcp_oauth_login_grant_type) @@ -30301,6 +30708,7 @@ def to_dict(self) -> dict: result["PermissionDecisionApproveForLocationApprovalCustomTool"] = to_class(PermissionDecisionApproveForLocationApprovalCustomTool, self.permission_decision_approve_for_location_approval_custom_tool) result["PermissionDecisionApproveForLocationApprovalExtensionManagement"] = to_class(PermissionDecisionApproveForLocationApprovalExtensionManagement, self.permission_decision_approve_for_location_approval_extension_management) result["PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess"] = to_class(PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess, self.permission_decision_approve_for_location_approval_extension_permission_access) + result["PermissionDecisionApproveForLocationApprovalFactory"] = to_class(PermissionDecisionApproveForLocationApprovalFactory, self.permission_decision_approve_for_location_approval_factory) result["PermissionDecisionApproveForLocationApprovalMcp"] = to_class(PermissionDecisionApproveForLocationApprovalMCP, self.permission_decision_approve_for_location_approval_mcp) result["PermissionDecisionApproveForLocationApprovalMcpSampling"] = to_class(PermissionDecisionApproveForLocationApprovalMCPSampling, self.permission_decision_approve_for_location_approval_mcp_sampling) result["PermissionDecisionApproveForLocationApprovalMemory"] = to_class(PermissionDecisionApproveForLocationApprovalMemory, self.permission_decision_approve_for_location_approval_memory) @@ -30312,6 +30720,7 @@ def to_dict(self) -> dict: result["PermissionDecisionApproveForSessionApprovalCustomTool"] = to_class(PermissionDecisionApproveForSessionApprovalCustomTool, self.permission_decision_approve_for_session_approval_custom_tool) result["PermissionDecisionApproveForSessionApprovalExtensionManagement"] = to_class(PermissionDecisionApproveForSessionApprovalExtensionManagement, self.permission_decision_approve_for_session_approval_extension_management) result["PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess"] = to_class(PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess, self.permission_decision_approve_for_session_approval_extension_permission_access) + result["PermissionDecisionApproveForSessionApprovalFactory"] = to_class(PermissionDecisionApproveForSessionApprovalFactory, self.permission_decision_approve_for_session_approval_factory) result["PermissionDecisionApproveForSessionApprovalMcp"] = to_class(PermissionDecisionApproveForSessionApprovalMCP, self.permission_decision_approve_for_session_approval_mcp) result["PermissionDecisionApproveForSessionApprovalMcpSampling"] = to_class(PermissionDecisionApproveForSessionApprovalMCPSampling, self.permission_decision_approve_for_session_approval_mcp_sampling) result["PermissionDecisionApproveForSessionApprovalMemory"] = to_class(PermissionDecisionApproveForSessionApprovalMemory, self.permission_decision_approve_for_session_approval_memory) @@ -30359,6 +30768,7 @@ def to_dict(self) -> dict: result["PermissionsLocationsAddToolApprovalDetailsCustomTool"] = to_class(PermissionsLocationsAddToolApprovalDetailsCustomTool, self.permissions_locations_add_tool_approval_details_custom_tool) result["PermissionsLocationsAddToolApprovalDetailsExtensionManagement"] = to_class(PermissionsLocationsAddToolApprovalDetailsExtensionManagement, self.permissions_locations_add_tool_approval_details_extension_management) result["PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess"] = to_class(PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess, self.permissions_locations_add_tool_approval_details_extension_permission_access) + result["PermissionsLocationsAddToolApprovalDetailsFactory"] = to_class(PermissionsLocationsAddToolApprovalDetailsFactory, self.permissions_locations_add_tool_approval_details_factory) result["PermissionsLocationsAddToolApprovalDetailsMcp"] = to_class(PermissionsLocationsAddToolApprovalDetailsMCP, self.permissions_locations_add_tool_approval_details_mcp) result["PermissionsLocationsAddToolApprovalDetailsMcpSampling"] = to_class(PermissionsLocationsAddToolApprovalDetailsMCPSampling, self.permissions_locations_add_tool_approval_details_mcp_sampling) result["PermissionsLocationsAddToolApprovalDetailsMemory"] = to_class(PermissionsLocationsAddToolApprovalDetailsMemory, self.permissions_locations_add_tool_approval_details_memory) @@ -30935,7 +31345,7 @@ def _load_PermissionDecision(obj: Any) -> "PermissionDecision": case _: raise ValueError(f"Unknown PermissionDecision kind: {kind!r}") # Approval to persist for this location -PermissionDecisionApproveForLocationApproval = PermissionDecisionApproveForLocationApprovalCommands | PermissionDecisionApproveForLocationApprovalRead | PermissionDecisionApproveForLocationApprovalWrite | PermissionDecisionApproveForLocationApprovalMCP | PermissionDecisionApproveForLocationApprovalMCPSampling | PermissionDecisionApproveForLocationApprovalMemory | PermissionDecisionApproveForLocationApprovalCustomTool | PermissionDecisionApproveForLocationApprovalExtensionManagement | PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess +PermissionDecisionApproveForLocationApproval = PermissionDecisionApproveForLocationApprovalCommands | PermissionDecisionApproveForLocationApprovalRead | PermissionDecisionApproveForLocationApprovalWrite | PermissionDecisionApproveForLocationApprovalMCP | PermissionDecisionApproveForLocationApprovalMCPSampling | PermissionDecisionApproveForLocationApprovalMemory | PermissionDecisionApproveForLocationApprovalCustomTool | PermissionDecisionApproveForLocationApprovalExtensionManagement | PermissionDecisionApproveForLocationApprovalFactory | PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess def _load_PermissionDecisionApproveForLocationApproval(obj: Any) -> "PermissionDecisionApproveForLocationApproval": assert isinstance(obj, dict) @@ -30949,11 +31359,12 @@ def _load_PermissionDecisionApproveForLocationApproval(obj: Any) -> "PermissionD case "memory": return PermissionDecisionApproveForLocationApprovalMemory.from_dict(obj) case "custom-tool": return PermissionDecisionApproveForLocationApprovalCustomTool.from_dict(obj) case "extension-management": return PermissionDecisionApproveForLocationApprovalExtensionManagement.from_dict(obj) + case "factory": return PermissionDecisionApproveForLocationApprovalFactory.from_dict(obj) case "extension-permission-access": return PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess.from_dict(obj) case _: raise ValueError(f"Unknown PermissionDecisionApproveForLocationApproval kind: {kind!r}") # Session-scoped approval to remember (tool prompts only; omitted for path/url prompts) -PermissionDecisionApproveForSessionApproval = PermissionDecisionApproveForSessionApprovalCommands | PermissionDecisionApproveForSessionApprovalRead | PermissionDecisionApproveForSessionApprovalWrite | PermissionDecisionApproveForSessionApprovalMCP | PermissionDecisionApproveForSessionApprovalMCPSampling | PermissionDecisionApproveForSessionApprovalMemory | PermissionDecisionApproveForSessionApprovalCustomTool | PermissionDecisionApproveForSessionApprovalExtensionManagement | PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess +PermissionDecisionApproveForSessionApproval = PermissionDecisionApproveForSessionApprovalCommands | PermissionDecisionApproveForSessionApprovalRead | PermissionDecisionApproveForSessionApprovalWrite | PermissionDecisionApproveForSessionApprovalMCP | PermissionDecisionApproveForSessionApprovalMCPSampling | PermissionDecisionApproveForSessionApprovalMemory | PermissionDecisionApproveForSessionApprovalCustomTool | PermissionDecisionApproveForSessionApprovalExtensionManagement | PermissionDecisionApproveForSessionApprovalFactory | PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess def _load_PermissionDecisionApproveForSessionApproval(obj: Any) -> "PermissionDecisionApproveForSessionApproval": assert isinstance(obj, dict) @@ -30967,11 +31378,12 @@ def _load_PermissionDecisionApproveForSessionApproval(obj: Any) -> "PermissionDe case "memory": return PermissionDecisionApproveForSessionApprovalMemory.from_dict(obj) case "custom-tool": return PermissionDecisionApproveForSessionApprovalCustomTool.from_dict(obj) case "extension-management": return PermissionDecisionApproveForSessionApprovalExtensionManagement.from_dict(obj) + case "factory": return PermissionDecisionApproveForSessionApprovalFactory.from_dict(obj) case "extension-permission-access": return PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess.from_dict(obj) case _: raise ValueError(f"Unknown PermissionDecisionApproveForSessionApproval kind: {kind!r}") # Tool approval to persist and apply -PermissionsLocationsAddToolApprovalDetails = PermissionsLocationsAddToolApprovalDetailsCommands | PermissionsLocationsAddToolApprovalDetailsRead | PermissionsLocationsAddToolApprovalDetailsWrite | PermissionsLocationsAddToolApprovalDetailsMCP | PermissionsLocationsAddToolApprovalDetailsMCPSampling | PermissionsLocationsAddToolApprovalDetailsMemory | PermissionsLocationsAddToolApprovalDetailsCustomTool | PermissionsLocationsAddToolApprovalDetailsExtensionManagement | PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess +PermissionsLocationsAddToolApprovalDetails = PermissionsLocationsAddToolApprovalDetailsCommands | PermissionsLocationsAddToolApprovalDetailsRead | PermissionsLocationsAddToolApprovalDetailsWrite | PermissionsLocationsAddToolApprovalDetailsMCP | PermissionsLocationsAddToolApprovalDetailsMCPSampling | PermissionsLocationsAddToolApprovalDetailsMemory | PermissionsLocationsAddToolApprovalDetailsCustomTool | PermissionsLocationsAddToolApprovalDetailsExtensionManagement | PermissionsLocationsAddToolApprovalDetailsFactory | PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess def _load_PermissionsLocationsAddToolApprovalDetails(obj: Any) -> "PermissionsLocationsAddToolApprovalDetails": assert isinstance(obj, dict) @@ -30985,6 +31397,7 @@ def _load_PermissionsLocationsAddToolApprovalDetails(obj: Any) -> "PermissionsLo case "memory": return PermissionsLocationsAddToolApprovalDetailsMemory.from_dict(obj) case "custom-tool": return PermissionsLocationsAddToolApprovalDetailsCustomTool.from_dict(obj) case "extension-management": return PermissionsLocationsAddToolApprovalDetailsExtensionManagement.from_dict(obj) + case "factory": return PermissionsLocationsAddToolApprovalDetailsFactory.from_dict(obj) case "extension-permission-access": return PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess.from_dict(obj) case _: raise ValueError(f"Unknown PermissionsLocationsAddToolApprovalDetails kind: {kind!r}") @@ -31290,6 +31703,26 @@ async def discover(self, params: MCPDiscoverRequest, *, timeout: float | None = return MCPDiscoverResult.from_dict(await self._client.request("mcp.discover", params_dict, **_timeout_kwargs(timeout))) +# Experimental: this API group is experimental and may change or be removed. +class ServerExtensionsApi: + def __init__(self, client: "JsonRpcClient"): + self._client = client + + async def discover(self, *, timeout: float | None = None) -> DiscoveredExtensions: + "Discovers user and enabled installed-plugin extensions from persisted Copilot home state, including enablement preferences. Launch-scoped additional plugins are not included.\n\nReturns:\n Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included." + return DiscoveredExtensions.from_dict(await self._client.request("extensions.discover", {}, **_timeout_kwargs(timeout))) + + async def enable(self, params: DiscoveredExtensionsEnableRequest, *, timeout: float | None = None) -> None: + "Persistently enables extension IDs for future sessions. Active sessions are unchanged; use session.extensions.enable to update them.\n\nArgs:\n params: Source-qualified extension identifiers to persistently enable for future sessions." + params_dict = {k: v for k, v in params.to_dict().items() if v is not None} + await self._client.request("extensions.enable", params_dict, **_timeout_kwargs(timeout)) + + async def disable(self, params: DiscoveredExtensionsDisableRequest, *, timeout: float | None = None) -> None: + "Persistently disables extension IDs for future sessions. Active sessions are unchanged; use session.extensions.disable to update them.\n\nArgs:\n params: Source-qualified extension identifiers to persistently disable for future sessions." + params_dict = {k: v for k, v in params.to_dict().items() if v is not None} + await self._client.request("extensions.disable", params_dict, **_timeout_kwargs(timeout)) + + # Experimental: this API group is experimental and may change or be removed. class ServerPluginsMarketplacesApi: def __init__(self, client: "JsonRpcClient"): @@ -31636,6 +32069,7 @@ def __init__(self, client: "JsonRpcClient"): self.account = ServerAccountApi(client) self.secrets = ServerSecretsApi(client) self.mcp = ServerMcpApi(client) + self.extensions = ServerExtensionsApi(client) self.plugins = ServerPluginsApi(client) self.skills = ServerSkillsApi(client) self.agents = ServerAgentsApi(client) @@ -32104,6 +32538,12 @@ async def list(self, params: SessionAgentListRequest | None = None, *, timeout: params_dict["sessionId"] = self._session_id return AgentList.from_dict(await self._client.request("session.agent.list", params_dict, **_timeout_kwargs(timeout))) + async def set_prompt(self, params: AgentSetPromptRequest, *, timeout: float | None = None) -> None: + "Sets an in-memory authored prompt override for an available agent. For built-in agents, this replaces only the static base prompt while preserving runtime-owned dynamic prompt composition and behavior. The special `general-purpose` agent is not overrideable. Overrides are not persisted; resumed and forked sessions start without them, so the host must re-apply them.\n\nArgs:\n params: An in-memory authored prompt override for an available agent." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + await self._client.request("session.agent.setPrompt", params_dict, **_timeout_kwargs(timeout)) + async def get_current(self, *, timeout: float | None = None) -> AgentGetCurrentResult: "Gets the currently selected custom agent for the session.\n\nReturns:\n The currently selected custom agent, or null when using the default agent." return AgentGetCurrentResult.from_dict(await self._client.request("session.agent.getCurrent", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -32233,6 +32673,12 @@ async def handle_pending_request(self, params: MCPOauthHandlePendingRequest, *, params_dict["sessionId"] = self._session_id return MCPOauthHandlePendingResult.from_dict(await self._client.request("session.mcp.oauth.handlePendingRequest", params_dict, **_timeout_kwargs(timeout))) + async def authentication_state_changed(self, params: MCPOauthAuthenticationStateChangedRequest, *, timeout: float | None = None) -> None: + "Notifies the session that MCP OAuth authentication succeeded and updated credentials were persisted, so cached tool definitions can be refreshed.\n\nArgs:\n params: Identifies the MCP server whose persisted OAuth credentials were updated." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + await self._client.request("session.mcp.oauth.authenticationStateChanged", params_dict, **_timeout_kwargs(timeout)) + async def login(self, params: MCPOauthLoginRequest, *, timeout: float | None = None) -> MCPOauthLoginResult: "Starts OAuth authentication for a remote MCP server.\n\nArgs:\n params: Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.\n\nReturns:\n OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} @@ -33026,7 +33472,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def read(self, params: EventLogReadRequest, *, timeout: float | None = None) -> EventsReadResult: - "Reads a batch of session events from a cursor, optionally waiting for new events.\n\nArgs:\n params: Cursor, batch size, and optional long-poll/filter parameters for reading session events.\n\nReturns:\n Batch of session events returned by a read, with cursor and continuation metadata." + "Reads a batch of session events from a cursor, optionally waiting for new events. Supports tail-first reads via `direction: backward`.\n\nArgs:\n params: Cursor, batch size, and optional long-poll/filter parameters for reading session events.\n\nReturns:\n Batch of session events returned by a read, with cursor and continuation metadata." 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 EventsReadResult.from_dict(await self._client.request("session.eventLog.read", params_dict, **_timeout_kwargs(timeout))) @@ -33705,6 +34151,7 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "AgentReloadResult", "AgentSelectRequest", "AgentSelectResult", + "AgentSetPromptRequest", "AgentsDiscoverRequest", "AgentsGetDiscoveryPathsRequest", "AllowAllPermissionSetResult", @@ -33782,6 +34229,13 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "DebugCollectLogsSkippedEntry", "DebugCollectLogsSource", "DiscoveredCanvas", + "DiscoveredExtension", + "DiscoveredExtensionMode", + "DiscoveredExtensionPlugin", + "DiscoveredExtensionSource", + "DiscoveredExtensions", + "DiscoveredExtensionsDisableRequest", + "DiscoveredExtensionsEnableRequest", "DiscoveredMCPServer", "DiscoveredMCPServerType", "EnqueueCommandParams", @@ -33796,6 +34250,7 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "EventLogTypes", "EventsAgentScope", "EventsCursorStatus", + "EventsReadDirection", "EventsReadResult", "ExecuteCommandParams", "ExecuteCommandResult", @@ -33999,6 +34454,7 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "MCPIsServerRunningResult", "MCPListToolsRequest", "MCPListToolsResult", + "MCPOauthAuthenticationStateChangedRequest", "MCPOauthHandlePendingRequest", "MCPOauthHandlePendingResult", "MCPOauthLoginRequest", @@ -34143,6 +34599,8 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "PermissionDecisionApproveForLocationApprovalExtensionManagementKind", "PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess", "PermissionDecisionApproveForLocationApprovalExtensionPermissionAccessKind", + "PermissionDecisionApproveForLocationApprovalFactory", + "PermissionDecisionApproveForLocationApprovalFactoryKind", "PermissionDecisionApproveForLocationApprovalMCP", "PermissionDecisionApproveForLocationApprovalMCPKind", "PermissionDecisionApproveForLocationApprovalMCPSampling", @@ -34160,6 +34618,7 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "PermissionDecisionApproveForSessionApprovalCustomTool", "PermissionDecisionApproveForSessionApprovalExtensionManagement", "PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess", + "PermissionDecisionApproveForSessionApprovalFactory", "PermissionDecisionApproveForSessionApprovalMCP", "PermissionDecisionApproveForSessionApprovalMCPSampling", "PermissionDecisionApproveForSessionApprovalMemory", @@ -34229,6 +34688,7 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "PermissionsLocationsAddToolApprovalDetailsCustomTool", "PermissionsLocationsAddToolApprovalDetailsExtensionManagement", "PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess", + "PermissionsLocationsAddToolApprovalDetailsFactory", "PermissionsLocationsAddToolApprovalDetailsMCP", "PermissionsLocationsAddToolApprovalDetailsMCPSampling", "PermissionsLocationsAddToolApprovalDetailsMemory", @@ -34442,6 +34902,7 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "ServerAgentRegistryApi", "ServerAgentsApi", "ServerCommandsApi", + "ServerExtensionsApi", "ServerInstructionSourceList", "ServerInstructionsApi", "ServerLlmInferenceApi", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index a9f6fe7011..0be503112c 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -1318,6 +1318,8 @@ class AssistantMessageData: content: str message_id: str api_call_id: str | None = None + chunk_count: int | None = None + chunk_index: int | None = None # Experimental: this field is part of an experimental API and may change or be removed. citations: Citations | None = None client_request_id: str | None = None @@ -1344,6 +1346,8 @@ def from_dict(obj: Any) -> "AssistantMessageData": content = from_str(obj.get("content")) message_id = from_str(obj.get("messageId")) api_call_id = from_union([from_none, from_str], obj.get("apiCallId")) + chunk_count = from_union([from_none, from_int], obj.get("chunkCount")) + chunk_index = from_union([from_none, from_int], obj.get("chunkIndex")) citations = from_union([from_none, Citations.from_dict], obj.get("citations")) client_request_id = from_union([from_none, from_str], obj.get("clientRequestId")) encrypted_content = from_union([from_none, from_str], obj.get("encryptedContent")) @@ -1365,6 +1369,8 @@ def from_dict(obj: Any) -> "AssistantMessageData": content=content, message_id=message_id, api_call_id=api_call_id, + chunk_count=chunk_count, + chunk_index=chunk_index, citations=citations, client_request_id=client_request_id, encrypted_content=encrypted_content, @@ -1390,6 +1396,10 @@ def to_dict(self) -> dict: result["messageId"] = from_str(self.message_id) if self.api_call_id is not None: result["apiCallId"] = from_union([from_none, from_str], self.api_call_id) + if self.chunk_count is not None: + result["chunkCount"] = from_union([from_none, to_int], self.chunk_count) + if self.chunk_index is not None: + result["chunkIndex"] = from_union([from_none, to_int], self.chunk_index) if self.citations is not None: result["citations"] = from_union([from_none, lambda x: to_class(Citations, x)], self.citations) if self.client_request_id is not None: @@ -3426,6 +3436,65 @@ def to_dict(self) -> dict: return result +@dataclass +class FactoryPermissionPhase: + "A declared phase shown in a factory permission prompt." + title: str + detail: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "FactoryPermissionPhase": + assert isinstance(obj, dict) + title = from_str(obj.get("title")) + detail = from_union([from_none, from_str], obj.get("detail")) + return FactoryPermissionPhase( + title=title, + detail=detail, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["title"] = from_str(self.title) + if self.detail is not None: + result["detail"] = from_union([from_none, from_str], self.detail) + return result + + +@dataclass +class GitHubMcpToolConfig: + "Per-session configuration for the built-in GitHub MCP server" + additional_tools: list[str] | None = None + additional_toolsets: list[str] | None = None + enable_all_tools: bool | None = None + enable_insiders_mode: bool | None = None + + @staticmethod + def from_dict(obj: Any) -> "GitHubMcpToolConfig": + assert isinstance(obj, dict) + additional_tools = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("additionalTools")) + additional_toolsets = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("additionalToolsets")) + enable_all_tools = from_union([from_none, from_bool], obj.get("enableAllTools")) + enable_insiders_mode = from_union([from_none, from_bool], obj.get("enableInsidersMode")) + return GitHubMcpToolConfig( + additional_tools=additional_tools, + additional_toolsets=additional_toolsets, + enable_all_tools=enable_all_tools, + enable_insiders_mode=enable_insiders_mode, + ) + + def to_dict(self) -> dict: + result: dict = {} + if self.additional_tools is not None: + result["additionalTools"] = from_union([from_none, lambda x: from_list(from_str, x)], self.additional_tools) + if self.additional_toolsets is not None: + result["additionalToolsets"] = from_union([from_none, lambda x: from_list(from_str, x)], self.additional_toolsets) + if self.enable_all_tools is not None: + result["enableAllTools"] = from_union([from_none, from_bool], self.enable_all_tools) + if self.enable_insiders_mode is not None: + result["enableInsidersMode"] = from_union([from_none, from_bool], self.enable_insiders_mode) + return result + + @dataclass class GitHubRepoRef: "Pointer to a GitHub repository." @@ -4677,6 +4746,103 @@ def to_dict(self) -> dict: return result +@dataclass +class PermissionPromptRequestFactory: + "Factory run or authoring permission prompt" + approval_key: str + can_persist_approval: bool + description: str + kind: ClassVar[str] = "factory" + name: str + operation: FactoryPermissionOperation + phases: list[FactoryPermissionPhase] + # Experimental: this field is part of an experimental API and may change or be removed. + auto_approval: PermissionAutoApproval | None = None + declared_max_ai_credits: float | None = None + declared_max_concurrent_subagents: int | None = None + declared_max_total_subagents: int | None = None + declared_timeout_seconds: float | None = None + managed_approval_required: bool | None = None + max_ai_credits: float | None = None + max_concurrent_subagents: int | None = None + max_total_subagents: int | None = None + timeout_seconds: float | None = None + tool_call_id: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "PermissionPromptRequestFactory": + assert isinstance(obj, dict) + approval_key = from_str(obj.get("approvalKey")) + can_persist_approval = from_bool(obj.get("canPersistApproval")) + description = from_str(obj.get("description")) + name = from_str(obj.get("name")) + operation = parse_enum(FactoryPermissionOperation, obj.get("operation")) + phases = from_list(FactoryPermissionPhase.from_dict, obj.get("phases")) + auto_approval = from_union([from_none, PermissionAutoApproval.from_dict], obj.get("autoApproval")) + declared_max_ai_credits = from_union([from_none, from_float], obj.get("declaredMaxAiCredits")) + declared_max_concurrent_subagents = from_union([from_none, from_int], obj.get("declaredMaxConcurrentSubagents")) + declared_max_total_subagents = from_union([from_none, from_int], obj.get("declaredMaxTotalSubagents")) + declared_timeout_seconds = from_union([from_none, from_float], obj.get("declaredTimeoutSeconds")) + managed_approval_required = from_union([from_none, from_bool], obj.get("managedApprovalRequired")) + max_ai_credits = from_union([from_none, from_float], obj.get("maxAiCredits")) + max_concurrent_subagents = from_union([from_none, from_int], obj.get("maxConcurrentSubagents")) + max_total_subagents = from_union([from_none, from_int], obj.get("maxTotalSubagents")) + timeout_seconds = from_union([from_none, from_float], obj.get("timeoutSeconds")) + tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) + return PermissionPromptRequestFactory( + approval_key=approval_key, + can_persist_approval=can_persist_approval, + description=description, + name=name, + operation=operation, + phases=phases, + auto_approval=auto_approval, + declared_max_ai_credits=declared_max_ai_credits, + declared_max_concurrent_subagents=declared_max_concurrent_subagents, + declared_max_total_subagents=declared_max_total_subagents, + declared_timeout_seconds=declared_timeout_seconds, + managed_approval_required=managed_approval_required, + max_ai_credits=max_ai_credits, + max_concurrent_subagents=max_concurrent_subagents, + max_total_subagents=max_total_subagents, + timeout_seconds=timeout_seconds, + tool_call_id=tool_call_id, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["approvalKey"] = from_str(self.approval_key) + result["canPersistApproval"] = from_bool(self.can_persist_approval) + result["description"] = from_str(self.description) + result["kind"] = self.kind + result["name"] = from_str(self.name) + result["operation"] = to_enum(FactoryPermissionOperation, self.operation) + result["phases"] = from_list(lambda x: to_class(FactoryPermissionPhase, x), self.phases) + if self.auto_approval is not None: + result["autoApproval"] = from_union([from_none, lambda x: to_class(PermissionAutoApproval, x)], self.auto_approval) + if self.declared_max_ai_credits is not None: + result["declaredMaxAiCredits"] = from_union([from_none, to_float], self.declared_max_ai_credits) + if self.declared_max_concurrent_subagents is not None: + result["declaredMaxConcurrentSubagents"] = from_union([from_none, to_int], self.declared_max_concurrent_subagents) + if self.declared_max_total_subagents is not None: + result["declaredMaxTotalSubagents"] = from_union([from_none, to_int], self.declared_max_total_subagents) + if self.declared_timeout_seconds is not None: + result["declaredTimeoutSeconds"] = from_union([from_none, to_float], self.declared_timeout_seconds) + if self.managed_approval_required is not None: + result["managedApprovalRequired"] = from_union([from_none, from_bool], self.managed_approval_required) + if self.max_ai_credits is not None: + result["maxAiCredits"] = from_union([from_none, to_float], self.max_ai_credits) + if self.max_concurrent_subagents is not None: + result["maxConcurrentSubagents"] = from_union([from_none, to_int], self.max_concurrent_subagents) + if self.max_total_subagents is not None: + result["maxTotalSubagents"] = from_union([from_none, to_int], self.max_total_subagents) + if self.timeout_seconds is not None: + result["timeoutSeconds"] = from_union([from_none, to_float], self.timeout_seconds) + if self.tool_call_id is not None: + result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) + return result + + @dataclass class PermissionPromptRequestHook: "Hook confirmation permission prompt" @@ -5119,6 +5285,92 @@ def to_dict(self) -> dict: return result +@dataclass +class PermissionRequestFactory: + "Factory run or authoring permission request" + approval_key: str + can_persist_approval: bool + description: str + kind: ClassVar[str] = "factory" + name: str + operation: FactoryPermissionOperation + phases: list[FactoryPermissionPhase] + declared_max_ai_credits: float | None = None + declared_max_concurrent_subagents: int | None = None + declared_max_total_subagents: int | None = None + declared_timeout_seconds: float | None = None + max_ai_credits: float | None = None + max_concurrent_subagents: int | None = None + max_total_subagents: int | None = None + timeout_seconds: float | None = None + tool_call_id: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "PermissionRequestFactory": + assert isinstance(obj, dict) + approval_key = from_str(obj.get("approvalKey")) + can_persist_approval = from_bool(obj.get("canPersistApproval")) + description = from_str(obj.get("description")) + name = from_str(obj.get("name")) + operation = parse_enum(FactoryPermissionOperation, obj.get("operation")) + phases = from_list(FactoryPermissionPhase.from_dict, obj.get("phases")) + declared_max_ai_credits = from_union([from_none, from_float], obj.get("declaredMaxAiCredits")) + declared_max_concurrent_subagents = from_union([from_none, from_int], obj.get("declaredMaxConcurrentSubagents")) + declared_max_total_subagents = from_union([from_none, from_int], obj.get("declaredMaxTotalSubagents")) + declared_timeout_seconds = from_union([from_none, from_float], obj.get("declaredTimeoutSeconds")) + max_ai_credits = from_union([from_none, from_float], obj.get("maxAiCredits")) + max_concurrent_subagents = from_union([from_none, from_int], obj.get("maxConcurrentSubagents")) + max_total_subagents = from_union([from_none, from_int], obj.get("maxTotalSubagents")) + timeout_seconds = from_union([from_none, from_float], obj.get("timeoutSeconds")) + tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) + return PermissionRequestFactory( + approval_key=approval_key, + can_persist_approval=can_persist_approval, + description=description, + name=name, + operation=operation, + phases=phases, + declared_max_ai_credits=declared_max_ai_credits, + declared_max_concurrent_subagents=declared_max_concurrent_subagents, + declared_max_total_subagents=declared_max_total_subagents, + declared_timeout_seconds=declared_timeout_seconds, + max_ai_credits=max_ai_credits, + max_concurrent_subagents=max_concurrent_subagents, + max_total_subagents=max_total_subagents, + timeout_seconds=timeout_seconds, + tool_call_id=tool_call_id, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["approvalKey"] = from_str(self.approval_key) + result["canPersistApproval"] = from_bool(self.can_persist_approval) + result["description"] = from_str(self.description) + result["kind"] = self.kind + result["name"] = from_str(self.name) + result["operation"] = to_enum(FactoryPermissionOperation, self.operation) + result["phases"] = from_list(lambda x: to_class(FactoryPermissionPhase, x), self.phases) + if self.declared_max_ai_credits is not None: + result["declaredMaxAiCredits"] = from_union([from_none, to_float], self.declared_max_ai_credits) + if self.declared_max_concurrent_subagents is not None: + result["declaredMaxConcurrentSubagents"] = from_union([from_none, to_int], self.declared_max_concurrent_subagents) + if self.declared_max_total_subagents is not None: + result["declaredMaxTotalSubagents"] = from_union([from_none, to_int], self.declared_max_total_subagents) + if self.declared_timeout_seconds is not None: + result["declaredTimeoutSeconds"] = from_union([from_none, to_float], self.declared_timeout_seconds) + if self.max_ai_credits is not None: + result["maxAiCredits"] = from_union([from_none, to_float], self.max_ai_credits) + if self.max_concurrent_subagents is not None: + result["maxConcurrentSubagents"] = from_union([from_none, to_int], self.max_concurrent_subagents) + if self.max_total_subagents is not None: + result["maxTotalSubagents"] = from_union([from_none, to_int], self.max_total_subagents) + if self.timeout_seconds is not None: + result["timeoutSeconds"] = from_union([from_none, to_float], self.timeout_seconds) + if self.tool_call_id is not None: + result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) + return result + + @dataclass class PermissionRequestHook: "Hook confirmation permission request" @@ -6925,6 +7177,7 @@ class SessionStartData: context: WorkingDirectoryContext | None = None context_tier: ContextTier | None = None detached_from_spawning_parent_session_id: str | None = None + github_mcp_tool_config: GitHubMcpToolConfig | None = None reasoning_effort: str | None = None reasoning_summary: ReasoningSummary | None = None remote_steerable: bool | None = None @@ -6944,6 +7197,7 @@ def from_dict(obj: Any) -> "SessionStartData": context = from_union([from_none, WorkingDirectoryContext.from_dict], obj.get("context")) context_tier = from_union([from_none, lambda x: parse_enum(ContextTier, x)], obj.get("contextTier")) detached_from_spawning_parent_session_id = from_union([from_none, from_str], obj.get("detachedFromSpawningParentSessionId")) + github_mcp_tool_config = from_union([from_none, GitHubMcpToolConfig.from_dict], obj.get("githubMcpToolConfig")) 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")) @@ -6960,6 +7214,7 @@ def from_dict(obj: Any) -> "SessionStartData": context=context, context_tier=context_tier, detached_from_spawning_parent_session_id=detached_from_spawning_parent_session_id, + github_mcp_tool_config=github_mcp_tool_config, reasoning_effort=reasoning_effort, reasoning_summary=reasoning_summary, remote_steerable=remote_steerable, @@ -6983,6 +7238,8 @@ def to_dict(self) -> dict: result["contextTier"] = from_union([from_none, lambda x: to_enum(ContextTier, x)], self.context_tier) if self.detached_from_spawning_parent_session_id is not None: result["detachedFromSpawningParentSessionId"] = from_union([from_none, from_str], self.detached_from_spawning_parent_session_id) + if self.github_mcp_tool_config is not None: + result["githubMcpToolConfig"] = from_union([from_none, lambda x: to_class(GitHubMcpToolConfig, x)], self.github_mcp_tool_config) if self.reasoning_effort is not None: result["reasoningEffort"] = from_union([from_none, from_str], self.reasoning_effort) if self.reasoning_summary is not None: @@ -7861,6 +8118,66 @@ def to_dict(self) -> dict: return result +@dataclass +class SystemNotificationFactoryCompleted: + "System notification metadata for a factory execution attempt that reached a terminal state." + attempt: int + consumed_nano_aiu: int + consumed_subagents: int + elapsed_ms: int + factory_name: str + run_id: str + status: SystemNotificationFactoryCompletedStatus + type: ClassVar[str] = "factory_completed" + failure: Any = None + result_preview: str | None = None + retry_guidance: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "SystemNotificationFactoryCompleted": + assert isinstance(obj, dict) + attempt = from_int(obj.get("attempt")) + consumed_nano_aiu = from_int(obj.get("consumedNanoAiu")) + consumed_subagents = from_int(obj.get("consumedSubagents")) + elapsed_ms = from_int(obj.get("elapsedMs")) + factory_name = from_str(obj.get("factoryName")) + run_id = from_str(obj.get("runId")) + status = parse_enum(SystemNotificationFactoryCompletedStatus, obj.get("status")) + failure = obj.get("failure") + result_preview = from_union([from_none, from_str], obj.get("resultPreview")) + retry_guidance = from_union([from_none, from_str], obj.get("retryGuidance")) + return SystemNotificationFactoryCompleted( + attempt=attempt, + consumed_nano_aiu=consumed_nano_aiu, + consumed_subagents=consumed_subagents, + elapsed_ms=elapsed_ms, + factory_name=factory_name, + run_id=run_id, + status=status, + failure=failure, + result_preview=result_preview, + retry_guidance=retry_guidance, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["attempt"] = to_int(self.attempt) + result["consumedNanoAiu"] = to_int(self.consumed_nano_aiu) + result["consumedSubagents"] = to_int(self.consumed_subagents) + result["elapsedMs"] = to_int(self.elapsed_ms) + result["factoryName"] = from_str(self.factory_name) + result["runId"] = from_str(self.run_id) + result["status"] = to_enum(SystemNotificationFactoryCompletedStatus, self.status) + result["type"] = self.type + if self.failure is not None: + result["failure"] = self.failure + if self.result_preview is not None: + result["resultPreview"] = from_union([from_none, from_str], self.result_preview) + if self.retry_guidance is not None: + result["retryGuidance"] = from_union([from_none, from_str], self.retry_guidance) + return result + + @dataclass class SystemNotificationInstructionDiscovered: "System notification metadata for an instruction file discovered during tool access, including source, trigger file, and tool." @@ -9197,6 +9514,28 @@ def to_dict(self) -> dict: return result +@dataclass +class UserToolSessionApprovalFactory: + "Session-scoped factory approval, optionally narrowed by approval key." + kind: ClassVar[str] = "factory" + approval_key: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "UserToolSessionApprovalFactory": + assert isinstance(obj, dict) + approval_key = from_union([from_none, from_str], obj.get("approvalKey")) + return UserToolSessionApprovalFactory( + approval_key=approval_key, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["kind"] = self.kind + if self.approval_key is not None: + result["approvalKey"] = from_union([from_none, from_str], self.approval_key) + return result + + @dataclass class UserToolSessionApprovalMcp: "Session-scoped tool-approval rule for an MCP server tool, or all tools on the server when `toolName` is null." @@ -9378,6 +9717,7 @@ def _load_PermissionPromptRequest(obj: Any) -> "PermissionPromptRequest": case "path": return PermissionPromptRequestPath.from_dict(obj) case "hook": return PermissionPromptRequestHook.from_dict(obj) case "extension-management": return PermissionPromptRequestExtensionManagement.from_dict(obj) + case "factory": return PermissionPromptRequestFactory.from_dict(obj) case "extension-permission-access": return PermissionPromptRequestExtensionPermissionAccess.from_dict(obj) case _: raise ValueError(f"Unknown PermissionPromptRequest kind: {kind!r}") @@ -9395,6 +9735,7 @@ def _load_PermissionRequest(obj: Any) -> "PermissionRequest": case "custom-tool": return PermissionRequestCustomTool.from_dict(obj) case "hook": return PermissionRequestHook.from_dict(obj) case "extension-management": return PermissionRequestExtensionManagement.from_dict(obj) + case "factory": return PermissionRequestFactory.from_dict(obj) case "extension-permission-access": return PermissionRequestExtensionPermissionAccess.from_dict(obj) case _: raise ValueError(f"Unknown PermissionRequest kind: {kind!r}") @@ -9425,6 +9766,7 @@ def _load_SystemNotification(obj: Any) -> "SystemNotification": case "shell_completed": return SystemNotificationShellCompleted.from_dict(obj) case "shell_detached_completed": return SystemNotificationShellDetachedCompleted.from_dict(obj) case "instruction_discovered": return SystemNotificationInstructionDiscovered.from_dict(obj) + case "factory_completed": return SystemNotificationFactoryCompleted.from_dict(obj) case "unclassified": return SystemNotificationUnclassified.from_dict(obj) case _: raise ValueError(f"Unknown SystemNotification type: {kind!r}") @@ -9454,6 +9796,7 @@ def _load_UserToolSessionApproval(obj: Any) -> "UserToolSessionApproval": case "memory": return UserToolSessionApprovalMemory.from_dict(obj) case "custom-tool": return UserToolSessionApprovalCustomTool.from_dict(obj) case "extension-management": return UserToolSessionApprovalExtensionManagement.from_dict(obj) + case "factory": return UserToolSessionApprovalFactory.from_dict(obj) case "extension-permission-access": return UserToolSessionApprovalExtensionPermissionAccess.from_dict(obj) case _: raise ValueError(f"Unknown UserToolSessionApproval kind: {kind!r}") @@ -9471,11 +9814,11 @@ def _load_UserToolSessionApproval(obj: Any) -> "UserToolSessionApproval": # Derived user-facing permission prompt details for UI consumers -PermissionPromptRequest = PermissionPromptRequestCommands | PermissionPromptRequestWrite | PermissionPromptRequestRead | PermissionPromptRequestMcp | PermissionPromptRequestUrl | PermissionPromptRequestMemory | PermissionPromptRequestCustomTool | PermissionPromptRequestPath | PermissionPromptRequestHook | PermissionPromptRequestExtensionManagement | PermissionPromptRequestExtensionPermissionAccess +PermissionPromptRequest = PermissionPromptRequestCommands | PermissionPromptRequestWrite | PermissionPromptRequestRead | PermissionPromptRequestMcp | PermissionPromptRequestUrl | PermissionPromptRequestMemory | PermissionPromptRequestCustomTool | PermissionPromptRequestPath | PermissionPromptRequestHook | PermissionPromptRequestExtensionManagement | PermissionPromptRequestFactory | PermissionPromptRequestExtensionPermissionAccess # Details of the permission being requested -PermissionRequest = PermissionRequestShell | PermissionRequestWrite | PermissionRequestRead | PermissionRequestMcp | PermissionRequestUrl | PermissionRequestMemory | PermissionRequestCustomTool | PermissionRequestHook | PermissionRequestExtensionManagement | PermissionRequestExtensionPermissionAccess +PermissionRequest = PermissionRequestShell | PermissionRequestWrite | PermissionRequestRead | PermissionRequestMcp | PermissionRequestUrl | PermissionRequestMemory | PermissionRequestCustomTool | PermissionRequestHook | PermissionRequestExtensionManagement | PermissionRequestFactory | PermissionRequestExtensionPermissionAccess # Location within a cited source (character, page, or content-block range) that supports a span. @@ -9483,11 +9826,11 @@ def _load_UserToolSessionApproval(obj: Any) -> "UserToolSessionApproval": # Structured metadata identifying what triggered this notification -SystemNotification = SystemNotificationAgentCompleted | SystemNotificationAgentIdle | SystemNotificationNewInboxMessage | SystemNotificationShellCompleted | SystemNotificationShellDetachedCompleted | SystemNotificationInstructionDiscovered | SystemNotificationUnclassified +SystemNotification = SystemNotificationAgentCompleted | SystemNotificationAgentIdle | SystemNotificationNewInboxMessage | SystemNotificationShellCompleted | SystemNotificationShellDetachedCompleted | SystemNotificationInstructionDiscovered | SystemNotificationFactoryCompleted | SystemNotificationUnclassified # The approval to add as a session-scoped rule -UserToolSessionApproval = UserToolSessionApprovalCommands | UserToolSessionApprovalRead | UserToolSessionApprovalWrite | UserToolSessionApprovalMcp | UserToolSessionApprovalMemory | UserToolSessionApprovalCustomTool | UserToolSessionApprovalExtensionManagement | UserToolSessionApprovalExtensionPermissionAccess +UserToolSessionApproval = UserToolSessionApprovalCommands | UserToolSessionApprovalRead | UserToolSessionApprovalWrite | UserToolSessionApprovalMcp | UserToolSessionApprovalMemory | UserToolSessionApprovalCustomTool | UserToolSessionApprovalExtensionManagement | UserToolSessionApprovalFactory | UserToolSessionApprovalExtensionPermissionAccess # The embedded resource contents, either text or base64-encoded binary @@ -9724,6 +10067,14 @@ class ExtensionsLoadedExtensionStatus(Enum): STARTING = "starting" +class FactoryPermissionOperation(Enum): + "Operation gated by a factory permission request." + # Running a registered factory, which spends subagents, active time, and AI credits under the approved limits. + RUN = "run" + # Authoring a factory, which writes JavaScript into a session-scoped extension and loads it. + AUTHOR = "author" + + class HandoffSourceType(Enum): "Origin type of the session being handed off" # The handoff originated from a remote session. @@ -10030,6 +10381,18 @@ class SystemNotificationAgentCompletedStatus(Enum): FAILED = "failed" +class SystemNotificationFactoryCompletedStatus(Enum): + "Terminal status reached by a factory execution attempt." + # The factory completed successfully. + COMPLETED = "completed" + # The factory was halted. + HALTED = "halted" + # The factory was cancelled. + CANCELLED = "cancelled" + # The factory failed. + ERROR = "error" + + class TaskCompletionOutcome(Enum): "Semantic result of evaluating a task completion request" # The completion request was accepted and the objective is complete. @@ -10382,7 +10745,10 @@ def session_event_to_dict(x: SessionEvent) -> Any: "ExtensionsLoadedExtensionStatus", "ExternalToolCompletedData", "ExternalToolRequestedData", + "FactoryPermissionOperation", + "FactoryPermissionPhase", "FactoryRunUpdatedData", + "GitHubMcpToolConfig", "GitHubRepoRef", "HandoffRepository", "HandoffSourceType", @@ -10444,6 +10810,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "PermissionPromptRequestCustomTool", "PermissionPromptRequestExtensionManagement", "PermissionPromptRequestExtensionPermissionAccess", + "PermissionPromptRequestFactory", "PermissionPromptRequestHook", "PermissionPromptRequestMcp", "PermissionPromptRequestMemory", @@ -10456,6 +10823,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "PermissionRequestCustomTool", "PermissionRequestExtensionManagement", "PermissionRequestExtensionPermissionAccess", + "PermissionRequestFactory", "PermissionRequestHook", "PermissionRequestMcp", "PermissionRequestMemory", @@ -10561,6 +10929,8 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SystemNotificationAgentCompletedStatus", "SystemNotificationAgentIdle", "SystemNotificationData", + "SystemNotificationFactoryCompleted", + "SystemNotificationFactoryCompletedStatus", "SystemNotificationInstructionDiscovered", "SystemNotificationNewInboxMessage", "SystemNotificationShellCompleted", @@ -10614,6 +10984,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "UserToolSessionApprovalCustomTool", "UserToolSessionApprovalExtensionManagement", "UserToolSessionApprovalExtensionPermissionAccess", + "UserToolSessionApprovalFactory", "UserToolSessionApprovalMcp", "UserToolSessionApprovalMemory", "UserToolSessionApprovalRead", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 0472ea0f71..cb0c4da541 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -56,6 +56,12 @@ pub mod rpc_methods { pub const MCP_CONFIG_RELOAD: &str = "mcp.config.reload"; /// `mcp.discover` pub const MCP_DISCOVER: &str = "mcp.discover"; + /// `extensions.discover` + pub const EXTENSIONS_DISCOVER: &str = "extensions.discover"; + /// `extensions.enable` + pub const EXTENSIONS_ENABLE: &str = "extensions.enable"; + /// `extensions.disable` + pub const EXTENSIONS_DISABLE: &str = "extensions.disable"; /// `plugins.list` pub const PLUGINS_LIST: &str = "plugins.list"; /// `plugins.install` @@ -307,6 +313,8 @@ pub mod rpc_methods { pub const SESSION_FLEET_START: &str = "session.fleet.start"; /// `session.agent.list` pub const SESSION_AGENT_LIST: &str = "session.agent.list"; + /// `session.agent.setPrompt` + pub const SESSION_AGENT_SETPROMPT: &str = "session.agent.setPrompt"; /// `session.agent.getCurrent` pub const SESSION_AGENT_GETCURRENT: &str = "session.agent.getCurrent"; /// `session.agent.select` @@ -387,6 +395,9 @@ pub mod rpc_methods { /// `session.mcp.oauth.handlePendingRequest` pub const SESSION_MCP_OAUTH_HANDLEPENDINGREQUEST: &str = "session.mcp.oauth.handlePendingRequest"; + /// `session.mcp.oauth.authenticationStateChanged` + pub const SESSION_MCP_OAUTH_AUTHENTICATIONSTATECHANGED: &str = + "session.mcp.oauth.authenticationStateChanged"; /// `session.mcp.oauth.login` pub const SESSION_MCP_OAUTH_LOGIN: &str = "session.mcp.oauth.login"; /// `session.mcp.oauth.respond` @@ -1306,6 +1317,23 @@ pub struct AgentSelectResult { pub agent: AgentInfo, } +/// An in-memory authored prompt override for an available agent. +/// +///

+/// +/// **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 AgentSetPromptRequest { + /// Stable effective agent id. Plugin namespace separators are normalized. + pub id: String, + /// Replacement authored prompt. Empty text is valid. + pub prompt: String, +} + /// Optional project paths to include when enumerating agent discovery directories. /// ///
@@ -3339,6 +3367,94 @@ pub struct DebugCollectLogsResult { pub skipped_entries: Option>, } +/// Installed plugin that contributes a discovered extension. +/// +///
+/// +/// **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 DiscoveredExtensionPlugin { + /// Installed plugin name + pub name: String, +} + +/// Discovered extension metadata and persistent enablement state. +/// +///
+/// +/// **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 DiscoveredExtension { + /// Whether this extension's persistent per-ID preference is enabled + pub enabled: bool, + /// Source-qualified ID accepted by both server and session extension enablement methods + pub id: String, + /// Human-readable extension name + pub name: String, + /// Absolute path to the extension entry module, suitable for revealing it in a file manager + pub path: String, + /// Containing plugin metadata for plugin-contributed extensions + #[serde(skip_serializing_if = "Option::is_none")] + pub plugin: Option, + /// Discovery source + pub source: DiscoveredExtensionSource, +} + +/// Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included. +/// +///
+/// +/// **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 DiscoveredExtensions { + /// Discovered user and enabled installed-plugin extensions from persisted Copilot home state + pub extensions: Vec, + /// Effective extension loading mode. Defaults to load_and_augment when unset. + pub mode: DiscoveredExtensionMode, +} + +/// Source-qualified extension identifiers to persistently disable for future sessions. +/// +///
+/// +/// **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 DiscoveredExtensionsDisableRequest { + /// Source-qualified user or plugin extension IDs to disable + pub ids: Vec, +} + +/// Source-qualified extension identifiers to persistently enable for future sessions. +/// +///
+/// +/// **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 DiscoveredExtensionsEnableRequest { + /// Source-qualified user or plugin extension IDs to enable + pub ids: Vec, +} + /// MCP server discovered by `mcp.discover`, with config source, optional plugin source, transport type, and enabled state. /// ///
@@ -3435,13 +3551,19 @@ pub struct EnvAuthInfo { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct EventLogReadRequest { + /// Optional non-empty list of subagent identifiers. When provided, only events owned by one of these agents are returned; ownership recognizes the event envelope's agentId plus legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over agentScope. + #[serde(skip_serializing_if = "Option::is_none")] + pub agent_ids: Option>, /// Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers. #[serde(skip_serializing_if = "Option::is_none")] pub agent_scope: Option, /// Opaque cursor returned by a previous read. Omit on the first call to start from the beginning of the session's persisted history. #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, - /// When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). + /// Direction to page through the session's persisted event history. 'forward' (default) pages from the cursor toward newer events (or from the start of history when no cursor is given). 'backward' enables tail-first reads: with no cursor it returns the NEWEST `max` events, and the returned cursor pages toward OLDER events on subsequent backward reads. Events within a returned batch are always in chronological (oldest-to-newest) order, even for a backward read. Backward reads cover PERSISTED history only; ephemeral events are never returned by a backward read. `direction` selects the INITIAL read only: the returned cursor is self-describing, so a continuation read pages in the cursor's own direction regardless of the `direction` passed alongside it — a forward cursor always pages forward and a backward cursor always pages backward. Pass the direction that matches the cursor to avoid confusion. + #[serde(skip_serializing_if = "Option::is_none")] + pub direction: Option, + /// When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). Ignored by backward reads, which always cover persisted history only. #[serde(skip_serializing_if = "Option::is_none")] pub include_ephemeral: Option, /// Maximum number of events to return in this batch (1–1000, default 200). @@ -3450,7 +3572,7 @@ pub struct EventLogReadRequest { /// Either '*' to receive all event types, or a non-empty list of event types to receive #[serde(skip_serializing_if = "Option::is_none")] pub types: Option, - /// Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). + /// Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). This applies to forward reads only: a backward read always returns immediately and ignores `waitMs`, because backward paging covers persisted history only while new events append at the tail (the opposite end from a backward page), so no blocking or ephemeral delivery can occur. #[serde(skip_serializing_if = "Option::is_none")] pub wait_ms: Option, } @@ -3496,13 +3618,13 @@ pub struct EventLogTailResult { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct EventsReadResult { - /// Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. + /// Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. For a backward read this cursor pages toward OLDER events; keep passing `direction: backward` with it (the cursor is also self-describing, so backward paging continues correctly). pub cursor: String, - /// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. + /// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history. For a forward read the fallback starts from the beginning of the remaining history; for a backward read it falls back to the tail (the newest window). Because the fallback page is a fresh boundary snapshot rather than a continuation of the requested cursor, it may overlap events the consumer has already rendered — a backward fallback to the tail in particular can repeat the newest window. On 'expired', consumers should reset or rebase their local pagination state (or deduplicate by event id) before continuing from the returned cursor rather than blindly appending/prepending the fallback page. pub cursor_status: EventsCursorStatus, - /// Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. + /// Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window contains persisted events only, still in chronological (oldest-to-newest) append order. pub events: Vec, - /// True when the read returned `max` events and more events are available immediately. When false, the next read with a non-zero `waitMs` will block until a new event arrives or the wait expires. + /// True when more events are available in the read's direction. For a forward read, true means the batch returned `max` events and more are available immediately. For a backward read, true means older persisted events remain before the returned window. pub has_more: bool, } @@ -6663,6 +6785,25 @@ pub struct McpListToolsResult { pub tools: Vec, } +/// Identifies the MCP server whose persisted OAuth credentials were updated. +/// +///
+/// +/// **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 McpOauthAuthenticationStateChangedRequest { + /// Whether the target session must mint a session-scoped access token instead of reusing a shared access token persisted by another session. + #[serde(skip_serializing_if = "Option::is_none")] + pub refresh_session_token: Option, + /// Name of the MCP server whose OAuth credentials were updated. Omit only when the host cannot identify the server. + #[serde(skip_serializing_if = "Option::is_none")] + pub server_name: Option, +} + #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct McpOauthPendingRequestResponseToken { @@ -8631,6 +8772,24 @@ pub struct PermissionDecisionApproveForSessionApprovalExtensionManagement { pub operation: Option, } +/// Session-scoped factory approval, optionally narrowed by approval key. +/// +///
+/// +/// **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 PermissionDecisionApproveForSessionApprovalFactory { + /// Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + #[serde(skip_serializing_if = "Option::is_none")] + pub approval_key: Option, + /// Approval covering factory operations. + pub kind: PermissionDecisionApproveForSessionApprovalFactoryKind, +} + /// Session-scoped approval details for an extension's permission-gated capability access, keyed by extension name. /// ///
@@ -8802,6 +8961,24 @@ pub struct PermissionDecisionApproveForLocationApprovalExtensionManagement { pub operation: Option, } +/// Location-scoped factory approval, optionally narrowed by approval key. +/// +///
+/// +/// **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 PermissionDecisionApproveForLocationApprovalFactory { + /// Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + #[serde(skip_serializing_if = "Option::is_none")] + pub approval_key: Option, + /// Approval covering factory operations. + pub kind: PermissionDecisionApproveForLocationApprovalFactoryKind, +} + /// Location-scoped approval details for an extension's permission-gated capability access, keyed by extension name. /// ///
@@ -9200,6 +9377,24 @@ pub struct PermissionsLocationsAddToolApprovalDetailsExtensionManagement { pub operation: Option, } +/// Location-persisted factory approval, optionally narrowed by approval key. +/// +///
+/// +/// **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 PermissionsLocationsAddToolApprovalDetailsFactory { + /// Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + #[serde(skip_serializing_if = "Option::is_none")] + pub approval_key: Option, + /// Approval covering factory operations. + pub kind: PermissionsLocationsAddToolApprovalDetailsFactoryKind, +} + /// Location-persisted tool approval details for an extension's permission-gated capability access, keyed by extension name. /// ///
@@ -9802,7 +9997,7 @@ pub struct PermissionsSetAllowAllRequest { /// Allow-all mode to apply. `on` enables full allow-all; `auto` enables advisory LLM auto-approval; `off` disables both. #[serde(skip_serializing_if = "Option::is_none")] pub mode: Option, - /// Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session's active model is used. + /// Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session resolves a default judge model: `gpt-5.5` for CAPI sessions and the session's active model for BYOK sessions. #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. @@ -12107,6 +12302,9 @@ pub struct SandboxConfig { /// Whether to auto-add the current working directory to readwritePaths. Default: true. #[serde(skip_serializing_if = "Option::is_none")] pub add_current_working_directory: Option, + /// Whether to auto-grant read access to common developer-tool caches, registries, and toolchains in their default home locations (cargo, go, npm, Maven, and more), plus read-write access to (and, on Unix, up-front creation of) the scratch caches builds write on every run (go-build, ccache, sccache, Gradle caches, Cargo lock/tracker files), so builds work without exporting CARGO_HOME/GOPATH/etc. Default: true (enabled by default; set to false to opt out). + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_dev_tool_caches: Option, /// Whether sandboxing is enabled for the session. pub enabled: bool, /// Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the OS keyring the sandbox blocks. Default: false (opt-in). @@ -17991,6 +18189,23 @@ pub struct McpConfigListResult { pub servers: HashMap, } +/// Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included. +/// +///
+/// +/// **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 ExtensionsDiscoverResult { + /// Discovered user and enabled installed-plugin extensions from persisted Copilot home state + pub extensions: Vec, + /// Effective extension loading mode. Defaults to load_and_augment when unset. + pub mode: DiscoveredExtensionMode, +} + /// Plugins installed in user/global state. /// ///
@@ -22616,13 +22831,13 @@ pub struct SessionQueueProcessParams { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionEventLogReadResult { - /// Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. + /// Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. For a backward read this cursor pages toward OLDER events; keep passing `direction: backward` with it (the cursor is also self-describing, so backward paging continues correctly). pub cursor: String, - /// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. + /// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history. For a forward read the fallback starts from the beginning of the remaining history; for a backward read it falls back to the tail (the newest window). Because the fallback page is a fresh boundary snapshot rather than a continuation of the requested cursor, it may overlap events the consumer has already rendered — a backward fallback to the tail in particular can repeat the newest window. On 'expired', consumers should reset or rebase their local pagination state (or deduplicate by event id) before continuing from the returned cursor rather than blindly appending/prepending the fallback page. pub cursor_status: EventsCursorStatus, - /// Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. + /// Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window contains persisted events only, still in chronological (oldest-to-newest) append order. pub events: Vec, - /// True when the read returned `max` events and more events are available immediately. When false, the next read with a non-zero `waitMs` will block until a new event arrives or the wait expires. + /// True when more events are available in the read's direction. For a forward read, true means the batch returned `max` events and more are available immediately. For a backward read, true means older persisted events remain before the returned window. pub has_more: bool, } @@ -23955,6 +24170,53 @@ pub enum DebugCollectLogsResultKind { Unknown, } +/// Persisted extension discovery source +/// +///
+/// +/// **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 DiscoveredExtensionSource { + /// Extension discovered from the user's extensions directory. + #[serde(rename = "user")] + User, + /// Extension contributed by an installed plugin. + #[serde(rename = "plugin")] + Plugin, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Effective extension loading and agent-management mode +/// +///
+/// +/// **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 DiscoveredExtensionMode { + /// Extensions are not loaded. + #[serde(rename = "disabled")] + Disabled, + /// Extensions are loaded, but the agent cannot create, reload, or manage them. + #[serde(rename = "load_only")] + LoadOnly, + /// Extensions are loaded and the agent can create, reload, and manage them. + #[serde(rename = "load_and_augment")] + LoadAndAugment, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Server transport type: stdio, http, sse (deprecated), or memory /// ///
@@ -24013,7 +24275,29 @@ pub enum EventsAgentScope { Unknown, } -/// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. +/// Direction to page through the session's persisted event history. 'forward' pages from the cursor toward newer events; 'backward' returns the newest window first (tail-first) and pages toward older events. Events within a returned batch are always chronological (oldest-to-newest), even for a backward read. +/// +///
+/// +/// **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 EventsReadDirection { + /// Page from the cursor toward newer events (default). + #[serde(rename = "forward")] + Forward, + /// Tail-first: return the newest events and page toward older events. + #[serde(rename = "backward")] + Backward, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history (the beginning for a forward read, the tail for a backward read). The fallback page is a fresh boundary snapshot, not a continuation of the requested cursor, so it may overlap already-rendered events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate by event id) before continuing from the returned cursor. /// ///
/// @@ -25601,6 +25885,14 @@ pub enum PermissionDecisionApproveForSessionApprovalExtensionManagementKind { ExtensionManagement, } +/// Approval covering factory operations. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum PermissionDecisionApproveForSessionApprovalFactoryKind { + #[serde(rename = "factory")] + #[default] + Factory, +} + /// Approval covering an extension's request to access a permission-gated capability. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum PermissionDecisionApproveForSessionApprovalExtensionPermissionAccessKind { @@ -25628,6 +25920,7 @@ pub enum PermissionDecisionApproveForSessionApproval { Memory(PermissionDecisionApproveForSessionApprovalMemory), CustomTool(PermissionDecisionApproveForSessionApprovalCustomTool), ExtensionManagement(PermissionDecisionApproveForSessionApprovalExtensionManagement), + Factory(PermissionDecisionApproveForSessionApprovalFactory), ExtensionPermissionAccess(PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess), } @@ -25703,6 +25996,14 @@ pub enum PermissionDecisionApproveForLocationApprovalExtensionManagementKind { ExtensionManagement, } +/// Approval covering factory operations. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum PermissionDecisionApproveForLocationApprovalFactoryKind { + #[serde(rename = "factory")] + #[default] + Factory, +} + /// Approval covering an extension's request to access a permission-gated capability. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum PermissionDecisionApproveForLocationApprovalExtensionPermissionAccessKind { @@ -25730,6 +26031,7 @@ pub enum PermissionDecisionApproveForLocationApproval { Memory(PermissionDecisionApproveForLocationApprovalMemory), CustomTool(PermissionDecisionApproveForLocationApprovalCustomTool), ExtensionManagement(PermissionDecisionApproveForLocationApprovalExtensionManagement), + Factory(PermissionDecisionApproveForLocationApprovalFactory), ExtensionPermissionAccess( PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess, ), @@ -25933,6 +26235,14 @@ pub enum PermissionsLocationsAddToolApprovalDetailsExtensionManagementKind { ExtensionManagement, } +/// Approval covering factory operations. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum PermissionsLocationsAddToolApprovalDetailsFactoryKind { + #[serde(rename = "factory")] + #[default] + Factory, +} + /// Approval covering an extension's request to access a permission-gated capability. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccessKind { @@ -25960,6 +26270,7 @@ pub enum PermissionsLocationsAddToolApprovalDetails { Memory(PermissionsLocationsAddToolApprovalDetailsMemory), CustomTool(PermissionsLocationsAddToolApprovalDetailsCustomTool), ExtensionManagement(PermissionsLocationsAddToolApprovalDetailsExtensionManagement), + Factory(PermissionsLocationsAddToolApprovalDetailsFactory), ExtensionPermissionAccess(PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess), } diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index e9bbef1d1a..3749b89473 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -50,6 +50,13 @@ impl<'a> ClientRpc<'a> { } } + /// `extensions.*` sub-namespace. + pub fn extensions(&self) -> ClientRpcExtensions<'a> { + ClientRpcExtensions { + client: self.client, + } + } + /// `instructions.*` sub-namespace. pub fn instructions(&self) -> ClientRpcInstructions<'a> { ClientRpcInstructions { @@ -496,6 +503,86 @@ impl<'a> ClientRpcCommands<'a> { } } +/// `extensions.*` RPCs. +#[derive(Clone, Copy)] +pub struct ClientRpcExtensions<'a> { + pub(crate) client: &'a Client, +} + +impl<'a> ClientRpcExtensions<'a> { + /// Discovers user and enabled installed-plugin extensions from persisted Copilot home state, including enablement preferences. Launch-scoped additional plugins are not included. + /// + /// Wire method: `extensions.discover`. + /// + /// # Returns + /// + /// Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included. + /// + ///
+ /// + /// **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 discover(&self) -> Result { + let wire_params = serde_json::json!({}); + let _value = self + .client + .call(rpc_methods::EXTENSIONS_DISCOVER, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Persistently enables extension IDs for future sessions. Active sessions are unchanged; use session.extensions.enable to update them. + /// + /// Wire method: `extensions.enable`. + /// + /// # Parameters + /// + /// * `params` - Source-qualified extension identifiers to persistently enable for future sessions. + /// + ///
+ /// + /// **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 enable(&self, params: DiscoveredExtensionsEnableRequest) -> Result<(), Error> { + let wire_params = serde_json::to_value(params)?; + let _value = self + .client + .call(rpc_methods::EXTENSIONS_ENABLE, Some(wire_params)) + .await?; + Ok(()) + } + + /// Persistently disables extension IDs for future sessions. Active sessions are unchanged; use session.extensions.disable to update them. + /// + /// Wire method: `extensions.disable`. + /// + /// # Parameters + /// + /// * `params` - Source-qualified extension identifiers to persistently disable for future sessions. + /// + ///
+ /// + /// **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 disable(&self, params: DiscoveredExtensionsDisableRequest) -> Result<(), Error> { + let wire_params = serde_json::to_value(params)?; + let _value = self + .client + .call(rpc_methods::EXTENSIONS_DISABLE, Some(wire_params)) + .await?; + Ok(()) + } +} + /// `instructions.*` RPCs. #[derive(Clone, Copy)] pub struct ClientRpcInstructions<'a> { @@ -3298,6 +3385,32 @@ impl<'a> SessionRpcAgent<'a> { Ok(serde_json::from_value(_value)?) } + /// Sets an in-memory authored prompt override for an available agent. For built-in agents, this replaces only the static base prompt while preserving runtime-owned dynamic prompt composition and behavior. The special `general-purpose` agent is not overrideable. Overrides are not persisted; resumed and forked sessions start without them, so the host must re-apply them. + /// + /// Wire method: `session.agent.setPrompt`. + /// + /// # Parameters + /// + /// * `params` - An in-memory authored prompt override for an available agent. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn set_prompt(&self, params: AgentSetPromptRequest) -> Result<(), Error> { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_AGENT_SETPROMPT, Some(wire_params)) + .await?; + Ok(()) + } + /// Gets the currently selected custom agent for the session. /// /// Wire method: `session.agent.getCurrent`. @@ -3962,7 +4075,7 @@ pub struct SessionRpcEventLog<'a> { } impl<'a> SessionRpcEventLog<'a> { - /// Reads a batch of session events from a cursor, optionally waiting for new events. + /// Reads a batch of session events from a cursor, optionally waiting for new events. Supports tail-first reads via `direction: backward`. /// /// Wire method: `session.eventLog.read`. /// @@ -5943,6 +6056,38 @@ impl<'a> SessionRpcMcpOauth<'a> { Ok(serde_json::from_value(_value)?) } + /// Notifies the session that MCP OAuth authentication succeeded and updated credentials were persisted, so cached tool definitions can be refreshed. + /// + /// Wire method: `session.mcp.oauth.authenticationStateChanged`. + /// + /// # Parameters + /// + /// * `params` - Identifies the MCP server whose persisted OAuth credentials were updated. + /// + ///
+ /// + /// **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 authentication_state_changed( + &self, + params: McpOauthAuthenticationStateChangedRequest, + ) -> Result<(), Error> { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_MCP_OAUTH_AUTHENTICATIONSTATECHANGED, + Some(wire_params), + ) + .await?; + Ok(()) + } + /// Starts OAuth authentication for a remote MCP server. /// /// Wire method: `session.mcp.oauth.login`. diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index 7bcba377aa..240eb81059 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -687,6 +687,24 @@ pub struct WorkingDirectoryContext { pub repository_host: Option, } +/// Per-session configuration for the built-in GitHub MCP server +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct GitHubMcpToolConfig { + /// Additional GitHub MCP tools requested by the session + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_tools: Option>, + /// Additional GitHub MCP toolsets requested by the session + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_toolsets: Option>, + /// Whether to use the read-write endpoint and request all toolsets + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_all_tools: Option, + /// Whether to request the GitHub MCP insiders build + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_insiders_mode: Option, +} + /// Optional session limits. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -714,6 +732,9 @@ pub struct SessionStartData { /// When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id. #[serde(skip_serializing_if = "Option::is_none")] pub detached_from_spawning_parent_session_id: Option, + /// Per-session GitHub MCP override persisted for cold resume + #[serde(skip_serializing_if = "Option::is_none")] + pub github_mcp_tool_config: Option, /// Identifier of the software producing the events (e.g., "copilot-agent") pub producer: String, /// Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") @@ -1796,6 +1817,12 @@ pub struct AssistantMessageData { /// Provider's completion / response identifier; shared across all chunks of a single API call. Used to group multi-chunk assistant utterances. #[serde(skip_serializing_if = "Option::is_none")] pub api_call_id: Option, + /// Total messages the model call's response was split into, one per reasoning boundary. Absent for a single-message response; the last chunk is the one where chunkIndex is chunkCount - 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub chunk_count: Option, + /// Zero-based position of this message within its model call's response. Absent when the response was not split into chunks. + #[serde(skip_serializing_if = "Option::is_none")] + pub chunk_index: Option, /// Provider-agnostic citations linking spans of this message's content to the sources that support them. Experimental; only populated when citation emission is enabled. /// ///
@@ -3264,6 +3291,60 @@ pub struct PermissionRequestExtensionManagement { pub tool_call_id: Option, } +/// A declared phase shown in a factory permission prompt. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FactoryPermissionPhase { + /// Optional phase detail + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Phase title + pub title: String, +} + +/// Factory run or authoring permission request +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PermissionRequestFactory { + /// Canonical key used for scoped factory approvals + pub approval_key: String, + /// Whether this factory is eligible for persistent approval + pub can_persist_approval: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub declared_max_ai_credits: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub declared_max_concurrent_subagents: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub declared_max_total_subagents: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub declared_timeout_seconds: Option, + /// Factory description + pub description: String, + /// Permission kind discriminator + pub kind: PermissionRequestFactoryKind, + /// Effective AI-credit limit; omitted means unlimited + #[serde(skip_serializing_if = "Option::is_none")] + pub max_ai_credits: Option, + /// Effective concurrent-subagent limit; omitted means unlimited + #[serde(skip_serializing_if = "Option::is_none")] + pub max_concurrent_subagents: Option, + /// Effective total-subagent limit; omitted means unlimited + #[serde(skip_serializing_if = "Option::is_none")] + pub max_total_subagents: Option, + /// Factory name + pub name: String, + /// Factory operation, either run or author + pub operation: FactoryPermissionOperation, + /// Declared factory phases + pub phases: Vec, + /// Effective active-time limit in seconds; omitted means unlimited + #[serde(skip_serializing_if = "Option::is_none")] + pub timeout_seconds: Option, + /// Tool call ID that triggered this permission request + #[serde(skip_serializing_if = "Option::is_none")] + pub tool_call_id: Option, +} + /// Extension permission access request #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -3617,6 +3698,62 @@ pub struct PermissionPromptRequestExtensionManagement { pub tool_call_id: Option, } +/// Factory run or authoring permission prompt +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PermissionPromptRequestFactory { + /// Canonical key used for scoped factory approvals + pub approval_key: String, + /// Auto-approval judge information for this request; present only when auto mode is enabled. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(skip_serializing_if = "Option::is_none")] + pub auto_approval: Option, + /// Whether this factory is eligible for persistent approval + pub can_persist_approval: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub declared_max_ai_credits: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub declared_max_concurrent_subagents: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub declared_max_total_subagents: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub declared_timeout_seconds: Option, + /// Factory description + pub description: String, + /// Prompt kind discriminator + pub kind: PermissionPromptRequestFactoryKind, + /// Whether managed policy requires a human response and forbids host auto-approval + #[serde(skip_serializing_if = "Option::is_none")] + pub managed_approval_required: Option, + /// Effective AI-credit limit; omitted means unlimited + #[serde(skip_serializing_if = "Option::is_none")] + pub max_ai_credits: Option, + /// Effective concurrent-subagent limit; omitted means unlimited + #[serde(skip_serializing_if = "Option::is_none")] + pub max_concurrent_subagents: Option, + /// Effective total-subagent limit; omitted means unlimited + #[serde(skip_serializing_if = "Option::is_none")] + pub max_total_subagents: Option, + /// Factory name + pub name: String, + /// Factory operation, either run or author + pub operation: FactoryPermissionOperation, + /// Declared factory phases + pub phases: Vec, + /// Effective active-time limit in seconds; omitted means unlimited + #[serde(skip_serializing_if = "Option::is_none")] + pub timeout_seconds: Option, + /// Tool call ID that triggered this permission request + #[serde(skip_serializing_if = "Option::is_none")] + pub tool_call_id: Option, +} + /// Extension permission access prompt #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -3736,6 +3873,17 @@ pub struct UserToolSessionApprovalExtensionManagement { pub operation: Option, } +/// Session-scoped factory approval, optionally narrowed by approval key. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct UserToolSessionApprovalFactory { + /// Optional factory operation name or canonical approval key + #[serde(skip_serializing_if = "Option::is_none")] + pub approval_key: Option, + /// Factory approval kind + pub kind: UserToolSessionApprovalFactoryKind, +} + /// Session-scoped tool-approval rule for an extension's permission-gated capability access, keyed by extension name. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -5576,6 +5724,29 @@ pub enum PermissionRequestExtensionManagementKind { ExtensionManagement, } +/// Permission kind discriminator +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum PermissionRequestFactoryKind { + #[serde(rename = "factory")] + #[default] + Factory, +} + +/// Operation gated by a factory permission request. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FactoryPermissionOperation { + /// Running a registered factory, which spends subagents, active time, and AI credits under the approved limits. + #[serde(rename = "run")] + Run, + /// Authoring a factory, which writes JavaScript into a session-scoped extension and loads it. + #[serde(rename = "author")] + Author, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Permission kind discriminator #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum PermissionRequestExtensionPermissionAccessKind { @@ -5597,6 +5768,7 @@ pub enum PermissionRequest { CustomTool(PermissionRequestCustomTool), Hook(PermissionRequestHook), ExtensionManagement(PermissionRequestExtensionManagement), + Factory(PermissionRequestFactory), ExtensionPermissionAccess(PermissionRequestExtensionPermissionAccess), } @@ -5757,6 +5929,14 @@ pub enum PermissionPromptRequestExtensionManagementKind { ExtensionManagement, } +/// Prompt kind discriminator +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum PermissionPromptRequestFactoryKind { + #[serde(rename = "factory")] + #[default] + Factory, +} + /// Prompt kind discriminator #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum PermissionPromptRequestExtensionPermissionAccessKind { @@ -5779,6 +5959,7 @@ pub enum PermissionPromptRequest { Path(PermissionPromptRequestPath), Hook(PermissionPromptRequestHook), ExtensionManagement(PermissionPromptRequestExtensionManagement), + Factory(PermissionPromptRequestFactory), ExtensionPermissionAccess(PermissionPromptRequestExtensionPermissionAccess), } @@ -5846,6 +6027,14 @@ pub enum UserToolSessionApprovalExtensionManagementKind { ExtensionManagement, } +/// Factory approval kind +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum UserToolSessionApprovalFactoryKind { + #[serde(rename = "factory")] + #[default] + Factory, +} + /// Extension permission access approval kind #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum UserToolSessionApprovalExtensionPermissionAccessKind { @@ -5865,6 +6054,7 @@ pub enum UserToolSessionApproval { Memory(UserToolSessionApprovalMemory), CustomTool(UserToolSessionApprovalCustomTool), ExtensionManagement(UserToolSessionApprovalExtensionManagement), + Factory(UserToolSessionApprovalFactory), ExtensionPermissionAccess(UserToolSessionApprovalExtensionPermissionAccess), } diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index 76b19f6adf..4cfbf7b854 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.77", + "@github/copilot": "^1.0.78-2", "@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.77", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.77.tgz", - "integrity": "sha512-nkTtDPKvsClAByPPqnD/57vK7YIBK1dgiv7aVc9uO3rxKCyqiqYaBqwi8pMzesvGP3yl+//+iMzaBXNWEcZVWQ==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.78-2.tgz", + "integrity": "sha512-9MrssRFvYWFPnePZ8BFgMGv735awQ19KrKMZYr14u7Kp9j8l3jyUiSMKa5oCJD5V0mR52+1YE2jy4TCfF/mqlA==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { @@ -513,20 +513,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.77", - "@github/copilot-darwin-x64": "1.0.77", - "@github/copilot-linux-arm64": "1.0.77", - "@github/copilot-linux-x64": "1.0.77", - "@github/copilot-linuxmusl-arm64": "1.0.77", - "@github/copilot-linuxmusl-x64": "1.0.77", - "@github/copilot-win32-arm64": "1.0.77", - "@github/copilot-win32-x64": "1.0.77" + "@github/copilot-darwin-arm64": "1.0.78-2", + "@github/copilot-darwin-x64": "1.0.78-2", + "@github/copilot-linux-arm64": "1.0.78-2", + "@github/copilot-linux-x64": "1.0.78-2", + "@github/copilot-linuxmusl-arm64": "1.0.78-2", + "@github/copilot-linuxmusl-x64": "1.0.78-2", + "@github/copilot-win32-arm64": "1.0.78-2", + "@github/copilot-win32-x64": "1.0.78-2" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.77.tgz", - "integrity": "sha512-sCWSH5+Flm/OxFe7dzsBfyj7ADBkzkR54Sz5NGw7dtcVVEOnVUkZLjEtNmZ1t5QRD4Sf1+g/DiwgJEbsR9xR1w==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.78-2.tgz", + "integrity": "sha512-tZ+53pbjdFzyIJHBhRhjbKTZZjBT2gJ2RF+MRqJKE9uv774rNxtWb3a9T3Yfu78smjusKjFf0dfJp2rabhxAKQ==", "cpu": [ "arm64" ], @@ -541,9 +541,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.77.tgz", - "integrity": "sha512-ReNlB+g+OBiqHwmY5leJBIyvHZQcjyWL/OY8aVimHyESn2ToPKP3eUNTzSUJvvbPM6+0LXwEpijLedkRd2Cn1g==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.78-2.tgz", + "integrity": "sha512-DpCSlK8u+k5bHeLpbYjJpDaIMlPulpDoTi5zJOcmKIBcxBUx5/RjPogq6DjumNSyLC09Fm9ddMPQgitvMxhDUw==", "cpu": [ "x64" ], @@ -558,9 +558,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.77.tgz", - "integrity": "sha512-A8j/WBPFvV5WfLbgnIIQLUVuFRAR7kLyc5WgId6XLCu1ARbkRM7353zz9mEXXwjc6LqotHVg80ooANJjNtmSPg==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.78-2.tgz", + "integrity": "sha512-ERhA6MoAL3yYRdYXN6IielJ8MJheSq7AnchCG92LWq7bRuFwmdQf0mQZzhZd/W6xHsistAQ9dByeVH/UAFB5mA==", "cpu": [ "arm64" ], @@ -575,9 +575,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.77.tgz", - "integrity": "sha512-2eefKkdUnQ1Y8oxyRyexHBXVpuSmrfEM8XJauquVjPc0JqF5nab9axwpFPzrRSF1GB+25F9tUK2sDQRyp08wag==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.78-2.tgz", + "integrity": "sha512-lbHfY2NrgPxhpJTnvbMWmtxDwSwkgIb9wqJGCQ50ofeX4RuONmBb1960rtmkECtGyN6zDUzIatX7MNBRRBFIpA==", "cpu": [ "x64" ], @@ -592,9 +592,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.77.tgz", - "integrity": "sha512-YtltOZQp8plytSKSGTWWKbOx3QD8iZH04sLtKTrYs6nu5UalIgFPoMkwamy1gh7h5EBkeVxD2s3epVrlvP4X4w==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.78-2.tgz", + "integrity": "sha512-xXHza3RpX/RbTY7/DDK8Bt7kDU0pDEn1Nf1T08X9o06FhUjTeh7wTMUh/Ogfq9ocG5K4v8fuk1ONv63viQVeIA==", "cpu": [ "arm64" ], @@ -609,9 +609,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.77.tgz", - "integrity": "sha512-owINwPgHU/ZZBwFhVPgkgGjLkF6e4QbdofADvKMdKJWV2+7oWjXUIlPA4/PwraD2Gkuu583l7m0XLL27TN8oUA==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.78-2.tgz", + "integrity": "sha512-ihWyNGlyJHs1iAZsG+BLYzRxpKzRX+OV7E5HVIlAAxL6fxw2ymkgrfSAfx5FR8D2ZXWloY14ZKttFUbizAyJkg==", "cpu": [ "x64" ], @@ -626,9 +626,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.77.tgz", - "integrity": "sha512-l5oQaMLCRup0nmmpbqOAYEAJ5YWgNlaoO0psNaKDzvTbdzEJRZqib2t7+p3bgoDpK7SB/m8m1uxFC4XT3hlprg==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.78-2.tgz", + "integrity": "sha512-5rzE6ysT8ZMCZ8zhcgtExaaZ05UFo6KOCQZNYi+YGx8xpObR92vruZKKhBZH2vE51DM47dT1JQ9o0jS6eP7/dw==", "cpu": [ "arm64" ], @@ -643,9 +643,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.77", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.77.tgz", - "integrity": "sha512-8Mo9y3/8CVU2w35WqwSiRMTGH1kKHR3URPSJYF4J4OG8L7NOEy2fafXR9Tuq3H21Srg3OzFkl/A+Taunqz9KcA==", + "version": "1.0.78-2", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.78-2.tgz", + "integrity": "sha512-10bTnLdDXiLcjWTMAoEmSuqkmf8Q+no9B5pL3u5ks3WiFLGx/r9oDo8CeyYV965CEsfoRkBIxWaLUTMra1tlxQ==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index 07b82a4d61..df0a1b9683 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.77", + "@github/copilot": "^1.0.78-2", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", From c7c63abd369ec444be2c7d46ea6b21ecbc970e4e Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Sat, 1 Aug 2026 23:48:20 -0400 Subject: [PATCH 2/2] Fix CI breaks from the CLI 1.0.78-2 schema update The dependency bump regenerated types but left hand-written code and tests behind, breaking every language job. Five independent fixes: - Go: the CLI added a `factory` permission-request kind, so `PermissionRequestFactory` needed a `RequiresManagedApproval()` impl. Added it, and registered the new variant in the codegen shim (`PERMISSION_REQUEST_DEFINITION_NAMES`) so Go/Python/Rust all carry the `managedApprovalRequired` field consistently. - .NET: `session.start` gained `githubMcpToolConfig`, so codegen emitted a `GitHubMcpToolConfig` class colliding with the hand-written one in `dotnet/src/Types.cs` (15 CS0260/CS0102 errors). Taught the C# generator to skip nested classes whose names already exist hand-written under `dotnet/src`, mirroring the existing behavior in the Go generator. The `[JsonSerializable]` registrations are preserved. - Java: `SessionEventHandlingTest` calls generated record constructors positionally; `SessionStartEventData` gained `githubMcpToolConfig` and `AssistantMessageEventData` gained `chunkIndex`/`chunkCount`. Padded the three call sites. This also unblocks CodeQL's java-kotlin analysis. - Rust: `EventLogReadRequest` gained `agent_ids` and `direction`; added them to the three exhaustive struct literals in `tests/e2e/rpc_event_log.rs`. - Node.js: the CLI can now answer `session.factory.run`/`resume` before the run settles, so the e2e test saw `status: "running"`. `SessionFactoryApi` documents these as resolving with a terminal envelope, so both now route through a `settleFactoryRun` helper that waits for terminal state when the initial envelope is non-terminal. Correct under both old and new CLI behavior. Validated locally: go build/vet, dotnet build (src + test), mvn test-compile + spotless:check + SessionEventHandlingTest (29/29), cargo check --tests + cargo fmt --check, npm run typecheck/lint, and the full Node unit suite (363 tests). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 820d6939-ba01-4044-8ee3-c5f5b4d3f443 --- dotnet/src/Generated/SessionEvents.cs | 25 -------- go/rpc/permission_request_managed_approval.go | 6 ++ go/rpc/zsession_events.go | 2 + .../copilot/SessionEventHandlingTest.java | 6 +- nodejs/src/session.ts | 18 +++++- python/copilot/generated/session_events.py | 5 ++ rust/src/generated/session_events.rs | 3 + rust/tests/e2e/rpc_event_log.rs | 6 ++ scripts/codegen/csharp.ts | 60 ++++++++++++++++++- scripts/codegen/utils.ts | 1 + 10 files changed, 99 insertions(+), 33 deletions(-) diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index a9899b9e4f..0f3b53f482 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -4731,31 +4731,6 @@ public sealed partial class WorkingDirectoryContext public string? RepositoryHost { get; set; } } -/// Per-session configuration for the built-in GitHub MCP server. -/// Nested data type for GitHubMcpToolConfig. -public sealed partial class GitHubMcpToolConfig -{ - /// Additional GitHub MCP tools requested by the session. - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonPropertyName("additionalTools")] - public string[]? AdditionalTools { get; set; } - - /// Additional GitHub MCP toolsets requested by the session. - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonPropertyName("additionalToolsets")] - public string[]? AdditionalToolsets { get; set; } - - /// Whether to use the read-write endpoint and request all toolsets. - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonPropertyName("enableAllTools")] - public bool? EnableAllTools { get; set; } - - /// Whether to request the GitHub MCP insiders build. - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonPropertyName("enableInsidersMode")] - public bool? EnableInsidersMode { get; set; } -} - /// Optional session limits. /// Nested data type for SessionLimitsConfig. public sealed partial class SessionLimitsConfig diff --git a/go/rpc/permission_request_managed_approval.go b/go/rpc/permission_request_managed_approval.go index 816181f204..0206268931 100644 --- a/go/rpc/permission_request_managed_approval.go +++ b/go/rpc/permission_request_managed_approval.go @@ -26,6 +26,12 @@ func (r PermissionRequestExtensionPermissionAccess) RequiresManagedApproval() bo return managedApprovalRequired(r.ManagedApprovalRequired) } +// RequiresManagedApproval reports whether managed policy requires an explicit +// human decision for this request. +func (r PermissionRequestFactory) RequiresManagedApproval() bool { + return managedApprovalRequired(r.ManagedApprovalRequired) +} + // RequiresManagedApproval reports whether managed policy requires an explicit // human decision for this request. func (r PermissionRequestHook) RequiresManagedApproval() bool { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 4551f98537..6855956b99 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -3061,6 +3061,8 @@ type PermissionRequestFactory struct { DeclaredTimeoutSeconds *float64 `json:"declaredTimeoutSeconds,omitempty"` // Factory description Description string `json:"description"` + // When true, managed policy requires an explicit user decision and automatic approval must be bypassed. + ManagedApprovalRequired *bool `json:"managedApprovalRequired,omitempty"` // Effective AI-credit limit; omitted means unlimited MaxAiCredits *float64 `json:"maxAiCredits,omitempty"` // Effective concurrent-subagent limit; omitted means unlimited diff --git a/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java b/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java index 6363e90caf..bd38d4962e 100644 --- a/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java +++ b/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java @@ -180,7 +180,7 @@ void testHandlerReceivesCorrectEventData() { SessionStartEvent startEvent = createSessionStartEvent(); startEvent.setData(new SessionStartEvent.SessionStartEventData("my-session-123", null, null, null, null, null, - null, null, null, null, null, null, null, null, null)); + null, null, null, null, null, null, null, null, null, null)); dispatchEvent(startEvent); AssistantMessageEvent msgEvent = createAssistantMessageEvent("Test content"); @@ -857,7 +857,7 @@ private SessionStartEvent createSessionStartEvent() { private SessionStartEvent createSessionStartEvent(String sessionId) { var event = new SessionStartEvent(); var data = new SessionStartEvent.SessionStartEventData(sessionId, 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; } @@ -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, null, null, null, null, null, null, null); event.setData(data); return event; } diff --git a/nodejs/src/session.ts b/nodejs/src/session.ts index 0d1d90fbbb..e0a3df0e6c 100644 --- a/nodejs/src/session.ts +++ b/nodejs/src/session.ts @@ -461,7 +461,7 @@ export class CopilotSession { }, }); - return toPublicFactoryRunResult(envelope); + return this.settleFactoryRun(envelope); }) as SessionFactoryApi["run"], resume: (async (runId: string, options?: Parameters[1]) => { let response; @@ -483,7 +483,7 @@ export class CopilotSession { } throw error; } - return toPublicFactoryRunResult(response.run); + return this.settleFactoryRun(response.run); }) as SessionFactoryApi["resume"], getRun: async (runId) => toPublicFactoryRunResult(await this.rpc.factory.getRun({ runId })), waitForRun: (runId, options) => this.waitForFactoryRun(runId, options?.signal), @@ -494,6 +494,20 @@ export class CopilotSession { cancel: async (runId) => toPublicFactoryRunResult(await this.rpc.factory.cancel({ runId })), }; + /** + * Resolve a start/resume envelope into the terminal envelope callers expect. + * + * The CLI may answer `session.factory.run` and `session.factory.resume` + * before the run settles, so a non-terminal envelope is followed by a wait + * on the run's terminal state. + */ + private settleFactoryRun(envelope: WireFactoryRunResult): Promise { + if (isFactoryRunTerminal(envelope.status)) { + return Promise.resolve(toPublicFactoryRunResult(envelope)); + } + return this.waitForFactoryRun(envelope.runId); + } + /** * Resolve when a factory run reaches a terminal status. * diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index 0be503112c..069a2ae840 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -5304,6 +5304,7 @@ class PermissionRequestFactory: max_total_subagents: int | None = None timeout_seconds: float | None = None tool_call_id: str | None = None + managed_approval_required: bool | None = None @staticmethod def from_dict(obj: Any) -> "PermissionRequestFactory": @@ -5323,6 +5324,7 @@ def from_dict(obj: Any) -> "PermissionRequestFactory": max_total_subagents = from_union([from_none, from_int], obj.get("maxTotalSubagents")) timeout_seconds = from_union([from_none, from_float], obj.get("timeoutSeconds")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) + managed_approval_required = from_union([from_none, from_bool], obj.get("managedApprovalRequired")) return PermissionRequestFactory( approval_key=approval_key, can_persist_approval=can_persist_approval, @@ -5339,6 +5341,7 @@ def from_dict(obj: Any) -> "PermissionRequestFactory": max_total_subagents=max_total_subagents, timeout_seconds=timeout_seconds, tool_call_id=tool_call_id, + managed_approval_required=managed_approval_required, ) def to_dict(self) -> dict: @@ -5368,6 +5371,8 @@ def to_dict(self) -> dict: result["timeoutSeconds"] = from_union([from_none, to_float], self.timeout_seconds) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) + if self.managed_approval_required is not None: + result["managedApprovalRequired"] = from_union([from_none, from_bool], self.managed_approval_required) return result diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index 240eb81059..7ebaa08da6 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -3322,6 +3322,9 @@ pub struct PermissionRequestFactory { pub description: String, /// Permission kind discriminator pub kind: PermissionRequestFactoryKind, + /// When true, managed policy requires an explicit user decision and automatic approval must be bypassed. + #[serde(skip_serializing_if = "Option::is_none")] + pub managed_approval_required: Option, /// Effective AI-credit limit; omitted means unlimited #[serde(skip_serializing_if = "Option::is_none")] pub max_ai_credits: Option, diff --git a/rust/tests/e2e/rpc_event_log.rs b/rust/tests/e2e/rpc_event_log.rs index 18122337ab..84d575ee38 100644 --- a/rust/tests/e2e/rpc_event_log.rs +++ b/rust/tests/e2e/rpc_event_log.rs @@ -43,8 +43,10 @@ async fn should_read_persisted_events_from_beginning() { .rpc() .event_log() .read(EventLogReadRequest { + agent_ids: None, agent_scope: None, cursor: None, + direction: None, include_ephemeral: None, max: Some(100), types: Some(json!("*")), @@ -89,8 +91,10 @@ async fn should_return_tail_cursor_and_read_empty_when_no_new_events() { .rpc() .event_log() .read(EventLogReadRequest { + agent_ids: None, agent_scope: None, cursor: Some(tail.cursor), + direction: None, include_ephemeral: None, max: Some(10), types: Some(json!("*")), @@ -172,8 +176,10 @@ async fn should_longpoll_with_types_filter_for_titlechanged_event() { let tail = session.rpc().event_log().tail().await.expect("tail"); let event_log = session.rpc().event_log(); let read_future = event_log.read(EventLogReadRequest { + agent_ids: None, agent_scope: None, cursor: Some(tail.cursor), + direction: None, include_ephemeral: None, max: Some(10), types: Some(json!(["session.title_changed"])), diff --git a/scripts/codegen/csharp.ts b/scripts/codegen/csharp.ts index 97fcebea67..2d68e68e27 100644 --- a/scripts/codegen/csharp.ts +++ b/scripts/codegen/csharp.ts @@ -70,6 +70,51 @@ const POLYMORPHIC_BASE_PROPERTIES: Record = { PermissionRequest: ["managedApprovalRequired"], }; +/** + * Public type names declared by hand-written C# sources under `dotnet/src` + * (excluding `dotnet/src/Generated`). Generated session-event types share the + * `GitHub.Copilot` namespace with those sources, so a schema definition whose + * name collides with a hand-written declaration must reuse it — emitting a + * second class of the same name fails the build (CS0260/CS0102). + * + * Populated by {@link collectHandWrittenCSharpTypeNames} before generation. + */ +let handWrittenCSharpTypeNames = new Set(); + +/** + * Scan hand-written `.cs` files under `dotnet/src` for top-level public type + * declarations. The `Generated` directory is skipped so this scanner never + * reads (or depends on the output of) its own emit. + */ +async function collectHandWrittenCSharpTypeNames(): Promise> { + const names = new Set(); + const srcDir = path.join(REPO_ROOT, "dotnet", "src"); + const declaration = /^\s*(?:public|internal)\s+(?:(?:abstract|sealed|static|partial|readonly|ref)\s+)*(?:class|record|struct|interface|enum)\s+([A-Za-z_]\w*)/gm; + + const walk = async (dir: string): Promise => { + let entries; + try { + entries = await fs.readdir(dir, { withFileTypes: true }); + } catch { + return; + } + for (const entry of entries) { + const entryPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + if (entry.name === "Generated" || entry.name === "bin" || entry.name === "obj") continue; + await walk(entryPath); + continue; + } + if (!entry.name.endsWith(".cs")) continue; + const content = await fs.readFile(entryPath, "utf-8"); + for (const match of content.matchAll(declaration)) names.add(match[1]); + } + }; + + await walk(srcDir); + return names; +} + /** Apply rename to a generated class name, checking both exact match and prefix replacement for derived types. */ function applyTypeRename(className: string): string { if (TYPE_RENAMES[className]) return TYPE_RENAMES[className]; @@ -1456,8 +1501,13 @@ namespace GitHub.Copilot; lines.push(generateDataClass(variant, knownTypes, nestedClasses, enumOutput), ""); } - // Nested classes - for (const [, code] of nestedClasses) lines.push(code, ""); + // Nested classes. A name already declared by a hand-written source is skipped: + // that declaration is the one the namespace keeps, and the generated property + // simply binds to it. + for (const [name, code] of nestedClasses) { + if (handWrittenCSharpTypeNames.has(name)) continue; + lines.push(code, ""); + } // Enums for (const code of enumOutput) lines.push(code); @@ -1477,6 +1527,7 @@ export async function generateSessionEvents(schemaPath?: string): Promise const resolvedPath = schemaPath ?? (await getSessionEventsSchemaPath()); const schema = cloneSchemaForCodegen((await loadSchemaJson(resolvedPath)) as JSONSchema7); const processed = propagateInternalVisibility(postProcessSchema(schema)); + handWrittenCSharpTypeNames = await collectHandWrittenCSharpTypeNames(); const code = generateSessionEventsCode(processed); const outPath = await writeGeneratedFile("dotnet/src/Generated/SessionEvents.cs", code); console.log(` ✓ ${outPath}`); @@ -2629,6 +2680,7 @@ namespace GitHub.Copilot.Rpc; export async function generateRpc(schemaPath?: string, sessionEventsSchema?: JSONSchema7): Promise { console.log("C#: generating RPC types..."); const resolvedPath = schemaPath ?? (await getApiSchemaPath()); + handWrittenCSharpTypeNames = await collectHandWrittenCSharpTypeNames(); let schema = fixNullableRequiredRefsInApiSchema(cloneSchemaForCodegen((await loadSchemaJson(resolvedPath)) as ApiSchema)); if (sessionEventsSchema) { const sharedDefinitions = findSharedSchemaDefinitions( @@ -2658,7 +2710,9 @@ export async function generateRpc(schemaPath?: string, sessionEventsSchema?: JSO for (const name of reachableDefinitions) { const typeName = typeToClassName(name); const declarationPattern = new RegExp(`\\bpublic\\s+(?:(?:sealed|abstract|partial|readonly)\\s+)*(?:class|struct)\\s+${typeName}\\b`); - if (declarationPattern.test(sessionEventsCode)) { + // A hand-written declaration also lives in `GitHub.Copilot`, so the + // reference resolves even though the generated file skipped it. + if (declarationPattern.test(sessionEventsCode) || handWrittenCSharpTypeNames.has(typeName)) { emittedDefinitions.add(name); } const valueTypeDeclarationPattern = new RegExp(`\\bpublic\\s+(?:(?:readonly)\\s+)?struct\\s+${typeName}\\b`); diff --git a/scripts/codegen/utils.ts b/scripts/codegen/utils.ts index ba4c9442bc..42e78b9a07 100644 --- a/scripts/codegen/utils.ts +++ b/scripts/codegen/utils.ts @@ -457,6 +457,7 @@ const PERMISSION_REQUEST_DEFINITION_NAMES = [ "PermissionRequestCustomTool", "PermissionRequestExtensionManagement", "PermissionRequestExtensionPermissionAccess", + "PermissionRequestFactory", "PermissionRequestHook", "PermissionRequestMcp", "PermissionRequestMemory",