diff --git a/.github/workflows/dotnet-sdk-tests.yml b/.github/workflows/dotnet-sdk-tests.yml index 2a446c97be..0acf807f0a 100644 --- a/.github/workflows/dotnet-sdk-tests.yml +++ b/.github/workflows/dotnet-sdk-tests.yml @@ -104,7 +104,43 @@ jobs: - os: macos-latest transport: default backend: capi - shard: "2b" + shard: "2b1a-permission-provider" + - os: macos-latest + transport: default + backend: capi + shard: "2b1a-rewind" + - os: macos-latest + transport: default + backend: capi + shard: "2b1a-rpc-a" + - os: macos-latest + transport: default + backend: capi + shard: "2b1a-rpc-e" + - os: macos-latest + transport: default + backend: capi + shard: "2b1b-mcp-and-skills" + - os: macos-latest + transport: default + backend: capi + shard: "2b1b-mcp-config" + - os: macos-latest + transport: default + backend: capi + shard: "2b1b-mcp-lifecycle" + - os: macos-latest + transport: default + backend: capi + shard: "2b1b-queue" + - os: macos-latest + transport: default + backend: capi + shard: "2b1b-remote" + - os: macos-latest + transport: default + backend: capi + shard: "2b2" - os: macos-latest transport: default backend: capi @@ -187,6 +223,7 @@ jobs: ) filter="$DOTNET_TEST_FILTER" + individual_filters=() if [[ "$DOTNET_TEST_SHARD" != "full" ]]; then case "$DOTNET_TEST_SHARD" in 1) @@ -203,9 +240,54 @@ jobs: initials=(B E F G) shard_filter="" ;; - 2b) - initials=(O P R) + 2b1a-permission-provider) + initials=() shard_filter="" + individual_filters=( + "FullyQualifiedName~GitHub.Copilot.Test.E2E.PendingWorkResumeE2ETests" + "FullyQualifiedName~GitHub.Copilot.Test.E2E.PerSessionAuthE2ETests" + "FullyQualifiedName~GitHub.Copilot.Test.E2E.PermissionE2ETests" + "FullyQualifiedName~GitHub.Copilot.Test.E2E.PreMcpToolCallHookE2ETests" + "FullyQualifiedName~GitHub.Copilot.Test.E2E.ProviderEndpointE2ETests" + "FullyQualifiedName~GitHub.Copilot.Test.Unit.PermissionHandlerTests" + "FullyQualifiedName~GitHub.Copilot.Test.Unit.PublicDtoTests" + ) + ;; + 2b1a-rewind) + initials=() + shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.Rewind" + ;; + 2b1a-rpc-a) + initials=() + shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcA" + ;; + 2b1a-rpc-e) + initials=() + shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcE" + ;; + 2b1b-mcp-and-skills) + initials=() + shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcMcpAndSkillsE2ETests" + ;; + 2b1b-mcp-config) + initials=() + shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcMcpConfigE2ETests" + ;; + 2b1b-mcp-lifecycle) + initials=() + shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcMcpLifecycleE2ETests" + ;; + 2b1b-queue) + initials=() + shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcQ" + ;; + 2b1b-remote) + initials=() + shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcR" + ;; + 2b2) + initials=() + shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcS|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcT|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcU|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcW|FullyQualifiedName~GitHub.Copilot.Test.Unit.R" ;; 2c) initials=(T V X Z) @@ -213,6 +295,14 @@ jobs: ;; esac + if (( ${#individual_filters[@]} > 0 )); then + for individual_filter in "${individual_filters[@]}"; do + combined_filter="${filter:+(${filter})&}(${individual_filter})" + dotnet test test/GitHub.Copilot.SDK.Test.csproj "${args[@]}" --filter "$combined_filter" + done + exit 0 + fi + for namespace in E2E Unit; do for initial in "${initials[@]}"; do clause="FullyQualifiedName~GitHub.Copilot.Test.${namespace}.${initial}" diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index 4379a2c122..06a717aa86 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -99,6 +99,69 @@ internal sealed class ConnectRequest public string? Token { get; set; } } +/// One server-discovered hook action from user, repository, plugin, or managed-policy configuration. +[Experimental(Diagnostics.Experimental)] +public sealed class DiscoveredHook +{ + /// Durable content hash used by hook enablement. Identical actions may intentionally share this key. Omitted when changing the user's disabled-hooks setting cannot change the action's current server-discovered state, including managed-policy hooks, session-start prompt actions, actions suppressed by disable-all settings, and projectless plugin actions that require project-directory expansion. + [JsonPropertyName("disableKey")] + public string? DisableKey { get; set; } + + /// Whether this action is enabled under the server-side discovery settings. Concrete sessions may differ because they can add session-specific directories, plugins, or trust. False when its disable key is present in the user's disabled-hooks setting or disable-all settings suppress the action. + [JsonPropertyName("enabled")] + public bool Enabled { get; set; } + + /// Hook event that invokes this action. + [JsonPropertyName("hookType")] + public HookType HookType { get; set; } + + /// Deterministic identifier for this server-discovered action row. It remains stable while the project, origin, source, event, action content, and duplicate ordinal are unchanged. This is row identity, not the key persisted in disabledHooks. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; + + /// Configuration tier that contributed this hook action. + [JsonPropertyName("origin")] + public HookOrigin Origin { get; set; } + + /// Input project path for which this server-side action was resolved. Set on every row returned for project-scoped discovery, including repeated user and policy actions. + [JsonPropertyName("projectPath")] + public string? ProjectPath { get; set; } + + /// Human-readable source label, such as a hook file path, settings source, or plugin name. + [JsonPropertyName("source")] + public string? Source { get; set; } +} + +/// Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources. +[Experimental(Diagnostics.Experimental)] +public sealed class HooksDiscoverResult +{ + /// Errors for hook sources or actions that could not be loaded, making the result partially incomplete. Other valid actions are still returned. Project-resolution and repository-settings errors are prefixed with their project path. + [JsonPropertyName("errors")] + public IList Errors { get => field ??= []; set; } + + /// All discovered hook actions. Byte-identical actions remain separate rows even when they share a disable key. + [JsonPropertyName("hooks")] + public IList Hooks { get => field ??= []; set; } + + /// Non-fatal source-loading warnings. Discovery remains complete for the affected source, although the source had a recoverable issue. Repository-settings warnings are prefixed with their project path when attribution is available. + [JsonPropertyName("warnings")] + public IList Warnings { get => field ??= []; set; } +} + +/// Optional project paths and host-exclusion behavior for server-scoped hook discovery. +[Experimental(Diagnostics.Experimental)] +internal sealed class HooksDiscoverRequest +{ + /// When true, omit host-owned user and plugin hook rows and their diagnostics. Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks still contribute to each remaining row's effective enabled state. This filters sources rather than simulating a host with no settings. + [JsonPropertyName("excludeHostHooks")] + public bool? ExcludeHostHooks { get; set; } + + /// Optional project directory paths whose trusted repository and project-expanded plugin hooks should be discovered. When omitted or empty, user, managed-policy, and globally enabled installed or explicit plugin hooks are returned without project expansion. + [JsonPropertyName("projectPaths")] + public IList? ProjectPaths { get; set; } +} + /// Active server-driven promotion for a model, including its discount and optional expiry. [Experimental(Diagnostics.Experimental)] public sealed class ModelBillingPromo @@ -3241,7 +3304,7 @@ internal sealed class SkillsConfigSetSkillDisabledRequest public string Name { get; set; } = string.Empty; } -/// Agent metadata, including identifiers, display details, source, tools, model, MCP servers, skills, and file path. +/// Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path. [Experimental(Diagnostics.Experimental)] public sealed class AgentInfo { @@ -3266,6 +3329,14 @@ public sealed class AgentInfo [JsonPropertyName("model")] public string? Model { get; set; } + /// Whether authored models are preferences or required constraints. + [JsonPropertyName("modelPolicy")] + public AgentModelPolicy? ModelPolicy { get; set; } + + /// Authored preferred model ids for this agent, in priority order. Runtime model selection chooses the first available model; omitted means no authored preference. + [JsonPropertyName("models")] + public IList? Models { get; set; } + /// Name of the agent. Use `id` as the stable selection identifier. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; @@ -4230,6 +4301,48 @@ internal sealed class SessionsGetMetadataRequest public string SessionId { get; set; } = string.Empty; } +/// Batch of session events returned by a read, with cursor and continuation metadata. +[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. 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 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`. 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 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; } +} + +/// Pagination options for reading an inactive or active local session's persisted event journal. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionsReadPersistedEventsRequest +{ + /// Opaque cursor returned by a previous persisted-event read. Omit on the first call. + [JsonPropertyName("cursor")] + public string? Cursor { get; set; } + + /// Direction to page through persisted history. Forward starts at the beginning; backward starts with the newest events. Events in each page remain chronological. + [JsonPropertyName("direction")] + public EventsReadDirection? Direction { get; set; } + + /// Maximum number of events to return in this batch (1–1000, default 200). + [JsonPropertyName("max")] + public long? Max { get; set; } + + /// Session ID whose persisted event journal should be read. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Recent local session IDs that contain user-visible history. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsListNonEmptySessionIdsResult @@ -7487,7 +7600,7 @@ internal sealed class ModelSwitchToRequest [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; - /// Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. + /// Origin to record on the effective `session.model_change` event for trusted in-process calls. Transport SDK calls are always recorded as `sdk`, regardless of this value. [JsonPropertyName("source")] public ModelChangeSource? Source { get; set; } @@ -11175,7 +11288,7 @@ public sealed class SandboxConfigUserPolicyNetworkProxy [JsonPropertyName("password")] public string? Password { get; set; } - /// Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. + /// Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted; an explicit port must be between 1 and 65535. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. [JsonPropertyName("url")] public string Url { get; set; } = string.Empty; @@ -11196,7 +11309,7 @@ public sealed class SandboxConfigUserPolicyNetwork [JsonPropertyName("allowOutbound")] public bool? AllowOutbound { get; set; } - /// HTTP proxy the sandboxed process routes traffic through. Enforced on Windows and cooperative (honored by well-behaved tools, not strictly enforced) on Linux and macOS. Credentials go in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; an https:// or authenticated loopback URL is used as-is. + /// HTTP proxy for sandboxed process traffic. Linux restricts egress to the proxy endpoint, requires that endpoint to be reachable over IPv4 (the [::] dual-stack wildcard is accepted and routed through the IPv4 gateway), and does not support proxy credentials. macOS relies on applications honoring proxy environment variables. Windows also configures a per-AppContainer WinHTTP proxy, but enforcement depends on the application's networking stack. Configure supported credentials in the separate `username` and `password` fields. A credential-free http:// loopback URL uses the localhost proxy form, while an https:// or authenticated loopback URL uses the URL form. [JsonPropertyName("proxy")] public SandboxConfigUserPolicyNetworkProxy? Proxy { get; set; } } @@ -12966,6 +13079,10 @@ public sealed class SubagentSettingsEntry /// Model override for matching subagents. [JsonPropertyName("model")] public string? Model { get; set; } + + /// Whether the configured model strategy is preferred or required. + [JsonPropertyName("modelPolicy")] + public AgentModelPolicy? ModelPolicy { get; set; } } /// Configured per-agent subagent overrides. @@ -16683,6 +16800,10 @@ public sealed class QueuePendingItems /// Whether this item is a queued user message or a queued slash command / model change. [JsonPropertyName("kind")] public QueuePendingItemsKind Kind { get; set; } + + /// Stable identity of the queued user message. Present for message rows and absent for slash commands and model changes. + [JsonPropertyName("messageId")] + public string? MessageId { get; set; } } /// Snapshot of the session's pending queued items and immediate-steering messages. @@ -17105,27 +17226,6 @@ internal sealed class SessionQueueProcessRequest public string SessionId { get; set; } = string.Empty; } -/// Batch of session events returned by a read, with cursor and continuation metadata. -[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. 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 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`. 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 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; } -} - /// Cursor, batch size, and optional long-poll/filter parameters for reading session events. [Experimental(Diagnostics.Experimental)] internal sealed class EventLogReadRequest @@ -18837,6 +18937,183 @@ public sealed class GitHubTokenAcquireRequest public string? SessionId { get; set; } } +/// Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HookType : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HookType(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Runs before a tool is invoked. + public static HookType PreToolUse { get; } = new("preToolUse"); + + /// Runs before an MCP tool is invoked. + public static HookType PreMcpToolCall { get; } = new("preMcpToolCall"); + + /// Runs after a tool completes successfully. + public static HookType PostToolUse { get; } = new("postToolUse"); + + /// Runs after a tool fails. + public static HookType PostToolUseFailure { get; } = new("postToolUseFailure"); + + /// Runs after the user submits a prompt. + public static HookType UserPromptSubmitted { get; } = new("userPromptSubmitted"); + + /// Runs after the runtime transforms the submitted prompt for the model, before it is added to session history. + public static HookType UserPromptTransformed { get; } = new("userPromptTransformed"); + + /// Runs when a session starts. + public static HookType SessionStart { get; } = new("sessionStart"); + + /// Runs when a session ends. + public static HookType SessionEnd { get; } = new("sessionEnd"); + + /// Runs after an agent result is produced. + public static HookType PostResult { get; } = new("postResult"); + + /// Runs before a pull request description is generated. + public static HookType PrePRDescription { get; } = new("prePRDescription"); + + /// Runs when the agent encounters an error. + public static HookType ErrorOccurred { get; } = new("errorOccurred"); + + /// Runs when the agent stops. + public static HookType AgentStop { get; } = new("agentStop"); + + /// Runs when a subagent starts. + public static HookType SubagentStart { get; } = new("subagentStart"); + + /// Runs when a subagent stops. + public static HookType SubagentStop { get; } = new("subagentStop"); + + /// Runs before conversation context is compacted. + public static HookType PreCompact { get; } = new("preCompact"); + + /// Runs when the agent requests permission. + public static HookType PermissionRequest { get; } = new("permissionRequest"); + + /// Runs when the agent emits a notification. + public static HookType Notification { get; } = new("notification"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HookType left, HookType right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HookType left, HookType right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HookType other && Equals(other); + + /// + public bool Equals(HookType 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 HookType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HookType value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HookType)); + } + } +} + + +/// Configuration tier that contributed a discovered hook action. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HookOrigin : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HookOrigin(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Hook loaded from user settings or the user's hook directory. + public static HookOrigin User { get; } = new("user"); + + /// Hook loaded from repository settings or the repository hook directory. + public static HookOrigin Repository { get; } = new("repository"); + + /// Hook provided by an enabled installed or explicit plugin. Projectless rows omit projectPath and do not expand a project directory. + public static HookOrigin Plugin { get; } = new("plugin"); + + /// Hook enforced by centrally managed policy. + public static HookOrigin Policy { get; } = new("policy"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HookOrigin left, HookOrigin right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HookOrigin left, HookOrigin right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HookOrigin other && Equals(other); + + /// + public bool Equals(HookOrigin 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 HookOrigin Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HookOrigin value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HookOrigin)); + } + } +} + + /// Resolved Anthropic adaptive-thinking capability for a model. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -22329,6 +22606,132 @@ public override void Write(Utf8JsonWriter writer, SessionSource value, JsonSeria } +/// 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}")] +public readonly struct EventsCursorStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public EventsCursorStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The cursor was applied successfully. + public static EventsCursorStatus Ok { get; } = new("ok"); + + /// The cursor referred to history that is no longer available. + public static EventsCursorStatus Expired { get; } = new("expired"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(EventsCursorStatus left, EventsCursorStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(EventsCursorStatus left, EventsCursorStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is EventsCursorStatus other && Equals(other); + + /// + public bool Equals(EventsCursorStatus 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 EventsCursorStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, EventsCursorStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(EventsCursorStatus)); + } + } +} + + +/// 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)); + } + } +} + + /// Kind of attention required when status === "attention". Meaningful only when status === "attention". [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -28619,69 +29022,6 @@ 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 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}")] -public readonly struct EventsCursorStatus : IEquatable -{ - private readonly string? _value; - - /// Initializes a new instance of the struct. - /// The value to associate with this . - [JsonConstructor] - public EventsCursorStatus(string value) - { - ArgumentException.ThrowIfNullOrWhiteSpace(value); - _value = value; - } - - /// Gets the value associated with this . - public string Value => _value ?? string.Empty; - - /// The cursor was applied successfully. - public static EventsCursorStatus Ok { get; } = new("ok"); - - /// The cursor referred to history that is no longer available. - public static EventsCursorStatus Expired { get; } = new("expired"); - - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(EventsCursorStatus left, EventsCursorStatus right) => left.Equals(right); - - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(EventsCursorStatus left, EventsCursorStatus right) => !(left == right); - - /// - public override bool Equals(object? obj) => obj is EventsCursorStatus other && Equals(other); - - /// - public bool Equals(EventsCursorStatus 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 EventsCursorStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); - } - - /// - public override void Write(Utf8JsonWriter writer, EventsCursorStatus value, JsonSerializerOptions options) - { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(EventsCursorStatus)); - } - } -} - - /// 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. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -28745,69 +29085,6 @@ 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))] @@ -29624,6 +29901,12 @@ public async Task RegisterExtensionLaunchProviderAsync(CancellationToken cancell await CopilotClient.InvokeRpcAsync(_rpc, "registerExtensionLaunchProvider", [], cancellationToken); } + /// Hooks APIs. + public ServerHooksApi Hooks => + field ?? + Interlocked.CompareExchange(ref field, new(_rpc), null) ?? + field; + /// Models APIs. public ServerModelsApi Models => field ?? @@ -29739,6 +30022,29 @@ public async Task RegisterExtensionLaunchProviderAsync(CancellationToken cancell field; } +/// Provides server-scoped Hooks APIs. +[Experimental(Diagnostics.Experimental)] +public sealed class ServerHooksApi +{ + private readonly JsonRpc _rpc; + + internal ServerHooksApi(JsonRpc rpc) + { + _rpc = rpc; + } + + /// Discovers hook actions enabled under server-side discovery settings from user, repository, plugin, and managed-policy sources. + /// Optional project directory paths whose trusted repository and project-expanded plugin hooks should be discovered. When omitted or empty, user, managed-policy, and globally enabled installed or explicit plugin hooks are returned without project expansion. + /// When true, omit host-owned user and plugin hook rows and their diagnostics. Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks still contribute to each remaining row's effective enabled state. This filters sources rather than simulating a host with no settings. + /// The to monitor for cancellation requests. The default is . + /// Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources. + public async Task DiscoverAsync(IList? projectPaths = null, bool? excludeHostHooks = null, CancellationToken cancellationToken = default) + { + var request = new HooksDiscoverRequest { ProjectPaths = projectPaths, ExcludeHostHooks = excludeHostHooks }; + return await CopilotClient.InvokeRpcAsync(_rpc, "hooks.discover", [request], cancellationToken); + } +} + /// Provides server-scoped Models APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerModelsApi @@ -30682,6 +30988,21 @@ internal async Task GetMetadataAsync(string sessionId return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.getMetadata", [request], cancellationToken); } + /// Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The initial backward read uses a bounded tail scan for fast first paint; cursor continuations preserve the session event-log paging semantics. Persisted events may omit payloads that are reconstructed only for an active session. + /// Session ID whose persisted event journal should be read. + /// Opaque cursor returned by a previous persisted-event read. Omit on the first call. + /// Maximum number of events to return in this batch (1–1000, default 200). + /// Direction to page through persisted history. Forward starts at the beginning; backward starts with the newest events. Events in each page remain chronological. + /// 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 ReadPersistedEventsAsync(string sessionId, string? cursor = null, long? max = null, EventsReadDirection? direction = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(sessionId); + + var request = new SessionsReadPersistedEventsRequest { SessionId = sessionId, Cursor = cursor, Max = max, Direction = direction }; + return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.readPersistedEvents", [request], cancellationToken); + } + /// Lists recent local session IDs that contain user-visible history, omitting housekeeping-only sessions. /// Maximum number of session IDs to return. /// The to monitor for cancellation requests. The default is . @@ -31996,7 +32317,7 @@ public async Task GetCurrentAsync(CancellationToken cancellationTo /// Output verbosity level to request for supported models. /// Override individual model capabilities resolved by the runtime. /// Explicit context tier for the selected model. `"default"` / `"long_context"` apply the requested tier; omit this field to use normal model behavior with no explicit tier. - /// Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. + /// Origin to record on the effective `session.model_change` event for trusted in-process calls. Transport SDK calls are always recorded as `sdk`, regardless of this value. /// When true, defer this switch (enqueue it) if another model change is already queued, even when no turn is active — so it drains last (FIFO) and wins over the already-queued change. Intended for genuine user-initiated model selections; internal restore/reapply switches omit it and apply immediately when no turn is active. When no other model change is queued this has no effect (a switch still applies immediately unless a turn is active). /// Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary. /// When true, evaluate context-window compaction policy before applying the switch. @@ -35692,6 +36013,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.AgentInterruptedCancelPhase), TypeInfoPropertyName = "SessionEventsAgentInterruptedCancelPhase")] [JsonSerializable(typeof(GitHub.Copilot.AgentInterruptedData), TypeInfoPropertyName = "SessionEventsAgentInterruptedData")] [JsonSerializable(typeof(GitHub.Copilot.AgentInterruptedEvent), TypeInfoPropertyName = "SessionEventsAgentInterruptedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.AgentModelPolicy), TypeInfoPropertyName = "SessionEventsAgentModelPolicy")] +[JsonSerializable(typeof(GitHub.Copilot.AssistantFusionPhaseActivityEvent), TypeInfoPropertyName = "SessionEventsAssistantFusionPhaseActivityEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantFusionPhaseCompletedEvent), TypeInfoPropertyName = "SessionEventsAssistantFusionPhaseCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantFusionPhaseFailedEvent), TypeInfoPropertyName = "SessionEventsAssistantFusionPhaseFailedEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantFusionPhaseStartedEvent), TypeInfoPropertyName = "SessionEventsAssistantFusionPhaseStartedEvent")] @@ -35797,6 +36120,10 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.CompactionCompleteCompactionTokensUsed), TypeInfoPropertyName = "SessionEventsCompactionCompleteCompactionTokensUsed")] [JsonSerializable(typeof(GitHub.Copilot.CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail), TypeInfoPropertyName = "SessionEventsCompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail")] [JsonSerializable(typeof(GitHub.Copilot.CompactionTrigger), TypeInfoPropertyName = "SessionEventsCompactionTrigger")] +[JsonSerializable(typeof(GitHub.Copilot.CompletionReceiptEventRange), TypeInfoPropertyName = "SessionEventsCompletionReceiptEventRange")] +[JsonSerializable(typeof(GitHub.Copilot.CompletionReceiptFinalTool), TypeInfoPropertyName = "SessionEventsCompletionReceiptFinalTool")] +[JsonSerializable(typeof(GitHub.Copilot.CompletionReceiptStopReason), TypeInfoPropertyName = "SessionEventsCompletionReceiptStopReason")] +[JsonSerializable(typeof(GitHub.Copilot.CompletionReceiptToolStatus), TypeInfoPropertyName = "SessionEventsCompletionReceiptToolStatus")] [JsonSerializable(typeof(GitHub.Copilot.ContextTier), TypeInfoPropertyName = "SessionEventsContextTier")] [JsonSerializable(typeof(GitHub.Copilot.CustomAgentsUpdatedAgent), TypeInfoPropertyName = "SessionEventsCustomAgentsUpdatedAgent")] [JsonSerializable(typeof(GitHub.Copilot.ElicitationCompletedAction), TypeInfoPropertyName = "SessionEventsElicitationCompletedAction")] @@ -35834,7 +36161,9 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.FusionFollowUpAction), TypeInfoPropertyName = "SessionEventsFusionFollowUpAction")] [JsonSerializable(typeof(GitHub.Copilot.FusionFollowUpRecommendation), TypeInfoPropertyName = "SessionEventsFusionFollowUpRecommendation")] [JsonSerializable(typeof(GitHub.Copilot.FusionPattern), TypeInfoPropertyName = "SessionEventsFusionPattern")] +[JsonSerializable(typeof(GitHub.Copilot.FusionPhaseActivityKind), TypeInfoPropertyName = "SessionEventsFusionPhaseActivityKind")] [JsonSerializable(typeof(GitHub.Copilot.FusionPhaseKind), TypeInfoPropertyName = "SessionEventsFusionPhaseKind")] +[JsonSerializable(typeof(GitHub.Copilot.FusionPhasePlanStep), TypeInfoPropertyName = "SessionEventsFusionPhasePlanStep")] [JsonSerializable(typeof(GitHub.Copilot.FusionPhaseStatus), TypeInfoPropertyName = "SessionEventsFusionPhaseStatus")] [JsonSerializable(typeof(GitHub.Copilot.FusionPhaseUsage), TypeInfoPropertyName = "SessionEventsFusionPhaseUsage")] [JsonSerializable(typeof(GitHub.Copilot.FusionProjectionMode), TypeInfoPropertyName = "SessionEventsFusionProjectionMode")] @@ -36181,6 +36510,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(DiscoveredExtensions))] [JsonSerializable(typeof(DiscoveredExtensionsDisableRequest))] [JsonSerializable(typeof(DiscoveredExtensionsEnableRequest))] +[JsonSerializable(typeof(DiscoveredHook))] [JsonSerializable(typeof(DiscoveredMcpServer))] [JsonSerializable(typeof(EnqueueCommandParams))] [JsonSerializable(typeof(EnqueueCommandResult))] @@ -36265,6 +36595,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(HistorySummarizeForHandoffResult))] [JsonSerializable(typeof(HistoryTruncateRequest))] [JsonSerializable(typeof(HistoryTruncateResult))] +[JsonSerializable(typeof(HooksDiscoverRequest))] +[JsonSerializable(typeof(HooksDiscoverResult))] [JsonSerializable(typeof(IDictionary))] [JsonSerializable(typeof(IList))] [JsonSerializable(typeof(IList))] @@ -36812,6 +37144,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionsLoadDeferredRepoHooksRequest))] [JsonSerializable(typeof(SessionsOpenProgress))] [JsonSerializable(typeof(SessionsPruneOldRequest))] +[JsonSerializable(typeof(SessionsReadPersistedEventsRequest))] [JsonSerializable(typeof(SessionsRegisterExtensionToolsOnSessionOptions))] [JsonSerializable(typeof(SessionsReleaseLockRequest))] [JsonSerializable(typeof(SessionsReleaseLockResult))] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index 170e83027a..f832b95d85 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -26,6 +26,7 @@ namespace GitHub.Copilot; IgnoreUnrecognizedTypeDiscriminators = true)] [JsonDerivedType(typeof(AbortEvent), "abort")] [JsonDerivedType(typeof(AgentInterruptedEvent), "agent.interrupted")] +[JsonDerivedType(typeof(AssistantFusionPhaseActivityEvent), "assistant.fusion_phase_activity")] [JsonDerivedType(typeof(AssistantFusionPhaseCompletedEvent), "assistant.fusion_phase_completed")] [JsonDerivedType(typeof(AssistantFusionPhaseFailedEvent), "assistant.fusion_phase_failed")] [JsonDerivedType(typeof(AssistantFusionPhaseStartedEvent), "assistant.fusion_phase_started")] @@ -94,6 +95,7 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionCanvasUnavailableEvent), "session.canvas.unavailable")] [JsonDerivedType(typeof(SessionCompactionCompleteEvent), "session.compaction_complete")] [JsonDerivedType(typeof(SessionCompactionStartEvent), "session.compaction_start")] +[JsonDerivedType(typeof(SessionCompletionReceiptEvent), "session.completion_receipt")] [JsonDerivedType(typeof(SessionContextChangedEvent), "session.context_changed")] [JsonDerivedType(typeof(SessionContextClearedEvent), "session.context_cleared")] [JsonDerivedType(typeof(SessionCustomAgentsUpdatedEvent), "session.custom_agents_updated")] @@ -601,6 +603,20 @@ public sealed partial class SessionTaskCompleteEvent : SessionEvent public required SessionTaskCompleteData Data { get; set; } } +/// Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted. +/// Represents the session.completion_receipt event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionCompletionReceiptEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.completion_receipt"; + + /// The session.completion_receipt event payload. + [JsonPropertyName("data")] + public required SessionCompletionReceiptData Data { get; set; } +} + /// Experimental transient signal that HydraFusion routing has started for an eligible turn. /// Represents the session.fusion_route_started event. [Experimental(Diagnostics.Experimental)] @@ -749,6 +765,20 @@ public sealed partial class AssistantFusionPhaseStartedEvent : SessionEvent public required AssistantFusionPhaseStartedData Data { get; set; } } +/// Experimental content-safe activity signal for a running HydraFusion phase. +/// Represents the assistant.fusion_phase_activity event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class AssistantFusionPhaseActivityEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "assistant.fusion_phase_activity"; + + /// The assistant.fusion_phase_activity event payload. + [JsonPropertyName("data")] + public required AssistantFusionPhaseActivityData Data { get; set; } +} + /// Experimental durable HydraFusion phase output and lossless replay checkpoint. /// Represents the assistant.fusion_phase_completed event. [Experimental(Diagnostics.Experimental)] @@ -2893,6 +2923,44 @@ public sealed partial class SessionTaskCompleteData public string? Summary { get; set; } } +/// Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionCompletionReceiptData +{ + /// One-based accepted completion receipt ordinal in the durable session history. + [JsonPropertyName("attempt")] + public required long Attempt { get; set; } + + /// Inclusive durable event range summarized by this receipt. + [JsonPropertyName("eventRange")] + public required CompletionReceiptEventRange EventRange { get; set; } + + /// Number of failed structured tool completions in the covered range. + [JsonPropertyName("failedToolCount")] + public required long FailedToolCount { get; set; } + + /// Final structured tool completion in the covered range, when one exists. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("finalTool")] + public CompletionReceiptFinalTool? FinalTool { get; set; } + + /// Version of the completion receipt payload. + [JsonPropertyName("schemaVersion")] + public required long SchemaVersion { get; set; } + + /// Identifier of the assistant turn-end event that supplied the accepted completion boundary. This is the receipt's idempotency key, and always equals eventRange.endEventId. + [JsonPropertyName("sourceEventId")] + public required string SourceEventId { get; set; } + + /// Runtime reason the completion decision was accepted. + [JsonPropertyName("stopReason")] + public required CompletionReceiptStopReason StopReason { get; set; } + + /// Number of successful structured tool completions in the covered range. + [JsonPropertyName("successfulToolCount")] + public required long SuccessfulToolCount { get; set; } +} + /// Experimental transient signal that HydraFusion routing has started for an eligible turn. [Experimental(Diagnostics.Experimental)] public sealed partial class SessionFusionRouteStartedData @@ -2985,6 +3053,12 @@ public sealed partial class SessionFusionResolvedData [JsonPropertyName("pattern")] public required FusionPattern Pattern { get; set; } + /// Presentation-neutral phase plan for clients that render workflow progress. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("phasePlan")] + public FusionPhasePlanStep[]? PhasePlan { get; set; } + /// Version of the validated execution-plan format. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("planVersion")] @@ -3156,6 +3230,11 @@ public sealed partial class UserMessageData [JsonPropertyName("isAutopilotContinuation")] public bool? IsAutopilotContinuation { get; set; } + /// Stable identity of the logical user message, matching the ID returned by send and retained by pending queue snapshots. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("messageId")] + public string? MessageId { get; set; } + /// Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("nativeDocumentPathFallbackPaths")] @@ -3337,6 +3416,49 @@ public sealed partial class AssistantFusionPhaseStartedData public required string Role { get; set; } } +/// Experimental content-safe activity signal for a running HydraFusion phase. +[Experimental(Diagnostics.Experimental)] +public sealed partial class AssistantFusionPhaseActivityData +{ + /// Kind of real activity observed. + [JsonPropertyName("activity")] + public required FusionPhaseActivityKind Activity { get; set; } + + /// Conversation scope in which the phase executes. + [JsonPropertyName("conversationScope")] + public required FusionConversationScope ConversationScope { get; set; } + + /// Identifier of the HydraFusion turn containing the phase. + [JsonPropertyName("fusionId")] + public required string FusionId { get; set; } + + /// HydraFusion orchestration pattern containing the phase. + [JsonPropertyName("pattern")] + public required FusionPattern Pattern { get; set; } + + /// Stable identifier for the concrete phase. + [JsonPropertyName("phaseId")] + public required string PhaseId { get; set; } + + /// Kind of phase currently executing. + [JsonPropertyName("phaseKind")] + public required FusionPhaseKind PhaseKind { get; set; } + + /// Semantic role assigned to the phase. + [JsonPropertyName("role")] + public required string Role { get; set; } + + /// Opaque hashed correlation token for matching tool-started and tool-completed activity within this Fusion activity stream. It is not the tool call identifier exposed by tool lifecycle events. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("toolCallId")] + public string? ToolCallId { get; set; } + + /// Cumulative private response bytes observed for this model call. The event never includes response text. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("totalResponseSizeBytes")] + public long? TotalResponseSizeBytes { get; set; } +} + /// Experimental durable HydraFusion phase output and lossless replay checkpoint. [Experimental(Diagnostics.Experimental)] public sealed partial class AssistantFusionPhaseCompletedData @@ -4655,6 +4777,11 @@ public sealed partial class SubagentCompletedData [JsonPropertyName("model")] public string? Model { get; set; } + /// Why an explicit task-call model did not become the effective model. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("modelOverrideReason")] + public string? ModelOverrideReason { get; set; } + /// Tool call ID of the parent tool invocation that spawned this sub-agent. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } @@ -4721,6 +4848,11 @@ public sealed partial class SubagentFailedData [JsonPropertyName("model")] public string? Model { get; set; } + /// Why an explicit task-call model did not become the effective model. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("modelOverrideReason")] + public string? ModelOverrideReason { get; set; } + /// Tool call ID of the parent tool invocation that spawned this sub-agent. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } @@ -4900,6 +5032,11 @@ public sealed partial class SystemNotificationData /// Permission request notification requiring client approval with request details. public sealed partial class PermissionRequestedData { + /// Agent mode captured from the owning turn when permission evaluation began. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("agentMode")] + public SessionMode? AgentMode { get; set; } + /// Details of the permission being requested. [JsonPropertyName("permissionRequest")] public required PermissionRequest PermissionRequest { get; set; } @@ -6238,6 +6375,42 @@ public sealed partial class CompactionCompleteCompactionTokensUsed public long? OutputTokens { get; set; } } +/// Inclusive durable event range summarized by a completion receipt. +/// Nested data type for CompletionReceiptEventRange. +public sealed partial class CompletionReceiptEventRange +{ + /// Identifier of the assistant turn-end event that ends the covered exchange. Always equals the receipt's sourceEventId, so either field is a valid join key. + [JsonPropertyName("endEventId")] + public required string EndEventId { get; set; } + + /// Identifier of the user message that starts the covered exchange. + [JsonPropertyName("startEventId")] + public required string StartEventId { get; set; } +} + +/// Final structured tool completion in the covered event range. +/// Nested data type for CompletionReceiptFinalTool. +public sealed partial class CompletionReceiptFinalTool +{ + /// Process exit code from a structured shell result, when available. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("exitCode")] + public long? ExitCode { get; set; } + + /// Structured success or failure status from the tool completion event. + [JsonPropertyName("status")] + public required CompletionReceiptToolStatus Status { get; set; } + + /// Unique identifier of the completed tool call. + [JsonPropertyName("toolCallId")] + public required string ToolCallId { get; set; } + + /// Tool name from the matching tool execution start event, when available. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("toolName")] + public string? ToolName { get; set; } +} + /// Durable server recommendation for subsequent HydraFusion turns. /// Nested data type for FusionFollowUpRecommendation. [Experimental(Diagnostics.Experimental)] @@ -6252,6 +6425,28 @@ public sealed partial class FusionFollowUpRecommendation public required FusionFollowUpAction UserTurn { get; set; } } +/// Presentation-neutral phase planned for a HydraFusion turn. +/// Nested data type for FusionPhasePlanStep. +[Experimental(Diagnostics.Experimental)] +public sealed partial class FusionPhasePlanStep +{ + /// Whether the phase executes only when an earlier phase requests it. + [JsonPropertyName("conditional")] + public required bool Conditional { get; set; } + + /// Kind of phase that may execute. + [JsonPropertyName("kind")] + public required FusionPhaseKind Kind { get; set; } + + /// Semantic role assigned to the phase. + [JsonPropertyName("role")] + public required string Role { get; set; } + + /// Conversation scope in which the phase executes. + [JsonPropertyName("scope")] + public required FusionConversationScope Scope { get; set; } +} + /// Validated HydraFusion routing capability scores. /// Nested data type for FusionScores. [Experimental(Diagnostics.Experimental)] @@ -10170,7 +10365,7 @@ public sealed partial class SkillsLoadedSkill public required bool UserInvocable { get; set; } } -/// A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and model override. +/// A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and authored model configuration. /// Nested data type for CustomAgentsUpdatedAgent. public sealed partial class CustomAgentsUpdatedAgent { @@ -10191,6 +10386,16 @@ public sealed partial class CustomAgentsUpdatedAgent [JsonPropertyName("model")] public string? Model { get; set; } + /// Whether authored models are preferences or required constraints. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("modelPolicy")] + public AgentModelPolicy? ModelPolicy { get; set; } + + /// Authored model ids in priority order, if configured. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("models")] + public string[]? Models { get; set; } + /// Internal name of the agent. [JsonPropertyName("name")] public required string Name { get; set; } @@ -11469,6 +11674,140 @@ public override void Write(Utf8JsonWriter writer, TaskCompletionOutcome value, J } } +/// Structured terminal status from a tool completion event. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct CompletionReceiptToolStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public CompletionReceiptToolStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The tool completed successfully. + public static CompletionReceiptToolStatus Success { get; } = new("success"); + + /// The tool failed without a more specific structured status. + public static CompletionReceiptToolStatus Failure { get; } = new("failure"); + + /// The tool exceeded its time budget. + public static CompletionReceiptToolStatus Timeout { get; } = new("timeout"); + + /// The user rejected the tool call. + public static CompletionReceiptToolStatus Rejected { get; } = new("rejected"); + + /// The permissions service denied the tool call. + public static CompletionReceiptToolStatus Denied { get; } = new("denied"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(CompletionReceiptToolStatus left, CompletionReceiptToolStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(CompletionReceiptToolStatus left, CompletionReceiptToolStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is CompletionReceiptToolStatus other && Equals(other); + + /// + public bool Equals(CompletionReceiptToolStatus 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 CompletionReceiptToolStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, CompletionReceiptToolStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(CompletionReceiptToolStatus)); + } + } +} + +/// Runtime reason the completion decision was accepted. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct CompletionReceiptStopReason : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public CompletionReceiptStopReason(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The model reached a natural terminal response. + public static CompletionReceiptStopReason Natural { get; } = new("natural"); + + /// A terminal tool ended the interaction. + public static CompletionReceiptStopReason TerminalTool { get; } = new("terminal_tool"); + + /// The configured agentStop continuation limit was reached. + public static CompletionReceiptStopReason AgentStopBlockLimit { get; } = new("agent_stop_block_limit"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(CompletionReceiptStopReason left, CompletionReceiptStopReason right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(CompletionReceiptStopReason left, CompletionReceiptStopReason right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is CompletionReceiptStopReason other && Equals(other); + + /// + public bool Equals(CompletionReceiptStopReason 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 CompletionReceiptStopReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, CompletionReceiptStopReason value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(CompletionReceiptStopReason)); + } + } +} + /// Kind of turn for which HydraFusion routing is running. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -11658,6 +11997,145 @@ public override void Write(Utf8JsonWriter writer, FusionPattern value, JsonSeria } } +/// HydraFusion phase kind. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FusionPhaseKind : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FusionPhaseKind(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Primary solver phase. + public static FusionPhaseKind Primary { get; } = new("primary"); + + /// Read-only cascade judge phase. + public static FusionPhaseKind Judge { get; } = new("judge"); + + /// Cascade repair phase. + public static FusionPhaseKind Repair { get; } = new("repair"); + + /// Initial critique-pattern draft phase. + public static FusionPhaseKind Draft { get; } = new("draft"); + + /// Read-only critique phase. + public static FusionPhaseKind Critic { get; } = new("critic"); + + /// Critique-pattern revision phase. + public static FusionPhaseKind Revision { get; } = new("revision"); + + /// Follow-up phase continuing from the resolved model. + public static FusionPhaseKind FollowUp { get; } = new("follow_up"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FusionPhaseKind left, FusionPhaseKind right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FusionPhaseKind left, FusionPhaseKind right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FusionPhaseKind other && Equals(other); + + /// + public bool Equals(FusionPhaseKind 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 FusionPhaseKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FusionPhaseKind value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionPhaseKind)); + } + } +} + +/// Conversation scope in which a HydraFusion phase executes. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FusionConversationScope : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FusionConversationScope(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Canonical root conversation history. + public static FusionConversationScope Root { get; } = new("root"); + + /// Isolated read-only review history that does not enter the root conversation. + public static FusionConversationScope Review { get; } = new("review"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FusionConversationScope left, FusionConversationScope right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FusionConversationScope left, FusionConversationScope right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FusionConversationScope other && Equals(other); + + /// + public bool Equals(FusionConversationScope 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 FusionConversationScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FusionConversationScope value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionConversationScope)); + } + } +} + /// The agent mode that was active when this message was sent. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -12103,120 +12581,46 @@ public override void Write(Utf8JsonWriter writer, ModelCallFailureTransport valu } } -/// Conversation scope in which a HydraFusion phase executes. +/// Content-safe activity observed while a HydraFusion phase is running. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] -public readonly struct FusionConversationScope : IEquatable +public readonly struct FusionPhaseActivityKind : IEquatable { private readonly string? _value; - /// Initializes a new instance of the struct. - /// The value to associate with this . + /// Initializes a new instance of the struct. + /// The value to associate with this . [JsonConstructor] - public FusionConversationScope(string value) + public FusionPhaseActivityKind(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } - /// Gets the value associated with this . + /// Gets the value associated with this . public string Value => _value ?? string.Empty; - /// Canonical root conversation history. - public static FusionConversationScope Root { get; } = new("root"); + /// The provider produced additional private output bytes. + public static FusionPhaseActivityKind ModelOutput { get; } = new("model_output"); - /// Isolated read-only review history that does not enter the root conversation. - public static FusionConversationScope Review { get; } = new("review"); + /// A tool began executing inside the phase. + public static FusionPhaseActivityKind ToolStarted { get; } = new("tool_started"); - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(FusionConversationScope left, FusionConversationScope right) => left.Equals(right); + /// A tool finished executing inside the phase. + public static FusionPhaseActivityKind ToolCompleted { get; } = new("tool_completed"); - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(FusionConversationScope left, FusionConversationScope right) => !(left == right); + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FusionPhaseActivityKind left, FusionPhaseActivityKind right) => left.Equals(right); - /// - public override bool Equals(object? obj) => obj is FusionConversationScope other && Equals(other); + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FusionPhaseActivityKind left, FusionPhaseActivityKind right) => !(left == right); /// - public bool Equals(FusionConversationScope other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + public override bool Equals(object? obj) => obj is FusionPhaseActivityKind other && Equals(other); /// - 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 FusionConversationScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); - } - - /// - public override void Write(Utf8JsonWriter writer, FusionConversationScope value, JsonSerializerOptions options) - { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionConversationScope)); - } - } -} - -/// HydraFusion phase kind. -[Experimental(Diagnostics.Experimental)] -[JsonConverter(typeof(Converter))] -[DebuggerDisplay("{Value,nq}")] -public readonly struct FusionPhaseKind : IEquatable -{ - private readonly string? _value; - - /// Initializes a new instance of the struct. - /// The value to associate with this . - [JsonConstructor] - public FusionPhaseKind(string value) - { - ArgumentException.ThrowIfNullOrWhiteSpace(value); - _value = value; - } - - /// Gets the value associated with this . - public string Value => _value ?? string.Empty; - - /// Primary solver phase. - public static FusionPhaseKind Primary { get; } = new("primary"); - - /// Read-only cascade judge phase. - public static FusionPhaseKind Judge { get; } = new("judge"); - - /// Cascade repair phase. - public static FusionPhaseKind Repair { get; } = new("repair"); - - /// Initial critique-pattern draft phase. - public static FusionPhaseKind Draft { get; } = new("draft"); - - /// Read-only critique phase. - public static FusionPhaseKind Critic { get; } = new("critic"); - - /// Critique-pattern revision phase. - public static FusionPhaseKind Revision { get; } = new("revision"); - - /// Follow-up phase continuing from the resolved model. - public static FusionPhaseKind FollowUp { get; } = new("follow_up"); - - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(FusionPhaseKind left, FusionPhaseKind right) => left.Equals(right); - - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(FusionPhaseKind left, FusionPhaseKind right) => !(left == right); - - /// - public override bool Equals(object? obj) => obj is FusionPhaseKind other && Equals(other); - - /// - public bool Equals(FusionPhaseKind other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + public bool Equals(FusionPhaseActivityKind other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); @@ -12224,20 +12628,20 @@ public FusionPhaseKind(string value) /// public override string ToString() => Value; - /// Provides a for serializing instances. + /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class Converter : JsonConverter + public sealed class Converter : JsonConverter { /// - public override FusionPhaseKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override FusionPhaseActivityKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// - public override void Write(Utf8JsonWriter writer, FusionPhaseKind value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, FusionPhaseActivityKind value, JsonSerializerOptions options) { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionPhaseKind)); + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionPhaseActivityKind)); } } } @@ -15251,6 +15655,67 @@ public override void Write(Utf8JsonWriter writer, SkillSource value, JsonSeriali } } +/// Whether configured models are advisory preferences or required constraints. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct AgentModelPolicy : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public AgentModelPolicy(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Treat the authored models as advisory preferences that callers may override. + public static AgentModelPolicy Preferred { get; } = new("preferred"); + + /// Require subagent execution to use one of the authored models. + public static AgentModelPolicy Required { get; } = new("required"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(AgentModelPolicy left, AgentModelPolicy right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(AgentModelPolicy left, AgentModelPolicy right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is AgentModelPolicy other && Equals(other); + + /// + public bool Equals(AgentModelPolicy 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 AgentModelPolicy Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, AgentModelPolicy value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentModelPolicy)); + } + } +} + /// Configuration source: user, workspace, plugin, or builtin. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -15604,6 +16069,8 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(AbortEvent))] [JsonSerializable(typeof(AgentInterruptedData))] [JsonSerializable(typeof(AgentInterruptedEvent))] +[JsonSerializable(typeof(AssistantFusionPhaseActivityData))] +[JsonSerializable(typeof(AssistantFusionPhaseActivityEvent))] [JsonSerializable(typeof(AssistantFusionPhaseCompletedData))] [JsonSerializable(typeof(AssistantFusionPhaseCompletedEvent))] [JsonSerializable(typeof(AssistantFusionPhaseFailedData))] @@ -15698,6 +16165,8 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(CompactionCompleteCompactionTokensUsed))] [JsonSerializable(typeof(CompactionCompleteCompactionTokensUsedCopilotUsage))] [JsonSerializable(typeof(CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail))] +[JsonSerializable(typeof(CompletionReceiptEventRange))] +[JsonSerializable(typeof(CompletionReceiptFinalTool))] [JsonSerializable(typeof(CustomAgentsUpdatedAgent))] [JsonSerializable(typeof(ElicitationCompletedData))] [JsonSerializable(typeof(ElicitationCompletedEvent))] @@ -15724,6 +16193,7 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(FactoryRunUpdatedEvent))] [JsonSerializable(typeof(FusionAttribution))] [JsonSerializable(typeof(FusionFollowUpRecommendation))] +[JsonSerializable(typeof(FusionPhasePlanStep))] [JsonSerializable(typeof(FusionPhaseUsage))] [JsonSerializable(typeof(FusionScores))] [JsonSerializable(typeof(FusionStagedTerminal))] @@ -15851,6 +16321,8 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SessionCompactionCompleteEvent))] [JsonSerializable(typeof(SessionCompactionStartData))] [JsonSerializable(typeof(SessionCompactionStartEvent))] +[JsonSerializable(typeof(SessionCompletionReceiptData))] +[JsonSerializable(typeof(SessionCompletionReceiptEvent))] [JsonSerializable(typeof(SessionContextChangedData))] [JsonSerializable(typeof(SessionContextChangedEvent))] [JsonSerializable(typeof(SessionContextClearedData))] diff --git a/dotnet/test/E2E/RpcMcpAndSkillsE2ETests.cs b/dotnet/test/E2E/RpcMcpAndSkillsE2ETests.cs index 0d2942d4bf..ec923b31a1 100644 --- a/dotnet/test/E2E/RpcMcpAndSkillsE2ETests.cs +++ b/dotnet/test/E2E/RpcMcpAndSkillsE2ETests.cs @@ -33,7 +33,7 @@ public async Task Should_List_And_Toggle_Session_Skills() { var skillName = $"session-rpc-skill-{Guid.NewGuid():N}"; var skillsDir = CreateSkillDirectory(skillName, "Session skill controlled by RPC."); - var session = await CreateSessionAsync(new SessionConfig + await using var session = await CreateSessionAsync(new SessionConfig { SkillDirectories = [skillsDir], DisabledSkills = [skillName], @@ -56,7 +56,7 @@ public async Task Should_Ensure_Skills_Are_Loaded_And_List_Invoked_Skills() { var skillName = $"ensure-rpc-skill-{Guid.NewGuid():N}"; var skillsDir = CreateSkillDirectory(skillName, "Skill loaded explicitly by RPC."); - var session = await CreateSessionAsync(new SessionConfig + await using var session = await CreateSessionAsync(new SessionConfig { SkillDirectories = [skillsDir], }); @@ -79,7 +79,7 @@ public async Task Should_Reload_Session_Skills() Directory.CreateDirectory(skillsDir); var skillName = $"reload-rpc-skill-{Guid.NewGuid():N}"; - var session = await CreateSessionAsync(new SessionConfig { SkillDirectories = [skillsDir] }); + await using var session = await CreateSessionAsync(new SessionConfig { SkillDirectories = [skillsDir] }); var before = await session.Rpc.Skills.ListAsync(); Assert.DoesNotContain(before.Skills, skill => string.Equals(skill.Name, skillName, StringComparison.Ordinal)); @@ -95,7 +95,7 @@ public async Task Should_Reload_Session_Skills() public async Task Should_List_Mcp_Servers_With_Configured_Server() { const string serverName = "rpc-list-mcp-server"; - var session = await CreateSessionAsync(new SessionConfig + await using var session = await CreateSessionAsync(new SessionConfig { McpServers = CreateTestMcpServers(serverName), }); @@ -111,7 +111,7 @@ public async Task Should_List_Mcp_Servers_With_Configured_Server() public async Task Should_Set_Mcp_Env_Value_Mode_And_Remove_GitHub_Server() { const string serverName = "github"; - var session = await CreateSessionAsync(new SessionConfig + await using var session = await CreateSessionAsync(new SessionConfig { McpServers = CreateTestMcpServers(serverName), }); @@ -137,7 +137,7 @@ public async Task Should_Set_Mcp_Env_Value_Mode_And_Remove_GitHub_Server() public async Task Should_Report_Mcp_Sampling_Failure_And_Cancel_Missing_Sampling() { const string serverName = "rpc-sampling-server"; - var session = await CreateSessionAsync(new SessionConfig + await using var session = await CreateSessionAsync(new SessionConfig { McpServers = CreateTestMcpServers(serverName), }); @@ -172,7 +172,7 @@ public async Task Should_Report_Mcp_Sampling_Failure_And_Cancel_Missing_Sampling [Fact] public async Task Should_List_Plugins() { - var session = await CreateSessionAsync(); + await using var session = await CreateSessionAsync(); var result = await session.Rpc.Plugins.ListAsync(); @@ -314,7 +314,7 @@ public async Task Should_Report_Error_When_Mcp_App_Resource_Is_Not_Available() [Fact] public async Task Should_Report_Error_When_Mcp_Host_Is_Not_Initialized() { - var session = await CreateSessionAsync(); + await using var session = await CreateSessionAsync(); await AssertFailureAsync( () => session.Rpc.Mcp.EnableAsync("missing-server"), @@ -333,7 +333,7 @@ await AssertFailureAsync( [Fact] public async Task Should_Report_Error_When_Mcp_Oauth_Server_Is_Not_Configured() { - var session = await CreateSessionAsync(new SessionConfig + await using var session = await CreateSessionAsync(new SessionConfig { McpServers = CreateTestMcpServers("configured-stdio-server"), }); @@ -348,7 +348,7 @@ await AssertFailureAsync( public async Task Should_Report_Error_When_Mcp_Oauth_Server_Is_Not_Remote() { const string serverName = "configured-stdio-server"; - var session = await CreateSessionAsync(new SessionConfig + await using var session = await CreateSessionAsync(new SessionConfig { McpServers = CreateTestMcpServers(serverName), }); diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 1b2458590d..70f3bcbbb4 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -170,7 +170,7 @@ type AgentGetCurrentResult struct { Agent *AgentInfo `json:"agent,omitempty"` } -// Agent metadata, including identifiers, display details, source, tools, model, MCP +// Agent metadata, including identifiers, display details, source, tools, model, models, MCP // servers, skills, and file path. // Experimental: AgentInfo is part of an experimental API and may change or be removed. type AgentInfo struct { @@ -189,6 +189,11 @@ type AgentInfo struct { // Authored preferred model id for this agent. Runtime model selection may choose a // different model; omitted means no authored preference. Model *string `json:"model,omitempty"` + // Whether authored models are preferences or required constraints. + ModelPolicy *AgentModelPolicy `json:"modelPolicy,omitempty"` + // Authored preferred model ids for this agent, in priority order. Runtime model selection + // chooses the first available model; omitted means no authored preference. + Models []string `json:"models,omitzero"` // Name of the agent. Use `id` as the stable selection identifier. Name string `json:"name"` // Absolute local file path of the agent definition. Only set for file-based agents loaded @@ -2582,6 +2587,36 @@ type DiscoveredExtensionsEnableRequest struct { IDs []string `json:"ids"` } +// One server-discovered hook action from user, repository, plugin, or managed-policy +// configuration. +// Experimental: DiscoveredHook is part of an experimental API and may change or be removed. +type DiscoveredHook struct { + // Durable content hash used by hook enablement. Identical actions may intentionally share + // this key. Omitted when changing the user's disabled-hooks setting cannot change the + // action's current server-discovered state, including managed-policy hooks, session-start + // prompt actions, actions suppressed by disable-all settings, and projectless plugin + // actions that require project-directory expansion. + DisableKey *string `json:"disableKey,omitempty"` + // Whether this action is enabled under the server-side discovery settings. Concrete + // sessions may differ because they can add session-specific directories, plugins, or trust. + // False when its disable key is present in the user's disabled-hooks setting or disable-all + // settings suppress the action. + Enabled bool `json:"enabled"` + // Hook event that invokes this action. + HookType HookType `json:"hookType"` + // Deterministic identifier for this server-discovered action row. It remains stable while + // the project, origin, source, event, action content, and duplicate ordinal are unchanged. + // This is row identity, not the key persisted in disabledHooks. + ID string `json:"id"` + // Configuration tier that contributed this hook action. + Origin HookOrigin `json:"origin"` + // Input project path for which this server-side action was resolved. Set on every row + // returned for project-scoped discovery, including repeated user and policy actions. + ProjectPath *string `json:"projectPath,omitempty"` + // Human-readable source label, such as a hook file path, settings source, or plugin name. + Source *string `json:"source,omitempty"` +} + // 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 @@ -4229,8 +4264,6 @@ type HistoryTruncateResult struct { // removed. // Internal: HookInvokeRequest is an internal SDK API and is not part of the public surface. type HookInvokeRequest struct { - // Internal: HookType is part of the SDK's internal API surface and is not intended for - // external use. HookType HookType `json:"hookType"` Input any `json:"input"` SessionID string `json:"sessionId"` @@ -4244,6 +4277,40 @@ type HookInvokeResponse struct { Output any `json:"output,omitempty"` } +// Optional project paths and host-exclusion behavior for server-scoped hook discovery. +// Experimental: HooksDiscoverRequest is part of an experimental API and may change or be +// removed. +type HooksDiscoverRequest struct { + // When true, omit host-owned user and plugin hook rows and their diagnostics. + // Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks + // still contribute to each remaining row's effective enabled state. This filters sources + // rather than simulating a host with no settings. + ExcludeHostHooks *bool `json:"excludeHostHooks,omitempty"` + // Optional project directory paths whose trusted repository and project-expanded plugin + // hooks should be discovered. When omitted or empty, user, managed-policy, and globally + // enabled installed or explicit plugin hooks are returned without project expansion. + ProjectPaths []string `json:"projectPaths,omitzero"` +} + +// Server-discovered hook actions and partial-load diagnostics from user, repository, +// plugin, and managed-policy sources. Concrete sessions may include additional +// session-specific hook sources. +// Experimental: HooksDiscoverResult is part of an experimental API and may change or be +// removed. +type HooksDiscoverResult struct { + // Errors for hook sources or actions that could not be loaded, making the result partially + // incomplete. Other valid actions are still returned. Project-resolution and + // repository-settings errors are prefixed with their project path. + Errors []string `json:"errors"` + // All discovered hook actions. Byte-identical actions remain separate rows even when they + // share a disable key. + Hooks []DiscoveredHook `json:"hooks"` + // Non-fatal source-loading warnings. Discovery remains complete for the affected source, + // although the source had a recoverable issue. Repository-settings warnings are prefixed + // with their project path when attribution is available. + Warnings []string `json:"warnings"` +} + // Installed plugin record from global state, with marketplace, version, install time, // enabled state, cache path, and source. // Experimental: InstalledPlugin is part of an experimental API and may change or be removed. @@ -7244,8 +7311,8 @@ type ModelSwitchToRequest struct { RequireAvailable *bool `json:"requireAvailable,omitempty"` // When true, evaluate context-window compaction policy before applying the switch. RunCompactionPreflight *bool `json:"runCompactionPreflight,omitempty"` - // Origin to record on the effective `session.model_change` event. Defaults to `sdk` when - // omitted. + // Origin to record on the effective `session.model_change` event for trusted in-process + // calls. Transport SDK calls are always recorded as `sdk`, regardless of this value. Source *ModelChangeSource `json:"source,omitempty"` // Output verbosity level to request for supported models Verbosity *Verbosity `json:"verbosity,omitempty"` @@ -9825,6 +9892,9 @@ type QueuePendingItems struct { ID string `json:"id"` // Whether this item is a queued user message or a queued slash command / model change Kind QueuePendingItemsKind `json:"kind"` + // Stable identity of the queued user message. Present for message rows and absent for slash + // commands and model changes. + MessageID *string `json:"messageId,omitempty"` } // Snapshot of the session's pending queued items and immediate-steering messages. @@ -10336,11 +10406,14 @@ type SandboxConfigUserPolicyNetwork struct { AllowLocalNetwork *bool `json:"allowLocalNetwork,omitempty"` // Whether outbound network traffic is allowed at all. AllowOutbound *bool `json:"allowOutbound,omitempty"` - // HTTP proxy the sandboxed process routes traffic through. Enforced on Windows and - // cooperative (honored by well-behaved tools, not strictly enforced) on Linux and macOS. - // Credentials go in the separate `username`/`password` fields. A credential-free http:// - // loopback proxy URL is routed through the localhost proxy automatically; an https:// or - // authenticated loopback URL is used as-is. + // HTTP proxy for sandboxed process traffic. Linux restricts egress to the proxy endpoint, + // requires that endpoint to be reachable over IPv4 (the [::] dual-stack wildcard is + // accepted and routed through the IPv4 gateway), and does not support proxy credentials. + // macOS relies on applications honoring proxy environment variables. Windows also + // configures a per-AppContainer WinHTTP proxy, but enforcement depends on the application's + // networking stack. Configure supported credentials in the separate `username` and + // `password` fields. A credential-free http:// loopback URL uses the localhost proxy form, + // while an https:// or authenticated loopback URL uses the URL form. Proxy *SandboxConfigUserPolicyNetworkProxy `json:"proxy,omitempty"` } @@ -10356,12 +10429,12 @@ type SandboxConfigUserPolicyNetworkProxy struct { // settings.json); the field is masked in the dialog and redacted by /settings show. Password *string `json:"password,omitempty"` // Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the - // scheme's standard port when omitted. Credentials must not be embedded here — a - // `user:pass@` authority is rejected; put them in the separate `username`/`password` - // fields. A credential-free http:// loopback URL is routed through the localhost proxy - // automatically; loopback covers localhost and any *.localhost subdomain, the whole - // 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or - // one with a username/password set, is used as-is. + // scheme's standard port when omitted; an explicit port must be between 1 and 65535. + // Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in + // the separate `username`/`password` fields. A credential-free http:// loopback proxy URL + // is routed through the localhost proxy automatically; loopback covers localhost and any + // *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback + // (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. URL string `json:"url"` // Optional username for proxy authentication. Combined with the URL (and `password`) into // `user:pass@host` when the sandboxed process routes through the proxy. @@ -12902,6 +12975,22 @@ type SessionsPruneOldRequest struct { OlderThanDays int64 `json:"olderThanDays"` } +// Pagination options for reading an inactive or active local session's persisted event +// journal. +// Experimental: SessionsReadPersistedEventsRequest is part of an experimental API and may +// change or be removed. +type SessionsReadPersistedEventsRequest struct { + // Opaque cursor returned by a previous persisted-event read. Omit on the first call. + Cursor *string `json:"cursor,omitempty"` + // Direction to page through persisted history. Forward starts at the beginning; backward + // starts with the newest events. Events in each page remain chronological. + Direction *EventsReadDirection `json:"direction,omitempty"` + // Maximum number of events to return in this batch (1–1000, default 200). + Max *int64 `json:"max,omitempty"` + // Session ID whose persisted event journal should be read. + SessionID string `json:"sessionId"` +} + // Optional registration options. // Experimental: SessionsRegisterExtensionToolsOnSessionOptions is part of an experimental // API and may change or be removed. @@ -13902,6 +13991,8 @@ type SubagentSettingsEntry struct { EffortLevel *string `json:"effortLevel,omitempty"` // Model override for matching subagents Model *string `json:"model,omitempty"` + // Whether the configured model strategy is preferred or required + ModelPolicy *AgentModelPolicy `json:"modelPolicy,omitempty"` } // Task completion notification with summary from the agent @@ -15713,6 +15804,18 @@ const ( AgentInfoSourceUser AgentInfoSource = "user" ) +// Whether configured models are advisory preferences or required constraints +// Experimental: AgentModelPolicy is part of an experimental API and may change or be +// removed. +type AgentModelPolicy string + +const ( + // Treat the authored models as advisory preferences that callers may override. + AgentModelPolicyPreferred AgentModelPolicy = "preferred" + // Require subagent execution to use one of the authored models. + AgentModelPolicyRequired AgentModelPolicy = "required" +) + // Kind of attention required when status === "attention". Meaningful only when status === // "attention". // Experimental: AgentRegistryLiveTargetEntryAttentionKind is part of an experimental API @@ -16784,7 +16887,24 @@ const ( HMACAuthInfoHostHTTPSGitHubCom HMACAuthInfoHost = "https://github.com" ) -// Hook event name dispatched through the SDK callback transport. +// Configuration tier that contributed a discovered hook action. +// Experimental: HookOrigin is part of an experimental API and may change or be removed. +type HookOrigin string + +const ( + // Hook provided by an enabled installed or explicit plugin. Projectless rows omit + // projectPath and do not expand a project directory. + HookOriginPlugin HookOrigin = "plugin" + // Hook enforced by centrally managed policy. + HookOriginPolicy HookOrigin = "policy" + // Hook loaded from repository settings or the repository hook directory. + HookOriginRepository HookOrigin = "repository" + // Hook loaded from user settings or the user's hook directory. + HookOriginUser HookOrigin = "user" +) + +// Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally +// support callback-only events. // Experimental: HookType is part of an experimental API and may change or be removed. type HookType string @@ -19348,6 +19468,32 @@ func (a *ServerExtensionsAPI) Enable(ctx context.Context, params *DiscoveredExte return &result, nil } +// Experimental: ServerHooksAPI contains experimental APIs that may change or be removed. +type ServerHooksAPI serverAPI + +// Discovers hook actions enabled under server-side discovery settings from user, +// repository, plugin, and managed-policy sources. +// +// RPC method: hooks.discover. +// +// Parameters: Optional project paths and host-exclusion behavior for server-scoped hook +// discovery. +// +// Returns: Server-discovered hook actions and partial-load diagnostics from user, +// repository, plugin, and managed-policy sources. Concrete sessions may include additional +// session-specific hook sources. +func (a *ServerHooksAPI) Discover(ctx context.Context, params *HooksDiscoverRequest) (*HooksDiscoverResult, error) { + raw, err := a.client.Request(ctx, "hooks.discover", params) + if err != nil { + return nil, err + } + var result HooksDiscoverResult + 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 @@ -20332,6 +20478,31 @@ func (a *ServerSessionsAPI) PruneOld(ctx context.Context, params *SessionsPruneO return &result, nil } +// ReadPersistedEvents reads a page of durable events directly from a local session's +// persisted journal without creating, resuming, or activating the session. The initial +// backward read uses a bounded tail scan for fast first paint; cursor continuations +// preserve the session event-log paging semantics. Persisted events may omit payloads that +// are reconstructed only for an active session. +// +// RPC method: sessions.readPersistedEvents. +// +// Parameters: Pagination options for reading an inactive or active local session's +// persisted event journal. +// +// Returns: Batch of session events returned by a read, with cursor and continuation +// metadata. +func (a *ServerSessionsAPI) ReadPersistedEvents(ctx context.Context, params *SessionsReadPersistedEventsRequest) (*EventsReadResult, error) { + raw, err := a.client.Request(ctx, "sessions.readPersistedEvents", params) + if err != nil { + return nil, err + } + var result EventsReadResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // ReleaseLock releases the in-use lock held by this process for a session. // // RPC method: sessions.releaseLock. @@ -20705,6 +20876,7 @@ type ServerRPC struct { Catalog *ServerCatalogAPI Commands *ServerCommandsAPI Extensions *ServerExtensionsAPI + Hooks *ServerHooksAPI Instructions *ServerInstructionsAPI LlmInference *ServerLlmInferenceAPI ManagedSettings *ServerManagedSettingsAPI @@ -20769,6 +20941,7 @@ func NewServerRPC(client *jsonrpc2.Client) *ServerRPC { r.Catalog = (*ServerCatalogAPI)(&r.common) r.Commands = (*ServerCommandsAPI)(&r.common) r.Extensions = (*ServerExtensionsAPI)(&r.common) + r.Hooks = (*ServerHooksAPI)(&r.common) r.Instructions = (*ServerInstructionsAPI)(&r.common) r.LlmInference = (*ServerLlmInferenceAPI)(&r.common) r.ManagedSettings = (*ServerManagedSettingsAPI)(&r.common) diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index 05e372402b..bbe9fbc74b 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -47,6 +47,12 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeAssistantFusionPhaseActivity: + var d AssistantFusionPhaseActivityData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeAssistantFusionPhaseCompleted: var d AssistantFusionPhaseCompletedData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -443,6 +449,12 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionCompletionReceipt: + var d SessionCompletionReceiptData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionContextChanged: var d SessionContextChangedData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -864,6 +876,7 @@ func (r *UserMessageData) UnmarshalJSON(data []byte) error { Delivery *UserMessageDelivery `json:"delivery,omitempty"` InteractionID *string `json:"interactionId,omitempty"` IsAutopilotContinuation *bool `json:"isAutopilotContinuation,omitempty"` + MessageID *string `json:"messageId,omitempty"` NativeDocumentPathFallbackPaths []string `json:"nativeDocumentPathFallbackPaths,omitzero"` ParentAgentTaskID *string `json:"parentAgentTaskId,omitempty"` Source *string `json:"source,omitempty"` @@ -890,6 +903,7 @@ func (r *UserMessageData) UnmarshalJSON(data []byte) error { r.Delivery = raw.Delivery r.InteractionID = raw.InteractionID r.IsAutopilotContinuation = raw.IsAutopilotContinuation + r.MessageID = raw.MessageID r.NativeDocumentPathFallbackPaths = raw.NativeDocumentPathFallbackPaths r.ParentAgentTaskID = raw.ParentAgentTaskID r.Source = raw.Source @@ -2101,6 +2115,7 @@ func (r PermissionPromptRequestWrite) MarshalJSON() ([]byte, error) { func (r *PermissionRequestedData) UnmarshalJSON(data []byte) error { type rawPermissionRequestedData struct { + AgentMode *SessionMode `json:"agentMode,omitempty"` PermissionRequest json.RawMessage `json:"permissionRequest"` PromptRequest json.RawMessage `json:"promptRequest,omitempty"` RequestID string `json:"requestId"` @@ -2111,6 +2126,7 @@ func (r *PermissionRequestedData) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &raw); err != nil { return err } + r.AgentMode = raw.AgentMode if raw.PermissionRequest != nil { value, err := unmarshalPermissionRequest(raw.PermissionRequest) if err != nil { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 0f93b52f18..a7d9d43af3 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -55,6 +55,9 @@ type SessionEventType string const ( SessionEventTypeAbort SessionEventType = "abort" SessionEventTypeAgentInterrupted SessionEventType = "agent.interrupted" + // Experimental: SessionEventTypeAssistantFusionPhaseActivity identifies an experimental + // event that may change or be removed. + SessionEventTypeAssistantFusionPhaseActivity SessionEventType = "assistant.fusion_phase_activity" // Experimental: SessionEventTypeAssistantFusionPhaseCompleted identifies an experimental // event that may change or be removed. SessionEventTypeAssistantFusionPhaseCompleted SessionEventType = "assistant.fusion_phase_completed" @@ -146,9 +149,12 @@ const ( SessionEventTypeSessionCanvasRemoved SessionEventType = "session.canvas.removed" // Experimental: SessionEventTypeSessionCanvasUnavailable identifies an experimental event // that may change or be removed. - SessionEventTypeSessionCanvasUnavailable SessionEventType = "session.canvas.unavailable" - SessionEventTypeSessionCompactionComplete SessionEventType = "session.compaction_complete" - SessionEventTypeSessionCompactionStart SessionEventType = "session.compaction_start" + SessionEventTypeSessionCanvasUnavailable SessionEventType = "session.canvas.unavailable" + SessionEventTypeSessionCompactionComplete SessionEventType = "session.compaction_complete" + SessionEventTypeSessionCompactionStart SessionEventType = "session.compaction_start" + // Experimental: SessionEventTypeSessionCompletionReceipt identifies an experimental event + // that may change or be removed. + SessionEventTypeSessionCompletionReceipt SessionEventType = "session.completion_receipt" SessionEventTypeSessionContextChanged SessionEventType = "session.context_changed" SessionEventTypeSessionContextCleared SessionEventType = "session.context_cleared" SessionEventTypeSessionCustomAgentsUpdated SessionEventType = "session.custom_agents_updated" @@ -474,6 +480,32 @@ func (*SessionAutopilotObjectiveChangedData) Type() SessionEventType { return SessionEventTypeSessionAutopilotObjectiveChanged } +// Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted. +// Experimental: SessionCompletionReceiptData is part of an experimental API and may change or be removed. +type SessionCompletionReceiptData struct { + // One-based accepted completion receipt ordinal in the durable session history. + Attempt int64 `json:"attempt"` + // Inclusive durable event range summarized by this receipt. + EventRange CompletionReceiptEventRange `json:"eventRange"` + // Number of failed structured tool completions in the covered range. + FailedToolCount int64 `json:"failedToolCount"` + // Final structured tool completion in the covered range, when one exists. + FinalTool *CompletionReceiptFinalTool `json:"finalTool,omitempty"` + // Version of the completion receipt payload. + SchemaVersion int64 `json:"schemaVersion"` + // Identifier of the assistant turn-end event that supplied the accepted completion boundary. This is the receipt's idempotency key, and always equals eventRange.endEventId. + SourceEventID string `json:"sourceEventId"` + // Runtime reason the completion decision was accepted. + StopReason CompletionReceiptStopReason `json:"stopReason"` + // Number of successful structured tool completions in the covered range. + SuccessfulToolCount int64 `json:"successfulToolCount"` +} + +func (*SessionCompletionReceiptData) sessionEventData() {} +func (*SessionCompletionReceiptData) Type() SessionEventType { + return SessionEventTypeSessionCompletionReceipt +} + // Canonical bytes for a content-addressed binary asset shared by reference across events type SessionBinaryAssetData struct { // Content-addressed id for this binary asset (e.g. "sha256:..."). @@ -883,6 +915,34 @@ type SessionErrorData struct { func (*SessionErrorData) sessionEventData() {} func (*SessionErrorData) Type() SessionEventType { return SessionEventTypeSessionError } +// Experimental content-safe activity signal for a running HydraFusion phase. +// Experimental: AssistantFusionPhaseActivityData is part of an experimental API and may change or be removed. +type AssistantFusionPhaseActivityData struct { + // Kind of real activity observed. + Activity FusionPhaseActivityKind `json:"activity"` + // Conversation scope in which the phase executes. + ConversationScope FusionConversationScope `json:"conversationScope"` + // Identifier of the HydraFusion turn containing the phase. + FusionID string `json:"fusionId"` + // HydraFusion orchestration pattern containing the phase. + Pattern FusionPattern `json:"pattern"` + // Stable identifier for the concrete phase. + PhaseID string `json:"phaseId"` + // Kind of phase currently executing. + PhaseKind FusionPhaseKind `json:"phaseKind"` + // Semantic role assigned to the phase. + Role string `json:"role"` + // Opaque hashed correlation token for matching tool-started and tool-completed activity within this Fusion activity stream. It is not the tool call identifier exposed by tool lifecycle events. + ToolCallID *string `json:"toolCallId,omitempty"` + // Cumulative private response bytes observed for this model call. The event never includes response text. + TotalResponseSizeBytes *int64 `json:"totalResponseSizeBytes,omitempty"` +} + +func (*AssistantFusionPhaseActivityData) sessionEventData() {} +func (*AssistantFusionPhaseActivityData) Type() SessionEventType { + return SessionEventTypeAssistantFusionPhaseActivity +} + // Experimental durable HydraFusion phase output and lossless replay checkpoint. // Experimental: AssistantFusionPhaseCompletedData is part of an experimental API and may change or be removed. type AssistantFusionPhaseCompletedData struct { @@ -1045,6 +1105,9 @@ type SessionFusionResolvedData struct { ModelUniverseVersion *string `json:"modelUniverseVersion,omitempty"` // Validated orchestration pattern selected for the turn. Pattern FusionPattern `json:"pattern"` + // Presentation-neutral phase plan for clients that render workflow progress. + // Experimental: PhasePlan is part of an experimental API and may change or be removed. + PhasePlan []FusionPhasePlanStep `json:"phasePlan,omitzero"` // Version of the validated execution-plan format. PlanVersion *string `json:"planVersion,omitempty"` // HydraFusion routing policy used to resolve the plan. @@ -1817,6 +1880,8 @@ type UserMessageData struct { InteractionID *string `json:"interactionId,omitempty"` // True when this user message was auto-injected by autopilot's continuation loop rather than typed by the user; used to distinguish autopilot-driven turns in telemetry. IsAutopilotContinuation *bool `json:"isAutopilotContinuation,omitempty"` + // Stable identity of the logical user message, matching the ID returned by send and retained by pending queue snapshots + MessageID *string `json:"messageId,omitempty"` // Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit NativeDocumentPathFallbackPaths []string `json:"nativeDocumentPathFallbackPaths,omitzero"` // Parent agent task ID for background telemetry correlated to this user turn @@ -1849,6 +1914,8 @@ func (*PermissionCompletedData) Type() SessionEventType { return SessionEventTyp // Permission request notification requiring client approval with request details type PermissionRequestedData struct { + // Agent mode captured from the owning turn when permission evaluation began. + AgentMode *SessionMode `json:"agentMode,omitempty"` // Details of the permission being requested PermissionRequest PermissionRequest `json:"permissionRequest"` // Derived user-facing permission prompt details for UI consumers @@ -2459,6 +2526,8 @@ type SubagentCompletedData struct { FirstDispatchedModel *string `json:"firstDispatchedModel,omitempty"` // Model used by the sub-agent Model *string `json:"model,omitempty"` + // Why an explicit task-call model did not become the effective model + ModelOverrideReason *string `json:"modelOverrideReason,omitempty"` // Tool call ID of the parent tool invocation that spawned this sub-agent ToolCallID string `json:"toolCallId"` // Total tokens (input + output) consumed by the sub-agent @@ -2492,6 +2561,8 @@ type SubagentFailedData struct { FirstDispatchedModel *string `json:"firstDispatchedModel,omitempty"` // Model selected for the sub-agent, when known Model *string `json:"model,omitempty"` + // Why an explicit task-call model did not become the effective model + ModelOverrideReason *string `json:"modelOverrideReason,omitempty"` // Tool call ID of the parent tool invocation that spawned this sub-agent ToolCallID string `json:"toolCallId"` // Total tokens (input + output) consumed before the sub-agent failed @@ -3123,7 +3194,27 @@ type CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail struct { TokenType string `json:"tokenType"` } -// A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and model override. +// Inclusive durable event range summarized by a completion receipt. +type CompletionReceiptEventRange struct { + // Identifier of the assistant turn-end event that ends the covered exchange. Always equals the receipt's sourceEventId, so either field is a valid join key. + EndEventID string `json:"endEventId"` + // Identifier of the user message that starts the covered exchange. + StartEventID string `json:"startEventId"` +} + +// Final structured tool completion in the covered event range. +type CompletionReceiptFinalTool struct { + // Process exit code from a structured shell result, when available. + ExitCode *int64 `json:"exitCode,omitempty"` + // Structured success or failure status from the tool completion event. + Status CompletionReceiptToolStatus `json:"status"` + // Unique identifier of the completed tool call. + ToolCallID string `json:"toolCallId"` + // Tool name from the matching tool execution start event, when available. + ToolName *string `json:"toolName,omitempty"` +} + +// A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and authored model configuration. type CustomAgentsUpdatedAgent struct { // Description of what the agent does Description string `json:"description"` @@ -3133,6 +3224,10 @@ type CustomAgentsUpdatedAgent struct { ID string `json:"id"` // Model override for this agent, if set Model *string `json:"model,omitempty"` + // Whether authored models are preferences or required constraints + ModelPolicy *AgentModelPolicy `json:"modelPolicy,omitempty"` + // Authored model ids in priority order, if configured + Models []string `json:"models,omitzero"` // Internal name of the agent Name string `json:"name"` // Source location: user, project, inherited, remote, or plugin @@ -3209,6 +3304,19 @@ type FusionFollowUpRecommendation struct { UserTurn FusionFollowUpAction `json:"userTurn"` } +// Presentation-neutral phase planned for a HydraFusion turn. +// Experimental: FusionPhasePlanStep is part of an experimental API and may change or be removed. +type FusionPhasePlanStep struct { + // Whether the phase executes only when an earlier phase requests it. + Conditional bool `json:"conditional"` + // Kind of phase that may execute. + Kind FusionPhaseKind `json:"kind"` + // Semantic role assigned to the phase. + Role string `json:"role"` + // Conversation scope in which the phase executes. + Scope FusionConversationScope `json:"scope"` +} + // Aggregate concrete-model usage for one HydraFusion phase. // Experimental: FusionPhaseUsage is part of an experimental API and may change or be removed. type FusionPhaseUsage struct { @@ -5068,6 +5176,34 @@ const ( CompactionTriggerThreshold CompactionTrigger = "threshold" ) +// Runtime reason the completion decision was accepted. +type CompletionReceiptStopReason string + +const ( + // The configured agentStop continuation limit was reached. + CompletionReceiptStopReasonAgentStopBlockLimit CompletionReceiptStopReason = "agent_stop_block_limit" + // The model reached a natural terminal response. + CompletionReceiptStopReasonNatural CompletionReceiptStopReason = "natural" + // A terminal tool ended the interaction. + CompletionReceiptStopReasonTerminalTool CompletionReceiptStopReason = "terminal_tool" +) + +// Structured terminal status from a tool completion event. +type CompletionReceiptToolStatus string + +const ( + // The permissions service denied the tool call. + CompletionReceiptToolStatusDenied CompletionReceiptToolStatus = "denied" + // The tool failed without a more specific structured status. + CompletionReceiptToolStatusFailure CompletionReceiptToolStatus = "failure" + // The user rejected the tool call. + CompletionReceiptToolStatusRejected CompletionReceiptToolStatus = "rejected" + // The tool completed successfully. + CompletionReceiptToolStatusSuccess CompletionReceiptToolStatus = "success" + // The tool exceeded its time budget. + CompletionReceiptToolStatusTimeout CompletionReceiptToolStatus = "timeout" +) + // The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed) type ElicitationCompletedAction string @@ -5198,6 +5334,19 @@ const ( FusionPatternSingle FusionPattern = "single" ) +// Content-safe activity observed while a HydraFusion phase is running. +// Experimental: FusionPhaseActivityKind is part of an experimental API and may change or be removed. +type FusionPhaseActivityKind string + +const ( + // The provider produced additional private output bytes. + FusionPhaseActivityKindModelOutput FusionPhaseActivityKind = "model_output" + // A tool finished executing inside the phase. + FusionPhaseActivityKindToolCompleted FusionPhaseActivityKind = "tool_completed" + // A tool began executing inside the phase. + FusionPhaseActivityKindToolStarted FusionPhaseActivityKind = "tool_started" +) + // HydraFusion phase kind. // Experimental: FusionPhaseKind is part of an experimental API and may change or be removed. type FusionPhaseKind string diff --git a/go/zsession_events.go b/go/zsession_events.go index 360f1a7588..8e8371cade 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -12,6 +12,8 @@ type ( AgentInterruptedActivity = rpc.AgentInterruptedActivity AgentInterruptedCancelPhase = rpc.AgentInterruptedCancelPhase AgentInterruptedData = rpc.AgentInterruptedData + AgentModelPolicy = rpc.AgentModelPolicy + AssistantFusionPhaseActivityData = rpc.AssistantFusionPhaseActivityData AssistantFusionPhaseCompletedData = rpc.AssistantFusionPhaseCompletedData AssistantFusionPhaseFailedData = rpc.AssistantFusionPhaseFailedData AssistantFusionPhaseStartedData = rpc.AssistantFusionPhaseStartedData @@ -97,6 +99,10 @@ type ( CompactionCompleteCompactionTokensUsed = rpc.CompactionCompleteCompactionTokensUsed CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail = rpc.CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail CompactionTrigger = rpc.CompactionTrigger + CompletionReceiptEventRange = rpc.CompletionReceiptEventRange + CompletionReceiptFinalTool = rpc.CompletionReceiptFinalTool + CompletionReceiptStopReason = rpc.CompletionReceiptStopReason + CompletionReceiptToolStatus = rpc.CompletionReceiptToolStatus ContextTier = rpc.ContextTier CustomAgentsUpdatedAgent = rpc.CustomAgentsUpdatedAgent ElicitationCompletedAction = rpc.ElicitationCompletedAction @@ -126,7 +132,9 @@ type ( FusionFollowUpAction = rpc.FusionFollowUpAction FusionFollowUpRecommendation = rpc.FusionFollowUpRecommendation FusionPattern = rpc.FusionPattern + FusionPhaseActivityKind = rpc.FusionPhaseActivityKind FusionPhaseKind = rpc.FusionPhaseKind + FusionPhasePlanStep = rpc.FusionPhasePlanStep FusionPhaseStatus = rpc.FusionPhaseStatus FusionPhaseUsage = rpc.FusionPhaseUsage FusionScores = rpc.FusionScores @@ -265,6 +273,7 @@ type ( SessionCanvasUnavailableData = rpc.SessionCanvasUnavailableData SessionCompactionCompleteData = rpc.SessionCompactionCompleteData SessionCompactionStartData = rpc.SessionCompactionStartData + SessionCompletionReceiptData = rpc.SessionCompletionReceiptData SessionContextChangedData = rpc.SessionContextChangedData SessionContextClearedData = rpc.SessionContextClearedData SessionCustomAgentsUpdatedData = rpc.SessionCustomAgentsUpdatedData @@ -427,6 +436,8 @@ const ( AgentInterruptedActivityToolCall = rpc.AgentInterruptedActivityToolCall AgentInterruptedCancelPhaseMidStream = rpc.AgentInterruptedCancelPhaseMidStream AgentInterruptedCancelPhasePreFirstToken = rpc.AgentInterruptedCancelPhasePreFirstToken + AgentModelPolicyPreferred = rpc.AgentModelPolicyPreferred + AgentModelPolicyRequired = rpc.AgentModelPolicyRequired AssistantMessageToolRequestCallerTypeProgram = rpc.AssistantMessageToolRequestCallerTypeProgram AssistantMessageToolRequestTypeCustom = rpc.AssistantMessageToolRequestTypeCustom AssistantMessageToolRequestTypeFunction = rpc.AssistantMessageToolRequestTypeFunction @@ -491,6 +502,14 @@ const ( CompactionTriggerMemoryPressure = rpc.CompactionTriggerMemoryPressure CompactionTriggerModelSwitch = rpc.CompactionTriggerModelSwitch CompactionTriggerThreshold = rpc.CompactionTriggerThreshold + CompletionReceiptStopReasonAgentStopBlockLimit = rpc.CompletionReceiptStopReasonAgentStopBlockLimit + CompletionReceiptStopReasonNatural = rpc.CompletionReceiptStopReasonNatural + CompletionReceiptStopReasonTerminalTool = rpc.CompletionReceiptStopReasonTerminalTool + CompletionReceiptToolStatusDenied = rpc.CompletionReceiptToolStatusDenied + CompletionReceiptToolStatusFailure = rpc.CompletionReceiptToolStatusFailure + CompletionReceiptToolStatusRejected = rpc.CompletionReceiptToolStatusRejected + CompletionReceiptToolStatusSuccess = rpc.CompletionReceiptToolStatusSuccess + CompletionReceiptToolStatusTimeout = rpc.CompletionReceiptToolStatusTimeout ContextTierDefault = rpc.ContextTierDefault ContextTierLongContext = rpc.ContextTierLongContext ElicitationCompletedActionAccept = rpc.ElicitationCompletedActionAccept @@ -524,6 +543,9 @@ const ( FusionPatternCascade = rpc.FusionPatternCascade FusionPatternCritique = rpc.FusionPatternCritique FusionPatternSingle = rpc.FusionPatternSingle + FusionPhaseActivityKindModelOutput = rpc.FusionPhaseActivityKindModelOutput + FusionPhaseActivityKindToolCompleted = rpc.FusionPhaseActivityKindToolCompleted + FusionPhaseActivityKindToolStarted = rpc.FusionPhaseActivityKindToolStarted FusionPhaseKindCritic = rpc.FusionPhaseKindCritic FusionPhaseKindDraft = rpc.FusionPhaseKindDraft FusionPhaseKindFollowUp = rpc.FusionPhaseKindFollowUp @@ -671,6 +693,7 @@ const ( ScheduleOriginUser = rpc.ScheduleOriginUser SessionEventTypeAbort = rpc.SessionEventTypeAbort SessionEventTypeAgentInterrupted = rpc.SessionEventTypeAgentInterrupted + SessionEventTypeAssistantFusionPhaseActivity = rpc.SessionEventTypeAssistantFusionPhaseActivity SessionEventTypeAssistantFusionPhaseCompleted = rpc.SessionEventTypeAssistantFusionPhaseCompleted SessionEventTypeAssistantFusionPhaseFailed = rpc.SessionEventTypeAssistantFusionPhaseFailed SessionEventTypeAssistantFusionPhaseStarted = rpc.SessionEventTypeAssistantFusionPhaseStarted @@ -737,6 +760,7 @@ const ( SessionEventTypeSessionCanvasUnavailable = rpc.SessionEventTypeSessionCanvasUnavailable SessionEventTypeSessionCompactionComplete = rpc.SessionEventTypeSessionCompactionComplete SessionEventTypeSessionCompactionStart = rpc.SessionEventTypeSessionCompactionStart + SessionEventTypeSessionCompletionReceipt = rpc.SessionEventTypeSessionCompletionReceipt SessionEventTypeSessionContextChanged = rpc.SessionEventTypeSessionContextChanged SessionEventTypeSessionContextCleared = rpc.SessionEventTypeSessionContextCleared SessionEventTypeSessionCustomAgentsUpdated = rpc.SessionEventTypeSessionCustomAgentsUpdated diff --git a/java/pom.xml b/java/pom.xml index f053f39ad7..7bbc1c8ce6 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -63,7 +63,7 @@ DO NOT EDIT MANUALLY. Updated by the update-copilot-dependency workflow. --> - ^1.0.83-1 + ^1.0.83-2 true diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index 8d3292a1b0..31e908aca7 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.83-1", + "@github/copilot": "^1.0.83-2", "json-schema": "^0.4.0", "tsx": "^4.23.13" } @@ -428,9 +428,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.83-1", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.83-1.tgz", - "integrity": "sha512-7rhgbgSx7IgfFYXrTx2/2+qowv6MZjC6BN0mhba37RuGQxsca9Zk2ucAeIX3GbQTp91AhvnN0aHCxabX36xADQ==", + "version": "1.0.83-2", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.83-2.tgz", + "integrity": "sha512-ntRvwGdZbZJjOvdV3LVBQ7z69W19DO4MWe/dh6pP8kYeumbzC4udVj7mCtoSwBOs0hwXirhXY+BZwqSJUp5FLQ==", "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.83-1", - "@github/copilot-darwin-x64": "1.0.83-1", - "@github/copilot-linux-arm64": "1.0.83-1", - "@github/copilot-linux-x64": "1.0.83-1", - "@github/copilot-linuxmusl-arm64": "1.0.83-1", - "@github/copilot-linuxmusl-x64": "1.0.83-1", - "@github/copilot-win32-arm64": "1.0.83-1", - "@github/copilot-win32-x64": "1.0.83-1" + "@github/copilot-darwin-arm64": "1.0.83-2", + "@github/copilot-darwin-x64": "1.0.83-2", + "@github/copilot-linux-arm64": "1.0.83-2", + "@github/copilot-linux-x64": "1.0.83-2", + "@github/copilot-linuxmusl-arm64": "1.0.83-2", + "@github/copilot-linuxmusl-x64": "1.0.83-2", + "@github/copilot-win32-arm64": "1.0.83-2", + "@github/copilot-win32-x64": "1.0.83-2" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.83-1", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.83-1.tgz", - "integrity": "sha512-gxYJEd4yoIBIQHRmJw6ZegSkR6VuNm7AJVdAdARcU0SS68VZjtZFT29luThAp75Pxp37S5w+3A/jQNtxGyHizw==", + "version": "1.0.83-2", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.83-2.tgz", + "integrity": "sha512-RBjF/zTJe+gp9PsthYtIHF36+y3A3Zv3w/2FAa9nHF6ople1+lYoQ0OC1z6tWQSpBx3n/fSkNt0ebMmfhWlQyw==", "cpu": [ "arm64" ], @@ -466,9 +466,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.83-1", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.83-1.tgz", - "integrity": "sha512-PL63+Ib1RH+Bpu2UYJ9E8tmD4NZD/YlhD25F1Q9Rb86AdgLEoRYlxjNxXXF9P9dMmJ/u5zm0rUtWIRxv/FRbPg==", + "version": "1.0.83-2", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.83-2.tgz", + "integrity": "sha512-GzaarluCiHUA4yrYxWIFEklwPLTYjxGvLyYjI0wW5IPseT7GLFjN7AkDGRU4Ny/mxTj1MbUEsJAWVtiNy5EUHg==", "cpu": [ "x64" ], @@ -482,9 +482,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.83-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.83-1.tgz", - "integrity": "sha512-7c4RVEuXQu9zepAWoXwkizpESztUbWUR1hLPl+o+19L+D8fXm+5XQRH5E22Ia7P7/xHW3Ml2o2x5cXFq0k7/7w==", + "version": "1.0.83-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.83-2.tgz", + "integrity": "sha512-iGD5Pc7vnzrAjqTK/BrI8MDtMqXyxUe7P6u8TiGt+4DzKe3v2myT6eFQ+z/JJOHNpiu6LUpTDzwS8WttZqqJpA==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.83-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.83-1.tgz", - "integrity": "sha512-Be0zUVysLYV66pnOPhMxpShQ8Ox5V07qcsSOoNzG7iwpzkfZuf70U9CHk/fnI//mWwmZR+caPUfVM9BpwrdNnA==", + "version": "1.0.83-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.83-2.tgz", + "integrity": "sha512-jOQwz075vRWat+RJiMNtD+7vm4DQ83Dvw4iakpNkLfqWMPXlliVr/tqL+SffeSo87LnhOKobZOJOjELS27drdg==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.83-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.83-1.tgz", - "integrity": "sha512-PZNP8vZZJU8yIc3dNjGUBUCFPNjqZs8FPZLDxvL6XdHM7Ep4cLBa+QdbRsw+nZONIaG0GtQf26eqk5ymYYpUPA==", + "version": "1.0.83-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.83-2.tgz", + "integrity": "sha512-6/+ByEBEV/vDofrCymaKrEZ5/p+TVHQfgWu8ywvWEPALfxj/iHpAF3grM2bj7uED4C19LTSarHNCkCqdrAUzIQ==", "cpu": [ "arm64" ], @@ -530,9 +530,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.83-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.83-1.tgz", - "integrity": "sha512-uKMhGtg5K07nA5/pxDSq8S5F/I+sMgVhUXg90Y4BI9trOidgxpXpCVyh4TeRNj2ENNugPvATdfGc6eFPsjmlgQ==", + "version": "1.0.83-2", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.83-2.tgz", + "integrity": "sha512-8dbiPUHaDemDibLfKXDe5xublJxt6fOht4yYDk/ikmOGAVezBUwRVO27PchXQBwGjP2PVNAASkv2WB4Ubw72lA==", "cpu": [ "x64" ], @@ -546,9 +546,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.83-1", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.83-1.tgz", - "integrity": "sha512-vMxHTmv3SotBuNI4LKcIFckd+n0OvhTik27qjsqOnVqFpvmHDghSsa8YPxySyxUQIE35z5pJaivVBK3dfEAY7w==", + "version": "1.0.83-2", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.83-2.tgz", + "integrity": "sha512-ZE1iUXlJSnNIH+VoRG96emy2e7jMJm85/pcKCrgLvqhDAcQSqiqLVv3OJp2VX2IcDxToOpiaGccU8Ab9zHQqkQ==", "cpu": [ "arm64" ], @@ -562,9 +562,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.83-1", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.83-1.tgz", - "integrity": "sha512-2l0VVTazW3/+p94ZQ5sAPCj1iH7KWxJAYh4yXWfvpsB/1JEEmyVgpLei1MeaMFVdtp/hi9bGprZ9+zWNlHh5hQ==", + "version": "1.0.83-2", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.83-2.tgz", + "integrity": "sha512-qfturLon+1oaWqSaXCISL6BEf5K+ijJFl0m/OZwstWYSlIlaE2+iOz5LcRukoxm25OG1JZDHQFp1k2PY2A+LbA==", "cpu": [ "x64" ], diff --git a/java/scripts/codegen/package.json b/java/scripts/codegen/package.json index 4e7c52ff8a..f5b28608a9 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.83-1", + "@github/copilot": "^1.0.83-2", "json-schema": "^0.4.0", "tsx": "^4.23.13" } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AgentModelPolicy.java b/java/sdk/src/generated/java/com/github/copilot/generated/AgentModelPolicy.java new file mode 100644 index 0000000000..06c80ba22e --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AgentModelPolicy.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Whether configured models are advisory preferences or required constraints + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AgentModelPolicy { + /** The {@code preferred} variant. */ + PREFERRED("preferred"), + /** The {@code required} variant. */ + REQUIRED("required"); + + private final String value; + AgentModelPolicy(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AgentModelPolicy fromValue(String value) { + for (AgentModelPolicy v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AgentModelPolicy value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseActivityEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseActivityEvent.java new file mode 100644 index 0000000000..64d8d58283 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseActivityEvent.java @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "assistant.fusion_phase_activity". Experimental content-safe activity signal for a running HydraFusion phase. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantFusionPhaseActivityEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.fusion_phase_activity"; } + + @JsonProperty("data") + private AssistantFusionPhaseActivityEventData data; + + public AssistantFusionPhaseActivityEventData getData() { return data; } + public void setData(AssistantFusionPhaseActivityEventData data) { this.data = data; } + + /** Data payload for {@link AssistantFusionPhaseActivityEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantFusionPhaseActivityEventData( + /** Identifier of the HydraFusion turn containing the phase. */ + @JsonProperty("fusionId") String fusionId, + /** Stable identifier for the concrete phase. */ + @JsonProperty("phaseId") String phaseId, + /** Kind of phase currently executing. */ + @JsonProperty("phaseKind") FusionPhaseKind phaseKind, + /** HydraFusion orchestration pattern containing the phase. */ + @JsonProperty("pattern") FusionPattern pattern, + /** Semantic role assigned to the phase. */ + @JsonProperty("role") String role, + /** Conversation scope in which the phase executes. */ + @JsonProperty("conversationScope") FusionConversationScope conversationScope, + /** Kind of real activity observed. */ + @JsonProperty("activity") FusionPhaseActivityKind activity, + /** Cumulative private response bytes observed for this model call. The event never includes response text. */ + @JsonProperty("totalResponseSizeBytes") Long totalResponseSizeBytes, + /** Opaque hashed correlation token for matching tool-started and tool-completed activity within this Fusion activity stream. It is not the tool call identifier exposed by tool lifecycle events. */ + @JsonProperty("toolCallId") String toolCallId + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptEventRange.java b/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptEventRange.java new file mode 100644 index 0000000000..7b05d1c9cd --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptEventRange.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Inclusive durable event range summarized by a completion receipt. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CompletionReceiptEventRange( + /** Identifier of the user message that starts the covered exchange. */ + @JsonProperty("startEventId") String startEventId, + /** Identifier of the assistant turn-end event that ends the covered exchange. Always equals the receipt's sourceEventId, so either field is a valid join key. */ + @JsonProperty("endEventId") String endEventId +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptFinalTool.java b/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptFinalTool.java new file mode 100644 index 0000000000..74d78d7ee1 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptFinalTool.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Final structured tool completion in the covered event range. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CompletionReceiptFinalTool( + /** Unique identifier of the completed tool call. */ + @JsonProperty("toolCallId") String toolCallId, + /** Tool name from the matching tool execution start event, when available. */ + @JsonProperty("toolName") String toolName, + /** Structured success or failure status from the tool completion event. */ + @JsonProperty("status") CompletionReceiptToolStatus status, + /** Process exit code from a structured shell result, when available. */ + @JsonProperty("exitCode") Long exitCode +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptStopReason.java b/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptStopReason.java new file mode 100644 index 0000000000..49874b0275 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptStopReason.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Runtime reason the completion decision was accepted. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum CompletionReceiptStopReason { + /** The {@code natural} variant. */ + NATURAL("natural"), + /** The {@code terminal_tool} variant. */ + TERMINAL_TOOL("terminal_tool"), + /** The {@code agent_stop_block_limit} variant. */ + AGENT_STOP_BLOCK_LIMIT("agent_stop_block_limit"); + + private final String value; + CompletionReceiptStopReason(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static CompletionReceiptStopReason fromValue(String value) { + for (CompletionReceiptStopReason v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown CompletionReceiptStopReason value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptToolStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptToolStatus.java new file mode 100644 index 0000000000..e82a1e6986 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CompletionReceiptToolStatus.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Structured terminal status from a tool completion event. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum CompletionReceiptToolStatus { + /** The {@code success} variant. */ + SUCCESS("success"), + /** The {@code failure} variant. */ + FAILURE("failure"), + /** The {@code timeout} variant. */ + TIMEOUT("timeout"), + /** The {@code rejected} variant. */ + REJECTED("rejected"), + /** The {@code denied} variant. */ + DENIED("denied"); + + private final String value; + CompletionReceiptToolStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static CompletionReceiptToolStatus fromValue(String value) { + for (CompletionReceiptToolStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown CompletionReceiptToolStatus value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CustomAgentsUpdatedAgent.java b/java/sdk/src/generated/java/com/github/copilot/generated/CustomAgentsUpdatedAgent.java index c2f195e486..762f0b1ac8 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/CustomAgentsUpdatedAgent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CustomAgentsUpdatedAgent.java @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and model override. + * A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and authored model configuration. * * @since 1.0.0 */ @@ -37,6 +37,10 @@ public record CustomAgentsUpdatedAgent( /** Whether the agent can be selected by the user */ @JsonProperty("userInvocable") Boolean userInvocable, /** Model override for this agent, if set */ - @JsonProperty("model") String model + @JsonProperty("model") String model, + /** Authored model ids in priority order, if configured */ + @JsonProperty("models") List models, + /** Whether authored models are preferences or required constraints */ + @JsonProperty("modelPolicy") AgentModelPolicy modelPolicy ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseActivityKind.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseActivityKind.java new file mode 100644 index 0000000000..a95a08cf91 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseActivityKind.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Content-safe activity observed while a HydraFusion phase is running. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FusionPhaseActivityKind { + /** The {@code model_output} variant. */ + MODEL_OUTPUT("model_output"), + /** The {@code tool_started} variant. */ + TOOL_STARTED("tool_started"), + /** The {@code tool_completed} variant. */ + TOOL_COMPLETED("tool_completed"); + + private final String value; + FusionPhaseActivityKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FusionPhaseActivityKind fromValue(String value) { + for (FusionPhaseActivityKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FusionPhaseActivityKind value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhasePlanStep.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhasePlanStep.java new file mode 100644 index 0000000000..cfb07a789a --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhasePlanStep.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Presentation-neutral phase planned for a HydraFusion turn. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FusionPhasePlanStep( + /** Kind of phase that may execute. */ + @JsonProperty("kind") FusionPhaseKind kind, + /** Semantic role assigned to the phase. */ + @JsonProperty("role") String role, + /** Conversation scope in which the phase executes. */ + @JsonProperty("scope") FusionConversationScope scope, + /** Whether the phase executes only when an earlier phase requests it. */ + @JsonProperty("conditional") Boolean conditional +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/PermissionRequestedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionRequestedEvent.java index b7aae9ec80..a854d5ffa4 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/PermissionRequestedEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionRequestedEvent.java @@ -40,6 +40,8 @@ public record PermissionRequestedEventData( @JsonProperty("permissionRequest") Object permissionRequest, /** Derived user-facing permission prompt details for UI consumers */ @JsonProperty("promptRequest") Object promptRequest, + /** Agent mode captured from the owning turn when permission evaluation began. */ + @JsonProperty("agentMode") SessionMode agentMode, /** Neutral risk metadata supplied by the tool host. Consumers may display this value but must not use it to bypass the permission decision. */ @JsonProperty("riskAssessment") Object riskAssessment, /** When true, this permission was already resolved by a permissionRequest hook and requires no client action */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompletionReceiptEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompletionReceiptEvent.java new file mode 100644 index 0000000000..15670c992a --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompletionReceiptEvent.java @@ -0,0 +1,55 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.completion_receipt". Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCompletionReceiptEvent extends SessionEvent { + + @Override + public String getType() { return "session.completion_receipt"; } + + @JsonProperty("data") + private SessionCompletionReceiptEventData data; + + public SessionCompletionReceiptEventData getData() { return data; } + public void setData(SessionCompletionReceiptEventData data) { this.data = data; } + + /** Data payload for {@link SessionCompletionReceiptEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCompletionReceiptEventData( + /** Version of the completion receipt payload. */ + @JsonProperty("schemaVersion") Long schemaVersion, + /** One-based accepted completion receipt ordinal in the durable session history. */ + @JsonProperty("attempt") Long attempt, + /** Identifier of the assistant turn-end event that supplied the accepted completion boundary. This is the receipt's idempotency key, and always equals eventRange.endEventId. */ + @JsonProperty("sourceEventId") String sourceEventId, + /** Inclusive durable event range summarized by this receipt. */ + @JsonProperty("eventRange") CompletionReceiptEventRange eventRange, + /** Runtime reason the completion decision was accepted. */ + @JsonProperty("stopReason") CompletionReceiptStopReason stopReason, + /** Final structured tool completion in the covered range, when one exists. */ + @JsonProperty("finalTool") CompletionReceiptFinalTool finalTool, + /** Number of successful structured tool completions in the covered range. */ + @JsonProperty("successfulToolCount") Long successfulToolCount, + /** Number of failed structured tool completions in the covered range. */ + @JsonProperty("failedToolCount") Long failedToolCount + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java index bf5dc65769..193aa56b8f 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java @@ -56,6 +56,7 @@ @JsonSubTypes.Type(value = SessionCompactionStartEvent.class, name = "session.compaction_start"), @JsonSubTypes.Type(value = SessionCompactionCompleteEvent.class, name = "session.compaction_complete"), @JsonSubTypes.Type(value = SessionTaskCompleteEvent.class, name = "session.task_complete"), + @JsonSubTypes.Type(value = SessionCompletionReceiptEvent.class, name = "session.completion_receipt"), @JsonSubTypes.Type(value = SessionFusionRouteStartedEvent.class, name = "session.fusion_route_started"), @JsonSubTypes.Type(value = SessionFusionRouteFailedEvent.class, name = "session.fusion_route_failed"), @JsonSubTypes.Type(value = SessionFusionResolvedEvent.class, name = "session.fusion_resolved"), @@ -67,6 +68,7 @@ @JsonSubTypes.Type(value = AgentInterruptedEvent.class, name = "agent.interrupted"), @JsonSubTypes.Type(value = AssistantIntentEvent.class, name = "assistant.intent"), @JsonSubTypes.Type(value = AssistantFusionPhaseStartedEvent.class, name = "assistant.fusion_phase_started"), + @JsonSubTypes.Type(value = AssistantFusionPhaseActivityEvent.class, name = "assistant.fusion_phase_activity"), @JsonSubTypes.Type(value = AssistantFusionPhaseCompletedEvent.class, name = "assistant.fusion_phase_completed"), @JsonSubTypes.Type(value = AssistantFusionPhaseFailedEvent.class, name = "assistant.fusion_phase_failed"), @JsonSubTypes.Type(value = AssistantServerToolProgressEvent.class, name = "assistant.server_tool_progress"), @@ -190,6 +192,7 @@ public abstract sealed class SessionEvent permits SessionCompactionStartEvent, SessionCompactionCompleteEvent, SessionTaskCompleteEvent, + SessionCompletionReceiptEvent, SessionFusionRouteStartedEvent, SessionFusionRouteFailedEvent, SessionFusionResolvedEvent, @@ -201,6 +204,7 @@ public abstract sealed class SessionEvent permits AgentInterruptedEvent, AssistantIntentEvent, AssistantFusionPhaseStartedEvent, + AssistantFusionPhaseActivityEvent, AssistantFusionPhaseCompletedEvent, AssistantFusionPhaseFailedEvent, AssistantServerToolProgressEvent, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionResolvedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionResolvedEvent.java index 7553c6eb43..d63bee33b3 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionResolvedEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionResolvedEvent.java @@ -10,6 +10,7 @@ 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; /** @@ -62,6 +63,8 @@ public record SessionFusionResolvedEventData( @JsonProperty("scores") FusionScores scores, /** Validated orchestration pattern selected for the turn. */ @JsonProperty("pattern") FusionPattern pattern, + /** Presentation-neutral phase plan for clients that render workflow progress. */ + @JsonProperty("phasePlan") List phasePlan, /** Concrete model selected for the primary solver phase. */ @JsonProperty("primaryModel") String primaryModel, /** Concrete model selected for the review or judge phase, when required. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentCompletedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentCompletedEvent.java index 62f6803652..26459bb955 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentCompletedEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentCompletedEvent.java @@ -50,6 +50,8 @@ public record SubagentCompletedEventData( @JsonProperty("explicitModelOverride") String explicitModelOverride, /** Whether the explicit task-call model matched the user's configured preference */ @JsonProperty("explicitModelMatchesPreference") Boolean explicitModelMatchesPreference, + /** Why an explicit task-call model did not become the effective model */ + @JsonProperty("modelOverrideReason") String modelOverrideReason, /** Whether the first model actually dispatched matched the user's configured preference */ @JsonProperty("configuredModelMatchesActual") Boolean configuredModelMatchesActual, /** Total number of tool calls made by the sub-agent */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentFailedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentFailedEvent.java index 1d1413c64d..54464f8ddf 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentFailedEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentFailedEvent.java @@ -52,6 +52,8 @@ public record SubagentFailedEventData( @JsonProperty("explicitModelOverride") String explicitModelOverride, /** Whether the explicit task-call model matched the user's configured preference */ @JsonProperty("explicitModelMatchesPreference") Boolean explicitModelMatchesPreference, + /** Why an explicit task-call model did not become the effective model */ + @JsonProperty("modelOverrideReason") String modelOverrideReason, /** Whether the first model actually dispatched matched the user's configured preference */ @JsonProperty("configuredModelMatchesActual") Boolean configuredModelMatchesActual, /** Total number of tool calls made before the sub-agent failed */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/UserMessageEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/UserMessageEvent.java index 7d839087da..43a886ea01 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/UserMessageEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/UserMessageEvent.java @@ -37,6 +37,8 @@ public final class UserMessageEvent extends SessionEvent { public record UserMessageEventData( /** The user's message text as displayed in the timeline */ @JsonProperty("content") String content, + /** Stable identity of the logical user message, matching the ID returned by send and retained by pending queue snapshots */ + @JsonProperty("messageId") String messageId, /** Transformed version of the message sent to the model, with XML wrapping, timestamps, and other augmentations for prompt caching */ @JsonProperty("transformedContent") String transformedContent, /** Files, selections, or GitHub references attached to the message */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AgentInfo.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AgentInfo.java index f239c82e61..3d9f9c2d7e 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AgentInfo.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AgentInfo.java @@ -15,7 +15,7 @@ import javax.annotation.processing.Generated; /** - * Agent metadata, including identifiers, display details, source, tools, model, MCP servers, skills, and file path. + * Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path. * * @since 1.0.0 */ @@ -41,6 +41,10 @@ public record AgentInfo( @JsonProperty("tools") List tools, /** Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference. */ @JsonProperty("model") String model, + /** Authored preferred model ids for this agent, in priority order. Runtime model selection chooses the first available model; omitted means no authored preference. */ + @JsonProperty("models") List models, + /** Whether authored models are preferences or required constraints. */ + @JsonProperty("modelPolicy") AgentModelPolicy modelPolicy, /** MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema. */ @JsonProperty("mcpServers") Map mcpServers, /** Skill names preloaded into this agent's context. Omitted means none. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AgentModelPolicy.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AgentModelPolicy.java new file mode 100644 index 0000000000..99158516f0 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AgentModelPolicy.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; + +/** + * Whether configured models are advisory preferences or required constraints + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AgentModelPolicy { + /** The {@code preferred} variant. */ + PREFERRED("preferred"), + /** The {@code required} variant. */ + REQUIRED("required"); + + private final String value; + AgentModelPolicy(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AgentModelPolicy fromValue(String value) { + for (AgentModelPolicy v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AgentModelPolicy value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/DiscoveredHook.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/DiscoveredHook.java new file mode 100644 index 0000000000..fce707243d --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/DiscoveredHook.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * One server-discovered hook action from user, repository, plugin, or managed-policy configuration. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record DiscoveredHook( + /** Deterministic identifier for this server-discovered action row. It remains stable while the project, origin, source, event, action content, and duplicate ordinal are unchanged. This is row identity, not the key persisted in disabledHooks. */ + @JsonProperty("id") String id, + /** Hook event that invokes this action. */ + @JsonProperty("hookType") HookType hookType, + /** Configuration tier that contributed this hook action. */ + @JsonProperty("origin") HookOrigin origin, + /** Human-readable source label, such as a hook file path, settings source, or plugin name. */ + @JsonProperty("source") String source, + /** Input project path for which this server-side action was resolved. Set on every row returned for project-scoped discovery, including repeated user and policy actions. */ + @JsonProperty("projectPath") String projectPath, + /** Whether this action is enabled under the server-side discovery settings. Concrete sessions may differ because they can add session-specific directories, plugins, or trust. False when its disable key is present in the user's disabled-hooks setting or disable-all settings suppress the action. */ + @JsonProperty("enabled") Boolean enabled, + /** Durable content hash used by hook enablement. Identical actions may intentionally share this key. Omitted when changing the user's disabled-hooks setting cannot change the action's current server-discovered state, including managed-policy hooks, session-start prompt actions, actions suppressed by disable-all settings, and projectless plugin actions that require project-directory expansion. */ + @JsonProperty("disableKey") String disableKey +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HookOrigin.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HookOrigin.java new file mode 100644 index 0000000000..bf3bfd14cd --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HookOrigin.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Configuration tier that contributed a discovered hook action. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HookOrigin { + /** The {@code user} variant. */ + USER("user"), + /** The {@code repository} variant. */ + REPOSITORY("repository"), + /** The {@code plugin} variant. */ + PLUGIN("plugin"), + /** The {@code policy} variant. */ + POLICY("policy"); + + private final String value; + HookOrigin(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HookOrigin fromValue(String value) { + for (HookOrigin v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HookOrigin value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HookType.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HookType.java index 8d7cd913c3..1a185958de 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HookType.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HookType.java @@ -10,7 +10,7 @@ import javax.annotation.processing.Generated; /** - * Hook event name dispatched through the SDK callback transport. + * Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events. * * @since 1.0.0 */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HooksDiscoverParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HooksDiscoverParams.java new file mode 100644 index 0000000000..a0e7610394 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HooksDiscoverParams.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; + +/** + * Optional project paths and host-exclusion behavior for server-scoped hook discovery. + * + * @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 HooksDiscoverParams( + /** Optional project directory paths whose trusted repository and project-expanded plugin hooks should be discovered. When omitted or empty, user, managed-policy, and globally enabled installed or explicit plugin hooks are returned without project expansion. */ + @JsonProperty("projectPaths") List projectPaths, + /** When true, omit host-owned user and plugin hook rows and their diagnostics. Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks still contribute to each remaining row's effective enabled state. This filters sources rather than simulating a host with no settings. */ + @JsonProperty("excludeHostHooks") Boolean excludeHostHooks +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HooksDiscoverResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HooksDiscoverResult.java new file mode 100644 index 0000000000..f30d4837ae --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HooksDiscoverResult.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources. + * + * @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 HooksDiscoverResult( + /** All discovered hook actions. Byte-identical actions remain separate rows even when they share a disable key. */ + @JsonProperty("hooks") List hooks, + /** Non-fatal source-loading warnings. Discovery remains complete for the affected source, although the source had a recoverable issue. Repository-settings warnings are prefixed with their project path when attribution is available. */ + @JsonProperty("warnings") List warnings, + /** Errors for hook sources or actions that could not be loaded, making the result partially incomplete. Other valid actions are still returned. Project-resolution and repository-settings errors are prefixed with their project path. */ + @JsonProperty("errors") List errors +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/QueuePendingItems.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/QueuePendingItems.java index f3b2f99188..f815f565f5 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/QueuePendingItems.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/QueuePendingItems.java @@ -23,6 +23,8 @@ public record QueuePendingItems( /** Stable opaque id for the canonical queued item. Batch rows share one id. */ @JsonProperty("id") String id, + /** Stable identity of the queued user message. Present for message rows and absent for slash commands and model changes. */ + @JsonProperty("messageId") String messageId, /** Whether this item is a queued user message or a queued slash command / model change */ @JsonProperty("kind") QueuePendingItemsKind kind, /** Human-readable text to display for this queue entry in the UI */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicyNetwork.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicyNetwork.java index 1e56acb53f..9c5e3e475f 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicyNetwork.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicyNetwork.java @@ -25,7 +25,7 @@ public record SandboxConfigUserPolicyNetwork( @JsonProperty("allowOutbound") Boolean allowOutbound, /** Whether traffic to local/loopback addresses is allowed. */ @JsonProperty("allowLocalNetwork") Boolean allowLocalNetwork, - /** HTTP proxy the sandboxed process routes traffic through. Enforced on Windows and cooperative (honored by well-behaved tools, not strictly enforced) on Linux and macOS. Credentials go in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; an https:// or authenticated loopback URL is used as-is. */ + /** HTTP proxy for sandboxed process traffic. Linux restricts egress to the proxy endpoint, requires that endpoint to be reachable over IPv4 (the [::] dual-stack wildcard is accepted and routed through the IPv4 gateway), and does not support proxy credentials. macOS relies on applications honoring proxy environment variables. Windows also configures a per-AppContainer WinHTTP proxy, but enforcement depends on the application's networking stack. Configure supported credentials in the separate `username` and `password` fields. A credential-free http:// loopback URL uses the localhost proxy form, while an https:// or authenticated loopback URL uses the URL form. */ @JsonProperty("proxy") SandboxConfigUserPolicyNetworkProxy proxy ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicyNetworkProxy.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicyNetworkProxy.java index 74ff86919e..2946269ec1 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicyNetworkProxy.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicyNetworkProxy.java @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record SandboxConfigUserPolicyNetworkProxy( - /** Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. */ + /** Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted; an explicit port must be between 1 and 65535. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. */ @JsonProperty("url") String url, /** Optional username for proxy authentication. Combined with the URL (and `password`) into `user:pass@host` when the sandboxed process routes through the proxy. */ @JsonProperty("username") String username, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerHooksApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerHooksApi.java new file mode 100644 index 0000000000..b6f69bf7dc --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerHooksApi.java @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * 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 hooks} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ServerHooksApi { + + private final RpcCaller caller; + + /** @param caller the RPC transport function */ + ServerHooksApi(RpcCaller caller) { + this.caller = caller; + } + + /** + * Optional project paths and host-exclusion behavior for server-scoped hook discovery. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture discover(HooksDiscoverParams params) { + return caller.invoke("hooks.discover", params, HooksDiscoverResult.class); + } + +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java index 111cee2560..caa7f92d07 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java @@ -25,6 +25,8 @@ public final class ServerRpc { private final RpcCaller caller; + /** API methods for the {@code hooks} namespace. */ + public final ServerHooksApi hooks; /** API methods for the {@code models} namespace. */ public final ServerModelsApi models; /** API methods for the {@code tools} namespace. */ @@ -71,6 +73,7 @@ public final class ServerRpc { */ public ServerRpc(RpcCaller caller) { this.caller = caller; + this.hooks = new ServerHooksApi(caller); this.models = new ServerModelsApi(caller); this.tools = new ServerToolsApi(caller); this.account = new ServerAccountApi(caller); diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java index 52481a7d73..870f7ac3cf 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java @@ -94,6 +94,17 @@ public CompletableFuture getMetadata(SessionsGetMetad return caller.invoke("sessions.getMetadata", params, SessionsGetMetadataResult.class); } + /** + * Pagination options for reading an inactive or active local session's persisted event journal. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture readPersistedEvents(SessionsReadPersistedEventsParams params) { + return caller.invoke("sessions.readPersistedEvents", params, SessionsReadPersistedEventsResult.class); + } + /** * Limit for non-empty local session IDs. * diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java index a7c60d28cd..d7e36cf3c9 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java @@ -38,7 +38,7 @@ public record SessionModelSwitchToParams( @JsonProperty("modelCapabilities") ModelCapabilitiesOverride modelCapabilities, /** Explicit context tier for the selected model. `"default"` / `"long_context"` apply the requested tier; omit this field to use normal model behavior with no explicit tier. */ @JsonProperty("contextTier") ContextTier contextTier, - /** Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. */ + /** Origin to record on the effective `session.model_change` event for trusted in-process calls. Transport SDK calls are always recorded as `sdk`, regardless of this value. */ @JsonProperty("source") ModelChangeSource source, /** When true, defer this switch (enqueue it) if another model change is already queued, even when no turn is active — so it drains last (FIFO) and wins over the already-queued change. Intended for genuine user-initiated model selections; internal restore/reapply switches omit it and apply immediately when no turn is active. When no other model change is queued this has no effect (a switch still applies immediately unless a turn is active). */ @JsonProperty("deferIfModelChangeQueued") Boolean deferIfModelChangeQueued, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionsReadPersistedEventsParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionsReadPersistedEventsParams.java new file mode 100644 index 0000000000..4da93409be --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionsReadPersistedEventsParams.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Pagination options for reading an inactive or active local session's persisted event journal. + * + * @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 SessionsReadPersistedEventsParams( + /** Session ID whose persisted event journal should be read. */ + @JsonProperty("sessionId") String sessionId, + /** Opaque cursor returned by a previous persisted-event read. Omit on the first call. */ + @JsonProperty("cursor") String cursor, + /** Maximum number of events to return in this batch (1–1000, default 200). */ + @JsonProperty("max") Long max, + /** Direction to page through persisted history. Forward starts at the beginning; backward starts with the newest events. Events in each page remain chronological. */ + @JsonProperty("direction") EventsReadDirection direction +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionsReadPersistedEventsResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionsReadPersistedEventsResult.java new file mode 100644 index 0000000000..f022df5ae2 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionsReadPersistedEventsResult.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * 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 com.github.copilot.generated.SessionEvent; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Batch of session events returned by a read, with cursor and continuation metadata. + * + * @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 SessionsReadPersistedEventsResult( + /** 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. 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 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 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/sdk/src/generated/java/com/github/copilot/generated/rpc/SubagentSettingsEntry.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SubagentSettingsEntry.java index 29426d931b..4a366864c3 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SubagentSettingsEntry.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SubagentSettingsEntry.java @@ -23,6 +23,8 @@ public record SubagentSettingsEntry( /** Model override for matching subagents */ @JsonProperty("model") String model, + /** Whether the configured model strategy is preferred or required */ + @JsonProperty("modelPolicy") AgentModelPolicy modelPolicy, /** Reasoning effort override for matching subagents */ @JsonProperty("effortLevel") String effortLevel, /** Context tier override for matching subagents */ diff --git a/java/sdk/src/test/java/com/github/copilot/RpcSessionStateExtrasE2ETest.java b/java/sdk/src/test/java/com/github/copilot/RpcSessionStateExtrasE2ETest.java index 18045f3e86..f7fc58d429 100644 --- a/java/sdk/src/test/java/com/github/copilot/RpcSessionStateExtrasE2ETest.java +++ b/java/sdk/src/test/java/com/github/copilot/RpcSessionStateExtrasE2ETest.java @@ -142,7 +142,7 @@ void testShouldUpdateAndClearLiveSubagentSettings() throws Exception { session.getRpc().tools.updateSubagentSettings(new SessionToolsUpdateSubagentSettingsParams(null, new SessionToolsUpdateSubagentSettingsParams.SessionToolsUpdateSubagentSettingsParamsSubagents( Map.of("general-purpose", - new SubagentSettingsEntry("gpt-5-mini", "low", + new SubagentSettingsEntry("gpt-5-mini", null, "low", SubagentSettingsEntryContextTier.LONG_CONTEXT)), List.of("legacy-agent"), null, null))) .get(30, TimeUnit.SECONDS); diff --git a/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java b/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java index eb0bc3d723..f86b3dfbcb 100644 --- a/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java +++ b/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java @@ -470,7 +470,7 @@ void pingResult_fields() { @Test void sessionAgentListResult_with_items() { var item = new AgentInfo("name1", "Name One", "Desc 1", "/path/to/agent1", null, null, null, null, null, null, - null, null); + null, null, null, null); var result = new SessionAgentListResult(List.of(item)); assertEquals(1, result.agents().size()); assertEquals("name1", result.agents().get(0).name()); @@ -482,7 +482,7 @@ void sessionAgentListResult_with_items() { @Test void sessionAgentGetCurrentResult_nested() { var agent = new AgentInfo("agent-1", "Agent One", "Does things", null, null, null, null, null, null, null, null, - null); + null, null, null); var result = new SessionAgentGetCurrentResult(agent); assertEquals("agent-1", result.agent().name()); assertEquals("Agent One", result.agent().displayName()); @@ -498,7 +498,8 @@ void sessionAgentGetCurrentResult_null_agent() { @Test void sessionAgentReloadResult_with_items() { - var item = new AgentInfo("a", "A", "Desc", "/path/to/a", null, null, null, null, null, null, null, null); + var item = new AgentInfo("a", "A", "Desc", "/path/to/a", null, null, null, null, null, null, null, null, null, + null); var result = new SessionAgentReloadResult(List.of(item)); assertEquals(1, result.agents().size()); assertEquals("a", result.agents().get(0).name()); @@ -507,7 +508,7 @@ void sessionAgentReloadResult_with_items() { @Test void sessionAgentSelectResult_nested() { var agent = new AgentInfo("selected", "Selected", "The selected agent", "/path/to/selected", null, null, null, - null, null, null, null, null); + null, null, null, null, null, null, null); var result = new SessionAgentSelectResult(agent); assertEquals("selected", result.agent().name()); } diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 39bb781f7b..39863e29a3 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.83-1", + "@github/copilot": "^1.0.83-2", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" @@ -658,8 +658,8 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.83-1", - "integrity": "sha512-7rhgbgSx7IgfFYXrTx2/2+qowv6MZjC6BN0mhba37RuGQxsca9Zk2ucAeIX3GbQTp91AhvnN0aHCxabX36xADQ==", + "version": "1.0.83-2", + "integrity": "sha512-ntRvwGdZbZJjOvdV3LVBQ7z69W19DO4MWe/dh6pP8kYeumbzC4udVj7mCtoSwBOs0hwXirhXY+BZwqSJUp5FLQ==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -668,19 +668,19 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.83-1", - "@github/copilot-darwin-x64": "1.0.83-1", - "@github/copilot-linux-arm64": "1.0.83-1", - "@github/copilot-linux-x64": "1.0.83-1", - "@github/copilot-linuxmusl-arm64": "1.0.83-1", - "@github/copilot-linuxmusl-x64": "1.0.83-1", - "@github/copilot-win32-arm64": "1.0.83-1", - "@github/copilot-win32-x64": "1.0.83-1" + "@github/copilot-darwin-arm64": "1.0.83-2", + "@github/copilot-darwin-x64": "1.0.83-2", + "@github/copilot-linux-arm64": "1.0.83-2", + "@github/copilot-linux-x64": "1.0.83-2", + "@github/copilot-linuxmusl-arm64": "1.0.83-2", + "@github/copilot-linuxmusl-x64": "1.0.83-2", + "@github/copilot-win32-arm64": "1.0.83-2", + "@github/copilot-win32-x64": "1.0.83-2" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.83-1", - "integrity": "sha512-gxYJEd4yoIBIQHRmJw6ZegSkR6VuNm7AJVdAdARcU0SS68VZjtZFT29luThAp75Pxp37S5w+3A/jQNtxGyHizw==", + "version": "1.0.83-2", + "integrity": "sha512-RBjF/zTJe+gp9PsthYtIHF36+y3A3Zv3w/2FAa9nHF6ople1+lYoQ0OC1z6tWQSpBx3n/fSkNt0ebMmfhWlQyw==", "cpu": [ "arm64" ], @@ -694,8 +694,8 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.83-1", - "integrity": "sha512-PL63+Ib1RH+Bpu2UYJ9E8tmD4NZD/YlhD25F1Q9Rb86AdgLEoRYlxjNxXXF9P9dMmJ/u5zm0rUtWIRxv/FRbPg==", + "version": "1.0.83-2", + "integrity": "sha512-GzaarluCiHUA4yrYxWIFEklwPLTYjxGvLyYjI0wW5IPseT7GLFjN7AkDGRU4Ny/mxTj1MbUEsJAWVtiNy5EUHg==", "cpu": [ "x64" ], @@ -709,8 +709,8 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.83-1", - "integrity": "sha512-7c4RVEuXQu9zepAWoXwkizpESztUbWUR1hLPl+o+19L+D8fXm+5XQRH5E22Ia7P7/xHW3Ml2o2x5cXFq0k7/7w==", + "version": "1.0.83-2", + "integrity": "sha512-iGD5Pc7vnzrAjqTK/BrI8MDtMqXyxUe7P6u8TiGt+4DzKe3v2myT6eFQ+z/JJOHNpiu6LUpTDzwS8WttZqqJpA==", "cpu": [ "arm64" ], @@ -724,8 +724,8 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.83-1", - "integrity": "sha512-Be0zUVysLYV66pnOPhMxpShQ8Ox5V07qcsSOoNzG7iwpzkfZuf70U9CHk/fnI//mWwmZR+caPUfVM9BpwrdNnA==", + "version": "1.0.83-2", + "integrity": "sha512-jOQwz075vRWat+RJiMNtD+7vm4DQ83Dvw4iakpNkLfqWMPXlliVr/tqL+SffeSo87LnhOKobZOJOjELS27drdg==", "cpu": [ "x64" ], @@ -739,8 +739,8 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.83-1", - "integrity": "sha512-PZNP8vZZJU8yIc3dNjGUBUCFPNjqZs8FPZLDxvL6XdHM7Ep4cLBa+QdbRsw+nZONIaG0GtQf26eqk5ymYYpUPA==", + "version": "1.0.83-2", + "integrity": "sha512-6/+ByEBEV/vDofrCymaKrEZ5/p+TVHQfgWu8ywvWEPALfxj/iHpAF3grM2bj7uED4C19LTSarHNCkCqdrAUzIQ==", "cpu": [ "arm64" ], @@ -754,8 +754,8 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.83-1", - "integrity": "sha512-uKMhGtg5K07nA5/pxDSq8S5F/I+sMgVhUXg90Y4BI9trOidgxpXpCVyh4TeRNj2ENNugPvATdfGc6eFPsjmlgQ==", + "version": "1.0.83-2", + "integrity": "sha512-8dbiPUHaDemDibLfKXDe5xublJxt6fOht4yYDk/ikmOGAVezBUwRVO27PchXQBwGjP2PVNAASkv2WB4Ubw72lA==", "cpu": [ "x64" ], @@ -769,8 +769,8 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.83-1", - "integrity": "sha512-vMxHTmv3SotBuNI4LKcIFckd+n0OvhTik27qjsqOnVqFpvmHDghSsa8YPxySyxUQIE35z5pJaivVBK3dfEAY7w==", + "version": "1.0.83-2", + "integrity": "sha512-ZE1iUXlJSnNIH+VoRG96emy2e7jMJm85/pcKCrgLvqhDAcQSqiqLVv3OJp2VX2IcDxToOpiaGccU8Ab9zHQqkQ==", "cpu": [ "arm64" ], @@ -784,8 +784,8 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.83-1", - "integrity": "sha512-2l0VVTazW3/+p94ZQ5sAPCj1iH7KWxJAYh4yXWfvpsB/1JEEmyVgpLei1MeaMFVdtp/hi9bGprZ9+zWNlHh5hQ==", + "version": "1.0.83-2", + "integrity": "sha512-qfturLon+1oaWqSaXCISL6BEf5K+ijJFl0m/OZwstWYSlIlaE2+iOz5LcRukoxm25OG1JZDHQFp1k2PY2A+LbA==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index da1892a794..3c2bed310d 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -56,7 +56,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.83-1", + "@github/copilot": "^1.0.83-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 bbb9cea89d..602facf807 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.83-1", + "@github/copilot": "^1.0.83-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 812c6b2607..eaa477ab0a 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -5,7 +5,7 @@ import type { MessageConnection } from "vscode-jsonrpc/node.js"; -import type { AbortReason, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerSource, McpServerStatus, ModelChangeSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompleteData, TaskCompletionOutcome, UserToolSessionApproval, Verbosity } from "./session-events.js"; +import type { AbortReason, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerSource, McpServerStatus, ModelChangeSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompleteData, TaskCompletionOutcome, UserToolSessionApproval, Verbosity } from "./session-events.js"; /** A value that can be represented losslessly on the SDK JSON wire. */ export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue }; @@ -869,6 +869,64 @@ export type DiscoveredExtensionMode = | "load_only" /** Extensions are loaded and the agent can create, reload, and manage them. */ | "load_and_augment"; +/** + * Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HookType". + */ +/** @experimental */ +export type HookType = + /** Runs before a tool is invoked. */ + | "preToolUse" + /** Runs before an MCP tool is invoked. */ + | "preMcpToolCall" + /** Runs after a tool completes successfully. */ + | "postToolUse" + /** Runs after a tool fails. */ + | "postToolUseFailure" + /** Runs after the user submits a prompt. */ + | "userPromptSubmitted" + /** Runs after the runtime transforms the submitted prompt for the model, before it is added to session history. */ + | "userPromptTransformed" + /** Runs when a session starts. */ + | "sessionStart" + /** Runs when a session ends. */ + | "sessionEnd" + /** Runs after an agent result is produced. */ + | "postResult" + /** Runs before a pull request description is generated. */ + | "prePRDescription" + /** Runs when the agent encounters an error. */ + | "errorOccurred" + /** Runs when the agent stops. */ + | "agentStop" + /** Runs when a subagent starts. */ + | "subagentStart" + /** Runs when a subagent stops. */ + | "subagentStop" + /** Runs before conversation context is compacted. */ + | "preCompact" + /** Runs when the agent requests permission. */ + | "permissionRequest" + /** Runs when the agent emits a notification. */ + | "notification"; +/** + * Configuration tier that contributed a discovered hook action. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HookOrigin". + */ +/** @experimental */ +export type HookOrigin = + /** Hook loaded from user settings or the user's hook directory. */ + | "user" + /** Hook loaded from repository settings or the repository hook directory. */ + | "repository" + /** Hook provided by an enabled installed or explicit plugin. Projectless rows omit projectPath and do not expand a project directory. */ + | "plugin" + /** Hook enforced by centrally managed policy. */ + | "policy"; /** * Server transport type: stdio, http, sse (deprecated), or memory * @@ -1348,49 +1406,6 @@ export type HistoryRewindOutcome = | "checkpoint-cleanup-failed" /** Files and conversation were rewound, but obsolete file snapshots could not be removed; only conversation-and-files rewinds produce this. */ | "snapshot-prune-failed"; -/** - * Hook event name dispatched through the SDK callback transport. - * - * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema - * via the `definition` "HookType". - */ -/** @experimental */ -/** @internal */ -export type HookType = - /** Runs before a tool is invoked. */ - | "preToolUse" - /** Runs before an MCP tool is invoked. */ - | "preMcpToolCall" - /** Runs after a tool completes successfully. */ - | "postToolUse" - /** Runs after a tool fails. */ - | "postToolUseFailure" - /** Runs after the user submits a prompt. */ - | "userPromptSubmitted" - /** Runs after the runtime transforms the submitted prompt for the model, before it is added to session history. */ - | "userPromptTransformed" - /** Runs when a session starts. */ - | "sessionStart" - /** Runs when a session ends. */ - | "sessionEnd" - /** Runs after an agent result is produced. */ - | "postResult" - /** Runs before a pull request description is generated. */ - | "prePRDescription" - /** Runs when the agent encounters an error. */ - | "errorOccurred" - /** Runs when the agent stops. */ - | "agentStop" - /** Runs when a subagent starts. */ - | "subagentStart" - /** Runs when a subagent stops. */ - | "subagentStop" - /** Runs before conversation context is compacted. */ - | "preCompact" - /** Runs when the agent requests permission. */ - | "permissionRequest" - /** Runs when the agent emits a notification. */ - | "notification"; /** * Source for direct repo installs (when marketplace is empty) * @@ -4589,7 +4604,7 @@ export interface AgentGetCurrentResult { agent?: AgentInfo | null; } /** - * Agent metadata, including identifiers, display details, source, tools, model, MCP servers, skills, and file path. + * Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "AgentInfo". @@ -4629,6 +4644,11 @@ export interface AgentInfo { * Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference. */ model?: string; + /** + * Authored preferred model ids for this agent, in priority order. Runtime model selection chooses the first available model; omitted means no authored preference. + */ + models?: string[]; + modelPolicy?: AgentModelPolicy; /** * MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema. * @@ -6841,6 +6861,37 @@ export interface DiscoveredExtensionsEnableRequest { */ ids: string[]; } +/** + * One server-discovered hook action from user, repository, plugin, or managed-policy configuration. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "DiscoveredHook". + */ +/** @experimental */ +export interface DiscoveredHook { + /** + * Deterministic identifier for this server-discovered action row. It remains stable while the project, origin, source, event, action content, and duplicate ordinal are unchanged. This is row identity, not the key persisted in disabledHooks. + */ + id: string; + hookType: HookType; + origin: HookOrigin; + /** + * Human-readable source label, such as a hook file path, settings source, or plugin name. + */ + source?: string; + /** + * Input project path for which this server-side action was resolved. Set on every row returned for project-scoped discovery, including repeated user and policy actions. + */ + projectPath?: string; + /** + * Whether this action is enabled under the server-side discovery settings. Concrete sessions may differ because they can add session-specific directories, plugins, or trust. False when its disable key is present in the user's disabled-hooks setting or disable-all settings suppress the action. + */ + enabled: boolean; + /** + * Durable content hash used by hook enablement. Identical actions may intentionally share this key. Omitted when changing the user's disabled-hooks setting cannot change the action's current server-discovered state, including managed-policy hooks, session-start prompt actions, actions suppressed by disable-all settings, and projectless plugin actions that require project-directory expansion. + */ + disableKey?: string; +} /** * MCP server discovered by `mcp.discover`, with config source, optional plugin source, transport type, and enabled state. * @@ -8982,6 +9033,44 @@ export interface HookInvokeRequest { export interface HookInvokeResponse { output?: JsonValue; } +/** + * Optional project paths and host-exclusion behavior for server-scoped hook discovery. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HooksDiscoverRequest". + */ +/** @experimental */ +export interface HooksDiscoverRequest { + /** + * Optional project directory paths whose trusted repository and project-expanded plugin hooks should be discovered. When omitted or empty, user, managed-policy, and globally enabled installed or explicit plugin hooks are returned without project expansion. + */ + projectPaths?: string[]; + /** + * When true, omit host-owned user and plugin hook rows and their diagnostics. Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks still contribute to each remaining row's effective enabled state. This filters sources rather than simulating a host with no settings. + */ + excludeHostHooks?: boolean; +} +/** + * Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HooksDiscoverResult". + */ +/** @experimental */ +export interface HooksDiscoverResult { + /** + * All discovered hook actions. Byte-identical actions remain separate rows even when they share a disable key. + */ + hooks: DiscoveredHook[]; + /** + * Non-fatal source-loading warnings. Discovery remains complete for the affected source, although the source had a recoverable issue. Repository-settings warnings are prefixed with their project path when attribution is available. + */ + warnings: string[]; + /** + * Errors for hook sources or actions that could not be loaded, making the result partially incomplete. Other valid actions are still returned. Project-resolution and repository-settings errors are prefixed with their project path. + */ + errors: string[]; +} /** * Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source. * @@ -15874,6 +15963,10 @@ export interface QueuePendingItems { * Stable opaque id for the canonical queued item. Batch rows share one id. */ id: string; + /** + * Stable identity of the queued user message. Present for message rows and absent for slash commands and model changes. + */ + messageId?: string; kind: QueuePendingItemsKind; /** * Human-readable text to display for this queue entry in the UI @@ -16560,7 +16653,7 @@ export interface SandboxConfigUserPolicyNetwork { /** @experimental */ export interface SandboxConfigUserPolicyNetworkProxy { /** - * Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. + * Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted; an explicit port must be between 1 and 65535. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. */ url: string; /** @@ -19496,6 +19589,28 @@ export interface SessionsPruneOldRequest { */ excludeSessionIds?: string[]; } +/** + * Pagination options for reading an inactive or active local session's persisted event journal. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "SessionsReadPersistedEventsRequest". + */ +/** @experimental */ +export interface SessionsReadPersistedEventsRequest { + /** + * Session ID whose persisted event journal should be read. + */ + sessionId: string; + /** + * Opaque cursor returned by a previous persisted-event read. Omit on the first call. + */ + cursor?: string; + /** + * Maximum number of events to return in this batch (1–1000, default 200). + */ + max?: number; + direction?: EventsReadDirection; +} /** * Session ID whose in-use lock should be released. * @@ -20505,6 +20620,7 @@ export interface SubagentSettingsEntry { * Model override for matching subagents */ model?: string; + modelPolicy?: AgentModelPolicy; /** * Reasoning effort override for matching subagents */ @@ -22852,6 +22968,18 @@ export function createServerRpc(connection: MessageConnection) { ping: async (params: PingRequest): Promise => connection.sendRequest("ping", params), /** @experimental */ + hooks: { + /** + * Discovers hook actions enabled under server-side discovery settings from user, repository, plugin, and managed-policy sources. + * + * @param params Optional project paths and host-exclusion behavior for server-scoped hook discovery. + * + * @returns Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources. + */ + discover: async (params: HooksDiscoverRequest): Promise => + connection.sendRequest("hooks.discover", params), + }, + /** @experimental */ models: { /** * Lists Copilot models available to the authenticated user. @@ -23377,6 +23505,15 @@ export function createServerRpc(connection: MessageConnection) { */ list: async (params: SessionsListRequest): Promise => connection.sendRequest("sessions.list", params), + /** + * Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The initial backward read uses a bounded tail scan for fast first paint; cursor continuations preserve the session event-log paging semantics. Persisted events may omit payloads that are reconstructed only for an active session. + * + * @param params Pagination options for reading an inactive or active local session's persisted event journal. + * + * @returns Batch of session events returned by a read, with cursor and continuation metadata. + */ + readPersistedEvents: async (params: SessionsReadPersistedEventsRequest): Promise => + connection.sendRequest("sessions.readPersistedEvents", params), /** * Finds the local session bound to a GitHub task ID, if any. * diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index a7049dd9fc..93576aabf5 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -41,6 +41,7 @@ export type SessionEvent = | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent + | CompletionReceiptEvent | FusionRouteStartedEvent | FusionRouteFailedEvent | FusionResolvedEvent @@ -50,6 +51,7 @@ export type SessionEvent = | AssistantTurnStartEvent | AssistantIntentEvent | AssistantFusionPhaseStartedEvent + | AssistantFusionPhaseActivityEvent | AssistantFusionPhaseCompletedEvent | AssistantFusionPhaseFailedEvent | AssistantServerToolProgressEvent @@ -317,6 +319,30 @@ export type TaskCompletionOutcome = | "continue" /** Completion cannot proceed without intervention; the active objective is paused when one is identified. */ | "blocked"; +/** + * Structured terminal status from a tool completion event. + */ +export type CompletionReceiptToolStatus = + /** The tool completed successfully. */ + | "success" + /** The tool failed without a more specific structured status. */ + | "failure" + /** The tool exceeded its time budget. */ + | "timeout" + /** The user rejected the tool call. */ + | "rejected" + /** The permissions service denied the tool call. */ + | "denied"; +/** + * Runtime reason the completion decision was accepted. + */ +export type CompletionReceiptStopReason = + /** The model reached a natural terminal response. */ + | "natural" + /** A terminal tool ended the interaction. */ + | "terminal_tool" + /** The configured agentStop continuation limit was reached. */ + | "agent_stop_block_limit"; /** * Kind of turn for which HydraFusion routing is running. */ @@ -346,6 +372,34 @@ export type FusionPattern = | "cascade" /** Run a primary draft, a read-only critique, and a revision. */ | "critique"; +/** + * HydraFusion phase kind. + */ +/** @experimental */ +export type FusionPhaseKind = + /** Primary solver phase. */ + | "primary" + /** Read-only cascade judge phase. */ + | "judge" + /** Cascade repair phase. */ + | "repair" + /** Initial critique-pattern draft phase. */ + | "draft" + /** Read-only critique phase. */ + | "critic" + /** Critique-pattern revision phase. */ + | "revision" + /** Follow-up phase continuing from the resolved model. */ + | "follow_up"; +/** + * Conversation scope in which a HydraFusion phase executes. + */ +/** @experimental */ +export type FusionConversationScope = + /** Canonical root conversation history. */ + | "root" + /** Isolated read-only review history that does not enter the root conversation. */ + | "review"; /** * The agent mode that was active when this message was sent */ @@ -406,33 +460,16 @@ export type UserMessageDelivery = /** Enqueued while the agent was busy; processed as its own run afterward. */ | "queued"; /** - * Conversation scope in which a HydraFusion phase executes. + * Content-safe activity observed while a HydraFusion phase is running. */ /** @experimental */ -export type FusionConversationScope = - /** Canonical root conversation history. */ - | "root" - /** Isolated read-only review history that does not enter the root conversation. */ - | "review"; -/** - * HydraFusion phase kind. - */ -/** @experimental */ -export type FusionPhaseKind = - /** Primary solver phase. */ - | "primary" - /** Read-only cascade judge phase. */ - | "judge" - /** Cascade repair phase. */ - | "repair" - /** Initial critique-pattern draft phase. */ - | "draft" - /** Read-only critique phase. */ - | "critic" - /** Critique-pattern revision phase. */ - | "revision" - /** Follow-up phase continuing from the resolved model. */ - | "follow_up"; +export type FusionPhaseActivityKind = + /** The provider produced additional private output bytes. */ + | "model_output" + /** A tool began executing inside the phase. */ + | "tool_started" + /** A tool finished executing inside the phase. */ + | "tool_completed"; /** * How a durable phase checkpoint contributes its exact message to canonical root history. */ @@ -1018,6 +1055,14 @@ export type SkillSource = | "custom" /** Skill bundled with the runtime. */ | "builtin"; +/** + * Whether configured models are advisory preferences or required constraints + */ +export type AgentModelPolicy = + /** Treat the authored models as advisory preferences that callers may override. */ + | "preferred" + /** Require subagent execution to use one of the authored models. */ + | "required"; /** * Configuration source: user, workspace, plugin, or builtin */ @@ -3068,6 +3113,97 @@ export interface TaskCompleteData { */ summary?: string; } +/** + * Session event "session.completion_receipt". Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted. + */ +/** @experimental */ +export interface CompletionReceiptEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CompletionReceiptData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.completion_receipt". + */ + type: "session.completion_receipt"; +} +/** + * Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted. + */ +/** @experimental */ +export interface CompletionReceiptData { + /** + * One-based accepted completion receipt ordinal in the durable session history. + */ + attempt: number; + eventRange: CompletionReceiptEventRange; + /** + * Number of failed structured tool completions in the covered range. + */ + failedToolCount: number; + finalTool?: CompletionReceiptFinalTool; + /** + * Version of the completion receipt payload. + */ + schemaVersion: number; + /** + * Identifier of the assistant turn-end event that supplied the accepted completion boundary. This is the receipt's idempotency key, and always equals eventRange.endEventId. + */ + sourceEventId: string; + stopReason: CompletionReceiptStopReason; + /** + * Number of successful structured tool completions in the covered range. + */ + successfulToolCount: number; +} +/** + * Inclusive durable event range summarized by a completion receipt. + */ +export interface CompletionReceiptEventRange { + /** + * Identifier of the assistant turn-end event that ends the covered exchange. Always equals the receipt's sourceEventId, so either field is a valid join key. + */ + endEventId: string; + /** + * Identifier of the user message that starts the covered exchange. + */ + startEventId: string; +} +/** + * Final structured tool completion in the covered event range. + */ +export interface CompletionReceiptFinalTool { + /** + * Process exit code from a structured shell result, when available. + */ + exitCode?: number; + status: CompletionReceiptToolStatus; + /** + * Unique identifier of the completed tool call. + */ + toolCallId: string; + /** + * Tool name from the matching tool execution start event, when available. + */ + toolName?: string; +} /** * Session event "session.fusion_route_started". Experimental transient signal that HydraFusion routing has started for an eligible turn. */ @@ -3241,6 +3377,12 @@ export interface FusionResolvedData { */ modelUniverseVersion?: string; pattern: FusionPattern; + /** + * Presentation-neutral phase plan for clients that render workflow progress. + * + * @experimental + */ + phasePlan?: FusionPhasePlanStep[]; /** * Version of the validated execution-plan format. */ @@ -3299,6 +3441,22 @@ export interface FusionFollowUpRecommendation { compactionTurn: FusionFollowUpAction; userTurn: FusionFollowUpAction; } +/** + * Presentation-neutral phase planned for a HydraFusion turn. + */ +/** @experimental */ +export interface FusionPhasePlanStep { + /** + * Whether the phase executes only when an earlier phase requests it. + */ + conditional: boolean; + kind: FusionPhaseKind; + /** + * Semantic role assigned to the phase. + */ + role: string; + scope: FusionConversationScope; +} /** * Validated HydraFusion routing capability scores. */ @@ -3479,6 +3637,10 @@ export interface UserMessageData { * True when this user message was auto-injected by autopilot's continuation loop rather than typed by the user; used to distinguish autopilot-driven turns in telemetry. */ isAutopilotContinuation?: boolean; + /** + * Stable identity of the logical user message, matching the ID returned by send and retained by pending queue snapshots + */ + messageId?: string; /** * Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit */ @@ -4118,6 +4280,67 @@ export interface FusionPhaseStartedData { */ role: string; } +/** + * Session event "assistant.fusion_phase_activity". Experimental content-safe activity signal for a running HydraFusion phase. + */ +/** @experimental */ +export interface AssistantFusionPhaseActivityEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionPhaseActivityData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.fusion_phase_activity". + */ + type: "assistant.fusion_phase_activity"; +} +/** + * Experimental content-safe activity signal for a running HydraFusion phase. + */ +/** @experimental */ +export interface FusionPhaseActivityData { + activity: FusionPhaseActivityKind; + conversationScope: FusionConversationScope; + /** + * Identifier of the HydraFusion turn containing the phase. + */ + fusionId: string; + pattern: FusionPattern; + /** + * Stable identifier for the concrete phase. + */ + phaseId: string; + phaseKind: FusionPhaseKind; + /** + * Semantic role assigned to the phase. + */ + role: string; + /** + * Opaque hashed correlation token for matching tool-started and tool-completed activity within this Fusion activity stream. It is not the tool call identifier exposed by tool lifecycle events. + */ + toolCallId?: string; + /** + * Cumulative private response bytes observed for this model call. The event never includes response text. + */ + totalResponseSizeBytes?: number; +} /** * Session event "assistant.fusion_phase_completed". Experimental durable HydraFusion phase output and lossless replay checkpoint. */ @@ -6838,6 +7061,10 @@ export interface SubagentCompletedData { * Model used by the sub-agent */ model?: string; + /** + * Why an explicit task-call model did not become the effective model + */ + modelOverrideReason?: string; /** * Tool call ID of the parent tool invocation that spawned this sub-agent */ @@ -6925,6 +7152,10 @@ export interface SubagentFailedData { * Model selected for the sub-agent, when known */ model?: string; + /** + * Why an explicit task-call model did not become the effective model + */ + modelOverrideReason?: string; /** * Tool call ID of the parent tool invocation that spawned this sub-agent */ @@ -7589,6 +7820,7 @@ export interface PermissionRequestedEvent { * Permission request notification requiring client approval with request details */ export interface PermissionRequestedData { + agentMode?: SessionMode; permissionRequest: PermissionRequest; promptRequest?: PermissionPromptRequest; /** @@ -10798,7 +11030,7 @@ export interface CustomAgentsUpdatedData { warnings: string[]; } /** - * A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and model override. + * A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and authored model configuration. */ export interface CustomAgentsUpdatedAgent { /** @@ -10817,6 +11049,11 @@ export interface CustomAgentsUpdatedAgent { * Model override for this agent, if set */ model?: string; + modelPolicy?: AgentModelPolicy; + /** + * Authored model ids in priority order, if configured + */ + models?: string[]; /** * Internal name of the agent */ diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 7b629d5c18..b4edc24e61 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -6,7 +6,7 @@ from typing import ClassVar, TYPE_CHECKING -from .session_events import AbortReason, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerSource, McpServerStatus, ModelChangeSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompletionOutcome, UserToolSessionApproval, Verbosity +from .session_events import AbortReason, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerSource, McpServerStatus, ModelChangeSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompletionOutcome, UserToolSessionApproval, Verbosity if TYPE_CHECKING: from .._jsonrpc import JsonRpcClient @@ -2498,6 +2498,42 @@ def to_dict(self) -> 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 HookType(Enum): + """Hook event that invokes this action. + + Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally + support callback-only events. + """ + AGENT_STOP = "agentStop" + ERROR_OCCURRED = "errorOccurred" + NOTIFICATION = "notification" + PERMISSION_REQUEST = "permissionRequest" + POST_RESULT = "postResult" + POST_TOOL_USE = "postToolUse" + POST_TOOL_USE_FAILURE = "postToolUseFailure" + PRE_COMPACT = "preCompact" + PRE_MCP_TOOL_CALL = "preMcpToolCall" + PRE_PR_DESCRIPTION = "prePRDescription" + PRE_TOOL_USE = "preToolUse" + SESSION_END = "sessionEnd" + SESSION_START = "sessionStart" + SUBAGENT_START = "subagentStart" + SUBAGENT_STOP = "subagentStop" + USER_PROMPT_SUBMITTED = "userPromptSubmitted" + USER_PROMPT_TRANSFORMED = "userPromptTransformed" + +# Experimental: this type is part of an experimental API and may change or be removed. +class HookOrigin(Enum): + """Configuration tier that contributed this hook action. + + Configuration tier that contributed a discovered hook action. + """ + PLUGIN = "plugin" + POLICY = "policy" + REPOSITORY = "repository" + USER = "user" + # 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""" @@ -2585,6 +2621,9 @@ class EventsReadDirection(Enum): 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. + + Direction to page through persisted history. Forward starts at the beginning; backward + starts with the newest events. Events in each page remain chronological. """ BACKWARD = "backward" FORWARD = "forward" @@ -4009,28 +4048,6 @@ def to_dict(self) -> dict: class HMACAuthInfoType(Enum): HMAC = "hmac" -# Internal: this type is an internal SDK API and is not part of the public surface. -class _HookType(Enum): - """Hook event name dispatched through the SDK callback transport.""" - - AGENT_STOP = "agentStop" - ERROR_OCCURRED = "errorOccurred" - NOTIFICATION = "notification" - PERMISSION_REQUEST = "permissionRequest" - POST_RESULT = "postResult" - POST_TOOL_USE = "postToolUse" - POST_TOOL_USE_FAILURE = "postToolUseFailure" - PRE_COMPACT = "preCompact" - PRE_MCP_TOOL_CALL = "preMcpToolCall" - PRE_PR_DESCRIPTION = "prePRDescription" - PRE_TOOL_USE = "preToolUse" - SESSION_END = "sessionEnd" - SESSION_START = "sessionStart" - SUBAGENT_START = "subagentStart" - SUBAGENT_STOP = "subagentStop" - USER_PROMPT_SUBMITTED = "userPromptSubmitted" - USER_PROMPT_TRANSFORMED = "userPromptTransformed" - # Internal: this type is an internal SDK API and is not part of the public surface. @dataclass class _HookInvokeResponse: @@ -4050,6 +4067,38 @@ def to_dict(self) -> dict: result["output"] = self.output return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HooksDiscoverRequest: + """Optional project paths and host-exclusion behavior for server-scoped hook discovery.""" + + exclude_host_hooks: bool | None = None + """When true, omit host-owned user and plugin hook rows and their diagnostics. + Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks + still contribute to each remaining row's effective enabled state. This filters sources + rather than simulating a host with no settings. + """ + project_paths: list[str] | None = None + """Optional project directory paths whose trusted repository and project-expanded plugin + hooks should be discovered. When omitted or empty, user, managed-policy, and globally + enabled installed or explicit plugin hooks are returned without project expansion. + """ + + @staticmethod + def from_dict(obj: Any) -> 'HooksDiscoverRequest': + assert isinstance(obj, dict) + exclude_host_hooks = from_union([from_bool, from_none], obj.get("excludeHostHooks")) + project_paths = from_union([lambda x: from_list(from_str, x), from_none], obj.get("projectPaths")) + return HooksDiscoverRequest(exclude_host_hooks, project_paths) + + def to_dict(self) -> dict: + result: dict = {} + if self.exclude_host_hooks is not None: + result["excludeHostHooks"] = from_union([from_bool, from_none], self.exclude_host_hooks) + if self.project_paths is not None: + result["projectPaths"] = from_union([lambda x: from_list(from_str, x), from_none], self.project_paths) + return result + class InstalledPluginSourceURLSource(Enum): GITHUB = "github" LOCAL = "local" @@ -9608,22 +9657,25 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SandboxConfigUserPolicyNetworkProxy: - """HTTP proxy the sandboxed process routes traffic through. Enforced on Windows and - cooperative (honored by well-behaved tools, not strictly enforced) on Linux and macOS. - Credentials go in the separate `username`/`password` fields. A credential-free http:// - loopback proxy URL is routed through the localhost proxy automatically; an https:// or - authenticated loopback URL is used as-is. + """HTTP proxy for sandboxed process traffic. Linux restricts egress to the proxy endpoint, + requires that endpoint to be reachable over IPv4 (the [::] dual-stack wildcard is + accepted and routed through the IPv4 gateway), and does not support proxy credentials. + macOS relies on applications honoring proxy environment variables. Windows also + configures a per-AppContainer WinHTTP proxy, but enforcement depends on the application's + networking stack. Configure supported credentials in the separate `username` and + `password` fields. A credential-free http:// loopback URL uses the localhost proxy form, + while an https:// or authenticated loopback URL uses the URL form. HTTP proxy configuration for sandboxed traffic. """ url: str """Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the - scheme's standard port when omitted. Credentials must not be embedded here — a - `user:pass@` authority is rejected; put them in the separate `username`/`password` - fields. A credential-free http:// loopback URL is routed through the localhost proxy - automatically; loopback covers localhost and any *.localhost subdomain, the whole - 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or - one with a username/password set, is used as-is. + scheme's standard port when omitted; an explicit port must be between 1 and 65535. + Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in + the separate `username`/`password` fields. A credential-free http:// loopback proxy URL + is routed through the localhost proxy automatically; loopback covers localhost and any + *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback + (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. """ password: str | None = None """Optional password for proxy authentication, combined with the URL at spawn time. The @@ -16327,6 +16379,132 @@ def to_dict(self) -> dict: result["plugin"] = from_union([lambda x: to_class(DiscoveredExtensionPlugin, x), from_none], self.plugin) return result +# Internal: this type is an internal SDK API and is not part of the public surface. +@dataclass +class _HookInvokeRequest: + """Runtime-owned wire payload for a server-to-client hook callback invocation.""" + + hook_type: HookType + input: Any + session_id: str + + @staticmethod + def from_dict(obj: Any) -> '_HookInvokeRequest': + assert isinstance(obj, dict) + hook_type = HookType(obj.get("hookType")) + input = obj.get("input") + session_id = from_str(obj.get("sessionId")) + return _HookInvokeRequest(hook_type, input, session_id) + + def to_dict(self) -> dict: + result: dict = {} + result["hookType"] = to_enum(HookType, self.hook_type) + result["input"] = self.input + result["sessionId"] = from_str(self.session_id) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class DiscoveredHook: + """One server-discovered hook action from user, repository, plugin, or managed-policy + configuration. + """ + enabled: bool + """Whether this action is enabled under the server-side discovery settings. Concrete + sessions may differ because they can add session-specific directories, plugins, or trust. + False when its disable key is present in the user's disabled-hooks setting or disable-all + settings suppress the action. + """ + hook_type: HookType + """Hook event that invokes this action.""" + + id: str + """Deterministic identifier for this server-discovered action row. It remains stable while + the project, origin, source, event, action content, and duplicate ordinal are unchanged. + This is row identity, not the key persisted in disabledHooks. + """ + origin: HookOrigin + """Configuration tier that contributed this hook action.""" + + disable_key: str | None = None + """Durable content hash used by hook enablement. Identical actions may intentionally share + this key. Omitted when changing the user's disabled-hooks setting cannot change the + action's current server-discovered state, including managed-policy hooks, session-start + prompt actions, actions suppressed by disable-all settings, and projectless plugin + actions that require project-directory expansion. + """ + project_path: str | None = None + """Input project path for which this server-side action was resolved. Set on every row + returned for project-scoped discovery, including repeated user and policy actions. + """ + source: str | None = None + """Human-readable source label, such as a hook file path, settings source, or plugin name.""" + + @staticmethod + def from_dict(obj: Any) -> 'DiscoveredHook': + assert isinstance(obj, dict) + enabled = from_bool(obj.get("enabled")) + hook_type = HookType(obj.get("hookType")) + id = from_str(obj.get("id")) + origin = HookOrigin(obj.get("origin")) + disable_key = from_union([from_str, from_none], obj.get("disableKey")) + project_path = from_union([from_str, from_none], obj.get("projectPath")) + source = from_union([from_str, from_none], obj.get("source")) + return DiscoveredHook(enabled, hook_type, id, origin, disable_key, project_path, source) + + def to_dict(self) -> dict: + result: dict = {} + result["enabled"] = from_bool(self.enabled) + result["hookType"] = to_enum(HookType, self.hook_type) + result["id"] = from_str(self.id) + result["origin"] = to_enum(HookOrigin, self.origin) + if self.disable_key is not None: + result["disableKey"] = from_union([from_str, from_none], self.disable_key) + if self.project_path is not None: + result["projectPath"] = from_union([from_str, from_none], self.project_path) + if self.source is not None: + result["source"] = from_union([from_str, from_none], self.source) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionsReadPersistedEventsRequest: + """Pagination options for reading an inactive or active local session's persisted event + journal. + """ + session_id: str + """Session ID whose persisted event journal should be read.""" + + cursor: str | None = None + """Opaque cursor returned by a previous persisted-event read. Omit on the first call.""" + + direction: EventsReadDirection | None = None + """Direction to page through persisted history. Forward starts at the beginning; backward + starts with the newest events. Events in each page remain chronological. + """ + max: int | None = None + """Maximum number of events to return in this batch (1–1000, default 200).""" + + @staticmethod + def from_dict(obj: Any) -> 'SessionsReadPersistedEventsRequest': + assert isinstance(obj, dict) + session_id = from_str(obj.get("sessionId")) + cursor = from_union([from_str, from_none], obj.get("cursor")) + direction = from_union([EventsReadDirection, from_none], obj.get("direction")) + max = from_union([from_int, from_none], obj.get("max")) + return SessionsReadPersistedEventsRequest(session_id, cursor, direction, max) + + def to_dict(self) -> dict: + result: dict = {} + result["sessionId"] = from_str(self.session_id) + 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.max is not None: + result["max"] = from_union([from_int, from_none], self.max) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class EventLogReadRequest: @@ -17605,30 +17783,6 @@ def to_dict(self) -> dict: result["mode"] = to_enum(HistoryRewindMode, self.mode) return result -# Internal: this type is an internal SDK API and is not part of the public surface. -@dataclass -class _HookInvokeRequest: - """Runtime-owned wire payload for a server-to-client hook callback invocation.""" - - hook_type: _HookType - input: Any - session_id: str - - @staticmethod - def from_dict(obj: Any) -> '_HookInvokeRequest': - assert isinstance(obj, dict) - hook_type = _HookType(obj.get("hookType")) - input = obj.get("input") - session_id = from_str(obj.get("sessionId")) - return _HookInvokeRequest(hook_type, input, session_id) - - def to_dict(self) -> dict: - result: dict = {} - result["hookType"] = to_enum(_HookType, self.hook_type) - result["input"] = self.input - result["sessionId"] = from_str(self.session_id) - return result - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class InstalledPluginSource: @@ -22385,6 +22539,11 @@ class QueuePendingItems: kind: QueuePendingItemsKind """Whether this item is a queued user message or a queued slash command / model change""" + message_id: str | None = None + """Stable identity of the queued user message. Present for message rows and absent for slash + commands and model changes. + """ + @staticmethod def from_dict(obj: Any) -> 'QueuePendingItems': assert isinstance(obj, dict) @@ -22392,7 +22551,8 @@ def from_dict(obj: Any) -> 'QueuePendingItems': display_text = from_str(obj.get("displayText")) id = from_str(obj.get("id")) kind = QueuePendingItemsKind(obj.get("kind")) - return QueuePendingItems(agent_mode, display_text, id, kind) + message_id = from_union([from_str, from_none], obj.get("messageId")) + return QueuePendingItems(agent_mode, display_text, id, kind, message_id) def to_dict(self) -> dict: result: dict = {} @@ -22400,6 +22560,8 @@ def to_dict(self) -> dict: result["displayText"] = from_str(self.display_text) result["id"] = from_str(self.id) result["kind"] = to_enum(QueuePendingItemsKind, self.kind) + if self.message_id is not None: + result["messageId"] = from_union([from_str, from_none], self.message_id) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -22662,11 +22824,14 @@ class SandboxConfigUserPolicyNetwork: """Whether outbound network traffic is allowed at all.""" proxy: SandboxConfigUserPolicyNetworkProxy | None = None - """HTTP proxy the sandboxed process routes traffic through. Enforced on Windows and - cooperative (honored by well-behaved tools, not strictly enforced) on Linux and macOS. - Credentials go in the separate `username`/`password` fields. A credential-free http:// - loopback proxy URL is routed through the localhost proxy automatically; an https:// or - authenticated loopback URL is used as-is. + """HTTP proxy for sandboxed process traffic. Linux restricts egress to the proxy endpoint, + requires that endpoint to be reachable over IPv4 (the [::] dual-stack wildcard is + accepted and routed through the IPv4 gateway), and does not support proxy credentials. + macOS relies on applications honoring proxy environment variables. Windows also + configures a per-AppContainer WinHTTP proxy, but enforcement depends on the application's + networking stack. Configure supported credentials in the separate `username` and + `password` fields. A credential-free http:// loopback URL uses the localhost proxy form, + while an https:// or authenticated loopback URL uses the URL form. """ @staticmethod @@ -23469,7 +23634,7 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class AgentInfo: - """Agent metadata, including identifiers, display details, source, tools, model, MCP + """Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path. The newly selected custom agent @@ -23496,6 +23661,13 @@ class AgentInfo: """Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference. """ + model_policy: AgentModelPolicy | None = None + """Whether authored models are preferences or required constraints.""" + + models: list[str] | None = None + """Authored preferred model ids for this agent, in priority order. Runtime model selection + chooses the first available model; omitted means no authored preference. + """ path: str | None = None """Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path. @@ -23527,13 +23699,15 @@ def from_dict(obj: Any) -> 'AgentInfo': name = from_str(obj.get("name")) mcp_servers = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("mcpServers")) model = from_union([from_str, from_none], obj.get("model")) + model_policy = from_union([AgentModelPolicy, from_none], obj.get("modelPolicy")) + models = from_union([lambda x: from_list(from_str, x), from_none], obj.get("models")) path = from_union([from_str, from_none], obj.get("path")) prompt = from_union([from_str, from_none], obj.get("prompt")) skills = from_union([lambda x: from_list(from_str, x), from_none], obj.get("skills")) source = from_union([AgentInfoSource, from_none], obj.get("source")) tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("tools")) user_invocable = from_union([from_bool, from_none], obj.get("userInvocable")) - return AgentInfo(description, display_name, id, name, mcp_servers, model, path, prompt, skills, source, tools, user_invocable) + return AgentInfo(description, display_name, id, name, mcp_servers, model, model_policy, models, path, prompt, skills, source, tools, user_invocable) def to_dict(self) -> dict: result: dict = {} @@ -23545,6 +23719,10 @@ def to_dict(self) -> dict: result["mcpServers"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.mcp_servers) if self.model is not None: result["model"] = from_union([from_str, from_none], self.model) + if self.model_policy is not None: + result["modelPolicy"] = from_union([lambda x: to_enum(AgentModelPolicy, x), from_none], self.model_policy) + if self.models is not None: + result["models"] = from_union([lambda x: from_list(from_str, x), from_none], self.models) if self.path is not None: result["path"] = from_union([from_str, from_none], self.path) if self.prompt is not None: @@ -25606,6 +25784,43 @@ def to_dict(self) -> dict: 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 HooksDiscoverResult: + """Server-discovered hook actions and partial-load diagnostics from user, repository, + plugin, and managed-policy sources. Concrete sessions may include additional + session-specific hook sources. + """ + errors: list[str] + """Errors for hook sources or actions that could not be loaded, making the result partially + incomplete. Other valid actions are still returned. Project-resolution and + repository-settings errors are prefixed with their project path. + """ + hooks: list[DiscoveredHook] + """All discovered hook actions. Byte-identical actions remain separate rows even when they + share a disable key. + """ + warnings: list[str] + """Non-fatal source-loading warnings. Discovery remains complete for the affected source, + although the source had a recoverable issue. Repository-settings warnings are prefixed + with their project path when attribution is available. + """ + + @staticmethod + def from_dict(obj: Any) -> 'HooksDiscoverResult': + assert isinstance(obj, dict) + errors = from_list(from_str, obj.get("errors")) + hooks = from_list(DiscoveredHook.from_dict, obj.get("hooks")) + warnings = from_list(from_str, obj.get("warnings")) + return HooksDiscoverResult(errors, hooks, warnings) + + def to_dict(self) -> dict: + result: dict = {} + result["errors"] = from_list(from_str, self.errors) + result["hooks"] = from_list(lambda x: to_class(DiscoveredHook, x), self.hooks) + result["warnings"] = from_list(from_str, self.warnings) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ExtensionList: @@ -34132,8 +34347,8 @@ class ModelSwitchToRequest: """When true, evaluate context-window compaction policy before applying the switch.""" source: ModelChangeSource | None = None - """Origin to record on the effective `session.model_change` event. Defaults to `sdk` when - omitted. + """Origin to record on the effective `session.model_change` event for trusted in-process + calls. Transport SDK calls are always recorded as `sdk`, regardless of this value. """ verbosity: Verbosity | None = None """Output verbosity level to request for supported models""" @@ -34858,13 +35073,17 @@ class SubagentSettingsEntry: model: str | None = None """Model override for matching subagents""" + model_policy: AgentModelPolicy | None = None + """Whether the configured model strategy is preferred or required""" + @staticmethod def from_dict(obj: Any) -> 'SubagentSettingsEntry': assert isinstance(obj, dict) context_tier = from_union([SubagentSettingsEntryContextTier, from_none], obj.get("contextTier")) effort_level = from_union([from_str, from_none], obj.get("effortLevel")) model = from_union([from_str, from_none], obj.get("model")) - return SubagentSettingsEntry(context_tier, effort_level, model) + model_policy = from_union([AgentModelPolicy, from_none], obj.get("modelPolicy")) + return SubagentSettingsEntry(context_tier, effort_level, model, model_policy) def to_dict(self) -> dict: result: dict = {} @@ -34874,6 +35093,8 @@ def to_dict(self) -> dict: result["effortLevel"] = from_union([from_str, from_none], self.effort_level) if self.model is not None: result["model"] = from_union([from_str, from_none], self.model) + if self.model_policy is not None: + result["modelPolicy"] = from_union([lambda x: to_enum(AgentModelPolicy, x), from_none], self.model_policy) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -35290,6 +35511,7 @@ class RPC: discovered_extensions_disable_request: DiscoveredExtensionsDisableRequest discovered_extensions_enable_request: DiscoveredExtensionsEnableRequest discovered_extension_source: DiscoveredExtensionSource + discovered_hook: DiscoveredHook discovered_mcp_server: DiscoveredMCPServer discovered_mcp_server_type: DiscoveredMCPServerType enqueue_command_params: EnqueueCommandParams @@ -35412,7 +35634,10 @@ class RPC: hmac_auth_info: HMACAuthInfo hook_invoke_request: _HookInvokeRequest hook_invoke_response: _HookInvokeResponse - hook_type: _HookType + hook_origin: HookOrigin + hooks_discover_request: HooksDiscoverRequest + hooks_discover_result: HooksDiscoverResult + hook_type: HookType installed_plugin: InstalledPlugin installed_plugin_info: InstalledPluginInfo installed_plugin_source: InstalledPluginSource | str @@ -36085,6 +36310,7 @@ class RPC: sessions_open_status: SessionsOpenStatus session_source: SessionSource sessions_prune_old_request: SessionsPruneOldRequest + sessions_read_persisted_events_request: SessionsReadPersistedEventsRequest sessions_register_extension_tools_on_session_options: SessionsRegisterExtensionToolsOnSessionOptions sessions_release_lock_request: SessionsReleaseLockRequest sessions_release_lock_result: SessionsReleaseLockResult @@ -36474,6 +36700,7 @@ def from_dict(obj: Any) -> 'RPC': 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_hook = DiscoveredHook.from_dict(obj.get("DiscoveredHook")) 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")) @@ -36596,7 +36823,10 @@ def from_dict(obj: Any) -> 'RPC': hmac_auth_info = HMACAuthInfo.from_dict(obj.get("HMACAuthInfo")) hook_invoke_request = _HookInvokeRequest.from_dict(obj.get("HookInvokeRequest")) hook_invoke_response = _HookInvokeResponse.from_dict(obj.get("HookInvokeResponse")) - hook_type = _HookType(obj.get("HookType")) + hook_origin = HookOrigin(obj.get("HookOrigin")) + hooks_discover_request = HooksDiscoverRequest.from_dict(obj.get("HooksDiscoverRequest")) + hooks_discover_result = HooksDiscoverResult.from_dict(obj.get("HooksDiscoverResult")) + hook_type = HookType(obj.get("HookType")) installed_plugin = InstalledPlugin.from_dict(obj.get("InstalledPlugin")) installed_plugin_info = InstalledPluginInfo.from_dict(obj.get("InstalledPluginInfo")) installed_plugin_source = from_union([InstalledPluginSource.from_dict, from_str], obj.get("InstalledPluginSource")) @@ -37269,6 +37499,7 @@ def from_dict(obj: Any) -> 'RPC': sessions_open_status = SessionsOpenStatus(obj.get("SessionsOpenStatus")) session_source = SessionSource(obj.get("SessionSource")) sessions_prune_old_request = SessionsPruneOldRequest.from_dict(obj.get("SessionsPruneOldRequest")) + sessions_read_persisted_events_request = SessionsReadPersistedEventsRequest.from_dict(obj.get("SessionsReadPersistedEventsRequest")) sessions_register_extension_tools_on_session_options = SessionsRegisterExtensionToolsOnSessionOptions.from_dict(obj.get("SessionsRegisterExtensionToolsOnSessionOptions")) sessions_release_lock_request = SessionsReleaseLockRequest.from_dict(obj.get("SessionsReleaseLockRequest")) sessions_release_lock_result = SessionsReleaseLockResult.from_dict(obj.get("SessionsReleaseLockResult")) @@ -37476,7 +37707,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, agent_set_prompt_request, agents_get_discovery_paths_request, api_key_auth_info, auth_identity, auth_info, auth_info_type, auth_validation_error, auth_validation_errors, built_in_model_catalog, built_in_model_catalog_entry, builtin_tool_descriptor, builtin_tool_format, builtin_tool_format_type, builtin_tool_input_schema, builtin_tool_input_schema_type, builtin_tool_safe_for_telemetry, builtin_tool_safe_telemetry_fields, 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_provider_register_request, canvas_provider_unregister_request, canvas_session_context, capi_session_options, card_digest, card_digest_algorithm, card_digest_value, catalog_ai_skill_candidate, catalog_ai_skill_candidate_provenance, catalog_authentication_required_error, catalog_authentication_required_reason, catalog_candidate, catalog_candidate_kind, catalog_candidate_source, catalog_candidate_source_embedded, catalog_candidate_source_url, catalog_capability, catalog_capability_id, catalog_client_contract, catalog_contract_violation_error, catalog_contract_violation_reason, catalog_handle_rejected_error, catalog_handle_rejection_reason, catalog_handle_type, catalog_invalid_request_error, catalog_invalid_request_field, catalog_malformed_card_error, catalog_malformed_card_reason, catalog_mcp_server_candidate, catalog_mcp_server_candidate_provenance, catalog_mcp_server_installability, catalog_media_type, catalog_negotiated_contract, catalog_negotiation_refused_error, catalog_negotiation_refused_reason, catalog_network_failure_error, catalog_network_failure_reason, catalog_not_installable_error, catalog_not_installable_reason, catalog_policy_rejected_error, catalog_search_request, catalog_search_result, catalog_search_succeeded, catalog_unavailable_error, catalog_unavailable_reason, catalog_unavailable_transport_error, catalog_unavailable_transport_reason, catalog_unsafe_retrieval_error, catalog_unsafe_retrieval_reason, catalog_unsupported_kind_error, command_list, commands_finalize_invocation_effect_request, commands_finalize_invocation_effect_result, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invocation_effect_outcome, commands_invocation_origin, 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, connect_client_info, 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_launch_profile, extension_launch_provider_resolve_request, extension_launch_provider_resolve_result, 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, factory_tool_resume_request, factory_tool_run_options, factory_tool_run_request, 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, git_hub_token_acquire_reason, git_hub_token_acquire_request, git_hub_token_acquire_result, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_clear_context_request, history_clear_context_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, managed_settings_read_result, 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_elicitation_form_mode, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_failed_server, 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_install_plan, 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_probe_needs_auth_reason, mcp_oauth_probe_request, mcp_oauth_probe_result, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_plan_configuration_change, mcp_plan_configuration_operation, mcp_plan_enum_value_type, mcp_plan_install_planned, mcp_plan_install_request, mcp_plan_install_result, mcp_plan_install_source, mcp_plan_install_source_candidate, mcp_plan_install_source_candidate_kind, mcp_plan_install_source_card, mcp_plan_install_source_card_kind, mcp_plan_package_install_method, mcp_plan_package_transport, mcp_plan_policy_decision, mcp_plan_policy_result, mcp_plan_policy_source, mcp_plan_provenance, mcp_plan_remote_install_method, mcp_plan_remote_transport, mcp_plan_required_value, mcp_plan_required_value_enum, mcp_plan_required_value_enum_kind, mcp_plan_required_value_scalar, mcp_plan_required_value_scalar_kind, mcp_plan_resource_identity, mcp_plan_scalar_value_type, mcp_plan_scope, mcp_plan_secret_placeholder, mcp_plan_secret_reference, mcp_plan_target, mcp_plan_transport_choice, mcp_plan_transport_choice_package, mcp_plan_transport_choice_remote, mcp_plan_value_category, mcp_register_external_client_request, mcp_reload_config, 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_safe_for_telemetry, mcp_safe_for_telemetry_fields, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_serializable_server_config, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_card_embedded, mcp_server_card_embedded_kind, mcp_server_card_media_type, mcp_server_card_reference, mcp_server_card_url, mcp_server_card_url_kind, 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_memory, mcp_server_config_memory_type, mcp_server_config_stdio, mcp_server_config_stdio_type, 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_task_metadata, 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_apply_startup_overlay_request, 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_message, model_picker_category, model_picker_persistence_request, model_picker_price_category, model_picker_settings_context, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_confirmation, model_switch_to_request, model_switch_to_result, model_warning_text, mode_set_request, mode_set_result, move_mcp_loading_to_background_result, 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_env_access, 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_env_access, 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_context, 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_outcome, permission_decision_reject, permission_decision_request, permission_decision_source, permission_decision_surface, 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_mode_source, 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_response_capability, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_mode_request, permissions_get_mode_result, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_env_access, 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_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_mode_request, permissions_set_mode_result, 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_builtin_set_request, 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, protocol_external_tool_defer, protocol_external_tool_definition, 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_host_status, 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_auth, sandbox_config_source, 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, sandbox_enforcement_status, 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_login_request, session_auth_logout_user_request, session_auth_status, session_auth_switch_request, 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_git_hub_auth_get_all_auth_available_result, session_git_hub_auth_logout_result, session_git_hub_auth_logout_user_result, 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_managed_permissions, session_managed_settings, 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, settable_auth_info, settable_token_auth_info, shell_cancel_user_requested_request, shell_credentials, 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_config_set_skill_disabled_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_add_timeline_entry_result, 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_model_picker_dialog, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_set_model_result, slash_command_set_plan_model_result, slash_command_show_dialog_result, slash_command_text_result, slash_command_timeline_entry, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_complete_data, task_completion_decision, 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, token_provider_auth_info, tool, tool_list, tool_result, tool_result_expanded, tool_result_new_message, tool_result_type, tools_execute_request, tools_get_builtin_descriptors_request, tools_get_builtin_descriptors_result, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_set_request, tools_set_result, tools_shell_descriptor_config, tools_task_complete_event_data_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_agent_metric, 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_auth_info_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, api_key_auth_info, auth_identity, auth_info, auth_info_type, auth_validation_error, auth_validation_errors, built_in_model_catalog, built_in_model_catalog_entry, builtin_tool_descriptor, builtin_tool_format, builtin_tool_format_type, builtin_tool_input_schema, builtin_tool_input_schema_type, builtin_tool_safe_for_telemetry, builtin_tool_safe_telemetry_fields, 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_provider_register_request, canvas_provider_unregister_request, canvas_session_context, capi_session_options, card_digest, card_digest_algorithm, card_digest_value, catalog_ai_skill_candidate, catalog_ai_skill_candidate_provenance, catalog_authentication_required_error, catalog_authentication_required_reason, catalog_candidate, catalog_candidate_kind, catalog_candidate_source, catalog_candidate_source_embedded, catalog_candidate_source_url, catalog_capability, catalog_capability_id, catalog_client_contract, catalog_contract_violation_error, catalog_contract_violation_reason, catalog_handle_rejected_error, catalog_handle_rejection_reason, catalog_handle_type, catalog_invalid_request_error, catalog_invalid_request_field, catalog_malformed_card_error, catalog_malformed_card_reason, catalog_mcp_server_candidate, catalog_mcp_server_candidate_provenance, catalog_mcp_server_installability, catalog_media_type, catalog_negotiated_contract, catalog_negotiation_refused_error, catalog_negotiation_refused_reason, catalog_network_failure_error, catalog_network_failure_reason, catalog_not_installable_error, catalog_not_installable_reason, catalog_policy_rejected_error, catalog_search_request, catalog_search_result, catalog_search_succeeded, catalog_unavailable_error, catalog_unavailable_reason, catalog_unavailable_transport_error, catalog_unavailable_transport_reason, catalog_unsafe_retrieval_error, catalog_unsafe_retrieval_reason, catalog_unsupported_kind_error, command_list, commands_finalize_invocation_effect_request, commands_finalize_invocation_effect_result, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invocation_effect_outcome, commands_invocation_origin, 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, connect_client_info, 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_hook, 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_launch_profile, extension_launch_provider_resolve_request, extension_launch_provider_resolve_result, 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, factory_tool_resume_request, factory_tool_run_options, factory_tool_run_request, 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, git_hub_token_acquire_reason, git_hub_token_acquire_request, git_hub_token_acquire_result, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_clear_context_request, history_clear_context_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_origin, hooks_discover_request, hooks_discover_result, 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, managed_settings_read_result, 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_elicitation_form_mode, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_failed_server, 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_install_plan, 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_probe_needs_auth_reason, mcp_oauth_probe_request, mcp_oauth_probe_result, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_plan_configuration_change, mcp_plan_configuration_operation, mcp_plan_enum_value_type, mcp_plan_install_planned, mcp_plan_install_request, mcp_plan_install_result, mcp_plan_install_source, mcp_plan_install_source_candidate, mcp_plan_install_source_candidate_kind, mcp_plan_install_source_card, mcp_plan_install_source_card_kind, mcp_plan_package_install_method, mcp_plan_package_transport, mcp_plan_policy_decision, mcp_plan_policy_result, mcp_plan_policy_source, mcp_plan_provenance, mcp_plan_remote_install_method, mcp_plan_remote_transport, mcp_plan_required_value, mcp_plan_required_value_enum, mcp_plan_required_value_enum_kind, mcp_plan_required_value_scalar, mcp_plan_required_value_scalar_kind, mcp_plan_resource_identity, mcp_plan_scalar_value_type, mcp_plan_scope, mcp_plan_secret_placeholder, mcp_plan_secret_reference, mcp_plan_target, mcp_plan_transport_choice, mcp_plan_transport_choice_package, mcp_plan_transport_choice_remote, mcp_plan_value_category, mcp_register_external_client_request, mcp_reload_config, 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_safe_for_telemetry, mcp_safe_for_telemetry_fields, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_serializable_server_config, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_card_embedded, mcp_server_card_embedded_kind, mcp_server_card_media_type, mcp_server_card_reference, mcp_server_card_url, mcp_server_card_url_kind, 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_memory, mcp_server_config_memory_type, mcp_server_config_stdio, mcp_server_config_stdio_type, 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_task_metadata, 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_apply_startup_overlay_request, 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_message, model_picker_category, model_picker_persistence_request, model_picker_price_category, model_picker_settings_context, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_confirmation, model_switch_to_request, model_switch_to_result, model_warning_text, mode_set_request, mode_set_result, move_mcp_loading_to_background_result, 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_env_access, 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_env_access, 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_context, 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_outcome, permission_decision_reject, permission_decision_request, permission_decision_source, permission_decision_surface, 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_mode_source, 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_response_capability, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_mode_request, permissions_get_mode_result, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_env_access, 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_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_mode_request, permissions_set_mode_result, 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_builtin_set_request, 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, protocol_external_tool_defer, protocol_external_tool_definition, 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_host_status, 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_auth, sandbox_config_source, 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, sandbox_enforcement_status, 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_login_request, session_auth_logout_user_request, session_auth_status, session_auth_switch_request, 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_git_hub_auth_get_all_auth_available_result, session_git_hub_auth_logout_result, session_git_hub_auth_logout_user_result, 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_managed_permissions, session_managed_settings, 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_read_persisted_events_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, settable_auth_info, settable_token_auth_info, shell_cancel_user_requested_request, shell_credentials, 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_config_set_skill_disabled_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_add_timeline_entry_result, 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_model_picker_dialog, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_set_model_result, slash_command_set_plan_model_result, slash_command_show_dialog_result, slash_command_text_result, slash_command_timeline_entry, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_complete_data, task_completion_decision, 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, token_provider_auth_info, tool, tool_list, tool_result, tool_result_expanded, tool_result_new_message, tool_result_type, tools_execute_request, tools_get_builtin_descriptors_request, tools_get_builtin_descriptors_result, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_set_request, tools_set_result, tools_shell_descriptor_config, tools_task_complete_event_data_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_agent_metric, 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_auth_info_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -37658,6 +37889,7 @@ def to_dict(self) -> dict: 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["DiscoveredHook"] = to_class(DiscoveredHook, self.discovered_hook) 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) @@ -37780,7 +38012,10 @@ def to_dict(self) -> dict: result["HMACAuthInfo"] = to_class(HMACAuthInfo, self.hmac_auth_info) result["HookInvokeRequest"] = to_class(_HookInvokeRequest, self.hook_invoke_request) result["HookInvokeResponse"] = to_class(_HookInvokeResponse, self.hook_invoke_response) - result["HookType"] = to_enum(_HookType, self.hook_type) + result["HookOrigin"] = to_enum(HookOrigin, self.hook_origin) + result["HooksDiscoverRequest"] = to_class(HooksDiscoverRequest, self.hooks_discover_request) + result["HooksDiscoverResult"] = to_class(HooksDiscoverResult, self.hooks_discover_result) + result["HookType"] = to_enum(HookType, self.hook_type) result["InstalledPlugin"] = to_class(InstalledPlugin, self.installed_plugin) result["InstalledPluginInfo"] = to_class(InstalledPluginInfo, self.installed_plugin_info) result["InstalledPluginSource"] = from_union([lambda x: to_class(InstalledPluginSource, x), from_str], self.installed_plugin_source) @@ -38453,6 +38688,7 @@ def to_dict(self) -> dict: result["SessionsOpenStatus"] = to_enum(SessionsOpenStatus, self.sessions_open_status) result["SessionSource"] = to_enum(SessionSource, self.session_source) result["SessionsPruneOldRequest"] = to_class(SessionsPruneOldRequest, self.sessions_prune_old_request) + result["SessionsReadPersistedEventsRequest"] = to_class(SessionsReadPersistedEventsRequest, self.sessions_read_persisted_events_request) result["SessionsRegisterExtensionToolsOnSessionOptions"] = to_class(SessionsRegisterExtensionToolsOnSessionOptions, self.sessions_register_extension_tools_on_session_options) result["SessionsReleaseLockRequest"] = to_class(SessionsReleaseLockRequest, self.sessions_release_lock_request) result["SessionsReleaseLockResult"] = to_class(SessionsReleaseLockResult, self.sessions_release_lock_result) @@ -39121,6 +39357,17 @@ def _patch_model_capabilities(data: dict) -> dict: return data +# Experimental: this API group is experimental and may change or be removed. +class ServerHooksApi: + def __init__(self, client: "JsonRpcClient"): + self._client = client + + async def discover(self, params: HooksDiscoverRequest, *, timeout: float | None = None) -> HooksDiscoverResult: + "Discovers hook actions enabled under server-side discovery settings from user, repository, plugin, and managed-policy sources.\n\nArgs:\n params: Optional project paths and host-exclusion behavior for server-scoped hook discovery.\n\nReturns:\n Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources." + params_dict = {k: v for k, v in params.to_dict().items() if v is not None} + return HooksDiscoverResult.from_dict(await self._client.request("hooks.discover", params_dict, **_timeout_kwargs(timeout))) + + # Experimental: this API group is experimental and may change or be removed. class ServerModelsApi: def __init__(self, client: "JsonRpcClient"): @@ -39533,6 +39780,11 @@ async def list(self, params: SessionsListRequest, *, timeout: float | None = Non params_dict = {k: v for k, v in params.to_dict().items() if v is not None} return SessionList.from_dict(await self._client.request("sessions.list", params_dict, **_timeout_kwargs(timeout))) + async def read_persisted_events(self, params: SessionsReadPersistedEventsRequest, *, timeout: float | None = None) -> EventsReadResult: + "Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The initial backward read uses a bounded tail scan for fast first paint; cursor continuations preserve the session event-log paging semantics. Persisted events may omit payloads that are reconstructed only for an active session.\n\nArgs:\n params: Pagination options for reading an inactive or active local session's persisted event journal.\n\nReturns:\n Batch of session events returned by a read, with cursor and continuation metadata." + params_dict = {k: v for k, v in params.to_dict().items() if v is not None} + return EventsReadResult.from_dict(await self._client.request("sessions.readPersistedEvents", params_dict, **_timeout_kwargs(timeout))) + async def find_by_task_id(self, params: SessionsFindByTaskIDRequest, *, timeout: float | None = None) -> SessionsFindByTaskIDResult: "Finds the local session bound to a GitHub task ID, if any.\n\nArgs:\n params: GitHub task ID to look up.\n\nReturns:\n ID of the local session bound to the given GitHub task, or omitted when none." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} @@ -39642,6 +39894,7 @@ class ServerRpc: """Typed server-scoped RPC methods.""" def __init__(self, client: "JsonRpcClient"): self._client = client + self.hooks = ServerHooksApi(client) self.models = ServerModelsApi(client) self.tools = ServerToolsApi(client) self.account = ServerAccountApi(client) @@ -42109,6 +42362,7 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "DiscoveredExtensions", "DiscoveredExtensionsDisableRequest", "DiscoveredExtensionsEnableRequest", + "DiscoveredHook", "DiscoveredMCPServer", "DiscoveredMCPServerType", "EnqueueCommandParams", @@ -42252,6 +42506,10 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "HistorySummarizeForHandoffResult", "HistoryTruncateRequest", "HistoryTruncateResult", + "HookOrigin", + "HookType", + "HooksDiscoverRequest", + "HooksDiscoverResult", "HooksHandler", "Host", "HostType", @@ -42886,6 +43144,7 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "ServerCatalogApi", "ServerCommandsApi", "ServerExtensionsApi", + "ServerHooksApi", "ServerInstructionSourceList", "ServerInstructionsApi", "ServerLlmInferenceApi", @@ -43071,6 +43330,7 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "SessionsOpenResumeLastKind", "SessionsOpenStatus", "SessionsPruneOldRequest", + "SessionsReadPersistedEventsRequest", "SessionsRegisterExtensionToolsOnSessionOptions", "SessionsReleaseLockRequest", "SessionsReleaseLockResult", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index 20b3df4be4..e3727eb24e 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -156,6 +156,8 @@ class SessionEventType(Enum): SESSION_COMPACTION_COMPLETE = "session.compaction_complete" SESSION_TASK_COMPLETE = "session.task_complete" # Experimental: this event is part of an experimental API and may change or be removed. + SESSION_COMPLETION_RECEIPT = "session.completion_receipt" + # Experimental: this event is part of an experimental API and may change or be removed. SESSION_FUSION_ROUTE_STARTED = "session.fusion_route_started" # Experimental: this event is part of an experimental API and may change or be removed. SESSION_FUSION_ROUTE_FAILED = "session.fusion_route_failed" @@ -172,6 +174,8 @@ class SessionEventType(Enum): # Experimental: this event is part of an experimental API and may change or be removed. ASSISTANT_FUSION_PHASE_STARTED = "assistant.fusion_phase_started" # Experimental: this event is part of an experimental API and may change or be removed. + ASSISTANT_FUSION_PHASE_ACTIVITY = "assistant.fusion_phase_activity" + # Experimental: this event is part of an experimental API and may change or be removed. ASSISTANT_FUSION_PHASE_COMPLETED = "assistant.fusion_phase_completed" # Experimental: this event is part of an experimental API and may change or be removed. ASSISTANT_FUSION_PHASE_FAILED = "assistant.fusion_phase_failed" @@ -398,6 +402,60 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class AssistantFusionPhaseActivityData: + "Experimental content-safe activity signal for a running HydraFusion phase." + activity: FusionPhaseActivityKind + conversation_scope: FusionConversationScope + fusion_id: str + pattern: FusionPattern + phase_id: str + phase_kind: FusionPhaseKind + role: str + tool_call_id: str | None = None + total_response_size_bytes: int | None = None + + @staticmethod + def from_dict(obj: Any) -> "AssistantFusionPhaseActivityData": + assert isinstance(obj, dict) + activity = parse_enum(FusionPhaseActivityKind, obj.get("activity")) + conversation_scope = parse_enum(FusionConversationScope, obj.get("conversationScope")) + fusion_id = from_str(obj.get("fusionId")) + pattern = parse_enum(FusionPattern, obj.get("pattern")) + phase_id = from_str(obj.get("phaseId")) + phase_kind = parse_enum(FusionPhaseKind, obj.get("phaseKind")) + role = from_str(obj.get("role")) + tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) + total_response_size_bytes = from_union([from_none, from_int], obj.get("totalResponseSizeBytes")) + return AssistantFusionPhaseActivityData( + activity=activity, + conversation_scope=conversation_scope, + fusion_id=fusion_id, + pattern=pattern, + phase_id=phase_id, + phase_kind=phase_kind, + role=role, + tool_call_id=tool_call_id, + total_response_size_bytes=total_response_size_bytes, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["activity"] = to_enum(FusionPhaseActivityKind, self.activity) + result["conversationScope"] = to_enum(FusionConversationScope, self.conversation_scope) + result["fusionId"] = from_str(self.fusion_id) + result["pattern"] = to_enum(FusionPattern, self.pattern) + result["phaseId"] = from_str(self.phase_id) + result["phaseKind"] = to_enum(FusionPhaseKind, self.phase_kind) + result["role"] = from_str(self.role) + if self.tool_call_id is not None: + result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) + if self.total_response_size_bytes is not None: + result["totalResponseSizeBytes"] = from_union([from_none, to_int], self.total_response_size_bytes) + return result + + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class AssistantFusionPhaseCompletedData: @@ -1202,6 +1260,38 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FusionPhasePlanStep: + "Presentation-neutral phase planned for a HydraFusion turn." + conditional: bool + kind: FusionPhaseKind + role: str + scope: FusionConversationScope + + @staticmethod + def from_dict(obj: Any) -> "FusionPhasePlanStep": + assert isinstance(obj, dict) + conditional = from_bool(obj.get("conditional")) + kind = parse_enum(FusionPhaseKind, obj.get("kind")) + role = from_str(obj.get("role")) + scope = parse_enum(FusionConversationScope, obj.get("scope")) + return FusionPhasePlanStep( + conditional=conditional, + kind=kind, + role=role, + scope=scope, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["conditional"] = from_bool(self.conditional) + result["kind"] = to_enum(FusionPhaseKind, self.kind) + result["role"] = from_str(self.role) + result["scope"] = to_enum(FusionConversationScope, self.scope) + return result + + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class FusionPhaseUsage: @@ -1678,6 +1768,55 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionCompletionReceiptData: + "Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted." + attempt: int + event_range: CompletionReceiptEventRange + failed_tool_count: int + schema_version: int + source_event_id: str + stop_reason: CompletionReceiptStopReason + successful_tool_count: int + final_tool: CompletionReceiptFinalTool | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionCompletionReceiptData": + assert isinstance(obj, dict) + attempt = from_int(obj.get("attempt")) + event_range = CompletionReceiptEventRange.from_dict(obj.get("eventRange")) + failed_tool_count = from_int(obj.get("failedToolCount")) + schema_version = from_int(obj.get("schemaVersion")) + source_event_id = from_str(obj.get("sourceEventId")) + stop_reason = parse_enum(CompletionReceiptStopReason, obj.get("stopReason")) + successful_tool_count = from_int(obj.get("successfulToolCount")) + final_tool = from_union([from_none, CompletionReceiptFinalTool.from_dict], obj.get("finalTool")) + return SessionCompletionReceiptData( + attempt=attempt, + event_range=event_range, + failed_tool_count=failed_tool_count, + schema_version=schema_version, + source_event_id=source_event_id, + stop_reason=stop_reason, + successful_tool_count=successful_tool_count, + final_tool=final_tool, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["attempt"] = to_int(self.attempt) + result["eventRange"] = to_class(CompletionReceiptEventRange, self.event_range) + result["failedToolCount"] = to_int(self.failed_tool_count) + result["schemaVersion"] = to_int(self.schema_version) + result["sourceEventId"] = from_str(self.source_event_id) + result["stopReason"] = to_enum(CompletionReceiptStopReason, self.stop_reason) + result["successfulToolCount"] = to_int(self.successful_tool_count) + if self.final_tool is not None: + result["finalTool"] = from_union([from_none, lambda x: to_class(CompletionReceiptFinalTool, x)], self.final_tool) + return result + + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionFusionCompletedData: @@ -1783,6 +1922,8 @@ class SessionFusionResolvedData: turn_id: str follow_up: FusionFollowUpRecommendation | None = None model_universe_version: str | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + phase_plan: list[FusionPhasePlanStep] | None = None plan_version: str | None = None policy_version: str | None = None route_source: str | None = None @@ -1807,6 +1948,7 @@ def from_dict(obj: Any) -> "SessionFusionResolvedData": turn_id = from_str(obj.get("turnId")) follow_up = from_union([from_none, FusionFollowUpRecommendation.from_dict], obj.get("followUp")) model_universe_version = from_union([from_none, from_str], obj.get("modelUniverseVersion")) + phase_plan = from_union([from_none, lambda x: from_list(FusionPhasePlanStep.from_dict, x)], obj.get("phasePlan")) plan_version = from_union([from_none, from_str], obj.get("planVersion")) policy_version = from_union([from_none, from_str], obj.get("policyVersion")) route_source = from_union([from_none, from_str], obj.get("routeSource")) @@ -1828,6 +1970,7 @@ def from_dict(obj: Any) -> "SessionFusionResolvedData": turn_id=turn_id, follow_up=follow_up, model_universe_version=model_universe_version, + phase_plan=phase_plan, plan_version=plan_version, policy_version=policy_version, route_source=route_source, @@ -1854,6 +1997,8 @@ def to_dict(self) -> dict: result["followUp"] = from_union([from_none, lambda x: to_class(FusionFollowUpRecommendation, x)], self.follow_up) if self.model_universe_version is not None: result["modelUniverseVersion"] = from_union([from_none, from_str], self.model_universe_version) + if self.phase_plan is not None: + result["phasePlan"] = from_union([from_none, lambda x: from_list(lambda x: to_class(FusionPhasePlanStep, x), x)], self.phase_plan) if self.plan_version is not None: result["planVersion"] = from_union([from_none, from_str], self.plan_version) if self.policy_version is not None: @@ -4109,9 +4254,65 @@ def to_dict(self) -> dict: return result +@dataclass +class CompletionReceiptEventRange: + "Inclusive durable event range summarized by a completion receipt." + end_event_id: str + start_event_id: str + + @staticmethod + def from_dict(obj: Any) -> "CompletionReceiptEventRange": + assert isinstance(obj, dict) + end_event_id = from_str(obj.get("endEventId")) + start_event_id = from_str(obj.get("startEventId")) + return CompletionReceiptEventRange( + end_event_id=end_event_id, + start_event_id=start_event_id, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["endEventId"] = from_str(self.end_event_id) + result["startEventId"] = from_str(self.start_event_id) + return result + + +@dataclass +class CompletionReceiptFinalTool: + "Final structured tool completion in the covered event range." + status: CompletionReceiptToolStatus + tool_call_id: str + exit_code: int | None = None + tool_name: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "CompletionReceiptFinalTool": + assert isinstance(obj, dict) + status = parse_enum(CompletionReceiptToolStatus, obj.get("status")) + tool_call_id = from_str(obj.get("toolCallId")) + exit_code = from_union([from_none, from_int], obj.get("exitCode")) + tool_name = from_union([from_none, from_str], obj.get("toolName")) + return CompletionReceiptFinalTool( + status=status, + tool_call_id=tool_call_id, + exit_code=exit_code, + tool_name=tool_name, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["status"] = to_enum(CompletionReceiptToolStatus, self.status) + result["toolCallId"] = from_str(self.tool_call_id) + if self.exit_code is not None: + result["exitCode"] = from_union([from_none, to_int], self.exit_code) + if self.tool_name is not None: + result["toolName"] = from_union([from_none, from_str], self.tool_name) + return result + + @dataclass class CustomAgentsUpdatedAgent: - "A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and model override." + "A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and authored model configuration." description: str display_name: str id: str @@ -4120,6 +4321,8 @@ class CustomAgentsUpdatedAgent: tools: list[str] | None user_invocable: bool model: str | None = None + model_policy: AgentModelPolicy | None = None + models: list[str] | None = None @staticmethod def from_dict(obj: Any) -> "CustomAgentsUpdatedAgent": @@ -4132,6 +4335,8 @@ def from_dict(obj: Any) -> "CustomAgentsUpdatedAgent": tools = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("tools")) user_invocable = from_bool(obj.get("userInvocable")) model = from_union([from_none, from_str], obj.get("model")) + model_policy = from_union([from_none, lambda x: parse_enum(AgentModelPolicy, x)], obj.get("modelPolicy")) + models = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("models")) return CustomAgentsUpdatedAgent( description=description, display_name=display_name, @@ -4141,6 +4346,8 @@ def from_dict(obj: Any) -> "CustomAgentsUpdatedAgent": tools=tools, user_invocable=user_invocable, model=model, + model_policy=model_policy, + models=models, ) def to_dict(self) -> dict: @@ -4154,6 +4361,10 @@ def to_dict(self) -> dict: result["userInvocable"] = from_bool(self.user_invocable) if self.model is not None: result["model"] = from_union([from_none, from_str], self.model) + if self.model_policy is not None: + result["modelPolicy"] = from_union([from_none, lambda x: to_enum(AgentModelPolicy, x)], self.model_policy) + if self.models is not None: + result["models"] = from_union([from_none, lambda x: from_list(from_str, x)], self.models) return result @@ -7078,6 +7289,7 @@ class PermissionRequestedData: "Permission request notification requiring client approval with request details" permission_request: PermissionRequest request_id: str + agent_mode: SessionMode | None = None prompt_request: PermissionPromptRequest | None = None resolved_by_hook: bool | None = None risk_assessment: Any = None @@ -7087,12 +7299,14 @@ def from_dict(obj: Any) -> "PermissionRequestedData": assert isinstance(obj, dict) permission_request = _load_PermissionRequest(obj.get("permissionRequest")) request_id = from_str(obj.get("requestId")) + agent_mode = from_union([from_none, lambda x: parse_enum(SessionMode, x)], obj.get("agentMode")) prompt_request = from_union([from_none, _load_PermissionPromptRequest], obj.get("promptRequest")) resolved_by_hook = from_union([from_none, from_bool], obj.get("resolvedByHook")) risk_assessment = obj.get("riskAssessment") return PermissionRequestedData( permission_request=permission_request, request_id=request_id, + agent_mode=agent_mode, prompt_request=prompt_request, resolved_by_hook=resolved_by_hook, risk_assessment=risk_assessment, @@ -7102,6 +7316,8 @@ def to_dict(self) -> dict: result: dict = {} result["permissionRequest"] = self.permission_request.to_dict() result["requestId"] = from_str(self.request_id) + if self.agent_mode is not None: + result["agentMode"] = from_union([from_none, lambda x: to_enum(SessionMode, x)], self.agent_mode) if self.prompt_request is not None: result["promptRequest"] = from_union([from_none, lambda x: x.to_dict()], self.prompt_request) if self.resolved_by_hook is not None: @@ -9312,6 +9528,7 @@ class SubagentCompletedData: explicit_model_override: str | None = None first_dispatched_model: str | None = None model: str | None = None + model_override_reason: str | None = None total_tokens: int | None = None total_tool_calls: int | None = None @@ -9329,6 +9546,7 @@ def from_dict(obj: Any) -> "SubagentCompletedData": explicit_model_override = from_union([from_none, from_str], obj.get("explicitModelOverride")) first_dispatched_model = from_union([from_none, from_str], obj.get("firstDispatchedModel")) model = from_union([from_none, from_str], obj.get("model")) + model_override_reason = from_union([from_none, from_str], obj.get("modelOverrideReason")) total_tokens = from_union([from_none, from_int], obj.get("totalTokens")) total_tool_calls = from_union([from_none, from_int], obj.get("totalToolCalls")) return SubagentCompletedData( @@ -9343,6 +9561,7 @@ def from_dict(obj: Any) -> "SubagentCompletedData": explicit_model_override=explicit_model_override, first_dispatched_model=first_dispatched_model, model=model, + model_override_reason=model_override_reason, total_tokens=total_tokens, total_tool_calls=total_tool_calls, ) @@ -9368,6 +9587,8 @@ def to_dict(self) -> dict: result["firstDispatchedModel"] = from_union([from_none, from_str], self.first_dispatched_model) if self.model is not None: result["model"] = from_union([from_none, from_str], self.model) + if self.model_override_reason is not None: + result["modelOverrideReason"] = from_union([from_none, from_str], self.model_override_reason) if self.total_tokens is not None: result["totalTokens"] = from_union([from_none, to_int], self.total_tokens) if self.total_tool_calls is not None: @@ -9434,6 +9655,7 @@ class SubagentFailedData: explicit_model_override: str | None = None first_dispatched_model: str | None = None model: str | None = None + model_override_reason: str | None = None total_tokens: int | None = None total_tool_calls: int | None = None @@ -9451,6 +9673,7 @@ def from_dict(obj: Any) -> "SubagentFailedData": explicit_model_override = from_union([from_none, from_str], obj.get("explicitModelOverride")) first_dispatched_model = from_union([from_none, from_str], obj.get("firstDispatchedModel")) model = from_union([from_none, from_str], obj.get("model")) + model_override_reason = from_union([from_none, from_str], obj.get("modelOverrideReason")) total_tokens = from_union([from_none, from_int], obj.get("totalTokens")) total_tool_calls = from_union([from_none, from_int], obj.get("totalToolCalls")) return SubagentFailedData( @@ -9465,6 +9688,7 @@ def from_dict(obj: Any) -> "SubagentFailedData": explicit_model_override=explicit_model_override, first_dispatched_model=first_dispatched_model, model=model, + model_override_reason=model_override_reason, total_tokens=total_tokens, total_tool_calls=total_tool_calls, ) @@ -9489,6 +9713,8 @@ def to_dict(self) -> dict: result["firstDispatchedModel"] = from_union([from_none, from_str], self.first_dispatched_model) if self.model is not None: result["model"] = from_union([from_none, from_str], self.model) + if self.model_override_reason is not None: + result["modelOverrideReason"] = from_union([from_none, from_str], self.model_override_reason) if self.total_tokens is not None: result["totalTokens"] = from_union([from_none, to_int], self.total_tokens) if self.total_tool_calls is not None: @@ -11017,6 +11243,7 @@ class UserMessageData: delivery: UserMessageDelivery | None = None interaction_id: str | None = None is_autopilot_continuation: bool | None = None + message_id: str | None = None native_document_path_fallback_paths: list[str] | None = None parent_agent_task_id: str | None = None source: str | None = None @@ -11033,6 +11260,7 @@ def from_dict(obj: Any) -> "UserMessageData": delivery = from_union([from_none, lambda x: parse_enum(UserMessageDelivery, x)], obj.get("delivery")) interaction_id = from_union([from_none, from_str], obj.get("interactionId")) is_autopilot_continuation = from_union([from_none, from_bool], obj.get("isAutopilotContinuation")) + message_id = from_union([from_none, from_str], obj.get("messageId")) native_document_path_fallback_paths = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("nativeDocumentPathFallbackPaths")) parent_agent_task_id = from_union([from_none, from_str], obj.get("parentAgentTaskId")) source = from_union([from_none, from_str], obj.get("source")) @@ -11046,6 +11274,7 @@ def from_dict(obj: Any) -> "UserMessageData": delivery=delivery, interaction_id=interaction_id, is_autopilot_continuation=is_autopilot_continuation, + message_id=message_id, native_document_path_fallback_paths=native_document_path_fallback_paths, parent_agent_task_id=parent_agent_task_id, source=source, @@ -11067,6 +11296,8 @@ def to_dict(self) -> dict: result["interactionId"] = from_union([from_none, from_str], self.interaction_id) if self.is_autopilot_continuation is not None: result["isAutopilotContinuation"] = from_union([from_none, from_bool], self.is_autopilot_continuation) + if self.message_id is not None: + result["messageId"] = from_union([from_none, from_str], self.message_id) if self.native_document_path_fallback_paths is not None: result["nativeDocumentPathFallbackPaths"] = from_union([from_none, lambda x: from_list(from_str, x)], self.native_document_path_fallback_paths) if self.parent_agent_task_id is not None: @@ -11590,6 +11821,17 @@ class FusionPattern(Enum): CRITIQUE = "critique" +# Experimental: this enum is part of an experimental API and may change or be removed. +class FusionPhaseActivityKind(Enum): + "Content-safe activity observed while a HydraFusion phase is running." + # The provider produced additional private output bytes. + MODEL_OUTPUT = "model_output" + # A tool began executing inside the phase. + TOOL_STARTED = "tool_started" + # A tool finished executing inside the phase. + TOOL_COMPLETED = "tool_completed" + + # Experimental: this enum is part of an experimental API and may change or be removed. class FusionPhaseKind(Enum): "HydraFusion phase kind." @@ -11705,6 +11947,14 @@ class AgentInterruptedCancelPhase(Enum): MID_STREAM = "mid_stream" +class AgentModelPolicy(Enum): + "Whether configured models are advisory preferences or required constraints" + # Treat the authored models as advisory preferences that callers may override. + PREFERRED = "preferred" + # Require subagent execution to use one of the authored models. + REQUIRED = "required" + + class AssistantMessageToolRequestCallerType(Enum): "Hosted program caller type" PROGRAM = "program" @@ -11830,6 +12080,30 @@ class CompactionTrigger(Enum): MODEL_SWITCH = "model_switch" +class CompletionReceiptStopReason(Enum): + "Runtime reason the completion decision was accepted." + # The model reached a natural terminal response. + NATURAL = "natural" + # A terminal tool ended the interaction. + TERMINAL_TOOL = "terminal_tool" + # The configured agentStop continuation limit was reached. + AGENT_STOP_BLOCK_LIMIT = "agent_stop_block_limit" + + +class CompletionReceiptToolStatus(Enum): + "Structured terminal status from a tool completion event." + # The tool completed successfully. + SUCCESS = "success" + # The tool failed without a more specific structured status. + FAILURE = "failure" + # The tool exceeded its time budget. + TIMEOUT = "timeout" + # The user rejected the tool call. + REJECTED = "rejected" + # The permissions service denied the tool call. + DENIED = "denied" + + class ContextTier(Enum): "Allowed values for the `ContextTier` enumeration." # Default context tier with standard context window size. @@ -12366,7 +12640,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionModeNoticeDeliveredData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionContextClearedData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | SessionFusionRouteStartedData | SessionFusionRouteFailedData | SessionFusionResolvedData | SessionFusionCompletedData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantTurnRetryData | AgentInterruptedData | AssistantIntentData | AssistantFusionPhaseStartedData | AssistantFusionPhaseCompletedData | AssistantFusionPhaseFailedData | AssistantServerToolProgressData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | PromptCacheBreakData | ModelCallFailureData | ModelCallFinishedData | ModelCallStartData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | ToolSearchActivatedData | SkillInvokedData | SandboxDecisionData | SubagentStartedData | SubagentConfiguredData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | UiEphemeralQueryData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | SessionManagedSettingsResolvedData | SessionManagedSettingsEnforcedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | FactoryRunUpdatedData | FactoryRunStartedData | FactoryRunSettledData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data +SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionModeNoticeDeliveredData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionContextClearedData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | SessionCompletionReceiptData | SessionFusionRouteStartedData | SessionFusionRouteFailedData | SessionFusionResolvedData | SessionFusionCompletedData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantTurnRetryData | AgentInterruptedData | AssistantIntentData | AssistantFusionPhaseStartedData | AssistantFusionPhaseActivityData | AssistantFusionPhaseCompletedData | AssistantFusionPhaseFailedData | AssistantServerToolProgressData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | PromptCacheBreakData | ModelCallFailureData | ModelCallFinishedData | ModelCallStartData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | ToolSearchActivatedData | SkillInvokedData | SandboxDecisionData | SubagentStartedData | SubagentConfiguredData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | UiEphemeralQueryData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | SessionManagedSettingsResolvedData | SessionManagedSettingsEnforcedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | FactoryRunUpdatedData | FactoryRunStartedData | FactoryRunSettledData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -12423,6 +12697,7 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_COMPACTION_START: data = SessionCompactionStartData.from_dict(data_obj) case SessionEventType.SESSION_COMPACTION_COMPLETE: data = SessionCompactionCompleteData.from_dict(data_obj) case SessionEventType.SESSION_TASK_COMPLETE: data = SessionTaskCompleteData.from_dict(data_obj) + case SessionEventType.SESSION_COMPLETION_RECEIPT: data = SessionCompletionReceiptData.from_dict(data_obj) case SessionEventType.SESSION_FUSION_ROUTE_STARTED: data = SessionFusionRouteStartedData.from_dict(data_obj) case SessionEventType.SESSION_FUSION_ROUTE_FAILED: data = SessionFusionRouteFailedData.from_dict(data_obj) case SessionEventType.SESSION_FUSION_RESOLVED: data = SessionFusionResolvedData.from_dict(data_obj) @@ -12434,6 +12709,7 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.AGENT_INTERRUPTED: data = AgentInterruptedData.from_dict(data_obj) case SessionEventType.ASSISTANT_INTENT: data = AssistantIntentData.from_dict(data_obj) case SessionEventType.ASSISTANT_FUSION_PHASE_STARTED: data = AssistantFusionPhaseStartedData.from_dict(data_obj) + case SessionEventType.ASSISTANT_FUSION_PHASE_ACTIVITY: data = AssistantFusionPhaseActivityData.from_dict(data_obj) case SessionEventType.ASSISTANT_FUSION_PHASE_COMPLETED: data = AssistantFusionPhaseCompletedData.from_dict(data_obj) case SessionEventType.ASSISTANT_FUSION_PHASE_FAILED: data = AssistantFusionPhaseFailedData.from_dict(data_obj) case SessionEventType.ASSISTANT_SERVER_TOOL_PROGRESS: data = AssistantServerToolProgressData.from_dict(data_obj) @@ -12562,6 +12838,8 @@ def session_event_to_dict(x: SessionEvent) -> Any: "AgentInterruptedActivity", "AgentInterruptedCancelPhase", "AgentInterruptedData", + "AgentModelPolicy", + "AssistantFusionPhaseActivityData", "AssistantFusionPhaseCompletedData", "AssistantFusionPhaseFailedData", "AssistantFusionPhaseStartedData", @@ -12646,6 +12924,10 @@ def session_event_to_dict(x: SessionEvent) -> Any: "CompactionCompleteCompactionTokensUsed", "CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail", "CompactionTrigger", + "CompletionReceiptEventRange", + "CompletionReceiptFinalTool", + "CompletionReceiptStopReason", + "CompletionReceiptToolStatus", "ContextTier", "CustomAgentsUpdatedAgent", "Data", @@ -12675,7 +12957,9 @@ def session_event_to_dict(x: SessionEvent) -> Any: "FusionFollowUpAction", "FusionFollowUpRecommendation", "FusionPattern", + "FusionPhaseActivityKind", "FusionPhaseKind", + "FusionPhasePlanStep", "FusionPhaseStatus", "FusionPhaseUsage", "FusionScores", @@ -12801,6 +13085,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SessionCanvasUnavailableData", "SessionCompactionCompleteData", "SessionCompactionStartData", + "SessionCompletionReceiptData", "SessionContextChangedData", "SessionContextClearedData", "SessionCustomAgentsUpdatedData", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index b1d9896f3e..3eff4e1524 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -10,11 +10,11 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use super::session_events::{ - AbortReason, AutoTier, ContextTier, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, - McpServerSource, McpServerStatus, ModelChangeSource, OmittedBinaryOmittedReason, - PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionLimitsConfig, - SessionMode, ShutdownType, SkillSource, TaskCompletionOutcome, UserToolSessionApproval, - Verbosity, + AbortReason, AgentModelPolicy, AutoTier, ContextTier, McpOauthHttpResponse, + McpOauthWWWAuthenticateParams, McpServerSource, McpServerStatus, ModelChangeSource, + OmittedBinaryOmittedReason, PermissionMode, PermissionPromptRequest, PermissionRule, + ReasoningSummary, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, + TaskCompletionOutcome, UserToolSessionApproval, Verbosity, }; use crate::types::{RequestId, SessionEvent, SessionId}; @@ -24,6 +24,8 @@ pub mod rpc_methods { pub const PING: &str = "ping"; /// `connect` pub const CONNECT: &str = "connect"; + /// `hooks.discover` + pub const HOOKS_DISCOVER: &str = "hooks.discover"; /// `models.list` pub const MODELS_LIST: &str = "models.list"; /// `models.getBuiltInCatalog` @@ -142,6 +144,8 @@ pub mod rpc_methods { pub const SESSIONS_LIST: &str = "sessions.list"; /// `sessions.getMetadata` pub const SESSIONS_GETMETADATA: &str = "sessions.getMetadata"; + /// `sessions.readPersistedEvents` + pub const SESSIONS_READPERSISTEDEVENTS: &str = "sessions.readPersistedEvents"; /// `sessions.listNonEmptySessionIds` pub const SESSIONS_LISTNONEMPTYSESSIONIDS: &str = "sessions.listNonEmptySessionIds"; /// `sessions.findByTaskId` @@ -1541,7 +1545,7 @@ pub struct AgentDiscoveryPathList { pub paths: Vec, } -/// Agent metadata, including identifiers, display details, source, tools, model, MCP servers, skills, and file path. +/// Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path. /// ///
/// @@ -1571,6 +1575,12 @@ pub struct AgentInfo { /// Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference. #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, + /// Whether authored models are preferences or required constraints. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_policy: Option, + /// Authored preferred model ids for this agent, in priority order. Runtime model selection chooses the first available model; omitted means no authored preference. + #[serde(skip_serializing_if = "Option::is_none")] + pub models: Option>, /// Name of the agent. Use `id` as the stable selection identifier. pub name: String, /// Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path. @@ -4379,6 +4389,36 @@ pub struct DiscoveredExtensionsEnableRequest { pub ids: Vec, } +/// One server-discovered hook action from user, repository, plugin, or managed-policy configuration. +/// +///
+/// +/// **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 DiscoveredHook { + /// Durable content hash used by hook enablement. Identical actions may intentionally share this key. Omitted when changing the user's disabled-hooks setting cannot change the action's current server-discovered state, including managed-policy hooks, session-start prompt actions, actions suppressed by disable-all settings, and projectless plugin actions that require project-directory expansion. + #[serde(skip_serializing_if = "Option::is_none")] + pub disable_key: Option, + /// Whether this action is enabled under the server-side discovery settings. Concrete sessions may differ because they can add session-specific directories, plugins, or trust. False when its disable key is present in the user's disabled-hooks setting or disable-all settings suppress the action. + pub enabled: bool, + /// Hook event that invokes this action. + pub hook_type: HookType, + /// Deterministic identifier for this server-discovered action row. It remains stable while the project, origin, source, event, action content, and duplicate ordinal are unchanged. This is row identity, not the key persisted in disabledHooks. + pub id: String, + /// Configuration tier that contributed this hook action. + pub origin: HookOrigin, + /// Input project path for which this server-side action was resolved. Set on every row returned for project-scoped discovery, including repeated user and policy actions. + #[serde(skip_serializing_if = "Option::is_none")] + pub project_path: Option, + /// Human-readable source label, such as a hook file path, settings source, or plugin name. + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, +} + /// MCP server discovered by `mcp.discover`, with config source, optional plugin source, transport type, and enabled state. /// ///
@@ -6459,8 +6499,7 @@ pub struct HistoryTruncateResult { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub(crate) struct HookInvokeRequest { - #[doc(hidden)] - pub(crate) hook_type: HookType, + pub hook_type: HookType, pub input: serde_json::Value, pub session_id: SessionId, } @@ -6473,6 +6512,44 @@ pub(crate) struct HookInvokeResponse { pub output: Option, } +/// Optional project paths and host-exclusion behavior for server-scoped hook discovery. +/// +///
+/// +/// **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 HooksDiscoverRequest { + /// When true, omit host-owned user and plugin hook rows and their diagnostics. Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks still contribute to each remaining row's effective enabled state. This filters sources rather than simulating a host with no settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub exclude_host_hooks: Option, + /// Optional project directory paths whose trusted repository and project-expanded plugin hooks should be discovered. When omitted or empty, user, managed-policy, and globally enabled installed or explicit plugin hooks are returned without project expansion. + #[serde(skip_serializing_if = "Option::is_none")] + pub project_paths: Option>, +} + +/// Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources. +/// +///
+/// +/// **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 HooksDiscoverResult { + /// Errors for hook sources or actions that could not be loaded, making the result partially incomplete. Other valid actions are still returned. Project-resolution and repository-settings errors are prefixed with their project path. + pub errors: Vec, + /// All discovered hook actions. Byte-identical actions remain separate rows even when they share a disable key. + pub hooks: Vec, + /// Non-fatal source-loading warnings. Discovery remains complete for the affected source, although the source had a recoverable issue. Repository-settings warnings are prefixed with their project path when attribution is available. + pub warnings: Vec, +} + /// Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source. /// ///
@@ -10519,7 +10596,7 @@ pub struct ModelSwitchToRequest { /// When true, evaluate context-window compaction policy before applying the switch. #[serde(skip_serializing_if = "Option::is_none")] pub run_compaction_preflight: Option, - /// Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. + /// Origin to record on the effective `session.model_change` event for trusted in-process calls. Transport SDK calls are always recorded as `sdk`, regardless of this value. #[serde(skip_serializing_if = "Option::is_none")] pub source: Option, /// Output verbosity level to request for supported models @@ -13974,6 +14051,9 @@ pub struct QueuePendingItems { pub id: String, /// Whether this item is a queued user message or a queued slash command / model change pub kind: QueuePendingItemsKind, + /// Stable identity of the queued user message. Present for message rows and absent for slash commands and model changes. + #[serde(skip_serializing_if = "Option::is_none")] + pub message_id: Option, } /// Snapshot of the session's pending queued items and immediate-steering messages. @@ -14680,7 +14760,7 @@ pub struct SandboxConfigUserPolicyNetworkProxy { /// Optional password for proxy authentication, combined with the URL at spawn time. The persisted value may be a literal password, a `${secret:…}` reference resolved from the OS keychain, or a `${VAR}`/`$VAR` environment reference; it is resolved just before the sandboxed process routes through the proxy. The /sandbox dialog stores a real password in the OS keychain and persists only a `${secret:…}` placeholder (never plaintext in settings.json); the field is masked in the dialog and redacted by /settings show. #[serde(skip_serializing_if = "Option::is_none")] pub password: Option, - /// Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. + /// Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted; an explicit port must be between 1 and 65535. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. pub url: String, /// Optional username for proxy authentication. Combined with the URL (and `password`) into `user:pass@host` when the sandboxed process routes through the proxy. #[serde(skip_serializing_if = "Option::is_none")] @@ -14704,7 +14784,7 @@ pub struct SandboxConfigUserPolicyNetwork { /// Whether outbound network traffic is allowed at all. #[serde(skip_serializing_if = "Option::is_none")] pub allow_outbound: Option, - /// HTTP proxy the sandboxed process routes traffic through. Enforced on Windows and cooperative (honored by well-behaved tools, not strictly enforced) on Linux and macOS. Credentials go in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; an https:// or authenticated loopback URL is used as-is. + /// HTTP proxy for sandboxed process traffic. Linux restricts egress to the proxy endpoint, requires that endpoint to be reachable over IPv4 (the `[::]` dual-stack wildcard is accepted and routed through the IPv4 gateway), and does not support proxy credentials. macOS relies on applications honoring proxy environment variables. Windows also configures a per-AppContainer WinHTTP proxy, but enforcement depends on the application's networking stack. Configure supported credentials in the separate `username` and `password` fields. A credential-free http:// loopback URL uses the localhost proxy form, while an https:// or authenticated loopback URL uses the URL form. #[serde(skip_serializing_if = "Option::is_none")] pub proxy: Option, } @@ -17969,6 +18049,30 @@ pub struct SessionsPruneOldRequest { pub older_than_days: i64, } +/// Pagination options for reading an inactive or active local session's persisted event journal. +/// +///
+/// +/// **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 SessionsReadPersistedEventsRequest { + /// Opaque cursor returned by a previous persisted-event read. Omit on the first call. + #[serde(skip_serializing_if = "Option::is_none")] + pub cursor: Option, + /// Direction to page through persisted history. Forward starts at the beginning; backward starts with the newest events. Events in each page remain chronological. + #[serde(skip_serializing_if = "Option::is_none")] + pub direction: Option, + /// Maximum number of events to return in this batch (1–1000, default 200). + #[serde(skip_serializing_if = "Option::is_none")] + pub max: Option, + /// Session ID whose persisted event journal should be read. + pub session_id: SessionId, +} + /// Session ID whose in-use lock should be released. /// ///
@@ -19031,6 +19135,9 @@ pub struct SubagentSettingsEntry { /// Model override for matching subagents #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, + /// Whether the configured model strategy is preferred or required + #[serde(skip_serializing_if = "Option::is_none")] + pub model_policy: Option, } /// Subagent settings to apply, or null to clear the live session override @@ -21795,6 +21902,27 @@ pub struct SessionsListResult { pub sessions: Vec, } +/// Batch of session events returned by a read, with cursor and continuation metadata. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionsReadPersistedEventsResult { + /// 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 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`. 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 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, +} + /// ID of the local session bound to the given GitHub task, or omitted when none. /// ///
@@ -28951,6 +29079,101 @@ pub enum DiscoveredExtensionMode { Unknown, } +/// Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events. +/// +///
+/// +/// **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 HookType { + /// Runs before a tool is invoked. + #[serde(rename = "preToolUse")] + PreToolUse, + /// Runs before an MCP tool is invoked. + #[serde(rename = "preMcpToolCall")] + PreMcpToolCall, + /// Runs after a tool completes successfully. + #[serde(rename = "postToolUse")] + PostToolUse, + /// Runs after a tool fails. + #[serde(rename = "postToolUseFailure")] + PostToolUseFailure, + /// Runs after the user submits a prompt. + #[serde(rename = "userPromptSubmitted")] + UserPromptSubmitted, + /// Runs after the runtime transforms the submitted prompt for the model, before it is added to session history. + #[serde(rename = "userPromptTransformed")] + UserPromptTransformed, + /// Runs when a session starts. + #[serde(rename = "sessionStart")] + SessionStart, + /// Runs when a session ends. + #[serde(rename = "sessionEnd")] + SessionEnd, + /// Runs after an agent result is produced. + #[serde(rename = "postResult")] + PostResult, + /// Runs before a pull request description is generated. + #[serde(rename = "prePRDescription")] + PrePRDescription, + /// Runs when the agent encounters an error. + #[serde(rename = "errorOccurred")] + ErrorOccurred, + /// Runs when the agent stops. + #[serde(rename = "agentStop")] + AgentStop, + /// Runs when a subagent starts. + #[serde(rename = "subagentStart")] + SubagentStart, + /// Runs when a subagent stops. + #[serde(rename = "subagentStop")] + SubagentStop, + /// Runs before conversation context is compacted. + #[serde(rename = "preCompact")] + PreCompact, + /// Runs when the agent requests permission. + #[serde(rename = "permissionRequest")] + PermissionRequest, + /// Runs when the agent emits a notification. + #[serde(rename = "notification")] + Notification, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Configuration tier that contributed a discovered hook action. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum HookOrigin { + /// Hook loaded from user settings or the user's hook directory. + #[serde(rename = "user")] + User, + /// Hook loaded from repository settings or the repository hook directory. + #[serde(rename = "repository")] + Repository, + /// Hook provided by an enabled installed or explicit plugin. Projectless rows omit projectPath and do not expand a project directory. + #[serde(rename = "plugin")] + Plugin, + /// Hook enforced by centrally managed policy. + #[serde(rename = "policy")] + Policy, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Server transport type: stdio, http, sse (deprecated), or memory /// ///
@@ -29565,66 +29788,6 @@ pub enum HistoryRewindOutcome { Unknown, } -/// Hook event name dispatched through the SDK callback transport. -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] -pub enum HookType { - /// Runs before a tool is invoked. - #[serde(rename = "preToolUse")] - PreToolUse, - /// Runs before an MCP tool is invoked. - #[serde(rename = "preMcpToolCall")] - PreMcpToolCall, - /// Runs after a tool completes successfully. - #[serde(rename = "postToolUse")] - PostToolUse, - /// Runs after a tool fails. - #[serde(rename = "postToolUseFailure")] - PostToolUseFailure, - /// Runs after the user submits a prompt. - #[serde(rename = "userPromptSubmitted")] - UserPromptSubmitted, - /// Runs after the runtime transforms the submitted prompt for the model, before it is added to session history. - #[serde(rename = "userPromptTransformed")] - UserPromptTransformed, - /// Runs when a session starts. - #[serde(rename = "sessionStart")] - SessionStart, - /// Runs when a session ends. - #[serde(rename = "sessionEnd")] - SessionEnd, - /// Runs after an agent result is produced. - #[serde(rename = "postResult")] - PostResult, - /// Runs before a pull request description is generated. - #[serde(rename = "prePRDescription")] - PrePRDescription, - /// Runs when the agent encounters an error. - #[serde(rename = "errorOccurred")] - ErrorOccurred, - /// Runs when the agent stops. - #[serde(rename = "agentStop")] - AgentStop, - /// Runs when a subagent starts. - #[serde(rename = "subagentStart")] - SubagentStart, - /// Runs when a subagent stops. - #[serde(rename = "subagentStop")] - SubagentStop, - /// Runs before conversation context is compacted. - #[serde(rename = "preCompact")] - PreCompact, - /// Runs when the agent requests permission. - #[serde(rename = "permissionRequest")] - PermissionRequest, - /// Runs when the agent emits a notification. - #[serde(rename = "notification")] - Notification, - /// Unknown variant for forward compatibility. - #[default] - #[serde(other)] - Unknown, -} - /// Constant value. Always "github". #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum InstalledPluginSourceGitHubSource { diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 6f5895d856..d31cea5ce9 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -64,6 +64,13 @@ impl<'a> ClientRpc<'a> { } } + /// `hooks.*` sub-namespace. + pub fn hooks(&self) -> ClientRpcHooks<'a> { + ClientRpcHooks { + client: self.client, + } + } + /// `instructions.*` sub-namespace. pub fn instructions(&self) -> ClientRpcInstructions<'a> { ClientRpcInstructions { @@ -656,6 +663,45 @@ impl<'a> ClientRpcExtensions<'a> { } } +/// `hooks.*` RPCs. +#[derive(Clone, Copy)] +pub struct ClientRpcHooks<'a> { + pub(crate) client: &'a Client, +} + +impl<'a> ClientRpcHooks<'a> { + /// Discovers hook actions enabled under server-side discovery settings from user, repository, plugin, and managed-policy sources. + /// + /// Wire method: `hooks.discover`. + /// + /// # Parameters + /// + /// * `params` - Optional project paths and host-exclusion behavior for server-scoped hook discovery. + /// + /// # Returns + /// + /// Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources. + /// + ///
+ /// + /// **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, + params: HooksDiscoverRequest, + ) -> Result { + let wire_params = serde_json::to_value(params)?; + let _value = self + .client + .call(rpc_methods::HOOKS_DISCOVER, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } +} + /// `instructions.*` RPCs. #[derive(Clone, Copy)] pub struct ClientRpcInstructions<'a> { @@ -1886,6 +1932,37 @@ impl<'a> ClientRpcSessions<'a> { Ok(serde_json::from_value(_value)?) } + /// Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The initial backward read uses a bounded tail scan for fast first paint; cursor continuations preserve the session event-log paging semantics. Persisted events may omit payloads that are reconstructed only for an active session. + /// + /// Wire method: `sessions.readPersistedEvents`. + /// + /// # Parameters + /// + /// * `params` - Pagination options for reading an inactive or active local session's persisted event journal. + /// + /// # Returns + /// + /// Batch of session events returned by a read, with cursor and continuation metadata. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn read_persisted_events( + &self, + params: SessionsReadPersistedEventsRequest, + ) -> Result { + let wire_params = serde_json::to_value(params)?; + let _value = self + .client + .call(rpc_methods::SESSIONS_READPERSISTEDEVENTS, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Lists recent local session IDs that contain user-visible history, omitting housekeeping-only sessions. /// /// Wire method: `sessions.listNonEmptySessionIds`. diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index 8c48ac62ca..1bf9b75903 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -87,6 +87,15 @@ pub enum SessionEventType { /// and may change or be removed in future SDK or CLI releases. /// ///
+ #[serde(rename = "session.completion_receipt")] + SessionCompletionReceipt, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
#[serde(rename = "session.fusion_route_started")] SessionFusionRouteStarted, /// @@ -144,6 +153,15 @@ pub enum SessionEventType { /// and may change or be removed in future SDK or CLI releases. /// ///
+ #[serde(rename = "assistant.fusion_phase_activity")] + AssistantFusionPhaseActivity, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
#[serde(rename = "assistant.fusion_phase_completed")] AssistantFusionPhaseCompleted, /// @@ -515,6 +533,15 @@ pub enum SessionEventData { /// and may change or be removed in future SDK or CLI releases. /// ///
+ #[serde(rename = "session.completion_receipt")] + SessionCompletionReceipt(SessionCompletionReceiptData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
#[serde(rename = "session.fusion_route_started")] SessionFusionRouteStarted(SessionFusionRouteStartedData), /// @@ -572,6 +599,15 @@ pub enum SessionEventData { /// and may change or be removed in future SDK or CLI releases. /// ///
+ #[serde(rename = "assistant.fusion_phase_activity")] + AssistantFusionPhaseActivity(AssistantFusionPhaseActivityData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
#[serde(rename = "assistant.fusion_phase_completed")] AssistantFusionPhaseCompleted(AssistantFusionPhaseCompletedData), /// @@ -1832,6 +1868,62 @@ pub struct SessionTaskCompleteData { pub summary: Option, } +/// Inclusive durable event range summarized by a completion receipt. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct CompletionReceiptEventRange { + /// Identifier of the assistant turn-end event that ends the covered exchange. Always equals the receipt's sourceEventId, so either field is a valid join key. + pub end_event_id: String, + /// Identifier of the user message that starts the covered exchange. + pub start_event_id: String, +} + +/// Final structured tool completion in the covered event range. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct CompletionReceiptFinalTool { + /// Process exit code from a structured shell result, when available. + #[serde(skip_serializing_if = "Option::is_none")] + pub exit_code: Option, + /// Structured success or failure status from the tool completion event. + pub status: CompletionReceiptToolStatus, + /// Unique identifier of the completed tool call. + pub tool_call_id: String, + /// Tool name from the matching tool execution start event, when available. + #[serde(skip_serializing_if = "Option::is_none")] + pub tool_name: Option, +} + +/// Session event "session.completion_receipt". Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted. +/// +///
+/// +/// **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 SessionCompletionReceiptData { + /// One-based accepted completion receipt ordinal in the durable session history. + pub attempt: i64, + /// Inclusive durable event range summarized by this receipt. + pub event_range: CompletionReceiptEventRange, + /// Number of failed structured tool completions in the covered range. + pub failed_tool_count: i64, + /// Final structured tool completion in the covered range, when one exists. + #[serde(skip_serializing_if = "Option::is_none")] + pub final_tool: Option, + /// Version of the completion receipt payload. + pub schema_version: i64, + /// Identifier of the assistant turn-end event that supplied the accepted completion boundary. This is the receipt's idempotency key, and always equals eventRange.endEventId. + pub source_event_id: String, + /// Runtime reason the completion decision was accepted. + pub stop_reason: CompletionReceiptStopReason, + /// Number of successful structured tool completions in the covered range. + pub successful_tool_count: i64, +} + /// Session event "session.fusion_route_started". Experimental transient signal that HydraFusion routing has started for an eligible turn. /// ///
@@ -1901,6 +1993,27 @@ pub struct FusionFollowUpRecommendation { pub user_turn: FusionFollowUpAction, } +/// Presentation-neutral phase planned for a HydraFusion turn. +/// +///
+/// +/// **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 FusionPhasePlanStep { + /// Whether the phase executes only when an earlier phase requests it. + pub conditional: bool, + /// Kind of phase that may execute. + pub kind: FusionPhaseKind, + /// Semantic role assigned to the phase. + pub role: String, + /// Conversation scope in which the phase executes. + pub scope: FusionConversationScope, +} + /// Validated HydraFusion routing capability scores. /// ///
@@ -1949,6 +2062,16 @@ pub struct SessionFusionResolvedData { pub model_universe_version: Option, /// Validated orchestration pattern selected for the turn. pub pattern: FusionPattern, + /// Presentation-neutral phase plan for clients that render workflow progress. + /// + ///
+ /// + /// **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 phase_plan: Option>, /// Version of the validated execution-plan format. #[serde(skip_serializing_if = "Option::is_none")] pub plan_version: Option, @@ -2056,6 +2179,9 @@ pub struct UserMessageData { /// True when this user message was auto-injected by autopilot's continuation loop rather than typed by the user; used to distinguish autopilot-driven turns in telemetry. #[serde(skip_serializing_if = "Option::is_none")] pub is_autopilot_continuation: Option, + /// Stable identity of the logical user message, matching the ID returned by send and retained by pending queue snapshots + #[serde(skip_serializing_if = "Option::is_none")] + pub message_id: Option, /// Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit #[serde(skip_serializing_if = "Option::is_none")] pub native_document_path_fallback_paths: Option>, @@ -2186,6 +2312,39 @@ pub struct AssistantFusionPhaseStartedData { pub role: String, } +/// Session event "assistant.fusion_phase_activity". Experimental content-safe activity signal for a running HydraFusion phase. +/// +///
+/// +/// **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 AssistantFusionPhaseActivityData { + /// Kind of real activity observed. + pub activity: FusionPhaseActivityKind, + /// Conversation scope in which the phase executes. + pub conversation_scope: FusionConversationScope, + /// Identifier of the HydraFusion turn containing the phase. + pub fusion_id: String, + /// HydraFusion orchestration pattern containing the phase. + pub pattern: FusionPattern, + /// Stable identifier for the concrete phase. + pub phase_id: String, + /// Kind of phase currently executing. + pub phase_kind: FusionPhaseKind, + /// Semantic role assigned to the phase. + pub role: String, + /// Opaque hashed correlation token for matching tool-started and tool-completed activity within this Fusion activity stream. It is not the tool call identifier exposed by tool lifecycle events. + #[serde(skip_serializing_if = "Option::is_none")] + pub tool_call_id: Option, + /// Cumulative private response bytes observed for this model call. The event never includes response text. + #[serde(skip_serializing_if = "Option::is_none")] + pub total_response_size_bytes: Option, +} + /// Internal durable terminal request staged by a HydraFusion phase until an idempotent final commit selects it. /// ///
@@ -3981,6 +4140,9 @@ pub struct SubagentCompletedData { /// Model used by the sub-agent #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, + /// Why an explicit task-call model did not become the effective model + #[serde(skip_serializing_if = "Option::is_none")] + pub model_override_reason: Option, /// Tool call ID of the parent tool invocation that spawned this sub-agent pub tool_call_id: String, /// Total tokens (input + output) consumed by the sub-agent @@ -4022,6 +4184,9 @@ pub struct SubagentFailedData { /// Model selected for the sub-agent, when known #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, + /// Why an explicit task-call model did not become the effective model + #[serde(skip_serializing_if = "Option::is_none")] + pub model_override_reason: Option, /// Tool call ID of the parent tool invocation that spawned this sub-agent pub tool_call_id: String, /// Total tokens (input + output) consumed before the sub-agent failed @@ -5030,6 +5195,9 @@ pub struct PermissionPromptRequestExtensionEnvAccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PermissionRequestedData { + /// Agent mode captured from the owning turn when permission evaluation began. + #[serde(skip_serializing_if = "Option::is_none")] + pub agent_mode: Option, /// Details of the permission being requested pub permission_request: PermissionRequest, /// Derived user-facing permission prompt details for UI consumers @@ -5980,7 +6148,7 @@ pub struct SessionSkillsLoadedData { pub skills: Vec, } -/// A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and model override. +/// A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and authored model configuration. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CustomAgentsUpdatedAgent { @@ -5993,6 +6161,12 @@ pub struct CustomAgentsUpdatedAgent { /// Model override for this agent, if set #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, + /// Whether authored models are preferences or required constraints + #[serde(skip_serializing_if = "Option::is_none")] + pub model_policy: Option, + /// Authored model ids in priority order, if configured + #[serde(skip_serializing_if = "Option::is_none")] + pub models: Option>, /// Internal name of the agent pub name: String, /// Source location: user, project, inherited, remote, or plugin @@ -6686,6 +6860,48 @@ pub enum TaskCompletionOutcome { Unknown, } +/// Structured terminal status from a tool completion event. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum CompletionReceiptToolStatus { + /// The tool completed successfully. + #[serde(rename = "success")] + Success, + /// The tool failed without a more specific structured status. + #[serde(rename = "failure")] + Failure, + /// The tool exceeded its time budget. + #[serde(rename = "timeout")] + Timeout, + /// The user rejected the tool call. + #[serde(rename = "rejected")] + Rejected, + /// The permissions service denied the tool call. + #[serde(rename = "denied")] + Denied, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Runtime reason the completion decision was accepted. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum CompletionReceiptStopReason { + /// The model reached a natural terminal response. + #[serde(rename = "natural")] + Natural, + /// A terminal tool ended the interaction. + #[serde(rename = "terminal_tool")] + TerminalTool, + /// The configured agentStop continuation limit was reached. + #[serde(rename = "agent_stop_block_limit")] + AgentStopBlockLimit, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Kind of turn for which HydraFusion routing is running. /// ///
@@ -6755,6 +6971,65 @@ pub enum FusionPattern { Unknown, } +/// HydraFusion phase kind. +/// +///
+/// +/// **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 FusionPhaseKind { + /// Primary solver phase. + #[serde(rename = "primary")] + Primary, + /// Read-only cascade judge phase. + #[serde(rename = "judge")] + Judge, + /// Cascade repair phase. + #[serde(rename = "repair")] + Repair, + /// Initial critique-pattern draft phase. + #[serde(rename = "draft")] + Draft, + /// Read-only critique phase. + #[serde(rename = "critic")] + Critic, + /// Critique-pattern revision phase. + #[serde(rename = "revision")] + Revision, + /// Follow-up phase continuing from the resolved model. + #[serde(rename = "follow_up")] + FollowUp, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Conversation scope in which a HydraFusion phase executes. +/// +///
+/// +/// **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 FusionConversationScope { + /// Canonical root conversation history. + #[serde(rename = "root")] + Root, + /// Isolated read-only review history that does not enter the root conversation. + #[serde(rename = "review")] + Review, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// The agent mode that was active when this message was sent #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum UserMessageAgentMode { @@ -6845,7 +7120,7 @@ pub enum ModelCallFailureTransport { Unknown, } -/// Conversation scope in which a HydraFusion phase executes. +/// Content-safe activity observed while a HydraFusion phase is running. /// ///
/// @@ -6854,50 +7129,16 @@ pub enum ModelCallFailureTransport { /// ///
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] -pub enum FusionConversationScope { - /// Canonical root conversation history. - #[serde(rename = "root")] - Root, - /// Isolated read-only review history that does not enter the root conversation. - #[serde(rename = "review")] - Review, - /// Unknown variant for forward compatibility. - #[default] - #[serde(other)] - Unknown, -} - -/// HydraFusion phase kind. -/// -///
-/// -/// **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 FusionPhaseKind { - /// Primary solver phase. - #[serde(rename = "primary")] - Primary, - /// Read-only cascade judge phase. - #[serde(rename = "judge")] - Judge, - /// Cascade repair phase. - #[serde(rename = "repair")] - Repair, - /// Initial critique-pattern draft phase. - #[serde(rename = "draft")] - Draft, - /// Read-only critique phase. - #[serde(rename = "critic")] - Critic, - /// Critique-pattern revision phase. - #[serde(rename = "revision")] - Revision, - /// Follow-up phase continuing from the resolved model. - #[serde(rename = "follow_up")] - FollowUp, +pub enum FusionPhaseActivityKind { + /// The provider produced additional private output bytes. + #[serde(rename = "model_output")] + ModelOutput, + /// A tool began executing inside the phase. + #[serde(rename = "tool_started")] + ToolStarted, + /// A tool finished executing inside the phase. + #[serde(rename = "tool_completed")] + ToolCompleted, /// Unknown variant for forward compatibility. #[default] #[serde(other)] @@ -8302,6 +8543,21 @@ pub enum SkillSource { Unknown, } +/// Whether configured models are advisory preferences or required constraints +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum AgentModelPolicy { + /// Treat the authored models as advisory preferences that callers may override. + #[serde(rename = "preferred")] + Preferred, + /// Require subagent execution to use one of the authored models. + #[serde(rename = "required")] + Required, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Configuration source: user, workspace, plugin, or builtin #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum McpServerSource { diff --git a/rust/tests/e2e/rpc_session_state_extras.rs b/rust/tests/e2e/rpc_session_state_extras.rs index 85c20debc7..e764c53933 100644 --- a/rust/tests/e2e/rpc_session_state_extras.rs +++ b/rust/tests/e2e/rpc_session_state_extras.rs @@ -495,6 +495,7 @@ async fn should_update_and_clear_live_subagent_settings() { ), effort_level: Some("low".to_string()), model: Some("gpt-5-mini".to_string()), + model_policy: None, }, )])), disabled_subagents: Some(vec!["legacy-agent".to_string()]), diff --git a/scripts/codegen/rust.ts b/scripts/codegen/rust.ts index 0feec5e98a..b3cc5d5753 100644 --- a/scripts/codegen/rust.ts +++ b/scripts/codegen/rust.ts @@ -378,9 +378,7 @@ function tryEmitRustUnion( const lines: string[] = []; if (schema.description) { - for (const line of schema.description.split(/\r?\n/)) { - lines.push(`/// ${line}`); - } + pushRustDoc(lines, schema.description); } pushRustExperimentalDocs(lines, isSchemaExperimental(schema) || ctx.experimentalTypeNames.has(enumName)); lines.push("#[derive(Debug, Clone, Serialize, Deserialize)]"); @@ -468,7 +466,8 @@ function pushRustExperimentalDocs( function pushRustDoc(lines: string[], text: string | undefined, indent = ""): void { if (!text) return; - for (const paragraph of text.trim().split(/\r?\n/)) { + const sanitized = text.replace(/\[::\]/g, "`[::]`"); + for (const paragraph of sanitized.trim().split(/\r?\n/)) { if (paragraph.trim().length === 0) { lines.push(`${indent}///`); } else { @@ -971,9 +970,7 @@ function emitRustStruct( for (const { propName, prop, isReq, rustField, rustType } of fields) { if (prop.description) { - for (const line of prop.description.split(/\r?\n/)) { - lines.push(` /// ${line}`); - } + pushRustDoc(lines, prop.description, " "); } pushRustExperimentalDocs(lines, isSchemaExperimental(prop), " "); const propIsInternal = isSchemaInternal(prop); diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index 274e70f675..8cf978665f 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.83-1", + "@github/copilot": "^1.0.83-2", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", @@ -472,8 +472,8 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.83-1", - "integrity": "sha512-7rhgbgSx7IgfFYXrTx2/2+qowv6MZjC6BN0mhba37RuGQxsca9Zk2ucAeIX3GbQTp91AhvnN0aHCxabX36xADQ==", + "version": "1.0.83-2", + "integrity": "sha512-ntRvwGdZbZJjOvdV3LVBQ7z69W19DO4MWe/dh6pP8kYeumbzC4udVj7mCtoSwBOs0hwXirhXY+BZwqSJUp5FLQ==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { @@ -483,19 +483,19 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.83-1", - "@github/copilot-darwin-x64": "1.0.83-1", - "@github/copilot-linux-arm64": "1.0.83-1", - "@github/copilot-linux-x64": "1.0.83-1", - "@github/copilot-linuxmusl-arm64": "1.0.83-1", - "@github/copilot-linuxmusl-x64": "1.0.83-1", - "@github/copilot-win32-arm64": "1.0.83-1", - "@github/copilot-win32-x64": "1.0.83-1" + "@github/copilot-darwin-arm64": "1.0.83-2", + "@github/copilot-darwin-x64": "1.0.83-2", + "@github/copilot-linux-arm64": "1.0.83-2", + "@github/copilot-linux-x64": "1.0.83-2", + "@github/copilot-linuxmusl-arm64": "1.0.83-2", + "@github/copilot-linuxmusl-x64": "1.0.83-2", + "@github/copilot-win32-arm64": "1.0.83-2", + "@github/copilot-win32-x64": "1.0.83-2" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.83-1", - "integrity": "sha512-gxYJEd4yoIBIQHRmJw6ZegSkR6VuNm7AJVdAdARcU0SS68VZjtZFT29luThAp75Pxp37S5w+3A/jQNtxGyHizw==", + "version": "1.0.83-2", + "integrity": "sha512-RBjF/zTJe+gp9PsthYtIHF36+y3A3Zv3w/2FAa9nHF6ople1+lYoQ0OC1z6tWQSpBx3n/fSkNt0ebMmfhWlQyw==", "cpu": [ "arm64" ], @@ -510,8 +510,8 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.83-1", - "integrity": "sha512-PL63+Ib1RH+Bpu2UYJ9E8tmD4NZD/YlhD25F1Q9Rb86AdgLEoRYlxjNxXXF9P9dMmJ/u5zm0rUtWIRxv/FRbPg==", + "version": "1.0.83-2", + "integrity": "sha512-GzaarluCiHUA4yrYxWIFEklwPLTYjxGvLyYjI0wW5IPseT7GLFjN7AkDGRU4Ny/mxTj1MbUEsJAWVtiNy5EUHg==", "cpu": [ "x64" ], @@ -526,8 +526,8 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.83-1", - "integrity": "sha512-7c4RVEuXQu9zepAWoXwkizpESztUbWUR1hLPl+o+19L+D8fXm+5XQRH5E22Ia7P7/xHW3Ml2o2x5cXFq0k7/7w==", + "version": "1.0.83-2", + "integrity": "sha512-iGD5Pc7vnzrAjqTK/BrI8MDtMqXyxUe7P6u8TiGt+4DzKe3v2myT6eFQ+z/JJOHNpiu6LUpTDzwS8WttZqqJpA==", "cpu": [ "arm64" ], @@ -542,8 +542,8 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.83-1", - "integrity": "sha512-Be0zUVysLYV66pnOPhMxpShQ8Ox5V07qcsSOoNzG7iwpzkfZuf70U9CHk/fnI//mWwmZR+caPUfVM9BpwrdNnA==", + "version": "1.0.83-2", + "integrity": "sha512-jOQwz075vRWat+RJiMNtD+7vm4DQ83Dvw4iakpNkLfqWMPXlliVr/tqL+SffeSo87LnhOKobZOJOjELS27drdg==", "cpu": [ "x64" ], @@ -558,8 +558,8 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.83-1", - "integrity": "sha512-PZNP8vZZJU8yIc3dNjGUBUCFPNjqZs8FPZLDxvL6XdHM7Ep4cLBa+QdbRsw+nZONIaG0GtQf26eqk5ymYYpUPA==", + "version": "1.0.83-2", + "integrity": "sha512-6/+ByEBEV/vDofrCymaKrEZ5/p+TVHQfgWu8ywvWEPALfxj/iHpAF3grM2bj7uED4C19LTSarHNCkCqdrAUzIQ==", "cpu": [ "arm64" ], @@ -574,8 +574,8 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.83-1", - "integrity": "sha512-uKMhGtg5K07nA5/pxDSq8S5F/I+sMgVhUXg90Y4BI9trOidgxpXpCVyh4TeRNj2ENNugPvATdfGc6eFPsjmlgQ==", + "version": "1.0.83-2", + "integrity": "sha512-8dbiPUHaDemDibLfKXDe5xublJxt6fOht4yYDk/ikmOGAVezBUwRVO27PchXQBwGjP2PVNAASkv2WB4Ubw72lA==", "cpu": [ "x64" ], @@ -590,8 +590,8 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.83-1", - "integrity": "sha512-vMxHTmv3SotBuNI4LKcIFckd+n0OvhTik27qjsqOnVqFpvmHDghSsa8YPxySyxUQIE35z5pJaivVBK3dfEAY7w==", + "version": "1.0.83-2", + "integrity": "sha512-ZE1iUXlJSnNIH+VoRG96emy2e7jMJm85/pcKCrgLvqhDAcQSqiqLVv3OJp2VX2IcDxToOpiaGccU8Ab9zHQqkQ==", "cpu": [ "arm64" ], @@ -606,8 +606,8 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.83-1", - "integrity": "sha512-2l0VVTazW3/+p94ZQ5sAPCj1iH7KWxJAYh4yXWfvpsB/1JEEmyVgpLei1MeaMFVdtp/hi9bGprZ9+zWNlHh5hQ==", + "version": "1.0.83-2", + "integrity": "sha512-qfturLon+1oaWqSaXCISL6BEf5K+ijJFl0m/OZwstWYSlIlaE2+iOz5LcRukoxm25OG1JZDHQFp1k2PY2A+LbA==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index e293910938..91aaff849a 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.83-1", + "@github/copilot": "^1.0.83-2", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14",