From 10b1c2ea4146cdc829344af9cb35698f472d1a78 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Wed, 9 Sep 2026 15:15:02 +0000 Subject: [PATCH 1/7] feat: Add typed structured outputs for Node and .NET Generate all language RPC wrappers from the local runtime schema, expose per-run output schemas, and correlate schema-bearing waits using originatingMessageId. Include real-provider recording/replay E2Es through the locally built runtime for raw schemas, tools, steering, batches, and overlapping typed sends. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CONTRIBUTING.md | 55 + dotnet/README.md | 104 ++ dotnet/src/Generated/Rpc.cs | 978 ++++++++++++------ dotnet/src/Generated/SessionEvents.cs | 279 ++++- dotnet/src/Session.StructuredOutput.cs | 189 ++++ dotnet/src/Session.cs | 16 + dotnet/src/Types.cs | 10 + dotnet/test/E2E/StructuredOutputE2ETests.cs | 186 ++++ .../test/Unit/ClientSessionLifetimeTests.cs | 21 +- dotnet/test/Unit/StructuredOutputTests.cs | 479 +++++++++ go/rpc/zrpc.go | 358 ++++++- go/rpc/zrpc_encoding.go | 97 +- go/rpc/zsession_encoding.go | 107 ++ go/rpc/zsession_events.go | 123 ++- go/zsession_events.go | 21 + .../generated/AssistantMessageEvent.java | 2 + .../generated/AssistantUsageCopilotUsage.java | 2 + ...AssistantUsageCopilotUsageTokenDetail.java | 2 + .../github/copilot/generated/AutoTier.java | 6 +- ...pleteCompactionTokensUsedCopilotUsage.java | 2 + ...tionTokensUsedCopilotUsageTokenDetail.java | 2 + .../generated/CustomAgentsUpdatedAgent.java | 2 + .../generated/FactoryRunSettledStatus.java | 2 + .../generated/RecommendedAutoTier.java | 37 + .../SessionAutoTierRecommendationEvent.java | 41 + .../SessionCompactionCompleteEvent.java | 2 + .../copilot/generated/SessionEvent.java | 2 + .../generated/SubagentStartedEvent.java | 2 + .../generated/SubagentTaskModelSource.java | 39 + .../copilot/generated/rpc/AgentInfo.java | 2 + .../copilot/generated/rpc/AutoTier.java | 6 +- .../generated/rpc/CapiSessionOptions.java | 2 +- .../generated/rpc/FactoryAbortParams.java | 4 +- .../generated/rpc/FactoryAgentOptions.java | 6 +- .../rpc/FactoryPauseCheckpointAction.java | 35 + .../generated/rpc/FactoryRunResult.java | 4 +- .../generated/rpc/FactoryRunStatus.java | 2 + .../generated/rpc/FactoryRunSummary.java | 4 +- .../generated/rpc/FactoryRunTerminal.java | 4 +- .../rpc/JsonSchemaResponseFormat.java | 33 + .../generated/rpc/PluginsDisableParams.java | 6 +- .../generated/rpc/PluginsEnableParams.java | 6 +- .../generated/rpc/ServerPluginsApi.java | 4 +- .../generated/rpc/SessionFactoryApi.java | 32 + .../rpc/SessionFactoryCancelResult.java | 4 +- .../rpc/SessionFactoryGetRunDetailResult.java | 2 + .../rpc/SessionFactoryGetRunResult.java | 4 +- ...SessionFactoryPauseAtCheckpointParams.java | 36 + ...SessionFactoryPauseAtCheckpointResult.java | 30 + .../rpc/SessionFactoryPauseParams.java | 32 + .../rpc/SessionFactoryPauseResult.java | 46 + .../rpc/SessionFactoryRunFromToolResult.java | 4 +- .../rpc/SessionFactoryRunResult.java | 4 +- .../generated/rpc/SessionModelApi.java | 16 + .../SessionModelSetAllowedModelsParams.java | 33 + .../SessionModelSetAllowedModelsResult.java | 37 + .../generated/rpc/SessionSandboxApi.java | 18 + ...SessionSandboxDisableForSessionParams.java | 34 + ...SessionSandboxDisableForSessionResult.java | 32 + .../rpc/SessionSendMessagesParams.java | 12 + .../generated/rpc/SessionSendParams.java | 12 + nodejs/README.md | 57 + nodejs/src/client.ts | 25 +- nodejs/src/generated/rpc.ts | 279 ++++- nodejs/src/generated/session-events.ts | 145 ++- nodejs/src/index.ts | 1 + nodejs/src/schema.ts | 24 + nodejs/src/session.ts | 153 ++- nodejs/src/types.ts | 20 + nodejs/test/e2e/structured_output.e2e.test.ts | 211 ++++ nodejs/test/structured-output.test.ts | 241 +++++ python/copilot/generated/rpc.py | 929 +++++++++++++---- python/copilot/generated/session_events.py | 175 +++- rust/src/generated/api_types.rs | 385 ++++++- rust/src/generated/rpc.rs | 138 ++- rust/src/generated/session_events.rs | 124 ++- scripts/codegen/csharp.test.ts | 62 ++ scripts/codegen/csharp.ts | 9 +- ..._typed_sends_return_their_own_results.yaml | 24 + ...d_rpc_accepts_a_batch_response_format.yaml | 10 + ...e_raw_schema_and_unformatted_followup.yaml | 14 + ...sult_after_terminal_tool_and_steering.yaml | 22 + ..._typed_sends_return_their_own_results.yaml | 24 + ...infers_typed_result_after_custom_tool.yaml | 24 + ...explicit_schema_for_message_and_batch.yaml | 16 + 85 files changed, 6152 insertions(+), 632 deletions(-) create mode 100644 dotnet/src/Session.StructuredOutput.cs create mode 100644 dotnet/test/E2E/StructuredOutputE2ETests.cs create mode 100644 dotnet/test/Unit/StructuredOutputTests.cs create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java create mode 100644 nodejs/src/schema.ts create mode 100644 nodejs/test/e2e/structured_output.e2e.test.ts create mode 100644 nodejs/test/structured-output.test.ts create mode 100644 scripts/codegen/csharp.test.ts create mode 100644 test/snapshots/structured_output/node_concurrent_typed_sends_return_their_own_results.yaml create mode 100644 test/snapshots/structured_output/node_generated_rpc_accepts_a_batch_response_format.yaml create mode 100644 test/snapshots/structured_output/node_raw_schema_and_unformatted_followup.yaml create mode 100644 test/snapshots/structured_output/node_zod_typed_result_after_terminal_tool_and_steering.yaml create mode 100644 test/snapshots/structured_output_dotnet/concurrent_typed_sends_return_their_own_results.yaml create mode 100644 test/snapshots/structured_output_dotnet/infers_typed_result_after_custom_tool.yaml create mode 100644 test/snapshots/structured_output_dotnet/sends_explicit_schema_for_message_and_batch.yaml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5135e596dd..b63c7f5944 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,6 +44,61 @@ Setup, build, and test instructions are maintained with each SDK: - [Rust](rust/README.md#development) - [Java](java/README.md#development-setup) +### Testing an unreleased runtime API + +The runtime's Rust contracts under `src/native/sdk-contract` produce both +`generated/api.schema.json` (RPC methods) and +`generated/session-events.schema.json` (event payloads). In a local checkout of +`github/copilot-agent-runtime`, build the runtime and emit these schemas: + +```bash +pnpm run build +pnpm bazel build //src/native/schema-codegen:schema-codegen +bazel-bin/src/native/schema-codegen/schema-codegen emit \ + --api "$PWD/generated/api.schema.json" \ + --session-events "$PWD/generated/session-events.schema.json" +``` + +The SDK generators normally download schemas from the pinned CLI release. To +use the local schemas instead, pass the event-schema path followed by the +RPC-schema path. From this repository's `scripts/codegen` directory: + +```bash +npm ci +for language in typescript csharp python go rust; do + node --import tsx "$language.ts" \ + "$RUNTIME_ROOT/generated/session-events.schema.json" \ + "$RUNTIME_ROOT/generated/api.schema.json" +done +``` + +Set `RUNTIME_ROOT` to the absolute path of the runtime checkout. Java's generator +at `java/scripts/codegen/java.ts` reads these files from +`java/scripts/codegen/target/schemas` instead of accepting positional arguments; +stage the local schemas there before running it. Do not hand-edit generated +wrappers. Regenerating against a newer runtime +also includes any other contract changes since the SDK's pinned release. + +Set `COPILOT_CLI_PATH` to the built runtime's `dist-cli/index.js` to run SDK E2Es +against that checkout rather than the packaged runtime. For example: + +```bash +export COPILOT_CLI_PATH="$RUNTIME_ROOT/dist-cli/index.js" +# Supply GITHUB_TOKEN with Copilot access when recording new provider responses. +cd nodejs +npm test -- test/e2e/structured_output.e2e.test.ts +cd ../dotnet +dotnet test test/GitHub.Copilot.SDK.Test.csproj \ + --filter FullyQualifiedName~StructuredOutputE2ETests +``` + +The shared harness records real inference responses under `test/snapshots`. +Record new captures with `GITHUB_TOKEN` set and `GITHUB_ACTIONS` unset; +never author model responses by hand. Rerun with `GITHUB_ACTIONS=true` and real +provider credentials removed to require replay instead of forwarding cache +misses upstream. A draft targeting an unreleased runtime should document the +required runtime revision; update the pinned release only after it ships. + ## Submitting a Pull Request 1. Fork and clone the repository diff --git a/dotnet/README.md b/dotnet/README.md index c518a40326..30c8dbb278 100644 --- a/dotnet/README.md +++ b/dotnet/README.md @@ -251,6 +251,7 @@ Send a message to the session. - `Attachments` - File attachments - `Mode` - Delivery mode ("enqueue" or "immediate") - `Source` - Optional message origin: `MessageSource.User`, `MessageSource.System`, or `MessageSource.Agent(id)`. Omitted by default, preserving the runtime's default user behavior. +- `ResponseSchema` - Experimental provider-native JSON Schema (`JsonElement`) for this turn. Returns the message ID. @@ -277,6 +278,109 @@ await session.SendAndWaitAsync(new MessageOptions Agent sources serialize as `agent-`. Pass the agent ID without adding a prefix. The SDK preserves its case and whitespace and rejects null IDs. +##### Structured outputs (experimental) + +Use `SendAndWaitAsync` to infer a JSON Schema from a .NET type and +deserialize the final response. Schema inference uses +`Microsoft.Extensions.AI.AIJsonUtilities`, the same technology as custom tools. +In a reflection-enabled application, `await session.SendAndWaitAsync(prompt)` +needs no serialization configuration. The example below supplies source-generated +metadata so it also works when reflection serialization is disabled. + +```csharp +var result = await session.SendAndWaitAsync( + "How many red widgets are in stock?", + serializerOptions: InventoryJsonContext.Default.Options); +Console.WriteLine($"{result.Count} {result.Color} widgets"); + +public sealed class Inventory +{ + public required int Count { get; set; } + public required string Color { get; set; } +} + +[System.Text.Json.Serialization.JsonSourceGenerationOptions( + PropertyNamingPolicy = System.Text.Json.Serialization.JsonKnownNamingPolicy.CamelCase)] +[System.Text.Json.Serialization.JsonSerializable(typeof(Inventory))] +internal partial class InventoryJsonContext : System.Text.Json.Serialization.JsonSerializerContext; +``` + +The same serialization options govern schema inference and deserialization, +including naming policies, `[JsonPropertyName]`, converters, required members, +and nullable annotations. Options default to `AIJsonUtilities.DefaultOptions`, +as for custom tools. Supply a source-generated resolver (as above) for Native +AOT or when reflection serialization is disabled. The typed helper requests +strict output, marks all schema properties required, and disallows additional +properties; nullable properties can still contain JSON null. + +The helper waits for non-autopilot session idle after the requested user message +is consumed, selecting only root assistant messages with that originating message +ID. This can wait for other queued work to drain, but other messages and subagent +responses cannot replace the result. Session errors or an aborted idle after the +requested run starts conservatively fail the wait, even if later queued work +caused them. It throws `InvalidOperationException` when there is no final response, +and `JsonException` for invalid JSON, an incompatible +value, or a null result. Deserialization is not full JSON Schema validation: +validate application-specific constraints yourself. Timeout defaults to 60 +seconds; timeout and cancellation stop waiting without aborting runtime work. +The original `MessageOptions` is not modified, and an explicit `ResponseSchema` +cannot be combined with this typed overload. + +For an explicit schema, set `MessageOptions.ResponseSchema`. Schemas are opaque +`JsonElement` values, just like custom-tool schemas. The SDK forwards this schema +unchanged with the name `response` and `strict: true`. The untyped +`SendAndWaitAsync` still returns an assistant message event; it does not validate +or deserialize the response. Schema-bearing waits use the same message +correlation as typed waits; unformatted waits retain their existing behavior. + +```csharp +using var schema = System.Text.Json.JsonDocument.Parse(""" + {"type":"object","properties":{"count":{"type":"integer"}},"required":["count"],"additionalProperties":false} + """); +var message = await session.SendAndWaitAsync(new MessageOptions +{ + Prompt = "Count the widgets.", + ResponseSchema = schema.RootElement.Clone(), +}); +``` + +Use the generated `session.Rpc` APIs for advanced response-format options: + +```csharp +using GitHub.Copilot.Rpc; +using System.Text.Json; + +using var schema = JsonDocument.Parse(""" + {"type":"object","properties":{"count":{"type":"integer"}},"required":["count"],"additionalProperties":false} + """); +var format = new ResponseFormat +{ + Type = "json_schema", + JsonSchema = new JsonSchemaResponseFormat + { + Name = "inventory", + Schema = schema.RootElement.Clone(), + Strict = true, + Description = "The inventory count", + }, +}; +await session.Rpc.SendAsync("Count the widgets.", responseFormat: format); +// A batch shares one output contract: +await session.Rpc.SendMessagesAsync( + [new() { Prompt = "There are 42 widgets." }, new() { Prompt = "Report the count." }], + responseFormat: format); +``` + +Raw schemas and outputs are passed through without validation or rewriting. +Provider support and schema restrictions apply. The format persists through +tool continuations in that turn, not subsequent turns. An ordinary +`Mode = "immediate"` steering message inherits the active format; specifying +a new format on an immediate message is rejected. +Use a provider route that enforces JSON Schema: an API-compatible gateway can +ignore unsupported format fields, and the Claude Chat-completions compatibility +route is not equivalent to Anthropic's native Messages endpoint. This preview +requires the unreleased runtime changes; see [local-runtime development](../CONTRIBUTING.md#testing-an-unreleased-runtime-api). + ##### `On(Action handler): IDisposable` Subscribe to session events. Returns a disposable to unsubscribe. diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index 2c74ab4bde..f1bfe5336b 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -3021,22 +3021,30 @@ public sealed class PluginUpdateAllResult public IList Results { get => field ??= []; set; } } -/// Plugin names (or specs) to enable. +/// Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsEnableRequest { /// Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. [JsonPropertyName("names")] public IList Names { get => field ??= []; set; } + + /// Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. + [JsonPropertyName("workingDirectory")] + public string? WorkingDirectory { get; set; } } -/// Plugin names (or specs) to disable. +/// Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsDisableRequest { /// Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. [JsonPropertyName("names")] public IList Names { get => field ??= []; set; } + + /// Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. + [JsonPropertyName("workingDirectory")] + public string? WorkingDirectory { get; set; } } /// Trusted built-in plugin directories to use for this runtime process. @@ -3332,6 +3340,10 @@ public sealed class AgentInfo [JsonPropertyName("description")] public string Description { get; set; } = string.Empty; + /// Whether model-driven invocation is disabled for this agent. + [JsonPropertyName("disableModelInvocation")] + public bool? DisableModelInvocation { get; set; } + /// Human-readable display name. [JsonPropertyName("displayName")] public string DisplayName { get; set; } = string.Empty; @@ -5256,6 +5268,40 @@ public sealed class SendResult public string MessageId { get; set; } = string.Empty; } +/// A JSON Schema output contract. OpenAI receives the name, description, schema and strict setting; Anthropic receives the schema in output_config.format and always uses its native strict enforcement. +[Experimental(Diagnostics.Experimental)] +public sealed class JsonSchemaResponseFormat +{ + /// Optional description passed to OpenAI providers. + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// Name of the output schema, subject to the provider's naming restrictions. + [JsonPropertyName("name")] + public string Name { get; set; } = string.Empty; + + /// JSON Schema passed unchanged to the inference provider. Supported keywords and schema restrictions are determined by that provider. + [JsonPropertyName("schema")] + public JsonElement Schema { get; set; } + + /// Optional strict enforcement setting for OpenAI providers. Omitted uses the provider default. Anthropic always enforces its supported schema subset. + [JsonPropertyName("strict")] + public bool? Strict { get; set; } +} + +/// Provider-native structured output format. JSON Schema is forwarded without rewriting or validating the schema or the generated output. +[Experimental(Diagnostics.Experimental)] +public sealed class ResponseFormat +{ + /// JSON Schema and provider options for the turn's output. + [JsonPropertyName("jsonSchema")] + public JsonSchemaResponseFormat JsonSchema { get => field ??= new(); set; } + + /// Output format discriminator. Currently only json_schema is supported. + [JsonPropertyName("type")] + public string Type { get; set; } = string.Empty; +} + /// Parameters for sending a user message to the session. [Experimental(Diagnostics.Experimental)] internal sealed class SendRequest @@ -5296,6 +5342,10 @@ internal sealed class SendRequest [JsonPropertyName("requiredTool")] public string? RequiredTool { get; set; } + /// Provider-native output format for this turn, including all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. + [JsonPropertyName("responseFormat")] + public ResponseFormat? ResponseFormat { get; set; } + /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; @@ -5384,6 +5434,10 @@ internal sealed class SendMessagesRequest [JsonPropertyName("requestHeaders")] public IDictionary? RequestHeaders { get; set; } + /// Provider-native output format for the whole turn, including an empty message batch and all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. + [JsonPropertyName("responseFormat")] + public ResponseFormat? ResponseFormat { get; set; } + /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; @@ -5566,6 +5620,57 @@ internal sealed class SessionSandboxGetEnforcementStatusRequest public string SessionId { get; set; } = string.Empty; } +/// Result of attempting to disable sandboxing for the current session. +[Experimental(Diagnostics.Experimental)] +public sealed class SandboxDisableForSessionResult +{ + /// The authoritative sandbox enabled state after the operation. + [JsonPropertyName("enabled")] + public bool Enabled { get; set; } + + /// Whether this call resolved the pending request and applied the session opt-out. + [JsonPropertyName("success")] + public bool Success { get; set; } +} + +/// Optional informational context describing how and where the permission decision was made. This does not affect permission behavior. +[Experimental(Diagnostics.Experimental)] +public sealed class PermissionDecisionContext +{ + /// Disposition of the permission request as observed by the responding client. + [JsonPropertyName("outcome")] + public PermissionDecisionOutcome Outcome { get; set; } + + /// Whether the responding client could ask a user interactively, was running headlessly, or had no response path. Omit when the client cannot determine this authoritatively. + [JsonPropertyName("responseCapability")] + public PermissionResponseCapability? ResponseCapability { get; set; } + + /// Controlled reason or actor responsible for the response. + [JsonPropertyName("source")] + public PermissionDecisionSource Source { get; set; } + + /// Client surface that submitted the response. + [JsonPropertyName("surface")] + public PermissionDecisionSurface Surface { get; set; } +} + +/// Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. +[Experimental(Diagnostics.Experimental)] +internal sealed class SandboxDisableForSessionRequest +{ + /// Optional attribution for the permission decision. + [JsonPropertyName("decisionContext")] + public PermissionDecisionContext? DecisionContext { get; set; } + + /// Identifier of the exact pending sandbox-bypass permission request that authorized the session opt-out. + [JsonPropertyName("requestId")] + public string RequestId { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Authentication status and account metadata for the session. [Experimental(Diagnostics.Experimental)] public sealed class SessionAuthStatus @@ -6416,6 +6521,11 @@ public partial class FactoryRunFailureFactoryLimitReached : FactoryRunFailure [JsonPropertyName("runId")] public required string RunId { get; set; } + /// Suggested larger ceiling when the runtime can derive one safely. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("suggestedValue")] + public double? SuggestedValue { get; set; } + /// Approved effective ceiling that was reached. [JsonPropertyName("value")] public required double Value { get; set; } @@ -6491,6 +6601,44 @@ public partial class FactoryRunFailureFactoryProviderDisconnected : FactoryRunFa public required string RunId { get; set; } } +/// Durable metadata describing who initiated a factory pause. +/// Polymorphic base type discriminated by type. +[Experimental(Diagnostics.Experimental)] +[JsonPolymorphic( + TypeDiscriminatorPropertyName = "type", + UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] +[JsonDerivedType(typeof(FactoryPauseInfoUser), "user")] +[JsonDerivedType(typeof(FactoryPauseInfoCheckpoint), "checkpoint")] +public partial class FactoryPauseInfo +{ + /// The type discriminator. + [JsonPropertyName("type")] + public virtual string Type { get; set; } = string.Empty; +} + + +/// The user variant of . +[Experimental(Diagnostics.Experimental)] +public partial class FactoryPauseInfoUser : FactoryPauseInfo +{ + /// + [JsonIgnore] + public override string Type => "user"; +} + +/// The checkpoint variant of . +[Experimental(Diagnostics.Experimental)] +public partial class FactoryPauseInfoCheckpoint : FactoryPauseInfo +{ + /// + [JsonIgnore] + public override string Type => "checkpoint"; + + /// Stable author-defined checkpoint key that initiated the pause. + [JsonPropertyName("key")] + public required string Key { get; set; } +} + /// Complete current or terminal factory run envelope. [Experimental(Diagnostics.Experimental)] public sealed class FactoryRunResult @@ -6507,6 +6655,10 @@ public sealed class FactoryRunResult [JsonPropertyName("failure")] public FactoryRunFailure? Failure { get; set; } + /// Structured pause initiator metadata for a paused attempt. + [JsonPropertyName("pauseInfo")] + public FactoryPauseInfo? PauseInfo { get; set; } + /// Reason for a halted or cancelled run. [JsonPropertyName("reason")] public string? Reason { get; set; } @@ -6764,6 +6916,10 @@ public sealed class FactoryRunTerminal [JsonPropertyName("failure")] public FactoryRunFailure? Failure { get; set; } + /// Pause initiator metadata, or null when the run did not pause. + [JsonPropertyName("pauseInfo")] + public FactoryPauseInfo? PauseInfo { get; set; } + /// Human-readable terminal reason. [JsonPropertyName("reason")] public string? Reason { get; set; } @@ -6785,6 +6941,10 @@ public sealed class FactoryRunSummary [JsonPropertyName("approved")] public FactoryDeclaredLimits? Approved { get; set; } + /// Whether the durable run state currently passes runtime resume eligibility checks. + [JsonPropertyName("canResume")] + public bool CanResume { get; set; } + /// Epoch milliseconds when the run completed, or null while nonterminal. [JsonPropertyName("completedAt")] public long? CompletedAt { get; set; } @@ -7092,6 +7252,10 @@ public sealed class FactoryRunDetail [JsonPropertyName("approved")] public FactoryDeclaredLimits? Approved { get; set; } + /// Whether the durable run state currently passes runtime resume eligibility checks. + [JsonPropertyName("canResume")] + public bool CanResume { get; set; } + /// Epoch milliseconds when the run completed, or null while nonterminal. [JsonPropertyName("completedAt")] public long? CompletedAt { get; set; } @@ -7211,6 +7375,49 @@ internal sealed class FactoryCancelRequest public string SessionId { get; set; } = string.Empty; } +/// Parameters for pausing a running factory. +[Experimental(Diagnostics.Experimental)] +internal sealed class FactoryPauseRequest +{ + /// Factory run identifier. + [JsonPropertyName("runId")] + public string RunId { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// RPC data type for SessionFactoryPauseAtCheckpoint operations. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionFactoryPauseAtCheckpointResult +{ + /// Whether this execution attempt must pause or may continue. + [JsonPropertyName("action")] + public FactoryPauseCheckpointAction Action { get; set; } +} + +/// Parameters for an owned durable pause checkpoint. +[Experimental(Diagnostics.Experimental)] +internal sealed class FactoryPauseCheckpointRequest +{ + /// Opaque token identifying the execution attempt that reached the checkpoint. + [JsonPropertyName("executionToken")] + public string ExecutionToken { get; set; } = string.Empty; + + /// Stable author-defined checkpoint key. + [JsonPropertyName("key")] + public string Key { get; set; } = string.Empty; + + /// Factory run identifier. + [JsonPropertyName("runId")] + public string RunId { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Acknowledgement that a factory request was accepted. [Experimental(Diagnostics.Experimental)] public sealed class FactoryAckResult @@ -7268,11 +7475,11 @@ public sealed class FactoryAgentResult [Experimental(Diagnostics.Experimental)] public sealed class FactoryAgentOptions { - /// Optional custom agent name for the subagent. This field is accepted but not yet honored. + /// Optional built-in or custom agent name whose definition configures the subagent. [JsonPropertyName("agent")] public string? Agent { get; set; } - /// Optional context tier for the subagent. This field is accepted but not yet honored. + /// Optional context tier override for the subagent. [JsonPropertyName("contextTier")] public ContextTier? ContextTier { get; set; } @@ -7284,7 +7491,7 @@ public sealed class FactoryAgentOptions [JsonPropertyName("model")] public string? Model { get; set; } - /// Optional reasoning effort for the subagent. This field is accepted but not yet honored. + /// Optional reasoning effort override for the subagent. [JsonPropertyName("reasoningEffort")] public string? ReasoningEffort { get; set; } @@ -7732,6 +7939,40 @@ internal sealed class ModelApplyStartupOverlayRequest public string SessionId { get; set; } = string.Empty; } +/// The applied host allowlist and effective session model policy after intersection. +[Experimental(Diagnostics.Experimental)] +public sealed class ModelSetAllowedModelsResult +{ + /// Normalized host allowlist. Omitted when the host restriction was cleared, or when a relay client does not return the host policy. + [JsonPropertyName("allowedModels")] + public IList? AllowedModels { get; set; } + + /// Effective exact IDs or repository policy patterns after applying the host restriction. Omitted by relay clients that do not return the host policy. + [JsonPropertyName("effectiveAllowedModels")] + public IList? EffectiveAllowedModels { get; set; } + + /// Effective deterministic fallback model, when the policy defines one. + [JsonPropertyName("fallbackModel")] + public string? FallbackModel { get; set; } + + /// Selected session model after reconciling a now-disallowed concrete selection. + [JsonPropertyName("modelId")] + public string? ModelId { get; set; } +} + +/// Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. +[Experimental(Diagnostics.Experimental)] +internal sealed class ModelSetAllowedModelsRequest +{ + /// Exact model IDs to permit, or null to clear the host restriction. + [JsonPropertyName("allowedModels")] + public IList? AllowedModels { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns. [Experimental(Diagnostics.Experimental)] public sealed class ModelSetReasoningEffortResult @@ -11750,7 +11991,7 @@ public sealed class OptionsUpdateAdditionalContentExclusionPolicy [Experimental(Diagnostics.Experimental)] public sealed class CapiSessionOptions { - /// Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. + /// Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. `fast` is an integrator-only latency preset, not a first-party GitHub Copilot product preference. [JsonPropertyName("autoTier")] public AutoTier? AutoTier { get; set; } @@ -14806,27 +15047,6 @@ public sealed class PermissionRequestResult public bool Success { get; set; } } -/// Optional informational context describing how and where the permission decision was made. This does not affect permission behavior. -[Experimental(Diagnostics.Experimental)] -public sealed class PermissionDecisionContext -{ - /// Disposition of the permission request as observed by the responding client. - [JsonPropertyName("outcome")] - public PermissionDecisionOutcome Outcome { get; set; } - - /// Whether the responding client could ask a user interactively, was running headlessly, or had no response path. Omit when the client cannot determine this authoritatively. - [JsonPropertyName("responseCapability")] - public PermissionResponseCapability? ResponseCapability { get; set; } - - /// Controlled reason or actor responsible for the response. - [JsonPropertyName("source")] - public PermissionDecisionSource Source { get; set; } - - /// Client surface that submitted the response. - [JsonPropertyName("surface")] - public PermissionDecisionSurface Surface { get; set; } -} - /// The client's response to the pending permission prompt. /// Polymorphic base type discriminated by kind. [Experimental(Diagnostics.Experimental)] @@ -18742,6 +18962,10 @@ public sealed class FactoryExecuteRequest [Experimental(Diagnostics.Experimental)] public sealed class FactoryAbortRequest { + /// Opaque token identifying the execution attempt to abort. + [JsonPropertyName("executionToken")] + public string ExecutionToken { get; set; } = string.Empty; + /// Factory run identifier. [JsonPropertyName("runId")] public string RunId { get; set; } = string.Empty; @@ -24303,6 +24527,279 @@ public override void Write(Utf8JsonWriter writer, SessionLogLevel value, JsonSer } +/// Disposition of a permission request as observed by the responding client. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct PermissionDecisionOutcome : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public PermissionDecisionOutcome(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The request was approved automatically without a new human decision. + public static PermissionDecisionOutcome AutoApproved { get; } = new("auto_approved"); + + /// The request was denied without an interactive user decision; source records why. + public static PermissionDecisionOutcome AutopilotDenied { get; } = new("autopilot_denied"); + + /// The response came from an interactive user prompt. + public static PermissionDecisionOutcome PromptedUser { get; } = new("prompted_user"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(PermissionDecisionOutcome left, PermissionDecisionOutcome right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(PermissionDecisionOutcome left, PermissionDecisionOutcome right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is PermissionDecisionOutcome other && Equals(other); + + /// + public bool Equals(PermissionDecisionOutcome 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 PermissionDecisionOutcome Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, PermissionDecisionOutcome value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionDecisionOutcome)); + } + } +} + + +/// Response capability available to the client when it settled a permission request. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct PermissionResponseCapability : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public PermissionResponseCapability(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The client could ask a user for this decision. + public static PermissionResponseCapability Interactive { get; } = new("interactive"); + + /// The client could return an automated response but could not ask a user. + public static PermissionResponseCapability Headless { get; } = new("headless"); + + /// The client had no response path available. + public static PermissionResponseCapability None { get; } = new("none"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(PermissionResponseCapability left, PermissionResponseCapability right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(PermissionResponseCapability left, PermissionResponseCapability right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is PermissionResponseCapability other && Equals(other); + + /// + public bool Equals(PermissionResponseCapability 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 PermissionResponseCapability Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, PermissionResponseCapability value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionResponseCapability)); + } + } +} + + +/// Controlled reason or actor responsible for a permission response. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct PermissionDecisionSource : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public PermissionDecisionSource(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The response followed the assisted-approval judge recommendation. + public static PermissionDecisionSource AssistedApproval { get; } = new("assisted_approval"); + + /// A human supplied the response through an interactive prompt. + public static PermissionDecisionSource HumanResponse { get; } = new("human_response"); + + /// The host applied a standing policy or override rather than a judge recommendation or human decision. + public static PermissionDecisionSource HostPolicy { get; } = new("host_policy"); + + /// The host denied the request because no interactive user response was available. + public static PermissionDecisionSource UnattendedFallback { get; } = new("unattended_fallback"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(PermissionDecisionSource left, PermissionDecisionSource right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(PermissionDecisionSource left, PermissionDecisionSource right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is PermissionDecisionSource other && Equals(other); + + /// + public bool Equals(PermissionDecisionSource 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 PermissionDecisionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, PermissionDecisionSource value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionDecisionSource)); + } + } +} + + +/// Client surface that submitted a permission response. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct PermissionDecisionSurface : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public PermissionDecisionSurface(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The interactive Copilot CLI terminal UI. + public static PermissionDecisionSurface Tui { get; } = new("tui"); + + /// The non-interactive Copilot CLI prompt mode. + public static PermissionDecisionSurface PromptMode { get; } = new("prompt_mode"); + + /// The Copilot App client. + public static PermissionDecisionSurface CopilotApp { get; } = new("copilot_app"); + + /// An Agent Client Protocol host. + public static PermissionDecisionSurface Acp { get; } = new("acp"); + + /// A generic Copilot SDK client. + public static PermissionDecisionSurface Sdk { get; } = new("sdk"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(PermissionDecisionSurface left, PermissionDecisionSurface right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(PermissionDecisionSurface left, PermissionDecisionSurface right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is PermissionDecisionSurface other && Equals(other); + + /// + public bool Equals(PermissionDecisionSurface 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 PermissionDecisionSurface Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, PermissionDecisionSurface value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionDecisionSurface)); + } + } +} + + /// Authentication type. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -24830,6 +25327,9 @@ public FactoryRunStatus(string value) /// The run was interrupted while resource budget remained. public static FactoryRunStatus Halted { get; } = new("halted"); + /// The current attempt stopped intentionally and the run may be resumed. + public static FactoryRunStatus Paused { get; } = new("paused"); + /// The run was cancelled before completion. public static FactoryRunStatus Cancelled { get; } = new("cancelled"); @@ -25005,6 +25505,69 @@ public override void Write(Utf8JsonWriter writer, FactoryLogLineKind value, Json } +/// Action the runtime selected for a durable factory pause checkpoint. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FactoryPauseCheckpointAction : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FactoryPauseCheckpointAction(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The checkpoint was committed by a prior paused attempt, so execution may continue. + public static FactoryPauseCheckpointAction Continue { get; } = new("continue"); + + /// This attempt claimed the checkpoint and must cooperatively stop. + public static FactoryPauseCheckpointAction Pause { get; } = new("pause"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FactoryPauseCheckpointAction left, FactoryPauseCheckpointAction right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FactoryPauseCheckpointAction left, FactoryPauseCheckpointAction right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FactoryPauseCheckpointAction other && Equals(other); + + /// + public bool Equals(FactoryPauseCheckpointAction 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 FactoryPauseCheckpointAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FactoryPauseCheckpointAction value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FactoryPauseCheckpointAction)); + } + } +} + + /// Whether the requested preference was already effective or was accepted for later transactional activation. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -28986,279 +29549,6 @@ public override void Write(Utf8JsonWriter writer, PermissionsConfigureAdditional } -/// Disposition of a permission request as observed by the responding client. -[Experimental(Diagnostics.Experimental)] -[JsonConverter(typeof(Converter))] -[DebuggerDisplay("{Value,nq}")] -public readonly struct PermissionDecisionOutcome : IEquatable -{ - private readonly string? _value; - - /// Initializes a new instance of the struct. - /// The value to associate with this . - [JsonConstructor] - public PermissionDecisionOutcome(string value) - { - ArgumentException.ThrowIfNullOrWhiteSpace(value); - _value = value; - } - - /// Gets the value associated with this . - public string Value => _value ?? string.Empty; - - /// The request was approved automatically without a new human decision. - public static PermissionDecisionOutcome AutoApproved { get; } = new("auto_approved"); - - /// The request was denied without an interactive user decision; source records why. - public static PermissionDecisionOutcome AutopilotDenied { get; } = new("autopilot_denied"); - - /// The response came from an interactive user prompt. - public static PermissionDecisionOutcome PromptedUser { get; } = new("prompted_user"); - - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(PermissionDecisionOutcome left, PermissionDecisionOutcome right) => left.Equals(right); - - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(PermissionDecisionOutcome left, PermissionDecisionOutcome right) => !(left == right); - - /// - public override bool Equals(object? obj) => obj is PermissionDecisionOutcome other && Equals(other); - - /// - public bool Equals(PermissionDecisionOutcome 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 PermissionDecisionOutcome Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); - } - - /// - public override void Write(Utf8JsonWriter writer, PermissionDecisionOutcome value, JsonSerializerOptions options) - { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionDecisionOutcome)); - } - } -} - - -/// Response capability available to the client when it settled a permission request. -[Experimental(Diagnostics.Experimental)] -[JsonConverter(typeof(Converter))] -[DebuggerDisplay("{Value,nq}")] -public readonly struct PermissionResponseCapability : IEquatable -{ - private readonly string? _value; - - /// Initializes a new instance of the struct. - /// The value to associate with this . - [JsonConstructor] - public PermissionResponseCapability(string value) - { - ArgumentException.ThrowIfNullOrWhiteSpace(value); - _value = value; - } - - /// Gets the value associated with this . - public string Value => _value ?? string.Empty; - - /// The client could ask a user for this decision. - public static PermissionResponseCapability Interactive { get; } = new("interactive"); - - /// The client could return an automated response but could not ask a user. - public static PermissionResponseCapability Headless { get; } = new("headless"); - - /// The client had no response path available. - public static PermissionResponseCapability None { get; } = new("none"); - - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(PermissionResponseCapability left, PermissionResponseCapability right) => left.Equals(right); - - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(PermissionResponseCapability left, PermissionResponseCapability right) => !(left == right); - - /// - public override bool Equals(object? obj) => obj is PermissionResponseCapability other && Equals(other); - - /// - public bool Equals(PermissionResponseCapability 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 PermissionResponseCapability Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); - } - - /// - public override void Write(Utf8JsonWriter writer, PermissionResponseCapability value, JsonSerializerOptions options) - { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionResponseCapability)); - } - } -} - - -/// Controlled reason or actor responsible for a permission response. -[Experimental(Diagnostics.Experimental)] -[JsonConverter(typeof(Converter))] -[DebuggerDisplay("{Value,nq}")] -public readonly struct PermissionDecisionSource : IEquatable -{ - private readonly string? _value; - - /// Initializes a new instance of the struct. - /// The value to associate with this . - [JsonConstructor] - public PermissionDecisionSource(string value) - { - ArgumentException.ThrowIfNullOrWhiteSpace(value); - _value = value; - } - - /// Gets the value associated with this . - public string Value => _value ?? string.Empty; - - /// The response followed the assisted-approval judge recommendation. - public static PermissionDecisionSource AssistedApproval { get; } = new("assisted_approval"); - - /// A human supplied the response through an interactive prompt. - public static PermissionDecisionSource HumanResponse { get; } = new("human_response"); - - /// The host applied a standing policy or override rather than a judge recommendation or human decision. - public static PermissionDecisionSource HostPolicy { get; } = new("host_policy"); - - /// The host denied the request because no interactive user response was available. - public static PermissionDecisionSource UnattendedFallback { get; } = new("unattended_fallback"); - - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(PermissionDecisionSource left, PermissionDecisionSource right) => left.Equals(right); - - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(PermissionDecisionSource left, PermissionDecisionSource right) => !(left == right); - - /// - public override bool Equals(object? obj) => obj is PermissionDecisionSource other && Equals(other); - - /// - public bool Equals(PermissionDecisionSource 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 PermissionDecisionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); - } - - /// - public override void Write(Utf8JsonWriter writer, PermissionDecisionSource value, JsonSerializerOptions options) - { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionDecisionSource)); - } - } -} - - -/// Client surface that submitted a permission response. -[Experimental(Diagnostics.Experimental)] -[JsonConverter(typeof(Converter))] -[DebuggerDisplay("{Value,nq}")] -public readonly struct PermissionDecisionSurface : IEquatable -{ - private readonly string? _value; - - /// Initializes a new instance of the struct. - /// The value to associate with this . - [JsonConstructor] - public PermissionDecisionSurface(string value) - { - ArgumentException.ThrowIfNullOrWhiteSpace(value); - _value = value; - } - - /// Gets the value associated with this . - public string Value => _value ?? string.Empty; - - /// The interactive Copilot CLI terminal UI. - public static PermissionDecisionSurface Tui { get; } = new("tui"); - - /// The non-interactive Copilot CLI prompt mode. - public static PermissionDecisionSurface PromptMode { get; } = new("prompt_mode"); - - /// The Copilot App client. - public static PermissionDecisionSurface CopilotApp { get; } = new("copilot_app"); - - /// An Agent Client Protocol host. - public static PermissionDecisionSurface Acp { get; } = new("acp"); - - /// A generic Copilot SDK client. - public static PermissionDecisionSurface Sdk { get; } = new("sdk"); - - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(PermissionDecisionSurface left, PermissionDecisionSurface right) => left.Equals(right); - - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(PermissionDecisionSurface left, PermissionDecisionSurface right) => !(left == right); - - /// - public override bool Equals(object? obj) => obj is PermissionDecisionSurface other && Equals(other); - - /// - public bool Equals(PermissionDecisionSurface 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 PermissionDecisionSurface Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); - } - - /// - public override void Write(Utf8JsonWriter writer, PermissionDecisionSurface value, JsonSerializerOptions options) - { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionDecisionSurface)); - } - } -} - - /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -31860,23 +32150,25 @@ public async Task UpdateAllAsync(CancellationToken cancel /// Enables installed plugins for new sessions. /// Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. + /// Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. /// The to monitor for cancellation requests. The default is . - public async Task EnableAsync(IList names, CancellationToken cancellationToken = default) + public async Task EnableAsync(IList names, string? workingDirectory = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(names); - var request = new PluginsEnableRequest { Names = names }; + var request = new PluginsEnableRequest { Names = names, WorkingDirectory = workingDirectory }; await CopilotClient.InvokeRpcAsync(_rpc, "plugins.enable", [request], cancellationToken); } /// Disables installed plugins for new sessions. /// Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. + /// Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. /// The to monitor for cancellation requests. The default is . - public async Task DisableAsync(IList names, CancellationToken cancellationToken = default) + public async Task DisableAsync(IList names, string? workingDirectory = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(names); - var request = new PluginsDisableRequest { Names = names }; + var request = new PluginsDisableRequest { Names = names, WorkingDirectory = workingDirectory }; await CopilotClient.InvokeRpcAsync(_rpc, "plugins.disable", [request], cancellationToken); } @@ -33024,18 +33316,19 @@ public async Task SuspendAsync(CancellationToken cancellationToken = default) /// Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-<command-id>` for command-originated messages, `schedule-<numeric-id>` for scheduled prompts, or `agent-<agent-id>` for prompts sent by another agent. /// The UI mode the agent was in when this message was sent. Defaults to the session's current mode. /// Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. + /// Provider-native output format for this turn, including all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. /// W3C Trace Context traceparent header for distributed tracing of this agent turn. /// W3C Trace Context tracestate header for distributed tracing. /// If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. /// The to monitor for cancellation requests. The default is . /// Result of sending a user message. [Experimental(Diagnostics.Experimental)] - public async Task SendAsync(string prompt, string? displayPrompt = null, IList? attachments = null, SendMode? mode = null, bool? prepend = null, bool? billable = null, string? requiredTool = null, string? source = null, SendAgentMode? agentMode = null, IDictionary? requestHeaders = null, string? traceparent = null, string? tracestate = null, bool? wait = null, CancellationToken cancellationToken = default) + public async Task SendAsync(string prompt, string? displayPrompt = null, IList? attachments = null, SendMode? mode = null, bool? prepend = null, bool? billable = null, string? requiredTool = null, string? source = null, SendAgentMode? agentMode = null, IDictionary? requestHeaders = null, ResponseFormat? responseFormat = null, string? traceparent = null, string? tracestate = null, bool? wait = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(prompt); _session.ThrowIfDisposed(); - var request = new SendRequest { SessionId = _session.SessionId, Prompt = prompt, DisplayPrompt = displayPrompt, Attachments = attachments, Mode = mode, Prepend = prepend, Billable = billable, RequiredTool = requiredTool, Source = source, AgentMode = agentMode, RequestHeaders = requestHeaders, Traceparent = traceparent, Tracestate = tracestate, Wait = wait }; + var request = new SendRequest { SessionId = _session.SessionId, Prompt = prompt, DisplayPrompt = displayPrompt, Attachments = attachments, Mode = mode, Prepend = prepend, Billable = billable, RequiredTool = requiredTool, Source = source, AgentMode = agentMode, RequestHeaders = requestHeaders, ResponseFormat = responseFormat, Traceparent = traceparent, Tracestate = tracestate, Wait = wait }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.send", [request], cancellationToken); } @@ -33045,18 +33338,19 @@ public async Task SendAsync(string prompt, string? displayPrompt = n /// If true, adds the messages to the front of the queue instead of the end. /// The UI mode the agent was in when these messages were sent. Defaults to the session's current mode. /// Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. + /// Provider-native output format for the whole turn, including an empty message batch and all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. /// W3C Trace Context traceparent header for distributed tracing of this agent turn. /// W3C Trace Context tracestate header for distributed tracing. /// If true, await completion of the agentic loop for this turn before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageIds`; the caller can rely on the agent having processed the messages before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. /// The to monitor for cancellation requests. The default is . /// Result of sending zero or more user messages. [Experimental(Diagnostics.Experimental)] - public async Task SendMessagesAsync(IList messages, SendMode? mode = null, bool? prepend = null, SendAgentMode? agentMode = null, IDictionary? requestHeaders = null, string? traceparent = null, string? tracestate = null, bool? wait = null, CancellationToken cancellationToken = default) + public async Task SendMessagesAsync(IList messages, SendMode? mode = null, bool? prepend = null, SendAgentMode? agentMode = null, IDictionary? requestHeaders = null, ResponseFormat? responseFormat = null, string? traceparent = null, string? tracestate = null, bool? wait = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(messages); _session.ThrowIfDisposed(); - var request = new SendMessagesRequest { SessionId = _session.SessionId, Messages = messages, Mode = mode, Prepend = prepend, AgentMode = agentMode, RequestHeaders = requestHeaders, Traceparent = traceparent, Tracestate = tracestate, Wait = wait }; + var request = new SendMessagesRequest { SessionId = _session.SessionId, Messages = messages, Mode = mode, Prepend = prepend, AgentMode = agentMode, RequestHeaders = requestHeaders, ResponseFormat = responseFormat, Traceparent = traceparent, Tracestate = tracestate, Wait = wait }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.sendMessages", [request], cancellationToken); } @@ -33167,6 +33461,20 @@ public async Task GetEnforcementStatusAsync(Cancellati var request = new SessionSandboxGetEnforcementStatusRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.sandbox.getEnforcementStatus", [request], cancellationToken); } + + /// Disables sandboxing for the remainder of the current session and approves the referenced pending sandbox-bypass permission request. The request is rejected unless the exact request is still pending and the effective sandbox policy permits bypass. + /// Identifier of the exact pending sandbox-bypass permission request that authorized the session opt-out. + /// Optional attribution for the permission decision. + /// The to monitor for cancellation requests. The default is . + /// Result of attempting to disable sandboxing for the current session. + public async Task DisableForSessionAsync(string requestId, PermissionDecisionContext? decisionContext = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(requestId); + _session.ThrowIfDisposed(); + + var request = new SandboxDisableForSessionRequest { SessionId = _session.SessionId, RequestId = requestId, DecisionContext = decisionContext }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.sandbox.disableForSession", [request], cancellationToken); + } } /// Provides session-scoped GitHubAuth APIs. @@ -33618,6 +33926,35 @@ public async Task CancelAsync(string runId, CancellationToken return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.cancel", [request], cancellationToken); } + /// Pauses a running factory and returns its settled run envelope. + /// Factory run identifier. + /// The to monitor for cancellation requests. The default is . + /// Complete current or terminal factory run envelope. + public async Task PauseAsync(string runId, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(runId); + _session.ThrowIfDisposed(); + + var request = new FactoryPauseRequest { SessionId = _session.SessionId, RunId = runId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.pause", [request], cancellationToken); + } + + /// Atomically pauses an owned factory attempt at a durable checkpoint. + /// Factory run identifier. + /// Opaque token identifying the execution attempt that reached the checkpoint. + /// Stable author-defined checkpoint key. + /// The to monitor for cancellation requests. The default is . + internal async Task PauseAtCheckpointAsync(string runId, string executionToken, string key, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(runId); + ArgumentNullException.ThrowIfNull(executionToken); + ArgumentNullException.ThrowIfNull(key); + _session.ThrowIfDisposed(); + + var request = new FactoryPauseCheckpointRequest { SessionId = _session.SessionId, RunId = runId, ExecutionToken = executionToken, Key = key }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.pauseAtCheckpoint", [request], cancellationToken); + } + /// Records a batch of ordered factory progress lines. /// Factory run identifier. /// Opaque token identifying the current factory execution attempt. @@ -33790,6 +34127,18 @@ internal async Task ApplyStartupOverlayAsync(string? device return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.applyStartupOverlay", [request], cancellationToken); } + /// Replaces or clears the host-supplied model allowlist for a running session. + /// Exact model IDs to permit, or null to clear the host restriction. + /// The to monitor for cancellation requests. The default is . + /// The applied host allowlist and effective session model policy after intersection. + public async Task SetAllowedModelsAsync(IList? allowedModels = null, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new ModelSetAllowedModelsRequest { SessionId = _session.SessionId, AllowedModels = allowedModels }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.setAllowedModels", [request], cancellationToken); + } + /// Updates the session's reasoning effort without changing the selected model. /// Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling. /// The to monitor for cancellation requests. The default is . @@ -37794,6 +38143,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.PromptCacheBreakData), TypeInfoPropertyName = "SessionEventsPromptCacheBreakData")] [JsonSerializable(typeof(GitHub.Copilot.PromptCacheBreakEvent), TypeInfoPropertyName = "SessionEventsPromptCacheBreakEvent")] [JsonSerializable(typeof(GitHub.Copilot.ReasoningSummary), TypeInfoPropertyName = "SessionEventsReasoningSummary")] +[JsonSerializable(typeof(GitHub.Copilot.RecommendedAutoTier), TypeInfoPropertyName = "SessionEventsRecommendedAutoTier")] [JsonSerializable(typeof(GitHub.Copilot.RemediationAction), TypeInfoPropertyName = "SessionEventsRemediationAction")] [JsonSerializable(typeof(GitHub.Copilot.SamplingCompletedData), TypeInfoPropertyName = "SessionEventsSamplingCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.SamplingCompletedEvent), TypeInfoPropertyName = "SessionEventsSamplingCompletedEvent")] @@ -37836,6 +38186,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.SubagentSelectedEvent), TypeInfoPropertyName = "SessionEventsSubagentSelectedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SubagentStartedData), TypeInfoPropertyName = "SessionEventsSubagentStartedData")] [JsonSerializable(typeof(GitHub.Copilot.SubagentStartedEvent), TypeInfoPropertyName = "SessionEventsSubagentStartedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.SubagentTaskModelSource), TypeInfoPropertyName = "SessionEventsSubagentTaskModelSource")] [JsonSerializable(typeof(GitHub.Copilot.SystemMessageData), TypeInfoPropertyName = "SessionEventsSystemMessageData")] [JsonSerializable(typeof(GitHub.Copilot.SystemMessageEvent), TypeInfoPropertyName = "SessionEventsSystemMessageEvent")] [JsonSerializable(typeof(GitHub.Copilot.SystemMessageMetadata), TypeInfoPropertyName = "SessionEventsSystemMessageMetadata")] @@ -37848,6 +38199,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationEvent), TypeInfoPropertyName = "SessionEventsSystemNotificationEvent")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationFactoryCompleted), TypeInfoPropertyName = "SessionEventsSystemNotificationFactoryCompleted")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationFactoryCompletedStatus), TypeInfoPropertyName = "SessionEventsSystemNotificationFactoryCompletedStatus")] +[JsonSerializable(typeof(GitHub.Copilot.SystemNotificationFactoryPauseInfo), TypeInfoPropertyName = "SessionEventsSystemNotificationFactoryPauseInfo")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationInstructionDiscovered), TypeInfoPropertyName = "SessionEventsSystemNotificationInstructionDiscovered")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationNewInboxMessage), TypeInfoPropertyName = "SessionEventsSystemNotificationNewInboxMessage")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationShellCompleted), TypeInfoPropertyName = "SessionEventsSystemNotificationShellCompleted")] @@ -38071,6 +38423,9 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(FactoryListRunsResult))] [JsonSerializable(typeof(FactoryLogLine))] [JsonSerializable(typeof(FactoryLogRequest))] +[JsonSerializable(typeof(FactoryPauseCheckpointRequest))] +[JsonSerializable(typeof(FactoryPauseInfo))] +[JsonSerializable(typeof(FactoryPauseRequest))] [JsonSerializable(typeof(FactoryPhaseObservation))] [JsonSerializable(typeof(FactoryProgressLine))] [JsonSerializable(typeof(FactoryProgressPage))] @@ -38132,6 +38487,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(InstructionsGetSourcesResult))] [JsonSerializable(typeof(InterruptMainTurnRequest))] [JsonSerializable(typeof(InterruptMainTurnResult))] +[JsonSerializable(typeof(JsonSchemaResponseFormat))] [JsonSerializable(typeof(LlmInferenceHttpRequestChunkRequest))] [JsonSerializable(typeof(LlmInferenceHttpRequestChunkResult))] [JsonSerializable(typeof(LlmInferenceHttpRequestStartRequest))] @@ -38290,6 +38646,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(ModelPickerSettingsContext))] [JsonSerializable(typeof(ModelPickerSettingsContextEnvironment))] [JsonSerializable(typeof(ModelPolicy))] +[JsonSerializable(typeof(ModelSetAllowedModelsRequest))] +[JsonSerializable(typeof(ModelSetAllowedModelsResult))] [JsonSerializable(typeof(ModelSetReasoningEffortRequest))] [JsonSerializable(typeof(ModelSetReasoningEffortResult))] [JsonSerializable(typeof(ModelSwitchAutoTierRequest))] @@ -38448,6 +38806,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(RemoteSessionConnectionResult))] [JsonSerializable(typeof(RemoteSessionMetadataRepository))] [JsonSerializable(typeof(RemoteSessionMetadataValue))] +[JsonSerializable(typeof(ResponseFormat))] [JsonSerializable(typeof(RunOptions))] [JsonSerializable(typeof(SandboxConfig))] [JsonSerializable(typeof(SandboxConfigAuth))] @@ -38458,6 +38817,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SandboxConfigUserPolicyNetwork))] [JsonSerializable(typeof(SandboxConfigUserPolicyNetworkProxy))] [JsonSerializable(typeof(SandboxConfigUserPolicySeatbelt))] +[JsonSerializable(typeof(SandboxDisableForSessionRequest))] +[JsonSerializable(typeof(SandboxDisableForSessionResult))] [JsonSerializable(typeof(SandboxEnforcementStatus))] [JsonSerializable(typeof(ScheduleAddAtRequest))] [JsonSerializable(typeof(ScheduleAddCronRequest))] @@ -38507,6 +38868,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionEventLogTailRequest))] [JsonSerializable(typeof(SessionExtensionsListRequest))] [JsonSerializable(typeof(SessionExtensionsReloadRequest))] +[JsonSerializable(typeof(SessionFactoryPauseAtCheckpointResult))] [JsonSerializable(typeof(SessionFsAppendFileRequest))] [JsonSerializable(typeof(SessionFsError))] [JsonSerializable(typeof(SessionFsExistsRequest))] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index 58c8a2c9cc..2e6de8f9b1 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -84,6 +84,7 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionLimitsExhaustedCompletedEvent), "session_limits_exhausted.completed")] [JsonDerivedType(typeof(SessionLimitsExhaustedRequestedEvent), "session_limits_exhausted.requested")] [JsonDerivedType(typeof(SessionAutoModeResolvedEvent), "session.auto_mode_resolved")] +[JsonDerivedType(typeof(SessionAutoTierRecommendationEvent), "session.auto_tier_recommendation")] [JsonDerivedType(typeof(SessionAutoTierSwitchFailedEvent), "session.auto_tier_switch_failed")] [JsonDerivedType(typeof(SessionAutopilotObjectiveChangedEvent), "session.autopilot_objective_changed")] [JsonDerivedType(typeof(SessionBackgroundTasksChangedEvent), "session.background_tasks_changed")] @@ -371,6 +372,20 @@ public sealed partial class SessionModelChangeEvent : SessionEvent public required SessionModelChangeData Data { get; set; } } +/// Live-only Auto preference recommendation from Copilot API after a successful Auto model call. +/// Represents the session.auto_tier_recommendation event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionAutoTierRecommendationEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.auto_tier_recommendation"; + + /// The session.auto_tier_recommendation event payload. + [JsonPropertyName("data")] + public required SessionAutoTierRecommendationData Data { get; set; } +} + /// A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. /// Represents the session.auto_tier_switch_failed event. public sealed partial class SessionAutoTierSwitchFailedEvent : SessionEvent @@ -2440,6 +2455,15 @@ public sealed partial class SessionModelChangeData public Verbosity? Verbosity { get; set; } } +/// Live-only Auto preference recommendation from Copilot API after a successful Auto model call. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionAutoTierRecommendationData +{ + /// Recommended Auto preference. + [JsonPropertyName("recommendedAutoTier")] + public required RecommendedAutoTier RecommendedAutoTier { get; set; } +} + /// A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. public sealed partial class SessionAutoTierSwitchFailedData { @@ -2502,13 +2526,15 @@ public sealed partial class SessionPermissionsChangedData /// Permission mode after the change. [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mode")] - public required PermissionMode Mode { get; set; } + public PermissionMode? Mode { get; set; } /// Permission mode before the change. [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("previousMode")] - public required PermissionMode PreviousMode { get; set; } + public PermissionMode? PreviousMode { get; set; } } /// Plan file operation details indicating what changed. @@ -2868,6 +2894,12 @@ public sealed partial class SessionCompactionStartData /// Conversation compaction results including success status, metrics, and optional error details. public sealed partial class SessionCompactionCompleteData { + /// Authoritative active-factory reminder appended to the compacted context. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("activeFactorySummary")] + internal string? ActiveFactorySummary { get; set; } + /// Canonical model identifier used for model-specific behavior when replaying compaction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("behaviorModelId")] @@ -3793,6 +3825,11 @@ public sealed partial class AssistantMessageData [JsonPropertyName("model")] public string? Model { get; set; } + /// Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("originatingMessageId")] + public string? OriginatingMessageId { get; set; } + /// Actual output token count from the API response (completion_tokens), used for accurate token accounting. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("outputTokens")] @@ -4782,6 +4819,11 @@ public sealed partial class SubagentStartedData [JsonPropertyName("resumable")] public bool? Resumable { get; set; } + /// Where the model input for this sub-agent came from. Present when the task planner resolved the launch (the task tool and factory agents); absent for sub-agents created through other runtime paths. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("taskModelSource")] + public SubagentTaskModelSource? TaskModelSource { get; set; } + /// Tool call ID of the parent tool invocation that spawned this sub-agent. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } @@ -6409,6 +6451,11 @@ public sealed partial class CompactionCompleteCompactionTokensUsedCopilotUsageTo [JsonPropertyName("costPerBatch")] public required long CostPerBatch { get; set; } + /// Model responsible for this billing entry. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("model")] + public string? Model { get; set; } + /// Total token count for this entry. [JsonPropertyName("tokenCount")] public required long TokenCount { get; set; } @@ -6422,6 +6469,12 @@ public sealed partial class CompactionCompleteCompactionTokensUsedCopilotUsageTo /// Nested data type for CompactionCompleteCompactionTokensUsedCopilotUsage. internal sealed partial class CompactionCompleteCompactionTokensUsedCopilotUsage { + /// Default billing model for token details that do not identify their own model. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("model")] + internal string? Model { get; set; } + /// Itemized token usage breakdown. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonInclude] @@ -7508,6 +7561,11 @@ public sealed partial class AssistantUsageCopilotUsageTokenDetail [JsonPropertyName("costPerBatch")] public required long CostPerBatch { get; set; } + /// Model responsible for this billing entry. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("model")] + public string? Model { get; set; } + /// Total token count for this entry. [JsonPropertyName("tokenCount")] public required long TokenCount { get; set; } @@ -7521,6 +7579,11 @@ public sealed partial class AssistantUsageCopilotUsageTokenDetail /// Nested data type for AssistantUsageCopilotUsage. public sealed partial class AssistantUsageCopilotUsage { + /// Default billing model for token details that do not identify their own model. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("model")] + public string? Model { get; set; } + /// Itemized token usage breakdown. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonInclude] @@ -8678,6 +8741,41 @@ public sealed partial class SystemNotificationInstructionDiscovered : SystemNoti public required string TriggerTool { get; set; } } +/// The user variant of . +public sealed partial class SystemNotificationFactoryPauseInfoUser : SystemNotificationFactoryPauseInfo +{ + /// + [JsonIgnore] + public override string Type => "user"; +} + +/// The checkpoint variant of . +public sealed partial class SystemNotificationFactoryPauseInfoCheckpoint : SystemNotificationFactoryPauseInfo +{ + /// + [JsonIgnore] + public override string Type => "checkpoint"; + + /// Stable author-defined checkpoint key that initiated the pause. + [JsonPropertyName("key")] + public required string Key { get; set; } +} + +/// Durable metadata describing who initiated a factory pause. +/// Polymorphic base type discriminated by type. +[JsonPolymorphic( + TypeDiscriminatorPropertyName = "type", + UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] +[JsonDerivedType(typeof(SystemNotificationFactoryPauseInfoUser), "user")] +[JsonDerivedType(typeof(SystemNotificationFactoryPauseInfoCheckpoint), "checkpoint")] +public partial class SystemNotificationFactoryPauseInfo +{ + /// The type discriminator. + [JsonPropertyName("type")] + public virtual string Type { get; set; } = string.Empty; +} + + /// System notification metadata for a factory execution attempt that reached a terminal state. /// The factory_completed variant of . public sealed partial class SystemNotificationFactoryCompleted : SystemNotification @@ -8711,6 +8809,11 @@ public sealed partial class SystemNotificationFactoryCompleted : SystemNotificat [JsonPropertyName("failure")] public JsonElement? Failure { get; set; } + /// Pause initiator metadata when this attempt settled as paused. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("pauseInfo")] + public SystemNotificationFactoryPauseInfo? PauseInfo { get; set; } + /// Bounded prompt-safe preview of the completed result. [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] [MaxLength(256)] @@ -8862,6 +8965,11 @@ public override bool? ManagedApprovalRequired [JsonPropertyName("requestSandboxBypassReason")] public string? RequestSandboxBypassReason { get; set; } + /// True when the requested escalation is a permissive retry rather than a full bypass: the command re-runs inside the sandbox with its file and process restrictions recording instead of blocking, while the network policy stays enforced. Always accompanied by requestSandboxBypass, so hosts that do not recognize this field still treat the request as the escalation it is. Hosts that do recognize it must not describe the command as running outside the sandbox, which would overstate the privilege being granted. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("requestSandboxPermissive")] + public bool? RequestSandboxPermissive { get; set; } + /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] @@ -9423,6 +9531,21 @@ public sealed partial class PermissionPromptRequestCommands : PermissionPromptRe [JsonPropertyName("managedApprovalRequired")] public bool? ManagedApprovalRequired { get; set; } + /// True when the shell command is requesting sandbox escalation. This is a request, not a grant. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("requestSandboxBypass")] + public bool? RequestSandboxBypass { get; set; } + + /// Reason for the sandbox escalation request. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("requestSandboxBypassReason")] + public string? RequestSandboxBypassReason { get; set; } + + /// True when the escalation is a permissive retry that keeps the sandbox and network policy attached while recording file and process accesses instead of blocking them. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("requestSandboxPermissive")] + public bool? RequestSandboxPermissive { get; set; } + /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] @@ -10478,6 +10601,11 @@ public sealed partial class CustomAgentsUpdatedAgent [JsonPropertyName("description")] public required string Description { get; set; } + /// Whether model-driven invocation is disabled for this agent. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("disableModelInvocation")] + public bool? DisableModelInvocation { get; set; } + /// Human-readable display name. [JsonPropertyName("displayName")] public required string DisplayName { get; set; } @@ -10689,7 +10817,7 @@ public sealed partial class McpAppToolCallCompleteToolMeta public McpAppToolCallCompleteToolMetaUI? Ui { get; set; } } -/// Routing preference used when the session model is `auto`. +/// Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AutoTier : IEquatable @@ -10717,6 +10845,9 @@ public AutoTier(string value) /// Optimize for intelligence. public static AutoTier Intelligence { get; } = new("intelligence"); + /// Integrator-only preset that optimizes for latency. + public static AutoTier Fast { get; } = new("fast"); + /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AutoTier left, AutoTier right) => left.Equals(right); @@ -11417,6 +11548,70 @@ public override void Write(Utf8JsonWriter writer, ModelChangeSource value, JsonS } } +/// Auto preferences that Copilot API can recommend. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct RecommendedAutoTier : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public RecommendedAutoTier(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Optimize for efficiency. + public static RecommendedAutoTier Efficiency { get; } = new("efficiency"); + + /// Balance efficiency and intelligence. + public static RecommendedAutoTier Balance { get; } = new("balance"); + + /// Optimize for intelligence. + public static RecommendedAutoTier Intelligence { get; } = new("intelligence"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(RecommendedAutoTier left, RecommendedAutoTier right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(RecommendedAutoTier left, RecommendedAutoTier right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is RecommendedAutoTier other && Equals(other); + + /// + public bool Equals(RecommendedAutoTier 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 RecommendedAutoTier Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, RecommendedAutoTier value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(RecommendedAutoTier)); + } + } +} + /// Terminal reason an Auto preference activation failed. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -14094,6 +14289,73 @@ public override void Write(Utf8JsonWriter writer, SkillInvokedTrigger value, Jso } } +/// Where the model input for a task-tool sub-agent came from. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct SubagentTaskModelSource : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public SubagentTaskModelSource(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The spawning agent supplied the task tool's model argument. + public static SubagentTaskModelSource TaskArgument { get; } = new("task_argument"); + + /// The task omitted a model and the per-sub-agent settings entry supplied a concrete one. + public static SubagentTaskModelSource SubagentConfiguration { get; } = new("subagent_configuration"); + + /// The task omitted a model and the user-defined custom agent's definition supplied one. + public static SubagentTaskModelSource CustomAgentDefinition { get; } = new("custom_agent_definition"); + + /// Neither the task call, the per-sub-agent settings entry, nor a custom agent definition supplied a model. + public static SubagentTaskModelSource Unset { get; } = new("unset"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(SubagentTaskModelSource left, SubagentTaskModelSource right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(SubagentTaskModelSource left, SubagentTaskModelSource right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is SubagentTaskModelSource other && Equals(other); + + /// + public bool Equals(SubagentTaskModelSource 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 SubagentTaskModelSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, SubagentTaskModelSource value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SubagentTaskModelSource)); + } + } +} + /// Binary asset type discriminator. Use "image" for images and "resource" otherwise. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -14302,6 +14564,9 @@ public SystemNotificationFactoryCompletedStatus(string value) /// The factory was halted. public static SystemNotificationFactoryCompletedStatus Halted { get; } = new("halted"); + /// The factory attempt paused intentionally. + public static SystemNotificationFactoryCompletedStatus Paused { get; } = new("paused"); + /// The factory was cancelled. public static SystemNotificationFactoryCompletedStatus Cancelled { get; } = new("cancelled"); @@ -15793,6 +16058,9 @@ public FactoryRunSettledStatus(string value) /// The run was stopped by a limit, an approval refusal or another policy decision. public static FactoryRunSettledStatus Halted { get; } = new("halted"); + /// The attempt paused intentionally while preserving resumable run state. + public static FactoryRunSettledStatus Paused { get; } = new("paused"); + /// The run was cancelled by its caller or by session disposal. public static FactoryRunSettledStatus Cancelled { get; } = new("cancelled"); @@ -16559,6 +16827,8 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SandboxDecisionEvent))] [JsonSerializable(typeof(SessionAutoModeResolvedData))] [JsonSerializable(typeof(SessionAutoModeResolvedEvent))] +[JsonSerializable(typeof(SessionAutoTierRecommendationData))] +[JsonSerializable(typeof(SessionAutoTierRecommendationEvent))] [JsonSerializable(typeof(SessionAutoTierSwitchFailedData))] [JsonSerializable(typeof(SessionAutoTierSwitchFailedEvent))] [JsonSerializable(typeof(SessionAutopilotObjectiveChangedData))] @@ -16711,6 +16981,9 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SystemNotificationData))] [JsonSerializable(typeof(SystemNotificationEvent))] [JsonSerializable(typeof(SystemNotificationFactoryCompleted))] +[JsonSerializable(typeof(SystemNotificationFactoryPauseInfo))] +[JsonSerializable(typeof(SystemNotificationFactoryPauseInfoCheckpoint))] +[JsonSerializable(typeof(SystemNotificationFactoryPauseInfoUser))] [JsonSerializable(typeof(SystemNotificationInstructionDiscovered))] [JsonSerializable(typeof(SystemNotificationNewInboxMessage))] [JsonSerializable(typeof(SystemNotificationShellCompleted))] diff --git a/dotnet/src/Session.StructuredOutput.cs b/dotnet/src/Session.StructuredOutput.cs new file mode 100644 index 0000000000..fe59f65f69 --- /dev/null +++ b/dotnet/src/Session.StructuredOutput.cs @@ -0,0 +1,189 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +using Microsoft.Extensions.AI; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Text.Json.Serialization.Metadata; + +namespace GitHub.Copilot; + +public sealed partial class CopilotSession +{ + /// + /// Sends a prompt with a JSON Schema inferred from and + /// deserializes the final response into that type. + /// + /// The expected response type. + /// The user message text. + /// Options used both for schema inference and deserialization. + /// Defaults to , as for custom tools. + /// For Native AOT, supply options with a source-generated type resolver. + /// Timeout duration (default: 60 seconds). Does not abort agent work. + /// Cancellation token for sending and waiting. + /// The non-null deserialized response. + [Experimental(Diagnostics.Experimental)] + public Task SendAndWaitAsync( + string prompt, + JsonSerializerOptions? serializerOptions = null, + TimeSpan? timeout = null, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(prompt); + return SendAndWaitAsync(new MessageOptions { Prompt = prompt }, serializerOptions, timeout, cancellationToken); + } + + /// + /// Sends a message with a JSON Schema inferred from and + /// deserializes the final response into that type. + /// + /// The expected response type. + /// The message to send. Must not specify a response schema or immediate delivery. + /// Options used both for schema inference and deserialization. + /// Defaults to , as for custom tools. + /// For Native AOT, supply options with a source-generated type resolver. + /// Timeout duration (default: 60 seconds). Does not abort agent work. + /// Cancellation token for sending and waiting. + /// The non-null deserialized response. + /// The message specifies a response schema or immediate delivery. + /// No final response was received, or the session reported an error. + /// The response is not valid JSON for the requested type, or is null. + /// The response did not arrive within the timeout. + /// + /// Uses the same Microsoft.Extensions.AI schema inference as custom tools. Property naming, + /// converters, required members and nullable annotations follow the supplied serialization + /// contracts. The inferred schema requests strict output with all properties required and + /// additional properties disallowed. Provider schema restrictions still apply. + /// Deserialization is not full JSON Schema validation; apply application-specific validation + /// to the returned value where needed. The supplied message options are not modified. + /// + [Experimental(Diagnostics.Experimental)] + public async Task SendAndWaitAsync( + MessageOptions options, + JsonSerializerOptions? serializerOptions = null, + TimeSpan? timeout = null, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(options); + ThrowIfDisposed(); + if (options.ResponseSchema is not null) + { + throw new ArgumentException("The typed overload infers its response schema. Use the untyped overload for an explicit response schema.", nameof(options)); + } + if (options.Mode == "immediate") + { + throw new ArgumentException("Structured output cannot be requested on an immediate steering message.", nameof(options)); + } + + serializerOptions ??= AIJsonUtilities.DefaultOptions; + var typeInfo = (JsonTypeInfo)serializerOptions.GetTypeInfo(typeof(TResult)); + var schema = AIJsonUtilities.CreateJsonSchema( + typeof(TResult), + serializerOptions: serializerOptions, + inferenceOptions: new AIJsonSchemaCreateOptions + { + TransformOptions = new AIJsonSchemaTransformOptions + { + RequireAllProperties = true, + DisallowAdditionalProperties = true, + MoveDefaultKeywordToDescription = true, + }, + }); + var message = options.Clone(); + message.ResponseSchema = schema; + + var response = await SendAndWaitForStructuredMessageAsync(message, timeout, cancellationToken); + return JsonSerializer.Deserialize(response.Data.Content, typeInfo) + ?? throw new JsonException("The structured response was JSON null, not a result."); + } + + private async Task SendAndWaitForStructuredMessageAsync( + MessageOptions options, TimeSpan? timeout, CancellationToken cancellationToken) + { + var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(60); + using var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + cts.CancelAfter(effectiveTimeout); + var completion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + using var registration = cts.Token.Register(() => completion.TrySetCanceled(cts.Token)); + var gate = new object(); + var pendingEvents = new List(); + string? messageId = null; + var started = false; + AssistantMessageEvent? finalMessage = null; + + void ProcessEvent(SessionEvent evt) + { + switch (evt) + { + case UserMessageEvent user when string.IsNullOrEmpty(user.AgentId) && user.Data.MessageId == messageId: + started = true; + break; + case AssistantMessageEvent assistant when string.IsNullOrEmpty(assistant.AgentId) && assistant.Data.OriginatingMessageId == messageId: + started = true; + finalMessage = assistant.Data.ToolRequests is { Length: > 0 } ? null : assistant; + break; + case SessionIdleEvent idle when started && string.IsNullOrEmpty(idle.AgentId) && idle.Data.Mode != SessionMode.Autopilot: + if (idle.Data.Aborted == true) + { + completion.TrySetException(new InvalidOperationException("The session was aborted before a final structured response was received.")); + } + else if (finalMessage is null || string.IsNullOrWhiteSpace(finalMessage.Data.Content)) + { + completion.TrySetException(new InvalidOperationException("The turn completed without a final structured response.")); + } + else + { + completion.TrySetResult(finalMessage); + } + break; + case SessionErrorEvent error when started && string.IsNullOrEmpty(error.AgentId): + completion.TrySetException(new InvalidOperationException($"Session error: {error.Data.Message}")); + break; + } + } + + using var subscription = On(evt => + { + if (evt is not (UserMessageEvent or AssistantMessageEvent or SessionIdleEvent or SessionErrorEvent)) + { + return; + } + lock (gate) + { + if (messageId is null) + { + // Events can arrive before the send RPC response supplies the logical message ID. + pendingEvents.Add(evt); + } + else + { + ProcessEvent(evt); + } + } + }); + try + { + var sentMessageId = await SendAsync(options, cts.Token); + lock (gate) + { + messageId = sentMessageId; + foreach (var evt in pendingEvents) + { + ProcessEvent(evt); + } + pendingEvents.Clear(); + } + await Task.WhenAny(completion.Task, JsonRpc.Completion, _eventChannel.Reader.Completion); + if (!completion.Task.IsCompleted) + { + throw new IOException("The session closed before a final structured response was received."); + } + return await completion.Task; + } + catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) + { + throw new TimeoutException($"SendAndWaitAsync timed out after {effectiveTimeout}"); + } + } +} diff --git a/dotnet/src/Session.cs b/dotnet/src/Session.cs index 404c0054b7..0912bbbfbd 100644 --- a/dotnet/src/Session.cs +++ b/dotnet/src/Session.cs @@ -331,6 +331,16 @@ public async Task SendAsync(MessageOptions options, CancellationToken ca Traceparent = traceparent, Tracestate = tracestate, RequestHeaders = options.RequestHeaders, + ResponseFormat = options.ResponseSchema is { } schema ? new ResponseFormat + { + Type = "json_schema", + JsonSchema = new JsonSchemaResponseFormat + { + Name = "response", + Schema = schema, + Strict = true, + }, + } : null, }; var rpcTimestamp = Stopwatch.GetTimestamp(); @@ -380,6 +390,11 @@ public async Task SendAsync(MessageOptions options, CancellationToken ca ArgumentNullException.ThrowIfNull(options); ThrowIfDisposed(); + if (options.ResponseSchema is not null) + { + return await SendAndWaitForStructuredMessageAsync(options, timeout, cancellationToken); + } + var totalTimestamp = Stopwatch.GetTimestamp(); var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(60); var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -2275,6 +2290,7 @@ internal record SendMessageRequest public string? Traceparent { get; init; } public string? Tracestate { get; init; } public IDictionary? RequestHeaders { get; init; } + public ResponseFormat? ResponseFormat { get; init; } } internal record SendMessageResponse diff --git a/dotnet/src/Types.cs b/dotnet/src/Types.cs index 755b42f296..57d509492d 100644 --- a/dotnet/src/Types.cs +++ b/dotnet/src/Types.cs @@ -4084,6 +4084,7 @@ private MessageOptions(MessageOptions? other) Source = other.Source; Prompt = other.Prompt; DisplayPrompt = other.DisplayPrompt; + ResponseSchema = other.ResponseSchema; RequestHeaders = other.RequestHeaders is not null ? new Dictionary(other.RequestHeaders) : null; @@ -4121,6 +4122,15 @@ private MessageOptions(MessageOptions? other) /// public string? DisplayPrompt { get; set; } + /// + /// Optional provider-native JSON Schema for this turn, including tool continuations. + /// The schema is passed unchanged with the name "response" and strict enforcement requested. + /// An immediate steering message inherits the active turn's schema and must not specify its own. + /// Use for advanced response-format options. + /// + [Experimental(Diagnostics.Experimental)] + public JsonElement? ResponseSchema { get; set; } + /// /// Creates a shallow clone of this instance. /// diff --git a/dotnet/test/E2E/StructuredOutputE2ETests.cs b/dotnet/test/E2E/StructuredOutputE2ETests.cs new file mode 100644 index 0000000000..804904e0e2 --- /dev/null +++ b/dotnet/test/E2E/StructuredOutputE2ETests.cs @@ -0,0 +1,186 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +using GitHub.Copilot.Rpc; +using GitHub.Copilot.Test.Harness; +using System.Text.Json; +using System.Text.Json.Serialization; +using Xunit; +using Xunit.Abstractions; + +namespace GitHub.Copilot.Test.E2E; + +public partial class StructuredOutputE2ETests(E2ETestFixture fixture, ITestOutputHelper output) + : E2ETestBase(fixture, "structured_output_dotnet", output) +{ + private SessionConfig StructuredSessionConfig() => new() + { + Model = "gpt-4.1", + AvailableTools = [], + Provider = new ProviderConfig + { + Type = "openai", + WireApi = "completions", + BaseUrl = Ctx.ProxyUrl, + ModelId = "gpt-4.1", + WireModel = "gpt-4.1", + ApiKey = Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true" + ? "fake-token-for-e2e-tests" + : Environment.GetEnvironmentVariable("GITHUB_TOKEN") ?? "fake-token-for-e2e-tests", + Headers = new Dictionary + { + ["Copilot-Integration-Id"] = "copilot-developer-cli", + ["Copilot-Harness-Id"] = "copilot-sdk", + ["X-GitHub-Api-Version"] = "2026-08-01", + }, + }, + }; + + [Fact] + public async Task Infers_Typed_Result_After_Custom_Tool() + { + var calls = 0; + var config = StructuredSessionConfig(); + config.Tools = + [ + CopilotTool.DefineTool(() => + { + calls++; + return "The inventory contains 42 red widgets."; + }, factoryOptions: new() { Name = "get_inventory", Description = "Get the current widget inventory." }), + ]; + var session = await CreateSessionAsync(config); + + var result = await session.SendAndWaitAsync( + "Call get_inventory, then report the widget count and color.", + StructuredOutputE2EJsonContext.Default.Options, + TimeSpan.FromMinutes(3)); + Assert.True(calls > 0); + Assert.Equal(42, result.Count); + Assert.Equal("red", result.Color); + + var ordinary = await session.SendAndWaitAsync( + "Now reply with exactly the plain text HELLO, not JSON.", + TimeSpan.FromMinutes(3)); + Assert.NotNull(ordinary); + Assert.Equal("HELLO", ordinary.Data.Content.Trim()); + } + + [Fact] + public async Task Sends_Explicit_Schema_For_Message_And_Batch() + { + var session = await CreateSessionAsync(StructuredSessionConfig()); + var completion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + using var subscription = session.On(message => + { + if (message.Data.ToolRequests is not { Length: > 0 }) + { + completion.TrySetResult(message); + } + }); + using var schema = JsonDocument.Parse( + """{"type":"object","properties":{"count":{"type":"integer"},"color":{"type":"string"}},"required":["count","color"],"additionalProperties":false}"""); + var accepted = await session.Rpc.SendMessagesAsync( + [new() { Prompt = "There are 42 red widgets in stock." }, new() { Prompt = "Report the widget count and color." }], + responseFormat: new ResponseFormat + { + Type = "json_schema", + JsonSchema = new JsonSchemaResponseFormat + { + Name = "inventory", + Schema = schema.RootElement.Clone(), + Strict = true, + Description = "The widget inventory", + }, + }); + using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); + var message = await completion.Task.WaitAsync(cts.Token); + Assert.Equal(accepted.MessageIds.Last(), message.Data.OriginatingMessageId); + var result = JsonSerializer.Deserialize(message.Data.Content, StructuredOutputE2EJsonContext.Default.Inventory); + Assert.NotNull(result); + Assert.Equal(42, result.Count); + Assert.Equal("red", result.Color); + + var raw = await session.SendAndWaitAsync(new MessageOptions + { + Prompt = "The inventory now has 21 blue widgets. Report the new count and color.", + ResponseSchema = schema.RootElement.Clone(), + }, TimeSpan.FromMinutes(3)); + Assert.NotNull(raw); + var updated = JsonSerializer.Deserialize(raw.Data.Content, StructuredOutputE2EJsonContext.Default.Inventory); + Assert.NotNull(updated); + Assert.Equal(21, updated.Count); + Assert.Equal("blue", updated.Color); + } + + [Fact] + public async Task Concurrent_Typed_Sends_Return_Their_Own_Results() + { + var toolEntered = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var releaseTool = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var config = StructuredSessionConfig(); + config.Tools = + [ + CopilotTool.DefineTool(async () => + { + toolEntered.TrySetResult(); + await releaseTool.Task; + return 42; + }, factoryOptions: new() { Name = "first_number", Description = "Get the number for the first question." }), + ]; + var session = await CreateSessionAsync(config); + var serializerOptions = JsonSerializer.IsReflectionEnabledByDefault + ? null + : StructuredOutputE2EJsonContext.Default.Options; + var first = session.SendAndWaitAsync( + "Call first_number exactly once and report its returned number.", + serializerOptions, + TimeSpan.FromMinutes(3)); + try + { + var entered = await Task.WhenAny(toolEntered.Task, first).WaitAsync(TimeSpan.FromMinutes(3)); + if (entered == first) + { + await first; + throw new InvalidOperationException("First run completed without calling first_number."); + } + const string secondPrompt = "What is 30 + 7? Do not use tools."; + var second = session.SendAndWaitAsync( + secondPrompt, serializerOptions, TimeSpan.FromMinutes(3)); + await TestHelper.WaitForConditionAsync( + async () => (await session.Rpc.Queue.PendingItemsAsync()).Items.Any( + item => item.DisplayText.Contains(secondPrompt, StringComparison.Ordinal)), + timeoutMessage: "Second structured send was not queued behind the tool call."); + releaseTool.TrySetResult(); + Assert.Equal(42, (await first).First); + Assert.Equal(37, (await second).Second); + } + finally + { + releaseTool.TrySetResult(); + } + } + + public sealed class FirstAnswer + { + public required int First { get; set; } + } + + public sealed class SecondAnswer + { + public required int Second { get; set; } + } + + public sealed class Inventory + { + public required int Count { get; set; } + public required string Color { get; set; } + } + + [JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] + [JsonSerializable(typeof(Inventory))] + [JsonSerializable(typeof(FirstAnswer))] + [JsonSerializable(typeof(SecondAnswer))] + internal sealed partial class StructuredOutputE2EJsonContext : JsonSerializerContext; +} diff --git a/dotnet/test/Unit/ClientSessionLifetimeTests.cs b/dotnet/test/Unit/ClientSessionLifetimeTests.cs index 173569788c..2ad0aa87c8 100644 --- a/dotnet/test/Unit/ClientSessionLifetimeTests.cs +++ b/dotnet/test/Unit/ClientSessionLifetimeTests.cs @@ -17,7 +17,7 @@ namespace GitHub.Copilot.Test.Unit; -public sealed class ClientSessionLifetimeTests +public sealed partial class ClientSessionLifetimeTests { private sealed record RpcRequestRecord(string Method, JsonElement Params); @@ -2201,6 +2201,11 @@ private sealed class FakeCopilotServer : IAsyncDisposable private bool _failRuntimeShutdown; private bool _failSessionCreate; private bool _failSessionSend; + private int _nextMessageId; + + public bool UniqueMessageIds { get; set; } + + public Func? BeforeSendResponse { get; set; } private FakeCopilotServer(TcpListener listener) { @@ -2297,7 +2302,7 @@ public async Task SendRequestAsync(string method, Dictionary data) + public Task SendSessionEventAsync(string sessionId, string type, Dictionary data, string? agentId = null) { var stream = _stream ?? throw new InvalidOperationException("Client is not connected."); return WriteMessageAsync(stream, new Dictionary @@ -2312,6 +2317,7 @@ public Task SendSessionEventAsync(string sessionId, string type, Dictionary new Dictionary @@ -2453,7 +2464,11 @@ private async Task HandleRequestAsync(Stream stream, JsonElement request, Cancel }, "session.send" => new Dictionary { - ["messageId"] = "message-1" + ["messageId"] = sendMessageId + }, + "session.sendMessages" => new Dictionary + { + ["messageIds"] = new[] { sendMessageId } }, "session.options.update" => new Dictionary { diff --git a/dotnet/test/Unit/StructuredOutputTests.cs b/dotnet/test/Unit/StructuredOutputTests.cs new file mode 100644 index 0000000000..d43b271876 --- /dev/null +++ b/dotnet/test/Unit/StructuredOutputTests.cs @@ -0,0 +1,479 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +#if NET8_0_OR_GREATER +using GitHub.Copilot.Rpc; +using System.Text.Json; +using System.Text.Json.Serialization; +using Xunit; + +namespace GitHub.Copilot.Test.Unit; + +public sealed partial class ClientSessionLifetimeTests +{ + [Theory] + [InlineData("session")] + [InlineData("rpc")] + [InlineData("batch")] + public async Task StructuredOutput_Raw_Format_Is_Forwarded_Without_Rewriting(string api) + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + using var document = JsonDocument.Parse("""{"type":"object","properties":{"value":{"type":"integer"}},"x-provider":{"anything":[true,42,null]}}"""); + var format = new ResponseFormat + { + Type = "json_schema", + JsonSchema = new JsonSchemaResponseFormat + { + Name = "answer", + Schema = document.RootElement.Clone(), + Strict = false, + Description = "An answer", + }, + }; + var options = new MessageOptions { Prompt = "Answer", ResponseSchema = document.RootElement.Clone() }; + Assert.Equal(options.ResponseSchema, options.Clone().ResponseSchema); + if (api == "batch") + { + await session.Rpc.SendMessagesAsync([new() { Prompt = "Answer" }], responseFormat: format); + } + else if (api == "rpc") + { + await session.Rpc.SendAsync("Answer", responseFormat: format); + } + else + { + await session.SendAsync(options); + } + var request = Assert.Single(server.Requests, r => r.Method == (api == "batch" ? "session.sendMessages" : "session.send")); + var wireFormat = request.Params.GetProperty("responseFormat"); + Assert.Equal("json_schema", wireFormat.GetProperty("type").GetString()); + var jsonSchema = wireFormat.GetProperty("jsonSchema"); + Assert.Equal(api == "session" ? "response" : "answer", jsonSchema.GetProperty("name").GetString()); + if (api == "session") + { + Assert.False(jsonSchema.TryGetProperty("description", out _)); + Assert.True(jsonSchema.GetProperty("strict").GetBoolean()); + } + else + { + Assert.Equal("An answer", jsonSchema.GetProperty("description").GetString()); + Assert.False(jsonSchema.GetProperty("strict").GetBoolean()); + } + Assert.Equal(document.RootElement.GetRawText(), jsonSchema.GetProperty("schema").GetRawText()); + + server.ClearRequests(); + await session.SendAsync("Ordinary text"); + Assert.False(Assert.Single(server.Requests, r => r.Method == "session.send").Params.TryGetProperty("responseFormat", out _)); + } + + [Fact] + public async Task StructuredOutput_Uses_Default_Custom_Tool_Serialization_Options() + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var task = session.SendAndWaitAsync("Answer"); + if (!JsonSerializer.IsReflectionEnabledByDefault) + { + await Assert.ThrowsAsync(() => task); + Assert.DoesNotContain(server.Requests, request => request.Method == "session.send"); + return; + } + var request = await WaitForRequestAsync(server, "session.send"); + var properties = request.Params.GetProperty("responseFormat").GetProperty("jsonSchema").GetProperty("schema").GetProperty("properties"); + Assert.True(properties.TryGetProperty("answer_text", out _)); + Assert.True(properties.TryGetProperty("count", out _)); + await SendStructuredAnswerAsync(server, session, "message-1", """{"answer_text":"correct","count":42}"""); + var result = await task.WaitAsync(TimeSpan.FromSeconds(5)); + Assert.Equal("correct", result.Answer); + Assert.Equal(42, result.Count); + } + + [Fact] + public async Task StructuredOutput_Infers_Schema_Using_Serialization_Contract() + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var options = new MessageOptions { Prompt = "Answer", RequestHeaders = new Dictionary { ["x-test"] = "preserved" } }; + var task = session.SendAndWaitAsync(options, StructuredOutputJsonContext.Default.Options); + var request = await WaitForRequestAsync(server, "session.send"); + Assert.Null(options.ResponseSchema); + Assert.Equal("preserved", request.Params.GetProperty("requestHeaders").GetProperty("x-test").GetString()); + var format = request.Params.GetProperty("responseFormat").GetProperty("jsonSchema"); + Assert.True(format.GetProperty("strict").GetBoolean()); + var schema = format.GetProperty("schema"); + var properties = schema.GetProperty("properties"); + Assert.True(properties.TryGetProperty("answer_text", out _)); + Assert.True(properties.TryGetProperty("count", out _)); + Assert.True(properties.TryGetProperty("note", out var note)); + Assert.Contains("null", note.GetProperty("type").EnumerateArray().Select(t => t.GetString())); + Assert.False(schema.GetProperty("additionalProperties").GetBoolean()); + Assert.Equal(3, schema.GetProperty("required").GetArrayLength()); + await SendStructuredAnswerAsync(server, session, "message-1", """{"answer_text":"correct","count":42,"note":null}"""); + var result = await task.WaitAsync(TimeSpan.FromSeconds(5)); + Assert.Equal("correct", result.Answer); + Assert.Equal(42, result.Count); + Assert.Null(result.Note); + } + + [Theory] + [InlineData("not JSON")] + [InlineData("""{"answer_text":"wrong","count":"not a number"}""")] + [InlineData("null")] + [InlineData("""{"count":42}""")] + public async Task StructuredOutput_Rejects_Unparseable_Or_Null_Result(string content) + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var task = session.SendAndWaitAsync("Answer", StructuredOutputJsonContext.Default.Options); + await WaitForRequestAsync(server, "session.send"); + await SendStructuredAnswerAsync(server, session, "message-1", content); + await Assert.ThrowsAsync(() => task.WaitAsync(TimeSpan.FromSeconds(5))); + } + + [Fact] + public async Task StructuredOutput_Rejects_Conflicting_Options_Before_Sending() + { + using var schema = JsonDocument.Parse("{}"); + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + await Assert.ThrowsAsync(() => session.SendAndWaitAsync( + new MessageOptions { Prompt = "Answer", Mode = "immediate" }, StructuredOutputJsonContext.Default.Options)); + await Assert.ThrowsAsync(() => session.SendAndWaitAsync( + new MessageOptions { Prompt = "Answer", ResponseSchema = schema.RootElement.Clone() }, StructuredOutputJsonContext.Default.Options)); + Assert.DoesNotContain(server.Requests, r => r.Method == "session.send"); + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task StructuredOutput_Correlates_Concurrent_Queued_Sends(bool typed) + { + await using var server = await FakeCopilotServer.StartAsync(); + server.UniqueMessageIds = true; + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + async Task SendAsync(string prompt) + { + if (typed) + { + return await session.SendAndWaitAsync(prompt, StructuredOutputJsonContext.Default.Options); + } + using var schema = JsonDocument.Parse("""{"type":"object","properties":{"answer_text":{"type":"string"},"count":{"type":"integer"}},"required":["answer_text","count"],"additionalProperties":false}"""); + var message = await session.SendAndWaitAsync(new MessageOptions { Prompt = prompt, ResponseSchema = schema.RootElement.Clone() }); + Assert.NotNull(message); + return JsonSerializer.Deserialize(message.Data.Content, StructuredOutputJsonContext.Default.StructuredAnswer)!; + } + var first = SendAsync("First"); + await WaitForRequestAsync(server, "session.send"); + server.ClearRequests(); + var second = SendAsync("Second"); + await WaitForRequestAsync(server, "session.send"); + + await SendStructuredAnswerAsync(server, session, "message-1", """{"answer_text":"first","count":1}"""); + Assert.Equal("first", (await first.WaitAsync(TimeSpan.FromSeconds(5))).Answer); + Assert.False(second.IsCompleted); + await SendStructuredAnswerAsync(server, session, "message-2", """{"answer_text":"second","count":2}"""); + Assert.Equal("second", (await second.WaitAsync(TimeSpan.FromSeconds(5))).Answer); + } + + [Fact] + public async Task StructuredOutput_Buffers_Events_Before_Send_Response() + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + server.BeforeSendResponse = messageId => + SendStructuredAnswerAsync(server, session, messageId, """{"answer_text":"early","count":42}"""); + var result = await session.SendAndWaitAsync( + "Answer", StructuredOutputJsonContext.Default.Options, TimeSpan.FromSeconds(5)); + Assert.Equal("early", result.Answer); + } + + [Fact] + public async Task StructuredOutput_Ignores_Idle_Until_Own_Message_Is_Consumed() + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var task = session.SendAndWaitAsync("Answer", StructuredOutputJsonContext.Default.Options); + await WaitForRequestAsync(server, "session.send"); + await server.SendSessionEventAsync(session.SessionId, "session.idle", new()); + await server.SendSessionEventAsync(session.SessionId, "session.error", new() + { + ["errorType"] = "provider", + ["message"] = "another turn failed", + }); + await SendStructuredAnswerAsync(server, session, "another-message", """{"answer_text":"wrong","count":0}"""); + await server.SendSessionEventAsync(session.SessionId, "user.message", new() + { + ["messageId"] = "message-1", + ["content"] = "Answer", + }, agentId: "subagent"); + await server.SendSessionEventAsync(session.SessionId, "session.idle", new()); + await SendStructuredAnswerAsync(server, session, "message-1", """{"answer_text":"correct","count":42}"""); + Assert.Equal("correct", (await task.WaitAsync(TimeSpan.FromSeconds(5))).Answer); + } + + [Fact] + public async Task StructuredOutput_Ignores_Subagent_Completion_And_Autopilot_Idle() + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var task = session.SendAndWaitAsync("Answer", StructuredOutputJsonContext.Default.Options); + await WaitForRequestAsync(server, "session.send"); + await server.SendSessionEventAsync(session.SessionId, "user.message", new() + { + ["messageId"] = "message-1", + ["content"] = "Answer", + }); + await server.SendSessionEventAsync(session.SessionId, "session.idle", new(), agentId: "subagent"); + await server.SendSessionEventAsync(session.SessionId, "session.error", new() + { + ["errorType"] = "provider", + ["message"] = "subagent failed", + }, agentId: "subagent"); + await server.SendSessionEventAsync(session.SessionId, "session.idle", new() { ["mode"] = "autopilot" }); + await SendStructuredAnswerAsync(server, session, "message-1", """{"answer_text":"correct","count":42}"""); + Assert.Equal("correct", (await task.WaitAsync(TimeSpan.FromSeconds(5))).Answer); + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task StructuredOutput_Rejects_Missing_Final_Response(bool toolOnly) + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var task = session.SendAndWaitAsync("Answer", StructuredOutputJsonContext.Default.Options); + await WaitForRequestAsync(server, "session.send"); + await server.SendSessionEventAsync(session.SessionId, "user.message", new() + { + ["messageId"] = "message-1", + ["content"] = "Answer", + }); + if (toolOnly) + { + await server.SendSessionEventAsync(session.SessionId, "assistant.message", new() + { + ["messageId"] = "tool-message", + ["originatingMessageId"] = "message-1", + ["content"] = """{"answer_text":"not final","count":42}""", + ["toolRequests"] = new[] { new Dictionary { ["toolCallId"] = "tool-1", ["name"] = "terminal_tool", ["arguments"] = new Dictionary() } }, + }); + } + await server.SendSessionEventAsync(session.SessionId, "session.idle", new()); + var error = await Assert.ThrowsAsync(() => task.WaitAsync(TimeSpan.FromSeconds(5))); + Assert.Contains("without a final structured response", error.Message); + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task StructuredOutput_Uses_Last_Correlated_Message_Not_Subagent_Or_Tool_Commentary(bool laterWorkAborted) + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var task = session.SendAndWaitAsync("Answer", StructuredOutputJsonContext.Default.Options); + await WaitForRequestAsync(server, "session.send"); + await server.SendSessionEventAsync(session.SessionId, "user.message", new() + { + ["messageId"] = "message-1", + ["content"] = "Answer", + }); + foreach (var (origin, content) in new[] + { + ("message-1", "First I will inspect the inventory."), + ("message-1", """{"answer_text":"final","count":42}"""), + ("subagent-message", """{"answer_text":"wrong","count":0}"""), + ("unrelated-queued-message", """{"answer_text":"also wrong","count":0}"""), + }) + { + await server.SendSessionEventAsync(session.SessionId, "assistant.message", new() + { + ["messageId"] = Guid.NewGuid().ToString(), + ["originatingMessageId"] = origin, + ["content"] = content, + }); + } + await server.SendSessionEventAsync(session.SessionId, "assistant.message", new() + { + ["messageId"] = "subagent-output", + ["originatingMessageId"] = "message-1", + ["content"] = """{"answer_text":"subagent must not win","count":0}""", + }, agentId: "subagent-1"); + await server.SendSessionEventAsync(session.SessionId, "session.idle", new() { ["aborted"] = laterWorkAborted }); + if (laterWorkAborted) + { + var error = await Assert.ThrowsAsync(() => task.WaitAsync(TimeSpan.FromSeconds(5))); + Assert.Contains("aborted", error.Message); + } + else + { + Assert.Equal("final", (await task.WaitAsync(TimeSpan.FromSeconds(5))).Answer); + } + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task StructuredOutput_Preserves_Timeout_And_Cancellation(bool cancel) + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + using var cts = new CancellationTokenSource(); + var task = session.SendAndWaitAsync("Answer", StructuredOutputJsonContext.Default.Options, + cancel ? TimeSpan.FromSeconds(10) : TimeSpan.FromMilliseconds(100), cts.Token); + await WaitForRequestAsync(server, "session.send"); + if (cancel) + { + cts.Cancel(); + await Assert.ThrowsAnyAsync(() => task); + } + else + { + await Assert.ThrowsAsync(() => task); + } + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task StructuredOutput_Propagates_Rpc_And_Session_Errors(bool rpcError) + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + if (rpcError) + { + server.FailSessionSend(); + } + var task = session.SendAndWaitAsync("Answer", StructuredOutputJsonContext.Default.Options); + await WaitForRequestAsync(server, "session.send"); + if (!rpcError) + { + await server.SendSessionEventAsync(session.SessionId, "user.message", new() + { + ["messageId"] = "message-1", + ["content"] = "Answer", + }); + await server.SendSessionEventAsync(session.SessionId, "session.error", new() + { + ["errorType"] = "provider", + ["message"] = "structured output unsupported", + }); + var error = await Assert.ThrowsAsync(() => task.WaitAsync(TimeSpan.FromSeconds(5))); + Assert.Contains("structured output unsupported", error.Message); + } + else + { + var error = await Assert.ThrowsAsync(() => task.WaitAsync(TimeSpan.FromSeconds(5))); + Assert.Contains("session send failed", error.Message); + } + } + + [Fact] + public async Task StructuredOutput_Can_Correlate_Without_User_Message_Event() + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var task = session.SendAndWaitAsync("Answer", StructuredOutputJsonContext.Default.Options); + await WaitForRequestAsync(server, "session.send"); + await server.SendSessionEventAsync(session.SessionId, "assistant.message", new() + { + ["messageId"] = "assistant-result", + ["originatingMessageId"] = "message-1", + ["content"] = """{"answer_text":"correct","count":42}""", + }); + await server.SendSessionEventAsync(session.SessionId, "session.idle", new()); + Assert.Equal("correct", (await task.WaitAsync(TimeSpan.FromSeconds(5))).Answer); + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task StructuredOutput_Rejects_When_Connection_Or_Session_Closes(bool disposeSession) + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var task = session.SendAndWaitAsync("Answer", StructuredOutputJsonContext.Default.Options); + await WaitForRequestAsync(server, "session.send"); + if (disposeSession) + { + await session.DisposeAsync(); + } + else + { + server.CloseConnection(); + } + try + { + await Assert.ThrowsAsync(() => task.WaitAsync(TimeSpan.FromSeconds(5))); + } + finally + { + // Graceful cleanup cannot wait for a peer whose transport was deliberately closed. + await client.ForceStopAsync(); + } + } + + [Fact] + public async Task StructuredOutput_Timeout_Includes_Send_Acknowledgement() + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var release = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + server.BeforeSendResponse = _ => release.Task; + try + { + await Assert.ThrowsAsync(() => session.SendAndWaitAsync( + "Answer", StructuredOutputJsonContext.Default.Options, TimeSpan.FromMilliseconds(100))); + } + finally + { + release.TrySetResult(); + } + } + + private static async Task SendStructuredAnswerAsync(FakeCopilotServer server, CopilotSession session, string messageId, string content) + { + await server.SendSessionEventAsync(session.SessionId, "user.message", new() + { + ["messageId"] = messageId, + ["content"] = "Answer", + }); + await server.SendSessionEventAsync(session.SessionId, "assistant.message", new() + { + ["messageId"] = Guid.NewGuid().ToString(), + ["originatingMessageId"] = messageId, + ["content"] = content, + }); + await server.SendSessionEventAsync(session.SessionId, "session.idle", new()); + } + + public sealed class StructuredAnswer + { + [JsonPropertyName("answer_text")] + public required string Answer { get; set; } + public int Count { get; set; } + public string? Note { get; set; } + } + + [JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] + [JsonSerializable(typeof(StructuredAnswer))] + internal sealed partial class StructuredOutputJsonContext : JsonSerializerContext; +} +#endif diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 3c9d2d46de..ce297873e3 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -176,6 +176,8 @@ type AgentGetCurrentResult struct { type AgentInfo struct { // Description of the agent's purpose Description string `json:"description"` + // Whether model-driven invocation is disabled for this agent. + DisableModelInvocation *bool `json:"disableModelInvocation,omitempty"` // Human-readable display name DisplayName string `json:"displayName"` // Stable identifier for selection. For most agents this is the same as `name`; for @@ -1414,7 +1416,8 @@ type CapiSessionOptions struct { // resume, the runtime restores the last committed preference. On resident resume, a // different value requests a safe switch after resume succeeds and cannot change an // in-flight turn. Successful switches are persisted for later cold resume. When no - // preference is supplied or restored, CAPI default routing is used. + // preference is supplied or restored, CAPI default routing is used. `fast` is an + // integrator-only latency preset, not a first-party GitHub Copilot product preference. AutoTier *AutoTier `json:"autoTier,omitempty"` // Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when // the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses @@ -3219,6 +3222,8 @@ type ExternalToolTextResultForLlmContentResourceLinkIcon struct { // Experimental: FactoryAbortRequest is part of an experimental API and may change or be // removed. type FactoryAbortRequest struct { + // Opaque token identifying the execution attempt to abort. + ExecutionToken string `json:"executionToken"` // Factory run identifier. RunID string `json:"runId"` // Target session identifier @@ -3235,15 +3240,15 @@ type FactoryAckResult struct { // Experimental: FactoryAgentOptions is part of an experimental API and may change or be // removed. type FactoryAgentOptions struct { - // Optional custom agent name for the subagent. This field is accepted but not yet honored. + // Optional built-in or custom agent name whose definition configures the subagent. Agent *string `json:"agent,omitempty"` - // Optional context tier for the subagent. This field is accepted but not yet honored. + // Optional context tier override for the subagent. ContextTier *ContextTier `json:"contextTier,omitempty"` // Optional label distinguishing otherwise identical memoized agent calls. Label *string `json:"label,omitempty"` // Optional model identifier for the subagent. Model *string `json:"model,omitempty"` - // Optional reasoning effort for the subagent. This field is accepted but not yet honored. + // Optional reasoning effort override for the subagent. ReasoningEffort *string `json:"reasoningEffort,omitempty"` // Optional JSON Schema for structured agent output. Schema any `json:"schema,omitempty"` @@ -3472,6 +3477,69 @@ type FactoryLogRequest struct { RunID string `json:"runId"` } +// Parameters for an owned durable pause checkpoint. +// Experimental: FactoryPauseCheckpointRequest is part of an experimental API and may change +// or be removed. +type FactoryPauseCheckpointRequest struct { + // Opaque token identifying the execution attempt that reached the checkpoint. + ExecutionToken string `json:"executionToken"` + // Stable author-defined checkpoint key. + Key string `json:"key"` + // Factory run identifier. + RunID string `json:"runId"` +} + +// Experimental: FactoryPauseCheckpointResult is part of an experimental API and may change +// or be removed. +type FactoryPauseCheckpointResult struct { + // Whether this execution attempt must pause or may continue. + Action FactoryPauseCheckpointAction `json:"action"` +} + +// Durable metadata describing who initiated a factory pause. +// Experimental: FactoryPauseInfo is part of an experimental API and may change or be +// removed. +type FactoryPauseInfo interface { + factoryPauseInfo() + Type() FactoryPauseInfoType +} + +type RawFactoryPauseInfoData struct { + Discriminator FactoryPauseInfoType + Raw json.RawMessage +} + +func (RawFactoryPauseInfoData) factoryPauseInfo() {} +func (r RawFactoryPauseInfoData) Type() FactoryPauseInfoType { + return r.Discriminator +} + +type FactoryPauseInfoCheckpoint struct { + // Stable author-defined checkpoint key that initiated the pause. + Key string `json:"key"` +} + +func (FactoryPauseInfoCheckpoint) factoryPauseInfo() {} +func (FactoryPauseInfoCheckpoint) Type() FactoryPauseInfoType { + return FactoryPauseInfoTypeCheckpoint +} + +type FactoryPauseInfoUser struct { +} + +func (FactoryPauseInfoUser) factoryPauseInfo() {} +func (FactoryPauseInfoUser) Type() FactoryPauseInfoType { + return FactoryPauseInfoTypeUser +} + +// Parameters for pausing a running factory. +// Experimental: FactoryPauseRequest is part of an experimental API and may change or be +// removed. +type FactoryPauseRequest struct { + // Factory run identifier. + RunID string `json:"runId"` +} + // Durable lifecycle and timing for one factory phase. // Experimental: FactoryPhaseObservation is part of an experimental API and may change or be // removed. @@ -3589,6 +3657,8 @@ type FactoryRunDetail struct { Agents []FactoryAgentSummary `json:"agents"` // Approved effective resource ceilings, or null until approved. Approved *FactoryDeclaredLimits `json:"approved"` + // Whether the durable run state currently passes runtime resume eligibility checks. + CanResume bool `json:"canResume"` // Epoch milliseconds when the run completed, or null while nonterminal. CompletedAt *int64 `json:"completedAt"` // Durable resource consumption. @@ -3679,6 +3749,8 @@ type FactoryRunFailureFactoryLimitReached struct { Kind FactoryRunFailureKind `json:"kind"` // Factory run identifier. RunID string `json:"runId"` + // Suggested larger ceiling when the runtime can derive one safely. + SuggestedValue *float64 `json:"suggestedValue,omitempty"` // Approved effective ceiling that was reached. Value float64 `json:"value"` } @@ -3752,6 +3824,8 @@ type FactoryRunResult struct { Error *string `json:"error,omitempty"` // Machine-readable failure details for a halted or errored run. Failure FactoryRunFailure `json:"failure,omitempty"` + // Structured pause initiator metadata for a paused attempt. + PauseInfo FactoryPauseInfo `json:"pauseInfo,omitempty"` // Reason for a halted or cancelled run. Reason *string `json:"reason,omitempty"` // Completed factory result. @@ -3772,6 +3846,8 @@ type FactoryRunSummary struct { ActiveSegmentStartedAt *int64 `json:"activeSegmentStartedAt"` // Approved effective resource ceilings, or null until approved. Approved *FactoryDeclaredLimits `json:"approved"` + // Whether the durable run state currently passes runtime resume eligibility checks. + CanResume bool `json:"canResume"` // Epoch milliseconds when the run completed, or null while nonterminal. CompletedAt *int64 `json:"completedAt"` // Durable resource consumption. @@ -3816,6 +3892,8 @@ type FactoryRunTerminal struct { Error *string `json:"error,omitempty"` // Machine-readable terminal failure. Failure FactoryRunFailure `json:"failure,omitempty"` + // Pause initiator metadata, or null when the run did not pause. + PauseInfo FactoryPauseInfo `json:"pauseInfo"` // Human-readable terminal reason. Reason *string `json:"reason,omitempty"` // Prompt-safe preview of the completed result. @@ -4616,6 +4694,24 @@ type InterruptMainTurnResult struct { Interrupted bool `json:"interrupted"` } +// A JSON Schema output contract. OpenAI receives the name, description, schema and strict +// setting; Anthropic receives the schema in output_config.format and always uses its native +// strict enforcement. +// Experimental: JSONSchemaResponseFormat is part of an experimental API and may change or +// be removed. +type JSONSchemaResponseFormat struct { + // Optional description passed to OpenAI providers. + Description *string `json:"description,omitempty"` + // Name of the output schema, subject to the provider's naming restrictions. + Name string `json:"name"` + // JSON Schema passed unchanged to the inference provider. Supported keywords and schema + // restrictions are determined by that provider. + Schema any `json:"schema"` + // Optional strict enforcement setting for OpenAI providers. Omitted uses the provider + // default. Anthropic always enforces its supported schema subset. + Strict *bool `json:"strict,omitempty"` +} + // HTTP headers as a map from lowercased header name to a list of values. Multi-valued // headers (e.g. Set-Cookie) preserve all values. // Experimental: LlmInferenceHeaders is part of an experimental API and may change or be @@ -7339,6 +7435,36 @@ type ModelPolicy struct { Terms *string `json:"terms,omitempty"` } +// Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are +// intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs +// remain exempt from repository-only policy but are restricted by this host list. Omit or +// pass null to clear the host restriction; an explicit empty or disjoint list is rejected. +// Validation and pre-selection fallback failures preserve the previous restriction. +// Failures after a fallback selection commits retain the new restriction and selected +// model; callers should inspect current session state after such an error. +// Experimental: ModelSetAllowedModelsRequest is part of an experimental API and may change +// or be removed. +type ModelSetAllowedModelsRequest struct { + // Exact model IDs to permit, or null to clear the host restriction. + AllowedModels []string `json:"allowedModels,omitzero"` +} + +// The applied host allowlist and effective session model policy after intersection. +// Experimental: ModelSetAllowedModelsResult is part of an experimental API and may change +// or be removed. +type ModelSetAllowedModelsResult struct { + // Normalized host allowlist. Omitted when the host restriction was cleared, or when a relay + // client does not return the host policy. + AllowedModels []string `json:"allowedModels,omitzero"` + // Effective exact IDs or repository policy patterns after applying the host restriction. + // Omitted by relay clients that do not return the host policy. + EffectiveAllowedModels []string `json:"effectiveAllowedModels,omitzero"` + // Effective deterministic fallback model, when the policy defines one. + FallbackModel *string `json:"fallbackModel,omitempty"` + // Selected session model after reconciling a now-disallowed concrete selection. + ModelID *string `json:"modelId,omitempty"` +} + // Reasoning effort level to apply to the currently selected model. // Experimental: ModelSetReasoningEffortRequest is part of an experimental API and may // change or be removed. @@ -9100,7 +9226,8 @@ type PluginsBuiltinSetRequest struct { type PluginsBuiltinSetResult struct { } -// Plugin names (or specs) to disable. +// Plugin names (or specs) to disable, plus the optional working directory the +// repository-controlled guard is evaluated against. // Experimental: PluginsDisableRequest is part of an experimental API and may change or be // removed. type PluginsDisableRequest struct { @@ -9109,6 +9236,12 @@ type PluginsDisableRequest struct { // Plugin-owned MCP servers are stopped in active sessions immediately; other plugin // contributions remain available until each session reloads plugins. Names []string `json:"names"` + // Working directory whose repository `enabledPlugins` overlay decides whether this mutation + // is repository-controlled. Hosts that serve sessions across several repositories (the SDK + // server) should pass the session's directory; otherwise the guard is evaluated against the + // server process's own working directory, which may belong to a different repository. + // Defaults to the server's current working directory. + WorkingDirectory *string `json:"workingDirectory,omitempty"` } // Experimental: PluginsDisableResult is part of an experimental API and may change or be @@ -9116,13 +9249,20 @@ type PluginsDisableRequest struct { type PluginsDisableResult struct { } -// Plugin names (or specs) to enable. +// Plugin names (or specs) to enable, plus the optional working directory the +// repository-controlled guard is evaluated against. // Experimental: PluginsEnableRequest is part of an experimental API and may change or be // removed. type PluginsEnableRequest struct { // Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. // Non-marketplace direct installs are always enabled and cannot be toggled via this API. Names []string `json:"names"` + // Working directory whose repository `enabledPlugins` overlay decides whether this mutation + // is repository-controlled. Hosts that serve sessions across several repositories (the SDK + // server) should pass the session's directory; otherwise the guard is evaluated against the + // server process's own working directory, which may belong to a different repository. + // Defaults to the server's current working directory. + WorkingDirectory *string `json:"workingDirectory,omitempty"` } // Experimental: PluginsEnableResult is part of an experimental API and may change or be @@ -10442,6 +10582,14 @@ type RemoteSessionRepository struct { Owner string `json:"owner"` } +// Experimental: ResponseFormat is part of an experimental API and may change or be removed. +type ResponseFormat struct { + // JSON Schema and provider options for the turn's output. + JSONSchema JSONSchemaResponseFormat `json:"jsonSchema"` + // Output format discriminator. Currently only json_schema is supported. + Type ResponseFormatType `json:"type"` +} + // Options controlling factory invocation. // Experimental: RunOptions is part of an experimental API and may change or be removed. type RunOptions struct { @@ -10625,6 +10773,28 @@ type SandboxConfigUserPolicySeatbelt struct { KeychainAccess *bool `json:"keychainAccess,omitempty"` } +// Request to disable sandboxing for the current session while resolving an active +// sandbox-bypass permission prompt. +// Experimental: SandboxDisableForSessionRequest is part of an experimental API and may +// change or be removed. +type SandboxDisableForSessionRequest struct { + // Optional attribution for the permission decision. + DecisionContext *PermissionDecisionContext `json:"decisionContext,omitempty"` + // Identifier of the exact pending sandbox-bypass permission request that authorized the + // session opt-out. + RequestID string `json:"requestId"` +} + +// Result of attempting to disable sandboxing for the current session. +// Experimental: SandboxDisableForSessionResult is part of an experimental API and may +// change or be removed. +type SandboxDisableForSessionResult struct { + // The authoritative sandbox enabled state after the operation. + Enabled bool `json:"enabled"` + // Whether this call resolved the pending request and applied the session opt-out. + Success bool `json:"success"` +} + // Managed sandbox enforcement state for a session. // Experimental: SandboxEnforcementStatus is part of an experimental API and may change or // be removed. @@ -10848,6 +11018,12 @@ type SendMessagesRequest struct { // session-level provider headers; per-turn headers augment and overwrite session-level // headers with the same key. RequestHeaders map[string]string `json:"requestHeaders,omitzero"` + // Provider-native output format for the whole turn, including an empty message batch and + // all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering + // inherits the active format; specifying responseFormat with mode: immediate is an error, + // even while idle. Returned assistant content remains text; the runtime does not parse or + // validate it. Unsupported models or schemas produce provider errors. + ResponseFormat *ResponseFormat `json:"responseFormat,omitempty"` // W3C Trace Context traceparent header for distributed tracing of this agent turn Traceparent *string `json:"traceparent,omitempty"` // W3C Trace Context tracestate header for distributed tracing @@ -10901,6 +11077,12 @@ type SendRequest struct { // If set, the request will fail if the named tool is not available when this message is // among the user messages at the start of the current exchange RequiredTool *string `json:"requiredTool,omitempty"` + // Provider-native output format for this turn, including all tool-call iterations. Not + // inherited by later turns or subagents. Ordinary steering inherits the active format; + // specifying responseFormat with mode: immediate is an error, even while idle. Returned + // assistant content remains text; the runtime does not parse or validate it. Unsupported + // models or schemas produce provider errors. + ResponseFormat *ResponseFormat `json:"responseFormat,omitempty"` // Optional provenance tag copied to the resulting user.message event. Must be `user`, // `system`, `command-` for command-originated messages, `schedule-` // for scheduled prompts, or `agent-` for prompts sent by another agent. @@ -11321,6 +11503,13 @@ type SessionExtensionsReloadResult struct { type SessionExtensionsSendAttachmentsToMessageResult struct { } +// Experimental: SessionFactoryPauseAtCheckpointResult is part of an experimental API and +// may change or be removed. +type SessionFactoryPauseAtCheckpointResult struct { + // Whether this execution attempt must pause or may continue. + Action FactoryPauseCheckpointAction `json:"action"` +} + // File path, content to append, and optional mode for the client-provided session // filesystem. // Experimental: SessionFSAppendFileRequest is part of an experimental API and may change or @@ -16505,7 +16694,8 @@ const ( AutopilotObjectiveStatusPaused AutopilotObjectiveStatus = "paused" ) -// Routing preference used when the session model is `auto`. +// Routing preference used when the session model is `auto`. `fast` is an integrator-only +// latency preset and is not a first-party GitHub Copilot product preference. // Experimental: AutoTier is part of an experimental API and may change or be removed. type AutoTier string @@ -16514,6 +16704,8 @@ const ( AutoTierBalance AutoTier = "balance" // Optimize for efficiency. AutoTierEfficiency AutoTier = "efficiency" + // Integrator-only preset that optimizes for latency. + AutoTierFast AutoTier = "fast" // Optimize for intelligence. AutoTierIntelligence AutoTier = "intelligence" ) @@ -17208,6 +17400,26 @@ const ( FactoryLogLineKindPhase FactoryLogLineKind = "phase" ) +// Action the runtime selected for a durable factory pause checkpoint. +// Experimental: FactoryPauseCheckpointAction is part of an experimental API and may change +// or be removed. +type FactoryPauseCheckpointAction string + +const ( + // The checkpoint was committed by a prior paused attempt, so execution may continue. + FactoryPauseCheckpointActionContinue FactoryPauseCheckpointAction = "continue" + // This attempt claimed the checkpoint and must cooperatively stop. + FactoryPauseCheckpointActionPause FactoryPauseCheckpointAction = "pause" +) + +// Type discriminator for FactoryPauseInfo. +type FactoryPauseInfoType string + +const ( + FactoryPauseInfoTypeCheckpoint FactoryPauseInfoType = "checkpoint" + FactoryPauseInfoTypeUser FactoryPauseInfoType = "user" +) + // Derived lifecycle state of a factory phase. // Experimental: FactoryPhaseStatus is part of an experimental API and may change or be // removed. @@ -17265,6 +17477,8 @@ const ( FactoryRunStatusError FactoryRunStatus = "error" // The run was interrupted while resource budget remained. FactoryRunStatusHalted FactoryRunStatus = "halted" + // The current attempt stopped intentionally and the run may be resumed. + FactoryRunStatusPaused FactoryRunStatus = "paused" // The run was minted and is awaiting approval. FactoryRunStatusPending FactoryRunStatus = "pending" // The run is executing. @@ -18814,6 +19028,13 @@ const ( RemoteSessionModeOn RemoteSessionMode = "on" ) +// Output format discriminator. Currently only json_schema is supported. +type ResponseFormatType string + +const ( + ResponseFormatTypeJSONSchema ResponseFormatType = "json_schema" +) + // Origin of the sandbox choice supplied by an internal client. // Experimental: SandboxConfigSource is part of an experimental API and may change or be // removed. @@ -20549,7 +20770,8 @@ type ServerPluginsAPI serverAPI // // RPC method: plugins.disable. // -// Parameters: Plugin names (or specs) to disable. +// Parameters: Plugin names (or specs) to disable, plus the optional working directory the +// repository-controlled guard is evaluated against. func (a *ServerPluginsAPI) Disable(ctx context.Context, params *PluginsDisableRequest) (*PluginsDisableResult, error) { raw, err := a.client.Request(ctx, "plugins.disable", params) if err != nil { @@ -20566,7 +20788,8 @@ func (a *ServerPluginsAPI) Disable(ctx context.Context, params *PluginsDisableRe // // RPC method: plugins.enable. // -// Parameters: Plugin names (or specs) to enable. +// Parameters: Plugin names (or specs) to enable, plus the optional working directory the +// repository-controlled guard is evaluated against. func (a *ServerPluginsAPI) Enable(ctx context.Context, params *PluginsEnableRequest) (*PluginsEnableResult, error) { raw, err := a.client.Request(ctx, "plugins.enable", params) if err != nil { @@ -22888,6 +23111,29 @@ func (a *FactoryAPI) Log(ctx context.Context, params *FactoryLogRequest) (*Facto return &result, nil } +// Pauses a running factory and returns its settled run envelope. +// +// RPC method: session.factory.pause. +// +// Parameters: Parameters for pausing a running factory. +// +// Returns: Complete current or terminal factory run envelope. +func (a *FactoryAPI) Pause(ctx context.Context, params *FactoryPauseRequest) (*FactoryRunResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["runId"] = params.RunID + } + raw, err := a.client.Request(ctx, "session.factory.pause", req) + if err != nil { + return nil, err + } + var result FactoryRunResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Resumes a factory run using its persisted name, arguments, journal, and accounting. // // RPC method: session.factory.resume. @@ -24532,6 +24778,39 @@ func (a *ModelAPI) List(ctx context.Context, params ...*SessionModelListRequest) return &result, nil } +// SetAllowedModels replaces or clears the host-supplied model allowlist for a running +// session. +// +// RPC method: session.model.setAllowedModels. +// +// Parameters: Host-supplied exact model selection IDs to allow for this running session. +// CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; +// provider-qualified IDs remain exempt from repository-only policy but are restricted by +// this host list. Omit or pass null to clear the host restriction; an explicit empty or +// disjoint list is rejected. Validation and pre-selection fallback failures preserve the +// previous restriction. Failures after a fallback selection commits retain the new +// restriction and selected model; callers should inspect current session state after such +// an error. +// +// Returns: The applied host allowlist and effective session model policy after intersection. +func (a *ModelAPI) SetAllowedModels(ctx context.Context, params *ModelSetAllowedModelsRequest) (*ModelSetAllowedModelsResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + if params.AllowedModels != nil { + req["allowedModels"] = params.AllowedModels + } + } + raw, err := a.client.Request(ctx, "session.model.setAllowedModels", req) + if err != nil { + return nil, err + } + var result ModelSetAllowedModelsResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // SetReasoningEffort updates the session's reasoning effort without changing the selected // model. // @@ -26032,6 +26311,36 @@ func (a *RemoteAPI) NotifySteerableChanged(ctx context.Context, params *RemoteNo // Experimental: SandboxAPI contains experimental APIs that may change or be removed. type SandboxAPI sessionAPI +// DisableForSession disables sandboxing for the remainder of the current session and +// approves the referenced pending sandbox-bypass permission request. The request is +// rejected unless the exact request is still pending and the effective sandbox policy +// permits bypass. +// +// RPC method: session.sandbox.disableForSession. +// +// Parameters: Request to disable sandboxing for the current session while resolving an +// active sandbox-bypass permission prompt. +// +// Returns: Result of attempting to disable sandboxing for the current session. +func (a *SandboxAPI) DisableForSession(ctx context.Context, params *SandboxDisableForSessionRequest) (*SandboxDisableForSessionResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + if params.DecisionContext != nil { + req["decisionContext"] = *params.DecisionContext + } + req["requestId"] = params.RequestID + } + raw, err := a.client.Request(ctx, "session.sandbox.disableForSession", req) + if err != nil { + return nil, err + } + var result SandboxDisableForSessionResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // GetEnforcementStatus returns whether managed policy requires sandbox enforcement and // whether an enforcement failure has permanently blocked the session. // @@ -27827,6 +28136,9 @@ func (a *SessionRPC) Send(ctx context.Context, params *SendRequest) (*SendResult if params.RequiredTool != nil { req["requiredTool"] = *params.RequiredTool } + if params.ResponseFormat != nil { + req["responseFormat"] = *params.ResponseFormat + } if params.Source != nil { req["source"] = *params.Source } @@ -27882,6 +28194,9 @@ func (a *SessionRPC) SendMessages(ctx context.Context, params *SendMessagesReque if params.RequestHeaders != nil { req["requestHeaders"] = params.RequestHeaders } + if params.ResponseFormat != nil { + req["responseFormat"] = *params.ResponseFormat + } if params.Traceparent != nil { req["traceparent"] = *params.Traceparent } @@ -28097,6 +28412,31 @@ func (a *InternalCommandsAPI) FinalizeInvocationEffect(ctx context.Context, para // Experimental: InternalFactoryAPI contains experimental APIs that may change or be removed. type InternalFactoryAPI internalSessionAPI +// PauseAtCheckpoint atomically pauses an owned factory attempt at a durable checkpoint. +// +// RPC method: session.factory.pauseAtCheckpoint. +// +// Parameters: Parameters for an owned durable pause checkpoint. +// Internal: PauseAtCheckpoint is part of the SDK's internal handshake/plumbing; external +// callers should not use it. +func (a *InternalFactoryAPI) PauseAtCheckpoint(ctx context.Context, params *FactoryPauseCheckpointRequest) (*SessionFactoryPauseAtCheckpointResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["executionToken"] = params.ExecutionToken + req["key"] = params.Key + req["runId"] = params.RunID + } + raw, err := a.client.Request(ctx, "session.factory.pauseAtCheckpoint", req) + if err != nil { + return nil, err + } + var result SessionFactoryPauseAtCheckpointResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // ResumeFromTool internal tool-originated factory resume. // // RPC method: session.factory.resumeFromTool. diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go index 13d190be22..d86f0040ff 100644 --- a/go/rpc/zrpc_encoding.go +++ b/go/rpc/zrpc_encoding.go @@ -1689,10 +1689,74 @@ func (r FactoryRunFailureFactoryResumeDeclined) MarshalJSON() ([]byte, error) { }) } +func unmarshalFactoryPauseInfo(data []byte) (FactoryPauseInfo, error) { + if string(data) == "null" { + return nil, nil + } + type rawUnion struct { + Type FactoryPauseInfoType `json:"type"` + } + var raw rawUnion + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + switch raw.Type { + case FactoryPauseInfoTypeCheckpoint: + var d FactoryPauseInfoCheckpoint + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case FactoryPauseInfoTypeUser: + var d FactoryPauseInfoUser + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + default: + return &RawFactoryPauseInfoData{Discriminator: raw.Type, Raw: data}, nil + } +} + +func (r RawFactoryPauseInfoData) MarshalJSON() ([]byte, error) { + if r.Raw != nil { + return r.Raw, nil + } + return json.Marshal(struct { + Type FactoryPauseInfoType `json:"type"` + }{ + Type: r.Discriminator, + }) +} + +func (r FactoryPauseInfoCheckpoint) MarshalJSON() ([]byte, error) { + type alias FactoryPauseInfoCheckpoint + return json.Marshal(struct { + Type FactoryPauseInfoType `json:"type"` + alias + }{ + Type: r.Type(), + alias: alias(r), + }) +} + +func (r FactoryPauseInfoUser) MarshalJSON() ([]byte, error) { + type alias FactoryPauseInfoUser + return json.Marshal(struct { + Type FactoryPauseInfoType `json:"type"` + alias + }{ + Type: r.Type(), + alias: alias(r), + }) +} + func (r *FactoryRunTerminal) UnmarshalJSON(data []byte) error { type rawFactoryRunTerminal struct { Error *string `json:"error,omitempty"` Failure json.RawMessage `json:"failure,omitempty"` + PauseInfo json.RawMessage `json:"pauseInfo"` Reason *string `json:"reason,omitempty"` ResultPreview *string `json:"resultPreview,omitempty"` } @@ -1708,6 +1772,13 @@ func (r *FactoryRunTerminal) UnmarshalJSON(data []byte) error { } r.Failure = value } + if raw.PauseInfo != nil { + value, err := unmarshalFactoryPauseInfo(raw.PauseInfo) + if err != nil { + return err + } + r.PauseInfo = value + } r.Reason = raw.Reason r.ResultPreview = raw.ResultPreview return nil @@ -1715,14 +1786,15 @@ func (r *FactoryRunTerminal) UnmarshalJSON(data []byte) error { func (r *FactoryRunResult) UnmarshalJSON(data []byte) error { type rawFactoryRunResult struct { - Attempt *int64 `json:"attempt,omitempty"` - Error *string `json:"error,omitempty"` - Failure json.RawMessage `json:"failure,omitempty"` - Reason *string `json:"reason,omitempty"` - Result any `json:"result,omitempty"` - RunID string `json:"runId"` - Snapshot any `json:"snapshot,omitempty"` - Status FactoryRunStatus `json:"status"` + Attempt *int64 `json:"attempt,omitempty"` + Error *string `json:"error,omitempty"` + Failure json.RawMessage `json:"failure,omitempty"` + PauseInfo json.RawMessage `json:"pauseInfo,omitempty"` + Reason *string `json:"reason,omitempty"` + Result any `json:"result,omitempty"` + RunID string `json:"runId"` + Snapshot any `json:"snapshot,omitempty"` + Status FactoryRunStatus `json:"status"` } var raw rawFactoryRunResult if err := json.Unmarshal(data, &raw); err != nil { @@ -1737,6 +1809,13 @@ func (r *FactoryRunResult) UnmarshalJSON(data []byte) error { } r.Failure = value } + if raw.PauseInfo != nil { + value, err := unmarshalFactoryPauseInfo(raw.PauseInfo) + if err != nil { + return err + } + r.PauseInfo = value + } r.Reason = raw.Reason r.Result = raw.Result r.RunID = raw.RunID @@ -5112,6 +5191,7 @@ func (r *SendRequest) UnmarshalJSON(data []byte) error { Prompt string `json:"prompt"` RequestHeaders map[string]string `json:"requestHeaders,omitzero"` RequiredTool *string `json:"requiredTool,omitempty"` + ResponseFormat *ResponseFormat `json:"responseFormat,omitempty"` Source *string `json:"source,omitempty"` Traceparent *string `json:"traceparent,omitempty"` Tracestate *string `json:"tracestate,omitempty"` @@ -5139,6 +5219,7 @@ func (r *SendRequest) UnmarshalJSON(data []byte) error { r.Prompt = raw.Prompt r.RequestHeaders = raw.RequestHeaders r.RequiredTool = raw.RequiredTool + r.ResponseFormat = raw.ResponseFormat r.Source = raw.Source r.Traceparent = raw.Traceparent r.Tracestate = raw.Tracestate diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index a220b79ad5..db4db7f740 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -389,6 +389,12 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionAutoTierRecommendation: + var d SessionAutoTierRecommendationData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionAutoTierSwitchFailed: var d SessionAutoTierSwitchFailedData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -1562,6 +1568,107 @@ func (r SystemNotificationAgentIdle) MarshalJSON() ([]byte, error) { }) } +func unmarshalSystemNotificationFactoryPauseInfo(data []byte) (SystemNotificationFactoryPauseInfo, error) { + if string(data) == "null" { + return nil, nil + } + type rawUnion struct { + Type SystemNotificationFactoryPauseInfoType `json:"type"` + } + var raw rawUnion + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + switch raw.Type { + case SystemNotificationFactoryPauseInfoTypeCheckpoint: + var d SystemNotificationFactoryPauseInfoCheckpoint + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case SystemNotificationFactoryPauseInfoTypeUser: + var d SystemNotificationFactoryPauseInfoUser + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + default: + return &RawSystemNotificationFactoryPauseInfo{Discriminator: raw.Type, Raw: data}, nil + } +} + +func (r RawSystemNotificationFactoryPauseInfo) MarshalJSON() ([]byte, error) { + if r.Raw != nil { + return r.Raw, nil + } + return json.Marshal(struct { + Type SystemNotificationFactoryPauseInfoType `json:"type"` + }{ + Type: r.Discriminator, + }) +} + +func (r SystemNotificationFactoryPauseInfoCheckpoint) MarshalJSON() ([]byte, error) { + type alias SystemNotificationFactoryPauseInfoCheckpoint + return json.Marshal(struct { + Type SystemNotificationFactoryPauseInfoType `json:"type"` + alias + }{ + Type: r.Type(), + alias: alias(r), + }) +} + +func (r SystemNotificationFactoryPauseInfoUser) MarshalJSON() ([]byte, error) { + type alias SystemNotificationFactoryPauseInfoUser + return json.Marshal(struct { + Type SystemNotificationFactoryPauseInfoType `json:"type"` + alias + }{ + Type: r.Type(), + alias: alias(r), + }) +} + +func (r *SystemNotificationFactoryCompleted) UnmarshalJSON(data []byte) error { + type rawSystemNotificationFactoryCompleted struct { + Attempt int64 `json:"attempt"` + ConsumedNanoAiu int64 `json:"consumedNanoAiu"` + ConsumedSubagents int64 `json:"consumedSubagents"` + ElapsedMs int64 `json:"elapsedMs"` + FactoryName string `json:"factoryName"` + Failure any `json:"failure,omitempty"` + PauseInfo json.RawMessage `json:"pauseInfo,omitempty"` + ResultPreview *string `json:"resultPreview,omitempty"` + RetryGuidance *string `json:"retryGuidance,omitempty"` + RunID string `json:"runId"` + Status SystemNotificationFactoryCompletedStatus `json:"status"` + } + var raw rawSystemNotificationFactoryCompleted + if err := json.Unmarshal(data, &raw); err != nil { + return err + } + r.Attempt = raw.Attempt + r.ConsumedNanoAiu = raw.ConsumedNanoAiu + r.ConsumedSubagents = raw.ConsumedSubagents + r.ElapsedMs = raw.ElapsedMs + r.FactoryName = raw.FactoryName + r.Failure = raw.Failure + if raw.PauseInfo != nil { + value, err := unmarshalSystemNotificationFactoryPauseInfo(raw.PauseInfo) + if err != nil { + return err + } + r.PauseInfo = value + } + r.ResultPreview = raw.ResultPreview + r.RetryGuidance = raw.RetryGuidance + r.RunID = raw.RunID + r.Status = raw.Status + return nil +} + func (r SystemNotificationFactoryCompleted) MarshalJSON() ([]byte, error) { type alias SystemNotificationFactoryCompleted return json.Marshal(struct { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 2874e1f59b..0ad16a63e1 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -128,8 +128,11 @@ const ( // that may change or be removed. SessionEventTypeSessionAutoModeResolved SessionEventType = "session.auto_mode_resolved" SessionEventTypeSessionAutopilotObjectiveChanged SessionEventType = "session.autopilot_objective_changed" - SessionEventTypeSessionAutoTierSwitchFailed SessionEventType = "session.auto_tier_switch_failed" - SessionEventTypeSessionBackgroundTasksChanged SessionEventType = "session.background_tasks_changed" + // Experimental: SessionEventTypeSessionAutoTierRecommendation identifies an experimental + // event that may change or be removed. + SessionEventTypeSessionAutoTierRecommendation SessionEventType = "session.auto_tier_recommendation" + SessionEventTypeSessionAutoTierSwitchFailed SessionEventType = "session.auto_tier_switch_failed" + SessionEventTypeSessionBackgroundTasksChanged SessionEventType = "session.background_tasks_changed" // Experimental: SessionEventTypeSessionBinaryAsset identifies an experimental event that // may change or be removed. SessionEventTypeSessionBinaryAsset SessionEventType = "session.binary_asset" @@ -383,6 +386,8 @@ type AssistantMessageData struct { MessageID string `json:"messageId"` // Model that produced this assistant message, if known Model *string `json:"model,omitempty"` + // Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. + OriginatingMessageID *string `json:"originatingMessageId,omitempty"` // Actual output token count from the API response (completion_tokens), used for accurate token accounting OutputTokens *int64 `json:"outputTokens,omitempty"` // Tool call ID of the parent tool invocation when this event originates from a sub-agent @@ -583,6 +588,9 @@ func (*SessionContextClearedData) Type() SessionEventType { // Conversation compaction results including success status, metrics, and optional error details type SessionCompactionCompleteData struct { + // Authoritative active-factory reminder appended to the compacted context + // Internal: ActiveFactorySummary is part of the SDK's internal API surface and is not intended for external use. + ActiveFactorySummary *string `json:"activeFactorySummary,omitempty"` // Canonical model identifier used for model-specific behavior when replaying compaction BehaviorModelID *string `json:"behaviorModelId,omitempty"` // Checkpoint snapshot number created for recovery @@ -1483,6 +1491,18 @@ func (*AssistantServerToolProgressData) Type() SessionEventType { return SessionEventTypeAssistantServerToolProgress } +// Live-only Auto preference recommendation from Copilot API after a successful Auto model call. +// Experimental: SessionAutoTierRecommendationData is part of an experimental API and may change or be removed. +type SessionAutoTierRecommendationData struct { + // Recommended Auto preference. + RecommendedAutoTier RecommendedAutoTier `json:"recommendedAutoTier"` +} + +func (*SessionAutoTierRecommendationData) sessionEventData() {} +func (*SessionAutoTierRecommendationData) Type() SessionEventType { + return SessionEventTypeSessionAutoTierRecommendation +} + // MCP App view called a tool on a connected MCP server (SEP-1865) type MCPAppToolCallCompleteData struct { // Arguments passed to the tool by the app view, if any @@ -1985,10 +2005,10 @@ type SessionPermissionsChangedData struct { AssistedApprovalModel *string `json:"assistedApprovalModel,omitempty"` // Permission mode after the change // Experimental: Mode is part of an experimental API and may change or be removed. - Mode PermissionMode `json:"mode"` + Mode *PermissionMode `json:"mode,omitempty"` // Permission mode before the change // Experimental: PreviousMode is part of an experimental API and may change or be removed. - PreviousMode PermissionMode `json:"previousMode"` + PreviousMode *PermissionMode `json:"previousMode,omitempty"` } func (*SessionPermissionsChangedData) sessionEventData() {} @@ -2642,6 +2662,8 @@ type SubagentStartedData struct { ParentID *string `json:"parentId,omitempty"` // Whether this sub-agent can be resumed. Currently always false. Resumable *bool `json:"resumable,omitempty"` + // Where the model input for this sub-agent came from. Present when the task planner resolved the launch (the task tool and factory agents); absent for sub-agents created through other runtime paths. + TaskModelSource *SubagentTaskModelSource `json:"taskModelSource,omitempty"` // Tool call ID of the parent tool invocation that spawned this sub-agent ToolCallID string `json:"toolCallId"` } @@ -2977,6 +2999,8 @@ type AssistantMessageToolRequestCaller struct { // Per-request cost and usage data from the CAPI copilot_usage response field type AssistantUsageCopilotUsage struct { + // Default billing model for token details that do not identify their own model + Model *string `json:"model,omitempty"` // Itemized token usage breakdown // Internal: TokenDetails is part of the SDK's internal API surface and is not intended for external use. TokenDetails []AssistantUsageCopilotUsageTokenDetail `json:"tokenDetails,omitzero"` @@ -2990,6 +3014,8 @@ type AssistantUsageCopilotUsageTokenDetail struct { BatchSize int64 `json:"batchSize"` // Cost per batch of tokens CostPerBatch int64 `json:"costPerBatch"` + // Model responsible for this billing entry + Model *string `json:"model,omitempty"` // Total token count for this entry TokenCount int64 `json:"tokenCount"` // Token category (e.g., "input", "output") @@ -3225,6 +3251,9 @@ type CompactionCompleteCompactionTokensUsed struct { // Per-request cost and usage data from the CAPI copilot_usage response field // Internal: CompactionCompleteCompactionTokensUsedCopilotUsage is an internal SDK API and is not part of the public surface. type CompactionCompleteCompactionTokensUsedCopilotUsage struct { + // Default billing model for token details that do not identify their own model + // Internal: Model is part of the SDK's internal API surface and is not intended for external use. + Model *string `json:"model,omitempty"` // Itemized token usage breakdown // Internal: TokenDetails is part of the SDK's internal API surface and is not intended for external use. TokenDetails []CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail `json:"tokenDetails,omitzero"` @@ -3238,6 +3267,8 @@ type CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail struct { BatchSize int64 `json:"batchSize"` // Cost per batch of tokens CostPerBatch int64 `json:"costPerBatch"` + // Model responsible for this billing entry + Model *string `json:"model,omitempty"` // Total token count for this entry TokenCount int64 `json:"tokenCount"` // Token category (e.g., "input", "output") @@ -3268,6 +3299,8 @@ type CompletionReceiptFinalTool struct { type CustomAgentsUpdatedAgent struct { // Description of what the agent does Description string `json:"description"` + // Whether model-driven invocation is disabled for this agent. + DisableModelInvocation *bool `json:"disableModelInvocation,omitempty"` // Human-readable display name DisplayName string `json:"displayName"` // Unique identifier for the agent @@ -3582,6 +3615,12 @@ type PermissionPromptRequestCommands struct { Intention string `json:"intention"` // Whether managed policy requires a human response and forbids host auto-approval ManagedApprovalRequired *bool `json:"managedApprovalRequired,omitempty"` + // True when the shell command is requesting sandbox escalation. This is a request, not a grant. + RequestSandboxBypass *bool `json:"requestSandboxBypass,omitempty"` + // Reason for the sandbox escalation request. + RequestSandboxBypassReason *string `json:"requestSandboxBypassReason,omitempty"` + // True when the escalation is a permissive retry that keeps the sandbox and network policy attached while recording file and process accesses instead of blocking them. + RequestSandboxPermissive *bool `json:"requestSandboxPermissive,omitempty"` // Tool call ID that triggered this permission request ToolCallID *string `json:"toolCallId,omitempty"` // Optional warning message about risks of running this command @@ -4126,6 +4165,8 @@ type PermissionRequestShell struct { RequestSandboxBypass *bool `json:"requestSandboxBypass,omitempty"` // What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. Only meaningful when requestSandboxBypass is true. RequestSandboxBypassReason *string `json:"requestSandboxBypassReason,omitempty"` + // True when the requested escalation is a permissive retry rather than a full bypass: the command re-runs inside the sandbox with its file and process restrictions recording instead of blocking, while the network policy stays enforced. Always accompanied by requestSandboxBypass, so hosts that do not recognize this field still treat the request as the escalation it is. Hosts that do recognize it must not describe the command as running outside the sandbox, which would overstate the privilege being granted. + RequestSandboxPermissive *bool `json:"requestSandboxPermissive,omitempty"` // Tool call ID that triggered this permission request ToolCallID *string `json:"toolCallId,omitempty"` // Optional warning message about risks of running this command @@ -4597,6 +4638,8 @@ type SystemNotificationFactoryCompleted struct { FactoryName string `json:"factoryName"` // Machine-readable terminal failure details, when present. Failure any `json:"failure,omitempty"` + // Pause initiator metadata when this attempt settled as paused. + PauseInfo SystemNotificationFactoryPauseInfo `json:"pauseInfo,omitempty"` // Bounded prompt-safe preview of the completed result. ResultPreview *string `json:"resultPreview,omitempty"` // Actionable run_factory resume guidance for a resource-limit failure. @@ -4685,6 +4728,40 @@ func (SystemNotificationUnclassified) Type() SystemNotificationType { return SystemNotificationTypeUnclassified } +// Durable metadata describing who initiated a factory pause. +type SystemNotificationFactoryPauseInfo interface { + systemNotificationFactoryPauseInfo() + Type() SystemNotificationFactoryPauseInfoType +} + +type RawSystemNotificationFactoryPauseInfo struct { + Discriminator SystemNotificationFactoryPauseInfoType + Raw json.RawMessage +} + +func (RawSystemNotificationFactoryPauseInfo) systemNotificationFactoryPauseInfo() {} +func (r RawSystemNotificationFactoryPauseInfo) Type() SystemNotificationFactoryPauseInfoType { + return r.Discriminator +} + +type SystemNotificationFactoryPauseInfoCheckpoint struct { + // Stable author-defined checkpoint key that initiated the pause. + Key string `json:"key"` +} + +func (SystemNotificationFactoryPauseInfoCheckpoint) systemNotificationFactoryPauseInfo() {} +func (SystemNotificationFactoryPauseInfoCheckpoint) Type() SystemNotificationFactoryPauseInfoType { + return SystemNotificationFactoryPauseInfoTypeCheckpoint +} + +type SystemNotificationFactoryPauseInfoUser struct { +} + +func (SystemNotificationFactoryPauseInfoUser) systemNotificationFactoryPauseInfo() {} +func (SystemNotificationFactoryPauseInfoUser) Type() SystemNotificationFactoryPauseInfoType { + return SystemNotificationFactoryPauseInfoTypeUser +} + // A content block within a tool result, which may be text, terminal output, image, audio, or a resource type ToolExecutionCompleteContent interface { toolExecutionCompleteContent() @@ -5365,6 +5442,8 @@ const ( FactoryRunSettledStatusError FactoryRunSettledStatus = "error" // The run was stopped by a limit, an approval refusal or another policy decision. FactoryRunSettledStatusHalted FactoryRunSettledStatus = "halted" + // The attempt paused intentionally while preserving resumable run state. + FactoryRunSettledStatusPaused FactoryRunSettledStatus = "paused" ) // Conversation scope in which a HydraFusion phase executes. @@ -5796,6 +5875,18 @@ const ( PlanChangedOperationUpdate PlanChangedOperation = "update" ) +// Auto preferences that Copilot API can recommend. +type RecommendedAutoTier string + +const ( + // Balance efficiency and intelligence. + RecommendedAutoTierBalance RecommendedAutoTier = "balance" + // Optimize for efficiency. + RecommendedAutoTierEfficiency RecommendedAutoTier = "efficiency" + // Optimize for intelligence. + RecommendedAutoTierIntelligence RecommendedAutoTier = "intelligence" +) + // Who created the schedule: `user` (an explicit user action such as `/every` or `/after`) or `model` (the agent via the `manage_schedule` tool). Gates whether a scheduled skill that opted out of model invocation may fire: only user-created schedules may. type ScheduleOrigin string @@ -5832,6 +5923,20 @@ const ( SkillInvokedTriggerUserInvoked SkillInvokedTrigger = "user-invoked" ) +// Where the model input for a task-tool sub-agent came from. +type SubagentTaskModelSource string + +const ( + // The task omitted a model and the user-defined custom agent's definition supplied one. + SubagentTaskModelSourceCustomAgentDefinition SubagentTaskModelSource = "custom_agent_definition" + // The task omitted a model and the per-sub-agent settings entry supplied a concrete one. + SubagentTaskModelSourceSubagentConfiguration SubagentTaskModelSource = "subagent_configuration" + // The spawning agent supplied the task tool's model argument. + SubagentTaskModelSourceTaskArgument SubagentTaskModelSource = "task_argument" + // Neither the task call, the per-sub-agent settings entry, nor a custom agent definition supplied a model. + SubagentTaskModelSourceUnset SubagentTaskModelSource = "unset" +) + // Message role: "system" for system prompts, "developer" for developer-injected instructions type SystemMessageRole string @@ -5864,6 +5969,16 @@ const ( SystemNotificationFactoryCompletedStatusError SystemNotificationFactoryCompletedStatus = "error" // The factory was halted. SystemNotificationFactoryCompletedStatusHalted SystemNotificationFactoryCompletedStatus = "halted" + // The factory attempt paused intentionally. + SystemNotificationFactoryCompletedStatusPaused SystemNotificationFactoryCompletedStatus = "paused" +) + +// Type discriminator for SystemNotificationFactoryPauseInfo. +type SystemNotificationFactoryPauseInfoType string + +const ( + SystemNotificationFactoryPauseInfoTypeCheckpoint SystemNotificationFactoryPauseInfoType = "checkpoint" + SystemNotificationFactoryPauseInfoTypeUser SystemNotificationFactoryPauseInfoType = "user" ) // Type discriminator for SystemNotification. diff --git a/go/zsession_events.go b/go/zsession_events.go index 9540968e52..cc914cb91f 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -257,8 +257,10 @@ type ( RawPersistedBinaryResult = rpc.RawPersistedBinaryResult RawSessionEventData = rpc.RawSessionEventData RawSystemNotification = rpc.RawSystemNotification + RawSystemNotificationFactoryPauseInfo = rpc.RawSystemNotificationFactoryPauseInfo RawToolExecutionCompleteContent = rpc.RawToolExecutionCompleteContent ReasoningSummary = rpc.ReasoningSummary + RecommendedAutoTier = rpc.RecommendedAutoTier RemediationAction = rpc.RemediationAction SamplingCompletedData = rpc.SamplingCompletedData SamplingRequestedData = rpc.SamplingRequestedData @@ -266,6 +268,7 @@ type ( ScheduleOrigin = rpc.ScheduleOrigin SessionAutoModeResolvedData = rpc.SessionAutoModeResolvedData SessionAutopilotObjectiveChangedData = rpc.SessionAutopilotObjectiveChangedData + SessionAutoTierRecommendationData = rpc.SessionAutoTierRecommendationData SessionAutoTierSwitchFailedData = rpc.SessionAutoTierSwitchFailedData SessionBackgroundTasksChangedData = rpc.SessionBackgroundTasksChangedData SessionBinaryAssetData = rpc.SessionBinaryAssetData @@ -349,6 +352,7 @@ type ( SubagentFailedData = rpc.SubagentFailedData SubagentSelectedData = rpc.SubagentSelectedData SubagentStartedData = rpc.SubagentStartedData + SubagentTaskModelSource = rpc.SubagentTaskModelSource SystemMessageData = rpc.SystemMessageData SystemMessageMetadata = rpc.SystemMessageMetadata SystemMessageRole = rpc.SystemMessageRole @@ -359,6 +363,10 @@ type ( SystemNotificationData = rpc.SystemNotificationData SystemNotificationFactoryCompleted = rpc.SystemNotificationFactoryCompleted SystemNotificationFactoryCompletedStatus = rpc.SystemNotificationFactoryCompletedStatus + SystemNotificationFactoryPauseInfo = rpc.SystemNotificationFactoryPauseInfo + SystemNotificationFactoryPauseInfoCheckpoint = rpc.SystemNotificationFactoryPauseInfoCheckpoint + SystemNotificationFactoryPauseInfoType = rpc.SystemNotificationFactoryPauseInfoType + SystemNotificationFactoryPauseInfoUser = rpc.SystemNotificationFactoryPauseInfoUser SystemNotificationInstructionDiscovered = rpc.SystemNotificationInstructionDiscovered SystemNotificationNewInboxMessage = rpc.SystemNotificationNewInboxMessage SystemNotificationShellCompleted = rpc.SystemNotificationShellCompleted @@ -493,6 +501,7 @@ const ( AutopilotObjectiveChangedStatusCapReached = rpc.AutopilotObjectiveChangedStatusCapReached AutopilotObjectiveChangedStatusCompleted = rpc.AutopilotObjectiveChangedStatusCompleted AutopilotObjectiveChangedStatusPaused = rpc.AutopilotObjectiveChangedStatusPaused + AutoTierFast = rpc.AutoTierFast AutoTierSwitchFailureReasonPolicyRejected = rpc.AutoTierSwitchFailureReasonPolicyRejected AutoTierSwitchFailureReasonRequestFailed = rpc.AutoTierSwitchFailureReasonRequestFailed AutoTierSwitchFailureReasonSetupFailed = rpc.AutoTierSwitchFailureReasonSetupFailed @@ -546,6 +555,7 @@ const ( FactoryRunSettledStatusCompleted = rpc.FactoryRunSettledStatusCompleted FactoryRunSettledStatusError = rpc.FactoryRunSettledStatusError FactoryRunSettledStatusHalted = rpc.FactoryRunSettledStatusHalted + FactoryRunSettledStatusPaused = rpc.FactoryRunSettledStatusPaused FusionConversationScopeReview = rpc.FusionConversationScopeReview FusionConversationScopeRoot = rpc.FusionConversationScopeRoot FusionFollowUpActionReroute = rpc.FusionFollowUpActionReroute @@ -699,6 +709,9 @@ const ( ReasoningSummaryConcise = rpc.ReasoningSummaryConcise ReasoningSummaryDetailed = rpc.ReasoningSummaryDetailed ReasoningSummaryNone = rpc.ReasoningSummaryNone + RecommendedAutoTierBalance = rpc.RecommendedAutoTierBalance + RecommendedAutoTierEfficiency = rpc.RecommendedAutoTierEfficiency + RecommendedAutoTierIntelligence = rpc.RecommendedAutoTierIntelligence RemediationActionAllowSandboxOutbound = rpc.RemediationActionAllowSandboxOutbound RemediationActionReviewSandboxPolicy = rpc.RemediationActionReviewSandboxPolicy RemediationActionShowAccount = rpc.RemediationActionShowAccount @@ -765,6 +778,7 @@ const ( SessionEventTypeSandboxDecision = rpc.SessionEventTypeSandboxDecision SessionEventTypeSessionAutoModeResolved = rpc.SessionEventTypeSessionAutoModeResolved SessionEventTypeSessionAutopilotObjectiveChanged = rpc.SessionEventTypeSessionAutopilotObjectiveChanged + SessionEventTypeSessionAutoTierRecommendation = rpc.SessionEventTypeSessionAutoTierRecommendation SessionEventTypeSessionAutoTierSwitchFailed = rpc.SessionEventTypeSessionAutoTierSwitchFailed SessionEventTypeSessionBackgroundTasksChanged = rpc.SessionEventTypeSessionBackgroundTasksChanged SessionEventTypeSessionBinaryAsset = rpc.SessionEventTypeSessionBinaryAsset @@ -862,6 +876,10 @@ const ( SkillSourcePlugin = rpc.SkillSourcePlugin SkillSourceProject = rpc.SkillSourceProject SkillSourceSDK = rpc.SkillSourceSDK + SubagentTaskModelSourceCustomAgentDefinition = rpc.SubagentTaskModelSourceCustomAgentDefinition + SubagentTaskModelSourceSubagentConfiguration = rpc.SubagentTaskModelSourceSubagentConfiguration + SubagentTaskModelSourceTaskArgument = rpc.SubagentTaskModelSourceTaskArgument + SubagentTaskModelSourceUnset = rpc.SubagentTaskModelSourceUnset SystemMessageRoleDeveloper = rpc.SystemMessageRoleDeveloper SystemMessageRoleSystem = rpc.SystemMessageRoleSystem SystemNotificationAgentCompletedStatusCompleted = rpc.SystemNotificationAgentCompletedStatusCompleted @@ -870,6 +888,9 @@ const ( SystemNotificationFactoryCompletedStatusCompleted = rpc.SystemNotificationFactoryCompletedStatusCompleted SystemNotificationFactoryCompletedStatusError = rpc.SystemNotificationFactoryCompletedStatusError SystemNotificationFactoryCompletedStatusHalted = rpc.SystemNotificationFactoryCompletedStatusHalted + SystemNotificationFactoryCompletedStatusPaused = rpc.SystemNotificationFactoryCompletedStatusPaused + SystemNotificationFactoryPauseInfoTypeCheckpoint = rpc.SystemNotificationFactoryPauseInfoTypeCheckpoint + SystemNotificationFactoryPauseInfoTypeUser = rpc.SystemNotificationFactoryPauseInfoTypeUser SystemNotificationTypeAgentCompleted = rpc.SystemNotificationTypeAgentCompleted SystemNotificationTypeAgentIdle = rpc.SystemNotificationTypeAgentIdle SystemNotificationTypeFactoryCompleted = rpc.SystemNotificationTypeFactoryCompleted diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java index 9ba4f05618..193044555d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java @@ -37,6 +37,8 @@ public final class AssistantMessageEvent extends SessionEvent { public record AssistantMessageEventData( /** Unique identifier for this assistant message */ @JsonProperty("messageId") String messageId, + /** Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. */ + @JsonProperty("originatingMessageId") String originatingMessageId, /** Model that produced this assistant message, if known */ @JsonProperty("model") String model, /** The assistant's text response content */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java index e9db8a530d..c4c61556b1 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java @@ -22,6 +22,8 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record AssistantUsageCopilotUsage( + /** Default billing model for token details that do not identify their own model */ + @JsonProperty("model") String model, /** Itemized token usage breakdown */ @JsonProperty("tokenDetails") List tokenDetails, /** Total cost in nano-AI units for this request */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java index 9354568c7c..79d61945c0 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java @@ -25,6 +25,8 @@ public record AssistantUsageCopilotUsageTokenDetail( @JsonProperty("batchSize") Long batchSize, /** Cost per batch of tokens */ @JsonProperty("costPerBatch") Long costPerBatch, + /** Model responsible for this billing entry */ + @JsonProperty("model") String model, /** Total token count for this entry */ @JsonProperty("tokenCount") Long tokenCount, /** Token category (e.g., "input", "output") */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java b/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java index 254543160a..1c9d81b8ed 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java @@ -10,7 +10,7 @@ import javax.annotation.processing.Generated; /** - * Routing preference used when the session model is `auto`. + * Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference. * * @since 1.0.0 */ @@ -21,7 +21,9 @@ public enum AutoTier { /** The {@code balance} variant. */ BALANCE("balance"), /** The {@code intelligence} variant. */ - INTELLIGENCE("intelligence"); + INTELLIGENCE("intelligence"), + /** The {@code fast} variant. */ + FAST("fast"); private final String value; AutoTier(String value) { this.value = value; } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java index 886229cc69..7a2aebf3dd 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java @@ -22,6 +22,8 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record CompactionCompleteCompactionTokensUsedCopilotUsage( + /** Default billing model for token details that do not identify their own model */ + @JsonProperty("model") String model, /** Itemized token usage breakdown */ @JsonProperty("tokenDetails") List tokenDetails, /** Total cost in nano-AI units for this request */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java index 83209f94c8..5a9dbd3e67 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java @@ -25,6 +25,8 @@ public record CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail( @JsonProperty("batchSize") Long batchSize, /** Cost per batch of tokens */ @JsonProperty("costPerBatch") Long costPerBatch, + /** Model responsible for this billing entry */ + @JsonProperty("model") String model, /** Total token count for this entry */ @JsonProperty("tokenCount") Long tokenCount, /** Token category (e.g., "input", "output") */ 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 762f0b1ac8..1fdf5bc13c 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 @@ -36,6 +36,8 @@ public record CustomAgentsUpdatedAgent( @JsonProperty("tools") List tools, /** Whether the agent can be selected by the user */ @JsonProperty("userInvocable") Boolean userInvocable, + /** Whether model-driven invocation is disabled for this agent. */ + @JsonProperty("disableModelInvocation") Boolean disableModelInvocation, /** Model override for this agent, if set */ @JsonProperty("model") String model, /** Authored model ids in priority order, if configured */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java index bbeffbbf48..828ddc9ee3 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java @@ -20,6 +20,8 @@ public enum FactoryRunSettledStatus { COMPLETED("completed"), /** The {@code halted} variant. */ HALTED("halted"), + /** The {@code paused} variant. */ + PAUSED("paused"), /** The {@code cancelled} variant. */ CANCELLED("cancelled"), /** The {@code error} variant. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.java b/java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.java new file mode 100644 index 0000000000..acccaf5c8e --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.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; + +/** + * Auto preferences that Copilot API can recommend. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum RecommendedAutoTier { + /** The {@code efficiency} variant. */ + EFFICIENCY("efficiency"), + /** The {@code balance} variant. */ + BALANCE("balance"), + /** The {@code intelligence} variant. */ + INTELLIGENCE("intelligence"); + + private final String value; + RecommendedAutoTier(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static RecommendedAutoTier fromValue(String value) { + for (RecommendedAutoTier v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown RecommendedAutoTier value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java new file mode 100644 index 0000000000..9dd00a4586 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.auto_tier_recommendation". Live-only Auto preference recommendation from Copilot API after a successful Auto model call. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionAutoTierRecommendationEvent extends SessionEvent { + + @Override + public String getType() { return "session.auto_tier_recommendation"; } + + @JsonProperty("data") + private SessionAutoTierRecommendationEventData data; + + public SessionAutoTierRecommendationEventData getData() { return data; } + public void setData(SessionAutoTierRecommendationEventData data) { this.data = data; } + + /** Data payload for {@link SessionAutoTierRecommendationEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionAutoTierRecommendationEventData( + /** Recommended Auto preference. */ + @JsonProperty("recommendedAutoTier") RecommendedAutoTier recommendedAutoTier + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java index 1925f6d893..70861fb977 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java @@ -52,6 +52,8 @@ public record SessionCompactionCompleteEventData( @JsonProperty("customInstructions") String customInstructions, /** LLM-generated summary of the compacted conversation history */ @JsonProperty("summaryContent") String summaryContent, + /** Authoritative active-factory reminder appended to the compacted context */ + @JsonProperty("activeFactorySummary") String activeFactorySummary, /** Canonical model identifier used for model-specific behavior when replaying compaction */ @JsonProperty("behaviorModelId") String behaviorModelId, /** Checkpoint snapshot number created for recovery */ 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 367fa120b5..a04aefe9f3 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 @@ -38,6 +38,7 @@ @JsonSubTypes.Type(value = SessionInfoEvent.class, name = "session.info"), @JsonSubTypes.Type(value = SessionWarningEvent.class, name = "session.warning"), @JsonSubTypes.Type(value = SessionModelChangeEvent.class, name = "session.model_change"), + @JsonSubTypes.Type(value = SessionAutoTierRecommendationEvent.class, name = "session.auto_tier_recommendation"), @JsonSubTypes.Type(value = SessionAutoTierSwitchFailedEvent.class, name = "session.auto_tier_switch_failed"), @JsonSubTypes.Type(value = SessionModeChangedEvent.class, name = "session.mode_changed"), @JsonSubTypes.Type(value = SessionModeNoticeDeliveredEvent.class, name = "session.mode_notice_delivered"), @@ -177,6 +178,7 @@ public abstract sealed class SessionEvent permits SessionInfoEvent, SessionWarningEvent, SessionModelChangeEvent, + SessionAutoTierRecommendationEvent, SessionAutoTierSwitchFailedEvent, SessionModeChangedEvent, SessionModeNoticeDeliveredEvent, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java index c246fac1ea..bef7c0138d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java @@ -44,6 +44,8 @@ public record SubagentStartedEventData( @JsonProperty("agentDescription") String agentDescription, /** Model the sub-agent will run with, when known at start. */ @JsonProperty("model") String model, + /** Where the model input for this sub-agent came from. Present when the task planner resolved the launch (the task tool and factory agents); absent for sub-agents created through other runtime paths. */ + @JsonProperty("taskModelSource") SubagentTaskModelSource taskModelSource, /** Root id of the factory run that spawned this sub-agent, when it was spawned by one. */ @JsonProperty("factoryRunId") String factoryRunId, /** Task-registry ID of the spawning sub-agent. Absent when the root session spawned this child. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java new file mode 100644 index 0000000000..6b5ec94531 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Where the model input for a task-tool sub-agent came from. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SubagentTaskModelSource { + /** The {@code task_argument} variant. */ + TASK_ARGUMENT("task_argument"), + /** The {@code subagent_configuration} variant. */ + SUBAGENT_CONFIGURATION("subagent_configuration"), + /** The {@code custom_agent_definition} variant. */ + CUSTOM_AGENT_DEFINITION("custom_agent_definition"), + /** The {@code unset} variant. */ + UNSET("unset"); + + private final String value; + SubagentTaskModelSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SubagentTaskModelSource fromValue(String value) { + for (SubagentTaskModelSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SubagentTaskModelSource value: " + value); + } +} 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 3d9f9c2d7e..8656baf397 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 @@ -37,6 +37,8 @@ public record AgentInfo( @JsonProperty("source") AgentInfoSource source, /** Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only. */ @JsonProperty("userInvocable") Boolean userInvocable, + /** Whether model-driven invocation is disabled for this agent. */ + @JsonProperty("disableModelInvocation") Boolean disableModelInvocation, /** Allowed tool names for this agent. Empty array means none; omitted means inherit defaults. */ @JsonProperty("tools") List tools, /** Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java index a4433e1ea9..00b18bcc94 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java @@ -10,7 +10,7 @@ import javax.annotation.processing.Generated; /** - * Routing preference used when the session model is `auto`. + * Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference. * * @since 1.0.0 */ @@ -21,7 +21,9 @@ public enum AutoTier { /** The {@code balance} variant. */ BALANCE("balance"), /** The {@code intelligence} variant. */ - INTELLIGENCE("intelligence"); + INTELLIGENCE("intelligence"), + /** The {@code fast} variant. */ + FAST("fast"); private final String value; AutoTier(String value) { this.value = value; } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java index 4fd7a91ca2..b1c2aff8b4 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record CapiSessionOptions( - /** Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. */ + /** Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. `fast` is an integrator-only latency preset, not a first-party GitHub Copilot product preference. */ @JsonProperty("autoTier") AutoTier autoTier, /** Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable. */ @JsonProperty("enableWebSocketResponses") Boolean enableWebSocketResponses diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java index 35e0f276ee..178c135cdd 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java @@ -27,6 +27,8 @@ public record FactoryAbortParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, /** Factory run identifier. */ - @JsonProperty("runId") String runId + @JsonProperty("runId") String runId, + /** Opaque token identifying the execution attempt to abort. */ + @JsonProperty("executionToken") String executionToken ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java index 9910d4f7f5..51b9077ba1 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java @@ -27,11 +27,11 @@ public record FactoryAgentOptions( @JsonProperty("schema") Object schema, /** Optional model identifier for the subagent. */ @JsonProperty("model") String model, - /** Optional reasoning effort for the subagent. This field is accepted but not yet honored. */ + /** Optional reasoning effort override for the subagent. */ @JsonProperty("reasoningEffort") String reasoningEffort, - /** Optional context tier for the subagent. This field is accepted but not yet honored. */ + /** Optional context tier override for the subagent. */ @JsonProperty("contextTier") ContextTier contextTier, - /** Optional custom agent name for the subagent. This field is accepted but not yet honored. */ + /** Optional built-in or custom agent name whose definition configures the subagent. */ @JsonProperty("agent") String agent ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.java new file mode 100644 index 0000000000..a07aa8a677 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.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; + +/** + * Action the runtime selected for a durable factory pause checkpoint. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FactoryPauseCheckpointAction { + /** The {@code continue} variant. */ + CONTINUE("continue"), + /** The {@code pause} variant. */ + PAUSE("pause"); + + private final String value; + FactoryPauseCheckpointAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FactoryPauseCheckpointAction fromValue(String value) { + for (FactoryPauseCheckpointAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FactoryPauseCheckpointAction value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java index 71ee3c49e6..436f969f61 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java @@ -36,6 +36,8 @@ public record FactoryRunResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java index 5d2348ec9e..d5c87e7304 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java @@ -24,6 +24,8 @@ public enum FactoryRunStatus { COMPLETED("completed"), /** The {@code halted} variant. */ HALTED("halted"), + /** The {@code paused} variant. */ + PAUSED("paused"), /** The {@code cancelled} variant. */ CANCELLED("cancelled"), /** The {@code error} variant. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java index f482acfa16..e58b774bcb 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java @@ -58,6 +58,8 @@ public record FactoryRunSummary( /** Epoch milliseconds when the current active segment started, or null while inactive. */ @JsonProperty("activeSegmentStartedAt") Long activeSegmentStartedAt, /** Terminal run outcome, or null while nonterminal. */ - @JsonProperty("terminal") FactoryRunTerminal terminal + @JsonProperty("terminal") FactoryRunTerminal terminal, + /** Whether the durable run state currently passes runtime resume eligibility checks. */ + @JsonProperty("canResume") Boolean canResume ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java index bf9bfa7db4..0123e19793 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java @@ -28,6 +28,8 @@ public record FactoryRunTerminal( /** Human-readable terminal error. */ @JsonProperty("error") String error, /** Prompt-safe preview of the completed result. */ - @JsonProperty("resultPreview") String resultPreview + @JsonProperty("resultPreview") String resultPreview, + /** Pause initiator metadata, or null when the run did not pause. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java new file mode 100644 index 0000000000..06b2db9825 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.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 javax.annotation.processing.Generated; + +/** + * A JSON Schema output contract. OpenAI receives the name, description, schema and strict setting; Anthropic receives the schema in output_config.format and always uses its native strict enforcement. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record JsonSchemaResponseFormat( + /** Name of the output schema, subject to the provider's naming restrictions. */ + @JsonProperty("name") String name, + /** JSON Schema passed unchanged to the inference provider. Supported keywords and schema restrictions are determined by that provider. */ + @JsonProperty("schema") Object schema, + /** Optional description passed to OpenAI providers. */ + @JsonProperty("description") String description, + /** Optional strict enforcement setting for OpenAI providers. Omitted uses the provider default. Anthropic always enforces its supported schema subset. */ + @JsonProperty("strict") Boolean strict +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java index 661e998b71..3876c20b62 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java @@ -15,7 +15,7 @@ import javax.annotation.processing.Generated; /** - * Plugin names (or specs) to disable. + * Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -26,6 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record PluginsDisableParams( /** Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. */ - @JsonProperty("names") List names + @JsonProperty("names") List names, + /** Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. */ + @JsonProperty("workingDirectory") String workingDirectory ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java index 24404eee46..2be80af89e 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java @@ -15,7 +15,7 @@ import javax.annotation.processing.Generated; /** - * Plugin names (or specs) to enable. + * Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -26,6 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record PluginsEnableParams( /** Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. */ - @JsonProperty("names") List names + @JsonProperty("names") List names, + /** Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. */ + @JsonProperty("workingDirectory") String workingDirectory ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java index a7a28f5d1c..da5ac6c0e8 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java @@ -89,7 +89,7 @@ public CompletableFuture updateAll() { } /** - * Plugin names (or specs) to enable. + * Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -100,7 +100,7 @@ public CompletableFuture enable(PluginsEnableParams params) { } /** - * Plugin names (or specs) to disable. + * Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java index e9a3e9f08a..12fa3cf6fd 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java @@ -178,6 +178,38 @@ public CompletableFuture cancel(SessionFactoryCancel return caller.invoke("session.factory.cancel", _p, SessionFactoryCancelResult.class); } + /** + * Parameters for pausing a running factory. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture pause(SessionFactoryPauseParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.factory.pause", _p, SessionFactoryPauseResult.class); + } + + /** + * Parameters for an owned durable pause checkpoint. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture pauseAtCheckpoint(SessionFactoryPauseAtCheckpointParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.factory.pauseAtCheckpoint", _p, SessionFactoryPauseAtCheckpointResult.class); + } + /** * Parameters for recording factory progress. *

diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java index c9f9de2dcc..42e1b38811 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java @@ -39,6 +39,8 @@ public record SessionFactoryCancelResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java index 01204cb832..0a3fb7f83a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java @@ -63,6 +63,8 @@ public record SessionFactoryGetRunDetailResult( @JsonProperty("activeSegmentStartedAt") Long activeSegmentStartedAt, /** Terminal run outcome, or null while nonterminal. */ @JsonProperty("terminal") FactoryRunTerminal terminal, + /** Whether the durable run state currently passes runtime resume eligibility checks. */ + @JsonProperty("canResume") Boolean canResume, /** Lifecycle and timing observations for each factory phase. */ @JsonProperty("phases") List phases, /** Durable identities and live statuses for direct factory agents. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java index 2d6a5f52a9..9c141b28d4 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java @@ -39,6 +39,8 @@ public record SessionFactoryGetRunResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.java new file mode 100644 index 0000000000..a54c089e20 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.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; + +/** + * Parameters for an owned durable pause checkpoint. + * + * @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 SessionFactoryPauseAtCheckpointParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Factory run identifier. */ + @JsonProperty("runId") String runId, + /** Opaque token identifying the execution attempt that reached the checkpoint. */ + @JsonProperty("executionToken") String executionToken, + /** Stable author-defined checkpoint key. */ + @JsonProperty("key") String key +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java new file mode 100644 index 0000000000..4775fa0c6b --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result for the {@code session.factory.pauseAtCheckpoint} RPC method. + * + * @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 SessionFactoryPauseAtCheckpointResult( + /** Whether this execution attempt must pause or may continue. */ + @JsonProperty("action") FactoryPauseCheckpointAction action +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java new file mode 100644 index 0000000000..00a1b4d660 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Parameters for pausing a running factory. + * + * @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 SessionFactoryPauseParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Factory run identifier. */ + @JsonProperty("runId") String runId +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java new file mode 100644 index 0000000000..aa93afbea2 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Complete current or terminal factory run envelope. + * + * @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 SessionFactoryPauseResult( + /** Factory run identifier. */ + @JsonProperty("runId") String runId, + /** One-based execution attempt represented by this envelope. Absent before the first attempt starts or when returned by an older runtime. */ + @JsonProperty("attempt") Long attempt, + /** Current or terminal factory run status. */ + @JsonProperty("status") FactoryRunStatus status, + /** Completed factory result. */ + @JsonProperty("result") Object result, + /** Error message for an errored run. */ + @JsonProperty("error") String error, + /** Machine-readable failure details for a halted or errored run. */ + @JsonProperty("failure") Object failure, + /** Reason for a halted or cancelled run. */ + @JsonProperty("reason") String reason, + /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java index 1a9dee5926..b76daece8d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java @@ -39,6 +39,8 @@ public record SessionFactoryRunFromToolResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java index d8ce481895..4a7cc978e4 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java @@ -39,6 +39,8 @@ public record SessionFactoryRunResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java index b9adc34484..7afe40eb0b 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java @@ -89,6 +89,22 @@ public CompletableFuture applyStartupOver return caller.invoke("session.model.applyStartupOverlay", _p, SessionModelApplyStartupOverlayResult.class); } + /** + * Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture setAllowedModels(SessionModelSetAllowedModelsParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.model.setAllowedModels", _p, SessionModelSetAllowedModelsResult.class); + } + /** * Reasoning effort level to apply to the currently selected model. *

diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.java new file mode 100644 index 0000000000..c46e1af7ac --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.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; + +/** + * Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. + * + * @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 SessionModelSetAllowedModelsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Exact model IDs to permit, or null to clear the host restriction. */ + @JsonProperty("allowedModels") List allowedModels +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java new file mode 100644 index 0000000000..d2552c2fcd --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * The applied host allowlist and effective session model policy after intersection. + * + * @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 SessionModelSetAllowedModelsResult( + /** Normalized host allowlist. Omitted when the host restriction was cleared, or when a relay client does not return the host policy. */ + @JsonProperty("allowedModels") List allowedModels, + /** Effective exact IDs or repository policy patterns after applying the host restriction. Omitted by relay clients that do not return the host policy. */ + @JsonProperty("effectiveAllowedModels") List effectiveAllowedModels, + /** Effective deterministic fallback model, when the policy defines one. */ + @JsonProperty("fallbackModel") String fallbackModel, + /** Selected session model after reconciling a now-disallowed concrete selection. */ + @JsonProperty("modelId") String modelId +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java index 55efb9da78..02dbbea37a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java @@ -19,6 +19,8 @@ @javax.annotation.processing.Generated("copilot-sdk-codegen") public final class SessionSandboxApi { + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + private final RpcCaller caller; private final String sessionId; @@ -39,4 +41,20 @@ public CompletableFuture getEnforcemen return caller.invoke("session.sandbox.getEnforcementStatus", java.util.Map.of("sessionId", this.sessionId), SessionSandboxGetEnforcementStatusResult.class); } + /** + * Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture disableForSession(SessionSandboxDisableForSessionParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.sandbox.disableForSession", _p, SessionSandboxDisableForSessionResult.class); + } + } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java new file mode 100644 index 0000000000..f7720f8f20 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. + * + * @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 SessionSandboxDisableForSessionParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Identifier of the exact pending sandbox-bypass permission request that authorized the session opt-out. */ + @JsonProperty("requestId") String requestId, + /** Optional attribution for the permission decision. */ + @JsonProperty("decisionContext") PermissionDecisionContext decisionContext +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java new file mode 100644 index 0000000000..a46129ea44 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Result of attempting to disable sandboxing for the current session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSandboxDisableForSessionResult( + /** Whether this call resolved the pending request and applied the session opt-out. */ + @JsonProperty("success") Boolean success, + /** The authoritative sandbox enabled state after the operation. */ + @JsonProperty("enabled") Boolean enabled +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java index 2943192041..cdec524a1a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java @@ -38,6 +38,8 @@ public record SessionSendMessagesParams( @JsonProperty("agentMode") SendAgentMode agentMode, /** Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. */ @JsonProperty("requestHeaders") Map requestHeaders, + /** Provider-native output format for the whole turn, including an empty message batch and all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. */ + @JsonProperty("responseFormat") SessionSendMessagesParamsResponseFormat responseFormat, /** W3C Trace Context traceparent header for distributed tracing of this agent turn */ @JsonProperty("traceparent") String traceparent, /** W3C Trace Context tracestate header for distributed tracing */ @@ -45,4 +47,14 @@ public record SessionSendMessagesParams( /** If true, await completion of the agentic loop for this turn before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageIds`; the caller can rely on the agent having processed the messages before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. */ @JsonProperty("wait") Boolean wait_ ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionSendMessagesParamsResponseFormat( + /** JSON Schema and provider options for the turn's output. */ + @JsonProperty("jsonSchema") JsonSchemaResponseFormat jsonSchema, + /** Output format discriminator. Currently only json_schema is supported. */ + @JsonProperty("type") String type + ) { + } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java index f19c85ebe2..964c48b438 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java @@ -48,6 +48,8 @@ public record SessionSendParams( @JsonProperty("agentMode") SendAgentMode agentMode, /** Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. */ @JsonProperty("requestHeaders") Map requestHeaders, + /** Provider-native output format for this turn, including all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. */ + @JsonProperty("responseFormat") SessionSendParamsResponseFormat responseFormat, /** W3C Trace Context traceparent header for distributed tracing of this agent turn */ @JsonProperty("traceparent") String traceparent, /** W3C Trace Context tracestate header for distributed tracing */ @@ -55,4 +57,14 @@ public record SessionSendParams( /** If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. */ @JsonProperty("wait") Boolean wait_ ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionSendParamsResponseFormat( + /** JSON Schema and provider options for the turn's output. */ + @JsonProperty("jsonSchema") JsonSchemaResponseFormat jsonSchema, + /** Output format discriminator. Currently only json_schema is supported. */ + @JsonProperty("type") String type + ) { + } } diff --git a/nodejs/README.md b/nodejs/README.md index 7effb81e95..d6fe833d05 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -301,6 +301,63 @@ Send a message and wait until the session becomes idle. Returns the final assistant message event, or undefined if none was received. +##### Structured output (preview) + +Requires a runtime build with `responseFormat` and `originatingMessageId` support. +Pass a raw JSON Schema or a Zod schema as `responseSchema` to `send` or +`sendAndWait`. As with custom tool parameters, the SDK converts Zod schemas to +JSON Schema before sending them: + +```typescript +import { z } from "zod"; + +const answerSchema = z.object({ answer: z.number().int() }); +const message = await session.sendAndWait({ + prompt: "What is 19 + 23?", + responseSchema: answerSchema, +}); +console.log(message?.data.content); // JSON text +``` + +For a typed result, pass the Zod schema as the **second argument** instead: + +```typescript +const answer = await session.sendAndWait("What is 19 + 23?", answerSchema); +console.log(answer.answer); // number; TResult is inferred from answerSchema +``` + +`sendAndWait(options, schema, timeout?)` generates the JSON Schema from +the schema value, parses the final JSON, and validates it with the schema's +`parse` method. TypeScript cannot derive a runtime schema from an erased type +parameter alone. Invalid JSON, a schema mismatch, or a completed run without a +matching assistant message throws. Do not also set `options.responseSchema` when +using the typed overload. + +The schema belongs to the submitted run, including its tool-call iterations. +Subsequent sends do not inherit it. Ordinary immediate steering inherits the +active schema; specifying a schema with `mode: "immediate"` is rejected. +The generated `session.rpc.send` and `session.rpc.sendMessages` wrappers expose +the full `responseFormat` contract when you need to set its name, description, +or strict option rather than using the convenience defaults (`name: "response"`, +`strict: true`). + +Structured waits select the last root-agent message whose `originatingMessageId` +matches the ID returned by their send, then return at a non-autopilot +`session.idle`. Other queued work can delay that idle, but cannot replace the +selected result. The existing unformatted overload retains its session-wide +behavior. `turnId` identifies an individual model/tool iteration, not the whole +run; telemetry interaction IDs are not unique run identifiers. + +Streaming still delivers ordinary text events, including intermediate messages +and tool calls. Only the final selected message is parsed by the typed overload; +not every event is necessarily a complete schema-conforming JSON document. +Provider errors, refusals, cancellation, truncation, session errors, and timeouts +can prevent a typed result. A timeout stops waiting, not the runtime's work. +Use a model and endpoint that support native structured output. An API-compatible +gateway may ignore format fields even when it accepts the request; for example, +the Claude Chat-completions compatibility route is not equivalent to Anthropic's +native `output_config.format` endpoint. + ##### `on(eventType: string, handler: TypedSessionEventHandler): () => void` Subscribe to a specific event type. The handler receives properly typed events. diff --git a/nodejs/src/client.ts b/nodejs/src/client.ts index eb92cf0bed..07b7c4a08f 100644 --- a/nodejs/src/client.ts +++ b/nodejs/src/client.ts @@ -49,6 +49,7 @@ import { createSessionFsAdapter, type SessionFsProvider } from "./sessionFsProvi import { createCopilotRequestAdapter } from "./copilotRequestHandler.js"; import type { CopilotRequestHandler } from "./copilotRequestHandler.js"; import { getTraceContext } from "./telemetry.js"; +import { toJsonSchema } from "./schema.js"; import { ToolSet } from "./toolSet.js"; import type { AutoModeSwitchRequest, @@ -87,7 +88,6 @@ import type { SessionMetadata, SystemMessageCustomizeConfig, TelemetryConfig, - Tool, TraceContextProvider, TypedSessionLifecycleHandler, } from "./types.js"; @@ -101,18 +101,6 @@ import type { FactoryHandle } from "./factory.js"; const MIN_PROTOCOL_VERSION = 3; const RUNTIME_SHUTDOWN_TIMEOUT_MS = 10_000; -/** - * Check if value is a Zod schema (has toJSONSchema method) - */ -function isZodSchema(value: unknown): value is { toJSONSchema(): Record } { - return ( - value != null && - typeof value === "object" && - "toJSONSchema" in value && - typeof (value as { toJSONSchema: unknown }).toJSONSchema === "function" - ); -} - async function withTimeout(promise: Promise, timeoutMs: number, message: string): Promise { let timeout: ReturnType | undefined; try { @@ -160,17 +148,6 @@ async function waitForChildExit(child: ChildProcess, timeoutMs: number): Promise }); } -/** - * Convert tool parameters to JSON schema format for sending to CLI - */ -function toJsonSchema(parameters: Tool["parameters"]): Record | undefined { - if (!parameters) return undefined; - if (isZodSchema(parameters)) { - return parameters.toJSONSchema(); - } - return parameters; -} - /** Implicit provider name for the singular, whole-session {@link ProviderConfig}. */ const DEFAULT_PROVIDER_NAME = "default"; diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index f4978de1ff..9f5254b1d9 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -1162,6 +1162,8 @@ export type FactoryRunStatus = | "completed" /** The run was interrupted while resource budget remained. */ | "halted" + /** The current attempt stopped intentionally and the run may be resumed. */ + | "paused" /** The run was cancelled before completion. */ | "cancelled" /** The factory body failed or reached a cumulative resource ceiling. */ @@ -1180,6 +1182,10 @@ export type FactoryRunFailure = * Approved effective ceiling that was reached. */ value: number; + /** + * Suggested larger ceiling when the runtime can derive one safely. + */ + suggestedValue?: number; /** * Factory run identifier. */ @@ -1256,6 +1262,30 @@ export type FactoryRunFailureKind = | "timeoutSeconds" /** The run's settled subagent model usage exceeded the approved AI-credit ceiling, or no headroom remained for another subagent. */ | "maxAiCredits"; +/** + * Durable metadata describing who initiated a factory pause. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "FactoryPauseInfo". + */ +/** @experimental */ +export type FactoryPauseInfo = + | { + /** + * Factory pause initiator discriminator. + */ + type: "user"; + } + | { + /** + * Stable author-defined checkpoint key that initiated the pause. + */ + key: string; + /** + * Factory pause initiator discriminator. + */ + type: "checkpoint"; + }; /** * Kind of factory progress line. * @@ -1268,6 +1298,18 @@ export type FactoryLogLineKind = | "log" /** A named factory phase marker. */ | "phase"; +/** + * Action the runtime selected for a durable factory pause checkpoint. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "FactoryPauseCheckpointAction". + */ +/** @experimental */ +export type FactoryPauseCheckpointAction = + /** The checkpoint was committed by a prior paused attempt, so execution may continue. */ + | "continue" + /** This attempt claimed the checkpoint and must cooperatively stop. */ + | "pause"; /** * Derived lifecycle state of a factory phase. * @@ -2983,6 +3025,20 @@ export type RemoteSessionMetadataTaskType = | "cca" /** CLI remote task. */ | "cli"; +/** + * Provider-native structured output format. JSON Schema is forwarded without rewriting or validating the schema or the generated output. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ResponseFormat". + */ +/** @experimental */ +export type ResponseFormat = { + jsonSchema: JsonSchemaResponseFormat; + /** + * Output format discriminator. Currently only json_schema is supported. + */ + type: "json_schema"; +}; /** * Origin of the sandbox choice supplied by an internal client. * @@ -4845,6 +4901,10 @@ export interface AgentInfo { * Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only. */ userInvocable?: boolean; + /** + * Whether model-driven invocation is disabled for this agent. + */ + disableModelInvocation?: boolean; /** * Allowed tool names for this agent. Empty array means none; omitted means inherit defaults. */ @@ -7818,6 +7878,10 @@ export interface FactoryAbortRequest { * Factory run identifier. */ runId: string; + /** + * Opaque token identifying the execution attempt to abort. + */ + executionToken: string; } /** * Acknowledgement that a factory request was accepted. @@ -7848,12 +7912,12 @@ export interface FactoryAgentOptions { */ model?: string; /** - * Optional reasoning effort for the subagent. This field is accepted but not yet honored. + * Optional reasoning effort override for the subagent. */ reasoningEffort?: string; contextTier?: ContextTier; /** - * Optional custom agent name for the subagent. This field is accepted but not yet honored. + * Optional built-in or custom agent name whose definition configures the subagent. */ agent?: string; } @@ -8284,6 +8348,10 @@ export interface FactoryRunSummary { * Terminal run outcome, or null while nonterminal. */ terminal: FactoryRunTerminal | null; + /** + * Whether the durable run state currently passes runtime resume eligibility checks. + */ + canResume: boolean; } /** * Durable factory resource consumption. @@ -8327,6 +8395,10 @@ export interface FactoryRunTerminal { * Prompt-safe preview of the completed result. */ resultPreview?: string; + /** + * Pause initiator metadata, or null when the run did not pause. + */ + pauseInfo: FactoryPauseInfo | null; } /** * One ordered factory progress line. @@ -8367,6 +8439,45 @@ export interface FactoryLogRequest { */ lines: FactoryLogLine[]; } +/** + * Parameters for an owned durable pause checkpoint. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "FactoryPauseCheckpointRequest". + */ +/** @experimental */ +export interface FactoryPauseCheckpointRequest { + /** + * Factory run identifier. + */ + runId: string; + /** + * Opaque token identifying the execution attempt that reached the checkpoint. + */ + executionToken: string; + /** + * Stable author-defined checkpoint key. + */ + key: string; +} + +/** @experimental */ +export interface FactoryPauseCheckpointResult { + action: FactoryPauseCheckpointAction; +} +/** + * Parameters for pausing a running factory. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "FactoryPauseRequest". + */ +/** @experimental */ +export interface FactoryPauseRequest { + /** + * Factory run identifier. + */ + runId: string; +} /** * Durable lifecycle and timing for one factory phase. * @@ -8521,19 +8632,19 @@ export interface FactoryRunLimits { /** * Maximum number of factory subagents that may run concurrently. */ - maxConcurrentSubagents?: number; + maxConcurrentSubagents?: number | null; /** * Maximum total number of factory subagents that may be admitted. */ - maxTotalSubagents?: number; + maxTotalSubagents?: number | null; /** * Maximum accumulated active-execution time in seconds. Active execution includes the entire extension body, subprocess waits, queued-agent waits, and sleeps; time between resumed attempts is not counted. */ - timeoutSeconds?: number; + timeoutSeconds?: number | null; /** * Maximum AI credits consumed by factory subagents and their descendants. The post-paid ceiling is soft: parallel turns can settle beyond it before the run stops. */ - maxAiCredits?: number; + maxAiCredits?: number | null; } /** * Resolved persisted factory identity and resumed run envelope. @@ -8583,6 +8694,7 @@ export interface FactoryRunResult { * Partial journal and progress snapshot for a halted, cancelled, or errored run. */ snapshot?: JsonValue; + pauseInfo?: FactoryPauseInfo; } /** * Full factory run observability detail. @@ -8659,6 +8771,10 @@ export interface FactoryRunDetail { * Terminal run outcome, or null while nonterminal. */ terminal: FactoryRunTerminal | null; + /** + * Whether the durable run state currently passes runtime resume eligibility checks. + */ + canResume: boolean; /** * Lifecycle and timing observations for each factory phase. */ @@ -9707,6 +9823,31 @@ export interface InterruptMainTurnResult { */ interrupted: boolean; } +/** + * A JSON Schema output contract. OpenAI receives the name, description, schema and strict setting; Anthropic receives the schema in output_config.format and always uses its native strict enforcement. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "JsonSchemaResponseFormat". + */ +/** @experimental */ +export interface JsonSchemaResponseFormat { + /** + * Name of the output schema, subject to the provider's naming restrictions. + */ + name: string; + /** + * JSON Schema passed unchanged to the inference provider. Supported keywords and schema restrictions are determined by that provider. + */ + schema: JsonValue; + /** + * Optional description passed to OpenAI providers. + */ + description?: string; + /** + * Optional strict enforcement setting for OpenAI providers. Omitted uses the provider default. Anthropic always enforces its supported schema subset. + */ + strict?: boolean; +} /** * HTTP headers as a map from lowercased header name to a list of values. Multi-valued headers (e.g. Set-Cookie) preserve all values. * @@ -13009,6 +13150,44 @@ export interface ModelPickerSettingsContext { */ environment: {}; } +/** + * Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelSetAllowedModelsRequest". + */ +/** @experimental */ +export interface ModelSetAllowedModelsRequest { + /** + * Exact model IDs to permit, or null to clear the host restriction. + */ + allowedModels?: string[] | null; +} +/** + * The applied host allowlist and effective session model policy after intersection. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelSetAllowedModelsResult". + */ +/** @experimental */ +export interface ModelSetAllowedModelsResult { + /** + * Normalized host allowlist. Omitted when the host restriction was cleared, or when a relay client does not return the host policy. + */ + allowedModels?: string[]; + /** + * Effective exact IDs or repository policy patterns after applying the host restriction. Omitted by relay clients that do not return the host policy. + */ + effectiveAllowedModels?: string[]; + /** + * Effective deterministic fallback model, when the policy defines one. + */ + fallbackModel?: string; + /** + * Selected session model after reconciling a now-disallowed concrete selection. + */ + modelId?: string; +} /** * Reasoning effort level to apply to the currently selected model. * @@ -15174,7 +15353,7 @@ export interface PluginsBuiltinSetRequest { paths: string[]; } /** - * Plugin names (or specs) to disable. + * Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "PluginsDisableRequest". @@ -15185,9 +15364,13 @@ export interface PluginsDisableRequest { * Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. */ names: string[]; + /** + * Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. + */ + workingDirectory?: string; } /** - * Plugin names (or specs) to enable. + * Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "PluginsEnableRequest". @@ -15198,6 +15381,10 @@ export interface PluginsEnableRequest { * Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. */ names: string[]; + /** + * Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. + */ + workingDirectory?: string; } /** * Plugin source and optional working directory for relative-path resolution. @@ -17130,6 +17317,37 @@ export interface SandboxConfigAuth { */ gh?: boolean; } +/** + * Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "SandboxDisableForSessionRequest". + */ +/** @experimental */ +export interface SandboxDisableForSessionRequest { + /** + * Identifier of the exact pending sandbox-bypass permission request that authorized the session opt-out. + */ + requestId: string; + decisionContext?: PermissionDecisionContext; +} +/** + * Result of attempting to disable sandboxing for the current session. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "SandboxDisableForSessionResult". + */ +/** @experimental */ +export interface SandboxDisableForSessionResult { + /** + * Whether this call resolved the pending request and applied the session opt-out. + */ + success: boolean; + /** + * The authoritative sandbox enabled state after the operation. + */ + enabled: boolean; +} /** * Managed sandbox enforcement state for a session. * @@ -17480,6 +17698,7 @@ export interface SendMessagesRequest { requestHeaders?: { [k: string]: string | undefined; }; + responseFormat?: ResponseFormat; /** * W3C Trace Context traceparent header for distributed tracing of this agent turn */ @@ -17552,6 +17771,7 @@ export interface SendRequest { requestHeaders?: { [k: string]: string | undefined; }; + responseFormat?: ResponseFormat; /** * W3C Trace Context traceparent header for distributed tracing of this agent turn */ @@ -23578,6 +23798,11 @@ export interface WorkspacesWriteAutopilotObjectiveResult { operation: string; } +/** @experimental */ +export interface SessionFactoryPauseAtCheckpointResult { + action: FactoryPauseCheckpointAction; +} + /** @experimental */ export interface SessionModelListRequest { /** @@ -23981,14 +24206,14 @@ export function createServerRpc(connection: MessageConnection) { /** * Enables installed plugins for new sessions. * - * @param params Plugin names (or specs) to enable. + * @param params Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. */ enable: async (params: PluginsEnableRequest): Promise => connection.sendRequest("plugins.enable", params), /** * Disables installed plugins for new sessions. * - * @param params Plugin names (or specs) to disable. + * @param params Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. */ disable: async (params: PluginsDisableRequest): Promise => connection.sendRequest("plugins.disable", params), @@ -24592,6 +24817,15 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ getEnforcementStatus: async (): Promise => connection.sendRequest("session.sandbox.getEnforcementStatus", { sessionId }), + /** + * Disables sandboxing for the remainder of the current session and approves the referenced pending sandbox-bypass permission request. The request is rejected unless the exact request is still pending and the effective sandbox policy permits bypass. + * + * @param params Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. + * + * @returns Result of attempting to disable sandboxing for the current session. + */ + disableForSession: async (params: SandboxDisableForSessionRequest): Promise => + connection.sendRequest("session.sandbox.disableForSession", { sessionId, ...params }), }, /** * Aborts the current agent turn. @@ -24774,6 +25008,15 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ cancel: async (params: FactoryCancelRequest): Promise => connection.sendRequest("session.factory.cancel", { sessionId, ...params }), + /** + * Pauses a running factory and returns its settled run envelope. + * + * @param params Parameters for pausing a running factory. + * + * @returns Complete current or terminal factory run envelope. + */ + pause: async (params: FactoryPauseRequest): Promise => + connection.sendRequest("session.factory.pause", { sessionId, ...params }), /** * Records a batch of ordered factory progress lines. * @@ -24841,6 +25084,15 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ switchAutoTier: async (params: ModelSwitchAutoTierRequest): Promise => connection.sendRequest("session.model.switchAutoTier", { sessionId, ...params }), + /** + * Replaces or clears the host-supplied model allowlist for a running session. + * + * @param params Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. + * + * @returns The applied host allowlist and effective session model policy after intersection. + */ + setAllowedModels: async (params: ModelSetAllowedModelsRequest): Promise => + connection.sendRequest("session.model.setAllowedModels", { sessionId, ...params }), /** * Updates the session's reasoning effort without changing the selected model. * @@ -26647,6 +26899,13 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI */ resumeFromTool: async (params: FactoryToolResumeRequest): Promise => connection.sendRequest("session.factory.resumeFromTool", { sessionId, ...params }), + /** + * Atomically pauses an owned factory attempt at a durable checkpoint. + * + * @param params Parameters for an owned durable pause checkpoint. + */ + pauseAtCheckpoint: async (params: FactoryPauseCheckpointRequest): Promise => + connection.sendRequest("session.factory.pauseAtCheckpoint", { sessionId, ...params }), }, /** @experimental */ model: { diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 02fbad6c5c..eb455e9e64 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -23,6 +23,7 @@ export type SessionEvent = | InfoEvent | WarningEvent | ModelChangeEvent + | AutoTierRecommendationEvent | AutoTierSwitchFailedEvent | ModeChangedEvent | ModeNoticeDeliveredEvent @@ -142,7 +143,7 @@ export type SessionEvent = | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent; /** - * Routing preference used when the session model is `auto`. + * Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference. */ export type AutoTier = /** Optimize for efficiency. */ @@ -150,7 +151,9 @@ export type AutoTier = /** Balance efficiency and intelligence. */ | "balance" /** Optimize for intelligence. */ - | "intelligence"; + | "intelligence" + /** Integrator-only preset that optimizes for latency. */ + | "fast"; /** * Hosting platform type of the repository (github or ado) */ @@ -267,6 +270,16 @@ export type ModelChangeSource = | "automatic" /** An SDK or RPC caller selected the model. */ | "sdk"; +/** + * Auto preferences that Copilot API can recommend. + */ +export type RecommendedAutoTier = + /** Optimize for efficiency. */ + | "efficiency" + /** Balance efficiency and intelligence. */ + | "balance" + /** Optimize for intelligence. */ + | "intelligence"; /** * Terminal reason an Auto preference activation failed. */ @@ -706,6 +719,18 @@ export type SkillInvokedTrigger = | "agent-invoked" /** Skill content loaded as part of another context, such as a configured custom agent or subagent. */ | "context-load"; +/** + * Where the model input for a task-tool sub-agent came from. + */ +export type SubagentTaskModelSource = + /** The spawning agent supplied the task tool's model argument. */ + | "task_argument" + /** The task omitted a model and the per-sub-agent settings entry supplied a concrete one. */ + | "subagent_configuration" + /** The task omitted a model and the user-defined custom agent's definition supplied one. */ + | "custom_agent_definition" + /** Neither the task call, the per-sub-agent settings entry, nor a custom agent definition supplied a model. */ + | "unset"; /** * Binary asset type discriminator. Use "image" for images and "resource" otherwise. */ @@ -742,6 +767,26 @@ export type SystemNotificationAgentCompletedStatus = | "completed" /** The agent failed. */ | "failed"; +/** + * Durable metadata describing who initiated a factory pause. + */ +export type SystemNotificationFactoryPauseInfo = + | { + /** + * Factory pause initiator discriminator. + */ + type: "user"; + } + | { + /** + * Stable author-defined checkpoint key that initiated the pause. + */ + key: string; + /** + * Factory pause initiator discriminator. + */ + type: "checkpoint"; + }; /** * Terminal status reached by a factory execution attempt. */ @@ -750,6 +795,8 @@ export type SystemNotificationFactoryCompletedStatus = | "completed" /** The factory was halted. */ | "halted" + /** The factory attempt paused intentionally. */ + | "paused" /** The factory was cancelled. */ | "cancelled" /** The factory failed. */ @@ -1062,6 +1109,8 @@ export type FactoryRunSettledStatus = | "completed" /** The run was stopped by a limit, an approval refusal or another policy decision. */ | "halted" + /** The attempt paused intentionally while preserving resumable run state. */ + | "paused" /** The run was cancelled by its caller or by session disposal. */ | "cancelled" /** The run failed, with `failureType` carrying the class when it has one. */ @@ -1950,6 +1999,44 @@ export interface ModelChangeData { source?: ModelChangeSource; verbosity?: Verbosity; } +/** + * Session event "session.auto_tier_recommendation". Live-only Auto preference recommendation from Copilot API after a successful Auto model call. + */ +/** @experimental */ +export interface AutoTierRecommendationEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AutoTierRecommendationData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.auto_tier_recommendation". + */ + type: "session.auto_tier_recommendation"; +} +/** + * Live-only Auto preference recommendation from Copilot API after a successful Auto model call. + */ +/** @experimental */ +export interface AutoTierRecommendationData { + recommendedAutoTier: RecommendedAutoTier; +} /** * Session event "session.auto_tier_switch_failed". A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. */ @@ -2154,13 +2241,13 @@ export interface PermissionsChangedData { * * @experimental */ - mode: PermissionMode; + mode?: PermissionMode; /** * Permission mode before the change * * @experimental */ - previousMode: PermissionMode; + previousMode?: PermissionMode; } /** * Session event "session.plan_changed". Plan file operation details indicating what changed @@ -2989,6 +3076,12 @@ export interface CompactionCompleteEvent { * Conversation compaction results including success status, metrics, and optional error details */ export interface CompactionCompleteData { + /** + * Authoritative active-factory reminder appended to the compacted context + * + * @internal + */ + activeFactorySummary?: string; /** * Canonical model identifier used for model-specific behavior when replaying compaction */ @@ -3108,6 +3201,12 @@ export interface CompactionCompleteCompactionTokensUsed { */ /** @internal */ export interface CompactionCompleteCompactionTokensUsedCopilotUsage { + /** + * Default billing model for token details that do not identify their own model + * + * @internal + */ + model?: string; /** * Itemized token usage breakdown * @@ -3131,6 +3230,10 @@ export interface CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail { * Cost per batch of tokens */ costPerBatch: number; + /** + * Model responsible for this billing entry + */ + model?: string; /** * Total token count for this entry */ @@ -4928,6 +5031,10 @@ export interface AssistantMessageData { * Model that produced this assistant message, if known */ model?: string; + /** + * Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. + */ + originatingMessageId?: string; /** * Actual output token count from the API response (completion_tokens), used for accurate token accounting */ @@ -5630,6 +5737,10 @@ export interface AssistantUsageData { * Per-request cost and usage data from the CAPI copilot_usage response field */ export interface AssistantUsageCopilotUsage { + /** + * Default billing model for token details that do not identify their own model + */ + model?: string; /** * Itemized token usage breakdown * @@ -5653,6 +5764,10 @@ export interface AssistantUsageCopilotUsageTokenDetail { * Cost per batch of tokens */ costPerBatch: number; + /** + * Model responsible for this billing entry + */ + model?: string; /** * Total token count for this entry */ @@ -7015,6 +7130,7 @@ export interface SubagentStartedData { * Whether this sub-agent can be resumed. Currently always false. */ resumable?: boolean; + taskModelSource?: SubagentTaskModelSource; /** * Tool call ID of the parent tool invocation that spawned this sub-agent */ @@ -7839,6 +7955,7 @@ export interface SystemNotificationFactoryCompleted { * Machine-readable terminal failure details, when present. */ failure?: JsonValue; + pauseInfo?: SystemNotificationFactoryPauseInfo; /** * Bounded prompt-safe preview of the completed result. */ @@ -7972,6 +8089,10 @@ export interface PermissionRequestShell { * What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. Only meaningful when requestSandboxBypass is true. */ requestSandboxBypassReason?: string; + /** + * True when the requested escalation is a permissive retry rather than a full bypass: the command re-runs inside the sandbox with its file and process restrictions recording instead of blocking, while the network policy stays enforced. Always accompanied by requestSandboxBypass, so hosts that do not recognize this field still treat the request as the escalation it is. Hosts that do recognize it must not describe the command as running outside the sandbox, which would overstate the privilege being granted. + */ + requestSandboxPermissive?: boolean; /** * Tool call ID that triggered this permission request */ @@ -8460,6 +8581,18 @@ export interface PermissionPromptRequestCommands { * Whether managed policy requires a human response and forbids host auto-approval */ managedApprovalRequired?: boolean; + /** + * True when the shell command is requesting sandbox escalation. This is a request, not a grant. + */ + requestSandboxBypass?: boolean; + /** + * Reason for the sandbox escalation request. + */ + requestSandboxBypassReason?: string; + /** + * True when the escalation is a permissive retry that keeps the sandbox and network policy attached while recording file and process accesses instead of blocking them. + */ + requestSandboxPermissive?: boolean; /** * Tool call ID that triggered this permission request */ @@ -11121,6 +11254,10 @@ export interface CustomAgentsUpdatedAgent { * Description of what the agent does */ description: string; + /** + * Whether model-driven invocation is disabled for this agent. + */ + disableModelInvocation?: boolean; /** * Human-readable display name */ diff --git a/nodejs/src/index.ts b/nodejs/src/index.ts index 6251df4fc7..1e321fb0be 100644 --- a/nodejs/src/index.ts +++ b/nodejs/src/index.ts @@ -116,6 +116,7 @@ export type { DefaultAgentConfig, BearerTokenProvider, MessageOptions, + ResponseSchema, MessageSource, ManagedSettings, ManagedSettingsPermissions, diff --git a/nodejs/src/schema.ts b/nodejs/src/schema.ts new file mode 100644 index 0000000000..29d9426758 --- /dev/null +++ b/nodejs/src/schema.ts @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +import type { ResponseSchema, ZodSchema } from "./types.js"; + +export function isZodSchema(value: unknown): value is ZodSchema { + return ( + typeof value === "object" && + value !== null && + "toJSONSchema" in value && + typeof value.toJSONSchema === "function" + ); +} + +export function toJsonSchema( + schema: ZodSchema | Record | undefined +): Record | undefined { + return isZodSchema(schema) ? schema.toJSONSchema() : schema; +} + +export function isResponseSchema(value: unknown): value is ResponseSchema { + return isZodSchema(value) && "parse" in value && typeof value.parse === "function"; +} diff --git a/nodejs/src/session.ts b/nodejs/src/session.ts index 4c2be14299..1c8f3811dc 100644 --- a/nodejs/src/session.ts +++ b/nodejs/src/session.ts @@ -23,6 +23,7 @@ import type { import { type Canvas, CanvasError } from "./canvas.js"; import type { OpenCanvasInstance } from "./generated/rpc.js"; import { getTraceContext } from "./telemetry.js"; +import { isResponseSchema, toJsonSchema } from "./schema.js"; import { isAttributedPermissionResult } from "./types.js"; import type { CommandHandler, @@ -39,6 +40,7 @@ import type { BearerTokenProvider, UiInputOptions, MessageOptions, + ResponseSchema, McpAuthHandler, McpAuthRequest, PermissionHandler, @@ -442,6 +444,7 @@ export class CopilotSession { private _capabilities: SessionCapabilities = {}; private openCanvasInstances: OpenCanvasInstance[] = []; private disconnected = false; + private readonly pendingStructuredWaits = new Set<(error: Error) => void>(); private disconnecting = false; private onDisconnected?: () => void; @@ -725,6 +728,18 @@ export class CopilotSession { mode: options.mode, agentMode: options.agentMode, requestHeaders: options.requestHeaders, + ...(options.responseSchema + ? { + responseFormat: { + type: "json_schema", + jsonSchema: { + name: "response", + strict: true, + schema: toJsonSchema(options.responseSchema), + }, + }, + } + : {}), }); return (response as { messageId: string }).messageId; @@ -738,6 +753,9 @@ export class CopilotSession { * assistant has finished processing the message. * * Events are still delivered to handlers registered via {@link on} while waiting. + * With a schema as the second argument, returns its parsed, validated result. + * Structured waits select only root-agent output originating from this send; + * other queued work may delay session.idle but cannot replace the result. * * @param options - The message options including the prompt and optional attachments * @param timeout - Timeout in milliseconds (default: 60000). Controls how long to wait; does not abort in-flight agent work. @@ -754,17 +772,46 @@ export class CopilotSession { * ``` */ async sendAndWait(prompt: string, timeout?: number): Promise; + async sendAndWait( + options: MessageOptions | string, + responseSchema: ResponseSchema, + timeout?: number + ): Promise; async sendAndWait( options: MessageOptions, timeout?: number ): Promise; async sendAndWait( optionsOrPrompt: MessageOptions | string, + schemaOrTimeout?: ResponseSchema | number, timeout?: number - ): Promise { + ): Promise { const options: MessageOptions = typeof optionsOrPrompt === "string" ? { prompt: optionsOrPrompt } : optionsOrPrompt; - const effectiveTimeout = timeout ?? 60_000; + const typedSchema = isResponseSchema(schemaOrTimeout) ? schemaOrTimeout : undefined; + const effectiveTimeout = + (typeof schemaOrTimeout === "number" ? schemaOrTimeout : timeout) ?? 60_000; + + if (typedSchema && options.responseSchema) { + throw new Error( + "Do not specify responseSchema in options when requesting a typed response." + ); + } + if (typedSchema || options.responseSchema) { + const message = await this.sendAndWaitForStructuredMessage( + typedSchema ? { ...options, responseSchema: typedSchema } : options, + effectiveTimeout + ); + if (typedSchema) { + if (!message) { + throw new Error( + "The requested run completed without a structured assistant response." + ); + } + return typedSchema.parse(JSON.parse(message.data.content)); + } + return message; + } type SessionOutcome = { kind: "idle" } | { kind: "error"; error: Error }; let resolveOutcome: (outcome: SessionOutcome) => void; @@ -817,12 +864,114 @@ export class CopilotSession { } } + private async sendAndWaitForStructuredMessage( + options: MessageOptions, + timeout: number + ): Promise { + if (this.disconnected) { + throw new Error("Session is disconnected"); + } + type Outcome = + | { kind: "idle"; message: AssistantMessageEvent | undefined } + | { kind: "error"; error: Error }; + let resolveOutcome!: (outcome: Outcome) => void; + const outcomePromise = new Promise((resolve) => { + resolveOutcome = resolve; + }); + const fail = (error: Error) => resolveOutcome({ kind: "error", error }); + let messageId: string | undefined; + let consumed = false; + let lastMessage: AssistantMessageEvent | undefined; + const buffered: SessionEvent[] = []; + const observe = (event: SessionEvent) => { + if (event.agentId) return; + if (event.type === "user.message" && event.data.messageId === messageId) { + consumed = true; + } else if ( + event.type === "assistant.message" && + event.data.originatingMessageId === messageId + ) { + consumed = true; + lastMessage = event.data.toolRequests?.length ? undefined : event; + } else if ( + consumed && + event.type === "session.idle" && + event.data.mode !== "autopilot" + ) { + if (event.data.aborted) { + fail( + new Error( + "The requested run was aborted before a structured result was completed." + ) + ); + } else { + resolveOutcome({ kind: "idle", message: lastMessage }); + } + } else if (consumed && event.type === "session.error") { + const error = new Error(event.data.message); + error.stack = event.data.stack; + fail(error); + } + }; + const unsubscribe = this.on((event) => { + if ( + event.type !== "user.message" && + event.type !== "assistant.message" && + event.type !== "session.idle" && + event.type !== "session.error" + ) { + return; + } + if (messageId === undefined) { + buffered.push(event); + } else { + observe(event); + } + }); + this.pendingStructuredWaits.add(fail); + const timer = setTimeout( + () => fail(new Error(`Timeout after ${timeout}ms waiting for the structured response`)), + timeout + ); + try { + const sendOutcome = this.send(options).then( + (id) => { + if (!id) { + throw new Error( + "The runtime did not return a message ID for the structured send." + ); + } + messageId = id; + for (const event of buffered) observe(event); + buffered.length = 0; + return outcomePromise; + }, + (error: unknown): Outcome => ({ + kind: "error", + error: error instanceof Error ? error : new Error(String(error)), + }) + ); + const outcome = await Promise.race([sendOutcome, outcomePromise]); + if (outcome.kind === "error") throw outcome.error; + return outcome.message; + } finally { + clearTimeout(timer); + buffered.length = 0; + unsubscribe(); + this.pendingStructuredWaits.delete(fail); + } + } + /** @internal */ _markDisconnected(): void { if (this.disconnected) { return; } this.disconnected = true; + for (const fail of this.pendingStructuredWaits) { + fail(new Error("Session disconnected while waiting for a structured response")); + } + this.pendingStructuredWaits.clear(); for (const controller of this.pendingExternalTools.values()) { controller.abort(); } diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index 068e0f0a58..f6eddb303a 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -710,6 +710,14 @@ export interface ZodSchema { toJSONSchema(): Record; } +/** + * A Zod-compatible output schema that both describes and parses a typed result. + * TypeScript types are erased at runtime, so typed output requires a schema value. + */ +export interface ResponseSchema extends ZodSchema { + parse(value: unknown): T; +} + /** * Tool definition. Parameters can be either: * - A Zod schema (provides type inference for handler) @@ -3389,6 +3397,18 @@ export interface MessageOptions { * If provided, this is shown in the timeline instead of `prompt`. */ displayPrompt?: string; + + /** + * JSON Schema or a Zod schema for this run's output, including requests after tool calls. + * Later sends do not inherit it. Ordinary immediate steering inherits the active schema; + * specifying a schema with mode "immediate" is rejected. + * + * sendAndWait still returns an assistant message event. For a typed result, pass a + * Zod-compatible schema as sendAndWait's second argument instead. + * Streaming events remain text and may include intermediate messages. + * Use rpc.send's responseFormat for provider-specific name, description and strict options. + */ + responseSchema?: ZodSchema | Record; } /** diff --git a/nodejs/test/e2e/structured_output.e2e.test.ts b/nodejs/test/e2e/structured_output.e2e.test.ts new file mode 100644 index 0000000000..4ddd8a5d15 --- /dev/null +++ b/nodejs/test/e2e/structured_output.e2e.test.ts @@ -0,0 +1,211 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +import { describe, expect, expectTypeOf, it } from "vitest"; +import { z } from "zod"; +import { + approveAll, + defineTool, + type CopilotSession, + type ProviderConfig, + type SessionEvent, +} from "../../src/index.js"; +import { createSdkTestContext, DEFAULT_GITHUB_TOKEN, isCI } from "./harness/sdkTestContext"; +import { waitForCondition } from "./harness/sdkTestHelper"; + +describe("Structured output", async () => { + const { copilotClient: client, openAiEndpoint } = await createSdkTestContext(); + const provider: ProviderConfig = { + type: "openai", + wireApi: "completions", + baseUrl: openAiEndpoint.url, + modelId: "gpt-4.1", + wireModel: "gpt-4.1", + apiKey: isCI ? DEFAULT_GITHUB_TOKEN : (process.env.GITHUB_TOKEN ?? DEFAULT_GITHUB_TOKEN), + headers: { + "Copilot-Integration-Id": "copilot-developer-cli", + "Copilot-Harness-Id": "copilot-sdk", + "X-GitHub-Api-Version": "2026-08-01", + }, + }; + + it("node_raw_schema_and_unformatted_followup", async () => { + const session = await client.createSession({ + model: "gpt-4.1", + provider, + onPermissionRequest: approveAll, + availableTools: [], + }); + const schema = { + type: "object", + properties: { + answer: { type: "integer" }, + contract: { type: "string", enum: ["raw_schema"] }, + }, + required: ["answer", "contract"], + additionalProperties: false, + }; + const result = await session.sendAndWait({ + prompt: "What is 19 + 23? Do not use tools.", + responseSchema: schema, + }); + expect( + result, + JSON.stringify( + (await openAiEndpoint.getExchanges()).map((exchange) => exchange.response) + ) + ).toBeDefined(); + expect(JSON.parse(result!.data.content)).toEqual({ answer: 42, contract: "raw_schema" }); + expect(result!.data.originatingMessageId).toBeTruthy(); + + const ordinary = await session.sendAndWait( + "Reply exactly SCHEMA_CLEARED without JSON or quotes." + ); + expect(ordinary?.data.content).toBe("SCHEMA_CLEARED"); + const exchanges = await openAiEndpoint.getExchanges(); + expect(exchanges).toHaveLength(2); + expect(exchanges[0].request).toMatchObject({ + response_format: { + type: "json_schema", + json_schema: { name: "response", strict: true, schema }, + }, + }); + expect(exchanges[1].request).not.toHaveProperty("response_format"); + }); + + it("node_zod_typed_result_after_terminal_tool_and_steering", async () => { + const events: SessionEvent[] = []; + let session: CopilotSession; + session = await client.createSession({ + model: "gpt-4.1", + provider, + onPermissionRequest: approveAll, + availableTools: [], + streaming: true, + onEvent: (event) => events.push(event), + tools: [ + defineTool("lookup_number", { + description: "Return the number needed for the calculation.", + parameters: z.object({}), + skipPermission: true, + isTerminal: true, + handler: async () => { + await session.send({ + prompt: "Continue with the original calculation. Do not call any more tools.", + mode: "immediate", + }); + return 58; + }, + }), + ], + }); + const schema = z.object({ answer: z.number().int(), contract: z.literal("typed_tool") }); + const result = await session.sendAndWait( + "Call lookup_number exactly once, then add 5 to the returned number. Do not guess its result.", + schema + ); + expectTypeOf(result).toEqualTypeOf<{ answer: number; contract: "typed_tool" }>(); + expect(result).toEqual({ answer: 63, contract: "typed_tool" }); + expect(events.some((event) => event.type === "tool.execution_complete")).toBe(true); + expect(events.some((event) => event.type === "assistant.message_delta")).toBe(true); + const exchanges = await openAiEndpoint.getExchanges(); + expect(exchanges.length).toBeGreaterThanOrEqual(2); + for (const exchange of exchanges) { + expect(exchange.request).toHaveProperty( + "response_format.json_schema.schema", + schema.toJSONSchema() + ); + } + }); + + it("node_concurrent_typed_sends_return_their_own_results", async () => { + let markToolEntered!: () => void; + let releaseTool!: () => void; + const toolEntered = new Promise((resolve) => { + markToolEntered = resolve; + }); + const toolReleased = new Promise((resolve) => { + releaseTool = resolve; + }); + const session = await client.createSession({ + model: "gpt-4.1", + provider, + onPermissionRequest: approveAll, + availableTools: [], + tools: [ + defineTool("first_number", { + description: "Get the number for the first question.", + parameters: z.object({}), + skipPermission: true, + handler: async () => { + markToolEntered(); + await toolReleased; + return 42; + }, + }), + ], + }); + const first = session.sendAndWait( + "Call first_number exactly once and report its returned number.", + z.object({ first: z.number().int(), contract: z.literal("first") }) + ); + try { + await Promise.race([ + toolEntered, + first.then(() => { + throw new Error("First run completed without calling first_number"); + }), + ]); + const secondPrompt = "What is 30 + 7? Do not use tools."; + const second = session.sendAndWait( + secondPrompt, + z.object({ second: z.number().int(), contract: z.literal("second") }) + ); + const results = Promise.all([first, second]); + await Promise.race([ + waitForCondition( + async () => + (await session.rpc.queue.pendingItems()).items.some((item) => + item.displayText.includes(secondPrompt) + ), + { timeoutMessage: "Second structured send was not queued behind the tool call" } + ), + results.then(() => { + throw new Error("Runs completed before the tool was released"); + }), + ]); + releaseTool(); + const [firstResult, secondResult] = await results; + expect(firstResult).toEqual({ first: 42, contract: "first" }); + expect(secondResult).toEqual({ second: 37, contract: "second" }); + } finally { + releaseTool(); + } + }); + + it("node_generated_rpc_accepts_a_batch_response_format", async () => { + const session = await client.createSession({ + model: "gpt-4.1", + provider, + onPermissionRequest: approveAll, + availableTools: [], + }); + const schema = z.object({ total: z.number().int() }); + const events: SessionEvent[] = []; + session.on((event) => events.push(event)); + const response = await session.rpc.sendMessages({ + messages: [{ prompt: "What is 16 + 26? Do not use tools." }], + responseFormat: { + type: "json_schema", + jsonSchema: { name: "batch", strict: true, schema: schema.toJSONSchema() }, + }, + wait: true, + }); + const final = events.findLast((event) => event.type === "assistant.message"); + expect(final?.type).toBe("assistant.message"); + if (final?.type !== "assistant.message") throw new Error("No assistant response"); + expect(schema.parse(JSON.parse(final.data.content))).toEqual({ total: 42 }); + expect(final.data.originatingMessageId).toBe(response.messageIds[0]); + }); +}); diff --git a/nodejs/test/structured-output.test.ts b/nodejs/test/structured-output.test.ts new file mode 100644 index 0000000000..d3686b752c --- /dev/null +++ b/nodejs/test/structured-output.test.ts @@ -0,0 +1,241 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +import { afterEach, describe, expect, expectTypeOf, it, vi } from "vitest"; +import type { MessageConnection } from "vscode-jsonrpc/node.js"; +import { z } from "zod"; +import { CopilotSession } from "../src/session.js"; +import type { SessionEvent } from "../src/generated/session-events.js"; +import type { MessageOptions } from "../src/types.js"; + +const answer = z.object({ answer: z.number().int() }); + +function event(type: SessionEvent["type"], data: unknown, agentId?: string): SessionEvent { + return { + type, + data, + agentId, + id: crypto.randomUUID(), + timestamp: new Date().toISOString(), + parentId: null, + } as SessionEvent; +} + +function user(messageId: string): SessionEvent { + return event("user.message", { messageId, content: "question", turnId: "0" }); +} + +function assistant(originatingMessageId: string, content: string, agentId?: string): SessionEvent { + return event( + "assistant.message", + { messageId: crypto.randomUUID(), originatingMessageId, content, turnId: "1" }, + agentId + ); +} + +function controlledSession() { + const sends: Array<{ + params: Record; + resolve: (value: { messageId: string }) => void; + reject: (error: Error) => void; + }> = []; + const sendRequest = vi.fn((_method: string, params: Record) => { + return new Promise<{ messageId: string }>((resolve, reject) => { + sends.push({ params, resolve, reject }); + }); + }); + const session = new CopilotSession("session", { sendRequest } as unknown as MessageConnection); + return { session, sends, sendRequest }; +} + +async function sent(sends: unknown[], count = 1) { + await vi.waitFor(() => expect(sends).toHaveLength(count)); +} + +describe("structured output", () => { + afterEach(() => vi.useRealTimers()); + + it("infers TResult from a Zod schema and forwards its JSON Schema", async () => { + const { session, sends } = controlledSession(); + const pending = session.sendAndWait("What is 19 + 23?", answer); + expectTypeOf(pending).toEqualTypeOf>(); + await sent(sends); + expect(sends[0].params.responseFormat).toEqual({ + type: "json_schema", + jsonSchema: { name: "response", strict: true, schema: answer.toJSONSchema() }, + }); + session._dispatchEvent(user("one")); + session._dispatchEvent(assistant("one", '{"answer":42}')); + session._dispatchEvent(event("session.idle", {})); + sends[0].resolve({ messageId: "one" }); + await expect(pending).resolves.toEqual({ answer: 42 }); + }); + + it("keeps raw schema sends and options-based Zod sends event-shaped", async () => { + for (const schema of [answer.toJSONSchema(), answer]) { + const { session, sends } = controlledSession(); + const options: MessageOptions = { prompt: "question", responseSchema: schema }; + const pending = session.sendAndWait(options); + await sent(sends); + const final = assistant("one", '{"answer":42}'); + sends[0].resolve({ messageId: "one" }); + session._dispatchEvent(user("one")); + session._dispatchEvent(final); + session._dispatchEvent(event("session.idle", {})); + await expect(pending).resolves.toEqual(final); + } + }); + + it("isolates queued concurrent sends and excludes subagent messages", async () => { + const { session, sends } = controlledSession(); + const first = session.sendAndWait("first", answer); + const second = session.sendAndWait("second", answer); + await sent(sends, 2); + session._dispatchEvent(event("session.idle", {})); + session._dispatchEvent(user("one")); + session._dispatchEvent(assistant("one", "intermediate tool-call text")); + session._dispatchEvent(assistant("one", '{"answer":42}')); + session._dispatchEvent(user("two")); + session._dispatchEvent(assistant("two", '{"answer":37}')); + session._dispatchEvent(assistant("one", '{"answer":999}', "subagent")); + session._dispatchEvent(assistant("unrelated", '{"answer":123}')); + session._dispatchEvent(event("session.idle", {})); + sends[1].resolve({ messageId: "two" }); + sends[0].resolve({ messageId: "one" }); + await expect(first).resolves.toEqual({ answer: 42 }); + await expect(second).resolves.toEqual({ answer: 37 }); + }); + + it("freezes the final message at idle even when more events precede send acknowledgement", async () => { + const { session, sends } = controlledSession(); + const pending = session.sendAndWait("question", answer); + await sent(sends); + session._dispatchEvent(user("one")); + session._dispatchEvent(assistant("one", '{"answer":42}')); + session._dispatchEvent(event("session.idle", {})); + session._dispatchEvent(assistant("one", '{"answer":999}')); + sends[0].resolve({ messageId: "one" }); + await expect(pending).resolves.toEqual({ answer: 42 }); + }); + + it("ignores autopilot idle boundaries until a final idle", async () => { + const { session, sends } = controlledSession(); + const pending = session.sendAndWait("question", answer); + await sent(sends); + session._dispatchEvent(user("one")); + session._dispatchEvent(event("session.idle", { mode: "autopilot" })); + session._dispatchEvent(assistant("one", '{"answer":42}')); + session._dispatchEvent(event("session.idle", {})); + sends[0].resolve({ messageId: "one" }); + await expect(pending).resolves.toEqual({ answer: 42 }); + }); + + it.each(["refusal", '{"answer":"not a number"}', "null"])( + "rejects invalid final output: %s", + async (content) => { + const { session, sends } = controlledSession(); + const pending = session.sendAndWait("question", answer); + const assertion = expect(pending).rejects.toThrow(); + await sent(sends); + session._dispatchEvent(user("one")); + session._dispatchEvent(assistant("one", content)); + session._dispatchEvent(event("session.idle", {})); + sends[0].resolve({ messageId: "one" }); + await assertion; + } + ); + + it("rejects missing or uncorrelated output rather than borrowing another message", async () => { + const { session, sends } = controlledSession(); + const pending = session.sendAndWait("question", answer); + const assertion = expect(pending).rejects.toThrow( + "without a structured assistant response" + ); + await sent(sends); + session._dispatchEvent(user("one")); + session._dispatchEvent(assistant("two", '{"answer":42}')); + session._dispatchEvent(event("session.idle", {})); + sends[0].resolve({ messageId: "one" }); + await assertion; + }); + + it("rejects conflicting explicit and inferred schemas before sending", async () => { + const { session, sendRequest } = controlledSession(); + await expect( + session.sendAndWait({ prompt: "question", responseSchema: answer }, answer) + ).rejects.toThrow("Do not specify responseSchema"); + expect(sendRequest).not.toHaveBeenCalled(); + }); + + it("does not return a partial result after abort", async () => { + const { session, sends } = controlledSession(); + const pending = session.sendAndWait("question", answer); + const assertion = expect(pending).rejects.toThrow("aborted"); + await sent(sends); + session._dispatchEvent(user("one")); + session._dispatchEvent(assistant("one", '{"answer":42}')); + session._dispatchEvent(event("session.idle", { aborted: true })); + sends[0].resolve({ messageId: "one" }); + await assertion; + }); + + it("does not parse a tool-call message as the final result", async () => { + const { session, sends } = controlledSession(); + const pending = session.sendAndWait("question", answer); + const assertion = expect(pending).rejects.toThrow( + "without a structured assistant response" + ); + await sent(sends); + session._dispatchEvent(user("one")); + session._dispatchEvent( + event("assistant.message", { + messageId: "assistant-one", + originatingMessageId: "one", + content: '{"answer":42}', + toolRequests: [{ toolCallId: "tool-one", name: "lookup" }], + }) + ); + session._dispatchEvent(event("session.idle", {})); + sends[0].resolve({ messageId: "one" }); + await assertion; + }); + + it("propagates send and model failures", async () => { + const first = controlledSession(); + const sendFailure = first.session.sendAndWait("question", answer); + const sendAssertion = expect(sendFailure).rejects.toThrow("admission failed"); + await sent(first.sends); + first.sends[0].reject(new Error("admission failed")); + await sendAssertion; + + const second = controlledSession(); + const modelFailure = second.session.sendAndWait("question", answer); + const modelAssertion = expect(modelFailure).rejects.toThrow("provider rejected"); + await sent(second.sends); + second.session._dispatchEvent(user("one")); + second.session._dispatchEvent( + event("session.error", { message: "provider rejected", errorType: "query" }) + ); + second.sends[0].resolve({ messageId: "one" }); + await modelAssertion; + }); + + it("times out even while send acknowledgement is pending", async () => { + vi.useFakeTimers(); + const { session } = controlledSession(); + const pending = session.sendAndWait("question", answer, 100); + const assertion = expect(pending).rejects.toThrow("Timeout after 100ms"); + await vi.advanceTimersByTimeAsync(100); + await assertion; + }); + + it("rejects promptly when the session disconnects", async () => { + const { session, sends } = controlledSession(); + const pending = session.sendAndWait("question", answer); + const assertion = expect(pending).rejects.toThrow("Session disconnected"); + await sent(sends); + session._markDisconnected(); + await assertion; + }); +}); diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index ac4cc5441d..a91cb0a5fe 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -1099,7 +1099,8 @@ class CapiSessionOptions: resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no - preference is supplied or restored, CAPI default routing is used. + preference is supplied or restored, CAPI default routing is used. `fast` is an + integrator-only latency preset, not a first-party GitHub Copilot product preference. """ enable_web_socket_responses: bool | None = None """Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when @@ -2971,6 +2972,9 @@ class KindEnum(Enum): class FactoryAbortRequest: """Parameters for cooperatively aborting a factory body.""" + execution_token: str + """Opaque token identifying the execution attempt to abort.""" + run_id: str """Factory run identifier.""" @@ -2980,12 +2984,14 @@ class FactoryAbortRequest: @staticmethod def from_dict(obj: Any) -> 'FactoryAbortRequest': assert isinstance(obj, dict) + execution_token = from_str(obj.get("executionToken")) run_id = from_str(obj.get("runId")) session_id = from_str(obj.get("sessionId")) - return FactoryAbortRequest(run_id, session_id) + return FactoryAbortRequest(execution_token, run_id, session_id) def to_dict(self) -> dict: result: dict = {} + result["executionToken"] = from_str(self.execution_token) result["runId"] = from_str(self.run_id) result["sessionId"] = from_str(self.session_id) return result @@ -3011,10 +3017,10 @@ class FactoryAgentOptions: Subagent execution options. """ agent: str | None = None - """Optional custom agent name for the subagent. This field is accepted but not yet honored.""" + """Optional built-in or custom agent name whose definition configures the subagent.""" context_tier: ContextTier | None = None - """Optional context tier for the subagent. This field is accepted but not yet honored.""" + """Optional context tier override for the subagent.""" label: str | None = None """Optional label distinguishing otherwise identical memoized agent calls.""" @@ -3023,7 +3029,7 @@ class FactoryAgentOptions: """Optional model identifier for the subagent.""" reasoning_effort: str | None = None - """Optional reasoning effort for the subagent. This field is accepted but not yet honored.""" + """Optional reasoning effort override for the subagent.""" schema: Any = None """Optional JSON Schema for structured agent output.""" @@ -3460,6 +3466,7 @@ class FactoryRunStatus(Enum): COMPLETED = "completed" ERROR = "error" HALTED = "halted" + PAUSED = "paused" PENDING = "pending" RUNNING = "running" @@ -3480,6 +3487,10 @@ class FactoryRunFailureType(Enum): FACTORY_PROVIDER_DISCONNECTED = "factory_provider_disconnected" FACTORY_RESUME_DECLINED = "factory_resume_declined" +class PauseInfoType(Enum): + CHECKPOINT = "checkpoint" + USER = "user" + # Experimental: this type is part of an experimental API and may change or be removed. class FactoryLogLineKind(Enum): """Progress line kind. @@ -3491,6 +3502,63 @@ class FactoryLogLineKind(Enum): LOG = "log" PHASE = "phase" +# Experimental: this type is part of an experimental API and may change or be removed. +class FactoryPauseCheckpointAction(Enum): + """Action the runtime selected for a durable factory pause checkpoint. + + Whether this execution attempt must pause or may continue. + """ + CONTINUE = "continue" + PAUSE = "pause" + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FactoryPauseCheckpointRequest: + """Parameters for an owned durable pause checkpoint.""" + + execution_token: str + """Opaque token identifying the execution attempt that reached the checkpoint.""" + + key: str + """Stable author-defined checkpoint key.""" + + run_id: str + """Factory run identifier.""" + + @staticmethod + def from_dict(obj: Any) -> 'FactoryPauseCheckpointRequest': + assert isinstance(obj, dict) + execution_token = from_str(obj.get("executionToken")) + key = from_str(obj.get("key")) + run_id = from_str(obj.get("runId")) + return FactoryPauseCheckpointRequest(execution_token, key, run_id) + + def to_dict(self) -> dict: + result: dict = {} + result["executionToken"] = from_str(self.execution_token) + result["key"] = from_str(self.key) + result["runId"] = from_str(self.run_id) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FactoryPauseRequest: + """Parameters for pausing a running factory.""" + + run_id: str + """Factory run identifier.""" + + @staticmethod + def from_dict(obj: Any) -> 'FactoryPauseRequest': + assert isinstance(obj, dict) + run_id = from_str(obj.get("runId")) + return FactoryPauseRequest(run_id) + + def to_dict(self) -> dict: + result: dict = {} + result["runId"] = from_str(self.run_id) + return result + # Experimental: this type is part of an experimental API and may change or be removed. class FactoryPhaseStatus(Enum): """Derived lifecycle state of the phase. @@ -3531,9 +3599,9 @@ class FactoryRunLimits: def from_dict(obj: Any) -> 'FactoryRunLimits': assert isinstance(obj, dict) max_ai_credits = from_union([from_float, from_none], obj.get("maxAiCredits")) - max_concurrent_subagents = from_union([from_int, from_none], obj.get("maxConcurrentSubagents")) - max_total_subagents = from_union([from_int, from_none], obj.get("maxTotalSubagents")) - timeout_seconds = from_union([from_float, from_none], obj.get("timeoutSeconds")) + max_concurrent_subagents = from_union([from_none, from_int], obj.get("maxConcurrentSubagents")) + max_total_subagents = from_union([from_none, from_int], obj.get("maxTotalSubagents")) + timeout_seconds = from_union([from_none, from_float], obj.get("timeoutSeconds")) return FactoryRunLimits(max_ai_credits, max_concurrent_subagents, max_total_subagents, timeout_seconds) def to_dict(self) -> dict: @@ -3541,11 +3609,11 @@ def to_dict(self) -> dict: if self.max_ai_credits is not None: result["maxAiCredits"] = from_union([to_float, from_none], self.max_ai_credits) if self.max_concurrent_subagents is not None: - result["maxConcurrentSubagents"] = from_union([from_int, from_none], self.max_concurrent_subagents) + result["maxConcurrentSubagents"] = from_union([from_none, from_int], self.max_concurrent_subagents) if self.max_total_subagents is not None: - result["maxTotalSubagents"] = from_union([from_int, from_none], self.max_total_subagents) + result["maxTotalSubagents"] = from_union([from_none, from_int], self.max_total_subagents) if self.timeout_seconds is not None: - result["timeoutSeconds"] = from_union([to_float, from_none], self.timeout_seconds) + result["timeoutSeconds"] = from_union([from_none, to_float], self.timeout_seconds) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -4313,6 +4381,49 @@ def to_dict(self) -> dict: result["interrupted"] = from_bool(self.interrupted) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class JSONSchemaResponseFormat: + """A JSON Schema output contract. OpenAI receives the name, description, schema and strict + setting; Anthropic receives the schema in output_config.format and always uses its native + strict enforcement. + + JSON Schema and provider options for the turn's output. + """ + name: str + """Name of the output schema, subject to the provider's naming restrictions.""" + + schema: Any = None + """JSON Schema passed unchanged to the inference provider. Supported keywords and schema + restrictions are determined by that provider. + """ + description: str | None = None + """Optional description passed to OpenAI providers.""" + + strict: bool | None = None + """Optional strict enforcement setting for OpenAI providers. Omitted uses the provider + default. Anthropic always enforces its supported schema subset. + """ + + @staticmethod + def from_dict(obj: Any) -> 'JSONSchemaResponseFormat': + assert isinstance(obj, dict) + name = from_str(obj.get("name")) + schema = obj.get("schema") + description = from_union([from_str, from_none], obj.get("description")) + strict = from_union([from_bool, from_none], obj.get("strict")) + return JSONSchemaResponseFormat(name, schema, description, strict) + + def to_dict(self) -> dict: + result: dict = {} + result["name"] = from_str(self.name) + result["schema"] = self.schema + if self.description is not None: + result["description"] = from_union([from_str, from_none], self.description) + if self.strict is not None: + result["strict"] = from_union([from_bool, from_none], self.strict) + return result + @dataclass class LlmInferenceHTTPRequestChunkRequest: """A request body chunk or cancellation signal.""" @@ -6966,6 +7077,46 @@ def to_dict(self) -> dict: result["supported_media_types"] = from_union([lambda x: from_list(from_str, x), from_none], self.supported_media_types) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ModelSetAllowedModelsResult: + """The applied host allowlist and effective session model policy after intersection.""" + + allowed_models: list[str] | None = None + """Normalized host allowlist. Omitted when the host restriction was cleared, or when a relay + client does not return the host policy. + """ + effective_allowed_models: list[str] | None = None + """Effective exact IDs or repository policy patterns after applying the host restriction. + Omitted by relay clients that do not return the host policy. + """ + fallback_model: str | None = None + """Effective deterministic fallback model, when the policy defines one.""" + + model_id: str | None = None + """Selected session model after reconciling a now-disallowed concrete selection.""" + + @staticmethod + def from_dict(obj: Any) -> 'ModelSetAllowedModelsResult': + assert isinstance(obj, dict) + allowed_models = from_union([lambda x: from_list(from_str, x), from_none], obj.get("allowedModels")) + effective_allowed_models = from_union([lambda x: from_list(from_str, x), from_none], obj.get("effectiveAllowedModels")) + fallback_model = from_union([from_str, from_none], obj.get("fallbackModel")) + model_id = from_union([from_str, from_none], obj.get("modelId")) + return ModelSetAllowedModelsResult(allowed_models, effective_allowed_models, fallback_model, model_id) + + def to_dict(self) -> dict: + result: dict = {} + if self.allowed_models is not None: + result["allowedModels"] = from_union([lambda x: from_list(from_str, x), from_none], self.allowed_models) + if self.effective_allowed_models is not None: + result["effectiveAllowedModels"] = from_union([lambda x: from_list(from_str, x), from_none], self.effective_allowed_models) + if self.fallback_model is not None: + result["fallbackModel"] = from_union([from_str, from_none], self.fallback_model) + if self.model_id is not None: + result["modelId"] = from_union([from_str, from_none], self.model_id) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ModelSetReasoningEffortRequest: @@ -9691,6 +9842,9 @@ def to_dict(self) -> dict: result["branch"] = from_union([from_str, from_none], self.branch) return result +class ResponseFormatType(Enum): + JSON_SCHEMA = "json_schema" + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SandboxConfigAuth: @@ -9876,6 +10030,30 @@ class _SandboxConfigSource(Enum): USER_DISABLED = "user_disabled" USER_ENABLED = "user_enabled" +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SandboxDisableForSessionResult: + """Result of attempting to disable sandboxing for the current session.""" + + enabled: bool + """The authoritative sandbox enabled state after the operation.""" + + success: bool + """Whether this call resolved the pending request and applied the session opt-out.""" + + @staticmethod + def from_dict(obj: Any) -> 'SandboxDisableForSessionResult': + assert isinstance(obj, dict) + enabled = from_bool(obj.get("enabled")) + success = from_bool(obj.get("success")) + return SandboxDisableForSessionResult(enabled, success) + + def to_dict(self) -> dict: + result: dict = {} + result["enabled"] = from_bool(self.enabled) + result["success"] = from_bool(self.success) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SandboxEnforcementStatus: @@ -16715,6 +16893,32 @@ def to_dict(self) -> dict: result["items"] = from_list(lambda x: to_class(SessionCompletionItem, x), self.items) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ModelSetAllowedModelsRequest: + """Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are + intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs + remain exempt from repository-only policy but are restricted by this host list. Omit or + pass null to clear the host restriction; an explicit empty or disjoint list is rejected. + Validation and pre-selection fallback failures preserve the previous restriction. + Failures after a fallback selection commits retain the new restriction and selected + model; callers should inspect current session state after such an error. + """ + allowed_models: list[str] | None = None + """Exact model IDs to permit, or null to clear the host restriction.""" + + @staticmethod + def from_dict(obj: Any) -> 'ModelSetAllowedModelsRequest': + assert isinstance(obj, dict) + allowed_models = from_union([lambda x: from_list(from_str, x), from_none], obj.get("allowedModels")) + return ModelSetAllowedModelsRequest(allowed_models) + + def to_dict(self) -> dict: + result: dict = {} + if self.allowed_models is not None: + result["allowedModels"] = from_union([lambda x: from_list(from_str, x), from_none], self.allowed_models) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class DebugCollectLogsCollectedEntry: @@ -17645,6 +17849,9 @@ class FactoryRunFailure: kind: FactoryRunFailureKind | None = None """Resource ceiling that stopped the run.""" + suggested_value: float | None = None + """Suggested larger ceiling when the runtime can derive one safely.""" + value: float | None = None """Approved effective ceiling that was reached.""" @@ -17666,12 +17873,13 @@ def from_dict(obj: Any) -> 'FactoryRunFailure': run_id = from_str(obj.get("runId")) type = FactoryRunFailureType(obj.get("type")) kind = from_union([FactoryRunFailureKind, from_none], obj.get("kind")) + suggested_value = from_union([from_float, from_none], obj.get("suggestedValue")) value = from_union([from_float, from_none], obj.get("value")) reason = from_union([from_str, from_none], obj.get("reason")) code = from_union([from_str, from_none], obj.get("code")) operation = from_union([FactoryDurableOperation, from_none], obj.get("operation")) drained_nano_aiu = from_union([from_int, from_none], obj.get("drainedNanoAiu")) - return FactoryRunFailure(run_id, type, kind, value, reason, code, operation, drained_nano_aiu) + return FactoryRunFailure(run_id, type, kind, suggested_value, value, reason, code, operation, drained_nano_aiu) def to_dict(self) -> dict: result: dict = {} @@ -17679,6 +17887,8 @@ def to_dict(self) -> dict: result["type"] = to_enum(FactoryRunFailureType, self.type) if self.kind is not None: result["kind"] = from_union([lambda x: to_enum(FactoryRunFailureKind, x), from_none], self.kind) + if self.suggested_value is not None: + result["suggestedValue"] = from_union([to_float, from_none], self.suggested_value) if self.value is not None: result["value"] = from_union([to_float, from_none], self.value) if self.reason is not None: @@ -17691,6 +17901,55 @@ def to_dict(self) -> dict: result["drainedNanoAiu"] = from_union([from_int, from_none], self.drained_nano_aiu) return result +@dataclass +class PauseInfoClass: + type: PauseInfoType + """Factory pause initiator discriminator.""" + + key: str | None = None + """Stable author-defined checkpoint key that initiated the pause.""" + + @staticmethod + def from_dict(obj: Any) -> 'PauseInfoClass': + assert isinstance(obj, dict) + type = PauseInfoType(obj.get("type")) + key = from_union([from_str, from_none], obj.get("key")) + return PauseInfoClass(type, key) + + def to_dict(self) -> dict: + result: dict = {} + result["type"] = to_enum(PauseInfoType, self.type) + if self.key is not None: + result["key"] = from_union([from_str, from_none], self.key) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FactoryPauseInfo: + """Durable metadata describing who initiated a factory pause. + + Structured pause initiator metadata for a paused attempt. + """ + type: PauseInfoType + """Factory pause initiator discriminator.""" + + key: str | None = None + """Stable author-defined checkpoint key that initiated the pause.""" + + @staticmethod + def from_dict(obj: Any) -> 'FactoryPauseInfo': + assert isinstance(obj, dict) + type = PauseInfoType(obj.get("type")) + key = from_union([from_str, from_none], obj.get("key")) + return FactoryPauseInfo(type, key) + + def to_dict(self) -> dict: + result: dict = {} + result["type"] = to_enum(PauseInfoType, self.type) + if self.key is not None: + result["key"] = from_union([from_str, from_none], self.key) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class FactoryLogLine: @@ -17764,6 +18023,40 @@ def to_dict(self) -> dict: result["phaseId"] = from_union([from_none, from_str], self.phase_id) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FactoryPauseCheckpointResult: + action: FactoryPauseCheckpointAction + """Whether this execution attempt must pause or may continue.""" + + @staticmethod + def from_dict(obj: Any) -> 'FactoryPauseCheckpointResult': + assert isinstance(obj, dict) + action = FactoryPauseCheckpointAction(obj.get("action")) + return FactoryPauseCheckpointResult(action) + + def to_dict(self) -> dict: + result: dict = {} + result["action"] = to_enum(FactoryPauseCheckpointAction, self.action) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionFactoryPauseAtCheckpointResult: + action: FactoryPauseCheckpointAction + """Whether this execution attempt must pause or may continue.""" + + @staticmethod + def from_dict(obj: Any) -> 'SessionFactoryPauseAtCheckpointResult': + assert isinstance(obj, dict) + action = FactoryPauseCheckpointAction(obj.get("action")) + return SessionFactoryPauseAtCheckpointResult(action) + + def to_dict(self) -> dict: + result: dict = {} + result["action"] = to_enum(FactoryPauseCheckpointAction, self.action) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class FactoryPhaseObservation: @@ -21491,6 +21784,8 @@ class PermissionDecisionContext: Optional informational context describing how and where this response was made. Omit it to preserve legacy behavior without attributing an origin. + + Optional attribution for the permission decision. """ outcome: PermissionDecisionOutcome """Disposition of the permission request as observed by the responding client.""" @@ -22185,45 +22480,67 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class PluginsDisableRequest: - """Plugin names (or specs) to disable.""" - + """Plugin names (or specs) to disable, plus the optional working directory the + repository-controlled guard is evaluated against. + """ names: list[str] """Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. """ + working_directory: str | None = None + """Working directory whose repository `enabledPlugins` overlay decides whether this mutation + is repository-controlled. Hosts that serve sessions across several repositories (the SDK + server) should pass the session's directory; otherwise the guard is evaluated against the + server process's own working directory, which may belong to a different repository. + Defaults to the server's current working directory. + """ @staticmethod def from_dict(obj: Any) -> 'PluginsDisableRequest': assert isinstance(obj, dict) names = from_list(from_str, obj.get("names")) - return PluginsDisableRequest(names) + working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) + return PluginsDisableRequest(names, working_directory) def to_dict(self) -> dict: result: dict = {} result["names"] = from_list(from_str, self.names) + if self.working_directory is not None: + result["workingDirectory"] = from_union([from_str, from_none], self.working_directory) return result # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class PluginsEnableRequest: - """Plugin names (or specs) to enable.""" - + """Plugin names (or specs) to enable, plus the optional working directory the + repository-controlled guard is evaluated against. + """ names: list[str] """Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. """ + working_directory: str | None = None + """Working directory whose repository `enabledPlugins` overlay decides whether this mutation + is repository-controlled. Hosts that serve sessions across several repositories (the SDK + server) should pass the session's directory; otherwise the guard is evaluated against the + server process's own working directory, which may belong to a different repository. + Defaults to the server's current working directory. + """ @staticmethod def from_dict(obj: Any) -> 'PluginsEnableRequest': assert isinstance(obj, dict) names = from_list(from_str, obj.get("names")) - return PluginsEnableRequest(names) + working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) + return PluginsEnableRequest(names, working_directory) def to_dict(self) -> dict: result: dict = {} result["names"] = from_list(from_str, self.names) + if self.working_directory is not None: + result["workingDirectory"] = from_union([from_str, from_none], self.working_directory) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -22921,116 +23238,6 @@ def to_dict(self) -> dict: result["wait"] = from_union([from_bool, from_none], self.wait) return result -# Experimental: this type is part of an experimental API and may change or be removed. -@dataclass -class SendRequest: - """Parameters for sending a user message to the session""" - - prompt: str - """The user message text""" - - agent_mode: SendAgentMode | None = None - """The UI mode the agent was in when this message was sent. Defaults to the session's - current mode. - """ - attachments: list[Attachment] | None = None - """Optional attachments (files, directories, selections, blobs, GitHub references) to - include with the message - """ - billable: bool | None = None - """If false, this message will not trigger a Premium Request Unit charge. User messages - default to billable. - """ - display_prompt: str | None = None - """If provided, this is shown in the timeline instead of `prompt`""" - - mode: SendMode | None = None - """How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` - interjects during an in-progress turn. - """ - prepend: bool | None = None - """If true, adds the message to the front of the queue instead of the end""" - - request_headers: dict[str, str] | None = None - """Custom HTTP headers to include in outbound model requests for this turn. Merged with - session-level provider headers; per-turn headers augment and overwrite session-level - headers with the same key. - """ - required_tool: str | None = None - """If set, the request will fail if the named tool is not available when this message is - among the user messages at the start of the current exchange - """ - # Internal: this field is an internal SDK API and is not part of the public surface. - source: str | None = None - """Optional provenance tag copied to the resulting user.message event. Must be `user`, - `system`, `command-` for command-originated messages, `schedule-` - for scheduled prompts, or `agent-` for prompts sent by another agent. - """ - traceparent: str | None = None - """W3C Trace Context traceparent header for distributed tracing of this agent turn""" - - tracestate: str | None = None - """W3C Trace Context tracestate header for distributed tracing""" - - wait: bool | None = None - """If true, await completion of the agentic loop for this message before returning. Defaults - to false (fire-and-forget). When true, the result still contains the same `messageId`; - the caller can rely on the agent having processed the message before the call resolves. - Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally - blocks until the completed turn's event tail has been dispatched to this session's - in-process subscribers, so a subsequent read of subscriber state already reflects the - turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery - follows over the wire. Callers that need the stronger local guarantee on remote sessions - should await the event stream explicitly. - """ - - @staticmethod - def from_dict(obj: Any) -> 'SendRequest': - assert isinstance(obj, dict) - prompt = from_str(obj.get("prompt")) - agent_mode = from_union([SendAgentMode, from_none], obj.get("agentMode")) - attachments = from_union([lambda x: from_list(Attachment.from_dict, x), from_none], obj.get("attachments")) - billable = from_union([from_bool, from_none], obj.get("billable")) - display_prompt = from_union([from_str, from_none], obj.get("displayPrompt")) - mode = from_union([SendMode, from_none], obj.get("mode")) - prepend = from_union([from_bool, from_none], obj.get("prepend")) - request_headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("requestHeaders")) - required_tool = from_union([from_str, from_none], obj.get("requiredTool")) - source = from_union([from_str, from_none], obj.get("source")) - traceparent = from_union([from_str, from_none], obj.get("traceparent")) - tracestate = from_union([from_str, from_none], obj.get("tracestate")) - wait = from_union([from_bool, from_none], obj.get("wait")) - return SendRequest(prompt, agent_mode, attachments, billable, display_prompt, mode, prepend, request_headers, required_tool, source, traceparent, tracestate, wait) - - def to_dict(self) -> dict: - result: dict = {} - result["prompt"] = from_str(self.prompt) - if self.agent_mode is not None: - result["agentMode"] = from_union([lambda x: to_enum(SendAgentMode, x), from_none], self.agent_mode) - if self.attachments is not None: - result["attachments"] = from_union([lambda x: from_list(lambda x: to_class(Attachment, x), x), from_none], self.attachments) - if self.billable is not None: - result["billable"] = from_union([from_bool, from_none], self.billable) - if self.display_prompt is not None: - result["displayPrompt"] = from_union([from_str, from_none], self.display_prompt) - if self.mode is not None: - result["mode"] = from_union([lambda x: to_enum(SendMode, x), from_none], self.mode) - if self.prepend is not None: - result["prepend"] = from_union([from_bool, from_none], self.prepend) - if self.request_headers is not None: - result["requestHeaders"] = from_union([lambda x: from_dict(from_str, x), from_none], self.request_headers) - if self.required_tool is not None: - result["requiredTool"] = from_union([from_str, from_none], self.required_tool) - if self.source is not None: - result["source"] = from_union([from_str, from_none], self.source) - if self.traceparent is not None: - result["traceparent"] = from_union([from_str, from_none], self.traceparent) - if self.tracestate is not None: - result["tracestate"] = from_union([from_str, from_none], self.tracestate) - if self.wait is not None: - result["wait"] = from_union([from_bool, from_none], self.wait) - return result - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class QueuePendingItems: @@ -23302,6 +23509,43 @@ def to_dict(self) -> dict: result["mode"] = from_union([lambda x: to_enum(RemoteSessionMode, x), from_none], self.mode) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ResponseFormat: + """Provider-native structured output format. JSON Schema is forwarded without rewriting or + validating the schema or the generated output. + + Provider-native output format for the whole turn, including an empty message batch and + all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering + inherits the active format; specifying responseFormat with mode: immediate is an error, + even while idle. Returned assistant content remains text; the runtime does not parse or + validate it. Unsupported models or schemas produce provider errors. + + Provider-native output format for this turn, including all tool-call iterations. Not + inherited by later turns or subagents. Ordinary steering inherits the active format; + specifying responseFormat with mode: immediate is an error, even while idle. Returned + assistant content remains text; the runtime does not parse or validate it. Unsupported + models or schemas produce provider errors. + """ + json_schema: JSONSchemaResponseFormat + """JSON Schema and provider options for the turn's output.""" + + type: ResponseFormatType + """Output format discriminator. Currently only json_schema is supported.""" + + @staticmethod + def from_dict(obj: Any) -> 'ResponseFormat': + assert isinstance(obj, dict) + json_schema = JSONSchemaResponseFormat.from_dict(obj.get("jsonSchema")) + type = ResponseFormatType(obj.get("type")) + return ResponseFormat(json_schema, type) + + def to_dict(self) -> dict: + result: dict = {} + result["jsonSchema"] = to_class(JSONSchemaResponseFormat, self.json_schema) + result["type"] = to_enum(ResponseFormatType, self.type) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SandboxConfigUserPolicyExperimental: @@ -23430,83 +23674,6 @@ def to_dict(self) -> dict: result["entry"] = from_union([lambda x: to_class(ScheduleEntry, x), from_none], self.entry) return result -# Experimental: this type is part of an experimental API and may change or be removed. -@dataclass -class SendMessagesRequest: - """Parameters for sending zero or more user messages to the session in a single turn. - Remote-backed (Mission Control) sessions do not support this method and will return an - error. - """ - messages: list[SendMessageItem] - """The user messages to append to the conversation, in order. May be empty, in which case a - single turn runs over the existing history with no new user message. - """ - agent_mode: SendAgentMode | None = None - """The UI mode the agent was in when these messages were sent. Defaults to the session's - current mode. - """ - mode: SendMode | None = None - """How to deliver the messages. `enqueue` (default) appends to the message queue. - `immediate` interjects during an in-progress turn. - """ - prepend: bool | None = None - """If true, adds the messages to the front of the queue instead of the end""" - - request_headers: dict[str, str] | None = None - """Custom HTTP headers to include in outbound model requests for this turn. Merged with - session-level provider headers; per-turn headers augment and overwrite session-level - headers with the same key. - """ - traceparent: str | None = None - """W3C Trace Context traceparent header for distributed tracing of this agent turn""" - - tracestate: str | None = None - """W3C Trace Context tracestate header for distributed tracing""" - - wait: bool | None = None - """If true, await completion of the agentic loop for this turn before returning. Defaults to - false (fire-and-forget). When true, the result still contains the same `messageIds`; the - caller can rely on the agent having processed the messages before the call resolves. - Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally - blocks until the completed turn's event tail has been dispatched to this session's - in-process subscribers, so a subsequent read of subscriber state already reflects the - turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery - follows over the wire. Callers that need the stronger local guarantee on remote sessions - should await the event stream explicitly. - """ - - @staticmethod - def from_dict(obj: Any) -> 'SendMessagesRequest': - assert isinstance(obj, dict) - messages = from_list(SendMessageItem.from_dict, obj.get("messages")) - agent_mode = from_union([SendAgentMode, from_none], obj.get("agentMode")) - mode = from_union([SendMode, from_none], obj.get("mode")) - prepend = from_union([from_bool, from_none], obj.get("prepend")) - request_headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("requestHeaders")) - traceparent = from_union([from_str, from_none], obj.get("traceparent")) - tracestate = from_union([from_str, from_none], obj.get("tracestate")) - wait = from_union([from_bool, from_none], obj.get("wait")) - return SendMessagesRequest(messages, agent_mode, mode, prepend, request_headers, traceparent, tracestate, wait) - - def to_dict(self) -> dict: - result: dict = {} - result["messages"] = from_list(lambda x: to_class(SendMessageItem, x), self.messages) - if self.agent_mode is not None: - result["agentMode"] = from_union([lambda x: to_enum(SendAgentMode, x), from_none], self.agent_mode) - if self.mode is not None: - result["mode"] = from_union([lambda x: to_enum(SendMode, x), from_none], self.mode) - if self.prepend is not None: - result["prepend"] = from_union([from_bool, from_none], self.prepend) - if self.request_headers is not None: - result["requestHeaders"] = from_union([lambda x: from_dict(from_str, x), from_none], self.request_headers) - if self.traceparent is not None: - result["traceparent"] = from_union([from_str, from_none], self.traceparent) - if self.tracestate is not None: - result["tracestate"] = from_union([from_str, from_none], self.tracestate) - if self.wait is not None: - result["wait"] = from_union([from_bool, from_none], self.wait) - return result - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ServerSkillList: @@ -24166,6 +24333,9 @@ class AgentInfo: name: str """Name of the agent. Use `id` as the stable selection identifier.""" + disable_model_invocation: bool | None = None + """Whether model-driven invocation is disabled for this agent.""" + mcp_servers: dict[str, Any] | None = None """MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema. @@ -24210,6 +24380,7 @@ def from_dict(obj: Any) -> 'AgentInfo': display_name = from_str(obj.get("displayName")) id = from_str(obj.get("id")) name = from_str(obj.get("name")) + disable_model_invocation = from_union([from_bool, from_none], obj.get("disableModelInvocation")) 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")) @@ -24220,7 +24391,7 @@ def from_dict(obj: Any) -> 'AgentInfo': 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, model_policy, models, path, prompt, skills, source, tools, user_invocable) + return AgentInfo(description, display_name, id, name, disable_model_invocation, mcp_servers, model, model_policy, models, path, prompt, skills, source, tools, user_invocable) def to_dict(self) -> dict: result: dict = {} @@ -24228,6 +24399,8 @@ def to_dict(self) -> dict: result["displayName"] = from_str(self.display_name) result["id"] = from_str(self.id) result["name"] = from_str(self.name) + if self.disable_model_invocation is not None: + result["disableModelInvocation"] = from_union([from_bool, from_none], self.disable_model_invocation) if self.mcp_servers is not None: result["mcpServers"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.mcp_servers) if self.model is not None: @@ -27092,6 +27265,9 @@ class FactoryRunTerminal: failure: FactoryRunFailure | None = None """Machine-readable terminal failure.""" + pause_info: PauseInfoClass | None = None + """Pause initiator metadata, or null when the run did not pause.""" + reason: str | None = None """Human-readable terminal reason.""" @@ -27103,9 +27279,10 @@ def from_dict(obj: Any) -> 'FactoryRunTerminal': assert isinstance(obj, dict) error = from_union([from_str, from_none], obj.get("error")) failure = from_union([FactoryRunFailure.from_dict, from_none], obj.get("failure")) + pause_info = from_union([PauseInfoClass.from_dict, from_none], obj.get("pauseInfo")) reason = from_union([from_str, from_none], obj.get("reason")) result_preview = from_union([from_str, from_none], obj.get("resultPreview")) - return FactoryRunTerminal(error, failure, reason, result_preview) + return FactoryRunTerminal(error, failure, pause_info, reason, result_preview) def to_dict(self) -> dict: result: dict = {} @@ -27113,6 +27290,7 @@ def to_dict(self) -> dict: result["error"] = from_union([from_str, from_none], self.error) if self.failure is not None: result["failure"] = from_union([lambda x: to_class(FactoryRunFailure, x), from_none], self.failure) + result["pauseInfo"] = from_union([lambda x: to_class(PauseInfoClass, x), from_none], self.pause_info) if self.reason is not None: result["reason"] = from_union([from_str, from_none], self.reason) if self.result_preview is not None: @@ -27142,6 +27320,9 @@ class FactoryRunResult: failure: FactoryRunFailure | None = None """Machine-readable failure details for a halted or errored run.""" + pause_info: FactoryPauseInfo | None = None + """Structured pause initiator metadata for a paused attempt.""" + reason: str | None = None """Reason for a halted or cancelled run.""" @@ -27159,10 +27340,11 @@ def from_dict(obj: Any) -> 'FactoryRunResult': attempt = from_union([from_int, from_none], obj.get("attempt")) error = from_union([from_str, from_none], obj.get("error")) failure = from_union([FactoryRunFailure.from_dict, from_none], obj.get("failure")) + pause_info = from_union([FactoryPauseInfo.from_dict, from_none], obj.get("pauseInfo")) reason = from_union([from_str, from_none], obj.get("reason")) result = obj.get("result") snapshot = obj.get("snapshot") - return FactoryRunResult(run_id, status, attempt, error, failure, reason, result, snapshot) + return FactoryRunResult(run_id, status, attempt, error, failure, pause_info, reason, result, snapshot) def to_dict(self) -> dict: result: dict = {} @@ -27174,6 +27356,8 @@ def to_dict(self) -> dict: result["error"] = from_union([from_str, from_none], self.error) if self.failure is not None: result["failure"] = from_union([lambda x: to_class(FactoryRunFailure, x), from_none], self.failure) + if self.pause_info is not None: + result["pauseInfo"] = from_union([lambda x: to_class(FactoryPauseInfo, x), from_none], self.pause_info) if self.reason is not None: result["reason"] = from_union([from_str, from_none], self.reason) if self.result is not None: @@ -28394,6 +28578,33 @@ def to_dict(self) -> dict: result["decisionContext"] = from_union([lambda x: to_class(PermissionDecisionContext, x), from_none], self.decision_context) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SandboxDisableForSessionRequest: + """Request to disable sandboxing for the current session while resolving an active + sandbox-bypass permission prompt. + """ + request_id: str + """Identifier of the exact pending sandbox-bypass permission request that authorized the + session opt-out. + """ + decision_context: PermissionDecisionContext | None = None + """Optional attribution for the permission decision.""" + + @staticmethod + def from_dict(obj: Any) -> 'SandboxDisableForSessionRequest': + assert isinstance(obj, dict) + request_id = from_str(obj.get("requestId")) + decision_context = from_union([PermissionDecisionContext.from_dict, from_none], obj.get("decisionContext")) + return SandboxDisableForSessionRequest(request_id, decision_context) + + def to_dict(self) -> dict: + result: dict = {} + result["requestId"] = from_str(self.request_id) + if self.decision_context is not None: + result["decisionContext"] = from_union([lambda x: to_class(PermissionDecisionContext, x), from_none], self.decision_context) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class PermissionsConfigureAdditionalContentExclusionPolicy: @@ -28795,6 +29006,213 @@ def to_dict(self) -> dict: 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 SendMessagesRequest: + """Parameters for sending zero or more user messages to the session in a single turn. + Remote-backed (Mission Control) sessions do not support this method and will return an + error. + """ + messages: list[SendMessageItem] + """The user messages to append to the conversation, in order. May be empty, in which case a + single turn runs over the existing history with no new user message. + """ + agent_mode: SendAgentMode | None = None + """The UI mode the agent was in when these messages were sent. Defaults to the session's + current mode. + """ + mode: SendMode | None = None + """How to deliver the messages. `enqueue` (default) appends to the message queue. + `immediate` interjects during an in-progress turn. + """ + prepend: bool | None = None + """If true, adds the messages to the front of the queue instead of the end""" + + request_headers: dict[str, str] | None = None + """Custom HTTP headers to include in outbound model requests for this turn. Merged with + session-level provider headers; per-turn headers augment and overwrite session-level + headers with the same key. + """ + response_format: ResponseFormat | None = None + """Provider-native output format for the whole turn, including an empty message batch and + all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering + inherits the active format; specifying responseFormat with mode: immediate is an error, + even while idle. Returned assistant content remains text; the runtime does not parse or + validate it. Unsupported models or schemas produce provider errors. + """ + traceparent: str | None = None + """W3C Trace Context traceparent header for distributed tracing of this agent turn""" + + tracestate: str | None = None + """W3C Trace Context tracestate header for distributed tracing""" + + wait: bool | None = None + """If true, await completion of the agentic loop for this turn before returning. Defaults to + false (fire-and-forget). When true, the result still contains the same `messageIds`; the + caller can rely on the agent having processed the messages before the call resolves. + Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally + blocks until the completed turn's event tail has been dispatched to this session's + in-process subscribers, so a subsequent read of subscriber state already reflects the + turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery + follows over the wire. Callers that need the stronger local guarantee on remote sessions + should await the event stream explicitly. + """ + + @staticmethod + def from_dict(obj: Any) -> 'SendMessagesRequest': + assert isinstance(obj, dict) + messages = from_list(SendMessageItem.from_dict, obj.get("messages")) + agent_mode = from_union([SendAgentMode, from_none], obj.get("agentMode")) + mode = from_union([SendMode, from_none], obj.get("mode")) + prepend = from_union([from_bool, from_none], obj.get("prepend")) + request_headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("requestHeaders")) + response_format = from_union([ResponseFormat.from_dict, from_none], obj.get("responseFormat")) + traceparent = from_union([from_str, from_none], obj.get("traceparent")) + tracestate = from_union([from_str, from_none], obj.get("tracestate")) + wait = from_union([from_bool, from_none], obj.get("wait")) + return SendMessagesRequest(messages, agent_mode, mode, prepend, request_headers, response_format, traceparent, tracestate, wait) + + def to_dict(self) -> dict: + result: dict = {} + result["messages"] = from_list(lambda x: to_class(SendMessageItem, x), self.messages) + if self.agent_mode is not None: + result["agentMode"] = from_union([lambda x: to_enum(SendAgentMode, x), from_none], self.agent_mode) + if self.mode is not None: + result["mode"] = from_union([lambda x: to_enum(SendMode, x), from_none], self.mode) + if self.prepend is not None: + result["prepend"] = from_union([from_bool, from_none], self.prepend) + if self.request_headers is not None: + result["requestHeaders"] = from_union([lambda x: from_dict(from_str, x), from_none], self.request_headers) + if self.response_format is not None: + result["responseFormat"] = from_union([lambda x: to_class(ResponseFormat, x), from_none], self.response_format) + if self.traceparent is not None: + result["traceparent"] = from_union([from_str, from_none], self.traceparent) + if self.tracestate is not None: + result["tracestate"] = from_union([from_str, from_none], self.tracestate) + if self.wait is not None: + result["wait"] = from_union([from_bool, from_none], self.wait) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SendRequest: + """Parameters for sending a user message to the session""" + + prompt: str + """The user message text""" + + agent_mode: SendAgentMode | None = None + """The UI mode the agent was in when this message was sent. Defaults to the session's + current mode. + """ + attachments: list[Attachment] | None = None + """Optional attachments (files, directories, selections, blobs, GitHub references) to + include with the message + """ + billable: bool | None = None + """If false, this message will not trigger a Premium Request Unit charge. User messages + default to billable. + """ + display_prompt: str | None = None + """If provided, this is shown in the timeline instead of `prompt`""" + + mode: SendMode | None = None + """How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` + interjects during an in-progress turn. + """ + prepend: bool | None = None + """If true, adds the message to the front of the queue instead of the end""" + + request_headers: dict[str, str] | None = None + """Custom HTTP headers to include in outbound model requests for this turn. Merged with + session-level provider headers; per-turn headers augment and overwrite session-level + headers with the same key. + """ + required_tool: str | None = None + """If set, the request will fail if the named tool is not available when this message is + among the user messages at the start of the current exchange + """ + response_format: ResponseFormat | None = None + """Provider-native output format for this turn, including all tool-call iterations. Not + inherited by later turns or subagents. Ordinary steering inherits the active format; + specifying responseFormat with mode: immediate is an error, even while idle. Returned + assistant content remains text; the runtime does not parse or validate it. Unsupported + models or schemas produce provider errors. + """ + # Internal: this field is an internal SDK API and is not part of the public surface. + source: str | None = None + """Optional provenance tag copied to the resulting user.message event. Must be `user`, + `system`, `command-` for command-originated messages, `schedule-` + for scheduled prompts, or `agent-` for prompts sent by another agent. + """ + traceparent: str | None = None + """W3C Trace Context traceparent header for distributed tracing of this agent turn""" + + tracestate: str | None = None + """W3C Trace Context tracestate header for distributed tracing""" + + wait: bool | None = None + """If true, await completion of the agentic loop for this message before returning. Defaults + to false (fire-and-forget). When true, the result still contains the same `messageId`; + the caller can rely on the agent having processed the message before the call resolves. + Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally + blocks until the completed turn's event tail has been dispatched to this session's + in-process subscribers, so a subsequent read of subscriber state already reflects the + turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery + follows over the wire. Callers that need the stronger local guarantee on remote sessions + should await the event stream explicitly. + """ + + @staticmethod + def from_dict(obj: Any) -> 'SendRequest': + assert isinstance(obj, dict) + prompt = from_str(obj.get("prompt")) + agent_mode = from_union([SendAgentMode, from_none], obj.get("agentMode")) + attachments = from_union([lambda x: from_list(Attachment.from_dict, x), from_none], obj.get("attachments")) + billable = from_union([from_bool, from_none], obj.get("billable")) + display_prompt = from_union([from_str, from_none], obj.get("displayPrompt")) + mode = from_union([SendMode, from_none], obj.get("mode")) + prepend = from_union([from_bool, from_none], obj.get("prepend")) + request_headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("requestHeaders")) + required_tool = from_union([from_str, from_none], obj.get("requiredTool")) + response_format = from_union([ResponseFormat.from_dict, from_none], obj.get("responseFormat")) + source = from_union([from_str, from_none], obj.get("source")) + traceparent = from_union([from_str, from_none], obj.get("traceparent")) + tracestate = from_union([from_str, from_none], obj.get("tracestate")) + wait = from_union([from_bool, from_none], obj.get("wait")) + return SendRequest(prompt, agent_mode, attachments, billable, display_prompt, mode, prepend, request_headers, required_tool, response_format, source, traceparent, tracestate, wait) + + def to_dict(self) -> dict: + result: dict = {} + result["prompt"] = from_str(self.prompt) + if self.agent_mode is not None: + result["agentMode"] = from_union([lambda x: to_enum(SendAgentMode, x), from_none], self.agent_mode) + if self.attachments is not None: + result["attachments"] = from_union([lambda x: from_list(lambda x: to_class(Attachment, x), x), from_none], self.attachments) + if self.billable is not None: + result["billable"] = from_union([from_bool, from_none], self.billable) + if self.display_prompt is not None: + result["displayPrompt"] = from_union([from_str, from_none], self.display_prompt) + if self.mode is not None: + result["mode"] = from_union([lambda x: to_enum(SendMode, x), from_none], self.mode) + if self.prepend is not None: + result["prepend"] = from_union([from_bool, from_none], self.prepend) + if self.request_headers is not None: + result["requestHeaders"] = from_union([lambda x: from_dict(from_str, x), from_none], self.request_headers) + if self.required_tool is not None: + result["requiredTool"] = from_union([from_str, from_none], self.required_tool) + if self.response_format is not None: + result["responseFormat"] = from_union([lambda x: to_class(ResponseFormat, x), from_none], self.response_format) + if self.source is not None: + result["source"] = from_union([from_str, from_none], self.source) + if self.traceparent is not None: + result["traceparent"] = from_union([from_str, from_none], self.traceparent) + if self.tracestate is not None: + result["tracestate"] = from_union([from_str, from_none], self.tracestate) + if self.wait is not None: + result["wait"] = from_union([from_bool, from_none], self.wait) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SandboxConfigUserPolicy: @@ -30901,6 +31319,9 @@ def to_dict(self) -> dict: class FactoryRunSummary: """Durable factory run summary with read-time live overlays.""" + can_resume: bool + """Whether the durable run state currently passes runtime resume eligibility checks.""" + consumed: FactoryRunConsumed """Durable resource consumption.""" @@ -30961,6 +31382,7 @@ class FactoryRunSummary: @staticmethod def from_dict(obj: Any) -> 'FactoryRunSummary': assert isinstance(obj, dict) + can_resume = from_bool(obj.get("canResume")) consumed = FactoryRunConsumed.from_dict(obj.get("consumed")) created_at = from_int(obj.get("createdAt")) declared_limits = FactoryDeclaredLimits.from_dict(obj.get("declaredLimits")) @@ -30980,10 +31402,11 @@ def from_dict(obj: Any) -> 'FactoryRunSummary': current_phase = from_union([FactoryCurrentPhase.from_dict, from_none], obj.get("currentPhase")) started_at = from_union([from_int, from_none], obj.get("startedAt")) terminal = from_union([FactoryRunTerminal.from_dict, from_none], obj.get("terminal")) - return FactoryRunSummary(consumed, created_at, declared_limits, declared_phase_count, description, factory_name, live_agent_count, observed_at, revision, run_id, status, total_spawned_agent_count, updated_at, active_segment_started_at, approved, completed_at, current_phase, started_at, terminal) + return FactoryRunSummary(can_resume, consumed, created_at, declared_limits, declared_phase_count, description, factory_name, live_agent_count, observed_at, revision, run_id, status, total_spawned_agent_count, updated_at, active_segment_started_at, approved, completed_at, current_phase, started_at, terminal) def to_dict(self) -> dict: result: dict = {} + result["canResume"] = from_bool(self.can_resume) result["consumed"] = to_class(FactoryRunConsumed, self.consumed) result["createdAt"] = from_int(self.created_at) result["declaredLimits"] = to_class(FactoryDeclaredLimits, self.declared_limits) @@ -34053,6 +34476,9 @@ class FactoryRunDetail: agents: list[FactoryAgentSummary] """Durable identities and live statuses for direct factory agents.""" + can_resume: bool + """Whether the durable run state currently passes runtime resume eligibility checks.""" + consumed: FactoryRunConsumed """Durable resource consumption.""" @@ -34120,6 +34546,7 @@ class FactoryRunDetail: def from_dict(obj: Any) -> 'FactoryRunDetail': assert isinstance(obj, dict) agents = from_list(FactoryAgentSummary.from_dict, obj.get("agents")) + can_resume = from_bool(obj.get("canResume")) consumed = FactoryRunConsumed.from_dict(obj.get("consumed")) created_at = from_int(obj.get("createdAt")) declared_limits = FactoryDeclaredLimits.from_dict(obj.get("declaredLimits")) @@ -34141,11 +34568,12 @@ def from_dict(obj: Any) -> 'FactoryRunDetail': current_phase = from_union([FactoryCurrentPhase.from_dict, from_none], obj.get("currentPhase")) started_at = from_union([from_int, from_none], obj.get("startedAt")) terminal = from_union([FactoryRunTerminal.from_dict, from_none], obj.get("terminal")) - return FactoryRunDetail(agents, consumed, created_at, declared_limits, declared_phase_count, description, factory_name, live_agent_count, observed_at, phases, progress, revision, run_id, status, total_spawned_agent_count, updated_at, active_segment_started_at, approved, completed_at, current_phase, started_at, terminal) + return FactoryRunDetail(agents, can_resume, consumed, created_at, declared_limits, declared_phase_count, description, factory_name, live_agent_count, observed_at, phases, progress, revision, run_id, status, total_spawned_agent_count, updated_at, active_segment_started_at, approved, completed_at, current_phase, started_at, terminal) def to_dict(self) -> dict: result: dict = {} result["agents"] = from_list(lambda x: to_class(FactoryAgentSummary, x), self.agents) + result["canResume"] = from_bool(self.can_resume) result["consumed"] = to_class(FactoryRunConsumed, self.consumed) result["createdAt"] = from_int(self.created_at) result["declaredLimits"] = to_class(FactoryDeclaredLimits, self.declared_limits) @@ -36736,6 +37164,11 @@ class RPC: factory_log_line: FactoryLogLine factory_log_line_kind: FactoryLogLineKind factory_log_request: FactoryLogRequest + factory_pause_checkpoint_action: FactoryPauseCheckpointAction + factory_pause_checkpoint_request: FactoryPauseCheckpointRequest + factory_pause_checkpoint_result: FactoryPauseCheckpointResult + factory_pause_info: FactoryPauseInfo + factory_pause_request: FactoryPauseRequest factory_phase_observation: FactoryPhaseObservation factory_phase_status: FactoryPhaseStatus factory_progress_line: FactoryProgressLine @@ -36818,6 +37251,7 @@ class RPC: instruction_source_type: InstructionSourceType interrupt_main_turn_request: InterruptMainTurnRequest interrupt_main_turn_result: InterruptMainTurnResult + json_schema_response_format: JSONSchemaResponseFormat llm_inference_headers: dict[str, list[str]] llm_inference_http_request_chunk_request: LlmInferenceHTTPRequestChunkRequest llm_inference_http_request_chunk_result: LlmInferenceHTTPRequestChunkResult @@ -37034,6 +37468,8 @@ class RPC: model_picker_settings_context: ModelPickerSettingsContext model_policy: ModelPolicy model_policy_state: ModelPolicyState + model_set_allowed_models_request: ModelSetAllowedModelsRequest + model_set_allowed_models_result: ModelSetAllowedModelsResult model_set_reasoning_effort_request: ModelSetReasoningEffortRequest model_set_reasoning_effort_result: ModelSetReasoningEffortResult models_list_request: ModelsListRequest @@ -37293,6 +37729,7 @@ class RPC: remote_session_metadata_value: RemoteSessionMetadataValue remote_session_mode: RemoteSessionMode remote_session_repository: RemoteSessionRepository + response_format: ResponseFormat run_options: RunOptions sandbox_config: SandboxConfig sandbox_config_auth: SandboxConfigAuth @@ -37304,6 +37741,8 @@ class RPC: sandbox_config_user_policy_network: SandboxConfigUserPolicyNetwork sandbox_config_user_policy_network_proxy: SandboxConfigUserPolicyNetworkProxy sandbox_config_user_policy_seatbelt: SandboxConfigUserPolicySeatbelt + sandbox_disable_for_session_request: SandboxDisableForSessionRequest + sandbox_disable_for_session_result: SandboxDisableForSessionResult sandbox_enforcement_status: SandboxEnforcementStatus schedule_add_at_request: ScheduleAddAtRequest schedule_add_cron_request: ScheduleAddCronRequest @@ -37345,6 +37784,7 @@ class RPC: session_context: SessionContext session_context_host_type: HostType session_enrich_metadata_result: SessionEnrichMetadataResult + session_factory_pause_at_checkpoint_result: SessionFactoryPauseAtCheckpointResult session_fs_append_file_request: SessionFSAppendFileRequest session_fs_error: SessionFSError session_fs_error_code: SessionFSErrorCode @@ -37956,6 +38396,11 @@ def from_dict(obj: Any) -> 'RPC': factory_log_line = FactoryLogLine.from_dict(obj.get("FactoryLogLine")) factory_log_line_kind = FactoryLogLineKind(obj.get("FactoryLogLineKind")) factory_log_request = FactoryLogRequest.from_dict(obj.get("FactoryLogRequest")) + factory_pause_checkpoint_action = FactoryPauseCheckpointAction(obj.get("FactoryPauseCheckpointAction")) + factory_pause_checkpoint_request = FactoryPauseCheckpointRequest.from_dict(obj.get("FactoryPauseCheckpointRequest")) + factory_pause_checkpoint_result = FactoryPauseCheckpointResult.from_dict(obj.get("FactoryPauseCheckpointResult")) + factory_pause_info = FactoryPauseInfo.from_dict(obj.get("FactoryPauseInfo")) + factory_pause_request = FactoryPauseRequest.from_dict(obj.get("FactoryPauseRequest")) factory_phase_observation = FactoryPhaseObservation.from_dict(obj.get("FactoryPhaseObservation")) factory_phase_status = FactoryPhaseStatus(obj.get("FactoryPhaseStatus")) factory_progress_line = FactoryProgressLine.from_dict(obj.get("FactoryProgressLine")) @@ -38038,6 +38483,7 @@ def from_dict(obj: Any) -> 'RPC': instruction_source_type = InstructionSourceType(obj.get("InstructionSourceType")) interrupt_main_turn_request = InterruptMainTurnRequest.from_dict(obj.get("InterruptMainTurnRequest")) interrupt_main_turn_result = InterruptMainTurnResult.from_dict(obj.get("InterruptMainTurnResult")) + json_schema_response_format = JSONSchemaResponseFormat.from_dict(obj.get("JsonSchemaResponseFormat")) llm_inference_headers = from_dict(lambda x: from_list(from_str, x), obj.get("LlmInferenceHeaders")) llm_inference_http_request_chunk_request = LlmInferenceHTTPRequestChunkRequest.from_dict(obj.get("LlmInferenceHttpRequestChunkRequest")) llm_inference_http_request_chunk_result = LlmInferenceHTTPRequestChunkResult.from_dict(obj.get("LlmInferenceHttpRequestChunkResult")) @@ -38254,6 +38700,8 @@ def from_dict(obj: Any) -> 'RPC': model_picker_settings_context = ModelPickerSettingsContext.from_dict(obj.get("ModelPickerSettingsContext")) model_policy = ModelPolicy.from_dict(obj.get("ModelPolicy")) model_policy_state = ModelPolicyState(obj.get("ModelPolicyState")) + model_set_allowed_models_request = ModelSetAllowedModelsRequest.from_dict(obj.get("ModelSetAllowedModelsRequest")) + model_set_allowed_models_result = ModelSetAllowedModelsResult.from_dict(obj.get("ModelSetAllowedModelsResult")) model_set_reasoning_effort_request = ModelSetReasoningEffortRequest.from_dict(obj.get("ModelSetReasoningEffortRequest")) model_set_reasoning_effort_result = ModelSetReasoningEffortResult.from_dict(obj.get("ModelSetReasoningEffortResult")) models_list_request = ModelsListRequest.from_dict(obj.get("ModelsListRequest")) @@ -38513,6 +38961,7 @@ def from_dict(obj: Any) -> 'RPC': remote_session_metadata_value = RemoteSessionMetadataValue.from_dict(obj.get("RemoteSessionMetadataValue")) remote_session_mode = RemoteSessionMode(obj.get("RemoteSessionMode")) remote_session_repository = RemoteSessionRepository.from_dict(obj.get("RemoteSessionRepository")) + response_format = ResponseFormat.from_dict(obj.get("ResponseFormat")) run_options = RunOptions.from_dict(obj.get("RunOptions")) sandbox_config = SandboxConfig.from_dict(obj.get("SandboxConfig")) sandbox_config_auth = SandboxConfigAuth.from_dict(obj.get("SandboxConfigAuth")) @@ -38524,6 +38973,8 @@ def from_dict(obj: Any) -> 'RPC': sandbox_config_user_policy_network = SandboxConfigUserPolicyNetwork.from_dict(obj.get("SandboxConfigUserPolicyNetwork")) sandbox_config_user_policy_network_proxy = SandboxConfigUserPolicyNetworkProxy.from_dict(obj.get("SandboxConfigUserPolicyNetworkProxy")) sandbox_config_user_policy_seatbelt = SandboxConfigUserPolicySeatbelt.from_dict(obj.get("SandboxConfigUserPolicySeatbelt")) + sandbox_disable_for_session_request = SandboxDisableForSessionRequest.from_dict(obj.get("SandboxDisableForSessionRequest")) + sandbox_disable_for_session_result = SandboxDisableForSessionResult.from_dict(obj.get("SandboxDisableForSessionResult")) sandbox_enforcement_status = SandboxEnforcementStatus.from_dict(obj.get("SandboxEnforcementStatus")) schedule_add_at_request = ScheduleAddAtRequest.from_dict(obj.get("ScheduleAddAtRequest")) schedule_add_cron_request = ScheduleAddCronRequest.from_dict(obj.get("ScheduleAddCronRequest")) @@ -38565,6 +39016,7 @@ def from_dict(obj: Any) -> 'RPC': session_context = SessionContext.from_dict(obj.get("SessionContext")) session_context_host_type = HostType(obj.get("SessionContextHostType")) session_enrich_metadata_result = SessionEnrichMetadataResult.from_dict(obj.get("SessionEnrichMetadataResult")) + session_factory_pause_at_checkpoint_result = SessionFactoryPauseAtCheckpointResult.from_dict(obj.get("SessionFactoryPauseAtCheckpointResult")) session_fs_append_file_request = SessionFSAppendFileRequest.from_dict(obj.get("SessionFsAppendFileRequest")) session_fs_error = SessionFSError.from_dict(obj.get("SessionFsError")) session_fs_error_code = SessionFSErrorCode(obj.get("SessionFsErrorCode")) @@ -38924,7 +39376,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, autopilot_objective_credit_limit, autopilot_objective_get_state_result, autopilot_objective_state, autopilot_objective_status, 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, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, 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_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, 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_install_staging_mode, 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, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, 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_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, 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_register_request, tasks_register_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_update_request, tasks_update_result, 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, autopilot_objective_credit_limit, autopilot_objective_get_state_result, autopilot_objective_state, autopilot_objective_status, 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, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, 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_pause_checkpoint_action, factory_pause_checkpoint_request, factory_pause_checkpoint_result, factory_pause_info, factory_pause_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, json_schema_response_format, 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_allowed_models_request, model_set_allowed_models_result, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, 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_install_staging_mode, 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, response_format, 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_disable_for_session_request, sandbox_disable_for_session_result, 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_factory_pause_at_checkpoint_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, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, 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_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, 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_register_request, tasks_register_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_update_request, tasks_update_result, 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 = {} @@ -39176,6 +39628,11 @@ def to_dict(self) -> dict: result["FactoryLogLine"] = to_class(FactoryLogLine, self.factory_log_line) result["FactoryLogLineKind"] = to_enum(FactoryLogLineKind, self.factory_log_line_kind) result["FactoryLogRequest"] = to_class(FactoryLogRequest, self.factory_log_request) + result["FactoryPauseCheckpointAction"] = to_enum(FactoryPauseCheckpointAction, self.factory_pause_checkpoint_action) + result["FactoryPauseCheckpointRequest"] = to_class(FactoryPauseCheckpointRequest, self.factory_pause_checkpoint_request) + result["FactoryPauseCheckpointResult"] = to_class(FactoryPauseCheckpointResult, self.factory_pause_checkpoint_result) + result["FactoryPauseInfo"] = to_class(FactoryPauseInfo, self.factory_pause_info) + result["FactoryPauseRequest"] = to_class(FactoryPauseRequest, self.factory_pause_request) result["FactoryPhaseObservation"] = to_class(FactoryPhaseObservation, self.factory_phase_observation) result["FactoryPhaseStatus"] = to_enum(FactoryPhaseStatus, self.factory_phase_status) result["FactoryProgressLine"] = to_class(FactoryProgressLine, self.factory_progress_line) @@ -39258,6 +39715,7 @@ def to_dict(self) -> dict: result["InstructionSourceType"] = to_enum(InstructionSourceType, self.instruction_source_type) result["InterruptMainTurnRequest"] = to_class(InterruptMainTurnRequest, self.interrupt_main_turn_request) result["InterruptMainTurnResult"] = to_class(InterruptMainTurnResult, self.interrupt_main_turn_result) + result["JsonSchemaResponseFormat"] = to_class(JSONSchemaResponseFormat, self.json_schema_response_format) result["LlmInferenceHeaders"] = from_dict(lambda x: from_list(from_str, x), self.llm_inference_headers) result["LlmInferenceHttpRequestChunkRequest"] = to_class(LlmInferenceHTTPRequestChunkRequest, self.llm_inference_http_request_chunk_request) result["LlmInferenceHttpRequestChunkResult"] = to_class(LlmInferenceHTTPRequestChunkResult, self.llm_inference_http_request_chunk_result) @@ -39474,6 +39932,8 @@ def to_dict(self) -> dict: result["ModelPickerSettingsContext"] = to_class(ModelPickerSettingsContext, self.model_picker_settings_context) result["ModelPolicy"] = to_class(ModelPolicy, self.model_policy) result["ModelPolicyState"] = to_enum(ModelPolicyState, self.model_policy_state) + result["ModelSetAllowedModelsRequest"] = to_class(ModelSetAllowedModelsRequest, self.model_set_allowed_models_request) + result["ModelSetAllowedModelsResult"] = to_class(ModelSetAllowedModelsResult, self.model_set_allowed_models_result) result["ModelSetReasoningEffortRequest"] = to_class(ModelSetReasoningEffortRequest, self.model_set_reasoning_effort_request) result["ModelSetReasoningEffortResult"] = to_class(ModelSetReasoningEffortResult, self.model_set_reasoning_effort_result) result["ModelsListRequest"] = to_class(ModelsListRequest, self.models_list_request) @@ -39733,6 +40193,7 @@ def to_dict(self) -> dict: result["RemoteSessionMetadataValue"] = to_class(RemoteSessionMetadataValue, self.remote_session_metadata_value) result["RemoteSessionMode"] = to_enum(RemoteSessionMode, self.remote_session_mode) result["RemoteSessionRepository"] = to_class(RemoteSessionRepository, self.remote_session_repository) + result["ResponseFormat"] = to_class(ResponseFormat, self.response_format) result["RunOptions"] = to_class(RunOptions, self.run_options) result["SandboxConfig"] = to_class(SandboxConfig, self.sandbox_config) result["SandboxConfigAuth"] = to_class(SandboxConfigAuth, self.sandbox_config_auth) @@ -39744,6 +40205,8 @@ def to_dict(self) -> dict: result["SandboxConfigUserPolicyNetwork"] = to_class(SandboxConfigUserPolicyNetwork, self.sandbox_config_user_policy_network) result["SandboxConfigUserPolicyNetworkProxy"] = to_class(SandboxConfigUserPolicyNetworkProxy, self.sandbox_config_user_policy_network_proxy) result["SandboxConfigUserPolicySeatbelt"] = to_class(SandboxConfigUserPolicySeatbelt, self.sandbox_config_user_policy_seatbelt) + result["SandboxDisableForSessionRequest"] = to_class(SandboxDisableForSessionRequest, self.sandbox_disable_for_session_request) + result["SandboxDisableForSessionResult"] = to_class(SandboxDisableForSessionResult, self.sandbox_disable_for_session_result) result["SandboxEnforcementStatus"] = to_class(SandboxEnforcementStatus, self.sandbox_enforcement_status) result["ScheduleAddAtRequest"] = to_class(ScheduleAddAtRequest, self.schedule_add_at_request) result["ScheduleAddCronRequest"] = to_class(ScheduleAddCronRequest, self.schedule_add_cron_request) @@ -39785,6 +40248,7 @@ def to_dict(self) -> dict: result["SessionContext"] = to_class(SessionContext, self.session_context) result["SessionContextHostType"] = to_enum(HostType, self.session_context_host_type) result["SessionEnrichMetadataResult"] = to_class(SessionEnrichMetadataResult, self.session_enrich_metadata_result) + result["SessionFactoryPauseAtCheckpointResult"] = to_class(SessionFactoryPauseAtCheckpointResult, self.session_factory_pause_at_checkpoint_result) result["SessionFsAppendFileRequest"] = to_class(SessionFSAppendFileRequest, self.session_fs_append_file_request) result["SessionFsError"] = to_class(SessionFSError, self.session_fs_error) result["SessionFsErrorCode"] = to_enum(SessionFSErrorCode, self.session_fs_error_code) @@ -40842,12 +41306,12 @@ async def update_all(self, *, timeout: float | None = None) -> PluginUpdateAllRe return PluginUpdateAllResult.from_dict(await self._client.request("plugins.updateAll", {}, **_timeout_kwargs(timeout))) async def enable(self, params: PluginsEnableRequest, *, timeout: float | None = None) -> None: - "Enables installed plugins for new sessions.\n\nArgs:\n params: Plugin names (or specs) to enable." + "Enables installed plugins for new sessions.\n\nArgs:\n params: Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} await self._client.request("plugins.enable", params_dict, **_timeout_kwargs(timeout)) async def disable(self, params: PluginsDisableRequest, *, timeout: float | None = None) -> None: - "Disables installed plugins for new sessions.\n\nArgs:\n params: Plugin names (or specs) to disable." + "Disables installed plugins for new sessions.\n\nArgs:\n params: Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} await self._client.request("plugins.disable", params_dict, **_timeout_kwargs(timeout)) @@ -41246,6 +41710,12 @@ async def get_enforcement_status(self, *, timeout: float | None = None) -> Sandb "Returns whether managed policy requires sandbox enforcement and whether an enforcement failure has permanently blocked the session.\n\nReturns:\n Managed sandbox enforcement state for a session." return SandboxEnforcementStatus.from_dict(await self._client.request("session.sandbox.getEnforcementStatus", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + async def disable_for_session(self, params: SandboxDisableForSessionRequest, *, timeout: float | None = None) -> SandboxDisableForSessionResult: + "Disables sandboxing for the remainder of the current session and approves the referenced pending sandbox-bypass permission request. The request is rejected unless the exact request is still pending and the effective sandbox policy permits bypass.\n\nArgs:\n params: Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt.\n\nReturns:\n Result of attempting to disable sandboxing for the current session." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return SandboxDisableForSessionResult.from_dict(await self._client.request("session.sandbox.disableForSession", params_dict, **_timeout_kwargs(timeout))) + # Experimental: this API group is experimental and may change or be removed. class GitHubAuthApi: @@ -41386,6 +41856,12 @@ async def cancel(self, params: FactoryCancelRequest, *, timeout: float | None = params_dict["sessionId"] = self._session_id return FactoryRunResult.from_dict(await self._client.request("session.factory.cancel", params_dict, **_timeout_kwargs(timeout))) + async def pause(self, params: FactoryPauseRequest, *, timeout: float | None = None) -> FactoryRunResult: + "Pauses a running factory and returns its settled run envelope.\n\nArgs:\n params: Parameters for pausing a running factory.\n\nReturns:\n Complete current or terminal factory run envelope." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return FactoryRunResult.from_dict(await self._client.request("session.factory.pause", params_dict, **_timeout_kwargs(timeout))) + async def log(self, params: FactoryLogRequest, *, timeout: float | None = None) -> FactoryACKResult: "Records a batch of ordered factory progress lines.\n\nArgs:\n params: Parameters for recording factory progress.\n\nReturns:\n Acknowledgement that a factory request was accepted." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} @@ -41421,6 +41897,12 @@ async def switch_auto_tier(self, params: ModelSwitchAutoTierRequest, *, timeout: params_dict["sessionId"] = self._session_id return ModelSwitchAutoTierResult.from_dict(await self._client.request("session.model.switchAutoTier", params_dict, **_timeout_kwargs(timeout))) + async def set_allowed_models(self, params: ModelSetAllowedModelsRequest, *, timeout: float | None = None) -> ModelSetAllowedModelsResult: + "Replaces or clears the host-supplied model allowlist for a running session.\n\nArgs:\n params: Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error.\n\nReturns:\n The applied host allowlist and effective session model policy after intersection." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return ModelSetAllowedModelsResult.from_dict(await self._client.request("session.model.setAllowedModels", params_dict, **_timeout_kwargs(timeout))) + async def set_reasoning_effort(self, params: ModelSetReasoningEffortRequest, *, timeout: float | None = None) -> ModelSetReasoningEffortResult: "Updates the session's reasoning effort without changing the selected model.\n\nArgs:\n params: Reasoning effort level to apply to the currently selected model.\n\nReturns:\n Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} @@ -42929,6 +43411,12 @@ async def _resume_from_tool(self, params: _FactoryToolResumeRequest, *, timeout: params_dict["sessionId"] = self._session_id return FactoryResumeResult.from_dict(await self._client.request("session.factory.resumeFromTool", params_dict, **_timeout_kwargs(timeout))) + async def _pause_at_checkpoint(self, params: FactoryPauseCheckpointRequest, *, timeout: float | None = None) -> SessionFactoryPauseAtCheckpointResult: + "Atomically pauses an owned factory attempt at a durable checkpoint.\n\nArgs:\n params: Parameters for an owned durable pause checkpoint.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return SessionFactoryPauseAtCheckpointResult.from_dict(await self._client.request("session.factory.pauseAtCheckpoint", params_dict, **_timeout_kwargs(timeout))) + # Experimental: this API group is experimental and may change or be removed. class _InternalModelApi: @@ -43746,6 +44234,11 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "FactoryLogLine", "FactoryLogLineKind", "FactoryLogRequest", + "FactoryPauseCheckpointAction", + "FactoryPauseCheckpointRequest", + "FactoryPauseCheckpointResult", + "FactoryPauseInfo", + "FactoryPauseRequest", "FactoryPhaseObservation", "FactoryPhaseStatus", "FactoryProgressLine", @@ -43841,6 +44334,7 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "InstructionsGetSourcesResult", "InterruptMainTurnRequest", "InterruptMainTurnResult", + "JSONSchemaResponseFormat", "KindEnum", "LimitPredictionApi", "LlmInferenceHTTPRequestChunkRequest", @@ -44091,6 +44585,8 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "ModelPickerSettingsContext", "ModelPolicy", "ModelPolicyState", + "ModelSetAllowedModelsRequest", + "ModelSetAllowedModelsResult", "ModelSetReasoningEffortRequest", "ModelSetReasoningEffortResult", "ModelSwitchAutoTierRequest", @@ -44118,6 +44614,8 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "OptionsUpdateEnvValueMode", "OptionsUpdateReasoningSummary", "OptionsUpdateToolFilterPrecedence", + "PauseInfoClass", + "PauseInfoType", "PendingPermissionRequest", "PendingPermissionRequestList", "PermissionDecision", @@ -44410,6 +44908,8 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "RemoteSessionMetadataValue", "RemoteSessionMode", "RemoteSessionRepository", + "ResponseFormat", + "ResponseFormatType", "RunOptions", "SandboxApi", "SandboxConfig", @@ -44421,6 +44921,8 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "SandboxConfigUserPolicyNetwork", "SandboxConfigUserPolicyNetworkProxy", "SandboxConfigUserPolicySeatbelt", + "SandboxDisableForSessionRequest", + "SandboxDisableForSessionResult", "SandboxEnforcementStatus", "Saved", "ScheduleAddAtRequest", @@ -44525,6 +45027,7 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "SessionFSStatRequest", "SessionFSStatResult", "SessionFSWriteFileRequest", + "SessionFactoryPauseAtCheckpointResult", "SessionFsHandler", "SessionFsReaddirWithTypesEntryType", "SessionGitHubAuthGetAllAuthAvailableResult", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index 52f1053a1f..fb8a9f4eae 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -136,6 +136,8 @@ class SessionEventType(Enum): SESSION_INFO = "session.info" SESSION_WARNING = "session.warning" SESSION_MODEL_CHANGE = "session.model_change" + # Experimental: this event is part of an experimental API and may change or be removed. + SESSION_AUTO_TIER_RECOMMENDATION = "session.auto_tier_recommendation" SESSION_AUTO_TIER_SWITCH_FAILED = "session.auto_tier_switch_failed" SESSION_MODE_CHANGED = "session.mode_changed" SESSION_MODE_NOTICE_DELIVERED = "session.mode_notice_delivered" @@ -1571,6 +1573,26 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionAutoTierRecommendationData: + "Live-only Auto preference recommendation from Copilot API after a successful Auto model call." + recommended_auto_tier: RecommendedAutoTier + + @staticmethod + def from_dict(obj: Any) -> "SessionAutoTierRecommendationData": + assert isinstance(obj, dict) + recommended_auto_tier = parse_enum(RecommendedAutoTier, obj.get("recommendedAutoTier")) + return SessionAutoTierRecommendationData( + recommended_auto_tier=recommended_auto_tier, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["recommendedAutoTier"] = to_enum(RecommendedAutoTier, self.recommended_auto_tier) + return result + + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionCanvasClosedData: @@ -2208,30 +2230,32 @@ def to_dict(self) -> dict: class SessionPermissionsChangedData: "Permission-mode transition details." # Experimental: this field is part of an experimental API and may change or be removed. - mode: PermissionMode + assisted_approval_model: str | None = None # Experimental: this field is part of an experimental API and may change or be removed. - previous_mode: PermissionMode + mode: PermissionMode | None = None # Experimental: this field is part of an experimental API and may change or be removed. - assisted_approval_model: str | None = None + previous_mode: PermissionMode | None = None @staticmethod def from_dict(obj: Any) -> "SessionPermissionsChangedData": assert isinstance(obj, dict) - mode = parse_enum(PermissionMode, obj.get("mode")) - previous_mode = parse_enum(PermissionMode, obj.get("previousMode")) assisted_approval_model = from_union([from_none, from_str], obj.get("assistedApprovalModel")) + mode = from_union([from_none, lambda x: parse_enum(PermissionMode, x)], obj.get("mode")) + previous_mode = from_union([from_none, lambda x: parse_enum(PermissionMode, x)], obj.get("previousMode")) return SessionPermissionsChangedData( + assisted_approval_model=assisted_approval_model, mode=mode, previous_mode=previous_mode, - assisted_approval_model=assisted_approval_model, ) def to_dict(self) -> dict: result: dict = {} - result["mode"] = to_enum(PermissionMode, self.mode) - result["previousMode"] = to_enum(PermissionMode, self.previous_mode) if self.assisted_approval_model is not None: result["assistedApprovalModel"] = from_union([from_none, from_str], self.assisted_approval_model) + if self.mode is not None: + result["mode"] = from_union([from_none, lambda x: to_enum(PermissionMode, x)], self.mode) + if self.previous_mode is not None: + result["previousMode"] = from_union([from_none, lambda x: to_enum(PermissionMode, x)], self.previous_mode) return result @@ -2425,6 +2449,7 @@ class AssistantMessageData: fusion: FusionAttribution | None = None interaction_id: str | None = None model: str | None = None + originating_message_id: str | None = None output_tokens: int | None = None # Deprecated: this field is deprecated. parent_tool_call_id: str | None = None @@ -2454,6 +2479,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": fusion = from_union([from_none, FusionAttribution.from_dict], obj.get("fusion")) interaction_id = from_union([from_none, from_str], obj.get("interactionId")) model = from_union([from_none, from_str], obj.get("model")) + originating_message_id = from_union([from_none, from_str], obj.get("originatingMessageId")) output_tokens = from_union([from_none, from_int], obj.get("outputTokens")) parent_tool_call_id = from_union([from_none, from_str], obj.get("parentToolCallId")) phase = from_union([from_none, from_str], obj.get("phase")) @@ -2479,6 +2505,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": fusion=fusion, interaction_id=interaction_id, model=model, + originating_message_id=originating_message_id, output_tokens=output_tokens, parent_tool_call_id=parent_tool_call_id, phase=phase, @@ -2516,6 +2543,8 @@ def to_dict(self) -> dict: result["interactionId"] = from_union([from_none, from_str], self.interaction_id) if self.model is not None: result["model"] = from_union([from_none, from_str], self.model) + if self.originating_message_id is not None: + result["originatingMessageId"] = from_union([from_none, from_str], self.originating_message_id) if self.output_tokens is not None: result["outputTokens"] = from_union([from_none, to_int], self.output_tokens) if self.parent_tool_call_id is not None: @@ -2895,6 +2924,7 @@ def to_dict(self) -> dict: class AssistantUsageCopilotUsage: "Per-request cost and usage data from the CAPI copilot_usage response field" total_nano_aiu: float + model: str | None = None # Internal: this field is an internal SDK API and is not part of the public surface. _token_details: list[AssistantUsageCopilotUsageTokenDetail] | None = None @@ -2902,15 +2932,19 @@ class AssistantUsageCopilotUsage: def from_dict(obj: Any) -> "AssistantUsageCopilotUsage": assert isinstance(obj, dict) total_nano_aiu = from_float(obj.get("totalNanoAiu")) + model = from_union([from_none, from_str], obj.get("model")) _token_details = from_union([from_none, lambda x: from_list(AssistantUsageCopilotUsageTokenDetail.from_dict, x)], obj.get("tokenDetails")) return AssistantUsageCopilotUsage( total_nano_aiu=total_nano_aiu, + model=model, _token_details=_token_details, ) def to_dict(self) -> dict: result: dict = {} result["totalNanoAiu"] = to_float(self.total_nano_aiu) + if self.model is not None: + result["model"] = from_union([from_none, from_str], self.model) if self._token_details is not None: result["tokenDetails"] = from_union([from_none, lambda x: from_list(lambda x: to_class(AssistantUsageCopilotUsageTokenDetail, x), x)], self._token_details) return result @@ -2923,6 +2957,7 @@ class AssistantUsageCopilotUsageTokenDetail: cost_per_batch: int token_count: int token_type: str + model: str | None = None @staticmethod def from_dict(obj: Any) -> "AssistantUsageCopilotUsageTokenDetail": @@ -2931,11 +2966,13 @@ def from_dict(obj: Any) -> "AssistantUsageCopilotUsageTokenDetail": cost_per_batch = from_int(obj.get("costPerBatch")) token_count = from_int(obj.get("tokenCount")) token_type = from_str(obj.get("tokenType")) + model = from_union([from_none, from_str], obj.get("model")) return AssistantUsageCopilotUsageTokenDetail( batch_size=batch_size, cost_per_batch=cost_per_batch, token_count=token_count, token_type=token_type, + model=model, ) def to_dict(self) -> dict: @@ -2944,6 +2981,8 @@ def to_dict(self) -> dict: result["costPerBatch"] = to_int(self.cost_per_batch) result["tokenCount"] = to_int(self.token_count) result["tokenType"] = from_str(self.token_type) + if self.model is not None: + result["model"] = from_union([from_none, from_str], self.model) return result @@ -4206,21 +4245,27 @@ class _CompactionCompleteCompactionTokensUsedCopilotUsage: "Per-request cost and usage data from the CAPI copilot_usage response field" total_nano_aiu: float # Internal: this field is an internal SDK API and is not part of the public surface. + _model: str | None = None + # Internal: this field is an internal SDK API and is not part of the public surface. _token_details: list[CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail] | None = None @staticmethod def from_dict(obj: Any) -> "_CompactionCompleteCompactionTokensUsedCopilotUsage": assert isinstance(obj, dict) total_nano_aiu = from_float(obj.get("totalNanoAiu")) + _model = from_union([from_none, from_str], obj.get("model")) _token_details = from_union([from_none, lambda x: from_list(CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.from_dict, x)], obj.get("tokenDetails")) return _CompactionCompleteCompactionTokensUsedCopilotUsage( total_nano_aiu=total_nano_aiu, + _model=_model, _token_details=_token_details, ) def to_dict(self) -> dict: result: dict = {} result["totalNanoAiu"] = to_float(self.total_nano_aiu) + if self._model is not None: + result["model"] = from_union([from_none, from_str], self._model) if self._token_details is not None: result["tokenDetails"] = from_union([from_none, lambda x: from_list(lambda x: to_class(CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail, x), x)], self._token_details) return result @@ -4233,6 +4278,7 @@ class CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail: cost_per_batch: int token_count: int token_type: str + model: str | None = None @staticmethod def from_dict(obj: Any) -> "CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail": @@ -4241,11 +4287,13 @@ def from_dict(obj: Any) -> "CompactionCompleteCompactionTokensUsedCopilotUsageTo cost_per_batch = from_int(obj.get("costPerBatch")) token_count = from_int(obj.get("tokenCount")) token_type = from_str(obj.get("tokenType")) + model = from_union([from_none, from_str], obj.get("model")) return CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail( batch_size=batch_size, cost_per_batch=cost_per_batch, token_count=token_count, token_type=token_type, + model=model, ) def to_dict(self) -> dict: @@ -4254,6 +4302,8 @@ def to_dict(self) -> dict: result["costPerBatch"] = to_int(self.cost_per_batch) result["tokenCount"] = to_int(self.token_count) result["tokenType"] = from_str(self.token_type) + if self.model is not None: + result["model"] = from_union([from_none, from_str], self.model) return result @@ -4323,6 +4373,7 @@ class CustomAgentsUpdatedAgent: source: str tools: list[str] | None user_invocable: bool + disable_model_invocation: bool | None = None model: str | None = None model_policy: AgentModelPolicy | None = None models: list[str] | None = None @@ -4337,6 +4388,7 @@ def from_dict(obj: Any) -> "CustomAgentsUpdatedAgent": source = from_str(obj.get("source")) tools = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("tools")) user_invocable = from_bool(obj.get("userInvocable")) + disable_model_invocation = from_union([from_none, from_bool], obj.get("disableModelInvocation")) 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")) @@ -4348,6 +4400,7 @@ def from_dict(obj: Any) -> "CustomAgentsUpdatedAgent": source=source, tools=tools, user_invocable=user_invocable, + disable_model_invocation=disable_model_invocation, model=model, model_policy=model_policy, models=models, @@ -4362,6 +4415,8 @@ def to_dict(self) -> dict: result["source"] = from_str(self.source) result["tools"] = from_union([from_none, lambda x: from_list(from_str, x)], self.tools) result["userInvocable"] = from_bool(self.user_invocable) + if self.disable_model_invocation is not None: + result["disableModelInvocation"] = from_union([from_none, from_bool], self.disable_model_invocation) if self.model is not None: result["model"] = from_union([from_none, from_str], self.model) if self.model_policy is not None: @@ -5977,6 +6032,9 @@ class PermissionPromptRequestCommands: # Experimental: this field is part of an experimental API and may change or be removed. assisted_approval: PermissionAssistedApproval | None = None managed_approval_required: bool | None = None + request_sandbox_bypass: bool | None = None + request_sandbox_bypass_reason: str | None = None + request_sandbox_permissive: bool | None = None tool_call_id: str | None = None warning: str | None = None @@ -5989,6 +6047,9 @@ def from_dict(obj: Any) -> "PermissionPromptRequestCommands": intention = from_str(obj.get("intention")) assisted_approval = from_union([from_none, PermissionAssistedApproval.from_dict], obj.get("assistedApproval")) managed_approval_required = from_union([from_none, from_bool], obj.get("managedApprovalRequired")) + request_sandbox_bypass = from_union([from_none, from_bool], obj.get("requestSandboxBypass")) + request_sandbox_bypass_reason = from_union([from_none, from_str], obj.get("requestSandboxBypassReason")) + request_sandbox_permissive = from_union([from_none, from_bool], obj.get("requestSandboxPermissive")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) warning = from_union([from_none, from_str], obj.get("warning")) return PermissionPromptRequestCommands( @@ -5998,6 +6059,9 @@ def from_dict(obj: Any) -> "PermissionPromptRequestCommands": intention=intention, assisted_approval=assisted_approval, managed_approval_required=managed_approval_required, + request_sandbox_bypass=request_sandbox_bypass, + request_sandbox_bypass_reason=request_sandbox_bypass_reason, + request_sandbox_permissive=request_sandbox_permissive, tool_call_id=tool_call_id, warning=warning, ) @@ -6013,6 +6077,12 @@ def to_dict(self) -> dict: result["assistedApproval"] = from_union([from_none, lambda x: to_class(PermissionAssistedApproval, x)], self.assisted_approval) if self.managed_approval_required is not None: result["managedApprovalRequired"] = from_union([from_none, from_bool], self.managed_approval_required) + if self.request_sandbox_bypass is not None: + result["requestSandboxBypass"] = from_union([from_none, from_bool], self.request_sandbox_bypass) + if self.request_sandbox_bypass_reason is not None: + result["requestSandboxBypassReason"] = from_union([from_none, from_str], self.request_sandbox_bypass_reason) + if self.request_sandbox_permissive is not None: + result["requestSandboxPermissive"] = from_union([from_none, from_bool], self.request_sandbox_permissive) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) if self.warning is not None: @@ -7078,6 +7148,7 @@ class PermissionRequestShell: managed_approval_required: bool | None = None request_sandbox_bypass: bool | None = None request_sandbox_bypass_reason: str | None = None + request_sandbox_permissive: bool | None = None tool_call_id: str | None = None warning: str | None = None @@ -7095,6 +7166,7 @@ def from_dict(obj: Any) -> "PermissionRequestShell": managed_approval_required = from_union([from_none, from_bool], obj.get("managedApprovalRequired")) request_sandbox_bypass = from_union([from_none, from_bool], obj.get("requestSandboxBypass")) request_sandbox_bypass_reason = from_union([from_none, from_str], obj.get("requestSandboxBypassReason")) + request_sandbox_permissive = from_union([from_none, from_bool], obj.get("requestSandboxPermissive")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) warning = from_union([from_none, from_str], obj.get("warning")) return PermissionRequestShell( @@ -7109,6 +7181,7 @@ def from_dict(obj: Any) -> "PermissionRequestShell": managed_approval_required=managed_approval_required, request_sandbox_bypass=request_sandbox_bypass, request_sandbox_bypass_reason=request_sandbox_bypass_reason, + request_sandbox_permissive=request_sandbox_permissive, tool_call_id=tool_call_id, warning=warning, ) @@ -7131,6 +7204,8 @@ def to_dict(self) -> dict: result["requestSandboxBypass"] = from_union([from_none, from_bool], self.request_sandbox_bypass) if self.request_sandbox_bypass_reason is not None: result["requestSandboxBypassReason"] = from_union([from_none, from_str], self.request_sandbox_bypass_reason) + if self.request_sandbox_permissive is not None: + result["requestSandboxPermissive"] = from_union([from_none, from_bool], self.request_sandbox_permissive) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) if self.warning is not None: @@ -7731,6 +7806,8 @@ def to_dict(self) -> dict: class SessionCompactionCompleteData: "Conversation compaction results including success status, metrics, and optional error details" success: bool + # Internal: this field is an internal SDK API and is not part of the public surface. + _active_factory_summary: str | None = None behavior_model_id: str | None = None checkpoint_number: int | None = None checkpoint_path: str | None = None @@ -7756,6 +7833,7 @@ class SessionCompactionCompleteData: def from_dict(obj: Any) -> "SessionCompactionCompleteData": assert isinstance(obj, dict) success = from_bool(obj.get("success")) + _active_factory_summary = from_union([from_none, from_str], obj.get("activeFactorySummary")) behavior_model_id = from_union([from_none, from_str], obj.get("behaviorModelId")) checkpoint_number = from_union([from_none, from_int], obj.get("checkpointNumber")) checkpoint_path = from_union([from_none, from_str], obj.get("checkpointPath")) @@ -7778,6 +7856,7 @@ def from_dict(obj: Any) -> "SessionCompactionCompleteData": trigger = from_union([from_none, lambda x: parse_enum(CompactionTrigger, x)], obj.get("trigger")) return SessionCompactionCompleteData( success=success, + _active_factory_summary=_active_factory_summary, behavior_model_id=behavior_model_id, checkpoint_number=checkpoint_number, checkpoint_path=checkpoint_path, @@ -7803,6 +7882,8 @@ def from_dict(obj: Any) -> "SessionCompactionCompleteData": def to_dict(self) -> dict: result: dict = {} result["success"] = from_bool(self.success) + if self._active_factory_summary is not None: + result["activeFactorySummary"] = from_union([from_none, from_str], self._active_factory_summary) if self.behavior_model_id is not None: result["behaviorModelId"] = from_union([from_none, from_str], self.behavior_model_id) if self.checkpoint_number is not None: @@ -9880,6 +9961,7 @@ class SubagentStartedData: model: str | None = None parent_id: str | None = None resumable: bool | None = None + task_model_source: SubagentTaskModelSource | None = None @staticmethod def from_dict(obj: Any) -> "SubagentStartedData": @@ -9894,6 +9976,7 @@ def from_dict(obj: Any) -> "SubagentStartedData": model = from_union([from_none, from_str], obj.get("model")) parent_id = from_union([from_none, from_str], obj.get("parentId")) resumable = from_union([from_none, from_bool], obj.get("resumable")) + task_model_source = from_union([from_none, lambda x: parse_enum(SubagentTaskModelSource, x)], obj.get("taskModelSource")) return SubagentStartedData( agent_description=agent_description, agent_display_name=agent_display_name, @@ -9905,6 +9988,7 @@ def from_dict(obj: Any) -> "SubagentStartedData": model=model, parent_id=parent_id, resumable=resumable, + task_model_source=task_model_source, ) def to_dict(self) -> dict: @@ -9925,6 +10009,8 @@ def to_dict(self) -> dict: result["parentId"] = from_union([from_none, from_str], self.parent_id) if self.resumable is not None: result["resumable"] = from_union([from_none, from_bool], self.resumable) + if self.task_model_source is not None: + result["taskModelSource"] = from_union([from_none, lambda x: to_enum(SubagentTaskModelSource, x)], self.task_model_source) return result @@ -10105,6 +10191,7 @@ class SystemNotificationFactoryCompleted: status: SystemNotificationFactoryCompletedStatus type: ClassVar[str] = "factory_completed" failure: Any = None + pause_info: SystemNotificationFactoryPauseInfo | None = None result_preview: str | None = None retry_guidance: str | None = None @@ -10119,6 +10206,7 @@ def from_dict(obj: Any) -> "SystemNotificationFactoryCompleted": run_id = from_str(obj.get("runId")) status = parse_enum(SystemNotificationFactoryCompletedStatus, obj.get("status")) failure = obj.get("failure") + pause_info = from_union([from_none, SystemNotificationFactoryPauseInfo.from_dict], obj.get("pauseInfo")) result_preview = from_union([from_none, from_str], obj.get("resultPreview")) retry_guidance = from_union([from_none, from_str], obj.get("retryGuidance")) return SystemNotificationFactoryCompleted( @@ -10130,6 +10218,7 @@ def from_dict(obj: Any) -> "SystemNotificationFactoryCompleted": run_id=run_id, status=status, failure=failure, + pause_info=pause_info, result_preview=result_preview, retry_guidance=retry_guidance, ) @@ -10146,6 +10235,8 @@ def to_dict(self) -> dict: result["type"] = self.type if self.failure is not None: result["failure"] = self.failure + if self.pause_info is not None: + result["pauseInfo"] = from_union([from_none, lambda x: to_class(SystemNotificationFactoryPauseInfo, x)], self.pause_info) if self.result_preview is not None: result["resultPreview"] = from_union([from_none, from_str], self.result_preview) if self.retry_guidance is not None: @@ -10153,6 +10244,30 @@ def to_dict(self) -> dict: return result +@dataclass +class SystemNotificationFactoryPauseInfo: + "Durable metadata describing who initiated a factory pause." + type: SystemNotificationFactoryPauseInfoType + key: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "SystemNotificationFactoryPauseInfo": + assert isinstance(obj, dict) + type = parse_enum(SystemNotificationFactoryPauseInfoType, obj.get("type")) + key = from_union([from_none, from_str], obj.get("key")) + return SystemNotificationFactoryPauseInfo( + type=type, + key=key, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["type"] = to_enum(SystemNotificationFactoryPauseInfoType, self.type) + if self.key is not None: + result["key"] = from_union([from_none, from_str], self.key) + return result + + @dataclass class SystemNotificationInstructionDiscovered: "System notification metadata for an instruction file discovered during tool access, including source, trigger file, and tool." @@ -12142,13 +12257,15 @@ class AutoModeSwitchResponse(Enum): class AutoTier(Enum): - "Routing preference used when the session model is `auto`." + "Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference." # Optimize for efficiency. EFFICIENCY = "efficiency" # Balance efficiency and intelligence. BALANCE = "balance" # Optimize for intelligence. INTELLIGENCE = "intelligence" + # Integrator-only preset that optimizes for latency. + FAST = "fast" class AutoTierSwitchFailureReason(Enum): @@ -12315,6 +12432,8 @@ class FactoryRunSettledStatus(Enum): COMPLETED = "completed" # The run was stopped by a limit, an approval refusal or another policy decision. HALTED = "halted" + # The attempt paused intentionally while preserving resumable run state. + PAUSED = "paused" # The run was cancelled by its caller or by session disposal. CANCELLED = "cancelled" # The run failed, with `failureType` carrying the class when it has one. @@ -12599,6 +12718,16 @@ class ReasoningSummary(Enum): DETAILED = "detailed" +class RecommendedAutoTier(Enum): + "Auto preferences that Copilot API can recommend." + # Optimize for efficiency. + EFFICIENCY = "efficiency" + # Balance efficiency and intelligence. + BALANCE = "balance" + # Optimize for intelligence. + INTELLIGENCE = "intelligence" + + class RemediationAction(Enum): "What the user must do to recover from a failure, named as an action rather than as one client's affordance. The runtime cannot know which affordance a client offers — a slash command, a settings pane, a link — so the accompanying message stays host-agnostic and each client renders its own copy from this value. Absent when the runtime knows of no action the user can take." # Authenticate again with the Copilot backend. The current credential is absent, expired, or rejected. @@ -12681,6 +12810,18 @@ class SkillSource(Enum): SDK = "sdk" +class SubagentTaskModelSource(Enum): + "Where the model input for a task-tool sub-agent came from." + # The spawning agent supplied the task tool's model argument. + TASK_ARGUMENT = "task_argument" + # The task omitted a model and the per-sub-agent settings entry supplied a concrete one. + SUBAGENT_CONFIGURATION = "subagent_configuration" + # The task omitted a model and the user-defined custom agent's definition supplied one. + CUSTOM_AGENT_DEFINITION = "custom_agent_definition" + # Neither the task call, the per-sub-agent settings entry, nor a custom agent definition supplied a model. + UNSET = "unset" + + class SystemMessageRole(Enum): "Message role: \"system\" for system prompts, \"developer\" for developer-injected instructions" # System prompt message. @@ -12703,12 +12844,20 @@ class SystemNotificationFactoryCompletedStatus(Enum): COMPLETED = "completed" # The factory was halted. HALTED = "halted" + # The factory attempt paused intentionally. + PAUSED = "paused" # The factory was cancelled. CANCELLED = "cancelled" # The factory failed. ERROR = "error" +class SystemNotificationFactoryPauseInfoType(Enum): + "Durable metadata describing who initiated a factory pause. discriminator" + USER = "user" + CHECKPOINT = "checkpoint" + + class TaskCompletionOutcome(Enum): "Semantic result of evaluating a task completion request" # The completion request was accepted and the objective is complete. @@ -12791,7 +12940,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionAutoTierSwitchFailedData | 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 | SessionMcpServerRemovedData | SessionMcpServerNeedsReconnectData | 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 | SessionAutoTierRecommendationData | SessionAutoTierSwitchFailedData | 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 | SessionMcpServerRemovedData | SessionMcpServerNeedsReconnectData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -12830,6 +12979,7 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_INFO: data = SessionInfoData.from_dict(data_obj) case SessionEventType.SESSION_WARNING: data = SessionWarningData.from_dict(data_obj) case SessionEventType.SESSION_MODEL_CHANGE: data = SessionModelChangeData.from_dict(data_obj) + case SessionEventType.SESSION_AUTO_TIER_RECOMMENDATION: data = SessionAutoTierRecommendationData.from_dict(data_obj) case SessionEventType.SESSION_AUTO_TIER_SWITCH_FAILED: data = SessionAutoTierSwitchFailedData.from_dict(data_obj) case SessionEventType.SESSION_MODE_CHANGED: data = SessionModeChangedData.from_dict(data_obj) case SessionEventType.SESSION_MODE_NOTICE_DELIVERED: data = SessionModeNoticeDeliveredData.from_dict(data_obj) @@ -13225,12 +13375,14 @@ def session_event_to_dict(x: SessionEvent) -> Any: "PromptCacheBreakData", "RawSessionEventData", "ReasoningSummary", + "RecommendedAutoTier", "RemediationAction", "SamplingCompletedData", "SamplingRequestedData", "SandboxDecisionData", "ScheduleOrigin", "SessionAutoModeResolvedData", + "SessionAutoTierRecommendationData", "SessionAutoTierSwitchFailedData", "SessionAutopilotObjectiveChangedData", "SessionBackgroundTasksChangedData", @@ -13315,6 +13467,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SubagentFailedData", "SubagentSelectedData", "SubagentStartedData", + "SubagentTaskModelSource", "SystemMessageData", "SystemMessageMetadata", "SystemMessageRole", @@ -13325,6 +13478,8 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SystemNotificationData", "SystemNotificationFactoryCompleted", "SystemNotificationFactoryCompletedStatus", + "SystemNotificationFactoryPauseInfo", + "SystemNotificationFactoryPauseInfoType", "SystemNotificationInstructionDiscovered", "SystemNotificationNewInboxMessage", "SystemNotificationShellCompleted", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 1bd83a50f7..fd0a1c8835 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -211,6 +211,8 @@ pub mod rpc_methods { pub const SESSION_SENDMESSAGES: &str = "session.sendMessages"; /// `session.sandbox.getEnforcementStatus` pub const SESSION_SANDBOX_GETENFORCEMENTSTATUS: &str = "session.sandbox.getEnforcementStatus"; + /// `session.sandbox.disableForSession` + pub const SESSION_SANDBOX_DISABLEFORSESSION: &str = "session.sandbox.disableForSession"; /// `session.sendSystemNotification` pub const SESSION_SENDSYSTEMNOTIFICATION: &str = "session.sendSystemNotification"; /// `session.abort` @@ -276,6 +278,10 @@ pub mod rpc_methods { pub const SESSION_FACTORY_GETRUNPROGRESS: &str = "session.factory.getRunProgress"; /// `session.factory.cancel` pub const SESSION_FACTORY_CANCEL: &str = "session.factory.cancel"; + /// `session.factory.pause` + pub const SESSION_FACTORY_PAUSE: &str = "session.factory.pause"; + /// `session.factory.pauseAtCheckpoint` + pub const SESSION_FACTORY_PAUSEATCHECKPOINT: &str = "session.factory.pauseAtCheckpoint"; /// `session.factory.log` pub const SESSION_FACTORY_LOG: &str = "session.factory.log"; /// `session.factory.agent` @@ -292,6 +298,8 @@ pub mod rpc_methods { pub const SESSION_MODEL_SWITCHAUTOTIER: &str = "session.model.switchAutoTier"; /// `session.model.applyStartupOverlay` pub const SESSION_MODEL_APPLYSTARTUPOVERLAY: &str = "session.model.applyStartupOverlay"; + /// `session.model.setAllowedModels` + pub const SESSION_MODEL_SETALLOWEDMODELS: &str = "session.model.setAllowedModels"; /// `session.model.setReasoningEffort` pub const SESSION_MODEL_SETREASONINGEFFORT: &str = "session.model.setReasoningEffort"; /// `session.model.list` @@ -1574,6 +1582,9 @@ pub struct AgentDiscoveryPathList { pub struct AgentInfo { /// Description of the agent's purpose pub description: String, + /// Whether model-driven invocation is disabled for this agent. + #[serde(skip_serializing_if = "Option::is_none")] + pub disable_model_invocation: Option, /// Human-readable display name pub display_name: String, /// Stable identifier for selection. For most agents this is the same as `name`; for plugin/builtin agents it may differ. Always populated; defaults to `name` when no distinct id was assigned. @@ -3115,7 +3126,7 @@ pub struct CanvasProviderUnregisterRequest { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CapiSessionOptions { - /// Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. + /// Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. `fast` is an integrator-only latency preset, not a first-party GitHub Copilot product preference. #[serde(skip_serializing_if = "Option::is_none")] pub auto_tier: Option, /// Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable. @@ -5141,6 +5152,8 @@ pub struct FactoryAbortRequest { pub session_id: SessionId, /// Factory run identifier. pub run_id: String, + /// Opaque token identifying the execution attempt to abort. + pub execution_token: String, } /// Acknowledgement that a factory request was accepted. @@ -5166,10 +5179,10 @@ pub struct FactoryAckResult {} #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct FactoryAgentOptions { - /// Optional custom agent name for the subagent. This field is accepted but not yet honored. + /// Optional built-in or custom agent name whose definition configures the subagent. #[serde(skip_serializing_if = "Option::is_none")] pub agent: Option, - /// Optional context tier for the subagent. This field is accepted but not yet honored. + /// Optional context tier override for the subagent. #[serde(skip_serializing_if = "Option::is_none")] pub context_tier: Option, /// Optional label distinguishing otherwise identical memoized agent calls. @@ -5178,7 +5191,7 @@ pub struct FactoryAgentOptions { /// Optional model identifier for the subagent. #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, - /// Optional reasoning effort for the subagent. This field is accepted but not yet honored. + /// Optional reasoning effort override for the subagent. #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_effort: Option, /// Optional JSON Schema for structured agent output. @@ -5524,6 +5537,8 @@ pub struct FactoryRunTerminal { /// Machine-readable terminal failure. #[serde(skip_serializing_if = "Option::is_none")] pub failure: Option, + /// Pause initiator metadata, or null when the run did not pause. + pub pause_info: Option, /// Human-readable terminal reason. #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option, @@ -5547,6 +5562,8 @@ pub struct FactoryRunSummary { pub active_segment_started_at: Option, /// Approved effective resource ceilings, or null until approved. pub approved: Option, + /// Whether the durable run state currently passes runtime resume eligibility checks. + pub can_resume: bool, /// Epoch milliseconds when the run completed, or null while nonterminal. pub completed_at: Option, /// Durable resource consumption. @@ -5648,6 +5665,54 @@ pub struct FactoryLogRequest { pub run_id: String, } +/// Parameters for an owned durable pause checkpoint. +/// +///

+/// +/// **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 FactoryPauseCheckpointRequest { + /// Opaque token identifying the execution attempt that reached the checkpoint. + pub execution_token: String, + /// Stable author-defined checkpoint key. + pub key: String, + /// Factory run identifier. + pub run_id: String, +} + +/// +///
+/// +/// **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 FactoryPauseCheckpointResult { + /// Whether this execution attempt must pause or may continue. + pub action: FactoryPauseCheckpointAction, +} + +/// Parameters for pausing a running factory. +/// +///
+/// +/// **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 FactoryPauseRequest { + /// Factory run identifier. + pub run_id: String, +} + /// Durable lifecycle and timing for one factory phase. /// ///
@@ -5809,6 +5874,9 @@ pub struct FactoryRunResult { /// Machine-readable failure details for a halted or errored run. #[serde(skip_serializing_if = "Option::is_none")] pub failure: Option, + /// Structured pause initiator metadata for a paused attempt. + #[serde(skip_serializing_if = "Option::is_none")] + pub pause_info: Option, /// Reason for a halted or cancelled run. #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option, @@ -5858,6 +5926,8 @@ pub struct FactoryRunDetail { pub agents: Vec, /// Approved effective resource ceilings, or null until approved. pub approved: Option, + /// Whether the durable run state currently passes runtime resume eligibility checks. + pub can_resume: bool, /// Epoch milliseconds when the run completed, or null while nonterminal. pub completed_at: Option, /// Durable resource consumption. @@ -6980,6 +7050,29 @@ pub struct InterruptMainTurnResult { pub interrupted: bool, } +/// A JSON Schema output contract. OpenAI receives the name, description, schema and strict setting; Anthropic receives the schema in output_config.format and always uses its native strict enforcement. +/// +///
+/// +/// **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 JsonSchemaResponseFormat { + /// Optional description passed to OpenAI providers. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Name of the output schema, subject to the provider's naming restrictions. + pub name: String, + /// JSON Schema passed unchanged to the inference provider. Supported keywords and schema restrictions are determined by that provider. + pub schema: serde_json::Value, + /// Optional strict enforcement setting for OpenAI providers. Omitted uses the provider default. Anthropic always enforces its supported schema subset. + #[serde(skip_serializing_if = "Option::is_none")] + pub strict: Option, +} + /// A request body chunk or cancellation signal. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -10628,6 +10721,47 @@ pub struct ModelPickerPersistenceRequest { pub settings_context: ModelPickerSettingsContext, } +/// Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. +/// +///
+/// +/// **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 ModelSetAllowedModelsRequest { + /// Exact model IDs to permit, or null to clear the host restriction. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_models: Option>, +} + +/// The applied host allowlist and effective session model policy after intersection. +/// +///
+/// +/// **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 ModelSetAllowedModelsResult { + /// Normalized host allowlist. Omitted when the host restriction was cleared, or when a relay client does not return the host policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_models: Option>, + /// Effective exact IDs or repository policy patterns after applying the host restriction. Omitted by relay clients that do not return the host policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_allowed_models: Option>, + /// Effective deterministic fallback model, when the policy defines one. + #[serde(skip_serializing_if = "Option::is_none")] + pub fallback_model: Option, + /// Selected session model after reconciling a now-disallowed concrete selection. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_id: Option, +} + /// Reasoning effort level to apply to the currently selected model. /// ///
@@ -12974,7 +13108,7 @@ pub struct PluginsBuiltinSetRequest { pub paths: Vec, } -/// Plugin names (or specs) to disable. +/// Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. /// ///
/// @@ -12987,9 +13121,12 @@ pub struct PluginsBuiltinSetRequest { pub struct PluginsDisableRequest { /// Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. pub names: Vec, + /// Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. + #[serde(skip_serializing_if = "Option::is_none")] + pub working_directory: Option, } -/// Plugin names (or specs) to enable. +/// Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. /// ///
/// @@ -13002,6 +13139,9 @@ pub struct PluginsDisableRequest { pub struct PluginsEnableRequest { /// Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. pub names: Vec, + /// Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. + #[serde(skip_serializing_if = "Option::is_none")] + pub working_directory: Option, } /// Plugin source and optional working directory for relative-path resolution. @@ -14869,6 +15009,23 @@ pub struct RemoteSessionRepository { pub owner: String, } +/// Provider-native structured output format. JSON Schema is forwarded without rewriting or validating the schema or the generated output. +/// +///
+/// +/// **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 ResponseFormat { + /// JSON Schema and provider options for the turn's output. + pub json_schema: JsonSchemaResponseFormat, + /// Output format discriminator. Currently only json_schema is supported. + pub r#type: ResponseFormatType, +} + /// Credential-injection capability flags applied while the sandbox is enabled. For the same capability independent of sandboxing, and matched to the credential's GitHub host, see `shell.credentials`; the two are additive. /// ///
@@ -15073,6 +15230,41 @@ pub struct SandboxConfig { pub user_policy: Option, } +/// Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. +/// +///
+/// +/// **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 SandboxDisableForSessionRequest { + /// Optional attribution for the permission decision. + #[serde(skip_serializing_if = "Option::is_none")] + pub decision_context: Option, + /// Identifier of the exact pending sandbox-bypass permission request that authorized the session opt-out. + pub request_id: RequestId, +} + +/// Result of attempting to disable sandboxing for the current session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SandboxDisableForSessionResult { + /// The authoritative sandbox enabled state after the operation. + pub enabled: bool, + /// Whether this call resolved the pending request and applied the session opt-out. + pub success: bool, +} + /// Managed sandbox enforcement state for a session. /// ///
@@ -15399,6 +15591,15 @@ pub struct SendMessageItem { pub(crate) source: Option, } +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SendMessagesRequestResponseFormat { + /// JSON Schema and provider options for the turn's output. + pub json_schema: JsonSchemaResponseFormat, + /// Output format discriminator. Currently only json_schema is supported. + pub r#type: SendMessagesRequestResponseFormatType, +} + /// Parameters for sending zero or more user messages to the session in a single turn. Remote-backed (Mission Control) sessions do not support this method and will return an error. /// ///
@@ -15424,6 +15625,9 @@ pub struct SendMessagesRequest { /// Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. #[serde(skip_serializing_if = "Option::is_none")] pub request_headers: Option>, + /// Provider-native output format for the whole turn, including an empty message batch and all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. + #[serde(skip_serializing_if = "Option::is_none")] + pub response_format: Option, /// W3C Trace Context traceparent header for distributed tracing of this agent turn #[serde(skip_serializing_if = "Option::is_none")] pub traceparent: Option, @@ -15450,6 +15654,15 @@ pub struct SendMessagesResult { pub message_ids: Vec, } +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SendRequestResponseFormat { + /// JSON Schema and provider options for the turn's output. + pub json_schema: JsonSchemaResponseFormat, + /// Output format discriminator. Currently only json_schema is supported. + pub r#type: SendRequestResponseFormatType, +} + /// Parameters for sending a user message to the session /// ///
@@ -15487,6 +15700,9 @@ pub struct SendRequest { /// If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange #[serde(skip_serializing_if = "Option::is_none")] pub required_tool: Option, + /// Provider-native output format for this turn, including all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. + #[serde(skip_serializing_if = "Option::is_none")] + pub response_format: Option, /// Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-` for command-originated messages, `schedule-` for scheduled prompts, or `agent-` for prompts sent by another agent. #[doc(hidden)] #[serde(skip_serializing_if = "Option::is_none")] @@ -22791,6 +23007,23 @@ pub struct SessionSandboxGetEnforcementStatusResult { pub required: bool, } +/// Result of attempting to disable sandboxing for the current session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionSandboxDisableForSessionResult { + /// The authoritative sandbox enabled state after the operation. + pub enabled: bool, + /// Whether this call resolved the pending request and applied the session opt-out. + pub success: bool, +} + /// Result of aborting the current turn /// ///
@@ -23132,6 +23365,9 @@ pub struct SessionFactoryRunResult { /// Machine-readable failure details for a halted or errored run. #[serde(skip_serializing_if = "Option::is_none")] pub failure: Option, + /// Structured pause initiator metadata for a paused attempt. + #[serde(skip_serializing_if = "Option::is_none")] + pub pause_info: Option, /// Reason for a halted or cancelled run. #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option, @@ -23184,6 +23420,9 @@ pub struct SessionFactoryRunFromToolResult { /// Machine-readable failure details for a halted or errored run. #[serde(skip_serializing_if = "Option::is_none")] pub failure: Option, + /// Structured pause initiator metadata for a paused attempt. + #[serde(skip_serializing_if = "Option::is_none")] + pub pause_info: Option, /// Reason for a halted or cancelled run. #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option, @@ -23236,6 +23475,9 @@ pub struct SessionFactoryGetRunResult { /// Machine-readable failure details for a halted or errored run. #[serde(skip_serializing_if = "Option::is_none")] pub failure: Option, + /// Structured pause initiator metadata for a paused attempt. + #[serde(skip_serializing_if = "Option::is_none")] + pub pause_info: Option, /// Reason for a halted or cancelled run. #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option, @@ -23295,6 +23537,8 @@ pub struct SessionFactoryGetRunDetailResult { pub agents: Vec, /// Approved effective resource ceilings, or null until approved. pub approved: Option, + /// Whether the durable run state currently passes runtime resume eligibility checks. + pub can_resume: bool, /// Epoch milliseconds when the run completed, or null while nonterminal. pub completed_at: Option, /// Durable resource consumption. @@ -23380,6 +23624,47 @@ pub struct SessionFactoryCancelResult { /// Machine-readable failure details for a halted or errored run. #[serde(skip_serializing_if = "Option::is_none")] pub failure: Option, + /// Structured pause initiator metadata for a paused attempt. + #[serde(skip_serializing_if = "Option::is_none")] + pub pause_info: Option, + /// Reason for a halted or cancelled run. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Completed factory result. + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option, + /// Factory run identifier. + pub run_id: String, + /// Partial journal and progress snapshot for a halted, cancelled, or errored run. + #[serde(skip_serializing_if = "Option::is_none")] + pub snapshot: Option, + /// Current or terminal factory run status. + pub status: FactoryRunStatus, +} + +/// Complete current or terminal factory run envelope. +/// +///
+/// +/// **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 SessionFactoryPauseResult { + /// One-based execution attempt represented by this envelope. Absent before the first attempt starts or when returned by an older runtime. + #[serde(skip_serializing_if = "Option::is_none")] + pub attempt: Option, + /// Error message for an errored run. + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Machine-readable failure details for a halted or errored run. + #[serde(skip_serializing_if = "Option::is_none")] + pub failure: Option, + /// Structured pause initiator metadata for a paused attempt. + #[serde(skip_serializing_if = "Option::is_none")] + pub pause_info: Option, /// Reason for a halted or cancelled run. #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option, @@ -23395,6 +23680,20 @@ pub struct SessionFactoryCancelResult { pub status: FactoryRunStatus, } +/// +///
+/// +/// **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 SessionFactoryPauseAtCheckpointResult { + /// Whether this execution attempt must pause or may continue. + pub action: FactoryPauseCheckpointAction, +} + /// Acknowledgement that a factory request was accepted. /// ///
@@ -23606,6 +23905,31 @@ pub struct SessionModelApplyStartupOverlayResult { pub warning: Option, } +/// The applied host allowlist and effective session model policy after intersection. +/// +///
+/// +/// **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 SessionModelSetAllowedModelsResult { + /// Normalized host allowlist. Omitted when the host restriction was cleared, or when a relay client does not return the host policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_models: Option>, + /// Effective exact IDs or repository policy patterns after applying the host restriction. Omitted by relay clients that do not return the host policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_allowed_models: Option>, + /// Effective deterministic fallback model, when the policy defines one. + #[serde(skip_serializing_if = "Option::is_none")] + pub fallback_model: Option, + /// Selected session model after reconciling a now-disallowed concrete selection. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_id: Option, +} + /// Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns. /// ///
@@ -30292,6 +30616,9 @@ pub enum FactoryRunStatus { /// The run was interrupted while resource budget remained. #[serde(rename = "halted")] Halted, + /// The current attempt stopped intentionally and the run may be resumed. + #[serde(rename = "paused")] + Paused, /// The run was cancelled before completion. #[serde(rename = "cancelled")] Cancelled, @@ -30326,6 +30653,28 @@ pub enum FactoryLogLineKind { Unknown, } +/// Action the runtime selected for a durable factory pause checkpoint. +/// +///
+/// +/// **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 FactoryPauseCheckpointAction { + /// The checkpoint was committed by a prior paused attempt, so execution may continue. + #[serde(rename = "continue")] + Continue, + /// This attempt claimed the checkpoint and must cooperatively stop. + #[serde(rename = "pause")] + Pause, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Derived lifecycle state of a factory phase. /// ///
@@ -33239,6 +33588,14 @@ pub enum RemoteSessionMetadataTaskType { Unknown, } +/// Output format discriminator. Currently only json_schema is supported. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ResponseFormatType { + #[serde(rename = "json_schema")] + #[default] + JsonSchema, +} + /// Origin of the sandbox choice supplied by an internal client. /// ///
@@ -33276,6 +33633,22 @@ pub enum SandboxConfigSource { Unknown, } +/// Output format discriminator. Currently only json_schema is supported. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum SendMessagesRequestResponseFormatType { + #[serde(rename = "json_schema")] + #[default] + JsonSchema, +} + +/// Output format discriminator. Currently only json_schema is supported. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum SendRequestResponseFormatType { + #[serde(rename = "json_schema")] + #[default] + JsonSchema, +} + /// Session capability enabled for this session /// ///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 50eee0f1fb..4e19060fe4 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -1415,7 +1415,7 @@ impl<'a> ClientRpcPlugins<'a> { /// /// # Parameters /// - /// * `params` - Plugin names (or specs) to enable. + /// * `params` - Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. /// ///
/// @@ -1439,7 +1439,7 @@ impl<'a> ClientRpcPlugins<'a> { /// /// # Parameters /// - /// * `params` - Plugin names (or specs) to disable. + /// * `params` - Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. /// ///
/// @@ -5113,6 +5113,68 @@ impl<'a> SessionRpcFactory<'a> { Ok(serde_json::from_value(_value)?) } + /// Pauses a running factory and returns its settled run envelope. + /// + /// Wire method: `session.factory.pause`. + /// + /// # Parameters + /// + /// * `params` - Parameters for pausing a running factory. + /// + /// # Returns + /// + /// Complete current or terminal factory run envelope. + /// + ///
+ /// + /// **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 pause(&self, params: FactoryPauseRequest) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_FACTORY_PAUSE, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Atomically pauses an owned factory attempt at a durable checkpoint. + /// + /// Wire method: `session.factory.pauseAtCheckpoint`. + /// + /// # Parameters + /// + /// * `params` - Parameters for an owned durable pause checkpoint. + /// + ///
+ /// + /// **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(crate) async fn pause_at_checkpoint( + &self, + params: FactoryPauseCheckpointRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_FACTORY_PAUSEATCHECKPOINT, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Records a batch of ordered factory progress lines. /// /// Wire method: `session.factory.log`. @@ -7624,6 +7686,42 @@ impl<'a> SessionRpcModel<'a> { Ok(serde_json::from_value(_value)?) } + /// Replaces or clears the host-supplied model allowlist for a running session. + /// + /// Wire method: `session.model.setAllowedModels`. + /// + /// # Parameters + /// + /// * `params` - Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. + /// + /// # Returns + /// + /// The applied host allowlist and effective session model policy after intersection. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn set_allowed_models( + &self, + params: ModelSetAllowedModelsRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_MODEL_SETALLOWEDMODELS, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Updates the session's reasoning effort without changing the selected model. /// /// Wire method: `session.model.setReasoningEffort`. @@ -9627,6 +9725,42 @@ impl<'a> SessionRpcSandbox<'a> { .await?; Ok(serde_json::from_value(_value)?) } + + /// Disables sandboxing for the remainder of the current session and approves the referenced pending sandbox-bypass permission request. The request is rejected unless the exact request is still pending and the effective sandbox policy permits bypass. + /// + /// Wire method: `session.sandbox.disableForSession`. + /// + /// # Parameters + /// + /// * `params` - Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. + /// + /// # Returns + /// + /// Result of attempting to disable sandboxing for the current session. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn disable_for_session( + &self, + params: SandboxDisableForSessionRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_SANDBOX_DISABLEFORSESSION, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } } /// `session.schedule.*` RPCs. diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index 1d4cdc7e43..631944e58c 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -37,6 +37,15 @@ pub enum SessionEventType { SessionWarning, #[serde(rename = "session.model_change")] SessionModelChange, + /// + ///
+ /// + /// **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.auto_tier_recommendation")] + SessionAutoTierRecommendation, #[serde(rename = "session.auto_tier_switch_failed")] SessionAutoTierSwitchFailed, #[serde(rename = "session.mode_changed")] @@ -489,6 +498,15 @@ pub enum SessionEventData { SessionWarning(SessionWarningData), #[serde(rename = "session.model_change")] SessionModelChange(SessionModelChangeData), + /// + ///
+ /// + /// **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.auto_tier_recommendation")] + SessionAutoTierRecommendation(SessionAutoTierRecommendationData), #[serde(rename = "session.auto_tier_switch_failed")] SessionAutoTierSwitchFailed(SessionAutoTierSwitchFailedData), #[serde(rename = "session.mode_changed")] @@ -1289,6 +1307,21 @@ pub struct SessionModelChangeData { pub verbosity: Option, } +/// Session event "session.auto_tier_recommendation". Live-only Auto preference recommendation from Copilot API after a successful Auto model call. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionAutoTierRecommendationData { + /// Recommended Auto preference. + pub recommended_auto_tier: RecommendedAutoTier, +} + /// Session event "session.auto_tier_switch_failed". A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -1360,7 +1393,8 @@ pub struct SessionPermissionsChangedData { /// and may change or be removed in future SDK or CLI releases. /// ///
- pub mode: PermissionMode, + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, /// Permission mode before the change /// ///
@@ -1369,7 +1403,8 @@ pub struct SessionPermissionsChangedData { /// and may change or be removed in future SDK or CLI releases. /// ///
- pub previous_mode: PermissionMode, + #[serde(skip_serializing_if = "Option::is_none")] + pub previous_mode: Option, } /// Session event "session.plan_changed". Plan file operation details indicating what changed @@ -1769,6 +1804,9 @@ pub struct CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail { pub batch_size: i64, /// Cost per batch of tokens pub cost_per_batch: i64, + /// Model responsible for this billing entry + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, /// Total token count for this entry pub token_count: i64, /// Token category (e.g., "input", "output") @@ -1779,6 +1817,10 @@ pub struct CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub(crate) struct CompactionCompleteCompactionTokensUsedCopilotUsage { + /// Default billing model for token details that do not identify their own model + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) model: Option, /// Itemized token usage breakdown #[doc(hidden)] #[serde(skip_serializing_if = "Option::is_none")] @@ -1820,6 +1862,10 @@ pub struct CompactionCompleteCompactionTokensUsed { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionCompactionCompleteData { + /// Authoritative active-factory reminder appended to the compacted context + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) active_factory_summary: Option, /// Canonical model identifier used for model-specific behavior when replaying compaction #[serde(skip_serializing_if = "Option::is_none")] pub behavior_model_id: Option, @@ -2834,6 +2880,9 @@ pub struct AssistantMessageData { /// Model that produced this assistant message, if known #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, + /// Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. + #[serde(skip_serializing_if = "Option::is_none")] + pub originating_message_id: Option, /// Actual output token count from the API response (completion_tokens), used for accurate token accounting #[serde(skip_serializing_if = "Option::is_none")] pub output_tokens: Option, @@ -2931,6 +2980,9 @@ pub struct AssistantUsageCopilotUsageTokenDetail { pub batch_size: i64, /// Cost per batch of tokens pub cost_per_batch: i64, + /// Model responsible for this billing entry + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, /// Total token count for this entry pub token_count: i64, /// Token category (e.g., "input", "output") @@ -2941,6 +2993,9 @@ pub struct AssistantUsageCopilotUsageTokenDetail { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct AssistantUsageCopilotUsage { + /// Default billing model for token details that do not identify their own model + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, /// Itemized token usage breakdown #[doc(hidden)] #[serde(skip_serializing_if = "Option::is_none")] @@ -4131,6 +4186,9 @@ pub struct SubagentStartedData { /// Whether this sub-agent can be resumed. Currently always false. #[serde(skip_serializing_if = "Option::is_none")] pub resumable: Option, + /// Where the model input for this sub-agent came from. Present when the task planner resolved the launch (the task tool and factory agents); absent for sub-agents created through other runtime paths. + #[serde(skip_serializing_if = "Option::is_none")] + pub task_model_source: Option, /// Tool call ID of the parent tool invocation that spawned this sub-agent pub tool_call_id: String, } @@ -4442,6 +4500,9 @@ pub struct PermissionRequestShell { /// What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. Only meaningful when requestSandboxBypass is true. #[serde(skip_serializing_if = "Option::is_none")] pub request_sandbox_bypass_reason: Option, + /// True when the requested escalation is a permissive retry rather than a full bypass: the command re-runs inside the sandbox with its file and process restrictions recording instead of blocking, while the network policy stays enforced. Always accompanied by requestSandboxBypass, so hosts that do not recognize this field still treat the request as the escalation it is. Hosts that do recognize it must not describe the command as running outside the sandbox, which would overstate the privilege being granted. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_sandbox_permissive: Option, /// Tool call ID that triggered this permission request #[serde(skip_serializing_if = "Option::is_none")] pub tool_call_id: Option, @@ -4827,6 +4888,15 @@ pub struct PermissionPromptRequestCommands { /// Whether managed policy requires a human response and forbids host auto-approval #[serde(skip_serializing_if = "Option::is_none")] pub managed_approval_required: Option, + /// True when the shell command is requesting sandbox escalation. This is a request, not a grant. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_sandbox_bypass: Option, + /// Reason for the sandbox escalation request. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_sandbox_bypass_reason: Option, + /// True when the escalation is a permissive retry that keeps the sandbox and network policy attached while recording file and process accesses instead of blocking them. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_sandbox_permissive: Option, /// Tool call ID that triggered this permission request #[serde(skip_serializing_if = "Option::is_none")] pub tool_call_id: Option, @@ -6197,6 +6267,9 @@ pub struct SessionSkillsLoadedData { pub struct CustomAgentsUpdatedAgent { /// Description of what the agent does pub description: String, + /// Whether model-driven invocation is disabled for this agent. + #[serde(skip_serializing_if = "Option::is_none")] + pub disable_model_invocation: Option, /// Human-readable display name pub display_name: String, /// Unique identifier for the agent @@ -6602,7 +6675,7 @@ pub struct McpAppToolCallCompleteData { pub tool_name: String, } -/// Routing preference used when the session model is `auto`. +/// Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum AutoTier { /// Optimize for efficiency. @@ -6614,6 +6687,9 @@ pub enum AutoTier { /// Optimize for intelligence. #[serde(rename = "intelligence")] Intelligence, + /// Integrator-only preset that optimizes for latency. + #[serde(rename = "fast")] + Fast, /// Unknown variant for forward compatibility. #[default] #[serde(other)] @@ -6824,6 +6900,24 @@ pub enum ModelChangeSource { Unknown, } +/// Auto preferences that Copilot API can recommend. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum RecommendedAutoTier { + /// Optimize for efficiency. + #[serde(rename = "efficiency")] + Efficiency, + /// Balance efficiency and intelligence. + #[serde(rename = "balance")] + Balance, + /// Optimize for intelligence. + #[serde(rename = "intelligence")] + Intelligence, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Terminal reason an Auto preference activation failed. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum AutoTierSwitchFailureReason { @@ -7703,6 +7797,27 @@ pub enum SkillInvokedTrigger { Unknown, } +/// Where the model input for a task-tool sub-agent came from. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum SubagentTaskModelSource { + /// The spawning agent supplied the task tool's model argument. + #[serde(rename = "task_argument")] + TaskArgument, + /// The task omitted a model and the per-sub-agent settings entry supplied a concrete one. + #[serde(rename = "subagent_configuration")] + SubagentConfiguration, + /// The task omitted a model and the user-defined custom agent's definition supplied one. + #[serde(rename = "custom_agent_definition")] + CustomAgentDefinition, + /// Neither the task call, the per-sub-agent settings entry, nor a custom agent definition supplied a model. + #[serde(rename = "unset")] + Unset, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Binary asset type discriminator. Use "image" for images and "resource" otherwise. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum BinaryAssetType { @@ -8616,6 +8731,9 @@ pub enum FactoryRunSettledStatus { /// The run was stopped by a limit, an approval refusal or another policy decision. #[serde(rename = "halted")] Halted, + /// The attempt paused intentionally while preserving resumable run state. + #[serde(rename = "paused")] + Paused, /// The run was cancelled by its caller or by session disposal. #[serde(rename = "cancelled")] Cancelled, diff --git a/scripts/codegen/csharp.test.ts b/scripts/codegen/csharp.test.ts new file mode 100644 index 0000000000..1af7e2bc0b --- /dev/null +++ b/scripts/codegen/csharp.test.ts @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +import assert from "node:assert/strict"; +import { test } from "node:test"; +import type { JSONSchema7 } from "json-schema"; +import { generateRpcCode } from "./csharp.js"; + +for (const keyword of ["anyOf", "oneOf"] as const) { + test(`C# RPC preserves named single-variant ${keyword} objects`, () => { + const responseFormat: JSONSchema7 = { + title: "ResponseFormat", + description: "A provider-native output format.", + [keyword]: [{ + type: "object", + properties: { + type: { type: "string", const: "json_schema" }, + jsonSchema: { $ref: "#/definitions/JsonSchemaResponseFormat" }, + }, + required: ["type", "jsonSchema"], + }], + }; + const code = generateRpcCode({ + session: { + send: { + rpcMethod: "session.send", + params: { + type: "object", + title: "SendRequest", + properties: { + responseFormat: { $ref: "#/definitions/ResponseFormat" }, + requiredFormat: { $ref: "#/definitions/ResponseFormat" }, + }, + required: ["requiredFormat"], + }, + }, + }, + definitions: { + ResponseFormat: responseFormat, + JsonSchemaResponseFormat: { + type: "object", + properties: { + name: { type: "string" }, + schema: { "x-opaque-json": true } as JSONSchema7, + strict: { type: "boolean" }, + }, + required: ["name", "schema"], + }, + }, + }); + + assert.match(code, /public sealed class ResponseFormat\b/); + assert.match(code, /A provider-native output format\./); + assert.match(code, /public ResponseFormat\? ResponseFormat/); + assert.match(code, /public ResponseFormat RequiredFormat/); + assert.match(code, /public JsonSchemaResponseFormat JsonSchema/); + assert.match(code, /public JsonElement Schema/); + assert.match(code, /public bool\? Strict/); + assert.equal(code.match(/public sealed class ResponseFormat\b/g)?.length, 1); + }); +} diff --git a/scripts/codegen/csharp.ts b/scripts/codegen/csharp.ts index 00afec6000..de885563c7 100644 --- a/scripts/codegen/csharp.ts +++ b/scripts/codegen/csharp.ts @@ -1693,6 +1693,13 @@ function resolveRpcType(schema: JSONSchema7, isRequired: boolean, parentClassNam if (nullableInner) { return resolveRpcType(nullableInner, false, parentClassName, propName, classes); } + const unionVariants = schema.anyOf ?? schema.oneOf; + if (unionVariants?.length === 1 && typeof unionVariants[0] === "object") { + return resolveRpcType( + { ...schema, anyOf: undefined, oneOf: undefined, ...unionVariants[0], title: schema.title ?? unionVariants[0].title }, + isRequired, parentClassName, propName, classes, + ); + } // Discriminated union: anyOf with multiple variants sharing a const discriminator if (schema.anyOf && Array.isArray(schema.anyOf)) { const nonNull = schema.anyOf.filter((s) => typeof s === "object" && s !== null && (s as JSONSchema7).type !== "null"); @@ -2602,7 +2609,7 @@ function emitClientGlobalApiRegistration(clientSchema: Record, return lines; } -function generateRpcCode( +export function generateRpcCode( schema: ApiSchema, externalJsonSerializableRefs: Map> = new Map(), externalValueTypes: Set = new Set() diff --git a/test/snapshots/structured_output/node_concurrent_typed_sends_return_their_own_results.yaml b/test/snapshots/structured_output/node_concurrent_typed_sends_return_their_own_results.yaml new file mode 100644 index 0000000000..2d85771847 --- /dev/null +++ b/test/snapshots/structured_output/node_concurrent_typed_sends_return_their_own_results.yaml @@ -0,0 +1,24 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: Call first_number exactly once and report its returned number. + - role: assistant + tool_calls: + - id: toolcall_0 + type: function + function: + name: first_number + arguments: "{}" + - role: tool + tool_call_id: toolcall_0 + content: "42" + - role: assistant + content: '{"contract":"first","first":42}' + - role: user + content: What is 30 + 7? Do not use tools. + - role: assistant + content: '{"contract":"second","second":37}' diff --git a/test/snapshots/structured_output/node_generated_rpc_accepts_a_batch_response_format.yaml b/test/snapshots/structured_output/node_generated_rpc_accepts_a_batch_response_format.yaml new file mode 100644 index 0000000000..338e1749c5 --- /dev/null +++ b/test/snapshots/structured_output/node_generated_rpc_accepts_a_batch_response_format.yaml @@ -0,0 +1,10 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: What is 16 + 26? Do not use tools. + - role: assistant + content: '{"total":42}' diff --git a/test/snapshots/structured_output/node_raw_schema_and_unformatted_followup.yaml b/test/snapshots/structured_output/node_raw_schema_and_unformatted_followup.yaml new file mode 100644 index 0000000000..b2e6967033 --- /dev/null +++ b/test/snapshots/structured_output/node_raw_schema_and_unformatted_followup.yaml @@ -0,0 +1,14 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: What is 19 + 23? Do not use tools. + - role: assistant + content: '{"answer":42,"contract":"raw_schema"}' + - role: user + content: Reply exactly SCHEMA_CLEARED without JSON or quotes. + - role: assistant + content: SCHEMA_CLEARED diff --git a/test/snapshots/structured_output/node_zod_typed_result_after_terminal_tool_and_steering.yaml b/test/snapshots/structured_output/node_zod_typed_result_after_terminal_tool_and_steering.yaml new file mode 100644 index 0000000000..060c0e1a3c --- /dev/null +++ b/test/snapshots/structured_output/node_zod_typed_result_after_terminal_tool_and_steering.yaml @@ -0,0 +1,22 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: Call lookup_number exactly once, then add 5 to the returned number. Do not guess its result. + - role: assistant + tool_calls: + - id: toolcall_0 + type: function + function: + name: lookup_number + arguments: "{}" + - role: tool + tool_call_id: toolcall_0 + content: "58" + - role: user + content: Continue with the original calculation. Do not call any more tools. + - role: assistant + content: '{"answer":63,"contract":"typed_tool"}' diff --git a/test/snapshots/structured_output_dotnet/concurrent_typed_sends_return_their_own_results.yaml b/test/snapshots/structured_output_dotnet/concurrent_typed_sends_return_their_own_results.yaml new file mode 100644 index 0000000000..24f06c4278 --- /dev/null +++ b/test/snapshots/structured_output_dotnet/concurrent_typed_sends_return_their_own_results.yaml @@ -0,0 +1,24 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: Call first_number exactly once and report its returned number. + - role: assistant + tool_calls: + - id: toolcall_0 + type: function + function: + name: first_number + arguments: "{}" + - role: tool + tool_call_id: toolcall_0 + content: "42" + - role: assistant + content: '{"first":42}' + - role: user + content: What is 30 + 7? Do not use tools. + - role: assistant + content: '{"second":37}' diff --git a/test/snapshots/structured_output_dotnet/infers_typed_result_after_custom_tool.yaml b/test/snapshots/structured_output_dotnet/infers_typed_result_after_custom_tool.yaml new file mode 100644 index 0000000000..d3cd70234d --- /dev/null +++ b/test/snapshots/structured_output_dotnet/infers_typed_result_after_custom_tool.yaml @@ -0,0 +1,24 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: Call get_inventory, then report the widget count and color. + - role: assistant + tool_calls: + - id: toolcall_0 + type: function + function: + name: get_inventory + arguments: "{}" + - role: tool + tool_call_id: toolcall_0 + content: The inventory contains 42 red widgets. + - role: assistant + content: '{"color":"red","count":42}' + - role: user + content: Now reply with exactly the plain text HELLO, not JSON. + - role: assistant + content: HELLO diff --git a/test/snapshots/structured_output_dotnet/sends_explicit_schema_for_message_and_batch.yaml b/test/snapshots/structured_output_dotnet/sends_explicit_schema_for_message_and_batch.yaml new file mode 100644 index 0000000000..f450faacb7 --- /dev/null +++ b/test/snapshots/structured_output_dotnet/sends_explicit_schema_for_message_and_batch.yaml @@ -0,0 +1,16 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: There are 42 red widgets in stock. + - role: user + content: Report the widget count and color. + - role: assistant + content: '{"color":"red","count":42}' + - role: user + content: The inventory now has 21 blue widgets. Report the new count and color. + - role: assistant + content: '{"color":"blue","count":21}' From 3c12e368a23c1be806f4307aaec1c1fda8010b49 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Sep 2026 15:15:33 +0000 Subject: [PATCH 2/7] Regenerate Java codegen output Auto-committed by java-codegen-check workflow. --- .../generated/AssistantMessageEvent.java | 2 - .../generated/AssistantUsageCopilotUsage.java | 2 - ...AssistantUsageCopilotUsageTokenDetail.java | 2 - .../github/copilot/generated/AutoTier.java | 6 +-- ...pleteCompactionTokensUsedCopilotUsage.java | 2 - ...tionTokensUsedCopilotUsageTokenDetail.java | 2 - .../generated/CustomAgentsUpdatedAgent.java | 2 - .../generated/FactoryRunSettledStatus.java | 2 - .../generated/RecommendedAutoTier.java | 37 --------------- .../SessionAutoTierRecommendationEvent.java | 41 ----------------- .../SessionCompactionCompleteEvent.java | 2 - .../copilot/generated/SessionEvent.java | 2 - .../generated/SubagentStartedEvent.java | 2 - .../generated/SubagentTaskModelSource.java | 39 ---------------- .../copilot/generated/rpc/AgentInfo.java | 2 - .../copilot/generated/rpc/AutoTier.java | 6 +-- .../generated/rpc/CapiSessionOptions.java | 2 +- .../generated/rpc/FactoryAbortParams.java | 4 +- .../generated/rpc/FactoryAgentOptions.java | 6 +-- .../rpc/FactoryPauseCheckpointAction.java | 35 -------------- .../generated/rpc/FactoryRunResult.java | 4 +- .../generated/rpc/FactoryRunStatus.java | 2 - .../generated/rpc/FactoryRunSummary.java | 4 +- .../generated/rpc/FactoryRunTerminal.java | 4 +- .../rpc/JsonSchemaResponseFormat.java | 33 ------------- .../generated/rpc/PluginsDisableParams.java | 6 +-- .../generated/rpc/PluginsEnableParams.java | 6 +-- .../generated/rpc/ServerPluginsApi.java | 4 +- .../generated/rpc/SessionFactoryApi.java | 32 ------------- .../rpc/SessionFactoryCancelResult.java | 4 +- .../rpc/SessionFactoryGetRunDetailResult.java | 2 - .../rpc/SessionFactoryGetRunResult.java | 4 +- ...SessionFactoryPauseAtCheckpointParams.java | 36 --------------- ...SessionFactoryPauseAtCheckpointResult.java | 30 ------------ .../rpc/SessionFactoryPauseParams.java | 32 ------------- .../rpc/SessionFactoryPauseResult.java | 46 ------------------- .../rpc/SessionFactoryRunFromToolResult.java | 4 +- .../rpc/SessionFactoryRunResult.java | 4 +- .../generated/rpc/SessionModelApi.java | 16 ------- .../SessionModelSetAllowedModelsParams.java | 33 ------------- .../SessionModelSetAllowedModelsResult.java | 37 --------------- .../generated/rpc/SessionSandboxApi.java | 18 -------- ...SessionSandboxDisableForSessionParams.java | 34 -------------- ...SessionSandboxDisableForSessionResult.java | 32 ------------- .../rpc/SessionSendMessagesParams.java | 12 ----- .../generated/rpc/SessionSendParams.java | 12 ----- 46 files changed, 22 insertions(+), 627 deletions(-) delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java delete mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java index 193044555d..9ba4f05618 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java @@ -37,8 +37,6 @@ public final class AssistantMessageEvent extends SessionEvent { public record AssistantMessageEventData( /** Unique identifier for this assistant message */ @JsonProperty("messageId") String messageId, - /** Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. */ - @JsonProperty("originatingMessageId") String originatingMessageId, /** Model that produced this assistant message, if known */ @JsonProperty("model") String model, /** The assistant's text response content */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java index c4c61556b1..e9db8a530d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java @@ -22,8 +22,6 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record AssistantUsageCopilotUsage( - /** Default billing model for token details that do not identify their own model */ - @JsonProperty("model") String model, /** Itemized token usage breakdown */ @JsonProperty("tokenDetails") List tokenDetails, /** Total cost in nano-AI units for this request */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java index 79d61945c0..9354568c7c 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java @@ -25,8 +25,6 @@ public record AssistantUsageCopilotUsageTokenDetail( @JsonProperty("batchSize") Long batchSize, /** Cost per batch of tokens */ @JsonProperty("costPerBatch") Long costPerBatch, - /** Model responsible for this billing entry */ - @JsonProperty("model") String model, /** Total token count for this entry */ @JsonProperty("tokenCount") Long tokenCount, /** Token category (e.g., "input", "output") */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java b/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java index 1c9d81b8ed..254543160a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java @@ -10,7 +10,7 @@ import javax.annotation.processing.Generated; /** - * Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference. + * Routing preference used when the session model is `auto`. * * @since 1.0.0 */ @@ -21,9 +21,7 @@ public enum AutoTier { /** The {@code balance} variant. */ BALANCE("balance"), /** The {@code intelligence} variant. */ - INTELLIGENCE("intelligence"), - /** The {@code fast} variant. */ - FAST("fast"); + INTELLIGENCE("intelligence"); private final String value; AutoTier(String value) { this.value = value; } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java index 7a2aebf3dd..886229cc69 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java @@ -22,8 +22,6 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record CompactionCompleteCompactionTokensUsedCopilotUsage( - /** Default billing model for token details that do not identify their own model */ - @JsonProperty("model") String model, /** Itemized token usage breakdown */ @JsonProperty("tokenDetails") List tokenDetails, /** Total cost in nano-AI units for this request */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java index 5a9dbd3e67..83209f94c8 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java @@ -25,8 +25,6 @@ public record CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail( @JsonProperty("batchSize") Long batchSize, /** Cost per batch of tokens */ @JsonProperty("costPerBatch") Long costPerBatch, - /** Model responsible for this billing entry */ - @JsonProperty("model") String model, /** Total token count for this entry */ @JsonProperty("tokenCount") Long tokenCount, /** Token category (e.g., "input", "output") */ 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 1fdf5bc13c..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 @@ -36,8 +36,6 @@ public record CustomAgentsUpdatedAgent( @JsonProperty("tools") List tools, /** Whether the agent can be selected by the user */ @JsonProperty("userInvocable") Boolean userInvocable, - /** Whether model-driven invocation is disabled for this agent. */ - @JsonProperty("disableModelInvocation") Boolean disableModelInvocation, /** Model override for this agent, if set */ @JsonProperty("model") String model, /** Authored model ids in priority order, if configured */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java index 828ddc9ee3..bbeffbbf48 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java @@ -20,8 +20,6 @@ public enum FactoryRunSettledStatus { COMPLETED("completed"), /** The {@code halted} variant. */ HALTED("halted"), - /** The {@code paused} variant. */ - PAUSED("paused"), /** The {@code cancelled} variant. */ CANCELLED("cancelled"), /** The {@code error} variant. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.java b/java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.java deleted file mode 100644 index acccaf5c8e..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.java +++ /dev/null @@ -1,37 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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; - -/** - * Auto preferences that Copilot API can recommend. - * - * @since 1.0.0 - */ -@javax.annotation.processing.Generated("copilot-sdk-codegen") -public enum RecommendedAutoTier { - /** The {@code efficiency} variant. */ - EFFICIENCY("efficiency"), - /** The {@code balance} variant. */ - BALANCE("balance"), - /** The {@code intelligence} variant. */ - INTELLIGENCE("intelligence"); - - private final String value; - RecommendedAutoTier(String value) { this.value = value; } - @com.fasterxml.jackson.annotation.JsonValue - public String getValue() { return value; } - @com.fasterxml.jackson.annotation.JsonCreator - public static RecommendedAutoTier fromValue(String value) { - for (RecommendedAutoTier v : values()) { - if (v.value.equals(value)) return v; - } - throw new IllegalArgumentException("Unknown RecommendedAutoTier value: " + value); - } -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java deleted file mode 100644 index 9dd00a4586..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java +++ /dev/null @@ -1,41 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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.auto_tier_recommendation". Live-only Auto preference recommendation from Copilot API after a successful Auto model call. - * @since 1.0.0 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@javax.annotation.processing.Generated("copilot-sdk-codegen") -public final class SessionAutoTierRecommendationEvent extends SessionEvent { - - @Override - public String getType() { return "session.auto_tier_recommendation"; } - - @JsonProperty("data") - private SessionAutoTierRecommendationEventData data; - - public SessionAutoTierRecommendationEventData getData() { return data; } - public void setData(SessionAutoTierRecommendationEventData data) { this.data = data; } - - /** Data payload for {@link SessionAutoTierRecommendationEvent}. */ - @JsonIgnoreProperties(ignoreUnknown = true) - @JsonInclude(JsonInclude.Include.NON_NULL) - public record SessionAutoTierRecommendationEventData( - /** Recommended Auto preference. */ - @JsonProperty("recommendedAutoTier") RecommendedAutoTier recommendedAutoTier - ) { - } -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java index 70861fb977..1925f6d893 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java @@ -52,8 +52,6 @@ public record SessionCompactionCompleteEventData( @JsonProperty("customInstructions") String customInstructions, /** LLM-generated summary of the compacted conversation history */ @JsonProperty("summaryContent") String summaryContent, - /** Authoritative active-factory reminder appended to the compacted context */ - @JsonProperty("activeFactorySummary") String activeFactorySummary, /** Canonical model identifier used for model-specific behavior when replaying compaction */ @JsonProperty("behaviorModelId") String behaviorModelId, /** Checkpoint snapshot number created for recovery */ 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 a04aefe9f3..367fa120b5 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 @@ -38,7 +38,6 @@ @JsonSubTypes.Type(value = SessionInfoEvent.class, name = "session.info"), @JsonSubTypes.Type(value = SessionWarningEvent.class, name = "session.warning"), @JsonSubTypes.Type(value = SessionModelChangeEvent.class, name = "session.model_change"), - @JsonSubTypes.Type(value = SessionAutoTierRecommendationEvent.class, name = "session.auto_tier_recommendation"), @JsonSubTypes.Type(value = SessionAutoTierSwitchFailedEvent.class, name = "session.auto_tier_switch_failed"), @JsonSubTypes.Type(value = SessionModeChangedEvent.class, name = "session.mode_changed"), @JsonSubTypes.Type(value = SessionModeNoticeDeliveredEvent.class, name = "session.mode_notice_delivered"), @@ -178,7 +177,6 @@ public abstract sealed class SessionEvent permits SessionInfoEvent, SessionWarningEvent, SessionModelChangeEvent, - SessionAutoTierRecommendationEvent, SessionAutoTierSwitchFailedEvent, SessionModeChangedEvent, SessionModeNoticeDeliveredEvent, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java index bef7c0138d..c246fac1ea 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java @@ -44,8 +44,6 @@ public record SubagentStartedEventData( @JsonProperty("agentDescription") String agentDescription, /** Model the sub-agent will run with, when known at start. */ @JsonProperty("model") String model, - /** Where the model input for this sub-agent came from. Present when the task planner resolved the launch (the task tool and factory agents); absent for sub-agents created through other runtime paths. */ - @JsonProperty("taskModelSource") SubagentTaskModelSource taskModelSource, /** Root id of the factory run that spawned this sub-agent, when it was spawned by one. */ @JsonProperty("factoryRunId") String factoryRunId, /** Task-registry ID of the spawning sub-agent. Absent when the root session spawned this child. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java deleted file mode 100644 index 6b5ec94531..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java +++ /dev/null @@ -1,39 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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; - -/** - * Where the model input for a task-tool sub-agent came from. - * - * @since 1.0.0 - */ -@javax.annotation.processing.Generated("copilot-sdk-codegen") -public enum SubagentTaskModelSource { - /** The {@code task_argument} variant. */ - TASK_ARGUMENT("task_argument"), - /** The {@code subagent_configuration} variant. */ - SUBAGENT_CONFIGURATION("subagent_configuration"), - /** The {@code custom_agent_definition} variant. */ - CUSTOM_AGENT_DEFINITION("custom_agent_definition"), - /** The {@code unset} variant. */ - UNSET("unset"); - - private final String value; - SubagentTaskModelSource(String value) { this.value = value; } - @com.fasterxml.jackson.annotation.JsonValue - public String getValue() { return value; } - @com.fasterxml.jackson.annotation.JsonCreator - public static SubagentTaskModelSource fromValue(String value) { - for (SubagentTaskModelSource v : values()) { - if (v.value.equals(value)) return v; - } - throw new IllegalArgumentException("Unknown SubagentTaskModelSource value: " + value); - } -} 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 8656baf397..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 @@ -37,8 +37,6 @@ public record AgentInfo( @JsonProperty("source") AgentInfoSource source, /** Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only. */ @JsonProperty("userInvocable") Boolean userInvocable, - /** Whether model-driven invocation is disabled for this agent. */ - @JsonProperty("disableModelInvocation") Boolean disableModelInvocation, /** Allowed tool names for this agent. Empty array means none; omitted means inherit defaults. */ @JsonProperty("tools") List tools, /** Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java index 00b18bcc94..a4433e1ea9 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java @@ -10,7 +10,7 @@ import javax.annotation.processing.Generated; /** - * Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference. + * Routing preference used when the session model is `auto`. * * @since 1.0.0 */ @@ -21,9 +21,7 @@ public enum AutoTier { /** The {@code balance} variant. */ BALANCE("balance"), /** The {@code intelligence} variant. */ - INTELLIGENCE("intelligence"), - /** The {@code fast} variant. */ - FAST("fast"); + INTELLIGENCE("intelligence"); private final String value; AutoTier(String value) { this.value = value; } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java index b1c2aff8b4..4fd7a91ca2 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record CapiSessionOptions( - /** Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. `fast` is an integrator-only latency preset, not a first-party GitHub Copilot product preference. */ + /** Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. */ @JsonProperty("autoTier") AutoTier autoTier, /** Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable. */ @JsonProperty("enableWebSocketResponses") Boolean enableWebSocketResponses diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java index 178c135cdd..35e0f276ee 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java @@ -27,8 +27,6 @@ public record FactoryAbortParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, /** Factory run identifier. */ - @JsonProperty("runId") String runId, - /** Opaque token identifying the execution attempt to abort. */ - @JsonProperty("executionToken") String executionToken + @JsonProperty("runId") String runId ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java index 51b9077ba1..9910d4f7f5 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java @@ -27,11 +27,11 @@ public record FactoryAgentOptions( @JsonProperty("schema") Object schema, /** Optional model identifier for the subagent. */ @JsonProperty("model") String model, - /** Optional reasoning effort override for the subagent. */ + /** Optional reasoning effort for the subagent. This field is accepted but not yet honored. */ @JsonProperty("reasoningEffort") String reasoningEffort, - /** Optional context tier override for the subagent. */ + /** Optional context tier for the subagent. This field is accepted but not yet honored. */ @JsonProperty("contextTier") ContextTier contextTier, - /** Optional built-in or custom agent name whose definition configures the subagent. */ + /** Optional custom agent name for the subagent. This field is accepted but not yet honored. */ @JsonProperty("agent") String agent ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.java deleted file mode 100644 index a07aa8a677..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.java +++ /dev/null @@ -1,35 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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; - -/** - * Action the runtime selected for a durable factory pause checkpoint. - * - * @since 1.0.0 - */ -@javax.annotation.processing.Generated("copilot-sdk-codegen") -public enum FactoryPauseCheckpointAction { - /** The {@code continue} variant. */ - CONTINUE("continue"), - /** The {@code pause} variant. */ - PAUSE("pause"); - - private final String value; - FactoryPauseCheckpointAction(String value) { this.value = value; } - @com.fasterxml.jackson.annotation.JsonValue - public String getValue() { return value; } - @com.fasterxml.jackson.annotation.JsonCreator - public static FactoryPauseCheckpointAction fromValue(String value) { - for (FactoryPauseCheckpointAction v : values()) { - if (v.value.equals(value)) return v; - } - throw new IllegalArgumentException("Unknown FactoryPauseCheckpointAction value: " + value); - } -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java index 436f969f61..71ee3c49e6 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java @@ -36,8 +36,6 @@ public record FactoryRunResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot, - /** Structured pause initiator metadata for a paused attempt. */ - @JsonProperty("pauseInfo") Object pauseInfo + @JsonProperty("snapshot") Object snapshot ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java index d5c87e7304..5d2348ec9e 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java @@ -24,8 +24,6 @@ public enum FactoryRunStatus { COMPLETED("completed"), /** The {@code halted} variant. */ HALTED("halted"), - /** The {@code paused} variant. */ - PAUSED("paused"), /** The {@code cancelled} variant. */ CANCELLED("cancelled"), /** The {@code error} variant. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java index e58b774bcb..f482acfa16 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java @@ -58,8 +58,6 @@ public record FactoryRunSummary( /** Epoch milliseconds when the current active segment started, or null while inactive. */ @JsonProperty("activeSegmentStartedAt") Long activeSegmentStartedAt, /** Terminal run outcome, or null while nonterminal. */ - @JsonProperty("terminal") FactoryRunTerminal terminal, - /** Whether the durable run state currently passes runtime resume eligibility checks. */ - @JsonProperty("canResume") Boolean canResume + @JsonProperty("terminal") FactoryRunTerminal terminal ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java index 0123e19793..bf9bfa7db4 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java @@ -28,8 +28,6 @@ public record FactoryRunTerminal( /** Human-readable terminal error. */ @JsonProperty("error") String error, /** Prompt-safe preview of the completed result. */ - @JsonProperty("resultPreview") String resultPreview, - /** Pause initiator metadata, or null when the run did not pause. */ - @JsonProperty("pauseInfo") Object pauseInfo + @JsonProperty("resultPreview") String resultPreview ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java deleted file mode 100644 index 06b2db9825..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java +++ /dev/null @@ -1,33 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - *--------------------------------------------------------------------------------------------*/ - -// AUTO-GENERATED FILE - DO NOT EDIT -// Generated from: api.schema.json - -package com.github.copilot.generated.rpc; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import javax.annotation.processing.Generated; - -/** - * A JSON Schema output contract. OpenAI receives the name, description, schema and strict setting; Anthropic receives the schema in output_config.format and always uses its native strict enforcement. - * - * @since 1.0.0 - */ -@javax.annotation.processing.Generated("copilot-sdk-codegen") -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public record JsonSchemaResponseFormat( - /** Name of the output schema, subject to the provider's naming restrictions. */ - @JsonProperty("name") String name, - /** JSON Schema passed unchanged to the inference provider. Supported keywords and schema restrictions are determined by that provider. */ - @JsonProperty("schema") Object schema, - /** Optional description passed to OpenAI providers. */ - @JsonProperty("description") String description, - /** Optional strict enforcement setting for OpenAI providers. Omitted uses the provider default. Anthropic always enforces its supported schema subset. */ - @JsonProperty("strict") Boolean strict -) { -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java index 3876c20b62..661e998b71 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java @@ -15,7 +15,7 @@ import javax.annotation.processing.Generated; /** - * Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. + * Plugin names (or specs) to disable. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -26,8 +26,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record PluginsDisableParams( /** Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. */ - @JsonProperty("names") List names, - /** Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. */ - @JsonProperty("workingDirectory") String workingDirectory + @JsonProperty("names") List names ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java index 2be80af89e..24404eee46 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java @@ -15,7 +15,7 @@ import javax.annotation.processing.Generated; /** - * Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. + * Plugin names (or specs) to enable. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -26,8 +26,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record PluginsEnableParams( /** Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. */ - @JsonProperty("names") List names, - /** Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. */ - @JsonProperty("workingDirectory") String workingDirectory + @JsonProperty("names") List names ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java index da5ac6c0e8..a7a28f5d1c 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java @@ -89,7 +89,7 @@ public CompletableFuture updateAll() { } /** - * Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. + * Plugin names (or specs) to enable. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -100,7 +100,7 @@ public CompletableFuture enable(PluginsEnableParams params) { } /** - * Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. + * Plugin names (or specs) to disable. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java index 12fa3cf6fd..e9a3e9f08a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java @@ -178,38 +178,6 @@ public CompletableFuture cancel(SessionFactoryCancel return caller.invoke("session.factory.cancel", _p, SessionFactoryCancelResult.class); } - /** - * Parameters for pausing a running factory. - *

- * Note: the {@code sessionId} field in the params record is overridden - * by the session-scoped wrapper; any value provided is ignored. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - @CopilotExperimental - public CompletableFuture pause(SessionFactoryPauseParams params) { - com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); - _p.put("sessionId", this.sessionId); - return caller.invoke("session.factory.pause", _p, SessionFactoryPauseResult.class); - } - - /** - * Parameters for an owned durable pause checkpoint. - *

- * Note: the {@code sessionId} field in the params record is overridden - * by the session-scoped wrapper; any value provided is ignored. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - @CopilotExperimental - public CompletableFuture pauseAtCheckpoint(SessionFactoryPauseAtCheckpointParams params) { - com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); - _p.put("sessionId", this.sessionId); - return caller.invoke("session.factory.pauseAtCheckpoint", _p, SessionFactoryPauseAtCheckpointResult.class); - } - /** * Parameters for recording factory progress. *

diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java index 42e1b38811..c9f9de2dcc 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java @@ -39,8 +39,6 @@ public record SessionFactoryCancelResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot, - /** Structured pause initiator metadata for a paused attempt. */ - @JsonProperty("pauseInfo") Object pauseInfo + @JsonProperty("snapshot") Object snapshot ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java index 0a3fb7f83a..01204cb832 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java @@ -63,8 +63,6 @@ public record SessionFactoryGetRunDetailResult( @JsonProperty("activeSegmentStartedAt") Long activeSegmentStartedAt, /** Terminal run outcome, or null while nonterminal. */ @JsonProperty("terminal") FactoryRunTerminal terminal, - /** Whether the durable run state currently passes runtime resume eligibility checks. */ - @JsonProperty("canResume") Boolean canResume, /** Lifecycle and timing observations for each factory phase. */ @JsonProperty("phases") List phases, /** Durable identities and live statuses for direct factory agents. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java index 9c141b28d4..2d6a5f52a9 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java @@ -39,8 +39,6 @@ public record SessionFactoryGetRunResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot, - /** Structured pause initiator metadata for a paused attempt. */ - @JsonProperty("pauseInfo") Object pauseInfo + @JsonProperty("snapshot") Object snapshot ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.java deleted file mode 100644 index a54c089e20..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.java +++ /dev/null @@ -1,36 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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; - -/** - * Parameters for an owned durable pause checkpoint. - * - * @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 SessionFactoryPauseAtCheckpointParams( - /** Target session identifier */ - @JsonProperty("sessionId") String sessionId, - /** Factory run identifier. */ - @JsonProperty("runId") String runId, - /** Opaque token identifying the execution attempt that reached the checkpoint. */ - @JsonProperty("executionToken") String executionToken, - /** Stable author-defined checkpoint key. */ - @JsonProperty("key") String key -) { -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java deleted file mode 100644 index 4775fa0c6b..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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; - -/** - * Result for the {@code session.factory.pauseAtCheckpoint} RPC method. - * - * @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 SessionFactoryPauseAtCheckpointResult( - /** Whether this execution attempt must pause or may continue. */ - @JsonProperty("action") FactoryPauseCheckpointAction action -) { -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java deleted file mode 100644 index 00a1b4d660..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java +++ /dev/null @@ -1,32 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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; - -/** - * Parameters for pausing a running factory. - * - * @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 SessionFactoryPauseParams( - /** Target session identifier */ - @JsonProperty("sessionId") String sessionId, - /** Factory run identifier. */ - @JsonProperty("runId") String runId -) { -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java deleted file mode 100644 index aa93afbea2..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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; - -/** - * Complete current or terminal factory run envelope. - * - * @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 SessionFactoryPauseResult( - /** Factory run identifier. */ - @JsonProperty("runId") String runId, - /** One-based execution attempt represented by this envelope. Absent before the first attempt starts or when returned by an older runtime. */ - @JsonProperty("attempt") Long attempt, - /** Current or terminal factory run status. */ - @JsonProperty("status") FactoryRunStatus status, - /** Completed factory result. */ - @JsonProperty("result") Object result, - /** Error message for an errored run. */ - @JsonProperty("error") String error, - /** Machine-readable failure details for a halted or errored run. */ - @JsonProperty("failure") Object failure, - /** Reason for a halted or cancelled run. */ - @JsonProperty("reason") String reason, - /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot, - /** Structured pause initiator metadata for a paused attempt. */ - @JsonProperty("pauseInfo") Object pauseInfo -) { -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java index b76daece8d..1a9dee5926 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java @@ -39,8 +39,6 @@ public record SessionFactoryRunFromToolResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot, - /** Structured pause initiator metadata for a paused attempt. */ - @JsonProperty("pauseInfo") Object pauseInfo + @JsonProperty("snapshot") Object snapshot ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java index 4a7cc978e4..d8ce481895 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java @@ -39,8 +39,6 @@ public record SessionFactoryRunResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot, - /** Structured pause initiator metadata for a paused attempt. */ - @JsonProperty("pauseInfo") Object pauseInfo + @JsonProperty("snapshot") Object snapshot ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java index 7afe40eb0b..b9adc34484 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java @@ -89,22 +89,6 @@ public CompletableFuture applyStartupOver return caller.invoke("session.model.applyStartupOverlay", _p, SessionModelApplyStartupOverlayResult.class); } - /** - * Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. - *

- * Note: the {@code sessionId} field in the params record is overridden - * by the session-scoped wrapper; any value provided is ignored. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - @CopilotExperimental - public CompletableFuture setAllowedModels(SessionModelSetAllowedModelsParams params) { - com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); - _p.put("sessionId", this.sessionId); - return caller.invoke("session.model.setAllowedModels", _p, SessionModelSetAllowedModelsResult.class); - } - /** * Reasoning effort level to apply to the currently selected model. *

diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.java deleted file mode 100644 index c46e1af7ac..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.java +++ /dev/null @@ -1,33 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - *--------------------------------------------------------------------------------------------*/ - -// AUTO-GENERATED FILE - DO NOT EDIT -// Generated from: api.schema.json - -package com.github.copilot.generated.rpc; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.github.copilot.CopilotExperimental; -import java.util.List; -import javax.annotation.processing.Generated; - -/** - * Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. - * - * @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 SessionModelSetAllowedModelsParams( - /** Target session identifier */ - @JsonProperty("sessionId") String sessionId, - /** Exact model IDs to permit, or null to clear the host restriction. */ - @JsonProperty("allowedModels") List allowedModels -) { -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java deleted file mode 100644 index d2552c2fcd..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java +++ /dev/null @@ -1,37 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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; - -/** - * The applied host allowlist and effective session model policy after intersection. - * - * @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 SessionModelSetAllowedModelsResult( - /** Normalized host allowlist. Omitted when the host restriction was cleared, or when a relay client does not return the host policy. */ - @JsonProperty("allowedModels") List allowedModels, - /** Effective exact IDs or repository policy patterns after applying the host restriction. Omitted by relay clients that do not return the host policy. */ - @JsonProperty("effectiveAllowedModels") List effectiveAllowedModels, - /** Effective deterministic fallback model, when the policy defines one. */ - @JsonProperty("fallbackModel") String fallbackModel, - /** Selected session model after reconciling a now-disallowed concrete selection. */ - @JsonProperty("modelId") String modelId -) { -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java index 02dbbea37a..55efb9da78 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java @@ -19,8 +19,6 @@ @javax.annotation.processing.Generated("copilot-sdk-codegen") public final class SessionSandboxApi { - private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; - private final RpcCaller caller; private final String sessionId; @@ -41,20 +39,4 @@ public CompletableFuture getEnforcemen return caller.invoke("session.sandbox.getEnforcementStatus", java.util.Map.of("sessionId", this.sessionId), SessionSandboxGetEnforcementStatusResult.class); } - /** - * Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. - *

- * Note: the {@code sessionId} field in the params record is overridden - * by the session-scoped wrapper; any value provided is ignored. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - @CopilotExperimental - public CompletableFuture disableForSession(SessionSandboxDisableForSessionParams params) { - com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); - _p.put("sessionId", this.sessionId); - return caller.invoke("session.sandbox.disableForSession", _p, SessionSandboxDisableForSessionResult.class); - } - } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java deleted file mode 100644 index f7720f8f20..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java +++ /dev/null @@ -1,34 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - *--------------------------------------------------------------------------------------------*/ - -// AUTO-GENERATED FILE - DO NOT EDIT -// Generated from: api.schema.json - -package com.github.copilot.generated.rpc; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.github.copilot.CopilotExperimental; -import javax.annotation.processing.Generated; - -/** - * Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. - * - * @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 SessionSandboxDisableForSessionParams( - /** Target session identifier */ - @JsonProperty("sessionId") String sessionId, - /** Identifier of the exact pending sandbox-bypass permission request that authorized the session opt-out. */ - @JsonProperty("requestId") String requestId, - /** Optional attribution for the permission decision. */ - @JsonProperty("decisionContext") PermissionDecisionContext decisionContext -) { -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java deleted file mode 100644 index a46129ea44..0000000000 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java +++ /dev/null @@ -1,32 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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; - -/** - * Result of attempting to disable sandboxing for the current session. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ -@CopilotExperimental -@javax.annotation.processing.Generated("copilot-sdk-codegen") -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public record SessionSandboxDisableForSessionResult( - /** Whether this call resolved the pending request and applied the session opt-out. */ - @JsonProperty("success") Boolean success, - /** The authoritative sandbox enabled state after the operation. */ - @JsonProperty("enabled") Boolean enabled -) { -} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java index cdec524a1a..2943192041 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java @@ -38,8 +38,6 @@ public record SessionSendMessagesParams( @JsonProperty("agentMode") SendAgentMode agentMode, /** Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. */ @JsonProperty("requestHeaders") Map requestHeaders, - /** Provider-native output format for the whole turn, including an empty message batch and all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. */ - @JsonProperty("responseFormat") SessionSendMessagesParamsResponseFormat responseFormat, /** W3C Trace Context traceparent header for distributed tracing of this agent turn */ @JsonProperty("traceparent") String traceparent, /** W3C Trace Context tracestate header for distributed tracing */ @@ -47,14 +45,4 @@ public record SessionSendMessagesParams( /** If true, await completion of the agentic loop for this turn before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageIds`; the caller can rely on the agent having processed the messages before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. */ @JsonProperty("wait") Boolean wait_ ) { - - @JsonIgnoreProperties(ignoreUnknown = true) - @JsonInclude(JsonInclude.Include.NON_NULL) - public record SessionSendMessagesParamsResponseFormat( - /** JSON Schema and provider options for the turn's output. */ - @JsonProperty("jsonSchema") JsonSchemaResponseFormat jsonSchema, - /** Output format discriminator. Currently only json_schema is supported. */ - @JsonProperty("type") String type - ) { - } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java index 964c48b438..f19c85ebe2 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java @@ -48,8 +48,6 @@ public record SessionSendParams( @JsonProperty("agentMode") SendAgentMode agentMode, /** Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. */ @JsonProperty("requestHeaders") Map requestHeaders, - /** Provider-native output format for this turn, including all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. */ - @JsonProperty("responseFormat") SessionSendParamsResponseFormat responseFormat, /** W3C Trace Context traceparent header for distributed tracing of this agent turn */ @JsonProperty("traceparent") String traceparent, /** W3C Trace Context tracestate header for distributed tracing */ @@ -57,14 +55,4 @@ public record SessionSendParams( /** If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. */ @JsonProperty("wait") Boolean wait_ ) { - - @JsonIgnoreProperties(ignoreUnknown = true) - @JsonInclude(JsonInclude.Include.NON_NULL) - public record SessionSendParamsResponseFormat( - /** JSON Schema and provider options for the turn's output. */ - @JsonProperty("jsonSchema") JsonSchemaResponseFormat jsonSchema, - /** Output format discriminator. Currently only json_schema is supported. */ - @JsonProperty("type") String type - ) { - } } From e8b714f667d1802f736b461a49ab486e2505a2fd Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Wed, 9 Sep 2026 15:18:35 +0000 Subject: [PATCH 3/7] ci: Preserve unreleased schema output on draft PRs Report pinned-schema drift without automatically rewriting draft Java output. Keep failure visibility, retain auto-regeneration for ready PRs, and restore the locally generated Java API after the initial workflow regenerated it against the old published runtime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/java-codegen-check.yml | 11 +++-- CONTRIBUTING.md | 3 ++ .../generated/AssistantMessageEvent.java | 2 + .../generated/AssistantUsageCopilotUsage.java | 2 + ...AssistantUsageCopilotUsageTokenDetail.java | 2 + .../github/copilot/generated/AutoTier.java | 6 ++- ...pleteCompactionTokensUsedCopilotUsage.java | 2 + ...tionTokensUsedCopilotUsageTokenDetail.java | 2 + .../generated/CustomAgentsUpdatedAgent.java | 2 + .../generated/FactoryRunSettledStatus.java | 2 + .../generated/RecommendedAutoTier.java | 37 +++++++++++++++ .../SessionAutoTierRecommendationEvent.java | 41 +++++++++++++++++ .../SessionCompactionCompleteEvent.java | 2 + .../copilot/generated/SessionEvent.java | 2 + .../generated/SubagentStartedEvent.java | 2 + .../generated/SubagentTaskModelSource.java | 39 ++++++++++++++++ .../copilot/generated/rpc/AgentInfo.java | 2 + .../copilot/generated/rpc/AutoTier.java | 6 ++- .../generated/rpc/CapiSessionOptions.java | 2 +- .../generated/rpc/FactoryAbortParams.java | 4 +- .../generated/rpc/FactoryAgentOptions.java | 6 +-- .../rpc/FactoryPauseCheckpointAction.java | 35 ++++++++++++++ .../generated/rpc/FactoryRunResult.java | 4 +- .../generated/rpc/FactoryRunStatus.java | 2 + .../generated/rpc/FactoryRunSummary.java | 4 +- .../generated/rpc/FactoryRunTerminal.java | 4 +- .../rpc/JsonSchemaResponseFormat.java | 33 +++++++++++++ .../generated/rpc/PluginsDisableParams.java | 6 ++- .../generated/rpc/PluginsEnableParams.java | 6 ++- .../generated/rpc/ServerPluginsApi.java | 4 +- .../generated/rpc/SessionFactoryApi.java | 32 +++++++++++++ .../rpc/SessionFactoryCancelResult.java | 4 +- .../rpc/SessionFactoryGetRunDetailResult.java | 2 + .../rpc/SessionFactoryGetRunResult.java | 4 +- ...SessionFactoryPauseAtCheckpointParams.java | 36 +++++++++++++++ ...SessionFactoryPauseAtCheckpointResult.java | 30 ++++++++++++ .../rpc/SessionFactoryPauseParams.java | 32 +++++++++++++ .../rpc/SessionFactoryPauseResult.java | 46 +++++++++++++++++++ .../rpc/SessionFactoryRunFromToolResult.java | 4 +- .../rpc/SessionFactoryRunResult.java | 4 +- .../generated/rpc/SessionModelApi.java | 16 +++++++ .../SessionModelSetAllowedModelsParams.java | 33 +++++++++++++ .../SessionModelSetAllowedModelsResult.java | 37 +++++++++++++++ .../generated/rpc/SessionSandboxApi.java | 18 ++++++++ ...SessionSandboxDisableForSessionParams.java | 34 ++++++++++++++ ...SessionSandboxDisableForSessionResult.java | 32 +++++++++++++ .../rpc/SessionSendMessagesParams.java | 12 +++++ .../generated/rpc/SessionSendParams.java | 12 +++++ 48 files changed, 636 insertions(+), 27 deletions(-) create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java diff --git a/.github/workflows/java-codegen-check.yml b/.github/workflows/java-codegen-check.yml index e490a5cf4e..28bd0b5bad 100644 --- a/.github/workflows/java-codegen-check.yml +++ b/.github/workflows/java-codegen-check.yml @@ -10,6 +10,7 @@ on: - 'java/sdk/src/generated/**' - '.github/workflows/java-codegen-check.yml' pull_request: + types: [opened, synchronize, reopened, ready_for_review] paths: - 'nodejs/package.json' - 'java/scripts/codegen/**' @@ -70,18 +71,18 @@ jobs: echo "✅ Generated files are up-to-date" fi - # --- On push to main: fail if generated files are stale (existing behavior) --- - - name: Fail on stale generated files (push to main) - if: steps.check-changes.outputs.changed == 'true' && github.event_name != 'pull_request' + # Drafts may intentionally target an unreleased schema; report drift without rewriting them. + - name: Fail on stale generated files without automatic updates + if: steps.check-changes.outputs.changed == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.draft == true) run: | echo "::error::Generated files are out of date. Run 'cd java/scripts/codegen && npm run generate' and commit the changes." git diff exit 1 - # --- On PR: commit regenerated files back and verify build --- + # --- On ready PRs: commit regenerated files back and verify build --- - name: Commit and push regenerated files to PR branch id: push-regen - if: steps.check-changes.outputs.changed == 'true' && github.event_name == 'pull_request' + if: steps.check-changes.outputs.changed == 'true' && github.event_name == 'pull_request' && github.event.pull_request.draft == false continue-on-error: true env: GH_TOKEN: ${{ github.token }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b63c7f5944..81f92144e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,6 +98,9 @@ never author model responses by hand. Rerun with `GITHUB_ACTIONS=true` and real provider credentials removed to require replay instead of forwarding cache misses upstream. A draft targeting an unreleased runtime should document the required runtime revision; update the pinned release only after it ships. +Pinned-schema CI can report drift in such a draft. Java codegen reports this +without automatically rewriting draft branches; automatic updates resume once +the pull request is ready for review. ## Submitting a Pull Request diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java index 9ba4f05618..193044555d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java @@ -37,6 +37,8 @@ public final class AssistantMessageEvent extends SessionEvent { public record AssistantMessageEventData( /** Unique identifier for this assistant message */ @JsonProperty("messageId") String messageId, + /** Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. */ + @JsonProperty("originatingMessageId") String originatingMessageId, /** Model that produced this assistant message, if known */ @JsonProperty("model") String model, /** The assistant's text response content */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java index e9db8a530d..c4c61556b1 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java @@ -22,6 +22,8 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record AssistantUsageCopilotUsage( + /** Default billing model for token details that do not identify their own model */ + @JsonProperty("model") String model, /** Itemized token usage breakdown */ @JsonProperty("tokenDetails") List tokenDetails, /** Total cost in nano-AI units for this request */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java index 9354568c7c..79d61945c0 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java @@ -25,6 +25,8 @@ public record AssistantUsageCopilotUsageTokenDetail( @JsonProperty("batchSize") Long batchSize, /** Cost per batch of tokens */ @JsonProperty("costPerBatch") Long costPerBatch, + /** Model responsible for this billing entry */ + @JsonProperty("model") String model, /** Total token count for this entry */ @JsonProperty("tokenCount") Long tokenCount, /** Token category (e.g., "input", "output") */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java b/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java index 254543160a..1c9d81b8ed 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AutoTier.java @@ -10,7 +10,7 @@ import javax.annotation.processing.Generated; /** - * Routing preference used when the session model is `auto`. + * Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference. * * @since 1.0.0 */ @@ -21,7 +21,9 @@ public enum AutoTier { /** The {@code balance} variant. */ BALANCE("balance"), /** The {@code intelligence} variant. */ - INTELLIGENCE("intelligence"); + INTELLIGENCE("intelligence"), + /** The {@code fast} variant. */ + FAST("fast"); private final String value; AutoTier(String value) { this.value = value; } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java index 886229cc69..7a2aebf3dd 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java @@ -22,6 +22,8 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record CompactionCompleteCompactionTokensUsedCopilotUsage( + /** Default billing model for token details that do not identify their own model */ + @JsonProperty("model") String model, /** Itemized token usage breakdown */ @JsonProperty("tokenDetails") List tokenDetails, /** Total cost in nano-AI units for this request */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java index 83209f94c8..5a9dbd3e67 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java @@ -25,6 +25,8 @@ public record CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail( @JsonProperty("batchSize") Long batchSize, /** Cost per batch of tokens */ @JsonProperty("costPerBatch") Long costPerBatch, + /** Model responsible for this billing entry */ + @JsonProperty("model") String model, /** Total token count for this entry */ @JsonProperty("tokenCount") Long tokenCount, /** Token category (e.g., "input", "output") */ 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 762f0b1ac8..1fdf5bc13c 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 @@ -36,6 +36,8 @@ public record CustomAgentsUpdatedAgent( @JsonProperty("tools") List tools, /** Whether the agent can be selected by the user */ @JsonProperty("userInvocable") Boolean userInvocable, + /** Whether model-driven invocation is disabled for this agent. */ + @JsonProperty("disableModelInvocation") Boolean disableModelInvocation, /** Model override for this agent, if set */ @JsonProperty("model") String model, /** Authored model ids in priority order, if configured */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java index bbeffbbf48..828ddc9ee3 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FactoryRunSettledStatus.java @@ -20,6 +20,8 @@ public enum FactoryRunSettledStatus { COMPLETED("completed"), /** The {@code halted} variant. */ HALTED("halted"), + /** The {@code paused} variant. */ + PAUSED("paused"), /** The {@code cancelled} variant. */ CANCELLED("cancelled"), /** The {@code error} variant. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.java b/java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.java new file mode 100644 index 0000000000..acccaf5c8e --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/RecommendedAutoTier.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; + +/** + * Auto preferences that Copilot API can recommend. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum RecommendedAutoTier { + /** The {@code efficiency} variant. */ + EFFICIENCY("efficiency"), + /** The {@code balance} variant. */ + BALANCE("balance"), + /** The {@code intelligence} variant. */ + INTELLIGENCE("intelligence"); + + private final String value; + RecommendedAutoTier(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static RecommendedAutoTier fromValue(String value) { + for (RecommendedAutoTier v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown RecommendedAutoTier value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java new file mode 100644 index 0000000000..9dd00a4586 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierRecommendationEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.auto_tier_recommendation". Live-only Auto preference recommendation from Copilot API after a successful Auto model call. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionAutoTierRecommendationEvent extends SessionEvent { + + @Override + public String getType() { return "session.auto_tier_recommendation"; } + + @JsonProperty("data") + private SessionAutoTierRecommendationEventData data; + + public SessionAutoTierRecommendationEventData getData() { return data; } + public void setData(SessionAutoTierRecommendationEventData data) { this.data = data; } + + /** Data payload for {@link SessionAutoTierRecommendationEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionAutoTierRecommendationEventData( + /** Recommended Auto preference. */ + @JsonProperty("recommendedAutoTier") RecommendedAutoTier recommendedAutoTier + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java index 1925f6d893..70861fb977 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java @@ -52,6 +52,8 @@ public record SessionCompactionCompleteEventData( @JsonProperty("customInstructions") String customInstructions, /** LLM-generated summary of the compacted conversation history */ @JsonProperty("summaryContent") String summaryContent, + /** Authoritative active-factory reminder appended to the compacted context */ + @JsonProperty("activeFactorySummary") String activeFactorySummary, /** Canonical model identifier used for model-specific behavior when replaying compaction */ @JsonProperty("behaviorModelId") String behaviorModelId, /** Checkpoint snapshot number created for recovery */ 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 367fa120b5..a04aefe9f3 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 @@ -38,6 +38,7 @@ @JsonSubTypes.Type(value = SessionInfoEvent.class, name = "session.info"), @JsonSubTypes.Type(value = SessionWarningEvent.class, name = "session.warning"), @JsonSubTypes.Type(value = SessionModelChangeEvent.class, name = "session.model_change"), + @JsonSubTypes.Type(value = SessionAutoTierRecommendationEvent.class, name = "session.auto_tier_recommendation"), @JsonSubTypes.Type(value = SessionAutoTierSwitchFailedEvent.class, name = "session.auto_tier_switch_failed"), @JsonSubTypes.Type(value = SessionModeChangedEvent.class, name = "session.mode_changed"), @JsonSubTypes.Type(value = SessionModeNoticeDeliveredEvent.class, name = "session.mode_notice_delivered"), @@ -177,6 +178,7 @@ public abstract sealed class SessionEvent permits SessionInfoEvent, SessionWarningEvent, SessionModelChangeEvent, + SessionAutoTierRecommendationEvent, SessionAutoTierSwitchFailedEvent, SessionModeChangedEvent, SessionModeNoticeDeliveredEvent, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java index c246fac1ea..bef7c0138d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java @@ -44,6 +44,8 @@ public record SubagentStartedEventData( @JsonProperty("agentDescription") String agentDescription, /** Model the sub-agent will run with, when known at start. */ @JsonProperty("model") String model, + /** Where the model input for this sub-agent came from. Present when the task planner resolved the launch (the task tool and factory agents); absent for sub-agents created through other runtime paths. */ + @JsonProperty("taskModelSource") SubagentTaskModelSource taskModelSource, /** Root id of the factory run that spawned this sub-agent, when it was spawned by one. */ @JsonProperty("factoryRunId") String factoryRunId, /** Task-registry ID of the spawning sub-agent. Absent when the root session spawned this child. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java new file mode 100644 index 0000000000..6b5ec94531 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentTaskModelSource.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Where the model input for a task-tool sub-agent came from. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SubagentTaskModelSource { + /** The {@code task_argument} variant. */ + TASK_ARGUMENT("task_argument"), + /** The {@code subagent_configuration} variant. */ + SUBAGENT_CONFIGURATION("subagent_configuration"), + /** The {@code custom_agent_definition} variant. */ + CUSTOM_AGENT_DEFINITION("custom_agent_definition"), + /** The {@code unset} variant. */ + UNSET("unset"); + + private final String value; + SubagentTaskModelSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SubagentTaskModelSource fromValue(String value) { + for (SubagentTaskModelSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SubagentTaskModelSource value: " + value); + } +} 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 3d9f9c2d7e..8656baf397 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 @@ -37,6 +37,8 @@ public record AgentInfo( @JsonProperty("source") AgentInfoSource source, /** Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only. */ @JsonProperty("userInvocable") Boolean userInvocable, + /** Whether model-driven invocation is disabled for this agent. */ + @JsonProperty("disableModelInvocation") Boolean disableModelInvocation, /** Allowed tool names for this agent. Empty array means none; omitted means inherit defaults. */ @JsonProperty("tools") List tools, /** Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java index a4433e1ea9..00b18bcc94 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/AutoTier.java @@ -10,7 +10,7 @@ import javax.annotation.processing.Generated; /** - * Routing preference used when the session model is `auto`. + * Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference. * * @since 1.0.0 */ @@ -21,7 +21,9 @@ public enum AutoTier { /** The {@code balance} variant. */ BALANCE("balance"), /** The {@code intelligence} variant. */ - INTELLIGENCE("intelligence"); + INTELLIGENCE("intelligence"), + /** The {@code fast} variant. */ + FAST("fast"); private final String value; AutoTier(String value) { this.value = value; } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java index 4fd7a91ca2..b1c2aff8b4 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record CapiSessionOptions( - /** Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. */ + /** Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. `fast` is an integrator-only latency preset, not a first-party GitHub Copilot product preference. */ @JsonProperty("autoTier") AutoTier autoTier, /** Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable. */ @JsonProperty("enableWebSocketResponses") Boolean enableWebSocketResponses diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java index 35e0f276ee..178c135cdd 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAbortParams.java @@ -27,6 +27,8 @@ public record FactoryAbortParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, /** Factory run identifier. */ - @JsonProperty("runId") String runId + @JsonProperty("runId") String runId, + /** Opaque token identifying the execution attempt to abort. */ + @JsonProperty("executionToken") String executionToken ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java index 9910d4f7f5..51b9077ba1 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentOptions.java @@ -27,11 +27,11 @@ public record FactoryAgentOptions( @JsonProperty("schema") Object schema, /** Optional model identifier for the subagent. */ @JsonProperty("model") String model, - /** Optional reasoning effort for the subagent. This field is accepted but not yet honored. */ + /** Optional reasoning effort override for the subagent. */ @JsonProperty("reasoningEffort") String reasoningEffort, - /** Optional context tier for the subagent. This field is accepted but not yet honored. */ + /** Optional context tier override for the subagent. */ @JsonProperty("contextTier") ContextTier contextTier, - /** Optional custom agent name for the subagent. This field is accepted but not yet honored. */ + /** Optional built-in or custom agent name whose definition configures the subagent. */ @JsonProperty("agent") String agent ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.java new file mode 100644 index 0000000000..a07aa8a677 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPauseCheckpointAction.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; + +/** + * Action the runtime selected for a durable factory pause checkpoint. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FactoryPauseCheckpointAction { + /** The {@code continue} variant. */ + CONTINUE("continue"), + /** The {@code pause} variant. */ + PAUSE("pause"); + + private final String value; + FactoryPauseCheckpointAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FactoryPauseCheckpointAction fromValue(String value) { + for (FactoryPauseCheckpointAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FactoryPauseCheckpointAction value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java index 71ee3c49e6..436f969f61 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java @@ -36,6 +36,8 @@ public record FactoryRunResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java index 5d2348ec9e..d5c87e7304 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunStatus.java @@ -24,6 +24,8 @@ public enum FactoryRunStatus { COMPLETED("completed"), /** The {@code halted} variant. */ HALTED("halted"), + /** The {@code paused} variant. */ + PAUSED("paused"), /** The {@code cancelled} variant. */ CANCELLED("cancelled"), /** The {@code error} variant. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java index f482acfa16..e58b774bcb 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java @@ -58,6 +58,8 @@ public record FactoryRunSummary( /** Epoch milliseconds when the current active segment started, or null while inactive. */ @JsonProperty("activeSegmentStartedAt") Long activeSegmentStartedAt, /** Terminal run outcome, or null while nonterminal. */ - @JsonProperty("terminal") FactoryRunTerminal terminal + @JsonProperty("terminal") FactoryRunTerminal terminal, + /** Whether the durable run state currently passes runtime resume eligibility checks. */ + @JsonProperty("canResume") Boolean canResume ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java index bf9bfa7db4..0123e19793 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java @@ -28,6 +28,8 @@ public record FactoryRunTerminal( /** Human-readable terminal error. */ @JsonProperty("error") String error, /** Prompt-safe preview of the completed result. */ - @JsonProperty("resultPreview") String resultPreview + @JsonProperty("resultPreview") String resultPreview, + /** Pause initiator metadata, or null when the run did not pause. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java new file mode 100644 index 0000000000..06b2db9825 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.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 javax.annotation.processing.Generated; + +/** + * A JSON Schema output contract. OpenAI receives the name, description, schema and strict setting; Anthropic receives the schema in output_config.format and always uses its native strict enforcement. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record JsonSchemaResponseFormat( + /** Name of the output schema, subject to the provider's naming restrictions. */ + @JsonProperty("name") String name, + /** JSON Schema passed unchanged to the inference provider. Supported keywords and schema restrictions are determined by that provider. */ + @JsonProperty("schema") Object schema, + /** Optional description passed to OpenAI providers. */ + @JsonProperty("description") String description, + /** Optional strict enforcement setting for OpenAI providers. Omitted uses the provider default. Anthropic always enforces its supported schema subset. */ + @JsonProperty("strict") Boolean strict +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java index 661e998b71..3876c20b62 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsDisableParams.java @@ -15,7 +15,7 @@ import javax.annotation.processing.Generated; /** - * Plugin names (or specs) to disable. + * Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -26,6 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record PluginsDisableParams( /** Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. */ - @JsonProperty("names") List names + @JsonProperty("names") List names, + /** Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. */ + @JsonProperty("workingDirectory") String workingDirectory ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java index 24404eee46..2be80af89e 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PluginsEnableParams.java @@ -15,7 +15,7 @@ import javax.annotation.processing.Generated; /** - * Plugin names (or specs) to enable. + * Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -26,6 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record PluginsEnableParams( /** Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. */ - @JsonProperty("names") List names + @JsonProperty("names") List names, + /** Working directory whose repository `enabledPlugins` overlay decides whether this mutation is repository-controlled. Hosts that serve sessions across several repositories (the SDK server) should pass the session's directory; otherwise the guard is evaluated against the server process's own working directory, which may belong to a different repository. Defaults to the server's current working directory. */ + @JsonProperty("workingDirectory") String workingDirectory ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java index a7a28f5d1c..da5ac6c0e8 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerPluginsApi.java @@ -89,7 +89,7 @@ public CompletableFuture updateAll() { } /** - * Plugin names (or specs) to enable. + * Plugin names (or specs) to enable, plus the optional working directory the repository-controlled guard is evaluated against. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -100,7 +100,7 @@ public CompletableFuture enable(PluginsEnableParams params) { } /** - * Plugin names (or specs) to disable. + * Plugin names (or specs) to disable, plus the optional working directory the repository-controlled guard is evaluated against. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java index e9a3e9f08a..12fa3cf6fd 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java @@ -178,6 +178,38 @@ public CompletableFuture cancel(SessionFactoryCancel return caller.invoke("session.factory.cancel", _p, SessionFactoryCancelResult.class); } + /** + * Parameters for pausing a running factory. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture pause(SessionFactoryPauseParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.factory.pause", _p, SessionFactoryPauseResult.class); + } + + /** + * Parameters for an owned durable pause checkpoint. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture pauseAtCheckpoint(SessionFactoryPauseAtCheckpointParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.factory.pauseAtCheckpoint", _p, SessionFactoryPauseAtCheckpointResult.class); + } + /** * Parameters for recording factory progress. *

diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java index c9f9de2dcc..42e1b38811 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryCancelResult.java @@ -39,6 +39,8 @@ public record SessionFactoryCancelResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java index 01204cb832..0a3fb7f83a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java @@ -63,6 +63,8 @@ public record SessionFactoryGetRunDetailResult( @JsonProperty("activeSegmentStartedAt") Long activeSegmentStartedAt, /** Terminal run outcome, or null while nonterminal. */ @JsonProperty("terminal") FactoryRunTerminal terminal, + /** Whether the durable run state currently passes runtime resume eligibility checks. */ + @JsonProperty("canResume") Boolean canResume, /** Lifecycle and timing observations for each factory phase. */ @JsonProperty("phases") List phases, /** Durable identities and live statuses for direct factory agents. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java index 2d6a5f52a9..9c141b28d4 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunResult.java @@ -39,6 +39,8 @@ public record SessionFactoryGetRunResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.java new file mode 100644 index 0000000000..a54c089e20 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointParams.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; + +/** + * Parameters for an owned durable pause checkpoint. + * + * @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 SessionFactoryPauseAtCheckpointParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Factory run identifier. */ + @JsonProperty("runId") String runId, + /** Opaque token identifying the execution attempt that reached the checkpoint. */ + @JsonProperty("executionToken") String executionToken, + /** Stable author-defined checkpoint key. */ + @JsonProperty("key") String key +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java new file mode 100644 index 0000000000..4775fa0c6b --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseAtCheckpointResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result for the {@code session.factory.pauseAtCheckpoint} RPC method. + * + * @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 SessionFactoryPauseAtCheckpointResult( + /** Whether this execution attempt must pause or may continue. */ + @JsonProperty("action") FactoryPauseCheckpointAction action +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java new file mode 100644 index 0000000000..00a1b4d660 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Parameters for pausing a running factory. + * + * @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 SessionFactoryPauseParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Factory run identifier. */ + @JsonProperty("runId") String runId +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java new file mode 100644 index 0000000000..aa93afbea2 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryPauseResult.java @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Complete current or terminal factory run envelope. + * + * @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 SessionFactoryPauseResult( + /** Factory run identifier. */ + @JsonProperty("runId") String runId, + /** One-based execution attempt represented by this envelope. Absent before the first attempt starts or when returned by an older runtime. */ + @JsonProperty("attempt") Long attempt, + /** Current or terminal factory run status. */ + @JsonProperty("status") FactoryRunStatus status, + /** Completed factory result. */ + @JsonProperty("result") Object result, + /** Error message for an errored run. */ + @JsonProperty("error") String error, + /** Machine-readable failure details for a halted or errored run. */ + @JsonProperty("failure") Object failure, + /** Reason for a halted or cancelled run. */ + @JsonProperty("reason") String reason, + /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java index 1a9dee5926..b76daece8d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunFromToolResult.java @@ -39,6 +39,8 @@ public record SessionFactoryRunFromToolResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java index d8ce481895..4a7cc978e4 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryRunResult.java @@ -39,6 +39,8 @@ public record SessionFactoryRunResult( /** Reason for a halted or cancelled run. */ @JsonProperty("reason") String reason, /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ - @JsonProperty("snapshot") Object snapshot + @JsonProperty("snapshot") Object snapshot, + /** Structured pause initiator metadata for a paused attempt. */ + @JsonProperty("pauseInfo") Object pauseInfo ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java index b9adc34484..7afe40eb0b 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java @@ -89,6 +89,22 @@ public CompletableFuture applyStartupOver return caller.invoke("session.model.applyStartupOverlay", _p, SessionModelApplyStartupOverlayResult.class); } + /** + * Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture setAllowedModels(SessionModelSetAllowedModelsParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.model.setAllowedModels", _p, SessionModelSetAllowedModelsResult.class); + } + /** * Reasoning effort level to apply to the currently selected model. *

diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.java new file mode 100644 index 0000000000..c46e1af7ac --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsParams.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; + +/** + * Host-supplied exact model selection IDs to allow for this running session. CAPI IDs are intersected with repository `.github/allowed_models.txt` policy; provider-qualified IDs remain exempt from repository-only policy but are restricted by this host list. Omit or pass null to clear the host restriction; an explicit empty or disjoint list is rejected. Validation and pre-selection fallback failures preserve the previous restriction. Failures after a fallback selection commits retain the new restriction and selected model; callers should inspect current session state after such an error. + * + * @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 SessionModelSetAllowedModelsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Exact model IDs to permit, or null to clear the host restriction. */ + @JsonProperty("allowedModels") List allowedModels +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java new file mode 100644 index 0000000000..d2552c2fcd --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetAllowedModelsResult.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * The applied host allowlist and effective session model policy after intersection. + * + * @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 SessionModelSetAllowedModelsResult( + /** Normalized host allowlist. Omitted when the host restriction was cleared, or when a relay client does not return the host policy. */ + @JsonProperty("allowedModels") List allowedModels, + /** Effective exact IDs or repository policy patterns after applying the host restriction. Omitted by relay clients that do not return the host policy. */ + @JsonProperty("effectiveAllowedModels") List effectiveAllowedModels, + /** Effective deterministic fallback model, when the policy defines one. */ + @JsonProperty("fallbackModel") String fallbackModel, + /** Selected session model after reconciling a now-disallowed concrete selection. */ + @JsonProperty("modelId") String modelId +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java index 55efb9da78..02dbbea37a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxApi.java @@ -19,6 +19,8 @@ @javax.annotation.processing.Generated("copilot-sdk-codegen") public final class SessionSandboxApi { + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + private final RpcCaller caller; private final String sessionId; @@ -39,4 +41,20 @@ public CompletableFuture getEnforcemen return caller.invoke("session.sandbox.getEnforcementStatus", java.util.Map.of("sessionId", this.sessionId), SessionSandboxGetEnforcementStatusResult.class); } + /** + * Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture disableForSession(SessionSandboxDisableForSessionParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.sandbox.disableForSession", _p, SessionSandboxDisableForSessionResult.class); + } + } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java new file mode 100644 index 0000000000..f7720f8f20 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Request to disable sandboxing for the current session while resolving an active sandbox-bypass permission prompt. + * + * @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 SessionSandboxDisableForSessionParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Identifier of the exact pending sandbox-bypass permission request that authorized the session opt-out. */ + @JsonProperty("requestId") String requestId, + /** Optional attribution for the permission decision. */ + @JsonProperty("decisionContext") PermissionDecisionContext decisionContext +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java new file mode 100644 index 0000000000..a46129ea44 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSandboxDisableForSessionResult.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Result of attempting to disable sandboxing for the current session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSandboxDisableForSessionResult( + /** Whether this call resolved the pending request and applied the session opt-out. */ + @JsonProperty("success") Boolean success, + /** The authoritative sandbox enabled state after the operation. */ + @JsonProperty("enabled") Boolean enabled +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java index 2943192041..cdec524a1a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java @@ -38,6 +38,8 @@ public record SessionSendMessagesParams( @JsonProperty("agentMode") SendAgentMode agentMode, /** Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. */ @JsonProperty("requestHeaders") Map requestHeaders, + /** Provider-native output format for the whole turn, including an empty message batch and all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. */ + @JsonProperty("responseFormat") SessionSendMessagesParamsResponseFormat responseFormat, /** W3C Trace Context traceparent header for distributed tracing of this agent turn */ @JsonProperty("traceparent") String traceparent, /** W3C Trace Context tracestate header for distributed tracing */ @@ -45,4 +47,14 @@ public record SessionSendMessagesParams( /** If true, await completion of the agentic loop for this turn before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageIds`; the caller can rely on the agent having processed the messages before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. */ @JsonProperty("wait") Boolean wait_ ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionSendMessagesParamsResponseFormat( + /** JSON Schema and provider options for the turn's output. */ + @JsonProperty("jsonSchema") JsonSchemaResponseFormat jsonSchema, + /** Output format discriminator. Currently only json_schema is supported. */ + @JsonProperty("type") String type + ) { + } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java index f19c85ebe2..964c48b438 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java @@ -48,6 +48,8 @@ public record SessionSendParams( @JsonProperty("agentMode") SendAgentMode agentMode, /** Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. */ @JsonProperty("requestHeaders") Map requestHeaders, + /** Provider-native output format for this turn, including all tool-call iterations. Not inherited by later turns or subagents. Ordinary steering inherits the active format; specifying responseFormat with mode: immediate is an error, even while idle. Returned assistant content remains text; the runtime does not parse or validate it. Unsupported models or schemas produce provider errors. */ + @JsonProperty("responseFormat") SessionSendParamsResponseFormat responseFormat, /** W3C Trace Context traceparent header for distributed tracing of this agent turn */ @JsonProperty("traceparent") String traceparent, /** W3C Trace Context tracestate header for distributed tracing */ @@ -55,4 +57,14 @@ public record SessionSendParams( /** If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. */ @JsonProperty("wait") Boolean wait_ ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionSendParamsResponseFormat( + /** JSON Schema and provider options for the turn's output. */ + @JsonProperty("jsonSchema") JsonSchemaResponseFormat jsonSchema, + /** Output format discriminator. Currently only json_schema is supported. */ + @JsonProperty("type") String type + ) { + } } From 941d6441feb02b5006949a7b59a8feaff2814b2f Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Wed, 9 Sep 2026 16:22:32 +0000 Subject: [PATCH 4/7] feat: Expose final reply markers for event-driven structured outputs Regenerate event types for all six SDK languages and document isFinalReply. Add real-provider Node and C# direct-send E2Es that parse the final correlated reply while stop hooks block idle, plus regressions preserving SendAndWait rejection on later errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/README.md | 9 ++ dotnet/src/Generated/SessionEvents.cs | 5 + dotnet/test/E2E/StructuredOutputE2ETests.cs | 77 +++++++++++++++- dotnet/test/Unit/StructuredOutputTests.cs | 30 ++++++ go/rpc/zsession_events.go | 2 + .../generated/AssistantMessageEvent.java | 2 + nodejs/README.md | 13 ++- nodejs/src/generated/session-events.ts | 4 + nodejs/test/e2e/structured_output.e2e.test.ts | 92 +++++++++++++++++++ nodejs/test/structured-output.test.ts | 25 +++++ python/copilot/generated/session_events.py | 5 + rust/src/generated/session_events.rs | 3 + ...inal_reply_before_stop_hook_completes.yaml | 20 ++++ ...inal_reply_before_stop_hook_completes.yaml | 20 ++++ 14 files changed, 305 insertions(+), 2 deletions(-) create mode 100644 test/snapshots/structured_output/node_send_exposes_final_reply_before_stop_hook_completes.yaml create mode 100644 test/snapshots/structured_output_dotnet/send_exposes_final_reply_before_stop_hook_completes.yaml diff --git a/dotnet/README.md b/dotnet/README.md index 30c8dbb278..f7f84d0d6c 100644 --- a/dotnet/README.md +++ b/dotnet/README.md @@ -333,6 +333,15 @@ unchanged with the name `response` and `strict: true`. The untyped or deserialize the response. Schema-bearing waits use the same message correlation as typed waits; unformatted waits retain their existing behavior. +With `SendAsync`, consume `AssistantMessageEvent` events whose +`Data.IsFinalReply == true` and `Data.OriginatingMessageId` matches the returned +message ID. This identifies the final reply to parse without waiting for idle. +Subscribe before sending because events can precede the send acknowledgement. +Tool-call messages are not marked final, and only the last message of a +multi-message terminal response is marked. This optional flag does not guarantee +successful completion: hooks and other processing can still produce a later +`SessionErrorEvent`. `SendAndWaitAsync` retains its wait-for-idle behavior. + ```csharp using var schema = System.Text.Json.JsonDocument.Parse(""" {"type":"object","properties":{"count":{"type":"integer"}},"required":["count"],"additionalProperties":false} diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index 2e6de8f9b1..d4c88e1ba9 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -3816,6 +3816,11 @@ public sealed partial class AssistantMessageData [JsonPropertyName("interactionId")] public string? InteractionId { get; set; } + ///

True when this is the last assistant reply for the originatingMessageId. Does not indicate successful completion of hooks or cleanup; session.error or abort events may still follow. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("isFinalReply")] + public bool? IsFinalReply { get; set; } + /// Unique identifier for this assistant message. [JsonPropertyName("messageId")] public required string MessageId { get; set; } diff --git a/dotnet/test/E2E/StructuredOutputE2ETests.cs b/dotnet/test/E2E/StructuredOutputE2ETests.cs index 804904e0e2..dfc9e549a3 100644 --- a/dotnet/test/E2E/StructuredOutputE2ETests.cs +++ b/dotnet/test/E2E/StructuredOutputE2ETests.cs @@ -74,7 +74,7 @@ public async Task Sends_Explicit_Schema_For_Message_And_Batch() var completion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); using var subscription = session.On(message => { - if (message.Data.ToolRequests is not { Length: > 0 }) + if (message.Data.IsFinalReply == true) { completion.TrySetResult(message); } @@ -97,6 +97,7 @@ public async Task Sends_Explicit_Schema_For_Message_And_Batch() using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); var message = await completion.Task.WaitAsync(cts.Token); Assert.Equal(accepted.MessageIds.Last(), message.Data.OriginatingMessageId); + Assert.True(message.Data.IsFinalReply); var result = JsonSerializer.Deserialize(message.Data.Content, StructuredOutputE2EJsonContext.Default.Inventory); Assert.NotNull(result); Assert.Equal(42, result.Count); @@ -108,12 +109,86 @@ public async Task Sends_Explicit_Schema_For_Message_And_Batch() ResponseSchema = schema.RootElement.Clone(), }, TimeSpan.FromMinutes(3)); Assert.NotNull(raw); + Assert.True(raw.Data.IsFinalReply); var updated = JsonSerializer.Deserialize(raw.Data.Content, StructuredOutputE2EJsonContext.Default.Inventory); Assert.NotNull(updated); Assert.Equal(21, updated.Count); Assert.Equal("blue", updated.Color); } + [Fact] + public async Task Send_Exposes_Final_Reply_Before_Stop_Hook_Completes() + { + var hookEntered = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var releaseHook = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var config = StructuredSessionConfig(); + config.Tools = + [ + CopilotTool.DefineTool(() => "The inventory contains 42 red widgets.", + factoryOptions: new() { Name = "read_inventory", Description = "Read the current widget count and color." }), + ]; + config.Hooks = new SessionHooks + { + OnAgentStop = async (_, _) => + { + hookEntered.TrySetResult(); + await releaseHook.Task; + return null; + }, + }; + var session = await CreateSessionAsync(config); + var replyReceived = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var idleReceived = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var replies = new System.Collections.Concurrent.ConcurrentQueue(); + using var subscription = session.On(evt => + { + if (!string.IsNullOrEmpty(evt.AgentId)) return; + switch (evt) + { + case AssistantMessageEvent message: + replies.Enqueue(message); + if (message.Data.IsFinalReply == true) replyReceived.TrySetResult(message); + break; + case SessionErrorEvent error: + replyReceived.TrySetException(new InvalidOperationException(error.Data.Message)); + break; + case SessionIdleEvent: + idleReceived.TrySetResult(); + break; + } + }); + using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); + using var schema = JsonDocument.Parse( + """{"type":"object","properties":{"count":{"type":"integer"},"color":{"type":"string"}},"required":["count","color"],"additionalProperties":false}"""); + try + { + var messageId = await session.SendAsync(new MessageOptions + { + Prompt = "Call read_inventory once, then report the current widget count and color.", + ResponseSchema = schema.RootElement.Clone(), + }, cts.Token); + var reply = await replyReceived.Task.WaitAsync(cts.Token); + await hookEntered.Task.WaitAsync(cts.Token); + Assert.Equal(messageId, reply.Data.OriginatingMessageId); + var result = JsonSerializer.Deserialize(reply.Data.Content, StructuredOutputE2EJsonContext.Default.Inventory); + Assert.NotNull(result); + Assert.Equal(42, result.Count); + Assert.Equal("red", result.Color); + Assert.False(idleReceived.Task.IsCompleted); + Assert.Same(reply, Assert.Single(replies, message => message.Data.IsFinalReply == true)); + Assert.Contains(replies, message => message.Data.ToolRequests is { Length: > 0 }); + Assert.Empty(reply.Data.ToolRequests ?? []); + + releaseHook.TrySetResult(); + await idleReceived.Task.WaitAsync(cts.Token); + Assert.Same(reply, replies.Last()); + } + finally + { + releaseHook.TrySetResult(); + } + } + [Fact] public async Task Concurrent_Typed_Sends_Return_Their_Own_Results() { diff --git a/dotnet/test/Unit/StructuredOutputTests.cs b/dotnet/test/Unit/StructuredOutputTests.cs index d43b271876..fdc560e091 100644 --- a/dotnet/test/Unit/StructuredOutputTests.cs +++ b/dotnet/test/Unit/StructuredOutputTests.cs @@ -382,6 +382,36 @@ public async Task StructuredOutput_Propagates_Rpc_And_Session_Errors(bool rpcErr } } + [Fact] + public async Task StructuredOutput_Final_Reply_Does_Not_Hide_Later_Session_Errors() + { + await using var server = await FakeCopilotServer.StartAsync(); + await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); + await using var session = await client.CreateSessionAsync(new SessionConfig()); + var task = session.SendAndWaitAsync("Answer", StructuredOutputJsonContext.Default.Options); + await WaitForRequestAsync(server, "session.send"); + await server.SendSessionEventAsync(session.SessionId, "user.message", new() + { + ["messageId"] = "message-1", + ["content"] = "Answer", + }); + await server.SendSessionEventAsync(session.SessionId, "assistant.message", new() + { + ["messageId"] = "final-reply", + ["originatingMessageId"] = "message-1", + ["isFinalReply"] = true, + ["content"] = """{"answer_text":"correct","count":42}""", + }); + await server.SendSessionEventAsync(session.SessionId, "session.error", new() + { + ["errorType"] = "query", + ["message"] = "post-response failure", + }); + await server.SendSessionEventAsync(session.SessionId, "session.idle", new()); + var error = await Assert.ThrowsAsync(() => task.WaitAsync(TimeSpan.FromSeconds(5))); + Assert.Contains("post-response failure", error.Message); + } + [Fact] public async Task StructuredOutput_Can_Correlate_Without_User_Message_Event() { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 0ad16a63e1..3511e18ea2 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -382,6 +382,8 @@ type AssistantMessageData struct { Fusion *FusionAttribution `json:"fusion,omitempty"` // CAPI interaction ID for correlating this message with upstream telemetry InteractionID *string `json:"interactionId,omitempty"` + // True when this is the last assistant reply for the originatingMessageId. Does not indicate successful completion of hooks or cleanup; session.error or abort events may still follow. + IsFinalReply *bool `json:"isFinalReply,omitempty"` // Unique identifier for this assistant message MessageID string `json:"messageId"` // Model that produced this assistant message, if known diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java index 193044555d..50877be6da 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java @@ -39,6 +39,8 @@ public record AssistantMessageEventData( @JsonProperty("messageId") String messageId, /** Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. */ @JsonProperty("originatingMessageId") String originatingMessageId, + /** True when this is the last assistant reply for the originatingMessageId. Does not indicate successful completion of hooks or cleanup; session.error or abort events may still follow. */ + @JsonProperty("isFinalReply") Boolean isFinalReply, /** Model that produced this assistant message, if known */ @JsonProperty("model") String model, /** The assistant's text response content */ diff --git a/nodejs/README.md b/nodejs/README.md index d6fe833d05..d5ef322209 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -303,7 +303,8 @@ Returns the final assistant message event, or undefined if none was received. ##### Structured output (preview) -Requires a runtime build with `responseFormat` and `originatingMessageId` support. +Requires a runtime build with `responseFormat`, `originatingMessageId`, and +`isFinalReply` support. Pass a raw JSON Schema or a Zod schema as `responseSchema` to `send` or `sendAndWait`. As with custom tool parameters, the SDK converts Zod schemas to JSON Schema before sending them: @@ -348,6 +349,16 @@ selected result. The existing unformatted overload retains its session-wide behavior. `turnId` identifies an individual model/tool iteration, not the whole run; telemetry interaction IDs are not unique run identifiers. +For event-driven consumption with `send`, a root `assistant.message` with +`data.isFinalReply === true` identifies the reply to parse without waiting for +idle. Match its `data.originatingMessageId` to the ID returned by `send`. +Subscribe before sending and allow for events arriving before that acknowledgement. +Tool-call messages are not final replies; for multi-message terminal responses, +only the last message is marked. The optional flag is a content-selection signal, +not a success guarantee: stop hooks and other processing can still run, and later +errors arrive through normal `session.error` events. `sendAndWait` deliberately +continues waiting for idle and can still reject after receiving a final reply. + Streaming still delivers ordinary text events, including intermediate messages and tool calls. Only the final selected message is parsed by the typed overload; not every event is necessarily a complete schema-conforming JSON document. diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index eb455e9e64..b9f5af578c 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -5023,6 +5023,10 @@ export interface AssistantMessageData { * CAPI interaction ID for correlating this message with upstream telemetry */ interactionId?: string; + /** + * True when this is the last assistant reply for the originatingMessageId. Does not indicate successful completion of hooks or cleanup; session.error or abort events may still follow. + */ + isFinalReply?: boolean; /** * Unique identifier for this assistant message */ diff --git a/nodejs/test/e2e/structured_output.e2e.test.ts b/nodejs/test/e2e/structured_output.e2e.test.ts index 4ddd8a5d15..7213ab4c96 100644 --- a/nodejs/test/e2e/structured_output.e2e.test.ts +++ b/nodejs/test/e2e/structured_output.e2e.test.ts @@ -7,6 +7,7 @@ import { z } from "zod"; import { approveAll, defineTool, + type AssistantMessageEvent, type CopilotSession, type ProviderConfig, type SessionEvent, @@ -58,11 +59,13 @@ describe("Structured output", async () => { ).toBeDefined(); expect(JSON.parse(result!.data.content)).toEqual({ answer: 42, contract: "raw_schema" }); expect(result!.data.originatingMessageId).toBeTruthy(); + expect(result!.data.isFinalReply).toBe(true); const ordinary = await session.sendAndWait( "Reply exactly SCHEMA_CLEARED without JSON or quotes." ); expect(ordinary?.data.content).toBe("SCHEMA_CLEARED"); + expect(ordinary?.data.isFinalReply).toBe(true); const exchanges = await openAiEndpoint.getExchanges(); expect(exchanges).toHaveLength(2); expect(exchanges[0].request).toMatchObject({ @@ -109,6 +112,16 @@ describe("Structured output", async () => { expect(result).toEqual({ answer: 63, contract: "typed_tool" }); expect(events.some((event) => event.type === "tool.execution_complete")).toBe(true); expect(events.some((event) => event.type === "assistant.message_delta")).toBe(true); + const replies = events.filter( + (event) => event.type === "assistant.message" && !event.agentId + ); + expect(replies.filter((event) => event.data.isFinalReply)).toEqual([replies.at(-1)]); + expect(replies.some((event) => event.data.toolRequests?.length)).toBe(true); + expect( + replies + .filter((event) => event.data.toolRequests?.length) + .every((event) => event.data.isFinalReply !== true) + ).toBe(true); const exchanges = await openAiEndpoint.getExchanges(); expect(exchanges.length).toBeGreaterThanOrEqual(2); for (const exchange of exchanges) { @@ -119,6 +132,84 @@ describe("Structured output", async () => { } }); + it("node_send_exposes_final_reply_before_stop_hook_completes", async () => { + let releaseHook!: () => void; + let hookEntered = false; + const hookReleased = new Promise((resolve) => { + releaseHook = resolve; + }); + const session = await client.createSession({ + model: "gpt-4.1", + provider, + onPermissionRequest: approveAll, + availableTools: [], + tools: [ + defineTool("read_inventory", { + description: "Read the current widget count and color.", + parameters: z.object({}), + skipPermission: true, + handler: () => ({ count: 42, color: "red" }), + }), + ], + hooks: { + onAgentStop: async () => { + hookEntered = true; + await hookReleased; + }, + }, + }); + const replies: AssistantMessageEvent[] = []; + let resolveReply!: (event: AssistantMessageEvent) => void; + let rejectReply!: (error: Error) => void; + const replyReceived = new Promise((resolve, reject) => { + resolveReply = resolve; + rejectReply = reject; + }); + let idle = false; + const unsubscribe = session.on((event) => { + if (event.agentId) return; + if (event.type === "assistant.message") { + replies.push(event); + if (event.data.isFinalReply === true) resolveReply(event); + } else if (event.type === "session.error") { + rejectReply(new Error(event.data.message)); + } else if (event.type === "session.idle") { + idle = true; + } + }); + const schema = z.object({ count: z.number().int(), color: z.literal("red") }); + const timeout = setTimeout(() => rejectReply(new Error("No final reply received")), 45_000); + try { + const [messageId, reply] = await Promise.all([ + session.send({ + prompt: "Call read_inventory once, then report the current widget count and color.", + responseSchema: schema, + }), + replyReceived, + ]); + await waitForCondition(() => hookEntered, { + timeoutMessage: "Stop hook did not start", + }); + expect(reply.data.originatingMessageId).toBe(messageId); + expect(schema.parse(JSON.parse(reply.data.content))).toEqual({ + count: 42, + color: "red", + }); + expect(idle).toBe(false); + expect(replies.filter((event) => event.data.isFinalReply)).toEqual([reply]); + expect(replies.some((event) => event.data.toolRequests?.length)).toBe(true); + expect(reply.data.toolRequests ?? []).toEqual([]); + + releaseHook(); + await waitForCondition(() => idle, { timeoutMessage: "Session did not become idle" }); + expect(replies.at(-1)).toBe(reply); + } finally { + clearTimeout(timeout); + releaseHook(); + unsubscribe(); + } + }, 60_000); + it("node_concurrent_typed_sends_return_their_own_results", async () => { let markToolEntered!: () => void; let releaseTool!: () => void; @@ -207,5 +298,6 @@ describe("Structured output", async () => { if (final?.type !== "assistant.message") throw new Error("No assistant response"); expect(schema.parse(JSON.parse(final.data.content))).toEqual({ total: 42 }); expect(final.data.originatingMessageId).toBe(response.messageIds[0]); + expect(final.data.isFinalReply).toBe(true); }); }); diff --git a/nodejs/test/structured-output.test.ts b/nodejs/test/structured-output.test.ts index d3686b752c..d445279218 100644 --- a/nodejs/test/structured-output.test.ts +++ b/nodejs/test/structured-output.test.ts @@ -230,6 +230,31 @@ describe("structured output", () => { await assertion; }); + it("does not treat a final-reply flag as successful completion", async () => { + const { session, sends } = controlledSession(); + const pending = session.sendAndWait("question", answer); + const assertion = expect(pending).rejects.toThrow("post-response failure"); + await sent(sends); + session._dispatchEvent(user("one")); + session._dispatchEvent( + event("assistant.message", { + messageId: "final-reply", + originatingMessageId: "one", + isFinalReply: true, + content: '{"answer":42}', + }) + ); + session._dispatchEvent( + event("session.error", { + errorType: "query", + message: "post-response failure", + }) + ); + session._dispatchEvent(event("session.idle", {})); + sends[0].resolve({ messageId: "one" }); + await assertion; + }); + it("rejects promptly when the session disconnects", async () => { const { session, sends } = controlledSession(); const pending = session.sendAndWait("question", answer); diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index fb8a9f4eae..ba9c627e9e 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -2448,6 +2448,7 @@ class AssistantMessageData: # Experimental: this field is part of an experimental API and may change or be removed. fusion: FusionAttribution | None = None interaction_id: str | None = None + is_final_reply: bool | None = None model: str | None = None originating_message_id: str | None = None output_tokens: int | None = None @@ -2478,6 +2479,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": encrypted_content = from_union([from_none, from_str], obj.get("encryptedContent")) fusion = from_union([from_none, FusionAttribution.from_dict], obj.get("fusion")) interaction_id = from_union([from_none, from_str], obj.get("interactionId")) + is_final_reply = from_union([from_none, from_bool], obj.get("isFinalReply")) model = from_union([from_none, from_str], obj.get("model")) originating_message_id = from_union([from_none, from_str], obj.get("originatingMessageId")) output_tokens = from_union([from_none, from_int], obj.get("outputTokens")) @@ -2504,6 +2506,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": encrypted_content=encrypted_content, fusion=fusion, interaction_id=interaction_id, + is_final_reply=is_final_reply, model=model, originating_message_id=originating_message_id, output_tokens=output_tokens, @@ -2541,6 +2544,8 @@ def to_dict(self) -> dict: result["fusion"] = from_union([from_none, lambda x: to_class(FusionAttribution, x)], self.fusion) if self.interaction_id is not None: result["interactionId"] = from_union([from_none, from_str], self.interaction_id) + if self.is_final_reply is not None: + result["isFinalReply"] = from_union([from_none, from_bool], self.is_final_reply) if self.model is not None: result["model"] = from_union([from_none, from_str], self.model) if self.originating_message_id is not None: diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index 631944e58c..9c730950b5 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -2875,6 +2875,9 @@ pub struct AssistantMessageData { /// CAPI interaction ID for correlating this message with upstream telemetry #[serde(skip_serializing_if = "Option::is_none")] pub interaction_id: Option, + /// True when this is the last assistant reply for the originatingMessageId. Does not indicate successful completion of hooks or cleanup; session.error or abort events may still follow. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_final_reply: Option, /// Unique identifier for this assistant message pub message_id: String, /// Model that produced this assistant message, if known diff --git a/test/snapshots/structured_output/node_send_exposes_final_reply_before_stop_hook_completes.yaml b/test/snapshots/structured_output/node_send_exposes_final_reply_before_stop_hook_completes.yaml new file mode 100644 index 0000000000..3e3a73c531 --- /dev/null +++ b/test/snapshots/structured_output/node_send_exposes_final_reply_before_stop_hook_completes.yaml @@ -0,0 +1,20 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: Call read_inventory once, then report the current widget count and color. + - role: assistant + tool_calls: + - id: toolcall_0 + type: function + function: + name: read_inventory + arguments: "{}" + - role: tool + tool_call_id: toolcall_0 + content: '{"color":"red","count":42}' + - role: assistant + content: '{"color":"red","count":42}' diff --git a/test/snapshots/structured_output_dotnet/send_exposes_final_reply_before_stop_hook_completes.yaml b/test/snapshots/structured_output_dotnet/send_exposes_final_reply_before_stop_hook_completes.yaml new file mode 100644 index 0000000000..35406a19ba --- /dev/null +++ b/test/snapshots/structured_output_dotnet/send_exposes_final_reply_before_stop_hook_completes.yaml @@ -0,0 +1,20 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: Call read_inventory once, then report the current widget count and color. + - role: assistant + tool_calls: + - id: toolcall_0 + type: function + function: + name: read_inventory + arguments: "{}" + - role: tool + tool_call_id: toolcall_0 + content: The inventory contains 42 red widgets. + - role: assistant + content: '{"color":"red","count":42}' From 3ab86635091dc4e922364e09f6c1495a51d658ff Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 10 Sep 2026 18:20:26 +0000 Subject: [PATCH 5/7] Align structured output with idle-based runtime completion Regenerate all SDK contracts from the local runtime, remove the provisional final-reply flag, and select correlated responses at idle. Share the real stop-hook correction capture between Node and C# and preserve existing captures while updating direct-send coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CONTRIBUTING.md | 14 ++ dotnet/README.md | 16 +- dotnet/src/Generated/Rpc.cs | 198 ++++++++++++++- dotnet/src/Generated/SessionEvents.cs | 93 ++++++- dotnet/test/E2E/StructuredOutputE2ETests.cs | 79 ++++-- dotnet/test/Unit/StructuredOutputTests.cs | 3 +- go/rpc/zrpc.go | 233 +++++++++++++++++- go/rpc/zrpc_encoding.go | 114 +++++++++ go/rpc/zsession_events.go | 28 ++- go/zsession_events.go | 8 + .../generated/AssistantMessageEvent.java | 4 +- .../generated/SubagentCompletedEvent.java | 2 + .../generated/SubagentFailedEvent.java | 2 + .../SubagentModelSelectionSource.java | 45 ++++ .../copilot/generated/rpc/ClientMetadata.java | 23 ++ .../generated/rpc/ServerSessionsApi.java | 12 + .../rpc/SessionFsAppendFileParams.java | 2 +- .../generated/rpc/SessionMetadataApi.java | 27 ++ ...essionMetadataGetClientMetadataParams.java | 30 +++ ...ionMetadataUpdateClientMetadataParams.java | 38 +++ .../rpc/SessionsGetClientMetadataParams.java | 33 +++ .../generated/rpc/SubagentSettingsEntry.java | 6 +- nodejs/README.md | 22 +- nodejs/src/generated/rpc.ts | 170 ++++++++++++- nodejs/src/generated/session-events.ts | 26 +- nodejs/test/e2e/structured_output.e2e.test.ts | 95 ++++--- nodejs/test/structured-output.test.ts | 23 +- python/copilot/generated/rpc.py | 187 +++++++++++++- python/copilot/generated/session_events.py | 34 ++- rust/src/generated/api_types.rs | 108 +++++++- rust/src/generated/rpc.rs | 97 +++++++- rust/src/generated/session_events.rs | 41 ++- ..._typed_sends_return_their_own_results.yaml | 0 ...infers_typed_result_after_custom_tool.yaml | 0 ...lects_correlated_response_after_idle.yaml} | 0 ...lects_correlated_response_after_idle.yaml} | 0 ...explicit_schema_for_message_and_batch.yaml | 0 ...ped_wait_returns_stop_hook_correction.yaml | 14 ++ 38 files changed, 1692 insertions(+), 135 deletions(-) create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SubagentModelSelectionSource.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientMetadata.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataGetClientMetadataParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataUpdateClientMetadataParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionsGetClientMetadataParams.java rename test/snapshots/{structured_output_dotnet => structured_output}/concurrent_typed_sends_return_their_own_results.yaml (100%) rename test/snapshots/{structured_output_dotnet => structured_output}/infers_typed_result_after_custom_tool.yaml (100%) rename test/snapshots/structured_output/{node_send_exposes_final_reply_before_stop_hook_completes.yaml => node_send_selects_correlated_response_after_idle.yaml} (100%) rename test/snapshots/{structured_output_dotnet/send_exposes_final_reply_before_stop_hook_completes.yaml => structured_output/send_selects_correlated_response_after_idle.yaml} (100%) rename test/snapshots/{structured_output_dotnet => structured_output}/sends_explicit_schema_for_message_and_batch.yaml (100%) create mode 100644 test/snapshots/structured_output/typed_wait_returns_stop_hook_correction.yaml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 81f92144e8..38127a1ab5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -102,6 +102,20 @@ Pinned-schema CI can report drift in such a draft. Java codegen reports this without automatically rewriting draft branches; automatic updates resume once the pull request is ready for review. +For recording behind `HTTPS_PROXY`, Node versions that support environment +proxies (including Node 24.20) need `NODE_USE_ENV_PROXY=1` in the test runner's +environment. If the host proxy substitutes a protected credential, set +`GITHUB_TOKEN="$GH_TOKEN"` using its issued placeholder; do not print or persist +the credential. Keep localhost and loopback in `NO_PROXY`. + +Equivalent cross-language E2Es should share snapshot names and prompts. +For example, Node's `typed_wait_returns_stop_hook_correction` and C#'s +`Typed_Wait_Returns_Stop_Hook_Correction` both use +`test/snapshots/structured_output/typed_wait_returns_stop_hook_correction.yaml`. +It was recorded once against real `gpt-4.1` inference, then replayed by both SDKs +against the local runtime. Both typed helpers select the corrected answer at +idle; there is no final-message flag. + ## Submitting a Pull Request 1. Fork and clone the repository diff --git a/dotnet/README.md b/dotnet/README.md index f7f84d0d6c..9e56212ce8 100644 --- a/dotnet/README.md +++ b/dotnet/README.md @@ -333,14 +333,14 @@ unchanged with the name `response` and `strict: true`. The untyped or deserialize the response. Schema-bearing waits use the same message correlation as typed waits; unformatted waits retain their existing behavior. -With `SendAsync`, consume `AssistantMessageEvent` events whose -`Data.IsFinalReply == true` and `Data.OriginatingMessageId` matches the returned -message ID. This identifies the final reply to parse without waiting for idle. -Subscribe before sending because events can precede the send acknowledgement. -Tool-call messages are not marked final, and only the last message of a -multi-message terminal response is marked. This optional flag does not guarantee -successful completion: hooks and other processing can still produce a later -`SessionErrorEvent`. `SendAndWaitAsync` retains its wait-for-idle behavior. +With `SendAsync`, collect root `AssistantMessageEvent` events whose +`Data.OriginatingMessageId` matches the returned message ID, then select the last +one when the session becomes idle. Subscribe before sending because events can +precede the send acknowledgement, and handle `SessionErrorEvent` normally. +There is no final-message flag: stop hooks can reject an initial answer and +request a correction. Those corrections retain the original schema and +originating message ID, so `SendAndWaitAsync` selects the corrected response at +idle. Independent queued sends retain their own schemas and IDs. ```csharp using var schema = System.Text.Json.JsonDocument.Parse(""" diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index f1bfe5336b..8cf1957eba 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -4333,6 +4333,115 @@ internal sealed class SessionsGetMetadataRequest public string SessionId { get; set; } = string.Empty; } +/// Client metadata outcome for one requested local session. +/// Polymorphic base type discriminated by status. +[Experimental(Diagnostics.Experimental)] +[JsonPolymorphic( + TypeDiscriminatorPropertyName = "status", + UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] +[JsonDerivedType(typeof(SessionsClientMetadataEntryOk), "ok")] +[JsonDerivedType(typeof(SessionsClientMetadataEntryNotFound), "notFound")] +[JsonDerivedType(typeof(SessionsClientMetadataEntryCorrupt), "corrupt")] +[JsonDerivedType(typeof(SessionsClientMetadataEntryUnsupportedVersion), "unsupportedVersion")] +[JsonDerivedType(typeof(SessionsClientMetadataEntryUnavailable), "unavailable")] +public partial class SessionsClientMetadataEntry +{ + /// The type discriminator. + [JsonPropertyName("status")] + public virtual string Status { get; set; } = string.Empty; +} + + +/// The ok variant of . +[Experimental(Diagnostics.Experimental)] +public partial class SessionsClientMetadataEntryOk : SessionsClientMetadataEntry +{ + /// + [JsonIgnore] + public override string Status => "ok"; + + /// Validated client metadata, possibly empty or projected to requested keys. + [JsonPropertyName("metadata")] + public required IDictionary Metadata { get; set; } + + /// Requested session ID. + [JsonPropertyName("sessionId")] + public required string SessionId { get; set; } +} + +/// The notFound variant of . +[Experimental(Diagnostics.Experimental)] +public partial class SessionsClientMetadataEntryNotFound : SessionsClientMetadataEntry +{ + /// + [JsonIgnore] + public override string Status => "notFound"; + + /// Requested session ID. + [JsonPropertyName("sessionId")] + public required string SessionId { get; set; } +} + +/// The corrupt variant of . +[Experimental(Diagnostics.Experimental)] +public partial class SessionsClientMetadataEntryCorrupt : SessionsClientMetadataEntry +{ + /// + [JsonIgnore] + public override string Status => "corrupt"; + + /// Requested session ID. + [JsonPropertyName("sessionId")] + public required string SessionId { get; set; } +} + +/// The unsupportedVersion variant of . +[Experimental(Diagnostics.Experimental)] +public partial class SessionsClientMetadataEntryUnsupportedVersion : SessionsClientMetadataEntry +{ + /// + [JsonIgnore] + public override string Status => "unsupportedVersion"; + + /// Requested session ID. + [JsonPropertyName("sessionId")] + public required string SessionId { get; set; } +} + +/// The unavailable variant of . +[Experimental(Diagnostics.Experimental)] +public partial class SessionsClientMetadataEntryUnavailable : SessionsClientMetadataEntry +{ + /// + [JsonIgnore] + public override string Status => "unavailable"; + + /// Filesystem or provider error code. Clients should not assume every provider uses operating-system error codes. + [JsonPropertyName("code")] + public required string Code { get; set; } + + /// Human-readable diagnostic message. Not stable for programmatic matching. + [JsonPropertyName("message")] + public required string Message { get; set; } + + /// Requested session ID. + [JsonPropertyName("sessionId")] + public required string SessionId { get; set; } +} + +/// Bounded batch request for client-owned metadata from persisted local sessions. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionsGetClientMetadataRequest +{ + /// Case-sensitive keys to project from each valid bag. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Omit to return every entry. + [JsonPropertyName("keys")] + public IList? Keys { get; set; } + + /// Session IDs to inspect. Results preserve this order. + [JsonPropertyName("sessionIds")] + public IList SessionIds { get => field ??= []; set; } +} + /// Batch of session events returned by a read, with cursor and continuation metadata. [Experimental(Diagnostics.Experimental)] public sealed class EventsReadResult @@ -13968,10 +14077,14 @@ public sealed class ToolsUpdateSubagentSettingsResult { } -/// Subagent model, reasoning effort, and context tier settings. +/// Subagent model, reasoning effort, context tier, and auto-invocation settings. [Experimental(Diagnostics.Experimental)] public sealed class SubagentSettingsEntry { + /// Whether this agent's runtime-defined proactive invocation prompting is enabled, if supported. Currently consumed by the built-in rubber-duck agent. + [JsonPropertyName("autoInvoke")] + public bool? AutoInvoke { get; set; } + /// Context tier override for matching subagents. [JsonPropertyName("contextTier")] public SubagentSettingsEntryContextTier? ContextTier { get; set; } @@ -16496,6 +16609,36 @@ internal sealed class SessionMetadataSnapshotRequest public string SessionId { get; set; } = string.Empty; } +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionMetadataGetClientMetadataRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Atomic patch for client-owned session metadata. Operations apply in clear, remove, then set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size limits. Local storage coordinates concurrent runtime processes; custom SessionFs providers must serialize writers that access the same session from multiple processes. +[Experimental(Diagnostics.Experimental)] +internal sealed class MetadataUpdateClientMetadataRequest +{ + /// Remove every existing client metadata entry before applying remove and set. Defaults to false. + [JsonPropertyName("clear")] + public bool? Clear { get; set; } + + /// Case-sensitive keys to remove. Missing keys are ignored. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. + [JsonPropertyName("remove")] + public IList? Remove { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// String entries to add or replace. Set wins when a key also appears in remove. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Each value may contain at most 16 KiB of UTF-8 data. + [JsonPropertyName("set")] + public IDictionary? Set { get; set; } +} + /// Indicates whether the local session is currently processing a turn or background continuation. [Experimental(Diagnostics.Experimental)] public sealed class MetadataIsProcessingResult @@ -19069,7 +19212,7 @@ public sealed class SessionFsWriteFileRequest public string SessionId { get; set; } = string.Empty; } -/// File path, content to append, and optional mode for the client-provided session filesystem. +/// File path, content to append, and optional mode for the client-provided session filesystem. Implementations create parent directories as needed. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsAppendFileRequest { @@ -32695,6 +32838,19 @@ internal async Task GetMetadataAsync(string sessionId return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.getMetadata", [request], cancellationToken); } + /// Reads client-owned metadata for multiple persisted local sessions without opening them. Results preserve request order and report missing, corrupt, unsupported, or temporarily unavailable sessions independently. + /// Session IDs to inspect. Results preserve this order. + /// Case-sensitive keys to project from each valid bag. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Omit to return every entry. + /// The to monitor for cancellation requests. The default is . + /// Ordered client metadata outcomes for the requested local sessions. + public async Task> GetClientMetadataAsync(IList sessionIds, IList? keys = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(sessionIds); + + var request = new SessionsGetClientMetadataRequest { SessionIds = sessionIds, Keys = keys }; + return await CopilotClient.InvokeRpcAsync>(_rpc, "sessions.getClientMetadata", [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. @@ -35869,7 +36025,7 @@ public async Task SetAsync(IList return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tools.set", [request], cancellationToken); } - /// Updates the current session's live subagent settings after user settings change. The persisted user settings remain the source of truth for future sessions. + /// Sets the current session's live subagent settings override, which takes precedence over persisted user settings until cleared. Persisted user settings remain the source of truth for future sessions. /// Subagent settings to apply, or null to clear the live session override. /// The to monitor for cancellation requests. The default is . /// Empty result after applying subagent settings. @@ -36565,6 +36721,31 @@ public async Task SnapshotAsync(CancellationToken cance return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.metadata.snapshot", [request], cancellationToken); } + /// Returns the client-owned string metadata persisted with this local session. The metadata is not included in model context, events, telemetry, snapshots, or remote exports. + /// The to monitor for cancellation requests. The default is . + /// Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. + public async Task> GetClientMetadataAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionMetadataGetClientMetadataRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync>(_session.Rpc, "session.metadata.getClientMetadata", [request], cancellationToken); + } + + /// Atomically patches the client-owned string metadata persisted with this local session and returns the committed bag. + /// Remove every existing client metadata entry before applying remove and set. Defaults to false. + /// Case-sensitive keys to remove. Missing keys are ignored. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. + /// String entries to add or replace. Set wins when a key also appears in remove. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Each value may contain at most 16 KiB of UTF-8 data. + /// The to monitor for cancellation requests. The default is . + /// Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. + public async Task> UpdateClientMetadataAsync(bool? clear = null, IList? remove = null, IDictionary? set = null, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new MetadataUpdateClientMetadataRequest { SessionId = _session.SessionId, Clear = clear, Remove = remove, Set = set }; + return await CopilotClient.InvokeRpcAsync>(_session.Rpc, "session.metadata.updateClientMetadata", [request], cancellationToken); + } + /// Reports whether the local session is currently processing user/agent messages. /// The to monitor for cancellation requests. The default is . /// Indicates whether the local session is currently processing a turn or background continuation. @@ -37527,8 +37708,8 @@ public interface ISessionFsHandler /// The to monitor for cancellation requests. The default is . /// Describes a filesystem error. Task WriteFileAsync(SessionFsWriteFileRequest request, CancellationToken cancellationToken = default); - /// Appends content to a file in the client-provided session filesystem. - /// File path, content to append, and optional mode for the client-provided session filesystem. + /// Appends content to a file in the client-provided session filesystem, creating parent directories as needed. + /// File path, content to append, and optional mode for the client-provided session filesystem. Implementations create parent directories as needed. /// The to monitor for cancellation requests. The default is . /// Describes a filesystem error. Task AppendFileAsync(SessionFsAppendFileRequest request, CancellationToken cancellationToken = default); @@ -38182,6 +38363,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.SubagentDeselectedEvent), TypeInfoPropertyName = "SessionEventsSubagentDeselectedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SubagentFailedData), TypeInfoPropertyName = "SessionEventsSubagentFailedData")] [JsonSerializable(typeof(GitHub.Copilot.SubagentFailedEvent), TypeInfoPropertyName = "SessionEventsSubagentFailedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.SubagentModelSelectionSource), TypeInfoPropertyName = "SessionEventsSubagentModelSelectionSource")] [JsonSerializable(typeof(GitHub.Copilot.SubagentSelectedData), TypeInfoPropertyName = "SessionEventsSubagentSelectedData")] [JsonSerializable(typeof(GitHub.Copilot.SubagentSelectedEvent), TypeInfoPropertyName = "SessionEventsSubagentSelectedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SubagentStartedData), TypeInfoPropertyName = "SessionEventsSubagentStartedData")] @@ -38474,9 +38656,11 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(HooksDiscoverRequest))] [JsonSerializable(typeof(HooksDiscoverResult))] [JsonSerializable(typeof(IDictionary))] +[JsonSerializable(typeof(IDictionary))] [JsonSerializable(typeof(IList))] [JsonSerializable(typeof(IList))] [JsonSerializable(typeof(IList))] +[JsonSerializable(typeof(IList))] [JsonSerializable(typeof(InstalledPlugin))] [JsonSerializable(typeof(InstalledPluginInfo))] [JsonSerializable(typeof(InstructionDiscoveryPath))] @@ -38624,6 +38808,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(MetadataSetWorkingDirectoryResult))] [JsonSerializable(typeof(MetadataSnapshotRemoteMetadata))] [JsonSerializable(typeof(MetadataSnapshotRemoteMetadataRepository))] +[JsonSerializable(typeof(MetadataUpdateClientMetadataRequest))] [JsonSerializable(typeof(ModeSetRequest))] [JsonSerializable(typeof(ModeSetResult))] [JsonSerializable(typeof(Model))] @@ -38927,6 +39112,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionMcpReloadRequest))] [JsonSerializable(typeof(SessionMcpRemoveGitHubRequest))] [JsonSerializable(typeof(SessionMetadataActivityRequest))] +[JsonSerializable(typeof(SessionMetadataGetClientMetadataRequest))] [JsonSerializable(typeof(SessionMetadataGetContextAttributionRequest))] [JsonSerializable(typeof(SessionMetadataIsProcessingRequest))] [JsonSerializable(typeof(SessionMetadataSnapshot))] @@ -39004,6 +39190,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionsBulkDeleteRequest))] [JsonSerializable(typeof(SessionsCheckInUseRequest))] [JsonSerializable(typeof(SessionsCheckInUseResult))] +[JsonSerializable(typeof(SessionsClientMetadataEntry))] [JsonSerializable(typeof(SessionsCloseRequest))] [JsonSerializable(typeof(SessionsCloseResult))] [JsonSerializable(typeof(SessionsDeleteRequest))] @@ -39016,6 +39203,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionsForkResult))] [JsonSerializable(typeof(SessionsGetBoardEntryCountRequest))] [JsonSerializable(typeof(SessionsGetBoardEntryCountResult))] +[JsonSerializable(typeof(SessionsGetClientMetadataRequest))] [JsonSerializable(typeof(SessionsGetEventFilePathRequest))] [JsonSerializable(typeof(SessionsGetEventFilePathResult))] [JsonSerializable(typeof(SessionsGetLastForContextRequest))] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index d4c88e1ba9..147f1e5ee8 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -3816,11 +3816,6 @@ public sealed partial class AssistantMessageData [JsonPropertyName("interactionId")] public string? InteractionId { get; set; } - /// True when this is the last assistant reply for the originatingMessageId. Does not indicate successful completion of hooks or cleanup; session.error or abort events may still follow. - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonPropertyName("isFinalReply")] - public bool? IsFinalReply { get; set; } - /// Unique identifier for this assistant message. [JsonPropertyName("messageId")] public required string MessageId { get; set; } @@ -3830,7 +3825,7 @@ public sealed partial class AssistantMessageData [JsonPropertyName("model")] public string? Model { get; set; } - /// Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. + /// Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations, steering messages, and stop-hook corrections. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("originatingMessageId")] public string? OriginatingMessageId { get; set; } @@ -4913,6 +4908,11 @@ public sealed partial class SubagentCompletedData [JsonPropertyName("modelOverrideReason")] public string? ModelOverrideReason { get; set; } + /// Authority or runtime mechanism responsible for sub-agent model selection. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("modelSelectionSource")] + public SubagentModelSelectionSource? ModelSelectionSource { get; set; } + /// Tool call ID of the parent tool invocation that spawned this sub-agent. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } @@ -4984,6 +4984,11 @@ public sealed partial class SubagentFailedData [JsonPropertyName("modelOverrideReason")] public string? ModelOverrideReason { get; set; } + /// Authority or runtime mechanism responsible for sub-agent model selection. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("modelSelectionSource")] + public SubagentModelSelectionSource? ModelSelectionSource { get; set; } + /// Tool call ID of the parent tool invocation that spawned this sub-agent. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } @@ -14361,6 +14366,82 @@ public override void Write(Utf8JsonWriter writer, SubagentTaskModelSource value, } } +/// Authority or runtime mechanism responsible for sub-agent model selection. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct SubagentModelSelectionSource : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public SubagentModelSelectionSource(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Explicit model supplied by the parent agent on the task call and selected for dispatch. + public static SubagentModelSelectionSource ExplicitOverride { get; } = new("explicit_override"); + + /// Required model policy configured for the sub-agent. + public static SubagentModelSelectionSource ConfiguredRequired { get; } = new("configured_required"); + + /// Non-required model preference configured for the sub-agent. + public static SubagentModelSelectionSource ConfiguredPreference { get; } = new("configured_preference"); + + /// Complementary-model default selected for the sub-agent. + public static SubagentModelSelectionSource ComplementaryDefault { get; } = new("complementary_default"); + + /// Model inherited from the parent session. + public static SubagentModelSelectionSource SessionInheritance { get; } = new("session_inheritance"); + + /// Default model declared by the agent definition. + public static SubagentModelSelectionSource AgentDefinitionDefault { get; } = new("agent_definition_default"); + + /// Runtime policy, Auto mode, or an experiment selected the model. + public static SubagentModelSelectionSource RuntimePolicy { get; } = new("runtime_policy"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(SubagentModelSelectionSource left, SubagentModelSelectionSource right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(SubagentModelSelectionSource left, SubagentModelSelectionSource right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is SubagentModelSelectionSource other && Equals(other); + + /// + public bool Equals(SubagentModelSelectionSource 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 SubagentModelSelectionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, SubagentModelSelectionSource value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SubagentModelSelectionSource)); + } + } +} + /// Binary asset type discriminator. Use "image" for images and "resource" otherwise. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] diff --git a/dotnet/test/E2E/StructuredOutputE2ETests.cs b/dotnet/test/E2E/StructuredOutputE2ETests.cs index dfc9e549a3..2d6f606c2c 100644 --- a/dotnet/test/E2E/StructuredOutputE2ETests.cs +++ b/dotnet/test/E2E/StructuredOutputE2ETests.cs @@ -12,7 +12,7 @@ namespace GitHub.Copilot.Test.E2E; public partial class StructuredOutputE2ETests(E2ETestFixture fixture, ITestOutputHelper output) - : E2ETestBase(fixture, "structured_output_dotnet", output) + : E2ETestBase(fixture, "structured_output", output) { private SessionConfig StructuredSessionConfig() => new() { @@ -71,12 +71,22 @@ public async Task Infers_Typed_Result_After_Custom_Tool() public async Task Sends_Explicit_Schema_For_Message_And_Batch() { var session = await CreateSessionAsync(StructuredSessionConfig()); - var completion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - using var subscription = session.On(message => + var completion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var replies = new System.Collections.Concurrent.ConcurrentQueue(); + using var subscription = session.On(evt => { - if (message.Data.IsFinalReply == true) + if (!string.IsNullOrEmpty(evt.AgentId)) return; + switch (evt) { - completion.TrySetResult(message); + case AssistantMessageEvent message: + replies.Enqueue(message); + break; + case SessionIdleEvent: + completion.TrySetResult(); + break; + case SessionErrorEvent error: + completion.TrySetException(new InvalidOperationException(error.Data.Message)); + break; } }); using var schema = JsonDocument.Parse( @@ -95,9 +105,10 @@ public async Task Sends_Explicit_Schema_For_Message_And_Batch() }, }); using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); - var message = await completion.Task.WaitAsync(cts.Token); + await completion.Task.WaitAsync(cts.Token); + var message = replies.Last(message => message.Data.OriginatingMessageId == accepted.MessageIds.Last()); Assert.Equal(accepted.MessageIds.Last(), message.Data.OriginatingMessageId); - Assert.True(message.Data.IsFinalReply); + Assert.Empty(message.Data.ToolRequests ?? []); var result = JsonSerializer.Deserialize(message.Data.Content, StructuredOutputE2EJsonContext.Default.Inventory); Assert.NotNull(result); Assert.Equal(42, result.Count); @@ -109,7 +120,6 @@ public async Task Sends_Explicit_Schema_For_Message_And_Batch() ResponseSchema = schema.RootElement.Clone(), }, TimeSpan.FromMinutes(3)); Assert.NotNull(raw); - Assert.True(raw.Data.IsFinalReply); var updated = JsonSerializer.Deserialize(raw.Data.Content, StructuredOutputE2EJsonContext.Default.Inventory); Assert.NotNull(updated); Assert.Equal(21, updated.Count); @@ -117,7 +127,7 @@ public async Task Sends_Explicit_Schema_For_Message_And_Batch() } [Fact] - public async Task Send_Exposes_Final_Reply_Before_Stop_Hook_Completes() + public async Task Send_Selects_Correlated_Response_After_Idle() { var hookEntered = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var releaseHook = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -137,7 +147,6 @@ public async Task Send_Exposes_Final_Reply_Before_Stop_Hook_Completes() }, }; var session = await CreateSessionAsync(config); - var replyReceived = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var idleReceived = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var replies = new System.Collections.Concurrent.ConcurrentQueue(); using var subscription = session.On(evt => @@ -147,10 +156,9 @@ public async Task Send_Exposes_Final_Reply_Before_Stop_Hook_Completes() { case AssistantMessageEvent message: replies.Enqueue(message); - if (message.Data.IsFinalReply == true) replyReceived.TrySetResult(message); break; case SessionErrorEvent error: - replyReceived.TrySetException(new InvalidOperationException(error.Data.Message)); + idleReceived.TrySetException(new InvalidOperationException(error.Data.Message)); break; case SessionIdleEvent: idleReceived.TrySetResult(); @@ -167,20 +175,18 @@ public async Task Send_Exposes_Final_Reply_Before_Stop_Hook_Completes() Prompt = "Call read_inventory once, then report the current widget count and color.", ResponseSchema = schema.RootElement.Clone(), }, cts.Token); - var reply = await replyReceived.Task.WaitAsync(cts.Token); await hookEntered.Task.WaitAsync(cts.Token); + Assert.False(idleReceived.Task.IsCompleted); + releaseHook.TrySetResult(); + await idleReceived.Task.WaitAsync(cts.Token); + var reply = replies.Last(message => message.Data.OriginatingMessageId == messageId); Assert.Equal(messageId, reply.Data.OriginatingMessageId); var result = JsonSerializer.Deserialize(reply.Data.Content, StructuredOutputE2EJsonContext.Default.Inventory); Assert.NotNull(result); Assert.Equal(42, result.Count); Assert.Equal("red", result.Color); - Assert.False(idleReceived.Task.IsCompleted); - Assert.Same(reply, Assert.Single(replies, message => message.Data.IsFinalReply == true)); Assert.Contains(replies, message => message.Data.ToolRequests is { Length: > 0 }); Assert.Empty(reply.Data.ToolRequests ?? []); - - releaseHook.TrySetResult(); - await idleReceived.Task.WaitAsync(cts.Token); Assert.Same(reply, replies.Last()); } finally @@ -189,6 +195,37 @@ public async Task Send_Exposes_Final_Reply_Before_Stop_Hook_Completes() } } + [Fact] + public async Task Typed_Wait_Returns_Stop_Hook_Correction() + { + var stops = 0; + var config = StructuredSessionConfig(); + config.Hooks = new SessionHooks + { + OnAgentStop = (_, _) => Task.FromResult( + Interlocked.Increment(ref stops) == 1 + ? new() { Decision = "block", Reason = "Correct the answer to 99, not 42. Do not use tools." } + : null), + }; + var session = await CreateSessionAsync(config); + var replies = new System.Collections.Concurrent.ConcurrentQueue(); + using var subscription = session.On(message => + { + if (string.IsNullOrEmpty(message.AgentId)) replies.Enqueue(message); + }); + var result = await session.SendAndWaitAsync( + "What is 19 + 23? Do not use tools.", + StructuredOutputE2EJsonContext.Default.Options, + TimeSpan.FromMinutes(3)); + Assert.Equal(99, result.Answer); + Assert.Equal(2, stops); + Assert.Equal(2, replies.Count); + Assert.False(string.IsNullOrEmpty(replies.First().Data.OriginatingMessageId)); + Assert.Equal(replies.First().Data.OriginatingMessageId, replies.Last().Data.OriginatingMessageId); + Assert.Equal([42, 99], replies.Select(message => + JsonSerializer.Deserialize(message.Data.Content, StructuredOutputE2EJsonContext.Default.CorrectionResult)!.Answer)); + } + [Fact] public async Task Concurrent_Typed_Sends_Return_Their_Own_Results() { @@ -253,9 +290,15 @@ public sealed class Inventory public required string Color { get; set; } } + public sealed class CorrectionResult + { + public required int Answer { get; set; } + } + [JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] [JsonSerializable(typeof(Inventory))] [JsonSerializable(typeof(FirstAnswer))] [JsonSerializable(typeof(SecondAnswer))] + [JsonSerializable(typeof(CorrectionResult))] internal sealed partial class StructuredOutputE2EJsonContext : JsonSerializerContext; } diff --git a/dotnet/test/Unit/StructuredOutputTests.cs b/dotnet/test/Unit/StructuredOutputTests.cs index fdc560e091..45b529d20f 100644 --- a/dotnet/test/Unit/StructuredOutputTests.cs +++ b/dotnet/test/Unit/StructuredOutputTests.cs @@ -383,7 +383,7 @@ public async Task StructuredOutput_Propagates_Rpc_And_Session_Errors(bool rpcErr } [Fact] - public async Task StructuredOutput_Final_Reply_Does_Not_Hide_Later_Session_Errors() + public async Task StructuredOutput_Response_Does_Not_Hide_Later_Session_Errors() { await using var server = await FakeCopilotServer.StartAsync(); await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) }); @@ -399,7 +399,6 @@ public async Task StructuredOutput_Final_Reply_Does_Not_Hide_Later_Session_Error { ["messageId"] = "final-reply", ["originatingMessageId"] = "message-1", - ["isFinalReply"] = true, ["content"] = """{"answer_text":"correct","count":42}""", }); await server.SendSessionEventAsync(session.SessionId, "session.error", new() diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index ce297873e3..5357c6cb53 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -1899,6 +1899,14 @@ func (CatalogUnsupportedKindError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindUnsupportedKind } +// Client-owned, case-sensitive string metadata persisted with a local session. Clients +// should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys +// under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 +// data. A bag may contain at most 128 entries and its serialized sidecar may contain at +// most 64 KiB. The runtime stores but never interprets these values. +// Experimental: ClientMetadata is part of an experimental API and may change or be removed. +type ClientMetadata map[string]string + // Runtime-to-owner cancellation request for a client-owned task. // Experimental: ClientTaskCancelRequest is part of an experimental API and may change or be // removed. @@ -7117,6 +7125,25 @@ type MetadataSnapshotRemoteMetadataRepository struct { Owner string `json:"owner"` } +// Atomic patch for client-owned session metadata. Operations apply in clear, remove, then +// set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size +// limits. Local storage coordinates concurrent runtime processes; custom SessionFs +// providers must serialize writers that access the same session from multiple processes. +// Experimental: MetadataUpdateClientMetadataRequest is part of an experimental API and may +// change or be removed. +type MetadataUpdateClientMetadataRequest struct { + // Remove every existing client metadata entry before applying remove and set. Defaults to + // false. + Clear *bool `json:"clear,omitempty"` + // Case-sensitive keys to remove. Missing keys are ignored. Each key must be non-empty, at + // most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. + Remove []string `json:"remove,omitzero"` + // String entries to add or replace. Set wins when a key also appears in remove. Each key + // must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and + // `github/` namespaces. Each value may contain at most 16 KiB of UTF-8 data. + Set map[string]string `json:"set,omitzero"` +} + // Copilot model metadata, including identifier, display name, capabilities, policy, // billing, reasoning efforts, and picker categories. // Experimental: Model is part of an experimental API and may change or be removed. @@ -11511,7 +11538,7 @@ type SessionFactoryPauseAtCheckpointResult struct { } // File path, content to append, and optional mode for the client-provided session -// filesystem. +// filesystem. Implementations create parent directories as needed. // Experimental: SessionFSAppendFileRequest is part of an experimental API and may change or // be removed. type SessionFSAppendFileRequest struct { @@ -12888,6 +12915,81 @@ type SessionsCheckInUseResult struct { type SessionScheduleHydrateResult struct { } +// Client metadata outcome for one requested local session. +// Experimental: SessionsClientMetadataEntry is part of an experimental API and may change +// or be removed. +type SessionsClientMetadataEntry interface { + sessionsClientMetadataEntry() + Status() SessionsClientMetadataEntryStatus +} + +type RawSessionsClientMetadataEntryData struct { + Discriminator SessionsClientMetadataEntryStatus + Raw json.RawMessage +} + +func (RawSessionsClientMetadataEntryData) sessionsClientMetadataEntry() {} +func (r RawSessionsClientMetadataEntryData) Status() SessionsClientMetadataEntryStatus { + return r.Discriminator +} + +type SessionsClientMetadataEntryCorrupt struct { + // Requested session ID. + SessionID string `json:"sessionId"` +} + +func (SessionsClientMetadataEntryCorrupt) sessionsClientMetadataEntry() {} +func (SessionsClientMetadataEntryCorrupt) Status() SessionsClientMetadataEntryStatus { + return SessionsClientMetadataEntryStatusCorrupt +} + +type SessionsClientMetadataEntryNotFound struct { + // Requested session ID. + SessionID string `json:"sessionId"` +} + +func (SessionsClientMetadataEntryNotFound) sessionsClientMetadataEntry() {} +func (SessionsClientMetadataEntryNotFound) Status() SessionsClientMetadataEntryStatus { + return SessionsClientMetadataEntryStatusNotFound +} + +type SessionsClientMetadataEntryOk struct { + // Validated client metadata, possibly empty or projected to requested keys. + Metadata map[string]string `json:"metadata"` + // Requested session ID. + SessionID string `json:"sessionId"` +} + +func (SessionsClientMetadataEntryOk) sessionsClientMetadataEntry() {} +func (SessionsClientMetadataEntryOk) Status() SessionsClientMetadataEntryStatus { + return SessionsClientMetadataEntryStatusOk +} + +type SessionsClientMetadataEntryUnavailable struct { + // Filesystem or provider error code. Clients should not assume every provider uses + // operating-system error codes. + Code string `json:"code"` + // Human-readable diagnostic message. Not stable for programmatic matching. + Message string `json:"message"` + // Requested session ID. + SessionID string `json:"sessionId"` +} + +func (SessionsClientMetadataEntryUnavailable) sessionsClientMetadataEntry() {} +func (SessionsClientMetadataEntryUnavailable) Status() SessionsClientMetadataEntryStatus { + return SessionsClientMetadataEntryStatusUnavailable +} + +type SessionsClientMetadataEntryUnsupportedVersion struct { + // Requested session ID. + SessionID string `json:"sessionId"` +} + +func (SessionsClientMetadataEntryUnsupportedVersion) sessionsClientMetadataEntry() {} +func (SessionsClientMetadataEntryUnsupportedVersion) Status() SessionsClientMetadataEntryStatus { + return SessionsClientMetadataEntryStatusUnsupportedVersion +} + // Session ID to close. // Experimental: SessionsCloseRequest is part of an experimental API and may change or be // removed. @@ -13188,6 +13290,23 @@ type SessionsGetBoardEntryCountResult struct { Count *int64 `json:"count,omitempty"` } +// Bounded batch request for client-owned metadata from persisted local sessions. +// Experimental: SessionsGetClientMetadataRequest is part of an experimental API and may +// change or be removed. +type SessionsGetClientMetadataRequest struct { + // Case-sensitive keys to project from each valid bag. Each key must be non-empty, at most + // 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Omit to + // return every entry. + Keys []string `json:"keys,omitzero"` + // Session IDs to inspect. Results preserve this order. + SessionIDs []string `json:"sessionIds"` +} + +// Ordered client metadata outcomes for the requested local sessions. +// Experimental: SessionsGetClientMetadataResult is part of an experimental API and may +// change or be removed. +type SessionsGetClientMetadataResult []SessionsClientMetadataEntry + // Session ID whose event-log file path to compute. // Experimental: SessionsGetEventFilePathRequest is part of an experimental API and may // change or be removed. @@ -14429,10 +14548,13 @@ type SubagentSettings struct { MaxDepth *int32 `json:"maxDepth,omitempty"` } -// Subagent model, reasoning effort, and context tier settings +// Subagent model, reasoning effort, context tier, and auto-invocation settings // Experimental: SubagentSettingsEntry is part of an experimental API and may change or be // removed. type SubagentSettingsEntry struct { + // Whether this agent's runtime-defined proactive invocation prompting is enabled, if + // supported. Currently consumed by the built-in rubber-duck agent. + AutoInvoke *bool `json:"autoInvoke,omitempty"` // Context tier override for matching subagents ContextTier *SubagentSettingsEntryContextTier `json:"contextTier,omitempty"` // Reasoning effort override for matching subagents @@ -19370,6 +19492,17 @@ const ( SessionOpenParamsKindResumeLast SessionOpenParamsKind = "resumeLast" ) +// Status discriminator for SessionsClientMetadataEntry. +type SessionsClientMetadataEntryStatus string + +const ( + SessionsClientMetadataEntryStatusCorrupt SessionsClientMetadataEntryStatus = "corrupt" + SessionsClientMetadataEntryStatusNotFound SessionsClientMetadataEntryStatus = "notFound" + SessionsClientMetadataEntryStatusOk SessionsClientMetadataEntryStatus = "ok" + SessionsClientMetadataEntryStatusUnavailable SessionsClientMetadataEntryStatus = "unavailable" + SessionsClientMetadataEntryStatusUnsupportedVersion SessionsClientMetadataEntryStatus = "unsupportedVersion" +) + // Rust-owned settings predicates exposed across the SDK boundary. Raw feature-flag names // are intentionally not part of the contract. // Experimental: SessionSettingsPredicateName is part of an experimental API and may change @@ -21253,6 +21386,27 @@ func (a *ServerSessionsAPI) Fork(ctx context.Context, params *SessionsForkReques return &result, nil } +// GetClientMetadata reads client-owned metadata for multiple persisted local sessions +// without opening them. Results preserve request order and report missing, corrupt, +// unsupported, or temporarily unavailable sessions independently. +// +// RPC method: sessions.getClientMetadata. +// +// Parameters: Bounded batch request for client-owned metadata from persisted local sessions. +// +// Returns: Ordered client metadata outcomes for the requested local sessions. +func (a *ServerSessionsAPI) GetClientMetadata(ctx context.Context, params *SessionsGetClientMetadataRequest) (*SessionsGetClientMetadataResult, error) { + raw, err := a.client.Request(ctx, "sessions.getClientMetadata", params) + if err != nil { + return nil, err + } + var result SessionsGetClientMetadataResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // GetLastForContext returns the most-relevant prior session for a given working-directory // context. // @@ -24459,6 +24613,30 @@ func (a *MetadataAPI) ContextInfo(ctx context.Context, params *MetadataContextIn return &result, nil } +// GetClientMetadata returns the client-owned string metadata persisted with this local +// session. The metadata is not included in model context, events, telemetry, snapshots, or +// remote exports. +// +// RPC method: session.metadata.getClientMetadata. +// +// Returns: Client-owned, case-sensitive string metadata persisted with a local session. +// Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 +// bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 +// KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may +// contain at most 64 KiB. The runtime stores but never interprets these values. +func (a *MetadataAPI) GetClientMetadata(ctx context.Context) (*ClientMetadata, error) { + req := map[string]any{"sessionId": a.sessionID} + raw, err := a.client.Request(ctx, "session.metadata.getClientMetadata", req) + if err != nil { + return nil, err + } + var result ClientMetadata + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // GetContextAttribution returns the experimental per-source attribution breakdown of the // session's current context window as a flat list of entries (skills, subagents, MCP // servers, built-in tools, plugin rollups, system/tool-definition costs, with nesting via @@ -24647,6 +24825,46 @@ func (a *MetadataAPI) Snapshot(ctx context.Context) (*SessionMetadataSnapshot, e return &result, nil } +// UpdateClientMetadata atomically patches the client-owned string metadata persisted with +// this local session and returns the committed bag. +// +// RPC method: session.metadata.updateClientMetadata. +// +// Parameters: Atomic patch for client-owned session metadata. Operations apply in clear, +// remove, then set order. The resulting bag must satisfy the ClientMetadata entry and +// serialized-size limits. Local storage coordinates concurrent runtime processes; custom +// SessionFs providers must serialize writers that access the same session from multiple +// processes. +// +// Returns: Client-owned, case-sensitive string metadata persisted with a local session. +// Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 +// bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 +// KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may +// contain at most 64 KiB. The runtime stores but never interprets these values. +func (a *MetadataAPI) UpdateClientMetadata(ctx context.Context, params *MetadataUpdateClientMetadataRequest) (*ClientMetadata, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + if params.Clear != nil { + req["clear"] = *params.Clear + } + if params.Remove != nil { + req["remove"] = params.Remove + } + if params.Set != nil { + req["set"] = params.Set + } + } + raw, err := a.client.Request(ctx, "session.metadata.updateClientMetadata", req) + if err != nil { + return nil, err + } + var result ClientMetadata + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Experimental: ModeAPI contains experimental APIs that may change or be removed. type ModeAPI sessionAPI @@ -27200,9 +27418,9 @@ func (a *ToolsAPI) TaskCompleteEventData(ctx context.Context, params *ToolsTaskC return &result, nil } -// UpdateSubagentSettings updates the current session's live subagent settings after user -// settings change. The persisted user settings remain the source of truth for future -// sessions. +// UpdateSubagentSettings sets the current session's live subagent settings override, which +// takes precedence over persisted user settings until cleared. Persisted user settings +// remain the source of truth for future sessions. // // RPC method: session.tools.updateSubagentSettings. // @@ -29429,12 +29647,13 @@ type ProviderTokenHandler interface { // Experimental: SessionFSHandler contains experimental APIs that may change or be removed. type SessionFSHandler interface { - // AppendFile appends content to a file in the client-provided session filesystem. + // AppendFile appends content to a file in the client-provided session filesystem, creating + // parent directories as needed. // // RPC method: sessionFs.appendFile. // // Parameters: File path, content to append, and optional mode for the client-provided - // session filesystem. + // session filesystem. Implementations create parent directories as needed. // // Returns: Describes a filesystem error. AppendFile(request *SessionFSAppendFileRequest) (*SessionFSError, error) diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go index d86f0040ff..dd63ac230e 100644 --- a/go/rpc/zrpc_encoding.go +++ b/go/rpc/zrpc_encoding.go @@ -5763,6 +5763,120 @@ func (r SessionsOpenResumeLast) MarshalJSON() ([]byte, error) { }) } +func unmarshalSessionsClientMetadataEntry(data []byte) (SessionsClientMetadataEntry, error) { + if string(data) == "null" { + return nil, nil + } + type rawUnion struct { + Status SessionsClientMetadataEntryStatus `json:"status"` + } + var raw rawUnion + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + switch raw.Status { + case SessionsClientMetadataEntryStatusCorrupt: + var d SessionsClientMetadataEntryCorrupt + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case SessionsClientMetadataEntryStatusNotFound: + var d SessionsClientMetadataEntryNotFound + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case SessionsClientMetadataEntryStatusOk: + var d SessionsClientMetadataEntryOk + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case SessionsClientMetadataEntryStatusUnavailable: + var d SessionsClientMetadataEntryUnavailable + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case SessionsClientMetadataEntryStatusUnsupportedVersion: + var d SessionsClientMetadataEntryUnsupportedVersion + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + default: + return &RawSessionsClientMetadataEntryData{Discriminator: raw.Status, Raw: data}, nil + } +} + +func (r RawSessionsClientMetadataEntryData) MarshalJSON() ([]byte, error) { + if r.Raw != nil { + return r.Raw, nil + } + return json.Marshal(struct { + Status SessionsClientMetadataEntryStatus `json:"status"` + }{ + Status: r.Discriminator, + }) +} + +func (r SessionsClientMetadataEntryCorrupt) MarshalJSON() ([]byte, error) { + type alias SessionsClientMetadataEntryCorrupt + return json.Marshal(struct { + Status SessionsClientMetadataEntryStatus `json:"status"` + alias + }{ + Status: r.Status(), + alias: alias(r), + }) +} + +func (r SessionsClientMetadataEntryNotFound) MarshalJSON() ([]byte, error) { + type alias SessionsClientMetadataEntryNotFound + return json.Marshal(struct { + Status SessionsClientMetadataEntryStatus `json:"status"` + alias + }{ + Status: r.Status(), + alias: alias(r), + }) +} + +func (r SessionsClientMetadataEntryOk) MarshalJSON() ([]byte, error) { + type alias SessionsClientMetadataEntryOk + return json.Marshal(struct { + Status SessionsClientMetadataEntryStatus `json:"status"` + alias + }{ + Status: r.Status(), + alias: alias(r), + }) +} + +func (r SessionsClientMetadataEntryUnavailable) MarshalJSON() ([]byte, error) { + type alias SessionsClientMetadataEntryUnavailable + return json.Marshal(struct { + Status SessionsClientMetadataEntryStatus `json:"status"` + alias + }{ + Status: r.Status(), + alias: alias(r), + }) +} + +func (r SessionsClientMetadataEntryUnsupportedVersion) MarshalJSON() ([]byte, error) { + type alias SessionsClientMetadataEntryUnsupportedVersion + return json.Marshal(struct { + Status SessionsClientMetadataEntryStatus `json:"status"` + alias + }{ + Status: r.Status(), + alias: alias(r), + }) +} + func unmarshalSettableAuthInfo(data []byte) (SettableAuthInfo, error) { if string(data) == "null" { return nil, nil diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 3511e18ea2..a16d3e45bf 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -382,13 +382,11 @@ type AssistantMessageData struct { Fusion *FusionAttribution `json:"fusion,omitempty"` // CAPI interaction ID for correlating this message with upstream telemetry InteractionID *string `json:"interactionId,omitempty"` - // True when this is the last assistant reply for the originatingMessageId. Does not indicate successful completion of hooks or cleanup; session.error or abort events may still follow. - IsFinalReply *bool `json:"isFinalReply,omitempty"` // Unique identifier for this assistant message MessageID string `json:"messageId"` // Model that produced this assistant message, if known Model *string `json:"model,omitempty"` - // Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. + // Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations, steering messages, and stop-hook corrections. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. OriginatingMessageID *string `json:"originatingMessageId,omitempty"` // Actual output token count from the API response (completion_tokens), used for accurate token accounting OutputTokens *int64 `json:"outputTokens,omitempty"` @@ -2598,6 +2596,8 @@ type SubagentCompletedData struct { Model *string `json:"model,omitempty"` // Why an explicit task-call model did not become the effective model ModelOverrideReason *string `json:"modelOverrideReason,omitempty"` + // Authority or runtime mechanism responsible for sub-agent model selection + ModelSelectionSource *SubagentModelSelectionSource `json:"modelSelectionSource,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 @@ -2633,6 +2633,8 @@ type SubagentFailedData struct { Model *string `json:"model,omitempty"` // Why an explicit task-call model did not become the effective model ModelOverrideReason *string `json:"modelOverrideReason,omitempty"` + // Authority or runtime mechanism responsible for sub-agent model selection + ModelSelectionSource *SubagentModelSelectionSource `json:"modelSelectionSource,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 @@ -5925,6 +5927,26 @@ const ( SkillInvokedTriggerUserInvoked SkillInvokedTrigger = "user-invoked" ) +// Authority or runtime mechanism responsible for sub-agent model selection. +type SubagentModelSelectionSource string + +const ( + // Default model declared by the agent definition. + SubagentModelSelectionSourceAgentDefinitionDefault SubagentModelSelectionSource = "agent_definition_default" + // Complementary-model default selected for the sub-agent. + SubagentModelSelectionSourceComplementaryDefault SubagentModelSelectionSource = "complementary_default" + // Non-required model preference configured for the sub-agent. + SubagentModelSelectionSourceConfiguredPreference SubagentModelSelectionSource = "configured_preference" + // Required model policy configured for the sub-agent. + SubagentModelSelectionSourceConfiguredRequired SubagentModelSelectionSource = "configured_required" + // Explicit model supplied by the parent agent on the task call and selected for dispatch. + SubagentModelSelectionSourceExplicitOverride SubagentModelSelectionSource = "explicit_override" + // Runtime policy, Auto mode, or an experiment selected the model. + SubagentModelSelectionSourceRuntimePolicy SubagentModelSelectionSource = "runtime_policy" + // Model inherited from the parent session. + SubagentModelSelectionSourceSessionInheritance SubagentModelSelectionSource = "session_inheritance" +) + // Where the model input for a task-tool sub-agent came from. type SubagentTaskModelSource string diff --git a/go/zsession_events.go b/go/zsession_events.go index cc914cb91f..25d7ef5460 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -350,6 +350,7 @@ type ( SubagentConfiguredData = rpc.SubagentConfiguredData SubagentDeselectedData = rpc.SubagentDeselectedData SubagentFailedData = rpc.SubagentFailedData + SubagentModelSelectionSource = rpc.SubagentModelSelectionSource SubagentSelectedData = rpc.SubagentSelectedData SubagentStartedData = rpc.SubagentStartedData SubagentTaskModelSource = rpc.SubagentTaskModelSource @@ -876,6 +877,13 @@ const ( SkillSourcePlugin = rpc.SkillSourcePlugin SkillSourceProject = rpc.SkillSourceProject SkillSourceSDK = rpc.SkillSourceSDK + SubagentModelSelectionSourceAgentDefinitionDefault = rpc.SubagentModelSelectionSourceAgentDefinitionDefault + SubagentModelSelectionSourceComplementaryDefault = rpc.SubagentModelSelectionSourceComplementaryDefault + SubagentModelSelectionSourceConfiguredPreference = rpc.SubagentModelSelectionSourceConfiguredPreference + SubagentModelSelectionSourceConfiguredRequired = rpc.SubagentModelSelectionSourceConfiguredRequired + SubagentModelSelectionSourceExplicitOverride = rpc.SubagentModelSelectionSourceExplicitOverride + SubagentModelSelectionSourceRuntimePolicy = rpc.SubagentModelSelectionSourceRuntimePolicy + SubagentModelSelectionSourceSessionInheritance = rpc.SubagentModelSelectionSourceSessionInheritance SubagentTaskModelSourceCustomAgentDefinition = rpc.SubagentTaskModelSourceCustomAgentDefinition SubagentTaskModelSourceSubagentConfiguration = rpc.SubagentTaskModelSourceSubagentConfiguration SubagentTaskModelSourceTaskArgument = rpc.SubagentTaskModelSourceTaskArgument diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java index 50877be6da..d3154846ed 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java @@ -37,10 +37,8 @@ public final class AssistantMessageEvent extends SessionEvent { public record AssistantMessageEventData( /** Unique identifier for this assistant message */ @JsonProperty("messageId") String messageId, - /** Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. */ + /** Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations, steering messages, and stop-hook corrections. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. */ @JsonProperty("originatingMessageId") String originatingMessageId, - /** True when this is the last assistant reply for the originatingMessageId. Does not indicate successful completion of hooks or cleanup; session.error or abort events may still follow. */ - @JsonProperty("isFinalReply") Boolean isFinalReply, /** Model that produced this assistant message, if known */ @JsonProperty("model") String model, /** The assistant's text response content */ 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 26459bb955..064efdd544 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 @@ -52,6 +52,8 @@ public record SubagentCompletedEventData( @JsonProperty("explicitModelMatchesPreference") Boolean explicitModelMatchesPreference, /** Why an explicit task-call model did not become the effective model */ @JsonProperty("modelOverrideReason") String modelOverrideReason, + /** Authority or runtime mechanism responsible for sub-agent model selection */ + @JsonProperty("modelSelectionSource") SubagentModelSelectionSource modelSelectionSource, /** 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 54464f8ddf..1b0d99cbee 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 @@ -54,6 +54,8 @@ public record SubagentFailedEventData( @JsonProperty("explicitModelMatchesPreference") Boolean explicitModelMatchesPreference, /** Why an explicit task-call model did not become the effective model */ @JsonProperty("modelOverrideReason") String modelOverrideReason, + /** Authority or runtime mechanism responsible for sub-agent model selection */ + @JsonProperty("modelSelectionSource") SubagentModelSelectionSource modelSelectionSource, /** 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/SubagentModelSelectionSource.java b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentModelSelectionSource.java new file mode 100644 index 0000000000..5ffcb187cf --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SubagentModelSelectionSource.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Authority or runtime mechanism responsible for sub-agent model selection. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SubagentModelSelectionSource { + /** The {@code explicit_override} variant. */ + EXPLICIT_OVERRIDE("explicit_override"), + /** The {@code configured_required} variant. */ + CONFIGURED_REQUIRED("configured_required"), + /** The {@code configured_preference} variant. */ + CONFIGURED_PREFERENCE("configured_preference"), + /** The {@code complementary_default} variant. */ + COMPLEMENTARY_DEFAULT("complementary_default"), + /** The {@code session_inheritance} variant. */ + SESSION_INHERITANCE("session_inheritance"), + /** The {@code agent_definition_default} variant. */ + AGENT_DEFINITION_DEFAULT("agent_definition_default"), + /** The {@code runtime_policy} variant. */ + RUNTIME_POLICY("runtime_policy"); + + private final String value; + SubagentModelSelectionSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SubagentModelSelectionSource fromValue(String value) { + for (SubagentModelSelectionSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SubagentModelSelectionSource value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientMetadata.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientMetadata.java new file mode 100644 index 0000000000..e18881ac91 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientMetadata.java @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ClientMetadata() { +} 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 870f7ac3cf..1c3b8d10a1 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 @@ -8,6 +8,7 @@ package com.github.copilot.generated.rpc; import com.github.copilot.CopilotExperimental; +import java.util.List; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -94,6 +95,17 @@ public CompletableFuture getMetadata(SessionsGetMetad return caller.invoke("sessions.getMetadata", params, SessionsGetMetadataResult.class); } + /** + * Bounded batch request for client-owned metadata from persisted local sessions. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture> getClientMetadata(SessionsGetClientMetadataParams params) { + return caller.invoke("sessions.getClientMetadata", params, RpcMapper.INSTANCE.getTypeFactory().constructCollectionType(List.class, Object.class)); + } + /** * Pagination options for reading an inactive or active local session's persisted event journal. * diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFsAppendFileParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFsAppendFileParams.java index 1751167ee9..c0904cc5a5 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFsAppendFileParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFsAppendFileParams.java @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * File path, content to append, and optional mode for the client-provided session filesystem. + * File path, content to append, and optional mode for the client-provided session filesystem. Implementations create parent directories as needed. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataApi.java index 0b15df5d43..8d7f3dd753 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataApi.java @@ -41,6 +41,33 @@ public CompletableFuture snapshot() { return caller.invoke("session.metadata.snapshot", java.util.Map.of("sessionId", this.sessionId), SessionMetadataSnapshotResult.class); } + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture getClientMetadata() { + return caller.invoke("session.metadata.getClientMetadata", java.util.Map.of("sessionId", this.sessionId), ClientMetadata.class); + } + + /** + * Atomic patch for client-owned session metadata. Operations apply in clear, remove, then set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size limits. Local storage coordinates concurrent runtime processes; custom SessionFs providers must serialize writers that access the same session from multiple processes. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture updateClientMetadata(SessionMetadataUpdateClientMetadataParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.metadata.updateClientMetadata", _p, ClientMetadata.class); + } + /** * Identifies the target session. * diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataGetClientMetadataParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataGetClientMetadataParams.java new file mode 100644 index 0000000000..08761e9181 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataGetClientMetadataParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataGetClientMetadataParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataUpdateClientMetadataParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataUpdateClientMetadataParams.java new file mode 100644 index 0000000000..6e43df873b --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataUpdateClientMetadataParams.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 java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * Atomic patch for client-owned session metadata. Operations apply in clear, remove, then set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size limits. Local storage coordinates concurrent runtime processes; custom SessionFs providers must serialize writers that access the same session from multiple processes. + * + * @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 SessionMetadataUpdateClientMetadataParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Remove every existing client metadata entry before applying remove and set. Defaults to false. */ + @JsonProperty("clear") Boolean clear, + /** Case-sensitive keys to remove. Missing keys are ignored. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. */ + @JsonProperty("remove") List remove, + /** String entries to add or replace. Set wins when a key also appears in remove. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Each value may contain at most 16 KiB of UTF-8 data. */ + @JsonProperty("set") Map set +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionsGetClientMetadataParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionsGetClientMetadataParams.java new file mode 100644 index 0000000000..9419f79c88 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionsGetClientMetadataParams.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; + +/** + * Bounded batch request for client-owned metadata from persisted local sessions. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsGetClientMetadataParams( + /** Session IDs to inspect. Results preserve this order. */ + @JsonProperty("sessionIds") List sessionIds, + /** Case-sensitive keys to project from each valid bag. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Omit to return every entry. */ + @JsonProperty("keys") List keys +) { +} 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 4a366864c3..eee4f1efa4 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 @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Subagent model, reasoning effort, and context tier settings + * Subagent model, reasoning effort, context tier, and auto-invocation settings * * @since 1.0.0 */ @@ -28,6 +28,8 @@ public record SubagentSettingsEntry( /** Reasoning effort override for matching subagents */ @JsonProperty("effortLevel") String effortLevel, /** Context tier override for matching subagents */ - @JsonProperty("contextTier") SubagentSettingsEntryContextTier contextTier + @JsonProperty("contextTier") SubagentSettingsEntryContextTier contextTier, + /** Whether this agent's runtime-defined proactive invocation prompting is enabled, if supported. Currently consumed by the built-in rubber-duck agent. */ + @JsonProperty("autoInvoke") Boolean autoInvoke ) { } diff --git a/nodejs/README.md b/nodejs/README.md index d5ef322209..e313dbb3ae 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -303,8 +303,7 @@ Returns the final assistant message event, or undefined if none was received. ##### Structured output (preview) -Requires a runtime build with `responseFormat`, `originatingMessageId`, and -`isFinalReply` support. +Requires a runtime build with `responseFormat` and `originatingMessageId` support. Pass a raw JSON Schema or a Zod schema as `responseSchema` to `send` or `sendAndWait`. As with custom tool parameters, the SDK converts Zod schemas to JSON Schema before sending them: @@ -335,7 +334,9 @@ matching assistant message throws. Do not also set `options.responseSchema` when using the typed overload. The schema belongs to the submitted run, including its tool-call iterations. -Subsequent sends do not inherit it. Ordinary immediate steering inherits the +Internally generated stop-hook corrections retain the schema and originating +message ID, so the wait returns the corrected answer. Independent subsequent +sends do not inherit it. Ordinary immediate steering inherits the active schema; specifying a schema with `mode: "immediate"` is rejected. The generated `session.rpc.send` and `session.rpc.sendMessages` wrappers expose the full `responseFormat` contract when you need to set its name, description, @@ -349,15 +350,12 @@ selected result. The existing unformatted overload retains its session-wide behavior. `turnId` identifies an individual model/tool iteration, not the whole run; telemetry interaction IDs are not unique run identifiers. -For event-driven consumption with `send`, a root `assistant.message` with -`data.isFinalReply === true` identifies the reply to parse without waiting for -idle. Match its `data.originatingMessageId` to the ID returned by `send`. -Subscribe before sending and allow for events arriving before that acknowledgement. -Tool-call messages are not final replies; for multi-message terminal responses, -only the last message is marked. The optional flag is a content-selection signal, -not a success guarantee: stop hooks and other processing can still run, and later -errors arrive through normal `session.error` events. `sendAndWait` deliberately -continues waiting for idle and can still reject after receiving a final reply. +For event-driven consumption with `send`, subscribe before sending and collect +root `assistant.message` events whose `data.originatingMessageId` matches the ID +returned by `send`; events may arrive before that acknowledgement. Wait for +`session.idle`, then parse the last matching message without tool requests. +An earlier response may be superseded by a stop-hook correction. Handle +`session.error` and aborted idle events rather than returning a partial result. Streaming still delivers ordinary text events, including intermediate messages and tool calls. Only the final selected message is parsed by the typed overload; diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 9f5254b1d9..2ebf565c8d 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -3475,6 +3475,73 @@ export type SessionsOpenProgressStatus = | "in-progress" /** The step has completed successfully. */ | "complete"; +/** + * Client metadata outcome for one requested local session. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "SessionsClientMetadataEntry". + */ +/** @experimental */ +export type SessionsClientMetadataEntry = + | { + /** + * Requested session ID. + */ + sessionId: string; + metadata: ClientMetadata; + /** + * Client metadata outcome discriminator. + */ + status: "ok"; + } + | { + /** + * Requested session ID. + */ + sessionId: string; + /** + * Client metadata outcome discriminator. + */ + status: "notFound"; + } + | { + /** + * Requested session ID. + */ + sessionId: string; + /** + * Client metadata outcome discriminator. + */ + status: "corrupt"; + } + | { + /** + * Requested session ID. + */ + sessionId: string; + /** + * Client metadata outcome discriminator. + */ + status: "unsupportedVersion"; + } + | { + /** + * Requested session ID. + */ + sessionId: string; + /** + * Filesystem or provider error code. Clients should not assume every provider uses operating-system error codes. + */ + code: string; + /** + * Human-readable diagnostic message. Not stable for programmatic matching. + */ + message: string; + /** + * Client metadata outcome discriminator. + */ + status: "unavailable"; + }; /** * Authentication credentials accepted by session.gitHubAuth.setCredentials. Session-owned token-provider identities cannot be installed through this method. * @@ -3536,6 +3603,14 @@ export type SessionSettingsPredicateName = | "trivialChangeEnabledForTool" /** Whether trivial-change skip behavior is enabled for a specific tool. */ | "trivialChangeSkipEnabledForTool"; +/** + * Ordered client metadata outcomes for the requested local sessions. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "SessionsGetClientMetadataResult". + */ +/** @experimental */ +export type SessionsGetClientMetadataResult = SessionsClientMetadataEntry[]; /** * Which session sources to include. Defaults to `local` for backward compatibility. * @@ -6385,6 +6460,16 @@ export interface CatalogUnavailableTransportError { */ message: string; } +/** + * Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ClientMetadata". + */ +/** @experimental */ +export interface ClientMetadata { + [k: string]: string | undefined; +} /** * Runtime-to-owner cancellation request for a client-owned task. * @@ -12686,6 +12771,31 @@ export interface MetadataSnapshotRemoteMetadataRepository { */ branch: string; } +/** + * Atomic patch for client-owned session metadata. Operations apply in clear, remove, then set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size limits. Local storage coordinates concurrent runtime processes; custom SessionFs providers must serialize writers that access the same session from multiple processes. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "MetadataUpdateClientMetadataRequest". + */ +/** @experimental */ +export interface MetadataUpdateClientMetadataRequest { + /** + * Remove every existing client metadata entry before applying remove and set. Defaults to false. + */ + clear?: boolean; + /** + * Case-sensitive keys to remove. Missing keys are ignored. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. + * + * @maxItems 128 + */ + remove?: string[]; + /** + * String entries to add or replace. Set wins when a key also appears in remove. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Each value may contain at most 16 KiB of UTF-8 data. + */ + set?: { + [k: string]: string | undefined; + }; +} /** * Copilot model metadata, including identifier, display name, capabilities, policy, billing, reasoning efforts, and picker categories. * @@ -18029,7 +18139,7 @@ export interface SessionEnrichMetadataResult { sessions: LocalSessionMetadataValue[]; } /** - * File path, content to append, and optional mode for the client-provided session filesystem. + * File path, content to append, and optional mode for the client-provided session filesystem. Implementations create parent directories as needed. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "SessionFsAppendFileRequest". @@ -20036,6 +20146,27 @@ export interface SessionsGetBoardEntryCountResult { */ count?: number; } +/** + * Bounded batch request for client-owned metadata from persisted local sessions. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "SessionsGetClientMetadataRequest". + */ +/** @experimental */ +export interface SessionsGetClientMetadataRequest { + /** + * Session IDs to inspect. Results preserve this order. + * + * @maxItems 1000 + */ + sessionIds: string[]; + /** + * Case-sensitive keys to project from each valid bag. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Omit to return every entry. + * + * @maxItems 128 + */ + keys?: string[]; +} /** * Session ID whose event-log file path to compute. * @@ -21338,7 +21469,7 @@ export interface SlashCommandSetPlanModelResult { runtimeSettingsChanged?: boolean; } /** - * Subagent model, reasoning effort, and context tier settings + * Subagent model, reasoning effort, context tier, and auto-invocation settings * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "SubagentSettingsEntry". @@ -21355,6 +21486,10 @@ export interface SubagentSettingsEntry { */ effortLevel?: string; contextTier?: SubagentSettingsEntryContextTier; + /** + * Whether this agent's runtime-defined proactive invocation prompting is enabled, if supported. Currently consumed by the built-in rubber-duck agent. + */ + autoInvoke?: boolean; } /** * Tracked background agent task metadata, including IDs, status, timing, agent type, prompt, model, result, and latest response. @@ -24492,6 +24627,15 @@ export function createServerRpc(connection: MessageConnection) { */ list: async (params: SessionsListRequest): Promise => connection.sendRequest("sessions.list", params), + /** + * Reads client-owned metadata for multiple persisted local sessions without opening them. Results preserve request order and report missing, corrupt, unsupported, or temporarily unavailable sessions independently. + * + * @param params Bounded batch request for client-owned metadata from persisted local sessions. + * + * @returns Ordered client metadata outcomes for the requested local sessions. + */ + getClientMetadata: async (params: SessionsGetClientMetadataRequest): Promise => + connection.sendRequest("sessions.getClientMetadata", 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. * @@ -25985,7 +26129,7 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin set: async (params: ToolsSetRequest): Promise => connection.sendRequest("session.tools.set", { sessionId, ...params }), /** - * Updates the current session's live subagent settings after user settings change. The persisted user settings remain the source of truth for future sessions. + * Sets the current session's live subagent settings override, which takes precedence over persisted user settings until cleared. Persisted user settings remain the source of truth for future sessions. * * @param params Subagent settings to apply to the current session * @@ -26377,6 +26521,22 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ snapshot: async (): Promise => connection.sendRequest("session.metadata.snapshot", { sessionId }), + /** + * Returns the client-owned string metadata persisted with this local session. The metadata is not included in model context, events, telemetry, snapshots, or remote exports. + * + * @returns Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. + */ + getClientMetadata: async (): Promise => + connection.sendRequest("session.metadata.getClientMetadata", { sessionId }), + /** + * Atomically patches the client-owned string metadata persisted with this local session and returns the committed bag. + * + * @param params Atomic patch for client-owned session metadata. Operations apply in clear, remove, then set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size limits. Local storage coordinates concurrent runtime processes; custom SessionFs providers must serialize writers that access the same session from multiple processes. + * + * @returns Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. + */ + updateClientMetadata: async (params: MetadataUpdateClientMetadataRequest): Promise => + connection.sendRequest("session.metadata.updateClientMetadata", { sessionId, ...params }), /** * Reports whether the local session is currently processing user/agent messages. * @@ -27178,9 +27338,9 @@ export interface SessionFsHandler { */ writeFile(params: SessionFsWriteFileRequest): Promise; /** - * Appends content to a file in the client-provided session filesystem. + * Appends content to a file in the client-provided session filesystem, creating parent directories as needed. * - * @param params File path, content to append, and optional mode for the client-provided session filesystem. + * @param params File path, content to append, and optional mode for the client-provided session filesystem. Implementations create parent directories as needed. * * @returns Describes a filesystem error. */ diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index b9f5af578c..87906dc30c 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -731,6 +731,24 @@ export type SubagentTaskModelSource = | "custom_agent_definition" /** Neither the task call, the per-sub-agent settings entry, nor a custom agent definition supplied a model. */ | "unset"; +/** + * Authority or runtime mechanism responsible for sub-agent model selection. + */ +export type SubagentModelSelectionSource = + /** Explicit model supplied by the parent agent on the task call and selected for dispatch. */ + | "explicit_override" + /** Required model policy configured for the sub-agent. */ + | "configured_required" + /** Non-required model preference configured for the sub-agent. */ + | "configured_preference" + /** Complementary-model default selected for the sub-agent. */ + | "complementary_default" + /** Model inherited from the parent session. */ + | "session_inheritance" + /** Default model declared by the agent definition. */ + | "agent_definition_default" + /** Runtime policy, Auto mode, or an experiment selected the model. */ + | "runtime_policy"; /** * Binary asset type discriminator. Use "image" for images and "resource" otherwise. */ @@ -5023,10 +5041,6 @@ export interface AssistantMessageData { * CAPI interaction ID for correlating this message with upstream telemetry */ interactionId?: string; - /** - * True when this is the last assistant reply for the originatingMessageId. Does not indicate successful completion of hooks or cleanup; session.error or abort events may still follow. - */ - isFinalReply?: boolean; /** * Unique identifier for this assistant message */ @@ -5036,7 +5050,7 @@ export interface AssistantMessageData { */ model?: string; /** - * Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. + * Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations, steering messages, and stop-hook corrections. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. */ originatingMessageId?: string; /** @@ -7269,6 +7283,7 @@ export interface SubagentCompletedData { * Why an explicit task-call model did not become the effective model */ modelOverrideReason?: string; + modelSelectionSource?: SubagentModelSelectionSource; /** * Tool call ID of the parent tool invocation that spawned this sub-agent */ @@ -7360,6 +7375,7 @@ export interface SubagentFailedData { * Why an explicit task-call model did not become the effective model */ modelOverrideReason?: string; + modelSelectionSource?: SubagentModelSelectionSource; /** * Tool call ID of the parent tool invocation that spawned this sub-agent */ diff --git a/nodejs/test/e2e/structured_output.e2e.test.ts b/nodejs/test/e2e/structured_output.e2e.test.ts index 7213ab4c96..2587902562 100644 --- a/nodejs/test/e2e/structured_output.e2e.test.ts +++ b/nodejs/test/e2e/structured_output.e2e.test.ts @@ -59,13 +59,11 @@ describe("Structured output", async () => { ).toBeDefined(); expect(JSON.parse(result!.data.content)).toEqual({ answer: 42, contract: "raw_schema" }); expect(result!.data.originatingMessageId).toBeTruthy(); - expect(result!.data.isFinalReply).toBe(true); const ordinary = await session.sendAndWait( "Reply exactly SCHEMA_CLEARED without JSON or quotes." ); expect(ordinary?.data.content).toBe("SCHEMA_CLEARED"); - expect(ordinary?.data.isFinalReply).toBe(true); const exchanges = await openAiEndpoint.getExchanges(); expect(exchanges).toHaveLength(2); expect(exchanges[0].request).toMatchObject({ @@ -115,13 +113,8 @@ describe("Structured output", async () => { const replies = events.filter( (event) => event.type === "assistant.message" && !event.agentId ); - expect(replies.filter((event) => event.data.isFinalReply)).toEqual([replies.at(-1)]); expect(replies.some((event) => event.data.toolRequests?.length)).toBe(true); - expect( - replies - .filter((event) => event.data.toolRequests?.length) - .every((event) => event.data.isFinalReply !== true) - ).toBe(true); + expect(replies.at(-1)?.data.toolRequests ?? []).toEqual([]); const exchanges = await openAiEndpoint.getExchanges(); expect(exchanges.length).toBeGreaterThanOrEqual(2); for (const exchange of exchanges) { @@ -132,7 +125,7 @@ describe("Structured output", async () => { } }); - it("node_send_exposes_final_reply_before_stop_hook_completes", async () => { + it("node_send_selects_correlated_response_after_idle", async () => { let releaseHook!: () => void; let hookEntered = false; const hookReleased = new Promise((resolve) => { @@ -159,57 +152,94 @@ describe("Structured output", async () => { }, }); const replies: AssistantMessageEvent[] = []; - let resolveReply!: (event: AssistantMessageEvent) => void; - let rejectReply!: (error: Error) => void; - const replyReceived = new Promise((resolve, reject) => { - resolveReply = resolve; - rejectReply = reject; - }); + const errors: string[] = []; let idle = false; const unsubscribe = session.on((event) => { if (event.agentId) return; if (event.type === "assistant.message") { replies.push(event); - if (event.data.isFinalReply === true) resolveReply(event); } else if (event.type === "session.error") { - rejectReply(new Error(event.data.message)); + errors.push(event.data.message); } else if (event.type === "session.idle") { idle = true; } }); const schema = z.object({ count: z.number().int(), color: z.literal("red") }); - const timeout = setTimeout(() => rejectReply(new Error("No final reply received")), 45_000); try { - const [messageId, reply] = await Promise.all([ - session.send({ - prompt: "Call read_inventory once, then report the current widget count and color.", - responseSchema: schema, - }), - replyReceived, - ]); - await waitForCondition(() => hookEntered, { + const messageId = await session.send({ + prompt: "Call read_inventory once, then report the current widget count and color.", + responseSchema: schema, + }); + await waitForCondition(() => hookEntered || errors.length > 0, { timeoutMessage: "Stop hook did not start", }); + expect(errors).toEqual([]); + expect(idle).toBe(false); + releaseHook(); + await waitForCondition(() => idle || errors.length > 0, { + timeoutMessage: "Session did not become idle", + }); + expect(errors).toEqual([]); + const reply = replies.findLast( + (event) => event.data.originatingMessageId === messageId + ); + expect(reply).toBeDefined(); + if (!reply) throw new Error("No correlated assistant response"); expect(reply.data.originatingMessageId).toBe(messageId); expect(schema.parse(JSON.parse(reply.data.content))).toEqual({ count: 42, color: "red", }); - expect(idle).toBe(false); - expect(replies.filter((event) => event.data.isFinalReply)).toEqual([reply]); expect(replies.some((event) => event.data.toolRequests?.length)).toBe(true); expect(reply.data.toolRequests ?? []).toEqual([]); - - releaseHook(); - await waitForCondition(() => idle, { timeoutMessage: "Session did not become idle" }); expect(replies.at(-1)).toBe(reply); } finally { - clearTimeout(timeout); releaseHook(); unsubscribe(); } }, 60_000); + it("typed_wait_returns_stop_hook_correction", async () => { + let stops = 0; + const replies: AssistantMessageEvent[] = []; + const schema = z.object({ answer: z.number().int() }); + const session = await client.createSession({ + model: "gpt-4.1", + provider, + onPermissionRequest: approveAll, + availableTools: [], + onEvent: (event) => { + if (event.type === "assistant.message" && !event.agentId) replies.push(event); + }, + hooks: { + onAgentStop: () => + ++stops === 1 + ? { + decision: "block", + reason: "Correct the answer to 99, not 42. Do not use tools.", + } + : undefined, + }, + }); + const result = await session.sendAndWait("What is 19 + 23? Do not use tools.", schema); + expect(result).toEqual({ answer: 99 }); + expect(stops).toBe(2); + expect(replies.map((reply): unknown => JSON.parse(reply.data.content))).toEqual([ + { answer: 42 }, + { answer: 99 }, + ]); + expect(replies[0].data.originatingMessageId).toBeTruthy(); + expect(replies[1].data.originatingMessageId).toBe(replies[0].data.originatingMessageId); + const exchanges = await openAiEndpoint.getExchanges(); + expect(exchanges).toHaveLength(2); + for (const exchange of exchanges) { + expect(exchange.request).toHaveProperty( + "response_format.json_schema.schema", + schema.toJSONSchema() + ); + } + }); + it("node_concurrent_typed_sends_return_their_own_results", async () => { let markToolEntered!: () => void; let releaseTool!: () => void; @@ -298,6 +328,5 @@ describe("Structured output", async () => { if (final?.type !== "assistant.message") throw new Error("No assistant response"); expect(schema.parse(JSON.parse(final.data.content))).toEqual({ total: 42 }); expect(final.data.originatingMessageId).toBe(response.messageIds[0]); - expect(final.data.isFinalReply).toBe(true); }); }); diff --git a/nodejs/test/structured-output.test.ts b/nodejs/test/structured-output.test.ts index d445279218..0823996ef3 100644 --- a/nodejs/test/structured-output.test.ts +++ b/nodejs/test/structured-output.test.ts @@ -230,7 +230,7 @@ describe("structured output", () => { await assertion; }); - it("does not treat a final-reply flag as successful completion", async () => { + it("does not treat an assistant response as successful completion", async () => { const { session, sends } = controlledSession(); const pending = session.sendAndWait("question", answer); const assertion = expect(pending).rejects.toThrow("post-response failure"); @@ -240,7 +240,6 @@ describe("structured output", () => { event("assistant.message", { messageId: "final-reply", originatingMessageId: "one", - isFinalReply: true, content: '{"answer":42}', }) ); @@ -255,6 +254,26 @@ describe("structured output", () => { await assertion; }); + it("waits for idle and returns a correlated hook correction instead of the original answer", async () => { + const { session, sends } = controlledSession(); + const pending = session.sendAndWait("question", answer); + const completed = vi.fn(); + void pending.then(completed); + await sent(sends); + sends[0].resolve({ messageId: "one" }); + session._dispatchEvent(user("one")); + session._dispatchEvent(assistant("one", '{"answer":42}')); + await Promise.resolve(); + expect(completed).not.toHaveBeenCalled(); + session._dispatchEvent(user("hook-correction")); + session._dispatchEvent(assistant("one", '{"answer":99}')); + session._dispatchEvent(assistant("unrelated", '{"answer":123}')); + await Promise.resolve(); + expect(completed).not.toHaveBeenCalled(); + session._dispatchEvent(event("session.idle", {})); + await expect(pending).resolves.toEqual({ answer: 99 }); + }); + it("rejects promptly when the session disconnects", async () => { const { session, sends } = controlledSession(); const pending = session.sendAndWait("question", answer); diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index a91cb0a5fe..5f8dd3c920 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -5839,7 +5839,7 @@ def to_dict(self) -> dict: result["serverName"] = from_str(self.server_name) return result -class Status(Enum): +class MCPOauthProbeResultStatus(Enum): AUTHENTICATED = "authenticated" FAILED = "failed" NEEDS_AUTH = "needs-auth" @@ -6761,6 +6761,46 @@ class TaskType(Enum): CCA = "cca" CLI = "cli" +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MetadataUpdateClientMetadataRequest: + """Atomic patch for client-owned session metadata. Operations apply in clear, remove, then + set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size + limits. Local storage coordinates concurrent runtime processes; custom SessionFs + providers must serialize writers that access the same session from multiple processes. + """ + clear: bool | None = None + """Remove every existing client metadata entry before applying remove and set. Defaults to + false. + """ + remove: list[str] | None = None + """Case-sensitive keys to remove. Missing keys are ignored. Each key must be non-empty, at + most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. + """ + set: dict[str, str] | None = None + """String entries to add or replace. Set wins when a key also appears in remove. Each key + must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and + `github/` namespaces. Each value may contain at most 16 KiB of UTF-8 data. + """ + + @staticmethod + def from_dict(obj: Any) -> 'MetadataUpdateClientMetadataRequest': + assert isinstance(obj, dict) + clear = from_union([from_bool, from_none], obj.get("clear")) + remove = from_union([lambda x: from_list(from_str, x), from_none], obj.get("remove")) + set = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("set")) + return MetadataUpdateClientMetadataRequest(clear, remove, set) + + def to_dict(self) -> dict: + result: dict = {} + if self.clear is not None: + result["clear"] = from_union([from_bool, from_none], self.clear) + if self.remove is not None: + result["remove"] = from_union([lambda x: from_list(from_str, x), from_none], self.remove) + if self.set is not None: + result["set"] = from_union([lambda x: from_dict(from_str, x), from_none], self.set) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ModelPickerSettingsContext: @@ -10801,7 +10841,7 @@ def to_dict(self) -> dict: @dataclass class SessionFSAppendFileRequest: """File path, content to append, and optional mode for the client-provided session - filesystem. + filesystem. Implementations create parent directories as needed. """ content: str """Content to append""" @@ -12135,6 +12175,13 @@ def to_dict(self) -> dict: result["inUse"] = from_list(from_str, self.in_use) return result +class SessionsClientMetadataEntryStatus(Enum): + CORRUPT = "corrupt" + NOT_FOUND = "notFound" + OK = "ok" + UNAVAILABLE = "unavailable" + UNSUPPORTED_VERSION = "unsupportedVersion" + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionsCloseRequest: @@ -12373,6 +12420,34 @@ def to_dict(self) -> dict: result["count"] = from_union([from_int, from_none], self.count) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionsGetClientMetadataRequest: + """Bounded batch request for client-owned metadata from persisted local sessions.""" + + session_ids: list[str] + """Session IDs to inspect. Results preserve this order.""" + + keys: list[str] | None = None + """Case-sensitive keys to project from each valid bag. Each key must be non-empty, at most + 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Omit to + return every entry. + """ + + @staticmethod + def from_dict(obj: Any) -> 'SessionsGetClientMetadataRequest': + assert isinstance(obj, dict) + session_ids = from_list(from_str, obj.get("sessionIds")) + keys = from_union([lambda x: from_list(from_str, x), from_none], obj.get("keys")) + return SessionsGetClientMetadataRequest(session_ids, keys) + + def to_dict(self) -> dict: + result: dict = {} + result["sessionIds"] = from_list(from_str, self.session_ids) + if self.keys is not None: + result["keys"] = from_union([lambda x: from_list(from_str, x), from_none], self.keys) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionsGetEventFilePathRequest: @@ -24259,6 +24334,51 @@ def to_dict(self) -> dict: result["status"] = from_union([lambda x: to_enum(SessionVisibilityStatus, x), from_none], self.status) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionsClientMetadataEntry: + """Client metadata outcome for one requested local session. + + Ordered client metadata outcomes for the requested local sessions. + """ + session_id: str + """Requested session ID.""" + + status: SessionsClientMetadataEntryStatus + """Client metadata outcome discriminator.""" + + metadata: dict[str, str] | None = None + """Validated client metadata, possibly empty or projected to requested keys.""" + + code: str | None = None + """Filesystem or provider error code. Clients should not assume every provider uses + operating-system error codes. + """ + message: str | None = None + """Human-readable diagnostic message. Not stable for programmatic matching.""" + + @staticmethod + def from_dict(obj: Any) -> 'SessionsClientMetadataEntry': + assert isinstance(obj, dict) + session_id = from_str(obj.get("sessionId")) + status = SessionsClientMetadataEntryStatus(obj.get("status")) + metadata = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("metadata")) + code = from_union([from_str, from_none], obj.get("code")) + message = from_union([from_str, from_none], obj.get("message")) + return SessionsClientMetadataEntry(session_id, status, metadata, code, message) + + def to_dict(self) -> dict: + result: dict = {} + result["sessionId"] = from_str(self.session_id) + result["status"] = to_enum(SessionsClientMetadataEntryStatus, self.status) + if self.metadata is not None: + result["metadata"] = from_union([lambda x: from_dict(from_str, x), from_none], self.metadata) + if self.code is not None: + result["code"] = from_union([from_str, from_none], self.code) + if self.message is not None: + result["message"] = from_union([from_str, from_none], self.message) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionsOpenAttach: @@ -34839,7 +34959,7 @@ class MCPOauthProbeResult: unauthenticated request. Failed is an expected probe-domain outcome; JSON-RPC errors are reserved for API-call failures. """ - status: Status + status: MCPOauthProbeResultStatus """Probe outcome variant discriminator.""" http_response: McpOauthHttpResponse | None = None @@ -34862,7 +34982,7 @@ class MCPOauthProbeResult: @staticmethod def from_dict(obj: Any) -> 'MCPOauthProbeResult': assert isinstance(obj, dict) - status = Status(obj.get("status")) + status = MCPOauthProbeResultStatus(obj.get("status")) http_response = from_union([McpOauthHttpResponse.from_dict, from_none], obj.get("httpResponse")) reason = from_union([MCPOauthProbeNeedsAuthReason, from_none], obj.get("reason")) www_authenticate_params = from_union([McpOauthWWWAuthenticateParams.from_dict, from_none], obj.get("wwwAuthenticateParams")) @@ -34871,7 +34991,7 @@ def from_dict(obj: Any) -> 'MCPOauthProbeResult': def to_dict(self) -> dict: result: dict = {} - result["status"] = to_enum(Status, self.status) + result["status"] = to_enum(MCPOauthProbeResultStatus, self.status) if self.http_response is not None: result["httpResponse"] = from_union([lambda x: to_class(McpOauthHttpResponse, x), from_none], self.http_response) if self.reason is not None: @@ -36645,8 +36765,12 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SubagentSettingsEntry: - """Subagent model, reasoning effort, and context tier settings""" + """Subagent model, reasoning effort, context tier, and auto-invocation settings""" + auto_invoke: bool | None = None + """Whether this agent's runtime-defined proactive invocation prompting is enabled, if + supported. Currently consumed by the built-in rubber-duck agent. + """ context_tier: SubagentSettingsEntryContextTier | None = None """Context tier override for matching subagents""" @@ -36662,14 +36786,17 @@ class SubagentSettingsEntry: @staticmethod def from_dict(obj: Any) -> 'SubagentSettingsEntry': assert isinstance(obj, dict) + auto_invoke = from_union([from_bool, from_none], obj.get("autoInvoke")) 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")) model_policy = from_union([AgentModelPolicy, from_none], obj.get("modelPolicy")) - return SubagentSettingsEntry(context_tier, effort_level, model, model_policy) + return SubagentSettingsEntry(auto_invoke, context_tier, effort_level, model, model_policy) def to_dict(self) -> dict: result: dict = {} + if self.auto_invoke is not None: + result["autoInvoke"] = from_union([from_bool, from_none], self.auto_invoke) if self.context_tier is not None: result["contextTier"] = from_union([lambda x: to_enum(SubagentSettingsEntryContextTier, x), from_none], self.context_tier) if self.effort_level is not None: @@ -37043,6 +37170,7 @@ class RPC: catalog_unsafe_retrieval_error: CatalogUnsafeRetrievalError catalog_unsafe_retrieval_reason: CatalogUnsafeRetrievalReason catalog_unsupported_kind_error: CatalogUnsupportedKindError + client_metadata: dict[str, str] client_task_cancel_reason: ClientTaskCancelReason client_task_cancel_request: ClientTaskCancelRequest client_task_cancel_result: ClientTaskCancelResult @@ -37445,6 +37573,7 @@ class RPC: metadata_snapshot_remote_metadata: MetadataSnapshotRemoteMetadata metadata_snapshot_remote_metadata_repository: MetadataSnapshotRemoteMetadataRepository metadata_snapshot_remote_metadata_task_type: TaskType + metadata_update_client_metadata_request: MetadataUpdateClientMetadataRequest model: Model model_apply_startup_overlay_request: ModelApplyStartupOverlayRequest model_billing: ModelBilling @@ -37865,6 +37994,7 @@ class RPC: sessions_bulk_delete_request: SessionsBulkDeleteRequest sessions_check_in_use_request: SessionsCheckInUseRequest sessions_check_in_use_result: SessionsCheckInUseResult + sessions_client_metadata_entry: SessionsClientMetadataEntry sessions_close_request: SessionsCloseRequest sessions_close_result: SessionsCloseResult sessions_delete_request: SessionsDeleteRequest @@ -37889,6 +38019,8 @@ class RPC: sessions_fork_result: SessionsForkResult sessions_get_board_entry_count_request: SessionsGetBoardEntryCountRequest sessions_get_board_entry_count_result: SessionsGetBoardEntryCountResult + sessions_get_client_metadata_request: SessionsGetClientMetadataRequest + sessions_get_client_metadata_result: list[SessionsClientMetadataEntry] sessions_get_event_file_path_request: SessionsGetEventFilePathRequest sessions_get_event_file_path_result: SessionsGetEventFilePathResult sessions_get_last_for_context_request: SessionsGetLastForContextRequest @@ -38275,6 +38407,7 @@ def from_dict(obj: Any) -> 'RPC': catalog_unsafe_retrieval_error = CatalogUnsafeRetrievalError.from_dict(obj.get("CatalogUnsafeRetrievalError")) catalog_unsafe_retrieval_reason = CatalogUnsafeRetrievalReason(obj.get("CatalogUnsafeRetrievalReason")) catalog_unsupported_kind_error = CatalogUnsupportedKindError.from_dict(obj.get("CatalogUnsupportedKindError")) + client_metadata = from_dict(from_str, obj.get("ClientMetadata")) client_task_cancel_reason = ClientTaskCancelReason(obj.get("ClientTaskCancelReason")) client_task_cancel_request = ClientTaskCancelRequest.from_dict(obj.get("ClientTaskCancelRequest")) client_task_cancel_result = ClientTaskCancelResult.from_dict(obj.get("ClientTaskCancelResult")) @@ -38677,6 +38810,7 @@ def from_dict(obj: Any) -> 'RPC': metadata_snapshot_remote_metadata = MetadataSnapshotRemoteMetadata.from_dict(obj.get("MetadataSnapshotRemoteMetadata")) metadata_snapshot_remote_metadata_repository = MetadataSnapshotRemoteMetadataRepository.from_dict(obj.get("MetadataSnapshotRemoteMetadataRepository")) metadata_snapshot_remote_metadata_task_type = TaskType(obj.get("MetadataSnapshotRemoteMetadataTaskType")) + metadata_update_client_metadata_request = MetadataUpdateClientMetadataRequest.from_dict(obj.get("MetadataUpdateClientMetadataRequest")) model = Model.from_dict(obj.get("Model")) model_apply_startup_overlay_request = ModelApplyStartupOverlayRequest.from_dict(obj.get("ModelApplyStartupOverlayRequest")) model_billing = ModelBilling.from_dict(obj.get("ModelBilling")) @@ -39097,6 +39231,7 @@ def from_dict(obj: Any) -> 'RPC': sessions_bulk_delete_request = SessionsBulkDeleteRequest.from_dict(obj.get("SessionsBulkDeleteRequest")) sessions_check_in_use_request = SessionsCheckInUseRequest.from_dict(obj.get("SessionsCheckInUseRequest")) sessions_check_in_use_result = SessionsCheckInUseResult.from_dict(obj.get("SessionsCheckInUseResult")) + sessions_client_metadata_entry = SessionsClientMetadataEntry.from_dict(obj.get("SessionsClientMetadataEntry")) sessions_close_request = SessionsCloseRequest.from_dict(obj.get("SessionsCloseRequest")) sessions_close_result = SessionsCloseResult.from_dict(obj.get("SessionsCloseResult")) sessions_delete_request = SessionsDeleteRequest.from_dict(obj.get("SessionsDeleteRequest")) @@ -39121,6 +39256,8 @@ def from_dict(obj: Any) -> 'RPC': sessions_fork_result = SessionsForkResult.from_dict(obj.get("SessionsForkResult")) sessions_get_board_entry_count_request = SessionsGetBoardEntryCountRequest.from_dict(obj.get("SessionsGetBoardEntryCountRequest")) sessions_get_board_entry_count_result = SessionsGetBoardEntryCountResult.from_dict(obj.get("SessionsGetBoardEntryCountResult")) + sessions_get_client_metadata_request = SessionsGetClientMetadataRequest.from_dict(obj.get("SessionsGetClientMetadataRequest")) + sessions_get_client_metadata_result = from_list(SessionsClientMetadataEntry.from_dict, obj.get("SessionsGetClientMetadataResult")) sessions_get_event_file_path_request = SessionsGetEventFilePathRequest.from_dict(obj.get("SessionsGetEventFilePathRequest")) sessions_get_event_file_path_result = SessionsGetEventFilePathResult.from_dict(obj.get("SessionsGetEventFilePathResult")) sessions_get_last_for_context_request = SessionsGetLastForContextRequest.from_dict(obj.get("SessionsGetLastForContextRequest")) @@ -39376,7 +39513,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, autopilot_objective_credit_limit, autopilot_objective_get_state_result, autopilot_objective_state, autopilot_objective_status, 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, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, 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_pause_checkpoint_action, factory_pause_checkpoint_request, factory_pause_checkpoint_result, factory_pause_info, factory_pause_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, json_schema_response_format, 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_allowed_models_request, model_set_allowed_models_result, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, 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_install_staging_mode, 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, response_format, 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_disable_for_session_request, sandbox_disable_for_session_result, 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_factory_pause_at_checkpoint_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, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, 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_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, 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_register_request, tasks_register_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_update_request, tasks_update_result, 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, autopilot_objective_credit_limit, autopilot_objective_get_state_result, autopilot_objective_state, autopilot_objective_status, 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, client_metadata, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, 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_pause_checkpoint_action, factory_pause_checkpoint_request, factory_pause_checkpoint_result, factory_pause_info, factory_pause_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, json_schema_response_format, 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, metadata_update_client_metadata_request, 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_allowed_models_request, model_set_allowed_models_result, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, 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_install_staging_mode, 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, response_format, 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_disable_for_session_request, sandbox_disable_for_session_result, 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_factory_pause_at_checkpoint_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_client_metadata_entry, 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_client_metadata_request, sessions_get_client_metadata_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, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, 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_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, 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_register_request, tasks_register_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_update_request, tasks_update_result, 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 = {} @@ -39507,6 +39644,7 @@ def to_dict(self) -> dict: result["CatalogUnsafeRetrievalError"] = to_class(CatalogUnsafeRetrievalError, self.catalog_unsafe_retrieval_error) result["CatalogUnsafeRetrievalReason"] = to_enum(CatalogUnsafeRetrievalReason, self.catalog_unsafe_retrieval_reason) result["CatalogUnsupportedKindError"] = to_class(CatalogUnsupportedKindError, self.catalog_unsupported_kind_error) + result["ClientMetadata"] = from_dict(from_str, self.client_metadata) result["ClientTaskCancelReason"] = to_enum(ClientTaskCancelReason, self.client_task_cancel_reason) result["ClientTaskCancelRequest"] = to_class(ClientTaskCancelRequest, self.client_task_cancel_request) result["ClientTaskCancelResult"] = to_class(ClientTaskCancelResult, self.client_task_cancel_result) @@ -39909,6 +40047,7 @@ def to_dict(self) -> dict: result["MetadataSnapshotRemoteMetadata"] = to_class(MetadataSnapshotRemoteMetadata, self.metadata_snapshot_remote_metadata) result["MetadataSnapshotRemoteMetadataRepository"] = to_class(MetadataSnapshotRemoteMetadataRepository, self.metadata_snapshot_remote_metadata_repository) result["MetadataSnapshotRemoteMetadataTaskType"] = to_enum(TaskType, self.metadata_snapshot_remote_metadata_task_type) + result["MetadataUpdateClientMetadataRequest"] = to_class(MetadataUpdateClientMetadataRequest, self.metadata_update_client_metadata_request) result["Model"] = to_class(Model, self.model) result["ModelApplyStartupOverlayRequest"] = to_class(ModelApplyStartupOverlayRequest, self.model_apply_startup_overlay_request) result["ModelBilling"] = to_class(ModelBilling, self.model_billing) @@ -40329,6 +40468,7 @@ def to_dict(self) -> dict: result["SessionsBulkDeleteRequest"] = to_class(SessionsBulkDeleteRequest, self.sessions_bulk_delete_request) result["SessionsCheckInUseRequest"] = to_class(SessionsCheckInUseRequest, self.sessions_check_in_use_request) result["SessionsCheckInUseResult"] = to_class(SessionsCheckInUseResult, self.sessions_check_in_use_result) + result["SessionsClientMetadataEntry"] = to_class(SessionsClientMetadataEntry, self.sessions_client_metadata_entry) result["SessionsCloseRequest"] = to_class(SessionsCloseRequest, self.sessions_close_request) result["SessionsCloseResult"] = to_class(SessionsCloseResult, self.sessions_close_result) result["SessionsDeleteRequest"] = to_class(SessionsDeleteRequest, self.sessions_delete_request) @@ -40353,6 +40493,8 @@ def to_dict(self) -> dict: result["SessionsForkResult"] = to_class(SessionsForkResult, self.sessions_fork_result) result["SessionsGetBoardEntryCountRequest"] = to_class(SessionsGetBoardEntryCountRequest, self.sessions_get_board_entry_count_request) result["SessionsGetBoardEntryCountResult"] = to_class(SessionsGetBoardEntryCountResult, self.sessions_get_board_entry_count_result) + result["SessionsGetClientMetadataRequest"] = to_class(SessionsGetClientMetadataRequest, self.sessions_get_client_metadata_request) + result["SessionsGetClientMetadataResult"] = from_list(lambda x: to_class(SessionsClientMetadataEntry, x), self.sessions_get_client_metadata_result) result["SessionsGetEventFilePathRequest"] = to_class(SessionsGetEventFilePathRequest, self.sessions_get_event_file_path_request) result["SessionsGetEventFilePathResult"] = to_class(SessionsGetEventFilePathResult, self.sessions_get_event_file_path_result) result["SessionsGetLastForContextRequest"] = to_class(SessionsGetLastForContextRequest, self.sessions_get_last_for_context_request) @@ -40973,6 +41115,7 @@ def _load_TaskInfo(obj: Any) -> "TaskInfo": CardDigestValue = str CatalogCapabilityId = str CatalogMcpServerInstallability = CatalogMCPServerInstallabilityEnum +ClientMetadata = dict CommandsListRequest = Any ExternalToolResult = ExternalToolTextResultForLlm ExternalToolTextResultForLlmContentResourceLinkIconTheme = Theme @@ -41034,6 +41177,7 @@ def _load_TaskInfo(obj: Any) -> "TaskInfo": SessionOpenOptionsAdditionalContentExclusionPolicyScope = AdditionalContentExclusionPolicyScope SessionOpenOptionsEnvValueMode = MCPSetEnvValueModeDetails SessionOpenOptionsReasoningSummary = ReasoningSummary +SessionsGetClientMetadataResult = list SessionsOpenHandoffTaskType = TaskType SessionWorkingDirectoryContextHostType = HostType TaskInfoExecutionMode = TaskExecutionMode @@ -41497,6 +41641,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 get_client_metadata(self, params: SessionsGetClientMetadataRequest, *, timeout: float | None = None) -> list: + "Reads client-owned metadata for multiple persisted local sessions without opening them. Results preserve request order and report missing, corrupt, unsupported, or temporarily unavailable sessions independently.\n\nArgs:\n params: Bounded batch request for client-owned metadata from persisted local sessions.\n\nReturns:\n Ordered client metadata outcomes for the requested local sessions." + params_dict = {k: v for k, v in params.to_dict().items() if v is not None} + return list(await self._client.request("sessions.getClientMetadata", 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} @@ -42618,7 +42767,7 @@ async def set(self, params: ToolsSetRequest, *, timeout: float | None = None) -> return ToolsSetResult.from_dict(await self._client.request("session.tools.set", params_dict, **_timeout_kwargs(timeout))) async def update_subagent_settings(self, params: UpdateSubagentSettingsRequest, *, timeout: float | None = None) -> ToolsUpdateSubagentSettingsResult: - "Updates the current session's live subagent settings after user settings change. The persisted user settings remain the source of truth for future sessions.\n\nArgs:\n params: Subagent settings to apply to the current session\n\nReturns:\n Empty result after applying subagent settings" + "Sets the current session's live subagent settings override, which takes precedence over persisted user settings until cleared. Persisted user settings remain the source of truth for future sessions.\n\nArgs:\n params: Subagent settings to apply to the current session\n\nReturns:\n Empty result after applying subagent settings" params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return ToolsUpdateSubagentSettingsResult.from_dict(await self._client.request("session.tools.updateSubagentSettings", params_dict, **_timeout_kwargs(timeout))) @@ -42918,6 +43067,16 @@ async def snapshot(self, *, timeout: float | None = None) -> SessionMetadataSnap "Returns a snapshot of the session's identifying metadata, mode, agent, and remote info.\n\nReturns:\n Point-in-time snapshot of slow-changing session identifier and state fields" return SessionMetadataSnapshot.from_dict(await self._client.request("session.metadata.snapshot", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + async def get_client_metadata(self, *, timeout: float | None = None) -> dict: + "Returns the client-owned string metadata persisted with this local session. The metadata is not included in model context, events, telemetry, snapshots, or remote exports.\n\nReturns:\n Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values." + return dict(await self._client.request("session.metadata.getClientMetadata", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def update_client_metadata(self, params: MetadataUpdateClientMetadataRequest, *, timeout: float | None = None) -> dict: + "Atomically patches the client-owned string metadata persisted with this local session and returns the committed bag.\n\nArgs:\n params: Atomic patch for client-owned session metadata. Operations apply in clear, remove, then set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size limits. Local storage coordinates concurrent runtime processes; custom SessionFs providers must serialize writers that access the same session from multiple processes.\n\nReturns:\n Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return dict(await self._client.request("session.metadata.updateClientMetadata", params_dict, **_timeout_kwargs(timeout))) + async def is_processing(self, *, timeout: float | None = None) -> MetadataIsProcessingResult: "Reports whether the local session is currently processing user/agent messages.\n\nReturns:\n Indicates whether the local session is currently processing a turn or background continuation." return MetadataIsProcessingResult.from_dict(await self._client.request("session.metadata.isProcessing", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -43636,7 +43795,7 @@ async def write_file(self, params: SessionFSWriteFileRequest) -> SessionFSError "Writes a file in the client-provided session filesystem.\n\nArgs:\n params: File path, content to write, and optional mode for the client-provided session filesystem.\n\nReturns:\n Describes a filesystem error." pass async def append_file(self, params: SessionFSAppendFileRequest) -> SessionFSError | None: - "Appends content to a file in the client-provided session filesystem.\n\nArgs:\n params: File path, content to append, and optional mode for the client-provided session filesystem.\n\nReturns:\n Describes a filesystem error." + "Appends content to a file in the client-provided session filesystem, creating parent directories as needed.\n\nArgs:\n params: File path, content to append, and optional mode for the client-provided session filesystem. Implementations create parent directories as needed.\n\nReturns:\n Describes a filesystem error." pass async def exists(self, params: SessionFSExistsRequest) -> SessionFSExistsResult: "Checks whether a path exists in the client-provided session filesystem.\n\nArgs:\n params: Path to test for existence in the client-provided session filesystem.\n\nReturns:\n Indicates whether the requested path exists in the client-provided session filesystem." @@ -44094,6 +44253,7 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "CatalogUnsupportedKindErrorKind", "Categories", "ClientGlobalApiHandlers", + "ClientMetadata", "ClientSessionApiHandlers", "ClientTaskCancelReason", "ClientTaskCancelRequest", @@ -44410,6 +44570,7 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "MCPOauthProbeNeedsAuthReason", "MCPOauthProbeRequest", "MCPOauthProbeResult", + "MCPOauthProbeResultStatus", "MCPOauthRespondRequest", "MCPOauthRespondResult", "MCPPlan", @@ -44558,6 +44719,7 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "MetadataSnapshotRemoteMetadata", "MetadataSnapshotRemoteMetadataRepository", "MetadataSnapshotRemoteMetadataTaskType", + "MetadataUpdateClientMetadataRequest", "ModeApi", "ModeSetRequest", "ModeSetResult", @@ -45099,6 +45261,8 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "SessionsBulkDeleteRequest", "SessionsCheckInUseRequest", "SessionsCheckInUseResult", + "SessionsClientMetadataEntry", + "SessionsClientMetadataEntryStatus", "SessionsCloseRequest", "SessionsCloseResult", "SessionsDeleteRequest", @@ -45111,6 +45275,8 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "SessionsForkResult", "SessionsGetBoardEntryCountRequest", "SessionsGetBoardEntryCountResult", + "SessionsGetClientMetadataRequest", + "SessionsGetClientMetadataResult", "SessionsGetEventFilePathRequest", "SessionsGetEventFilePathResult", "SessionsGetLastForContextRequest", @@ -45217,7 +45383,6 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "SlashCommandShowDialogResultKind", "SlashCommandTextResult", "SlashCommandTimelineEntry", - "Status", "SubagentSettings", "SubagentSettingsEntry", "SubagentSettingsEntryContextTier", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index ba9c627e9e..a893d68fd6 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -2448,7 +2448,6 @@ class AssistantMessageData: # Experimental: this field is part of an experimental API and may change or be removed. fusion: FusionAttribution | None = None interaction_id: str | None = None - is_final_reply: bool | None = None model: str | None = None originating_message_id: str | None = None output_tokens: int | None = None @@ -2479,7 +2478,6 @@ def from_dict(obj: Any) -> "AssistantMessageData": encrypted_content = from_union([from_none, from_str], obj.get("encryptedContent")) fusion = from_union([from_none, FusionAttribution.from_dict], obj.get("fusion")) interaction_id = from_union([from_none, from_str], obj.get("interactionId")) - is_final_reply = from_union([from_none, from_bool], obj.get("isFinalReply")) model = from_union([from_none, from_str], obj.get("model")) originating_message_id = from_union([from_none, from_str], obj.get("originatingMessageId")) output_tokens = from_union([from_none, from_int], obj.get("outputTokens")) @@ -2506,7 +2504,6 @@ def from_dict(obj: Any) -> "AssistantMessageData": encrypted_content=encrypted_content, fusion=fusion, interaction_id=interaction_id, - is_final_reply=is_final_reply, model=model, originating_message_id=originating_message_id, output_tokens=output_tokens, @@ -2544,8 +2541,6 @@ def to_dict(self) -> dict: result["fusion"] = from_union([from_none, lambda x: to_class(FusionAttribution, x)], self.fusion) if self.interaction_id is not None: result["interactionId"] = from_union([from_none, from_str], self.interaction_id) - if self.is_final_reply is not None: - result["isFinalReply"] = from_union([from_none, from_bool], self.is_final_reply) if self.model is not None: result["model"] = from_union([from_none, from_str], self.model) if self.originating_message_id is not None: @@ -9733,6 +9728,7 @@ class SubagentCompletedData: first_dispatched_model: str | None = None model: str | None = None model_override_reason: str | None = None + model_selection_source: SubagentModelSelectionSource | None = None total_tokens: int | None = None total_tool_calls: int | None = None @@ -9751,6 +9747,7 @@ def from_dict(obj: Any) -> "SubagentCompletedData": 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")) + model_selection_source = from_union([from_none, lambda x: parse_enum(SubagentModelSelectionSource, x)], obj.get("modelSelectionSource")) 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( @@ -9766,6 +9763,7 @@ def from_dict(obj: Any) -> "SubagentCompletedData": first_dispatched_model=first_dispatched_model, model=model, model_override_reason=model_override_reason, + model_selection_source=model_selection_source, total_tokens=total_tokens, total_tool_calls=total_tool_calls, ) @@ -9793,6 +9791,8 @@ def to_dict(self) -> dict: 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.model_selection_source is not None: + result["modelSelectionSource"] = from_union([from_none, lambda x: to_enum(SubagentModelSelectionSource, x)], self.model_selection_source) 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: @@ -9860,6 +9860,7 @@ class SubagentFailedData: first_dispatched_model: str | None = None model: str | None = None model_override_reason: str | None = None + model_selection_source: SubagentModelSelectionSource | None = None total_tokens: int | None = None total_tool_calls: int | None = None @@ -9878,6 +9879,7 @@ def from_dict(obj: Any) -> "SubagentFailedData": 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")) + model_selection_source = from_union([from_none, lambda x: parse_enum(SubagentModelSelectionSource, x)], obj.get("modelSelectionSource")) 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( @@ -9893,6 +9895,7 @@ def from_dict(obj: Any) -> "SubagentFailedData": first_dispatched_model=first_dispatched_model, model=model, model_override_reason=model_override_reason, + model_selection_source=model_selection_source, total_tokens=total_tokens, total_tool_calls=total_tool_calls, ) @@ -9919,6 +9922,8 @@ def to_dict(self) -> dict: 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.model_selection_source is not None: + result["modelSelectionSource"] = from_union([from_none, lambda x: to_enum(SubagentModelSelectionSource, x)], self.model_selection_source) 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: @@ -12815,6 +12820,24 @@ class SkillSource(Enum): SDK = "sdk" +class SubagentModelSelectionSource(Enum): + "Authority or runtime mechanism responsible for sub-agent model selection." + # Explicit model supplied by the parent agent on the task call and selected for dispatch. + EXPLICIT_OVERRIDE = "explicit_override" + # Required model policy configured for the sub-agent. + CONFIGURED_REQUIRED = "configured_required" + # Non-required model preference configured for the sub-agent. + CONFIGURED_PREFERENCE = "configured_preference" + # Complementary-model default selected for the sub-agent. + COMPLEMENTARY_DEFAULT = "complementary_default" + # Model inherited from the parent session. + SESSION_INHERITANCE = "session_inheritance" + # Default model declared by the agent definition. + AGENT_DEFINITION_DEFAULT = "agent_definition_default" + # Runtime policy, Auto mode, or an experiment selected the model. + RUNTIME_POLICY = "runtime_policy" + + class SubagentTaskModelSource(Enum): "Where the model input for a task-tool sub-agent came from." # The spawning agent supplied the task tool's model argument. @@ -13470,6 +13493,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SubagentConfiguredData", "SubagentDeselectedData", "SubagentFailedData", + "SubagentModelSelectionSource", "SubagentSelectedData", "SubagentStartedData", "SubagentTaskModelSource", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index fd0a1c8835..194532c6c5 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -146,6 +146,8 @@ pub mod rpc_methods { pub const SESSIONS_LIST: &str = "sessions.list"; /// `sessions.getMetadata` pub const SESSIONS_GETMETADATA: &str = "sessions.getMetadata"; + /// `sessions.getClientMetadata` + pub const SESSIONS_GETCLIENTMETADATA: &str = "sessions.getClientMetadata"; /// `sessions.readPersistedEvents` pub const SESSIONS_READPERSISTEDEVENTS: &str = "sessions.readPersistedEvents"; /// `sessions.listNonEmptySessionIds` @@ -630,6 +632,10 @@ pub mod rpc_methods { pub const SESSION_LOG: &str = "session.log"; /// `session.metadata.snapshot` pub const SESSION_METADATA_SNAPSHOT: &str = "session.metadata.snapshot"; + /// `session.metadata.getClientMetadata` + pub const SESSION_METADATA_GETCLIENTMETADATA: &str = "session.metadata.getClientMetadata"; + /// `session.metadata.updateClientMetadata` + pub const SESSION_METADATA_UPDATECLIENTMETADATA: &str = "session.metadata.updateClientMetadata"; /// `session.metadata.isProcessing` pub const SESSION_METADATA_ISPROCESSING: &str = "session.metadata.isProcessing"; /// `session.metadata.activity` @@ -10181,6 +10187,28 @@ pub struct MetadataSnapshotRemoteMetadata { pub task_type: Option, } +/// Atomic patch for client-owned session metadata. Operations apply in clear, remove, then set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size limits. Local storage coordinates concurrent runtime processes; custom SessionFs providers must serialize writers that access the same session from multiple processes. +/// +///

+/// +/// **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 MetadataUpdateClientMetadataRequest { + /// Remove every existing client metadata entry before applying remove and set. Defaults to false. + #[serde(skip_serializing_if = "Option::is_none")] + pub clear: Option, + /// Case-sensitive keys to remove. Missing keys are ignored. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. + #[serde(skip_serializing_if = "Option::is_none")] + pub remove: Option>, + /// String entries to add or replace. Set wins when a key also appears in remove. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Each value may contain at most 16 KiB of UTF-8 data. + #[serde(skip_serializing_if = "Option::is_none")] + pub set: Option>, +} + /// Active server-driven promotion for a model, including its discount and optional expiry. /// ///
@@ -16111,7 +16139,7 @@ pub struct SessionEnrichMetadataResult { pub sessions: Vec, } -/// File path, content to append, and optional mode for the client-provided session filesystem. +/// File path, content to append, and optional mode for the client-provided session filesystem. Implementations create parent directories as needed. /// ///
/// @@ -18261,6 +18289,24 @@ pub struct SessionsGetBoardEntryCountResult { pub count: Option, } +/// Bounded batch request for client-owned metadata from persisted local sessions. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionsGetClientMetadataRequest { + /// Case-sensitive keys to project from each valid bag. Each key must be non-empty, at most 256 UTF-8 bytes, and outside the reserved `copilot/` and `github/` namespaces. Omit to return every entry. + #[serde(skip_serializing_if = "Option::is_none")] + pub keys: Option>, + /// Session IDs to inspect. Results preserve this order. + pub session_ids: Vec, +} + /// Session ID whose event-log file path to compute. /// ///
@@ -19643,7 +19689,7 @@ pub struct SlashCommandSetPlanModelResult { pub runtime_settings_changed: Option, } -/// Subagent model, reasoning effort, and context tier settings +/// Subagent model, reasoning effort, context tier, and auto-invocation settings /// ///
/// @@ -19654,6 +19700,9 @@ pub struct SlashCommandSetPlanModelResult { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SubagentSettingsEntry { + /// Whether this agent's runtime-defined proactive invocation prompting is enabled, if supported. Currently consumed by the built-in rubber-duck agent. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_invoke: Option, /// Context tier override for matching subagents #[serde(skip_serializing_if = "Option::is_none")] pub context_tier: Option, @@ -26799,6 +26848,21 @@ pub struct SessionMetadataSnapshotResult { pub workspace_path: Option, } +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionMetadataGetClientMetadataParams { + /// Target session identifier + pub session_id: SessionId, +} + /// Identifies the target session. /// ///
@@ -28302,6 +28366,16 @@ pub type CardDigestValue = String; ///
pub type CatalogCapabilityId = String; +/// Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+pub type ClientMetadata = HashMap; + /// HTTP headers as a map from lowercased header name to a list of values. Multi-valued headers (e.g. Set-Cookie) preserve all values. /// ///
@@ -28332,6 +28406,16 @@ pub type McpExecuteSamplingResult = HashMap; ///
pub type McpPlanSecretReference = String; +/// Ordered client metadata outcomes for the requested local sessions. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+pub type SessionsGetClientMetadataResult = Vec; + /// The form values submitted by the user (present when action is 'accept') /// ///
@@ -28412,6 +28496,26 @@ pub type SessionGitHubAuthLastAuthErrorsResult = Vec; ///
pub type SessionMcpAppsCallToolResult = HashMap; +/// Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+pub type SessionMetadataGetClientMetadataResult = HashMap; + +/// Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+pub type SessionMetadataUpdateClientMetadataResult = HashMap; + /// Authentication host. HMAC auth always targets the public GitHub host. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum HMACAuthInfoHost { diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 4e19060fe4..789514b708 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -1952,6 +1952,37 @@ impl<'a> ClientRpcSessions<'a> { Ok(serde_json::from_value(_value)?) } + /// Reads client-owned metadata for multiple persisted local sessions without opening them. Results preserve request order and report missing, corrupt, unsupported, or temporarily unavailable sessions independently. + /// + /// Wire method: `sessions.getClientMetadata`. + /// + /// # Parameters + /// + /// * `params` - Bounded batch request for client-owned metadata from persisted local sessions. + /// + /// # Returns + /// + /// Ordered client metadata outcomes for the requested local sessions. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn get_client_metadata( + &self, + params: SessionsGetClientMetadataRequest, + ) -> Result { + let wire_params = serde_json::to_value(params)?; + let _value = self + .client + .call(rpc_methods::SESSIONS_GETCLIENTMETADATA, Some(wire_params)) + .await?; + 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`. @@ -7230,6 +7261,70 @@ impl<'a> SessionRpcMetadata<'a> { Ok(serde_json::from_value(_value)?) } + /// Returns the client-owned string metadata persisted with this local session. The metadata is not included in model context, events, telemetry, snapshots, or remote exports. + /// + /// Wire method: `session.metadata.getClientMetadata`. + /// + /// # Returns + /// + /// Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn get_client_metadata(&self) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_METADATA_GETCLIENTMETADATA, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Atomically patches the client-owned string metadata persisted with this local session and returns the committed bag. + /// + /// Wire method: `session.metadata.updateClientMetadata`. + /// + /// # Parameters + /// + /// * `params` - Atomic patch for client-owned session metadata. Operations apply in clear, remove, then set order. The resulting bag must satisfy the ClientMetadata entry and serialized-size limits. Local storage coordinates concurrent runtime processes; custom SessionFs providers must serialize writers that access the same session from multiple processes. + /// + /// # Returns + /// + /// Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values. + /// + ///
+ /// + /// **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 update_client_metadata( + &self, + params: MetadataUpdateClientMetadataRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_METADATA_UPDATECLIENTMETADATA, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Reports whether the local session is currently processing user/agent messages. /// /// Wire method: `session.metadata.isProcessing`. @@ -11106,7 +11201,7 @@ impl<'a> SessionRpcTools<'a> { Ok(serde_json::from_value(_value)?) } - /// Updates the current session's live subagent settings after user settings change. The persisted user settings remain the source of truth for future sessions. + /// Sets the current session's live subagent settings override, which takes precedence over persisted user settings until cleared. Persisted user settings remain the source of truth for future sessions. /// /// Wire method: `session.tools.updateSubagentSettings`. /// diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index 9c730950b5..ea672dbe20 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -2875,15 +2875,12 @@ pub struct AssistantMessageData { /// CAPI interaction ID for correlating this message with upstream telemetry #[serde(skip_serializing_if = "Option::is_none")] pub interaction_id: Option, - /// True when this is the last assistant reply for the originatingMessageId. Does not indicate successful completion of hooks or cleanup; session.error or abort events may still follow. - #[serde(skip_serializing_if = "Option::is_none")] - pub is_final_reply: Option, /// Unique identifier for this assistant message pub message_id: String, /// Model that produced this assistant message, if known #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, - /// Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations and steering messages. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. + /// Logical ID of the primary user message that initiated this run, matching the messageId returned by session.send (or the last messageId of session.sendMessages). Stable across model/tool iterations, steering messages, and stop-hook corrections. Subagent runs use their own initiating message ID, not the parent's. Absent for runs without an associated initiating message, such as empty batches. #[serde(skip_serializing_if = "Option::is_none")] pub originating_message_id: Option, /// Actual output token count from the API response (completion_tokens), used for accurate token accounting @@ -4247,6 +4244,9 @@ pub struct SubagentCompletedData { /// Why an explicit task-call model did not become the effective model #[serde(skip_serializing_if = "Option::is_none")] pub model_override_reason: Option, + /// Authority or runtime mechanism responsible for sub-agent model selection + #[serde(skip_serializing_if = "Option::is_none")] + pub model_selection_source: 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 @@ -4291,6 +4291,9 @@ pub struct SubagentFailedData { /// Why an explicit task-call model did not become the effective model #[serde(skip_serializing_if = "Option::is_none")] pub model_override_reason: Option, + /// Authority or runtime mechanism responsible for sub-agent model selection + #[serde(skip_serializing_if = "Option::is_none")] + pub model_selection_source: 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 @@ -7821,6 +7824,36 @@ pub enum SubagentTaskModelSource { Unknown, } +/// Authority or runtime mechanism responsible for sub-agent model selection. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum SubagentModelSelectionSource { + /// Explicit model supplied by the parent agent on the task call and selected for dispatch. + #[serde(rename = "explicit_override")] + ExplicitOverride, + /// Required model policy configured for the sub-agent. + #[serde(rename = "configured_required")] + ConfiguredRequired, + /// Non-required model preference configured for the sub-agent. + #[serde(rename = "configured_preference")] + ConfiguredPreference, + /// Complementary-model default selected for the sub-agent. + #[serde(rename = "complementary_default")] + ComplementaryDefault, + /// Model inherited from the parent session. + #[serde(rename = "session_inheritance")] + SessionInheritance, + /// Default model declared by the agent definition. + #[serde(rename = "agent_definition_default")] + AgentDefinitionDefault, + /// Runtime policy, Auto mode, or an experiment selected the model. + #[serde(rename = "runtime_policy")] + RuntimePolicy, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Binary asset type discriminator. Use "image" for images and "resource" otherwise. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum BinaryAssetType { diff --git a/test/snapshots/structured_output_dotnet/concurrent_typed_sends_return_their_own_results.yaml b/test/snapshots/structured_output/concurrent_typed_sends_return_their_own_results.yaml similarity index 100% rename from test/snapshots/structured_output_dotnet/concurrent_typed_sends_return_their_own_results.yaml rename to test/snapshots/structured_output/concurrent_typed_sends_return_their_own_results.yaml diff --git a/test/snapshots/structured_output_dotnet/infers_typed_result_after_custom_tool.yaml b/test/snapshots/structured_output/infers_typed_result_after_custom_tool.yaml similarity index 100% rename from test/snapshots/structured_output_dotnet/infers_typed_result_after_custom_tool.yaml rename to test/snapshots/structured_output/infers_typed_result_after_custom_tool.yaml diff --git a/test/snapshots/structured_output/node_send_exposes_final_reply_before_stop_hook_completes.yaml b/test/snapshots/structured_output/node_send_selects_correlated_response_after_idle.yaml similarity index 100% rename from test/snapshots/structured_output/node_send_exposes_final_reply_before_stop_hook_completes.yaml rename to test/snapshots/structured_output/node_send_selects_correlated_response_after_idle.yaml diff --git a/test/snapshots/structured_output_dotnet/send_exposes_final_reply_before_stop_hook_completes.yaml b/test/snapshots/structured_output/send_selects_correlated_response_after_idle.yaml similarity index 100% rename from test/snapshots/structured_output_dotnet/send_exposes_final_reply_before_stop_hook_completes.yaml rename to test/snapshots/structured_output/send_selects_correlated_response_after_idle.yaml diff --git a/test/snapshots/structured_output_dotnet/sends_explicit_schema_for_message_and_batch.yaml b/test/snapshots/structured_output/sends_explicit_schema_for_message_and_batch.yaml similarity index 100% rename from test/snapshots/structured_output_dotnet/sends_explicit_schema_for_message_and_batch.yaml rename to test/snapshots/structured_output/sends_explicit_schema_for_message_and_batch.yaml diff --git a/test/snapshots/structured_output/typed_wait_returns_stop_hook_correction.yaml b/test/snapshots/structured_output/typed_wait_returns_stop_hook_correction.yaml new file mode 100644 index 0000000000..5f6e6483c4 --- /dev/null +++ b/test/snapshots/structured_output/typed_wait_returns_stop_hook_correction.yaml @@ -0,0 +1,14 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: What is 19 + 23? Do not use tools. + - role: assistant + content: '{"answer":42}' + - role: user + content: Correct the answer to 99, not 42. Do not use tools. + - role: assistant + content: '{"answer":99}' From 8b6006bc3d99116f7c27d0c18f169036465a6494 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 10 Sep 2026 20:45:23 +0000 Subject: [PATCH 6/7] Align Node and C# structured output with the latest runtime Refresh batch contracts, cover late steering with a shared provider capture, and reject malformed typed-wait arguments instead of sending unformatted requests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/README.md | 20 ++++++-- dotnet/src/Generated/Rpc.cs | 6 +-- dotnet/src/Session.cs | 3 +- dotnet/src/Types.cs | 5 +- dotnet/test/E2E/StructuredOutputE2ETests.cs | 44 +++++++++++++++++ go/rpc/zrpc.go | 14 ++++-- .../rpc/SessionSendMessagesParams.java | 2 +- .../rpc/SessionSendMessagesResult.java | 2 +- nodejs/README.md | 14 +++++- nodejs/src/generated/rpc.ts | 4 +- nodejs/src/session.ts | 11 ++++- nodejs/src/types.ts | 6 ++- nodejs/test/e2e/structured_output.e2e.test.ts | 47 +++++++++++++++++++ nodejs/test/structured-output.test.ts | 12 +++++ python/copilot/generated/rpc.py | 14 ++++-- rust/src/generated/api_types.rs | 6 +-- ...d_wait_returns_late_steering_response.yaml | 14 ++++++ 17 files changed, 193 insertions(+), 31 deletions(-) create mode 100644 test/snapshots/structured_output/typed_wait_returns_late_steering_response.yaml diff --git a/dotnet/README.md b/dotnet/README.md index 9e56212ce8..e6001dd723 100644 --- a/dotnet/README.md +++ b/dotnet/README.md @@ -335,8 +335,8 @@ correlation as typed waits; unformatted waits retain their existing behavior. With `SendAsync`, collect root `AssistantMessageEvent` events whose `Data.OriginatingMessageId` matches the returned message ID, then select the last -one when the session becomes idle. Subscribe before sending because events can -precede the send acknowledgement, and handle `SessionErrorEvent` normally. +one without tool requests when the session becomes idle. Subscribe before sending +because events can precede the send acknowledgement, and handle `SessionErrorEvent` normally. There is no final-message flag: stop hooks can reject an initial answer and request a correction. Those corrections retain the original schema and originating message ID, so `SendAndWaitAsync` selects the corrected response at @@ -382,9 +382,19 @@ await session.Rpc.SendMessagesAsync( Raw schemas and outputs are passed through without validation or rewriting. Provider support and schema restrictions apply. The format persists through -tool continuations in that turn, not subsequent turns. An ordinary -`Mode = "immediate"` steering message inherits the active format; specifying -a new format on an immediate message is rejected. +tool continuations in that run, not independent subsequent runs. An ordinary +`Mode = "immediate"` steering message inherits the active format and originating +message ID, even if it arrives after the final model request and is promoted +into a follow-up run. Specifying a new format on an immediate message is rejected, +even while idle. +Each batch starts one run: the final returned message ID is its origin, preceding +messages are context, and an empty batch has no origin. An immediate batch +steers the active run instead and retains its origin. +The schema is not a persisted session default: autonomous resume-pending work +after a restart does not restore it. A terminal tool that clears context ends +the old run; its fresh seed does not inherit the schema or origin. Such a run +can finish without a structured result, in which case the typed wait throws. +Remote sessions and HydraFusion routes reject response formats. Use a provider route that enforces JSON Schema: an API-compatible gateway can ignore unsupported format fields, and the Claude Chat-completions compatibility route is not equivalent to Anthropic's native Messages endpoint. This preview diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index 8cf1957eba..8de5a69c24 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -5482,7 +5482,7 @@ internal sealed class SendRequest [Experimental(Diagnostics.Experimental)] public sealed class SendMessagesResult { - /// Unique identifiers assigned to the messages, one per provided message in order. Empty when no messages were provided. + /// Unique identifiers assigned to the messages, one per provided message in order. For a batch that starts a run, assistant messages use the final ID as originatingMessageId throughout that run, including tool iterations and stop-hook corrections. Immediate steering does not replace the active run's origin. Empty when no messages were provided; that run has no originatingMessageId. [JsonPropertyName("messageIds")] public IList MessageIds { get => field ??= []; set; } } @@ -5527,7 +5527,7 @@ internal sealed class SendMessagesRequest [JsonPropertyName("agentMode")] public SendAgentMode? AgentMode { get; set; } - /// The user messages to append to the conversation, in order. May be empty, in which case a single turn runs over the existing history with no new user message. + /// The user messages to append to the conversation, in order, before running one agent loop. When the batch starts a run, its final message is the primary initiating message; earlier messages provide context, not separate runs or replies. May be empty, in which case a single turn runs over the existing history with no new user message or originatingMessageId. [JsonPropertyName("messages")] public IList Messages { get => field ??= []; set; } @@ -33489,7 +33489,7 @@ public async Task SendAsync(string prompt, string? displayPrompt = n } /// Sends zero or more user messages to the session in a single turn and returns their message IDs. All provided messages are appended to the conversation in order, then exactly one agent turn runs over the resulting history. When the list is empty, one turn runs over the existing history with no new user message. Remote-backed (Mission Control) sessions do not support this method and will return an error. - /// The user messages to append to the conversation, in order. May be empty, in which case a single turn runs over the existing history with no new user message. + /// The user messages to append to the conversation, in order, before running one agent loop. When the batch starts a run, its final message is the primary initiating message; earlier messages provide context, not separate runs or replies. May be empty, in which case a single turn runs over the existing history with no new user message or originatingMessageId. /// How to deliver the messages. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn. /// If true, adds the messages to the front of the queue instead of the end. /// The UI mode the agent was in when these messages were sent. Defaults to the session's current mode. diff --git a/dotnet/src/Session.cs b/dotnet/src/Session.cs index 0912bbbfbd..df8c951068 100644 --- a/dotnet/src/Session.cs +++ b/dotnet/src/Session.cs @@ -289,7 +289,8 @@ public Task SendAsync(string prompt, CancellationToken cancellationToken /// /// Options for the message to be sent, including the prompt and optional attachments. /// A that can be used to cancel the operation. - /// A task that resolves with the ID of the response message, which can be used to correlate events. + /// The submitted user message's ID, not an assistant response ID. When this send starts + /// a run, root assistant messages carry it as OriginatingMessageId. /// Thrown if the session has been disposed. /// /// diff --git a/dotnet/src/Types.cs b/dotnet/src/Types.cs index 57d509492d..1f4ed2c69e 100644 --- a/dotnet/src/Types.cs +++ b/dotnet/src/Types.cs @@ -4125,7 +4125,10 @@ private MessageOptions(MessageOptions? other) /// /// Optional provider-native JSON Schema for this turn, including tool continuations. /// The schema is passed unchanged with the name "response" and strict enforcement requested. - /// An immediate steering message inherits the active turn's schema and must not specify its own. + /// Ordinary immediate steering retains the active run's schema and origin even when promoted + /// to a follow-up after the model request finishes. An immediate message must not specify its + /// own schema, even while idle. Independent sends and context resets do not inherit this schema; + /// it is not a persisted session default. /// Use for advanced response-format options. /// [Experimental(Diagnostics.Experimental)] diff --git a/dotnet/test/E2E/StructuredOutputE2ETests.cs b/dotnet/test/E2E/StructuredOutputE2ETests.cs index 2d6f606c2c..a39dbae06a 100644 --- a/dotnet/test/E2E/StructuredOutputE2ETests.cs +++ b/dotnet/test/E2E/StructuredOutputE2ETests.cs @@ -226,6 +226,50 @@ public async Task Typed_Wait_Returns_Stop_Hook_Correction() JsonSerializer.Deserialize(message.Data.Content, StructuredOutputE2EJsonContext.Default.CorrectionResult)!.Answer)); } + [Fact] + public async Task Typed_Wait_Returns_Late_Steering_Response() + { + var stops = 0; + string? steeringId = null; + CopilotSession? session = null; + var config = StructuredSessionConfig(); + config.Hooks = new SessionHooks + { + OnAgentStop = async (_, _) => + { + if (Interlocked.Increment(ref stops) == 1) + { + // The final model request has finished, but this run still admits steering. + steeringId = await session!.SendAsync(new MessageOptions + { + Prompt = "Change the answer to 99. Do not use tools.", + Mode = "immediate", + }); + } + return null; + }, + }; + session = await CreateSessionAsync(config); + var replies = new System.Collections.Concurrent.ConcurrentQueue(); + using var subscription = session.On(message => + { + if (string.IsNullOrEmpty(message.AgentId)) replies.Enqueue(message); + }); + var result = await session.SendAndWaitAsync( + "What is 19 + 23? Do not use tools.", + StructuredOutputE2EJsonContext.Default.Options, + TimeSpan.FromMinutes(3)); + Assert.Equal(99, result.Answer); + Assert.Equal(2, stops); + Assert.Equal(2, replies.Count); + Assert.False(string.IsNullOrEmpty(steeringId)); + Assert.False(string.IsNullOrEmpty(replies.First().Data.OriginatingMessageId)); + Assert.NotEqual(steeringId, replies.First().Data.OriginatingMessageId); + Assert.Equal(replies.First().Data.OriginatingMessageId, replies.Last().Data.OriginatingMessageId); + Assert.Equal([42, 99], replies.Select(message => + JsonSerializer.Deserialize(message.Data.Content, StructuredOutputE2EJsonContext.Default.CorrectionResult)!.Answer)); + } + [Fact] public async Task Concurrent_Typed_Sends_Return_Their_Own_Results() { diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 5357c6cb53..82ba4934bd 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -11033,8 +11033,11 @@ type SendMessagesRequest struct { // The UI mode the agent was in when these messages were sent. Defaults to the session's // current mode. AgentMode *SendAgentMode `json:"agentMode,omitempty"` - // The user messages to append to the conversation, in order. May be empty, in which case a - // single turn runs over the existing history with no new user message. + // The user messages to append to the conversation, in order, before running one agent loop. + // When the batch starts a run, its final message is the primary initiating message; earlier + // messages provide context, not separate runs or replies. May be empty, in which case a + // single turn runs over the existing history with no new user message or + // originatingMessageId. Messages []SendMessageItem `json:"messages"` // How to deliver the messages. `enqueue` (default) appends to the message queue. // `immediate` interjects during an in-progress turn. @@ -11071,8 +11074,11 @@ type SendMessagesRequest struct { // Experimental: SendMessagesResult is part of an experimental API and may change or be // removed. type SendMessagesResult struct { - // Unique identifiers assigned to the messages, one per provided message in order. Empty - // when no messages were provided. + // Unique identifiers assigned to the messages, one per provided message in order. For a + // batch that starts a run, assistant messages use the final ID as originatingMessageId + // throughout that run, including tool iterations and stop-hook corrections. Immediate + // steering does not replace the active run's origin. Empty when no messages were provided; + // that run has no originatingMessageId. MessageIDs []string `json:"messageIds"` } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java index cdec524a1a..9c488a8287 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java @@ -28,7 +28,7 @@ public record SessionSendMessagesParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, - /** The user messages to append to the conversation, in order. May be empty, in which case a single turn runs over the existing history with no new user message. */ + /** The user messages to append to the conversation, in order, before running one agent loop. When the batch starts a run, its final message is the primary initiating message; earlier messages provide context, not separate runs or replies. May be empty, in which case a single turn runs over the existing history with no new user message or originatingMessageId. */ @JsonProperty("messages") List messages, /** How to deliver the messages. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn. */ @JsonProperty("mode") SendMode mode, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesResult.java index aeb556ba0f..5fbdac79a6 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesResult.java @@ -25,7 +25,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record SessionSendMessagesResult( - /** Unique identifiers assigned to the messages, one per provided message in order. Empty when no messages were provided. */ + /** Unique identifiers assigned to the messages, one per provided message in order. For a batch that starts a run, assistant messages use the final ID as originatingMessageId throughout that run, including tool iterations and stop-hook corrections. Immediate steering does not replace the active run's origin. Empty when no messages were provided; that run has no originatingMessageId. */ @JsonProperty("messageIds") List messageIds ) { } diff --git a/nodejs/README.md b/nodejs/README.md index e313dbb3ae..221fcaf9bc 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -336,12 +336,22 @@ using the typed overload. The schema belongs to the submitted run, including its tool-call iterations. Internally generated stop-hook corrections retain the schema and originating message ID, so the wait returns the corrected answer. Independent subsequent -sends do not inherit it. Ordinary immediate steering inherits the -active schema; specifying a schema with `mode: "immediate"` is rejected. +sends do not inherit it. Ordinary immediate steering inherits the active schema +and originating message ID, even when it arrives too late for the current model +request and is promoted into a follow-up run. Specifying a schema with +`mode: "immediate"` is rejected, even while idle. The generated `session.rpc.send` and `session.rpc.sendMessages` wrappers expose the full `responseFormat` contract when you need to set its name, description, or strict option rather than using the convenience defaults (`name: "response"`, `strict: true`). +Each batch starts one run: the final returned message ID is its origin, preceding +messages are context, and an empty batch has no origin. An immediate batch +steers the active run instead and retains its origin. +The schema is not a persisted session default: autonomous resume-pending work +after a restart does not restore it. A terminal tool that clears context ends +the old run; its fresh seed does not inherit the schema or origin. Such a run +can finish without a structured result, in which case the typed wait throws. +Remote sessions and HydraFusion routes reject response formats. Structured waits select the last root-agent message whose `originatingMessageId` matches the ID returned by their send, then return at a non-autopilot diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 2ebf565c8d..70a92d15ae 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -17793,7 +17793,7 @@ export interface SendMessageItem { /** @experimental */ export interface SendMessagesRequest { /** - * The user messages to append to the conversation, in order. May be empty, in which case a single turn runs over the existing history with no new user message. + * The user messages to append to the conversation, in order, before running one agent loop. When the batch starts a run, its final message is the primary initiating message; earlier messages provide context, not separate runs or replies. May be empty, in which case a single turn runs over the existing history with no new user message or originatingMessageId. */ messages: SendMessageItem[]; mode?: SendMode; @@ -17831,7 +17831,7 @@ export interface SendMessagesRequest { /** @experimental */ export interface SendMessagesResult { /** - * Unique identifiers assigned to the messages, one per provided message in order. Empty when no messages were provided. + * Unique identifiers assigned to the messages, one per provided message in order. For a batch that starts a run, assistant messages use the final ID as originatingMessageId throughout that run, including tool iterations and stop-hook corrections. Immediate steering does not replace the active run's origin. Empty when no messages were provided; that run has no originatingMessageId. */ messageIds: string[]; } diff --git a/nodejs/src/session.ts b/nodejs/src/session.ts index 1c8f3811dc..356999d2c2 100644 --- a/nodejs/src/session.ts +++ b/nodejs/src/session.ts @@ -696,13 +696,14 @@ export class CopilotSession { } /** - * Sends a message to this session and waits for the response. + * Sends a message to this session and returns once it is admitted. * * The message is processed asynchronously. Subscribe to events via {@link on} * to receive streaming responses and other session events. * * @param options - The message options including the prompt and optional attachments - * @returns A promise that resolves with the message ID of the response + * @returns The submitted user message's ID, not an assistant response ID. + * When this send starts a run, root assistant messages carry it as originatingMessageId. * @throws Error if the session has been disconnected or the connection fails * * @example @@ -789,6 +790,12 @@ export class CopilotSession { const options: MessageOptions = typeof optionsOrPrompt === "string" ? { prompt: optionsOrPrompt } : optionsOrPrompt; const typedSchema = isResponseSchema(schemaOrTimeout) ? schemaOrTimeout : undefined; + if (schemaOrTimeout !== undefined && typeof schemaOrTimeout !== "number" && !typedSchema) { + throw new TypeError( + "The second argument must be a timeout or a schema with toJSONSchema() and parse(). " + + "Pass raw JSON Schema in options.responseSchema instead." + ); + } const effectiveTimeout = (typeof schemaOrTimeout === "number" ? schemaOrTimeout : timeout) ?? 60_000; diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index f6eddb303a..2ef3312151 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -3400,8 +3400,10 @@ export interface MessageOptions { /** * JSON Schema or a Zod schema for this run's output, including requests after tool calls. - * Later sends do not inherit it. Ordinary immediate steering inherits the active schema; - * specifying a schema with mode "immediate" is rejected. + * Independent sends do not inherit it. Ordinary immediate steering retains the active + * schema and origin, even when promoted to a follow-up after the model request finishes. + * Specifying a schema with mode "immediate" is rejected, even while idle. + * This is not a persisted session default and does not survive a context reset. * * sendAndWait still returns an assistant message event. For a typed result, pass a * Zod-compatible schema as sendAndWait's second argument instead. diff --git a/nodejs/test/e2e/structured_output.e2e.test.ts b/nodejs/test/e2e/structured_output.e2e.test.ts index 2587902562..d6ec59b6e6 100644 --- a/nodejs/test/e2e/structured_output.e2e.test.ts +++ b/nodejs/test/e2e/structured_output.e2e.test.ts @@ -240,6 +240,53 @@ describe("Structured output", async () => { } }); + it("typed_wait_returns_late_steering_response", async () => { + let stops = 0; + let steeringId: string | undefined; + let session: CopilotSession; + const replies: AssistantMessageEvent[] = []; + const schema = z.object({ answer: z.number().int() }); + session = await client.createSession({ + model: "gpt-4.1", + provider, + onPermissionRequest: approveAll, + availableTools: [], + onEvent: (event) => { + if (event.type === "assistant.message" && !event.agentId) replies.push(event); + }, + hooks: { + onAgentStop: async () => { + if (++stops === 1) { + // The final model request has finished, but this run still admits steering. + steeringId = await session.send({ + prompt: "Change the answer to 99. Do not use tools.", + mode: "immediate", + }); + } + }, + }, + }); + const result = await session.sendAndWait("What is 19 + 23? Do not use tools.", schema); + expect(result).toEqual({ answer: 99 }); + expect(stops).toBe(2); + expect(replies.map((reply): unknown => JSON.parse(reply.data.content))).toEqual([ + { answer: 42 }, + { answer: 99 }, + ]); + expect(steeringId).toBeTruthy(); + expect(replies[0].data.originatingMessageId).toBeTruthy(); + expect(replies[0].data.originatingMessageId).not.toBe(steeringId); + expect(replies[1].data.originatingMessageId).toBe(replies[0].data.originatingMessageId); + const exchanges = await openAiEndpoint.getExchanges(); + expect(exchanges).toHaveLength(2); + for (const exchange of exchanges) { + expect(exchange.request).toHaveProperty( + "response_format.json_schema.schema", + schema.toJSONSchema() + ); + } + }); + it("node_concurrent_typed_sends_return_their_own_results", async () => { let markToolEntered!: () => void; let releaseTool!: () => void; diff --git a/nodejs/test/structured-output.test.ts b/nodejs/test/structured-output.test.ts index 0823996ef3..9068ab125a 100644 --- a/nodejs/test/structured-output.test.ts +++ b/nodejs/test/structured-output.test.ts @@ -168,6 +168,18 @@ describe("structured output", () => { expect(sendRequest).not.toHaveBeenCalled(); }); + it.each([{ type: "object" }, { toJSONSchema: () => ({ type: "object" }) }, null])( + "rejects an invalid second argument instead of sending an unformatted request: %j", + async (schema) => { + const { session, sendRequest } = controlledSession(); + await expect( + // @ts-expect-error Exercise malformed arguments from JavaScript callers. + session.sendAndWait("question", schema) + ).rejects.toThrow("Pass raw JSON Schema in options.responseSchema instead."); + expect(sendRequest).not.toHaveBeenCalled(); + } + ); + it("does not return a partial result after abort", async () => { const { session, sends } = controlledSession(); const pending = session.sendAndWait("question", answer); diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 5f8dd3c920..47a322b17f 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -10534,8 +10534,11 @@ class SendMessagesResult: """Result of sending zero or more user messages""" message_ids: list[str] - """Unique identifiers assigned to the messages, one per provided message in order. Empty - when no messages were provided. + """Unique identifiers assigned to the messages, one per provided message in order. For a + batch that starts a run, assistant messages use the final ID as originatingMessageId + throughout that run, including tool iterations and stop-hook corrections. Immediate + steering does not replace the active run's origin. Empty when no messages were provided; + that run has no originatingMessageId. """ @staticmethod @@ -29134,8 +29137,11 @@ class SendMessagesRequest: error. """ messages: list[SendMessageItem] - """The user messages to append to the conversation, in order. May be empty, in which case a - single turn runs over the existing history with no new user message. + """The user messages to append to the conversation, in order, before running one agent loop. + When the batch starts a run, its final message is the primary initiating message; earlier + messages provide context, not separate runs or replies. May be empty, in which case a + single turn runs over the existing history with no new user message or + originatingMessageId. """ agent_mode: SendAgentMode | None = None """The UI mode the agent was in when these messages were sent. Defaults to the session's diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 194532c6c5..bb904e8a97 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -15642,7 +15642,7 @@ pub struct SendMessagesRequest { /// The UI mode the agent was in when these messages were sent. Defaults to the session's current mode. #[serde(skip_serializing_if = "Option::is_none")] pub agent_mode: Option, - /// The user messages to append to the conversation, in order. May be empty, in which case a single turn runs over the existing history with no new user message. + /// The user messages to append to the conversation, in order, before running one agent loop. When the batch starts a run, its final message is the primary initiating message; earlier messages provide context, not separate runs or replies. May be empty, in which case a single turn runs over the existing history with no new user message or originatingMessageId. pub messages: Vec, /// How to deliver the messages. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn. #[serde(skip_serializing_if = "Option::is_none")] @@ -15678,7 +15678,7 @@ pub struct SendMessagesRequest { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SendMessagesResult { - /// Unique identifiers assigned to the messages, one per provided message in order. Empty when no messages were provided. + /// Unique identifiers assigned to the messages, one per provided message in order. For a batch that starts a run, assistant messages use the final ID as originatingMessageId throughout that run, including tool iterations and stop-hook corrections. Immediate steering does not replace the active run's origin. Empty when no messages were provided; that run has no originatingMessageId. pub message_ids: Vec, } @@ -23017,7 +23017,7 @@ pub struct SessionSendResult { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionSendMessagesResult { - /// Unique identifiers assigned to the messages, one per provided message in order. Empty when no messages were provided. + /// Unique identifiers assigned to the messages, one per provided message in order. For a batch that starts a run, assistant messages use the final ID as originatingMessageId throughout that run, including tool iterations and stop-hook corrections. Immediate steering does not replace the active run's origin. Empty when no messages were provided; that run has no originatingMessageId. pub message_ids: Vec, } diff --git a/test/snapshots/structured_output/typed_wait_returns_late_steering_response.yaml b/test/snapshots/structured_output/typed_wait_returns_late_steering_response.yaml new file mode 100644 index 0000000000..d418eef9f4 --- /dev/null +++ b/test/snapshots/structured_output/typed_wait_returns_late_steering_response.yaml @@ -0,0 +1,14 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: What is 19 + 23? Do not use tools. + - role: assistant + content: '{"answer":42}' + - role: user + content: Change the answer to 99. Do not use tools. + - role: assistant + content: '{"answer":99}' From ad9ca891cdc90f8b7ff98f70ed0a7cf0e3399605 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Fri, 11 Sep 2026 10:55:47 +0000 Subject: [PATCH 7/7] Sync structured-output SDKs with latest runtime review fixes Regenerate all language contracts from runtime 145f0fc7d0. Preserve the Node permission-source export after it moves into shared event definitions. Exercise output-only terminal finalization with stop-hook correction and synchronous size/HydraFusion rejection through both Node and C# SDKs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/README.md | 7 +- dotnet/src/Generated/Rpc.cs | 146 +- dotnet/src/Generated/SessionEvents.cs | 340 +++ dotnet/test/E2E/StructuredOutputE2ETests.cs | 82 + dotnet/test/Harness/ReplayProxy.cs | 3 +- go/rpc/zrpc.go | 870 +++----- go/rpc/zrpc_encoding.go | 1119 +++++----- go/rpc/zsession_encoding.go | 299 +-- go/rpc/zsession_events.go | 907 ++++---- go/zsession_events.go | 1892 +++++++++-------- .../PermissionCarriedForwardEvent.java | 47 + .../generated/PermissionCompletedEvent.java | 4 +- .../generated/PermissionDecisionSource.java | 41 + ...sionMessageAuthorizationDegradedEvent.java | 41 + .../PermissionMessageAuthorizationEvent.java | 58 + ...ermissionMessageAuthorizationPolarity.java | 35 + ...rmissionMessageAuthorizationReadEvent.java | 41 + .../copilot/generated/SessionEvent.java | 8 + .../generated/rpc/CopilotUserResponse.java | 2 +- .../generated/rpc/EventsCursorStatus.java | 2 +- .../rpc/JsonSchemaResponseFormat.java | 2 +- .../rpc/PermissionDecisionSource.java | 4 +- .../rpc/SessionEventLogReadResult.java | 4 +- .../generated/rpc/SessionFleetApi.java | 2 +- .../rpc/SessionFleetStartParams.java | 11 +- .../generated/rpc/SessionModeSetParams.java | 2 + .../generated/rpc/SessionModeSetResult.java | 2 + .../generated/rpc/SessionOpenOptions.java | 2 + .../SessionsReadPersistedEventsParams.java | 6 +- .../SessionsReadPersistedEventsResult.java | 4 +- nodejs/README.md | 7 +- nodejs/src/generated/rpc.ts | 67 +- nodejs/src/generated/session-events.ts | 309 +++ nodejs/src/types.ts | 2 +- nodejs/test/e2e/structured_output.e2e.test.ts | 110 +- python/copilot/generated/rpc.py | 258 ++- python/copilot/generated/session_events.py | 227 +- rust/src/generated/api_types.rs | 87 +- rust/src/generated/rpc.rs | 4 +- rust/src/generated/session_events.rs | 378 ++++ ...p_hook_correction_after_terminal_tool.yaml | 24 + 41 files changed, 4534 insertions(+), 2922 deletions(-) create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/PermissionCarriedForwardEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/PermissionDecisionSource.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationDegradedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationPolarity.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationReadEvent.java create mode 100644 test/snapshots/structured_output/typed_wait_returns_stop_hook_correction_after_terminal_tool.yaml diff --git a/dotnet/README.md b/dotnet/README.md index e6001dd723..d2ae8f6d71 100644 --- a/dotnet/README.md +++ b/dotnet/README.md @@ -394,7 +394,12 @@ The schema is not a persisted session default: autonomous resume-pending work after a restart does not restore it. A terminal tool that clears context ends the old run; its fresh seed does not inherit the schema or origin. Such a run can finish without a structured result, in which case the typed wait throws. -Remote sessions and HydraFusion routes reject response formats. +After a successful terminal tool, the runtime disables tools while the model +produces the structured result. Stop-hook corrections remain supported. +Remote sessions and known HydraFusion routes reject response formats before +admission. Schemas larger than 32 MiB when JSON-encoded are also rejected before +admission, using the runtime's existing request-size ceiling. This does not +guarantee the schema plus conversation and tools fits the provider's budget. Use a provider route that enforces JSON Schema: an API-compatible gateway can ignore unsupported format fields, and the Claude Chat-completions compatibility route is not equivalent to Anthropic's native Messages endpoint. This preview diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index 988f90baff..0011faf130 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -670,6 +670,10 @@ public sealed class CopilotUserResponseEndpoints /// RPC data type for CopilotUserResponseOrganizationListItem operations. public sealed class CopilotUserResponseOrganizationListItem { + /// Numeric database ID of the organization. + [JsonPropertyName("id")] + public double? Id { get; set; } + /// GitHub login of the organization. [JsonPropertyName("login")] public string? Login { get; set; } @@ -931,7 +935,7 @@ public sealed class CopilotUserResponse [JsonPropertyName("monthly_quotas")] public IDictionary? MonthlyQuotas { get; set; } - /// Organizations the user belongs to, each with an optional login and display name. + /// Organizations the user belongs to, each with an optional ID, login, and display name. [JsonPropertyName("organization_list")] public IList? OrganizationList { get; set; } @@ -4527,7 +4531,7 @@ public sealed class EventsReadResult [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. + /// Cursor status: 'ok' means the cursor was applied successfully. For session.eventLog.read, 'expired' means the cursor referred to an event that no longer exists in active history and the read fell back to a boundary of the remaining history: the beginning for a forward read or the newest window for a backward read. That fallback may overlap already rendered events, so active-session consumers should reset, rebase, or deduplicate before continuing. sessions.readPersistedEvents has stricter snapshot semantics: 'expired' returns an empty terminal page and never switches to a replacement journal generation. Other persisted-read I/O failures are RPC errors with diagnostics, not cursor expiry. [JsonPropertyName("cursorStatus")] public EventsCursorStatus CursorStatus { get; set; } @@ -4535,7 +4539,7 @@ public sealed class EventsReadResult [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. + /// True when more events are available in the read's direction. For a backward read, true means older persisted events remain before the returned window. A persisted-event page may contain fewer than `max` events because of its byte budget while still reporting hasMore true; continue according to this flag rather than the event count. [JsonPropertyName("hasMore")] public bool HasMore { get; set; } } @@ -4544,15 +4548,15 @@ public sealed class EventsReadResult [Experimental(Diagnostics.Experimental)] internal sealed class SessionsReadPersistedEventsRequest { - /// Opaque cursor returned by a previous persisted-event read. Omit on the first call. + /// Opaque, process-local, single-use cursor returned by the previous persisted-event read. Omit on the first call and issue continuations sequentially; reusing the same cursor returns an expired terminal page. [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. + /// Direction to page through persisted history. Forward starts at the beginning; backward starts with the newest events. Events in each page remain chronological. This selects the initial read only; a continuation always uses the direction bound into its cursor. [JsonPropertyName("direction")] public EventsReadDirection? Direction { get; set; } - /// Maximum number of events to return in this batch (1–1000, default 200). + /// Maximum number of events to return in this batch (1–1000, default 200). Pages may contain fewer events to keep the serialized event array within a soft 1 MiB budget including resolved binary assets; one oversized event is returned alone to guarantee progress. [JsonPropertyName("max")] public long? Max { get; set; } @@ -5466,7 +5470,7 @@ public sealed class JsonSchemaResponseFormat [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; - /// JSON Schema passed unchanged to the inference provider. Supported keywords and schema restrictions are determined by that provider. + /// JSON Schema passed unchanged to the inference provider. Schemas larger than 32 MiB when JSON-encoded are rejected before admission, using the runtime's existing request-size ceiling. This is not a guarantee that the entire model request fits. Supported keywords and schema restrictions are determined by the provider. [JsonPropertyName("schema")] public JsonElement Schema { get; set; } @@ -8267,6 +8271,10 @@ public sealed class ModeSetResult [JsonPropertyName("message")] public string? Message { get; set; } + /// Whether the requested mode was applied to the session. False only when an 'expectedMode' precondition did not hold, in which case any model change reported alongside it was still applied. + [JsonPropertyName("modeApplied")] + public bool? ModeApplied { get; set; } + /// Whether applying the mode changed the active model. [JsonPropertyName("modelChanged")] public bool ModelChanged { get; set; } @@ -8288,6 +8296,10 @@ internal sealed class ModeSetRequest [JsonPropertyName("compactionDecision")] public string? CompactionDecision { get; set; } + /// Mode the session must currently be in for the change to apply. When set and the session is in a different mode the request is a no-op and reports status 'unchanged'. + [JsonPropertyName("expectedMode")] + public SessionMode? ExpectedMode { get; set; } + /// Session whose plan-mode base state should be inherited. [JsonPropertyName("inheritPlanBaseFromSessionId")] public string? InheritPlanBaseFromSessionId { get; set; } @@ -9163,10 +9175,19 @@ public sealed class FleetStartResult public bool Started { get; set; } } -/// Optional user prompt to combine with the fleet orchestration instructions. +/// Parameters for starting fleet orchestration: an optional user prompt combined with the fleet instructions, plus the send options forwarded to the resulting turn. [Experimental(Diagnostics.Experimental)] internal sealed class FleetStartRequest { + /// Optional attachments (files, directories, selections, blobs, GitHub references) to include with the fleet request. + [JsonPropertyName("attachments")] + public IList? Attachments { get; set; } + + /// If false, this request will not trigger a Premium Request Unit charge. User requests default to billable. + [JsonInclude] + [JsonPropertyName("billable")] + internal bool? Billable { get; set; } + /// Optional user prompt to combine with fleet instructions. [JsonPropertyName("prompt")] public string? Prompt { get; set; } @@ -9174,6 +9195,10 @@ internal sealed class FleetStartRequest /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; + + /// If true, await completion of the agentic loop for this fleet request before returning. Defaults to false. + [JsonPropertyName("wait")] + public bool? Wait { get; set; } } /// Agents available to the session. @@ -23881,7 +23906,7 @@ 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. +/// Cursor status: 'ok' means the read succeeded against the requested history; 'expired' means the requested continuation is unavailable. Recovery is endpoint-specific: session.eventLog.read returns a boundary window of remaining active history that may overlap prior pages, while sessions.readPersistedEvents returns an empty terminal page and never switches journal generations. An expired persisted read is not successful completion; a complete persisted snapshot requires cursorStatus 'ok' and hasMore false. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -23901,10 +23926,10 @@ public EventsCursorStatus(string value) /// Gets the value associated with this . public string Value => _value ?? string.Empty; - /// The cursor was applied successfully. + /// The read succeeded against the requested history. public static EventsCursorStatus Ok { get; } = new("ok"); - /// The cursor referred to history that is no longer available. + /// The requested continuation is unavailable; see the endpoint's recovery semantics. public static EventsCursorStatus Expired { get; } = new("expired"); /// Returns a value indicating whether two instances are equivalent. @@ -24880,75 +24905,6 @@ public override void Write(Utf8JsonWriter writer, PermissionResponseCapability v } -/// Controlled reason or actor responsible for a permission response. -[Experimental(Diagnostics.Experimental)] -[JsonConverter(typeof(Converter))] -[DebuggerDisplay("{Value,nq}")] -public readonly struct PermissionDecisionSource : IEquatable -{ - private readonly string? _value; - - /// Initializes a new instance of the struct. - /// The value to associate with this . - [JsonConstructor] - public PermissionDecisionSource(string value) - { - ArgumentException.ThrowIfNullOrWhiteSpace(value); - _value = value; - } - - /// Gets the value associated with this . - public string Value => _value ?? string.Empty; - - /// The response followed the assisted-approval judge recommendation. - public static PermissionDecisionSource AssistedApproval { get; } = new("assisted_approval"); - - /// A human supplied the response through an interactive prompt. - public static PermissionDecisionSource HumanResponse { get; } = new("human_response"); - - /// The host applied a standing policy or override rather than a judge recommendation or human decision. - public static PermissionDecisionSource HostPolicy { get; } = new("host_policy"); - - /// The host denied the request because no interactive user response was available. - public static PermissionDecisionSource UnattendedFallback { get; } = new("unattended_fallback"); - - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(PermissionDecisionSource left, PermissionDecisionSource right) => left.Equals(right); - - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(PermissionDecisionSource left, PermissionDecisionSource right) => !(left == right); - - /// - public override bool Equals(object? obj) => obj is PermissionDecisionSource other && Equals(other); - - /// - public bool Equals(PermissionDecisionSource 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 PermissionDecisionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); - } - - /// - public override void Write(Utf8JsonWriter writer, PermissionDecisionSource value, JsonSerializerOptions options) - { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionDecisionSource)); - } - } -} - - /// Client surface that submitted a permission response. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -32930,11 +32886,11 @@ public async Task> GetClientMetadataAsync(ILi return await CopilotClient.InvokeRpcAsync>(_rpc, "sessions.getClientMetadata", [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. + /// Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The first read pins the currently opened journal generation and its byte-length boundary; opaque cursor continuations remain on that generation across runtime-owned compaction, truncation, and rewrite operations, which replace the live path atomically, and events appended after the boundary are excluded. For cold hydration, await the first successful page before activation and establish lossless live-event buffering before resume; merge subsequent live events by ID, preserving persisted order and letting live payloads win. Continuations are process-local, single-use capabilities bound to the originating session and storage context and must be paged sequentially; concurrent or repeated use of the same cursor expires that duplicate read rather than reading the generation twice. A complete snapshot has cursorStatus 'ok' and hasMore false. Snapshots expire after five idle minutes, with at most eight retained per process and idle-only eviction under pressure; completion and cancelled-worker exit release their handles. No transcript copy is created, but retained handles may keep replaced files' disk blocks alive until release. Pages have a soft 1 MiB serialized event-array budget including resolved binary assets; one oversized event is returned alone to guarantee progress. Working memory also includes a record/lookahead and asset resolution; resolving the first binary reference may scan the full pinned generation to build a bounded offset index. If the snapshot expires, is evicted, is cancelled before a continuation is established, or becomes unreadable after an observable unsupported in-place shortening, the continuation returns cursorStatus 'expired' with an empty terminal page and never falls back to a different generation. A missing or initially unreadable journal is an RPC error. Persisted history excludes ephemeral events and may omit payloads that are reconstructed only for an active session; use the active session event stream for post-resume live events. /// 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. + /// Opaque, process-local, single-use cursor returned by the previous persisted-event read. Omit on the first call and issue continuations sequentially; reusing the same cursor returns an expired terminal page. + /// Maximum number of events to return in this batch (1–1000, default 200). Pages may contain fewer events to keep the serialized event array within a soft 1 MiB budget including resolved binary assets; one oversized event is returned alone to guarantee progress. + /// Direction to page through persisted history. Forward starts at the beginning; backward starts with the newest events. Events in each page remain chronological. This selects the initial read only; a continuation always uses the direction bound into its cursor. /// 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) @@ -34424,6 +34380,7 @@ public async Task GetAsync(CancellationToken cancellationToken = de /// Sets the current agent interaction mode. /// The session mode the agent is operating in. + /// Mode the session must currently be in for the change to apply. When set and the session is in a different mode the request is a no-op and reports status 'unchanged'. /// Session whose plan-mode base state should be inherited. /// Whether a dedicated plan model is configured. /// Dedicated model to use in plan mode, when configured. @@ -34436,11 +34393,11 @@ public async Task GetAsync(CancellationToken cancellationToken = de /// Action to perform when leaving plan mode. /// The to monitor for cancellation requests. The default is . /// Outcome of a session mode change, including any model switch it triggered and follow-up the host must perform. - public async Task SetAsync(SessionMode mode, string? inheritPlanBaseFromSessionId = null, bool? planModelConfigured = null, string? planModel = null, string? planReasoningEffort = null, string? planContextTier = null, string? compactionDecision = null, bool? restorePlanModel = null, bool? persistPlanSelection = null, ModelPickerSettingsContext? pickerSettingsContext = null, string? planExitAction = null, CancellationToken cancellationToken = default) + public async Task SetAsync(SessionMode mode, SessionMode? expectedMode = null, string? inheritPlanBaseFromSessionId = null, bool? planModelConfigured = null, string? planModel = null, string? planReasoningEffort = null, string? planContextTier = null, string? compactionDecision = null, bool? restorePlanModel = null, bool? persistPlanSelection = null, ModelPickerSettingsContext? pickerSettingsContext = null, string? planExitAction = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); - var request = new ModeSetRequest { SessionId = _session.SessionId, Mode = mode, InheritPlanBaseFromSessionId = inheritPlanBaseFromSessionId, PlanModelConfigured = planModelConfigured, PlanModel = planModel, PlanReasoningEffort = planReasoningEffort, PlanContextTier = planContextTier, CompactionDecision = compactionDecision, RestorePlanModel = restorePlanModel, PersistPlanSelection = persistPlanSelection, PickerSettingsContext = pickerSettingsContext, PlanExitAction = planExitAction }; + var request = new ModeSetRequest { SessionId = _session.SessionId, Mode = mode, ExpectedMode = expectedMode, InheritPlanBaseFromSessionId = inheritPlanBaseFromSessionId, PlanModelConfigured = planModelConfigured, PlanModel = planModel, PlanReasoningEffort = planReasoningEffort, PlanContextTier = planContextTier, CompactionDecision = compactionDecision, RestorePlanModel = restorePlanModel, PersistPlanSelection = persistPlanSelection, PickerSettingsContext = pickerSettingsContext, PlanExitAction = planExitAction }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mode.set", [request], cancellationToken); } } @@ -34864,13 +34821,16 @@ internal FleetApi(CopilotSession session) /// Starts fleet mode by submitting the fleet orchestration prompt to the session. /// Optional user prompt to combine with fleet instructions. + /// Optional attachments (files, directories, selections, blobs, GitHub references) to include with the fleet request. + /// If false, this request will not trigger a Premium Request Unit charge. User requests default to billable. + /// If true, await completion of the agentic loop for this fleet request before returning. Defaults to false. /// The to monitor for cancellation requests. The default is . /// Indicates whether fleet mode was successfully activated. - public async Task StartAsync(string? prompt = null, CancellationToken cancellationToken = default) + public async Task StartAsync(string? prompt = null, IList? attachments = null, bool? billable = null, bool? wait = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); - var request = new FleetStartRequest { SessionId = _session.SessionId, Prompt = prompt }; + var request = new FleetStartRequest { SessionId = _session.SessionId, Prompt = prompt, Attachments = attachments, Billable = billable, Wait = wait }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.fleet.start", [request], cancellationToken); } } @@ -38354,8 +38314,18 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.PendingMessagesModifiedData), TypeInfoPropertyName = "SessionEventsPendingMessagesModifiedData")] [JsonSerializable(typeof(GitHub.Copilot.PendingMessagesModifiedEvent), TypeInfoPropertyName = "SessionEventsPendingMessagesModifiedEvent")] [JsonSerializable(typeof(GitHub.Copilot.PermissionAssistedApproval), TypeInfoPropertyName = "SessionEventsPermissionAssistedApproval")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionCarriedForwardData), TypeInfoPropertyName = "SessionEventsPermissionCarriedForwardData")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionCarriedForwardEvent), TypeInfoPropertyName = "SessionEventsPermissionCarriedForwardEvent")] [JsonSerializable(typeof(GitHub.Copilot.PermissionCompletedData), TypeInfoPropertyName = "SessionEventsPermissionCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.PermissionCompletedEvent), TypeInfoPropertyName = "SessionEventsPermissionCompletedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionDecisionSource), TypeInfoPropertyName = "SessionEventsPermissionDecisionSource")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionMessageAuthorizationData), TypeInfoPropertyName = "SessionEventsPermissionMessageAuthorizationData")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionMessageAuthorizationDegradedData), TypeInfoPropertyName = "SessionEventsPermissionMessageAuthorizationDegradedData")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionMessageAuthorizationDegradedEvent), TypeInfoPropertyName = "SessionEventsPermissionMessageAuthorizationDegradedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionMessageAuthorizationEvent), TypeInfoPropertyName = "SessionEventsPermissionMessageAuthorizationEvent")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionMessageAuthorizationPolarity), TypeInfoPropertyName = "SessionEventsPermissionMessageAuthorizationPolarity")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionMessageAuthorizationReadData), TypeInfoPropertyName = "SessionEventsPermissionMessageAuthorizationReadData")] +[JsonSerializable(typeof(GitHub.Copilot.PermissionMessageAuthorizationReadEvent), TypeInfoPropertyName = "SessionEventsPermissionMessageAuthorizationReadEvent")] [JsonSerializable(typeof(GitHub.Copilot.PermissionMode), TypeInfoPropertyName = "SessionEventsPermissionMode")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequest), TypeInfoPropertyName = "SessionEventsPermissionPromptRequest")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestCommands), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestCommands")] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index 147f1e5ee8..5cb6f8f82e 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -75,7 +75,11 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(ModelCallFinishedEvent), "model.call_finished")] [JsonDerivedType(typeof(ModelCallStartEvent), "model.call_start")] [JsonDerivedType(typeof(PendingMessagesModifiedEvent), "pending_messages.modified")] +[JsonDerivedType(typeof(PermissionCarriedForwardEvent), "permission.carriedForward")] [JsonDerivedType(typeof(PermissionCompletedEvent), "permission.completed")] +[JsonDerivedType(typeof(PermissionMessageAuthorizationEvent), "permission.messageAuthorization")] +[JsonDerivedType(typeof(PermissionMessageAuthorizationDegradedEvent), "permission.messageAuthorizationDegraded")] +[JsonDerivedType(typeof(PermissionMessageAuthorizationReadEvent), "permission.messageAuthorizationRead")] [JsonDerivedType(typeof(PermissionRequestedEvent), "permission.requested")] [JsonDerivedType(typeof(PromptCacheBreakEvent), "prompt_cache_break")] [JsonDerivedType(typeof(SamplingCompletedEvent), "sampling.completed")] @@ -1333,6 +1337,62 @@ public sealed partial class PermissionCompletedEvent : SessionEvent public required PermissionCompletedData Data { get; set; } } +/// Records that a live authorization record from an earlier human decision in this session contained a permission proposal, so it ran without another prompt. This mints no authority: it accounts for one more effect against the prior grant, which is what lets a replayed session agree with the live one about how much of that grant is left. +/// Represents the permission.carriedForward event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class PermissionCarriedForwardEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "permission.carriedForward"; + + /// The permission.carriedForward event payload. + [JsonPropertyName("data")] + public required PermissionCarriedForwardData Data { get; set; } +} + +/// Freezes one blinded, verbatim-verified authorization claim the runtime minted from a human user message, so a resumed session re-establishes the same grant deterministically instead of re-running the extraction model. This mints no authority on its own: it records what a blinded proposer pointed at and the trusted discriminator the runtime established, and deterministic establishment runs on replay. Persisted so recorded authority survives compaction and process resume. +/// Represents the permission.messageAuthorization event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class PermissionMessageAuthorizationEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "permission.messageAuthorization"; + + /// The permission.messageAuthorization event payload. + [JsonPropertyName("data")] + public required PermissionMessageAuthorizationData Data { get; set; } +} + +/// Records that one human turn has been read by the blinded authorization proposer, whether or not it minted anything, so a resumed session does not re-run the extraction model on a turn the live session already read. Persisted purely to avoid wasted model calls across resume; it is never a correctness mechanism. +/// Represents the permission.messageAuthorizationRead event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class PermissionMessageAuthorizationReadEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "permission.messageAuthorizationRead"; + + /// The permission.messageAuthorizationRead event payload. + [JsonPropertyName("data")] + public required PermissionMessageAuthorizationReadData Data { get; set; } +} + +/// Records that message-backed authorization could not safely represent one human turn before compaction. The runtime may compact the original message after this marker is durable, but message-derived carry-forward and assisted auto-approval remain disabled for the rest of the session so subsequent commands continue through the ordinary permission prompt. +/// Represents the permission.messageAuthorizationDegraded event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class PermissionMessageAuthorizationDegradedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "permission.messageAuthorizationDegraded"; + + /// The permission.messageAuthorizationDegraded event payload. + [JsonPropertyName("data")] + public required PermissionMessageAuthorizationDegradedData Data { get; set; } +} + /// User input request notification with question and optional predefined choices. /// Represents the user_input.requested event. public sealed partial class UserInputRequestedEvent : SessionEvent @@ -5200,6 +5260,12 @@ public sealed partial class PermissionRequestedData /// Permission request completion notification signaling UI dismissal. public sealed partial class PermissionCompletedData { + /// Who decided this permission request. Absent on completions recorded before this field existed, which consumers must treat as "not a human decision" rather than assuming one. Authorization records are minted only for `human_response`; an assisted-approval verdict, a host policy, an unattended fallback, and a hook resolution all produce the same `result` a person does, so this is the only field that distinguishes them. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("decisionSource")] + public PermissionDecisionSource? DecisionSource { get; set; } + /// Request ID of the resolved permission request; clients should dismiss any UI for this request. [JsonPropertyName("requestId")] public required string RequestId { get; set; } @@ -5214,6 +5280,104 @@ public sealed partial class PermissionCompletedData public string? ToolCallId { get; set; } } +/// Records that a live authorization record from an earlier human decision in this session contained a permission proposal, so it ran without another prompt. This mints no authority: it accounts for one more effect against the prior grant, which is what lets a replayed session agree with the live one about how much of that grant is left. +[Experimental(Diagnostics.Experimental)] +public sealed partial class PermissionCarriedForwardData +{ + /// Always `authorization_carry_forward`. Stated explicitly so a consumer reading this event cannot mistake it for a human, host-policy, or assisted-approval decision. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("decisionSource")] + public required PermissionDecisionSource DecisionSource { get; set; } + + /// Identity of the prior authorization record that contained the proposal. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("recordId")] + public required string RecordId { get; set; } + + /// Authorization edge minted for this admission. Not a prompt id: no prompt was raised, so no client should expect a request with this id. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("requestId")] + public required string RequestId { get; set; } + + /// Tool call this admission authorizes. Its execution receipts the prior grant, which is how a single-effect approval is spent rather than carried forward again. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("toolCallId")] + public required string ToolCallId { get; set; } +} + +/// Freezes one blinded, verbatim-verified authorization claim the runtime minted from a human user message, so a resumed session re-establishes the same grant deterministically instead of re-running the extraction model. This mints no authority on its own: it records what a blinded proposer pointed at and the trusted discriminator the runtime established, and deterministic establishment runs on replay. Persisted so recorded authority survives compaction and process resume. +[Experimental(Diagnostics.Experimental)] +public sealed partial class PermissionMessageAuthorizationData +{ + /// The kind of effect authorized, as an action-class identifier. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("actionClass")] + public required string ActionClass { get; set; } + + /// Whether the claim granted or denied authority. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("polarity")] + public required PermissionMessageAuthorizationPolarity Polarity { get; set; } + + /// Deterministic identity of the record, derived from the turn and span offsets so re-extracting the same span mints nothing new. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("recordId")] + public required string RecordId { get; set; } + + /// End byte offset of the authorizing span within the turn. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("spanEnd")] + public required long SpanEnd { get; set; } + + /// Start byte offset of the authorizing span within the turn. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("spanStart")] + public required long SpanStart { get; set; } + + /// Concrete named targets that appear verbatim inside the span. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("targetMembers")] + public string[]? TargetMembers { get; set; } + + /// The task the permission is scoped to, when the human named one. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("task")] + public string? Task { get; set; } + + /// The human turn the quoted span was read from. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("turnIndex")] + public required long TurnIndex { get; set; } + + /// The trusted version discriminator, when one exists. Exact shell-command grants carry the byte-identical commands grounded in the human span; world-derived classes carry a file object, remote tip, or runner only when that state was captured safely. An opaque object mirroring the runtime's adjacently-tagged resolution. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("world")] + public JsonElement? World { get; set; } +} + +/// Records that one human turn has been read by the blinded authorization proposer, whether or not it minted anything, so a resumed session does not re-run the extraction model on a turn the live session already read. Persisted purely to avoid wasted model calls across resume; it is never a correctness mechanism. +[Experimental(Diagnostics.Experimental)] +public sealed partial class PermissionMessageAuthorizationReadData +{ + /// The human turn that was read by the proposer. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("turnIndex")] + public required long TurnIndex { get; set; } +} + +/// Records that message-backed authorization could not safely represent one human turn before compaction. The runtime may compact the original message after this marker is durable, but message-derived carry-forward and assisted auto-approval remain disabled for the rest of the session so subsequent commands continue through the ordinary permission prompt. +[Experimental(Diagnostics.Experimental)] +public sealed partial class PermissionMessageAuthorizationDegradedData +{ + /// The human turn that could not be represented safely. + [Experimental(Diagnostics.Experimental)] + [JsonPropertyName("turnIndex")] + public required long TurnIndex { get; set; } +} + /// User input request notification with question and optional predefined choices. public sealed partial class UserInputRequestedData { @@ -8980,6 +9144,18 @@ public override bool? ManagedApprovalRequired [JsonPropertyName("requestSandboxPermissive")] public bool? RequestSandboxPermissive { get; set; } + /// Runtime-resolved canonical object each possiblePaths entry names, keyed by the requested spelling, used for authorization identity checks. Internal and experimental; clients should continue to display possiblePaths. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("resolvedPaths")] + public IDictionary? ResolvedPaths { get; set; } + + /// Runtime-resolved canonical working directory the command runs in, used for authorization identity checks. Internal and experimental; clients should not display it. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("resolvedWorkingDirectory")] + public string? ResolvedWorkingDirectory { get; set; } + /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] @@ -9039,6 +9215,12 @@ public override bool? ManagedApprovalRequired [JsonPropertyName("requestSandboxBypassReason")] public string? RequestSandboxBypassReason { get; set; } + /// Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display fileName. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("resolvedPath")] + public string? ResolvedPath { get; set; } + /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] @@ -9080,6 +9262,12 @@ public override bool? ManagedApprovalRequired [JsonPropertyName("requestSandboxBypassReason")] public string? RequestSandboxBypassReason { get; set; } + /// Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display path. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("resolvedPath")] + public string? ResolvedPath { get; set; } + /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] @@ -9607,6 +9795,12 @@ public sealed partial class PermissionPromptRequestWrite : PermissionPromptReque [JsonPropertyName("newFileContents")] public string? NewFileContents { get; set; } + /// Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display fileName. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("resolvedPath")] + public string? ResolvedPath { get; set; } + /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] @@ -9640,6 +9834,12 @@ public sealed partial class PermissionPromptRequestRead : PermissionPromptReques [JsonPropertyName("path")] public required string Path { get; set; } + /// Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display path. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("resolvedPath")] + public string? ResolvedPath { get; set; } + /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] @@ -15201,6 +15401,138 @@ public override void Write(Utf8JsonWriter writer, PermissionPromptRequestPathAcc } } +/// Controlled reason or actor responsible for a permission response. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct PermissionDecisionSource : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public PermissionDecisionSource(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The response followed the assisted-approval judge recommendation. + public static PermissionDecisionSource AssistedApproval { get; } = new("assisted_approval"); + + /// A human supplied the response through an interactive prompt. + public static PermissionDecisionSource HumanResponse { get; } = new("human_response"); + + /// The host applied a standing policy or override rather than a judge recommendation or human decision. + public static PermissionDecisionSource HostPolicy { get; } = new("host_policy"); + + /// The host denied the request because no interactive user response was available. + public static PermissionDecisionSource UnattendedFallback { get; } = new("unattended_fallback"); + + /// A live authorization record from an earlier human decision in this session contained the proposal, so it ran without another prompt. This is not a new human decision and never mints authority of its own. + public static PermissionDecisionSource AuthorizationCarryForward { get; } = new("authorization_carry_forward"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(PermissionDecisionSource left, PermissionDecisionSource right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(PermissionDecisionSource left, PermissionDecisionSource right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is PermissionDecisionSource other && Equals(other); + + /// + public bool Equals(PermissionDecisionSource 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 PermissionDecisionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, PermissionDecisionSource value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionDecisionSource)); + } + } +} + +/// Which direction a message-backed authorization claim moves authority in. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct PermissionMessageAuthorizationPolarity : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public PermissionMessageAuthorizationPolarity(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The human's words authorized an effect. + public static PermissionMessageAuthorizationPolarity Grant { get; } = new("grant"); + + /// The human's words refused an effect. + public static PermissionMessageAuthorizationPolarity Denial { get; } = new("denial"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(PermissionMessageAuthorizationPolarity left, PermissionMessageAuthorizationPolarity right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(PermissionMessageAuthorizationPolarity left, PermissionMessageAuthorizationPolarity right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is PermissionMessageAuthorizationPolarity other && Equals(other); + + /// + public bool Equals(PermissionMessageAuthorizationPolarity 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 PermissionMessageAuthorizationPolarity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, PermissionMessageAuthorizationPolarity value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionMessageAuthorizationPolarity)); + } + } +} + /// Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -16856,8 +17188,16 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(PendingMessagesModifiedData))] [JsonSerializable(typeof(PendingMessagesModifiedEvent))] [JsonSerializable(typeof(PermissionAssistedApproval))] +[JsonSerializable(typeof(PermissionCarriedForwardData))] +[JsonSerializable(typeof(PermissionCarriedForwardEvent))] [JsonSerializable(typeof(PermissionCompletedData))] [JsonSerializable(typeof(PermissionCompletedEvent))] +[JsonSerializable(typeof(PermissionMessageAuthorizationData))] +[JsonSerializable(typeof(PermissionMessageAuthorizationDegradedData))] +[JsonSerializable(typeof(PermissionMessageAuthorizationDegradedEvent))] +[JsonSerializable(typeof(PermissionMessageAuthorizationEvent))] +[JsonSerializable(typeof(PermissionMessageAuthorizationReadData))] +[JsonSerializable(typeof(PermissionMessageAuthorizationReadEvent))] [JsonSerializable(typeof(PermissionPromptRequest))] [JsonSerializable(typeof(PermissionPromptRequestCommands))] [JsonSerializable(typeof(PermissionPromptRequestCustomTool))] diff --git a/dotnet/test/E2E/StructuredOutputE2ETests.cs b/dotnet/test/E2E/StructuredOutputE2ETests.cs index a39dbae06a..6de9c92ccd 100644 --- a/dotnet/test/E2E/StructuredOutputE2ETests.cs +++ b/dotnet/test/E2E/StructuredOutputE2ETests.cs @@ -270,6 +270,88 @@ public async Task Typed_Wait_Returns_Late_Steering_Response() JsonSerializer.Deserialize(message.Data.Content, StructuredOutputE2EJsonContext.Default.CorrectionResult)!.Answer)); } + [Fact] + public async Task Typed_Wait_Returns_Stop_Hook_Correction_After_Terminal_Tool() + { + var calls = 0; + var stops = 0; + var config = StructuredSessionConfig(); + config.Tools = + [ + CopilotTool.DefineTool(() => + { + Interlocked.Increment(ref calls); + return 58; + }, new CopilotToolOptions { IsTerminal = true, SkipPermission = true }, + new() { Name = "lookup_number", Description = "Return the number needed for the calculation." }), + ]; + config.Hooks = new SessionHooks + { + OnAgentStop = (_, _) => Task.FromResult( + Interlocked.Increment(ref stops) == 1 + ? new() { Decision = "block", Reason = "Correct the answer to 99, not 63. Do not use tools." } + : null), + }; + var session = await CreateSessionAsync(config); + var replies = new System.Collections.Concurrent.ConcurrentQueue(); + using var subscription = session.On(message => + { + if (string.IsNullOrEmpty(message.AgentId)) replies.Enqueue(message); + }); + var result = await session.SendAndWaitAsync( + "Call lookup_number exactly once, then add 5 to the returned number. Do not guess its result.", + StructuredOutputE2EJsonContext.Default.Options, + TimeSpan.FromMinutes(3)); + Assert.Equal(99, result.Answer); + Assert.Equal(1, calls); + Assert.Equal(2, stops); + var answers = replies.Where(message => message.Data.ToolRequests is not { Length: > 0 }).ToArray(); + Assert.Equal([63, 99], answers.Select(message => + JsonSerializer.Deserialize(message.Data.Content, StructuredOutputE2EJsonContext.Default.CorrectionResult)!.Answer)); + Assert.False(string.IsNullOrEmpty(answers[0].Data.OriginatingMessageId)); + Assert.Equal(answers[0].Data.OriginatingMessageId, answers[1].Data.OriginatingMessageId); + var exchanges = await Ctx.GetExchangesAsync(); + Assert.Equal(3, exchanges.Count); + Assert.Equal("none", exchanges[1].Request.ToolChoice?.GetString()); + } + + [Fact] + public async Task Rejects_Unsupported_Or_Oversized_Schemas_Before_Admission() + { + var environment = Ctx.GetEnvironment(); + environment["COPILOT_CLI_ENABLED_FEATURE_FLAGS"] = "HYDRAFUSION,HYDRAFUSION_ROLLOUT"; + await using var client = Ctx.CreateClient(environment: environment); + foreach (var model in new[] { "gpt-4.1", "hydrafusion" }) + { + var config = StructuredSessionConfig(); + config.Model = model; + config.OnPermissionRequest = PermissionHandler.ApproveAll; + await using var session = await client.CreateSessionAsync(config); + using var schema = JsonDocument.Parse( + "{\"type\":\"object\",\"description\":\"" + + (model == "gpt-4.1" ? new string('x', 32 * 1024 * 1024) : "Small schema") + "\"}"); + var message = model == "gpt-4.1" ? "32 MiB" : "HydraFusion"; + var error = await Assert.ThrowsAnyAsync(() => + session.SendAndWaitAsync(new MessageOptions + { + Prompt = "Must not be admitted", + ResponseSchema = schema.RootElement, + })); + Assert.Contains(message, error.Message); + error = await Assert.ThrowsAnyAsync(() => + session.Rpc.SendMessagesAsync([], responseFormat: new ResponseFormat + { + Type = "json_schema", + JsonSchema = new() { Name = "response", Schema = schema.RootElement }, + })); + Assert.Contains(message, error.Message); + Assert.Empty((await session.Rpc.Queue.PendingItemsAsync()).Items); + Assert.DoesNotContain(await session.GetEventsAsync(), + evt => evt is UserMessageEvent or SessionErrorEvent); + } + Assert.Empty(await Ctx.GetExchangesAsync()); + } + [Fact] public async Task Concurrent_Typed_Sends_Return_Their_Own_Results() { diff --git a/dotnet/test/Harness/ReplayProxy.cs b/dotnet/test/Harness/ReplayProxy.cs index 895ebccb87..2b2cd9e0ec 100644 --- a/dotnet/test/Harness/ReplayProxy.cs +++ b/dotnet/test/Harness/ReplayProxy.cs @@ -250,7 +250,8 @@ public record ParsedHttpExchange( public record ChatCompletionRequest( string Model, List Messages, - List? Tools); + List? Tools, + [property: JsonPropertyName("tool_choice")] JsonElement? ToolChoice = null); public record ChatCompletionMessage( string Role, diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 46735817dd..0f5c603ae1 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -6,10 +6,10 @@ package rpc import ( "context" "encoding/json" + "time" "errors" "fmt" "github.com/github/copilot-sdk/go/internal/jsonrpc2" - "time" ) // Parameters for aborting the current turn @@ -337,7 +337,6 @@ func (RawAgentRegistrySpawnResultData) agentRegistrySpawnResult() {} func (r RawAgentRegistrySpawnResultData) Kind() AgentRegistrySpawnResultKind { return r.Discriminator } - // `child_process.spawn` itself failed before the child entered the registry. // Experimental: AgentRegistrySpawnError is part of an experimental API and may change or be // removed. @@ -352,7 +351,6 @@ func (AgentRegistrySpawnError) agentRegistrySpawnResult() {} func (AgentRegistrySpawnError) Kind() AgentRegistrySpawnResultKind { return AgentRegistrySpawnResultKindSpawnError } - // Spawn succeeded but the child did not publish a matching managed-server entry within the // timeout. // Experimental: AgentRegistrySpawnRegistryTimeout is part of an experimental API and may @@ -368,7 +366,6 @@ func (AgentRegistrySpawnRegistryTimeout) agentRegistrySpawnResult() {} func (AgentRegistrySpawnRegistryTimeout) Kind() AgentRegistrySpawnResultKind { return AgentRegistrySpawnResultKindRegistryTimeout } - // Managed-server child was spawned and registered successfully. // Experimental: AgentRegistrySpawnSpawned is part of an experimental API and may change or // be removed. @@ -392,7 +389,6 @@ func (AgentRegistrySpawnSpawned) agentRegistrySpawnResult() {} func (AgentRegistrySpawnSpawned) Kind() AgentRegistrySpawnResultKind { return AgentRegistrySpawnResultKindSpawned } - // Synchronous pre-validation rejected the spawn request. // Experimental: AgentRegistrySpawnValidationError is part of an experimental API and may // change or be removed. @@ -487,7 +483,6 @@ func (RawAttachmentData) attachment() {} func (r RawAttachmentData) Type() AttachmentType { return r.Discriminator } - // Blob attachment with inline base64-encoded data // Experimental: AttachmentBlob is part of an experimental API and may change or be removed. type AttachmentBlob struct { @@ -512,7 +507,6 @@ func (AttachmentBlob) attachment() {} func (AttachmentBlob) Type() AttachmentType { return AttachmentTypeBlob } - // Directory attachment // Experimental: AttachmentDirectory is part of an experimental API and may change or be // removed. @@ -531,7 +525,6 @@ func (AttachmentDirectory) attachment() {} func (AttachmentDirectory) Type() AttachmentType { return AttachmentTypeDirectory } - // Structured context contributed by an extension. Composer pills displayed in the host are // forwarded back through session.send.attachments, then rendered into the model prompt as // an XML block. @@ -558,7 +551,6 @@ func (AttachmentExtensionContext) attachment() {} func (AttachmentExtensionContext) Type() AttachmentType { return AttachmentTypeExtensionContext } - // File attachment // Experimental: AttachmentFile is part of an experimental API and may change or be removed. type AttachmentFile struct { @@ -590,7 +582,6 @@ func (AttachmentFile) attachment() {} func (AttachmentFile) Type() AttachmentType { return AttachmentTypeFile } - // Pointer to a GitHub Actions job. // Experimental: AttachmentGitHubActionsJob is part of an experimental API and may change or // be removed. @@ -614,7 +605,6 @@ func (AttachmentGitHubActionsJob) attachment() {} func (AttachmentGitHubActionsJob) Type() AttachmentType { return AttachmentTypeGitHubActionsJob } - // Pointer to a GitHub commit. // Experimental: AttachmentGitHubCommit is part of an experimental API and may change or be // removed. @@ -633,7 +623,6 @@ func (AttachmentGitHubCommit) attachment() {} func (AttachmentGitHubCommit) Type() AttachmentType { return AttachmentTypeGitHubCommit } - // Pointer to a file in a GitHub repository at a specific ref. // Experimental: AttachmentGitHubFile is part of an experimental API and may change or be // removed. @@ -652,7 +641,6 @@ func (AttachmentGitHubFile) attachment() {} func (AttachmentGitHubFile) Type() AttachmentType { return AttachmentTypeGitHubFile } - // Pointer to a single-file diff. At least one of `head` and `base` must be present. // Experimental: AttachmentGitHubFileDiff is part of an experimental API and may change or // be removed. @@ -669,7 +657,6 @@ func (AttachmentGitHubFileDiff) attachment() {} func (AttachmentGitHubFileDiff) Type() AttachmentType { return AttachmentTypeGitHubFileDiff } - // GitHub issue, pull request, or discussion reference // Experimental: AttachmentGitHubReference is part of an experimental API and may change or // be removed. @@ -690,7 +677,6 @@ func (AttachmentGitHubReference) attachment() {} func (AttachmentGitHubReference) Type() AttachmentType { return AttachmentTypeGitHubReference } - // Pointer to a GitHub release. // Experimental: AttachmentGitHubRelease is part of an experimental API and may change or be // removed. @@ -709,7 +695,6 @@ func (AttachmentGitHubRelease) attachment() {} func (AttachmentGitHubRelease) Type() AttachmentType { return AttachmentTypeGitHubRelease } - // Pointer to a GitHub repository. // Experimental: AttachmentGitHubRepository is part of an experimental API and may change or // be removed. @@ -729,7 +714,6 @@ func (AttachmentGitHubRepository) attachment() {} func (AttachmentGitHubRepository) Type() AttachmentType { return AttachmentTypeGitHubRepository } - // Pointer to a line range inside a file in a GitHub repository. // Experimental: AttachmentGitHubSnippet is part of an experimental API and may change or be // removed. @@ -750,7 +734,6 @@ func (AttachmentGitHubSnippet) attachment() {} func (AttachmentGitHubSnippet) Type() AttachmentType { return AttachmentTypeGitHubSnippet } - // Pointer to a comparison between two git revisions. // Experimental: AttachmentGitHubTreeComparison is part of an experimental API and may // change or be removed. @@ -767,7 +750,6 @@ func (AttachmentGitHubTreeComparison) attachment() {} func (AttachmentGitHubTreeComparison) Type() AttachmentType { return AttachmentTypeGitHubTreeComparison } - // Generic GitHub URL reference. // Experimental: AttachmentGitHubURL is part of an experimental API and may change or be // removed. @@ -780,7 +762,6 @@ func (AttachmentGitHubURL) attachment() {} func (AttachmentGitHubURL) Type() AttachmentType { return AttachmentTypeGitHubURL } - // Code selection attachment from an editor // Experimental: AttachmentSelection is part of an experimental API and may change or be // removed. @@ -897,7 +878,6 @@ func (RawAuthInfoData) authInfo() {} func (r RawAuthInfoData) Type() AuthInfoType { return r.Discriminator } - // Authentication-info input variant for API-key authentication to a non-GitHub LLM // provider, carrying the secret `apiKey` and host. // Experimental: APIKeyAuthInfo is part of an experimental API and may change or be removed. @@ -916,7 +896,6 @@ func (APIKeyAuthInfo) authInfo() {} func (APIKeyAuthInfo) Type() AuthInfoType { return AuthInfoTypeAPIKey } - // Authentication-info variant for direct Copilot API token auth sourced from environment // variables, with public GitHub host. // Experimental: CopilotAPITokenAuthInfo is part of an experimental API and may change or be @@ -934,7 +913,6 @@ func (CopilotAPITokenAuthInfo) authInfo() {} func (CopilotAPITokenAuthInfo) Type() AuthInfoType { return AuthInfoTypeCopilotAPIToken } - // Authentication-info input variant for a token sourced from an environment variable, with // host, optional login, token, and env var name. // Experimental: EnvAuthInfo is part of an experimental API and may change or be removed. @@ -958,7 +936,6 @@ func (EnvAuthInfo) authInfo() {} func (EnvAuthInfo) Type() AuthInfoType { return AuthInfoTypeEnv } - // Authentication-info input variant for GitHub CLI credentials, carrying host, login, and // the `gh auth token` value. // Experimental: GhCLIAuthInfo is part of an experimental API and may change or be removed. @@ -979,7 +956,6 @@ func (GhCLIAuthInfo) authInfo() {} func (GhCLIAuthInfo) Type() AuthInfoType { return AuthInfoTypeGhCLI } - // Authentication-info input variant for GitHub-internal HMAC auth, carrying the public // GitHub host and HMAC secret. // Experimental: HMACAuthInfo is part of an experimental API and may change or be removed. @@ -998,7 +974,6 @@ func (HMACAuthInfo) authInfo() {} func (HMACAuthInfo) Type() AuthInfoType { return AuthInfoTypeHMAC } - // Authentication-info input variant for SDK-configured token authentication, carrying host // and the secret token value. // Experimental: TokenAuthInfo is part of an experimental API and may change or be removed. @@ -1019,7 +994,6 @@ func (TokenAuthInfo) authInfo() {} func (TokenAuthInfo) Type() AuthInfoType { return AuthInfoTypeToken } - // Authentication-info variant backed by an SDK GitHub token callback. It carries routing // metadata but never a plaintext token. // Experimental: TokenProviderAuthInfo is part of an experimental API and may change or be @@ -1037,7 +1011,6 @@ func (TokenProviderAuthInfo) authInfo() {} func (TokenProviderAuthInfo) Type() AuthInfoType { return AuthInfoTypeTokenProvider } - // Authentication-info variant for OAuth user auth, with host and login; the token remains // in the runtime secret store. // Experimental: UserAuthInfo is part of an experimental API and may change or be removed. @@ -1477,7 +1450,6 @@ func (RawCatalogCandidateData) catalogCandidate() {} func (r RawCatalogCandidateData) Kind() CatalogCandidateKind { return r.Discriminator } - // An inert AI skill catalog result. AI skills are discovery-only and cannot be represented // as installable through this surface. // Experimental: CatalogAiSkillCandidate is part of an experimental API and may change or be @@ -1510,7 +1482,6 @@ func (CatalogAiSkillCandidate) catalogCandidate() {} func (CatalogAiSkillCandidate) Kind() CatalogCandidateKind { return CatalogCandidateKindAiSkill } - // An inert MCP server catalog result. Every free-text field is untrusted external data and // must never be treated as an instruction, and the handle is the only way to refer to the // candidate in a later operation. @@ -1564,7 +1535,6 @@ func (RawCatalogCandidateSourceData) catalogCandidateSource() {} func (r RawCatalogCandidateSourceData) Kind() CatalogCandidateSourceKind { return r.Discriminator } - // Candidate whose card reference arrived inline. The document and its content-derived // properties stay behind the runtime boundary. // Experimental: CatalogCandidateSourceEmbedded is part of an experimental API and may @@ -1576,7 +1546,6 @@ func (CatalogCandidateSourceEmbedded) catalogCandidateSource() {} func (CatalogCandidateSourceEmbedded) Kind() CatalogCandidateSourceKind { return CatalogCandidateSourceKindEmbedded } - // Candidate whose card is retrieved from a URL through the runtime's hardened fetch // boundary. // Experimental: CatalogCandidateSourceURL is part of an experimental API and may change or @@ -1681,7 +1650,6 @@ func (RawCatalogSearchResultData) catalogSearchResult() {} func (r RawCatalogSearchResultData) Kind() CatalogSearchResultKind { return r.Discriminator } - // An optional catalog authentication exchange did not establish the caller's identity. // Anonymous search remains supported; this refusal is reserved for an operation that cannot // continue after the attempted exchange. It is distinct from `policy-rejected` and from a @@ -1701,7 +1669,6 @@ func (CatalogAuthenticationRequiredError) catalogSearchResult() {} func (CatalogAuthenticationRequiredError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindAuthenticationRequired } - // An upstream catalog response broke the wire contract. Most importantly, every result must // carry exactly one of a URL or embedded data: a result carrying both, or neither, is // refused here rather than being guessed at. @@ -1719,7 +1686,6 @@ func (CatalogContractViolationError) catalogSearchResult() {} func (CatalogContractViolationError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindContractViolation } - // The request was rejected before any work was done, because a bounded field fell outside // its permitted range or a required field was unusable. // Experimental: CatalogInvalidRequestError is part of an experimental API and may change or @@ -1736,7 +1702,6 @@ func (CatalogInvalidRequestError) catalogSearchResult() {} func (CatalogInvalidRequestError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindInvalidRequest } - // A card could not be parsed or did not satisfy its declared media type's schema. // Experimental: CatalogMalformedCardError is part of an experimental API and may change or // be removed. @@ -1754,7 +1719,6 @@ func (CatalogMalformedCardError) catalogSearchResult() {} func (CatalogMalformedCardError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindMalformedCard } - // The caller's protocol version or required capabilities cannot be honoured. Returned // instead of a partial or ambiguous success. // Experimental: CatalogNegotiationRefusedError is part of an experimental API and may @@ -1781,7 +1745,6 @@ func (CatalogNegotiationRefusedError) catalogSearchResult() {} func (CatalogNegotiationRefusedError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindNegotiationRefused } - // The runtime could not reach the catalog authority or retrieve a card. Covers being // offline as well as transport-level failure. // Experimental: CatalogNetworkFailureError is part of an experimental API and may change or @@ -1804,7 +1767,6 @@ func (CatalogNetworkFailureError) catalogSearchResult() {} func (CatalogNetworkFailureError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindNetworkFailure } - // Registry or enterprise policy refused the operation. // Experimental: CatalogPolicyRejectedError is part of an experimental API and may change or // be removed. @@ -1820,7 +1782,6 @@ func (CatalogPolicyRejectedError) catalogSearchResult() {} func (CatalogPolicyRejectedError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindPolicyRejected } - // A completed catalog search: inert candidate summaries, each carrying a single-use handle. // Experimental: CatalogSearchSucceeded is part of an experimental API and may change or be // removed. @@ -1845,7 +1806,6 @@ func (CatalogSearchSucceeded) catalogSearchResult() {} func (CatalogSearchSucceeded) Kind() CatalogSearchResultKind { return CatalogSearchResultKindSucceeded } - // The operation is not available on this runtime. Distinct from a network failure: nothing // was attempted. // Experimental: CatalogUnavailableError is part of an experimental API and may change or be @@ -1862,7 +1822,6 @@ func (CatalogUnavailableError) catalogSearchResult() {} func (CatalogUnavailableError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindUnavailable } - // Retrieval was refused by the runtime's hardened fetch boundary before any request left // the process, or before a redirect was followed. // Experimental: CatalogUnsafeRetrievalError is part of an experimental API and may change @@ -1880,7 +1839,6 @@ func (CatalogUnsafeRetrievalError) catalogSearchResult() {} func (CatalogUnsafeRetrievalError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindUnsafeRetrieval } - // The request asked for a candidate kind this runtime does not serve. // Experimental: CatalogUnsupportedKindError is part of an experimental API and may change // or be removed. @@ -2264,7 +2222,7 @@ type CopilotUserResponse struct { Login *string `json:"login,omitempty"` // Per-category monthly quota allotments, keyed by quota category. MonthlyQuotas map[string]float64 `json:"monthly_quotas,omitzero"` - // Organizations the user belongs to, each with an optional login and display name. + // Organizations the user belongs to, each with an optional ID, login, and display name. OrganizationList []CopilotUserResponseOrganizationListItem `json:"organization_list,omitzero"` // Logins of the organizations the user belongs to. OrganizationLoginList []string `json:"organization_login_list,omitzero"` @@ -2303,6 +2261,8 @@ type CopilotUserResponseEndpoints struct { } type CopilotUserResponseOrganizationListItem struct { + // Numeric database ID of the organization. + ID *float64 `json:"id,omitempty"` // GitHub login of the organization. Login *string `json:"login,omitempty"` // Display name of the organization. @@ -2500,7 +2460,6 @@ func (RawDebugCollectLogsDestinationData) debugCollectLogsDestination() {} func (r RawDebugCollectLogsDestinationData) Kind() DebugCollectLogsDestinationKind { return r.Discriminator } - type DebugCollectLogsDestinationArchive struct { // When true, create the archive atomically without overwriting an existing file by // appending ` (N)` before the extension as needed. Defaults to false. @@ -2513,7 +2472,6 @@ func (DebugCollectLogsDestinationArchive) debugCollectLogsDestination() {} func (DebugCollectLogsDestinationArchive) Kind() DebugCollectLogsDestinationKind { return DebugCollectLogsDestinationKindArchive } - type DebugCollectLogsDestinationDirectory struct { // Directory where redacted files should be staged. The directory is created if needed. OutputDirectory string `json:"outputDirectory"` @@ -2828,7 +2786,7 @@ type EventLogTailResult struct { // Either '*' to receive all event types, or a non-empty list of event types to receive // Experimental: EventLogTypes is part of an experimental API and may change or be removed. type EventLogTypes struct { - String *EventLogTypesString + String *EventLogTypesString StringArray []string } @@ -2841,16 +2799,14 @@ type EventsReadResult struct { // backward read this cursor pages toward OLDER events; keep passing `direction: backward` // with it (the cursor is also self-describing, so backward paging continues correctly). Cursor string `json:"cursor"` - // Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor - // referred to an event that no longer exists in history (e.g. truncated or compacted away) - // and the read 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. + // Cursor status: 'ok' means the cursor was applied successfully. For session.eventLog.read, + // 'expired' means the cursor referred to an event that no longer exists in active history + // and the read fell back to a boundary of the remaining history: the beginning for a + // forward read or the newest window for a backward read. That fallback may overlap already + // rendered events, so active-session consumers should reset, rebase, or deduplicate before + // continuing. sessions.readPersistedEvents has stricter snapshot semantics: 'expired' + // returns an empty terminal page and never switches to a replacement journal generation. + // Other persisted-read I/O failures are RPC errors with diagnostics, not cursor expiry. CursorStatus EventsCursorStatus `json:"cursorStatus"` // Session events for this batch, merged into a single stream in creation order: durable // (persisted) events and ephemeral events interleave exactly as they were emitted. Set @@ -2859,9 +2815,10 @@ type EventsReadResult struct { // reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window // contains persisted events only, still in chronological (oldest-to-newest) append order. Events []SessionEvent `json:"events"` - // True when 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. + // True when more events are available in the read's direction. For a backward read, true + // means older persisted events remain before the returned window. A persisted-event page + // may contain fewer than `max` events because of its byte budget while still reporting + // hasMore true; continue according to this flag rather than the event count. HasMore bool `json:"hasMore"` } @@ -3046,7 +3003,6 @@ func (RawExternalToolTextResultForLlmContentData) externalToolTextResultForLlmCo func (r RawExternalToolTextResultForLlmContentData) Type() ExternalToolTextResultForLlmContentType { return r.Discriminator } - // Audio content block with base64-encoded data // Experimental: ExternalToolTextResultForLlmContentAudio is part of an experimental API and // may change or be removed. @@ -3061,7 +3017,6 @@ func (ExternalToolTextResultForLlmContentAudio) externalToolTextResultForLlmCont func (ExternalToolTextResultForLlmContentAudio) Type() ExternalToolTextResultForLlmContentType { return ExternalToolTextResultForLlmContentTypeAudio } - // Image content block with base64-encoded data // Experimental: ExternalToolTextResultForLlmContentImage is part of an experimental API and // may change or be removed. @@ -3076,7 +3031,6 @@ func (ExternalToolTextResultForLlmContentImage) externalToolTextResultForLlmCont func (ExternalToolTextResultForLlmContentImage) Type() ExternalToolTextResultForLlmContentType { return ExternalToolTextResultForLlmContentTypeImage } - // Embedded resource content block with inline text or binary data // Experimental: ExternalToolTextResultForLlmContentResource is part of an experimental API // and may change or be removed. @@ -3089,7 +3043,6 @@ func (ExternalToolTextResultForLlmContentResource) externalToolTextResultForLlmC func (ExternalToolTextResultForLlmContentResource) Type() ExternalToolTextResultForLlmContentType { return ExternalToolTextResultForLlmContentTypeResource } - // Resource link content block referencing an external resource // Experimental: ExternalToolTextResultForLlmContentResourceLink is part of an experimental // API and may change or be removed. @@ -3114,7 +3067,6 @@ func (ExternalToolTextResultForLlmContentResourceLink) externalToolTextResultFor func (ExternalToolTextResultForLlmContentResourceLink) Type() ExternalToolTextResultForLlmContentType { return ExternalToolTextResultForLlmContentTypeResourceLink } - // Shell command exit metadata with optional output preview // Experimental: ExternalToolTextResultForLlmContentShellExit is part of an experimental API // and may change or be removed. @@ -3139,7 +3091,6 @@ func (ExternalToolTextResultForLlmContentShellExit) externalToolTextResultForLlm func (ExternalToolTextResultForLlmContentShellExit) Type() ExternalToolTextResultForLlmContentType { return ExternalToolTextResultForLlmContentTypeShellExit } - // Terminal/shell output content block with optional exit code and working directory // Experimental: ExternalToolTextResultForLlmContentTerminal is part of an experimental API // and may change or be removed. @@ -3156,7 +3107,6 @@ func (ExternalToolTextResultForLlmContentTerminal) externalToolTextResultForLlmC func (ExternalToolTextResultForLlmContentTerminal) Type() ExternalToolTextResultForLlmContentType { return ExternalToolTextResultForLlmContentTypeTerminal } - // Plain text content block // Experimental: ExternalToolTextResultForLlmContentText is part of an experimental API and // may change or be removed. @@ -3181,9 +3131,7 @@ type RawExternalToolTextResultForLlmContentResourceDetailsData struct { Raw json.RawMessage } -func (RawExternalToolTextResultForLlmContentResourceDetailsData) externalToolTextResultForLlmContentResourceDetails() { -} - +func (RawExternalToolTextResultForLlmContentResourceDetailsData) externalToolTextResultForLlmContentResourceDetails() {} // Embedded binary resource contents identified by a URI, with an optional MIME type and a // base64-encoded blob. // Experimental: EmbeddedBlobResourceContents is part of an experimental API and may change @@ -3214,6 +3162,7 @@ type EmbeddedTextResourceContents struct { func (EmbeddedTextResourceContents) externalToolTextResultForLlmContentResourceDetails() {} + // Icon image for a resource // Experimental: ExternalToolTextResultForLlmContentResourceLinkIcon is part of an // experimental API and may change or be removed. @@ -3523,7 +3472,6 @@ func (RawFactoryPauseInfoData) factoryPauseInfo() {} func (r RawFactoryPauseInfoData) Type() FactoryPauseInfoType { return r.Discriminator } - type FactoryPauseInfoCheckpoint struct { // Stable author-defined checkpoint key that initiated the pause. Key string `json:"key"` @@ -3533,7 +3481,6 @@ func (FactoryPauseInfoCheckpoint) factoryPauseInfo() {} func (FactoryPauseInfoCheckpoint) Type() FactoryPauseInfoType { return FactoryPauseInfoTypeCheckpoint } - type FactoryPauseInfoUser struct { } @@ -3726,7 +3673,6 @@ func (RawFactoryRunFailureData) factoryRunFailure() {} func (r RawFactoryRunFailureData) Type() FactoryRunFailureType { return r.Discriminator } - // The run stopped because its usage accounting could not be completed. type FactoryRunFailureFactoryAccountingIncomplete struct { // Confirmed usage in nano-AIU, representing the floor of what the run spent. @@ -3739,7 +3685,6 @@ func (FactoryRunFailureFactoryAccountingIncomplete) factoryRunFailure() {} func (FactoryRunFailureFactoryAccountingIncomplete) Type() FactoryRunFailureType { return FactoryRunFailureTypeFactoryAccountingIncomplete } - type FactoryRunFailureFactoryDurableFailure struct { // Stable failure code. Code string `json:"code"` @@ -3753,7 +3698,6 @@ func (FactoryRunFailureFactoryDurableFailure) factoryRunFailure() {} func (FactoryRunFailureFactoryDurableFailure) Type() FactoryRunFailureType { return FactoryRunFailureTypeFactoryDurableFailure } - type FactoryRunFailureFactoryLimitReached struct { // Resource ceiling that stopped the run. Kind FactoryRunFailureKind `json:"kind"` @@ -3769,7 +3713,6 @@ func (FactoryRunFailureFactoryLimitReached) factoryRunFailure() {} func (FactoryRunFailureFactoryLimitReached) Type() FactoryRunFailureType { return FactoryRunFailureTypeFactoryLimitReached } - // The extension that owns the factory disconnected while the run was executing, so the host // halted it. The run's journaled subagent results are preserved so a resume can reuse them. type FactoryRunFailureFactoryProviderDisconnected struct { @@ -3781,7 +3724,6 @@ func (FactoryRunFailureFactoryProviderDisconnected) factoryRunFailure() {} func (FactoryRunFailureFactoryProviderDisconnected) Type() FactoryRunFailureType { return FactoryRunFailureTypeFactoryProviderDisconnected } - type FactoryRunFailureFactoryResumeDeclined struct { // Human-readable reason the resume did not proceed. Reason string `json:"reason"` @@ -3965,12 +3907,24 @@ type FilterMappingEnumMap map[string]ContentFilterMode func (FilterMappingEnumMap) filterMapping() {} -// Optional user prompt to combine with the fleet orchestration instructions. +// Parameters for starting fleet orchestration: an optional user prompt combined with the +// fleet instructions, plus the send options forwarded to the resulting turn. // Experimental: FleetStartRequest is part of an experimental API and may change or be // removed. type FleetStartRequest struct { + // Optional attachments (files, directories, selections, blobs, GitHub references) to + // include with the fleet request + Attachments []Attachment `json:"attachments,omitzero"` + // If false, this request will not trigger a Premium Request Unit charge. User requests + // default to billable. + // Internal: Billable is part of the SDK's internal API surface and is not intended for + // external use. + Billable *bool `json:"billable,omitempty"` // Optional user prompt to combine with fleet instructions Prompt *string `json:"prompt,omitempty"` + // If true, await completion of the agentic loop for this fleet request before returning. + // Defaults to false. + Wait *bool `json:"wait,omitempty"` } // Indicates whether fleet mode was successfully activated. @@ -4128,7 +4082,6 @@ func (RawGitHubTokenAcquireResultData) githubTokenAcquireResult() {} func (r RawGitHubTokenAcquireResultData) Kind() GitHubTokenAcquireResultKind { return r.Discriminator } - type GitHubTokenAcquireResultCancelled struct { } @@ -4136,7 +4089,6 @@ func (GitHubTokenAcquireResultCancelled) githubTokenAcquireResult() {} func (GitHubTokenAcquireResultCancelled) Kind() GitHubTokenAcquireResultKind { return GitHubTokenAcquireResultKindCancelled } - type GitHubTokenAcquireResultToken struct { // GitHub access token acquired by the SDK host. AccessToken string `json:"accessToken"` @@ -4436,9 +4388,9 @@ type HistoryTruncateResult struct { // removed. // Internal: HookInvokeRequest is an internal SDK API and is not part of the public surface. type HookInvokeRequest struct { - HookType HookType `json:"hookType"` - Input any `json:"input"` - SessionID string `json:"sessionId"` + HookType HookType `json:"hookType"` + Input any `json:"input"` + SessionID string `json:"sessionId"` } // Optional output returned by an SDK callback hook. @@ -4546,9 +4498,9 @@ type InstalledPluginInfo struct { // removed. type InstalledPluginSource struct { InstalledPluginSourceGitHub *InstalledPluginSourceGitHub - InstalledPluginSourceLocal *InstalledPluginSourceLocal - InstalledPluginSourceURL *InstalledPluginSourceURL - String *string + InstalledPluginSourceLocal *InstalledPluginSourceLocal + InstalledPluginSourceURL *InstalledPluginSourceURL + String *string } // Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref or @@ -4714,8 +4666,10 @@ type JSONSchemaResponseFormat struct { Description *string `json:"description,omitempty"` // Name of the output schema, subject to the provider's naming restrictions. Name string `json:"name"` - // JSON Schema passed unchanged to the inference provider. Supported keywords and schema - // restrictions are determined by that provider. + // JSON Schema passed unchanged to the inference provider. Schemas larger than 32 MiB when + // JSON-encoded are rejected before admission, using the runtime's existing request-size + // ceiling. This is not a guarantee that the entire model request fits. Supported keywords + // and schema restrictions are determined by the provider. Schema any `json:"schema"` // Optional strict enforcement setting for OpenAI providers. Omitted uses the provider // default. Anthropic always enforces its supported schema subset. @@ -5470,29 +5424,24 @@ type RawMCPHeadersHandlePendingHeadersRefreshRequestData struct { Raw json.RawMessage } -func (RawMCPHeadersHandlePendingHeadersRefreshRequestData) mcpHeadersHandlePendingHeadersRefreshRequest() { -} +func (RawMCPHeadersHandlePendingHeadersRefreshRequestData) mcpHeadersHandlePendingHeadersRefreshRequest() {} func (r RawMCPHeadersHandlePendingHeadersRefreshRequestData) Kind() MCPHeadersHandlePendingHeadersRefreshRequestKind { return r.Discriminator } - type MCPHeadersHandlePendingHeadersRefreshRequestHeaders struct { // Headers to overlay onto the MCP request. Dynamic headers override static config headers // but do not replace SDK-managed request headers. Headers map[string]string `json:"headers"` } -func (MCPHeadersHandlePendingHeadersRefreshRequestHeaders) mcpHeadersHandlePendingHeadersRefreshRequest() { -} +func (MCPHeadersHandlePendingHeadersRefreshRequestHeaders) mcpHeadersHandlePendingHeadersRefreshRequest() {} func (MCPHeadersHandlePendingHeadersRefreshRequestHeaders) Kind() MCPHeadersHandlePendingHeadersRefreshRequestKind { return MCPHeadersHandlePendingHeadersRefreshRequestKindHeaders } - type MCPHeadersHandlePendingHeadersRefreshRequestNone struct { } -func (MCPHeadersHandlePendingHeadersRefreshRequestNone) mcpHeadersHandlePendingHeadersRefreshRequest() { -} +func (MCPHeadersHandlePendingHeadersRefreshRequestNone) mcpHeadersHandlePendingHeadersRefreshRequest() {} func (MCPHeadersHandlePendingHeadersRefreshRequestNone) Kind() MCPHeadersHandlePendingHeadersRefreshRequestKind { return MCPHeadersHandlePendingHeadersRefreshRequestKindNone } @@ -5703,7 +5652,6 @@ func (RawMCPOauthPendingRequestResponseData) mcpOauthPendingRequestResponse() {} func (r RawMCPOauthPendingRequestResponseData) Kind() MCPOauthPendingRequestResponseKind { return r.Discriminator } - type MCPOauthPendingRequestResponseCancelled struct { } @@ -5711,7 +5659,6 @@ func (MCPOauthPendingRequestResponseCancelled) mcpOauthPendingRequestResponse() func (MCPOauthPendingRequestResponseCancelled) Kind() MCPOauthPendingRequestResponseKind { return MCPOauthPendingRequestResponseKindCancelled } - type MCPOauthPendingRequestResponseToken struct { // Access token acquired by the SDK host AccessToken string `json:"accessToken"` @@ -5755,7 +5702,6 @@ func (RawMCPOauthProbeResultData) mcpOauthProbeResult() {} func (r RawMCPOauthProbeResultData) Status() MCPOauthProbeResultStatus { return r.Discriminator } - type MCPOauthProbeResultAuthenticated struct { // HTTP response returned by the server. HTTPResponse MCPOauthHTTPResponse `json:"httpResponse"` @@ -5765,7 +5711,6 @@ func (MCPOauthProbeResultAuthenticated) mcpOauthProbeResult() {} func (MCPOauthProbeResultAuthenticated) Status() MCPOauthProbeResultStatus { return MCPOauthProbeResultStatusAuthenticated } - type MCPOauthProbeResultFailed struct { // Human-readable probe failure detail. Error string `json:"error"` @@ -5778,7 +5723,6 @@ func (MCPOauthProbeResultFailed) mcpOauthProbeResult() {} func (MCPOauthProbeResultFailed) Status() MCPOauthProbeResultStatus { return MCPOauthProbeResultStatusFailed } - type MCPOauthProbeResultNeedsAuth struct { // HTTP 401 or 403 response returned by the server. HTTPResponse MCPOauthHTTPResponse `json:"httpResponse"` @@ -5792,7 +5736,6 @@ func (MCPOauthProbeResultNeedsAuth) mcpOauthProbeResult() {} func (MCPOauthProbeResultNeedsAuth) Status() MCPOauthProbeResultStatus { return MCPOauthProbeResultStatusNeedsAuth } - type MCPOauthProbeResultNoAuthRequired struct { // HTTP response returned by the server. HTTPResponse MCPOauthHTTPResponse `json:"httpResponse"` @@ -5878,7 +5821,6 @@ func (CatalogContractViolationError) mcpPlanInstallResult() {} func (CatalogContractViolationError) mcpPlanInstallResultKind() MCPPlanInstallResultKind { return MCPPlanInstallResultKindContractViolation } - // A presented handle was not accepted. Handles are runtime-instance scoped, TTL-bound, and // single-use, so each way of failing is reported distinctly. // Experimental: CatalogHandleRejectedError is part of an experimental API and may change or @@ -5913,7 +5855,6 @@ func (CatalogNetworkFailureError) mcpPlanInstallResult() {} func (CatalogNetworkFailureError) mcpPlanInstallResultKind() MCPPlanInstallResultKind { return MCPPlanInstallResultKindNetworkFailure } - // The candidate is discoverable but cannot be installed. `application/ai-skill` resolves // here, because it stays searchable while remaining typed non-installable. // Experimental: CatalogNotInstallableError is part of an experimental API and may change or @@ -5938,7 +5879,6 @@ func (CatalogUnavailableError) mcpPlanInstallResult() {} func (CatalogUnavailableError) mcpPlanInstallResultKind() MCPPlanInstallResultKind { return MCPPlanInstallResultKindUnavailable } - // No transport this runtime can use is available for the requested server. // Experimental: CatalogUnavailableTransportError is part of an experimental API and may // change or be removed. @@ -5958,7 +5898,6 @@ func (CatalogUnsafeRetrievalError) mcpPlanInstallResult() {} func (CatalogUnsafeRetrievalError) mcpPlanInstallResultKind() MCPPlanInstallResultKind { return MCPPlanInstallResultKindUnsafeRetrieval } - // A computed MCP install plan. Nothing has been applied: the plan describes what installing // would change, and the plan handle is what a later apply operation would consume. // Experimental: MCPPlanInstallPlanned is part of an experimental API and may change or be @@ -5993,7 +5932,6 @@ func (RawMCPPlanInstallSourceData) mcpPlanInstallSource() {} func (r RawMCPPlanInstallSourceData) Kind() MCPPlanInstallSourceKind { return r.Discriminator } - // Plan from a candidate returned by a previous catalog search. // Experimental: MCPPlanInstallSourceCandidate is part of an experimental API and may change // or be removed. @@ -6014,7 +5952,6 @@ func (MCPPlanInstallSourceCandidate) mcpPlanInstallSource() {} func (MCPPlanInstallSourceCandidate) Kind() MCPPlanInstallSourceKind { return MCPPlanInstallSourceKindCandidate } - // Plan from a card supplied directly by the caller, without a preceding search. // Experimental: MCPPlanInstallSourceCard is part of an experimental API and may change or // be removed. @@ -6077,7 +6014,6 @@ func (RawMCPPlanRequiredValueData) mcpPlanRequiredValue() {} func (r RawMCPPlanRequiredValueData) Kind() MCPPlanRequiredValueKind { return r.Discriminator } - // One enumerated non-secret value a transport choice needs before it can be applied. The // permitted values are structurally required. // Experimental: MCPPlanRequiredValueEnum is part of an experimental API and may change or @@ -6108,7 +6044,6 @@ func (MCPPlanRequiredValueEnum) mcpPlanRequiredValue() {} func (MCPPlanRequiredValueEnum) Kind() MCPPlanRequiredValueKind { return MCPPlanRequiredValueKindEnum } - // One non-secret scalar value a transport choice needs before it can be applied. // Experimental: MCPPlanRequiredValueScalar is part of an experimental API and may change or // be removed. @@ -6200,7 +6135,6 @@ func (RawMCPPlanTransportChoiceData) mcpPlanTransportChoice() {} func (r RawMCPPlanTransportChoiceData) Transport() MCPPlanTransportChoiceTransport { return r.Discriminator } - // An eligible local-package transport choice. Package identity is required and a remote // endpoint cannot be represented. // Experimental: MCPPlanTransportChoicePackage is part of an experimental API and may change @@ -6225,7 +6159,6 @@ func (MCPPlanTransportChoicePackage) mcpPlanTransportChoice() {} func (MCPPlanTransportChoicePackage) Transport() MCPPlanTransportChoiceTransport { return MCPPlanTransportChoiceTransportStdio } - // An eligible remote-endpoint transport choice. The endpoint is required and package // identity cannot be represented. // Experimental: MCPPlanTransportChoiceRemote is part of an experimental API and may change @@ -6242,7 +6175,7 @@ type MCPPlanTransportChoiceRemote struct { RequiredValues []MCPPlanRequiredValue `json:"requiredValues"` // Secrets this choice requires, referenced by placeholder only. SecretPlaceholders []MCPPlanSecretPlaceholder `json:"secretPlaceholders"` - Discriminator MCPPlanRemoteTransport `json:"transport,omitempty"` + Discriminator MCPPlanRemoteTransport `json:"transport,omitempty"` } func (MCPPlanTransportChoiceRemote) mcpPlanTransportChoice() {} @@ -6281,18 +6214,18 @@ type MCPRegisterExternalClientRequest struct { type MCPReloadConfig struct { ActiveGitHubToken *string `json:"activeGitHubToken,omitempty"` // Server names the CLI enabled for this session via `--enable-mcp-server`. - CLIEnabledServers []string `json:"cliEnabledServers,omitzero"` - ConfigFilter any `json:"configFilter,omitempty"` - DisabledServers []string `json:"disabledServers,omitzero"` - EnabledServers []string `json:"enabledServers,omitzero"` - ForceRestart *bool `json:"forceRestart,omitempty"` - GitHubMCPToolOptions any `json:"githubMcpToolOptions,omitempty"` - GitHubMCPUserOverride *bool `json:"githubMcpUserOverride,omitempty"` - IncludeWorkspaceSources *bool `json:"includeWorkspaceSources,omitempty"` - Mcp3pEnabled *bool `json:"mcp3pEnabled,omitempty"` - MCPServers map[string]MCPServerConfig `json:"mcpServers"` - SecretStore any `json:"secretStore,omitempty"` - UseCachedToolSnapshots *bool `json:"useCachedToolSnapshots,omitempty"` + CLIEnabledServers []string `json:"cliEnabledServers,omitzero"` + ConfigFilter any `json:"configFilter,omitempty"` + DisabledServers []string `json:"disabledServers,omitzero"` + EnabledServers []string `json:"enabledServers,omitzero"` + ForceRestart *bool `json:"forceRestart,omitempty"` + GitHubMCPToolOptions any `json:"githubMcpToolOptions,omitempty"` + GitHubMCPUserOverride *bool `json:"githubMcpUserOverride,omitempty"` + IncludeWorkspaceSources *bool `json:"includeWorkspaceSources,omitempty"` + Mcp3pEnabled *bool `json:"mcp3pEnabled,omitempty"` + MCPServers map[string]MCPServerConfig `json:"mcpServers"` + SecretStore any `json:"secretStore,omitempty"` + UseCachedToolSnapshots *bool `json:"useCachedToolSnapshots,omitempty"` } // Opaque MCP reload configuration. @@ -6538,7 +6471,6 @@ type RawMCPSerializableServerConfigData struct { } func (RawMCPSerializableServerConfigData) mcpSerializableServerConfig() {} - // Remote MCP server configuration accessed over HTTP or SSE. // Experimental: MCPServerConfigHTTP is part of an experimental API and may change or be // removed. @@ -6667,6 +6599,7 @@ type MCPServerConfigStdio struct { func (MCPServerConfigStdio) mcpSerializableServerConfig() {} + // MCP server status entry, including config source/plugin source and any connection error. // Experimental: MCPServer is part of an experimental API and may change or be removed. type MCPServer struct { @@ -6728,7 +6661,6 @@ func (RawMCPServerCardReferenceData) mcpServerCardReference() {} func (r RawMCPServerCardReferenceData) Kind() MCPServerCardReferenceKind { return r.Discriminator } - // An MCP server card supplied inline as an inert document. // Experimental: MCPServerCardEmbedded is part of an experimental API and may change or be // removed. @@ -6744,7 +6676,6 @@ func (MCPServerCardEmbedded) mcpServerCardReference() {} func (MCPServerCardEmbedded) Kind() MCPServerCardReferenceKind { return MCPServerCardReferenceKindEmbedded } - // An MCP server card to be retrieved from a URL through the runtime's hardened fetch // boundary. // Experimental: MCPServerCardURL is part of an experimental API and may change or be @@ -6774,7 +6705,7 @@ type RawMCPServerConfigData struct { } func (RawMCPServerConfigData) mcpServerConfig() {} -func (MCPServerConfigHTTP) mcpServerConfig() {} +func (MCPServerConfigHTTP) mcpServerConfig() {} // In-process MCP server configuration used by embedded SDK clients. // Experimental: MCPServerConfigMemory is part of an experimental API and may change or be @@ -6831,6 +6762,7 @@ func (MCPServerConfigMemory) mcpServerConfig() {} func (MCPServerConfigStdio) mcpServerConfig() {} + // Recorded MCP server connection failure. // Experimental: MCPServerFailureInfo is part of an experimental API and may change or be // removed. @@ -7699,6 +7631,9 @@ type ModelWarningText struct { type ModeSetRequest struct { // Explicit response to a model-switch compaction preflight. CompactionDecision *string `json:"compactionDecision,omitempty"` + // Mode the session must currently be in for the change to apply. When set and the session + // is in a different mode the request is a no-op and reports status 'unchanged'. + ExpectedMode *SessionMode `json:"expectedMode,omitempty"` // Session whose plan-mode base state should be inherited. InheritPlanBaseFromSessionID *string `json:"inheritPlanBaseFromSessionId,omitempty"` // The session mode the agent is operating in @@ -7735,6 +7670,10 @@ type ModeSetResult struct { DeprecationWarnings []string `json:"deprecationWarnings,omitzero"` // User-facing outcome message for the model switch triggered by the mode change. Message *string `json:"message,omitempty"` + // Whether the requested mode was applied to the session. False only when an 'expectedMode' + // precondition did not hold, in which case any model change reported alongside it was still + // applied. + ModeApplied *bool `json:"modeApplied,omitempty"` // Whether applying the mode changed the active model. ModelChanged bool `json:"modelChanged"` // Lifecycle status of the requested mode change. @@ -7917,7 +7856,6 @@ func (RawPermissionDecisionData) permissionDecision() {} func (r RawPermissionDecisionData) Kind() PermissionDecisionKind { return r.Discriminator } - // Permission-decision variant indicating the request was approved. // Experimental: PermissionDecisionApproved is part of an experimental API and may change or // be removed. @@ -7928,7 +7866,6 @@ func (PermissionDecisionApproved) permissionDecision() {} func (PermissionDecisionApproved) Kind() PermissionDecisionKind { return PermissionDecisionKindApproved } - // Permission-decision variant indicating approval was persisted for a project location, // with approval details and location key. // Experimental: PermissionDecisionApprovedForLocation is part of an experimental API and @@ -7944,7 +7881,6 @@ func (PermissionDecisionApprovedForLocation) permissionDecision() {} func (PermissionDecisionApprovedForLocation) Kind() PermissionDecisionKind { return PermissionDecisionKindApprovedForLocation } - // Permission-decision variant indicating approval was remembered for the session, with // approval details. // Experimental: PermissionDecisionApprovedForSession is part of an experimental API and may @@ -7958,7 +7894,6 @@ func (PermissionDecisionApprovedForSession) permissionDecision() {} func (PermissionDecisionApprovedForSession) Kind() PermissionDecisionKind { return PermissionDecisionKindApprovedForSession } - // Permission-decision request variant to approve and persist a permission for a project // location, with approval details and location key. // Experimental: PermissionDecisionApproveForLocation is part of an experimental API and may @@ -7974,7 +7909,6 @@ func (PermissionDecisionApproveForLocation) permissionDecision() {} func (PermissionDecisionApproveForLocation) Kind() PermissionDecisionKind { return PermissionDecisionKindApproveForLocation } - // Permission-decision request variant to approve for the rest of the session, with optional // tool approval or URL domain. // Experimental: PermissionDecisionApproveForSession is part of an experimental API and may @@ -7990,7 +7924,6 @@ func (PermissionDecisionApproveForSession) permissionDecision() {} func (PermissionDecisionApproveForSession) Kind() PermissionDecisionKind { return PermissionDecisionKindApproveForSession } - // Permission-decision request variant to approve only the current permission request. // Experimental: PermissionDecisionApproveOnce is part of an experimental API and may change // or be removed. @@ -8003,7 +7936,6 @@ func (PermissionDecisionApproveOnce) permissionDecision() {} func (PermissionDecisionApproveOnce) Kind() PermissionDecisionKind { return PermissionDecisionKindApproveOnce } - // Permission-decision request variant to permanently approve a URL domain across sessions. // Experimental: PermissionDecisionApprovePermanently is part of an experimental API and may // change or be removed. @@ -8016,7 +7948,6 @@ func (PermissionDecisionApprovePermanently) permissionDecision() {} func (PermissionDecisionApprovePermanently) Kind() PermissionDecisionKind { return PermissionDecisionKindApprovePermanently } - // Permission-decision variant indicating the request was cancelled before use, with an // optional reason. // Experimental: PermissionDecisionCancelled is part of an experimental API and may change @@ -8030,7 +7961,6 @@ func (PermissionDecisionCancelled) permissionDecision() {} func (PermissionDecisionCancelled) Kind() PermissionDecisionKind { return PermissionDecisionKindCancelled } - // Permission-decision variant indicating denial by content-exclusion policy, with path and // message. // Experimental: PermissionDecisionDeniedByContentExclusionPolicy is part of an experimental @@ -8046,7 +7976,6 @@ func (PermissionDecisionDeniedByContentExclusionPolicy) permissionDecision() {} func (PermissionDecisionDeniedByContentExclusionPolicy) Kind() PermissionDecisionKind { return PermissionDecisionKindDeniedByContentExclusionPolicy } - // Permission-decision variant indicating denial by a permission request hook, with optional // message and interrupt flag. // Experimental: PermissionDecisionDeniedByPermissionRequestHook is part of an experimental @@ -8062,7 +7991,6 @@ func (PermissionDecisionDeniedByPermissionRequestHook) permissionDecision() {} func (PermissionDecisionDeniedByPermissionRequestHook) Kind() PermissionDecisionKind { return PermissionDecisionKindDeniedByPermissionRequestHook } - // Permission-decision variant indicating explicit denial by permission rules, with the // matching rules. // Experimental: PermissionDecisionDeniedByRules is part of an experimental API and may @@ -8076,7 +8004,6 @@ func (PermissionDecisionDeniedByRules) permissionDecision() {} func (PermissionDecisionDeniedByRules) Kind() PermissionDecisionKind { return PermissionDecisionKindDeniedByRules } - // Permission-decision variant indicating the user denied an interactive prompt, with // optional feedback and force-reject flag. // Experimental: PermissionDecisionDeniedInteractivelyByUser is part of an experimental API @@ -8092,7 +8019,6 @@ func (PermissionDecisionDeniedInteractivelyByUser) permissionDecision() {} func (PermissionDecisionDeniedInteractivelyByUser) Kind() PermissionDecisionKind { return PermissionDecisionKindDeniedInteractivelyByUser } - // Permission-decision variant indicating no approval rule matched and user confirmation was // unavailable. // Experimental: PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser is part of @@ -8104,7 +8030,6 @@ func (PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser) permissi func (PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser) Kind() PermissionDecisionKind { return PermissionDecisionKindDeniedNoApprovalRuleAndCouldNotRequestFromUser } - // Permission-decision request variant to reject a pending permission request, with optional // feedback. // Experimental: PermissionDecisionReject is part of an experimental API and may change or @@ -8118,7 +8043,6 @@ func (PermissionDecisionReject) permissionDecision() {} func (PermissionDecisionReject) Kind() PermissionDecisionKind { return PermissionDecisionKindReject } - // Permission-decision variant indicating no user was available to confirm the request. // Experimental: PermissionDecisionUserNotAvailable is part of an experimental API and may // change or be removed. @@ -8143,12 +8067,10 @@ type RawPermissionDecisionApproveForLocationApprovalData struct { Raw json.RawMessage } -func (RawPermissionDecisionApproveForLocationApprovalData) permissionDecisionApproveForLocationApproval() { -} +func (RawPermissionDecisionApproveForLocationApprovalData) permissionDecisionApproveForLocationApproval() {} func (r RawPermissionDecisionApproveForLocationApprovalData) Kind() PermissionDecisionApproveForLocationApprovalKind { return r.Discriminator } - // Location-scoped approval details for specific command identifiers. // Experimental: PermissionDecisionApproveForLocationApprovalCommands is part of an // experimental API and may change or be removed. @@ -8157,12 +8079,10 @@ type PermissionDecisionApproveForLocationApprovalCommands struct { CommandIdentifiers []string `json:"commandIdentifiers"` } -func (PermissionDecisionApproveForLocationApprovalCommands) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalCommands) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalCommands) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindCommands } - // Location-scoped approval details for a custom tool, keyed by tool name. // Experimental: PermissionDecisionApproveForLocationApprovalCustomTool is part of an // experimental API and may change or be removed. @@ -8171,12 +8091,10 @@ type PermissionDecisionApproveForLocationApprovalCustomTool struct { ToolName string `json:"toolName"` } -func (PermissionDecisionApproveForLocationApprovalCustomTool) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalCustomTool) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalCustomTool) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindCustomTool } - // Location-scoped approval details for an extension's access to sensitive environment // variables, keyed by extension name and the exact set of variable names. // Experimental: PermissionDecisionApproveForLocationApprovalExtensionEnvAccess is part of @@ -8189,12 +8107,10 @@ type PermissionDecisionApproveForLocationApprovalExtensionEnvAccess struct { ExtensionName string `json:"extensionName"` } -func (PermissionDecisionApproveForLocationApprovalExtensionEnvAccess) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalExtensionEnvAccess) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalExtensionEnvAccess) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindExtensionEnvAccess } - // Location-scoped approval details for extension-management operations, optionally narrowed // by operation. // Experimental: PermissionDecisionApproveForLocationApprovalExtensionManagement is part of @@ -8205,12 +8121,10 @@ type PermissionDecisionApproveForLocationApprovalExtensionManagement struct { Operation *string `json:"operation,omitempty"` } -func (PermissionDecisionApproveForLocationApprovalExtensionManagement) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalExtensionManagement) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalExtensionManagement) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindExtensionManagement } - // Location-scoped approval details for an extension's permission-gated capability access, // keyed by extension name. // Experimental: PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess is @@ -8220,12 +8134,10 @@ type PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess struc ExtensionName string `json:"extensionName"` } -func (PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindExtensionPermissionAccess } - // Location-scoped factory approval, optionally narrowed by approval key. // Experimental: PermissionDecisionApproveForLocationApprovalFactory is part of an // experimental API and may change or be removed. @@ -8235,12 +8147,10 @@ type PermissionDecisionApproveForLocationApprovalFactory struct { ApprovalKey *string `json:"approvalKey,omitempty"` } -func (PermissionDecisionApproveForLocationApprovalFactory) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalFactory) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalFactory) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindFactory } - // Location-scoped approval details for an MCP server tool, or all tools on the server when // `toolName` is null. // Experimental: PermissionDecisionApproveForLocationApprovalMCP is part of an experimental @@ -8252,12 +8162,10 @@ type PermissionDecisionApproveForLocationApprovalMCP struct { ToolName *string `json:"toolName"` } -func (PermissionDecisionApproveForLocationApprovalMCP) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalMCP) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalMCP) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindMCP } - // Location-scoped approval details for MCP sampling requests from a server. // Experimental: PermissionDecisionApproveForLocationApprovalMCPSampling is part of an // experimental API and may change or be removed. @@ -8266,44 +8174,37 @@ type PermissionDecisionApproveForLocationApprovalMCPSampling struct { ServerName string `json:"serverName"` } -func (PermissionDecisionApproveForLocationApprovalMCPSampling) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalMCPSampling) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalMCPSampling) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindMCPSampling } - // Location-scoped approval details for writes to long-term memory. // Experimental: PermissionDecisionApproveForLocationApprovalMemory is part of an // experimental API and may change or be removed. type PermissionDecisionApproveForLocationApprovalMemory struct { } -func (PermissionDecisionApproveForLocationApprovalMemory) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalMemory) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalMemory) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindMemory } - // Location-scoped approval details for read-only filesystem operations. // Experimental: PermissionDecisionApproveForLocationApprovalRead is part of an experimental // API and may change or be removed. type PermissionDecisionApproveForLocationApprovalRead struct { } -func (PermissionDecisionApproveForLocationApprovalRead) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalRead) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalRead) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindRead } - // Location-scoped approval details for filesystem write operations. // Experimental: PermissionDecisionApproveForLocationApprovalWrite is part of an // experimental API and may change or be removed. type PermissionDecisionApproveForLocationApprovalWrite struct { } -func (PermissionDecisionApproveForLocationApprovalWrite) permissionDecisionApproveForLocationApproval() { -} +func (PermissionDecisionApproveForLocationApprovalWrite) permissionDecisionApproveForLocationApproval() {} func (PermissionDecisionApproveForLocationApprovalWrite) Kind() PermissionDecisionApproveForLocationApprovalKind { return PermissionDecisionApproveForLocationApprovalKindWrite } @@ -8321,12 +8222,10 @@ type RawPermissionDecisionApproveForSessionApprovalData struct { Raw json.RawMessage } -func (RawPermissionDecisionApproveForSessionApprovalData) permissionDecisionApproveForSessionApproval() { -} +func (RawPermissionDecisionApproveForSessionApprovalData) permissionDecisionApproveForSessionApproval() {} func (r RawPermissionDecisionApproveForSessionApprovalData) Kind() PermissionDecisionApproveForSessionApprovalKind { return r.Discriminator } - // Session-scoped approval details for specific command identifiers. // Experimental: PermissionDecisionApproveForSessionApprovalCommands is part of an // experimental API and may change or be removed. @@ -8335,12 +8234,10 @@ type PermissionDecisionApproveForSessionApprovalCommands struct { CommandIdentifiers []string `json:"commandIdentifiers"` } -func (PermissionDecisionApproveForSessionApprovalCommands) permissionDecisionApproveForSessionApproval() { -} +func (PermissionDecisionApproveForSessionApprovalCommands) permissionDecisionApproveForSessionApproval() {} func (PermissionDecisionApproveForSessionApprovalCommands) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindCommands } - // Session-scoped approval details for a custom tool, keyed by tool name. // Experimental: PermissionDecisionApproveForSessionApprovalCustomTool is part of an // experimental API and may change or be removed. @@ -8349,12 +8246,10 @@ type PermissionDecisionApproveForSessionApprovalCustomTool struct { ToolName string `json:"toolName"` } -func (PermissionDecisionApproveForSessionApprovalCustomTool) permissionDecisionApproveForSessionApproval() { -} +func (PermissionDecisionApproveForSessionApprovalCustomTool) permissionDecisionApproveForSessionApproval() {} func (PermissionDecisionApproveForSessionApprovalCustomTool) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindCustomTool } - // Session-scoped approval details for an extension's access to sensitive environment // variables, keyed by extension name and the exact set of variable names. // Experimental: PermissionDecisionApproveForSessionApprovalExtensionEnvAccess is part of an @@ -8367,12 +8262,10 @@ type PermissionDecisionApproveForSessionApprovalExtensionEnvAccess struct { ExtensionName string `json:"extensionName"` } -func (PermissionDecisionApproveForSessionApprovalExtensionEnvAccess) permissionDecisionApproveForSessionApproval() { -} +func (PermissionDecisionApproveForSessionApprovalExtensionEnvAccess) permissionDecisionApproveForSessionApproval() {} func (PermissionDecisionApproveForSessionApprovalExtensionEnvAccess) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindExtensionEnvAccess } - // Session-scoped approval details for extension-management operations, optionally narrowed // by operation. // Experimental: PermissionDecisionApproveForSessionApprovalExtensionManagement is part of @@ -8383,12 +8276,10 @@ type PermissionDecisionApproveForSessionApprovalExtensionManagement struct { Operation *string `json:"operation,omitempty"` } -func (PermissionDecisionApproveForSessionApprovalExtensionManagement) permissionDecisionApproveForSessionApproval() { -} +func (PermissionDecisionApproveForSessionApprovalExtensionManagement) permissionDecisionApproveForSessionApproval() {} func (PermissionDecisionApproveForSessionApprovalExtensionManagement) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindExtensionManagement } - // Session-scoped approval details for an extension's permission-gated capability access, // keyed by extension name. // Experimental: PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess is @@ -8398,12 +8289,10 @@ type PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess struct ExtensionName string `json:"extensionName"` } -func (PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess) permissionDecisionApproveForSessionApproval() { -} +func (PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess) permissionDecisionApproveForSessionApproval() {} func (PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindExtensionPermissionAccess } - // Session-scoped factory approval, optionally narrowed by approval key. // Experimental: PermissionDecisionApproveForSessionApprovalFactory is part of an // experimental API and may change or be removed. @@ -8413,12 +8302,10 @@ type PermissionDecisionApproveForSessionApprovalFactory struct { ApprovalKey *string `json:"approvalKey,omitempty"` } -func (PermissionDecisionApproveForSessionApprovalFactory) permissionDecisionApproveForSessionApproval() { -} +func (PermissionDecisionApproveForSessionApprovalFactory) permissionDecisionApproveForSessionApproval() {} func (PermissionDecisionApproveForSessionApprovalFactory) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindFactory } - // Session-scoped approval details for an MCP server tool, or all tools on the server when // `toolName` is null. // Experimental: PermissionDecisionApproveForSessionApprovalMCP is part of an experimental @@ -8434,7 +8321,6 @@ func (PermissionDecisionApproveForSessionApprovalMCP) permissionDecisionApproveF func (PermissionDecisionApproveForSessionApprovalMCP) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindMCP } - // Session-scoped approval details for MCP sampling requests from a server. // Experimental: PermissionDecisionApproveForSessionApprovalMCPSampling is part of an // experimental API and may change or be removed. @@ -8443,44 +8329,37 @@ type PermissionDecisionApproveForSessionApprovalMCPSampling struct { ServerName string `json:"serverName"` } -func (PermissionDecisionApproveForSessionApprovalMCPSampling) permissionDecisionApproveForSessionApproval() { -} +func (PermissionDecisionApproveForSessionApprovalMCPSampling) permissionDecisionApproveForSessionApproval() {} func (PermissionDecisionApproveForSessionApprovalMCPSampling) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindMCPSampling } - // Session-scoped approval details for writes to long-term memory. // Experimental: PermissionDecisionApproveForSessionApprovalMemory is part of an // experimental API and may change or be removed. type PermissionDecisionApproveForSessionApprovalMemory struct { } -func (PermissionDecisionApproveForSessionApprovalMemory) permissionDecisionApproveForSessionApproval() { -} +func (PermissionDecisionApproveForSessionApprovalMemory) permissionDecisionApproveForSessionApproval() {} func (PermissionDecisionApproveForSessionApprovalMemory) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindMemory } - // Session-scoped approval details for read-only filesystem operations. // Experimental: PermissionDecisionApproveForSessionApprovalRead is part of an experimental // API and may change or be removed. type PermissionDecisionApproveForSessionApprovalRead struct { } -func (PermissionDecisionApproveForSessionApprovalRead) permissionDecisionApproveForSessionApproval() { -} +func (PermissionDecisionApproveForSessionApprovalRead) permissionDecisionApproveForSessionApproval() {} func (PermissionDecisionApproveForSessionApprovalRead) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindRead } - // Session-scoped approval details for filesystem write operations. // Experimental: PermissionDecisionApproveForSessionApprovalWrite is part of an experimental // API and may change or be removed. type PermissionDecisionApproveForSessionApprovalWrite struct { } -func (PermissionDecisionApproveForSessionApprovalWrite) permissionDecisionApproveForSessionApproval() { -} +func (PermissionDecisionApproveForSessionApprovalWrite) permissionDecisionApproveForSessionApproval() {} func (PermissionDecisionApproveForSessionApprovalWrite) Kind() PermissionDecisionApproveForSessionApprovalKind { return PermissionDecisionApproveForSessionApprovalKindWrite } @@ -8805,12 +8684,10 @@ type RawPermissionsLocationsAddToolApprovalDetailsData struct { Raw json.RawMessage } -func (RawPermissionsLocationsAddToolApprovalDetailsData) permissionsLocationsAddToolApprovalDetails() { -} +func (RawPermissionsLocationsAddToolApprovalDetailsData) permissionsLocationsAddToolApprovalDetails() {} func (r RawPermissionsLocationsAddToolApprovalDetailsData) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return r.Discriminator } - // Location-persisted tool approval details for specific command identifiers. // Experimental: PermissionsLocationsAddToolApprovalDetailsCommands is part of an // experimental API and may change or be removed. @@ -8819,12 +8696,10 @@ type PermissionsLocationsAddToolApprovalDetailsCommands struct { CommandIdentifiers []string `json:"commandIdentifiers"` } -func (PermissionsLocationsAddToolApprovalDetailsCommands) permissionsLocationsAddToolApprovalDetails() { -} +func (PermissionsLocationsAddToolApprovalDetailsCommands) permissionsLocationsAddToolApprovalDetails() {} func (PermissionsLocationsAddToolApprovalDetailsCommands) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return PermissionsLocationsAddToolApprovalDetailsKindCommands } - // Location-persisted tool approval details for a custom tool, keyed by tool name. // Experimental: PermissionsLocationsAddToolApprovalDetailsCustomTool is part of an // experimental API and may change or be removed. @@ -8833,12 +8708,10 @@ type PermissionsLocationsAddToolApprovalDetailsCustomTool struct { ToolName string `json:"toolName"` } -func (PermissionsLocationsAddToolApprovalDetailsCustomTool) permissionsLocationsAddToolApprovalDetails() { -} +func (PermissionsLocationsAddToolApprovalDetailsCustomTool) permissionsLocationsAddToolApprovalDetails() {} func (PermissionsLocationsAddToolApprovalDetailsCustomTool) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return PermissionsLocationsAddToolApprovalDetailsKindCustomTool } - // Location-persisted tool approval details for an extension's access to sensitive // environment variables, keyed by extension name and the exact set of variable names. // Experimental: PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess is part of an @@ -8851,12 +8724,10 @@ type PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess struct { ExtensionName string `json:"extensionName"` } -func (PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess) permissionsLocationsAddToolApprovalDetails() { -} +func (PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess) permissionsLocationsAddToolApprovalDetails() {} func (PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return PermissionsLocationsAddToolApprovalDetailsKindExtensionEnvAccess } - // Location-persisted tool approval details for extension-management operations, optionally // narrowed by operation. // Experimental: PermissionsLocationsAddToolApprovalDetailsExtensionManagement is part of an @@ -8867,12 +8738,10 @@ type PermissionsLocationsAddToolApprovalDetailsExtensionManagement struct { Operation *string `json:"operation,omitempty"` } -func (PermissionsLocationsAddToolApprovalDetailsExtensionManagement) permissionsLocationsAddToolApprovalDetails() { -} +func (PermissionsLocationsAddToolApprovalDetailsExtensionManagement) permissionsLocationsAddToolApprovalDetails() {} func (PermissionsLocationsAddToolApprovalDetailsExtensionManagement) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return PermissionsLocationsAddToolApprovalDetailsKindExtensionManagement } - // Location-persisted tool approval details for an extension's permission-gated capability // access, keyed by extension name. // Experimental: PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess is part @@ -8882,12 +8751,10 @@ type PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess struct ExtensionName string `json:"extensionName"` } -func (PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess) permissionsLocationsAddToolApprovalDetails() { -} +func (PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess) permissionsLocationsAddToolApprovalDetails() {} func (PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return PermissionsLocationsAddToolApprovalDetailsKindExtensionPermissionAccess } - // Location-persisted factory approval, optionally narrowed by approval key. // Experimental: PermissionsLocationsAddToolApprovalDetailsFactory is part of an // experimental API and may change or be removed. @@ -8897,12 +8764,10 @@ type PermissionsLocationsAddToolApprovalDetailsFactory struct { ApprovalKey *string `json:"approvalKey,omitempty"` } -func (PermissionsLocationsAddToolApprovalDetailsFactory) permissionsLocationsAddToolApprovalDetails() { -} +func (PermissionsLocationsAddToolApprovalDetailsFactory) permissionsLocationsAddToolApprovalDetails() {} func (PermissionsLocationsAddToolApprovalDetailsFactory) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return PermissionsLocationsAddToolApprovalDetailsKindFactory } - // Location-persisted tool approval details for an MCP server tool, or all tools when // `toolName` is null. // Experimental: PermissionsLocationsAddToolApprovalDetailsMCP is part of an experimental @@ -8918,7 +8783,6 @@ func (PermissionsLocationsAddToolApprovalDetailsMCP) permissionsLocationsAddTool func (PermissionsLocationsAddToolApprovalDetailsMCP) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return PermissionsLocationsAddToolApprovalDetailsKindMCP } - // Location-persisted tool approval details for MCP sampling requests from a server. // Experimental: PermissionsLocationsAddToolApprovalDetailsMCPSampling is part of an // experimental API and may change or be removed. @@ -8927,24 +8791,20 @@ type PermissionsLocationsAddToolApprovalDetailsMCPSampling struct { ServerName string `json:"serverName"` } -func (PermissionsLocationsAddToolApprovalDetailsMCPSampling) permissionsLocationsAddToolApprovalDetails() { -} +func (PermissionsLocationsAddToolApprovalDetailsMCPSampling) permissionsLocationsAddToolApprovalDetails() {} func (PermissionsLocationsAddToolApprovalDetailsMCPSampling) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return PermissionsLocationsAddToolApprovalDetailsKindMCPSampling } - // Location-persisted tool approval details for writes to long-term memory. // Experimental: PermissionsLocationsAddToolApprovalDetailsMemory is part of an experimental // API and may change or be removed. type PermissionsLocationsAddToolApprovalDetailsMemory struct { } -func (PermissionsLocationsAddToolApprovalDetailsMemory) permissionsLocationsAddToolApprovalDetails() { -} +func (PermissionsLocationsAddToolApprovalDetailsMemory) permissionsLocationsAddToolApprovalDetails() {} func (PermissionsLocationsAddToolApprovalDetailsMemory) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return PermissionsLocationsAddToolApprovalDetailsKindMemory } - // Location-persisted tool approval details for read-only filesystem operations. // Experimental: PermissionsLocationsAddToolApprovalDetailsRead is part of an experimental // API and may change or be removed. @@ -8955,7 +8815,6 @@ func (PermissionsLocationsAddToolApprovalDetailsRead) permissionsLocationsAddToo func (PermissionsLocationsAddToolApprovalDetailsRead) Kind() PermissionsLocationsAddToolApprovalDetailsKind { return PermissionsLocationsAddToolApprovalDetailsKindRead } - // Location-persisted tool approval details for filesystem write operations. // Experimental: PermissionsLocationsAddToolApprovalDetailsWrite is part of an experimental // API and may change or be removed. @@ -9694,7 +9553,6 @@ func (RawPushAttachmentData) pushAttachment() {} func (r RawPushAttachmentData) Type() PushAttachmentType { return r.Discriminator } - // Slim input shape for extension_context attachments; identity fields are runtime-derived. // Experimental: ExtensionContextPushInput is part of an experimental API and may change or // be removed. @@ -9709,7 +9567,6 @@ func (ExtensionContextPushInput) pushAttachment() {} func (ExtensionContextPushInput) Type() PushAttachmentType { return PushAttachmentTypeExtensionContext } - // Blob attachment with inline base64-encoded data // Experimental: PushAttachmentBlob is part of an experimental API and may change or be // removed. @@ -9726,7 +9583,6 @@ func (PushAttachmentBlob) pushAttachment() {} func (PushAttachmentBlob) Type() PushAttachmentType { return PushAttachmentTypeBlob } - // Directory attachment // Experimental: PushAttachmentDirectory is part of an experimental API and may change or be // removed. @@ -9741,7 +9597,6 @@ func (PushAttachmentDirectory) pushAttachment() {} func (PushAttachmentDirectory) Type() PushAttachmentType { return PushAttachmentTypeDirectory } - // File attachment // Experimental: PushAttachmentFile is part of an experimental API and may change or be // removed. @@ -9758,7 +9613,6 @@ func (PushAttachmentFile) pushAttachment() {} func (PushAttachmentFile) Type() PushAttachmentType { return PushAttachmentTypeFile } - // Pointer to a GitHub Actions job. // Experimental: PushAttachmentGitHubActionsJob is part of an experimental API and may // change or be removed. @@ -9782,7 +9636,6 @@ func (PushAttachmentGitHubActionsJob) pushAttachment() {} func (PushAttachmentGitHubActionsJob) Type() PushAttachmentType { return PushAttachmentTypeGitHubActionsJob } - // Pointer to a GitHub commit. // Experimental: PushAttachmentGitHubCommit is part of an experimental API and may change or // be removed. @@ -9801,7 +9654,6 @@ func (PushAttachmentGitHubCommit) pushAttachment() {} func (PushAttachmentGitHubCommit) Type() PushAttachmentType { return PushAttachmentTypeGitHubCommit } - // Pointer to a file in a GitHub repository at a specific ref. // Experimental: PushAttachmentGitHubFile is part of an experimental API and may change or // be removed. @@ -9820,7 +9672,6 @@ func (PushAttachmentGitHubFile) pushAttachment() {} func (PushAttachmentGitHubFile) Type() PushAttachmentType { return PushAttachmentTypeGitHubFile } - // Pointer to a single-file diff. At least one of `head` and `base` must be present. // Experimental: PushAttachmentGitHubFileDiff is part of an experimental API and may change // or be removed. @@ -9837,7 +9688,6 @@ func (PushAttachmentGitHubFileDiff) pushAttachment() {} func (PushAttachmentGitHubFileDiff) Type() PushAttachmentType { return PushAttachmentTypeGitHubFileDiff } - // GitHub issue, pull request, or discussion reference // Experimental: PushAttachmentGitHubReference is part of an experimental API and may change // or be removed. @@ -9858,7 +9708,6 @@ func (PushAttachmentGitHubReference) pushAttachment() {} func (PushAttachmentGitHubReference) Type() PushAttachmentType { return PushAttachmentTypeGitHubReference } - // Pointer to a GitHub release. // Experimental: PushAttachmentGitHubRelease is part of an experimental API and may change // or be removed. @@ -9877,7 +9726,6 @@ func (PushAttachmentGitHubRelease) pushAttachment() {} func (PushAttachmentGitHubRelease) Type() PushAttachmentType { return PushAttachmentTypeGitHubRelease } - // Pointer to a GitHub repository. // Experimental: PushAttachmentGitHubRepository is part of an experimental API and may // change or be removed. @@ -9897,7 +9745,6 @@ func (PushAttachmentGitHubRepository) pushAttachment() {} func (PushAttachmentGitHubRepository) Type() PushAttachmentType { return PushAttachmentTypeGitHubRepository } - // Pointer to a line range inside a file in a GitHub repository. // Experimental: PushAttachmentGitHubSnippet is part of an experimental API and may change // or be removed. @@ -9918,7 +9765,6 @@ func (PushAttachmentGitHubSnippet) pushAttachment() {} func (PushAttachmentGitHubSnippet) Type() PushAttachmentType { return PushAttachmentTypeGitHubSnippet } - // Pointer to a comparison between two git revisions. // Experimental: PushAttachmentGitHubTreeComparison is part of an experimental API and may // change or be removed. @@ -9935,7 +9781,6 @@ func (PushAttachmentGitHubTreeComparison) pushAttachment() {} func (PushAttachmentGitHubTreeComparison) Type() PushAttachmentType { return PushAttachmentTypeGitHubTreeComparison } - // Generic GitHub URL reference. // Experimental: PushAttachmentGitHubURL is part of an experimental API and may change or be // removed. @@ -9948,7 +9793,6 @@ func (PushAttachmentGitHubURL) pushAttachment() {} func (PushAttachmentGitHubURL) Type() PushAttachmentType { return PushAttachmentTypeGitHubURL } - // Code selection attachment from an editor // Experimental: PushAttachmentSelection is part of an experimental API and may change or be // removed. @@ -10088,7 +9932,6 @@ func (QueuedCommandHandled) queuedCommandResult() {} func (QueuedCommandHandled) Handled() bool { return true } - // Queued-command response indicating the host did not execute the command and the queue may // continue. // Experimental: QueuedCommandNotHandled is part of an experimental API and may change or be @@ -10482,7 +10325,6 @@ func (RawRemoteControlStatusData) remoteControlStatus() {} func (r RawRemoteControlStatusData) State() RemoteControlStatusState { return r.Discriminator } - // Remote control is connected to a local session. // Experimental: RemoteControlStatusActive is part of an experimental API and may change or // be removed. @@ -10511,7 +10353,6 @@ func (RemoteControlStatusActive) remoteControlStatus() {} func (RemoteControlStatusActive) State() RemoteControlStatusState { return RemoteControlStatusStateActive } - // Remote control is in the middle of initial setup. // Experimental: RemoteControlStatusConnecting is part of an experimental API and may change // or be removed. @@ -10524,7 +10365,6 @@ func (RemoteControlStatusConnecting) remoteControlStatus() {} func (RemoteControlStatusConnecting) State() RemoteControlStatusState { return RemoteControlStatusStateConnecting } - // The last setup attempt failed. The singleton is otherwise off. // Experimental: RemoteControlStatusError is part of an experimental API and may change or // be removed. @@ -10539,7 +10379,6 @@ func (RemoteControlStatusError) remoteControlStatus() {} func (RemoteControlStatusError) State() RemoteControlStatusState { return RemoteControlStatusStateError } - // Remote control is not connected. // Experimental: RemoteControlStatusOff is part of an experimental API and may change or be // removed. @@ -11985,9 +11824,9 @@ type SessionInstalledPlugin struct { // or be removed. type SessionInstalledPluginSource struct { SessionInstalledPluginSourceGitHub *SessionInstalledPluginSourceGitHub - SessionInstalledPluginSourceLocal *SessionInstalledPluginSourceLocal - SessionInstalledPluginSourceURL *SessionInstalledPluginSourceURL - String *string + SessionInstalledPluginSourceLocal *SessionInstalledPluginSourceLocal + SessionInstalledPluginSourceURL *SessionInstalledPluginSourceURL + String *string } // Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref or @@ -12102,7 +11941,6 @@ func (RawSessionLimitPredictionResultData) sessionLimitPredictionResult() {} func (r RawSessionLimitPredictionResultData) Kind() SessionLimitPredictionResultKind { return r.Discriminator } - type SessionLimitPredictionResultAvailable struct { // Predicted session limit details. Prediction SessionLimitPredictionDetails `json:"prediction"` @@ -12112,7 +11950,6 @@ func (SessionLimitPredictionResultAvailable) sessionLimitPredictionResult() {} func (SessionLimitPredictionResultAvailable) Kind() SessionLimitPredictionResultKind { return SessionLimitPredictionResultKindAvailable } - type SessionLimitPredictionResultUnavailable struct { // Reason no prediction is available. Reason SessionLimitPredictionUnavailableReason `json:"reason"` @@ -12161,7 +11998,6 @@ func (LocalSessionMetadataValue) sessionListEntry() {} func (LocalSessionMetadataValue) sessionListEntryIsRemote() bool { return false } - // Remote session metadata for the session to hand off (typically obtained from // `sessions.list` with `source: "remote"`). // Experimental: RemoteSessionMetadataValue is part of an experimental API and may change or @@ -12583,6 +12419,9 @@ type SessionOpenOptions struct { ReasoningEffort *string `json:"reasoningEffort,omitempty"` // Initial reasoning summary mode for supported model clients. ReasoningSummary *SessionOpenOptionsReasoningSummary `json:"reasoningSummary,omitempty"` + // Whether to invalidate cached custom-instruction discovery before constructing the + // session. Use when instruction files may have changed earlier in the same runtime process. + RefreshCustomInstructions *bool `json:"refreshCustomInstructions,omitempty"` // Telemetry-only remote-defaulted flag. RemoteDefaultedOn *bool `json:"remoteDefaultedOn,omitempty"` // Telemetry-only remote exporting flag. @@ -12681,7 +12520,6 @@ func (RawSessionOpenParamsData) sessionOpenParams() {} func (r RawSessionOpenParamsData) Kind() SessionOpenParamsKind { return r.Discriminator } - // Parameters for attaching to an already-active session by ID. // Experimental: SessionsOpenAttach is part of an experimental API and may change or be // removed. @@ -12694,7 +12532,6 @@ func (SessionsOpenAttach) sessionOpenParams() {} func (SessionsOpenAttach) Kind() SessionOpenParamsKind { return SessionOpenParamsKindAttach } - // Parameters for creating a new cloud session. // Experimental: SessionsOpenCloud is part of an experimental API and may change or be // removed. @@ -12718,7 +12555,6 @@ func (SessionsOpenCloud) sessionOpenParams() {} func (SessionsOpenCloud) Kind() SessionOpenParamsKind { return SessionOpenParamsKindCloud } - // Parameters for creating a new local session. // Experimental: SessionsOpenCreate is part of an experimental API and may change or be // removed. @@ -12733,7 +12569,6 @@ func (SessionsOpenCreate) sessionOpenParams() {} func (SessionsOpenCreate) Kind() SessionOpenParamsKind { return SessionOpenParamsKindCreate } - // Parameters for fetching a remote session and handing it off to a new local session. // Experimental: SessionsOpenHandoff is part of an experimental API and may change or be // removed. @@ -12770,7 +12605,6 @@ func (SessionsOpenHandoff) sessionOpenParams() {} func (SessionsOpenHandoff) Kind() SessionOpenParamsKind { return SessionOpenParamsKindHandoff } - // Parameters for connecting to a live remote session. // Experimental: SessionsOpenRemote is part of an experimental API and may change or be // removed. @@ -12787,7 +12621,6 @@ func (SessionsOpenRemote) sessionOpenParams() {} func (SessionsOpenRemote) Kind() SessionOpenParamsKind { return SessionOpenParamsKindRemote } - // Parameters for resuming a specific local session. // Experimental: SessionsOpenResume is part of an experimental API and may change or be // removed. @@ -12806,7 +12639,6 @@ func (SessionsOpenResume) sessionOpenParams() {} func (SessionsOpenResume) Kind() SessionOpenParamsKind { return SessionOpenParamsKindResume } - // Parameters for resuming the most relevant local session. // Experimental: SessionsOpenResumeLast is part of an experimental API and may change or be // removed. @@ -12980,7 +12812,6 @@ func (RawSessionsClientMetadataEntryData) sessionsClientMetadataEntry() {} func (r RawSessionsClientMetadataEntryData) Status() SessionsClientMetadataEntryStatus { return r.Discriminator } - type SessionsClientMetadataEntryCorrupt struct { // Requested session ID. SessionID string `json:"sessionId"` @@ -12990,7 +12821,6 @@ func (SessionsClientMetadataEntryCorrupt) sessionsClientMetadataEntry() {} func (SessionsClientMetadataEntryCorrupt) Status() SessionsClientMetadataEntryStatus { return SessionsClientMetadataEntryStatusCorrupt } - type SessionsClientMetadataEntryNotFound struct { // Requested session ID. SessionID string `json:"sessionId"` @@ -13000,7 +12830,6 @@ func (SessionsClientMetadataEntryNotFound) sessionsClientMetadataEntry() {} func (SessionsClientMetadataEntryNotFound) Status() SessionsClientMetadataEntryStatus { return SessionsClientMetadataEntryStatusNotFound } - type SessionsClientMetadataEntryOk struct { // Validated client metadata, possibly empty or projected to requested keys. Metadata map[string]string `json:"metadata"` @@ -13012,7 +12841,6 @@ func (SessionsClientMetadataEntryOk) sessionsClientMetadataEntry() {} func (SessionsClientMetadataEntryOk) Status() SessionsClientMetadataEntryStatus { return SessionsClientMetadataEntryStatusOk } - type SessionsClientMetadataEntryUnavailable struct { // Filesystem or provider error code. Clients should not assume every provider uses // operating-system error codes. @@ -13027,7 +12855,6 @@ func (SessionsClientMetadataEntryUnavailable) sessionsClientMetadataEntry() {} func (SessionsClientMetadataEntryUnavailable) Status() SessionsClientMetadataEntryStatus { return SessionsClientMetadataEntryStatusUnavailable } - type SessionsClientMetadataEntryUnsupportedVersion struct { // Requested session ID. SessionID string `json:"sessionId"` @@ -13527,12 +13354,17 @@ type SessionsPruneOldRequest struct { // 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. + // Opaque, process-local, single-use cursor returned by the previous persisted-event read. + // Omit on the first call and issue continuations sequentially; reusing the same cursor + // returns an expired terminal page. 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. + // starts with the newest events. Events in each page remain chronological. This selects the + // initial read only; a continuation always uses the direction bound into its cursor. Direction *EventsReadDirection `json:"direction,omitempty"` - // Maximum number of events to return in this batch (1–1000, default 200). + // Maximum number of events to return in this batch (1–1000, default 200). Pages may contain + // fewer events to keep the serialized event array within a soft 1 MiB budget including + // resolved binary assets; one oversized event is returned alone to guarantee progress. Max *int64 `json:"max,omitempty"` // Session ID whose persisted event journal should be read. SessionID string `json:"sessionId"` @@ -13910,7 +13742,6 @@ func (HMACAuthInfo) settableAuthInfo() {} func (HMACAuthInfo) settableAuthInfoType() SettableAuthInfoType { return SettableAuthInfoTypeHMAC } - // Token authentication accepted by session.gitHubAuth.setCredentials. // Experimental: SettableTokenAuthInfo is part of an experimental API and may change or be // removed. @@ -14386,7 +14217,6 @@ func (RawSlashCommandInvocationResultData) slashCommandInvocationResult() {} func (r RawSlashCommandInvocationResultData) Kind() SlashCommandInvocationResultKind { return r.Discriminator } - // Experimental: SlashCommandAddTimelineEntryResult is part of an experimental API and may // change or be removed. type SlashCommandAddTimelineEntryResult struct { @@ -14402,7 +14232,6 @@ func (SlashCommandAddTimelineEntryResult) slashCommandInvocationResult() {} func (SlashCommandAddTimelineEntryResult) Kind() SlashCommandInvocationResultKind { return SlashCommandInvocationResultKindAddTimelineEntry } - // Slash-command invocation result that submits an agent prompt, with display prompt, // optional mode, optional user-facing notice, and settings-change flag. // Experimental: SlashCommandAgentPromptResult is part of an experimental API and may change @@ -14425,7 +14254,6 @@ func (SlashCommandAgentPromptResult) slashCommandInvocationResult() {} func (SlashCommandAgentPromptResult) Kind() SlashCommandInvocationResultKind { return SlashCommandInvocationResultKindAgentPrompt } - // Slash-command invocation result indicating completion, with optional message and // settings-change flag. // Experimental: SlashCommandCompletedResult is part of an experimental API and may change @@ -14444,7 +14272,6 @@ func (SlashCommandCompletedResult) slashCommandInvocationResult() {} func (SlashCommandCompletedResult) Kind() SlashCommandInvocationResultKind { return SlashCommandInvocationResultKindCompleted } - // Slash-command invocation result asking the client to present subcommand options for a // parent command. // Experimental: SlashCommandSelectSubcommandResult is part of an experimental API and may @@ -14465,7 +14292,6 @@ func (SlashCommandSelectSubcommandResult) slashCommandInvocationResult() {} func (SlashCommandSelectSubcommandResult) Kind() SlashCommandInvocationResultKind { return SlashCommandInvocationResultKindSelectSubcommand } - // Experimental: SlashCommandSetModelResult is part of an experimental API and may change or // be removed. type SlashCommandSetModelResult struct { @@ -14489,7 +14315,6 @@ func (SlashCommandSetModelResult) slashCommandInvocationResult() {} func (SlashCommandSetModelResult) Kind() SlashCommandInvocationResultKind { return SlashCommandInvocationResultKindSetModel } - // Experimental: SlashCommandSetPlanModelResult is part of an experimental API and may // change or be removed. type SlashCommandSetPlanModelResult struct { @@ -14505,7 +14330,6 @@ func (SlashCommandSetPlanModelResult) slashCommandInvocationResult() {} func (SlashCommandSetPlanModelResult) Kind() SlashCommandInvocationResultKind { return SlashCommandInvocationResultKindSetPlanModel } - // Experimental: SlashCommandShowDialogResult is part of an experimental API and may change // or be removed. type SlashCommandShowDialogResult struct { @@ -14519,7 +14343,6 @@ func (SlashCommandShowDialogResult) slashCommandInvocationResult() {} func (SlashCommandShowDialogResult) Kind() SlashCommandInvocationResultKind { return SlashCommandInvocationResultKindShowDialog } - // Slash-command invocation result containing text output plus Markdown/ANSI rendering flags. // Experimental: SlashCommandTextResult is part of an experimental API and may change or be // removed. @@ -14650,7 +14473,6 @@ func (RawTaskClientUpdateData) taskClientUpdate() {} func (r RawTaskClientUpdateData) Kind() TaskClientUpdateKind { return r.Discriminator } - // Reports terminal cancellation after external work stopped. type TaskClientUpdateCancelled struct { // Optional final progress message @@ -14663,7 +14485,6 @@ func (TaskClientUpdateCancelled) taskClientUpdate() {} func (TaskClientUpdateCancelled) Kind() TaskClientUpdateKind { return TaskClientUpdateKindCancelled } - // Reports successful terminal completion. type TaskClientUpdateCompleted struct { // Optional final progress message @@ -14676,7 +14497,6 @@ func (TaskClientUpdateCompleted) taskClientUpdate() {} func (TaskClientUpdateCompleted) Kind() TaskClientUpdateKind { return TaskClientUpdateKindCompleted } - // Reports terminal failure. type TaskClientUpdateFailed struct { // Optional owner-supplied terminal failure code @@ -14691,7 +14511,6 @@ func (TaskClientUpdateFailed) taskClientUpdate() {} func (TaskClientUpdateFailed) Kind() TaskClientUpdateKind { return TaskClientUpdateKindFailed } - // Publishes nonterminal progress for a running or idle client task. type TaskClientUpdateProgress struct { // Optional progress message appended to recent activity when nonempty @@ -14764,7 +14583,6 @@ func (RawTaskInfoData) taskInfo() {} func (r RawTaskInfoData) Type() TaskInfoType { return r.Discriminator } - // Tracked background agent task metadata, including IDs, status, timing, agent type, // prompt, model, result, and latest response. // Experimental: TaskAgentInfo is part of an experimental API and may change or be removed. @@ -14816,7 +14634,6 @@ func (TaskAgentInfo) taskInfo() {} func (TaskAgentInfo) Type() TaskInfoType { return TaskInfoTypeAgent } - // Tracked client-owned task metadata. // Experimental: TaskClientInfo is part of an experimental API and may change or be removed. type TaskClientInfo struct { @@ -14868,7 +14685,6 @@ func (TaskClientInfo) taskInfo() {} func (TaskClientInfo) Type() TaskInfoType { return TaskInfoTypeClient } - // Tracked shell task metadata, including ID, command, status, timing, attachment/execution // mode, log path, and PID. // Experimental: TaskShellInfo is part of an experimental API and may change or be removed. @@ -14927,7 +14743,6 @@ func (RawTaskProgressData) taskProgress() {} func (r RawTaskProgressData) Type() TaskProgressType { return r.Discriminator } - // Progress snapshot for an agent task, with recent activity lines and optional latest // intent. // Experimental: TaskAgentProgress is part of an experimental API and may change or be @@ -14943,7 +14758,6 @@ func (TaskAgentProgress) taskProgress() {} func (TaskAgentProgress) Type() TaskProgressType { return TaskProgressTypeAgent } - // Generic progress for a client-owned task. // Experimental: TaskClientProgress is part of an experimental API and may change or be // removed. @@ -14968,7 +14782,6 @@ func (TaskClientProgress) taskProgress() {} func (TaskClientProgress) Type() TaskProgressType { return TaskProgressTypeClient } - // Progress snapshot for a shell task, with recent stdout/stderr output and optional process // ID. // Experimental: TaskShellProgress is part of an experimental API and may change or be @@ -15535,7 +15348,6 @@ func (RawUIElicitationSchemaPropertyData) uiElicitationSchemaProperty() {} func (r RawUIElicitationSchemaPropertyData) Type() UIElicitationSchemaPropertyType { return r.Discriminator } - // Multi-select string field where each option pairs a value with a display label. // Experimental: UIElicitationArrayAnyOfField is part of an experimental API and may change // or be removed. @@ -15558,7 +15370,6 @@ func (UIElicitationArrayAnyOfField) uiElicitationSchemaProperty() {} func (UIElicitationArrayAnyOfField) Type() UIElicitationSchemaPropertyType { return UIElicitationSchemaPropertyTypeArray } - // Multi-select string field whose allowed values are defined inline. // Experimental: UIElicitationArrayEnumField is part of an experimental API and may change // or be removed. @@ -15581,7 +15392,6 @@ func (UIElicitationArrayEnumField) uiElicitationSchemaProperty() {} func (UIElicitationArrayEnumField) Type() UIElicitationSchemaPropertyType { return UIElicitationSchemaPropertyTypeArray } - // Boolean field rendered as a yes/no toggle. // Experimental: UIElicitationSchemaPropertyBoolean is part of an experimental API and may // change or be removed. @@ -15598,7 +15408,6 @@ func (UIElicitationSchemaPropertyBoolean) uiElicitationSchemaProperty() {} func (UIElicitationSchemaPropertyBoolean) Type() UIElicitationSchemaPropertyType { return UIElicitationSchemaPropertyTypeBoolean } - // Numeric field accepting either a number or an integer. // Experimental: UIElicitationSchemaPropertyNumber is part of an experimental API and may // change or be removed. @@ -15612,7 +15421,7 @@ type UIElicitationSchemaPropertyNumber struct { // Minimum allowed value (inclusive). Minimum *float64 `json:"minimum,omitempty"` // Human-readable label for the field. - Title *string `json:"title,omitempty"` + Title *string `json:"title,omitempty"` Discriminator UIElicitationSchemaPropertyNumberType `json:"type,omitempty"` } @@ -15623,7 +15432,6 @@ func (r UIElicitationSchemaPropertyNumber) Type() UIElicitationSchemaPropertyTyp } return UIElicitationSchemaPropertyType(r.Discriminator) } - // Free-text string field with optional length and format constraints. // Experimental: UIElicitationSchemaPropertyString is part of an experimental API and may // change or be removed. @@ -15646,7 +15454,6 @@ func (UIElicitationSchemaPropertyString) uiElicitationSchemaProperty() {} func (UIElicitationSchemaPropertyString) Type() UIElicitationSchemaPropertyType { return UIElicitationSchemaPropertyTypeString } - // Single-select string field whose allowed values are defined inline. // Experimental: UIElicitationStringEnumField is part of an experimental API and may change // or be removed. @@ -15667,7 +15474,6 @@ func (UIElicitationStringEnumField) uiElicitationSchemaProperty() {} func (UIElicitationStringEnumField) Type() UIElicitationSchemaPropertyType { return UIElicitationSchemaPropertyTypeString } - // Single-select string field where each option pairs a value with a display label. // Experimental: UIElicitationStringOneOfField is part of an experimental API and may change // or be removed. @@ -16104,7 +15910,6 @@ func (RawUserToolSessionApprovalData) userToolSessionApproval() {} func (r RawUserToolSessionApprovalData) Kind() UserToolSessionApprovalKind { return r.Discriminator } - // Session-scoped tool-approval rule for specific shell command identifiers. // Experimental: UserToolSessionApprovalCommands is part of an experimental API and may // change or be removed. @@ -16117,7 +15922,6 @@ func (UserToolSessionApprovalCommands) userToolSessionApproval() {} func (UserToolSessionApprovalCommands) Kind() UserToolSessionApprovalKind { return UserToolSessionApprovalKindCommands } - // Session-scoped tool-approval rule for a custom tool, keyed by tool name. // Experimental: UserToolSessionApprovalCustomTool is part of an experimental API and may // change or be removed. @@ -16130,7 +15934,6 @@ func (UserToolSessionApprovalCustomTool) userToolSessionApproval() {} func (UserToolSessionApprovalCustomTool) Kind() UserToolSessionApprovalKind { return UserToolSessionApprovalKindCustomTool } - // Session-scoped tool-approval rule for an extension's access to sensitive environment // variables, keyed by extension name and the exact set of variable names. // Experimental: UserToolSessionApprovalExtensionEnvAccess is part of an experimental API @@ -16147,7 +15950,6 @@ func (UserToolSessionApprovalExtensionEnvAccess) userToolSessionApproval() {} func (UserToolSessionApprovalExtensionEnvAccess) Kind() UserToolSessionApprovalKind { return UserToolSessionApprovalKindExtensionEnvAccess } - // Session-scoped tool-approval rule for extension-management operations, optionally // narrowed by operation. // Experimental: UserToolSessionApprovalExtensionManagement is part of an experimental API @@ -16161,7 +15963,6 @@ func (UserToolSessionApprovalExtensionManagement) userToolSessionApproval() {} func (UserToolSessionApprovalExtensionManagement) Kind() UserToolSessionApprovalKind { return UserToolSessionApprovalKindExtensionManagement } - // Session-scoped tool-approval rule for an extension's permission-gated capability access, // keyed by extension name. // Experimental: UserToolSessionApprovalExtensionPermissionAccess is part of an experimental @@ -16175,7 +15976,6 @@ func (UserToolSessionApprovalExtensionPermissionAccess) userToolSessionApproval( func (UserToolSessionApprovalExtensionPermissionAccess) Kind() UserToolSessionApprovalKind { return UserToolSessionApprovalKindExtensionPermissionAccess } - // Session-scoped factory approval, optionally narrowed by approval key. // Experimental: UserToolSessionApprovalFactory is part of an experimental API and may // change or be removed. @@ -16188,7 +15988,6 @@ func (UserToolSessionApprovalFactory) userToolSessionApproval() {} func (UserToolSessionApprovalFactory) Kind() UserToolSessionApprovalKind { return UserToolSessionApprovalKindFactory } - // Session-scoped tool-approval rule for an MCP server tool, or all tools on the server when // `toolName` is null. // Experimental: UserToolSessionApprovalMCP is part of an experimental API and may change or @@ -16204,7 +16003,6 @@ func (UserToolSessionApprovalMCP) userToolSessionApproval() {} func (UserToolSessionApprovalMCP) Kind() UserToolSessionApprovalKind { return UserToolSessionApprovalKindMCP } - // Session-scoped tool-approval rule for writes to long-term memory. // Experimental: UserToolSessionApprovalMemory is part of an experimental API and may change // or be removed. @@ -16215,7 +16013,6 @@ func (UserToolSessionApprovalMemory) userToolSessionApproval() {} func (UserToolSessionApprovalMemory) Kind() UserToolSessionApprovalKind { return UserToolSessionApprovalKindMemory } - // Session-scoped tool-approval rule for read-only filesystem operations. // Experimental: UserToolSessionApprovalRead is part of an experimental API and may change // or be removed. @@ -16226,7 +16023,6 @@ func (UserToolSessionApprovalRead) userToolSessionApproval() {} func (UserToolSessionApprovalRead) Kind() UserToolSessionApprovalKind { return UserToolSessionApprovalKindRead } - // Session-scoped tool-approval rule for filesystem write operations. // Experimental: UserToolSessionApprovalWrite is part of an experimental API and may change // or be removed. @@ -16755,8 +16551,8 @@ type AgentRegistrySpawnResultKind string const ( AgentRegistrySpawnResultKindRegistryTimeout AgentRegistrySpawnResultKind = "registry-timeout" - AgentRegistrySpawnResultKindSpawned AgentRegistrySpawnResultKind = "spawned" - AgentRegistrySpawnResultKindSpawnError AgentRegistrySpawnResultKind = "spawn-error" + AgentRegistrySpawnResultKindSpawned AgentRegistrySpawnResultKind = "spawned" + AgentRegistrySpawnResultKindSpawnError AgentRegistrySpawnResultKind = "spawn-error" AgentRegistrySpawnResultKindValidationError AgentRegistrySpawnResultKind = "validation-error" ) @@ -16818,21 +16614,21 @@ const ( type AttachmentType string const ( - AttachmentTypeBlob AttachmentType = "blob" - AttachmentTypeDirectory AttachmentType = "directory" - AttachmentTypeExtensionContext AttachmentType = "extension_context" - AttachmentTypeFile AttachmentType = "file" - AttachmentTypeGitHubActionsJob AttachmentType = "github_actions_job" - AttachmentTypeGitHubCommit AttachmentType = "github_commit" - AttachmentTypeGitHubFile AttachmentType = "github_file" - AttachmentTypeGitHubFileDiff AttachmentType = "github_file_diff" - AttachmentTypeGitHubReference AttachmentType = "github_reference" - AttachmentTypeGitHubRelease AttachmentType = "github_release" - AttachmentTypeGitHubRepository AttachmentType = "github_repository" - AttachmentTypeGitHubSnippet AttachmentType = "github_snippet" + AttachmentTypeBlob AttachmentType = "blob" + AttachmentTypeDirectory AttachmentType = "directory" + AttachmentTypeExtensionContext AttachmentType = "extension_context" + AttachmentTypeFile AttachmentType = "file" + AttachmentTypeGitHubActionsJob AttachmentType = "github_actions_job" + AttachmentTypeGitHubCommit AttachmentType = "github_commit" + AttachmentTypeGitHubFile AttachmentType = "github_file" + AttachmentTypeGitHubFileDiff AttachmentType = "github_file_diff" + AttachmentTypeGitHubReference AttachmentType = "github_reference" + AttachmentTypeGitHubRelease AttachmentType = "github_release" + AttachmentTypeGitHubRepository AttachmentType = "github_repository" + AttachmentTypeGitHubSnippet AttachmentType = "github_snippet" AttachmentTypeGitHubTreeComparison AttachmentType = "github_tree_comparison" - AttachmentTypeGitHubURL AttachmentType = "github_url" - AttachmentTypeSelection AttachmentType = "selection" + AttachmentTypeGitHubURL AttachmentType = "github_url" + AttachmentTypeSelection AttachmentType = "selection" ) // Type discriminator for AuthInfo. @@ -16840,14 +16636,14 @@ const ( type AuthInfoType string const ( - AuthInfoTypeAPIKey AuthInfoType = "api-key" + AuthInfoTypeAPIKey AuthInfoType = "api-key" AuthInfoTypeCopilotAPIToken AuthInfoType = "copilot-api-token" - AuthInfoTypeEnv AuthInfoType = "env" - AuthInfoTypeGhCLI AuthInfoType = "gh-cli" - AuthInfoTypeHMAC AuthInfoType = "hmac" - AuthInfoTypeToken AuthInfoType = "token" - AuthInfoTypeTokenProvider AuthInfoType = "token-provider" - AuthInfoTypeUser AuthInfoType = "user" + AuthInfoTypeEnv AuthInfoType = "env" + AuthInfoTypeGhCLI AuthInfoType = "gh-cli" + AuthInfoTypeHMAC AuthInfoType = "hmac" + AuthInfoTypeToken AuthInfoType = "token" + AuthInfoTypeTokenProvider AuthInfoType = "token-provider" + AuthInfoTypeUser AuthInfoType = "user" ) // Current normalized autopilot objective lifecycle status. @@ -16954,7 +16750,7 @@ const ( type CatalogCandidateKind string const ( - CatalogCandidateKindAiSkill CatalogCandidateKind = "ai-skill" + CatalogCandidateKindAiSkill CatalogCandidateKind = "ai-skill" CatalogCandidateKindMCPServer CatalogCandidateKind = "mcp-server" ) @@ -16963,7 +16759,7 @@ type CatalogCandidateSourceKind string const ( CatalogCandidateSourceKindEmbedded CatalogCandidateSourceKind = "embedded" - CatalogCandidateSourceKindURL CatalogCandidateSourceKind = "url" + CatalogCandidateSourceKindURL CatalogCandidateSourceKind = "url" ) // A wire feature a caller can require of the catalog surface, negotiated per request. A @@ -17160,16 +16956,16 @@ type CatalogSearchResultKind string const ( CatalogSearchResultKindAuthenticationRequired CatalogSearchResultKind = "authentication-required" - CatalogSearchResultKindContractViolation CatalogSearchResultKind = "contract-violation" - CatalogSearchResultKindInvalidRequest CatalogSearchResultKind = "invalid-request" - CatalogSearchResultKindMalformedCard CatalogSearchResultKind = "malformed-card" - CatalogSearchResultKindNegotiationRefused CatalogSearchResultKind = "negotiation-refused" - CatalogSearchResultKindNetworkFailure CatalogSearchResultKind = "network-failure" - CatalogSearchResultKindPolicyRejected CatalogSearchResultKind = "policy-rejected" - CatalogSearchResultKindSucceeded CatalogSearchResultKind = "succeeded" - CatalogSearchResultKindUnavailable CatalogSearchResultKind = "unavailable" - CatalogSearchResultKindUnsafeRetrieval CatalogSearchResultKind = "unsafe-retrieval" - CatalogSearchResultKindUnsupportedKind CatalogSearchResultKind = "unsupported-kind" + CatalogSearchResultKindContractViolation CatalogSearchResultKind = "contract-violation" + CatalogSearchResultKindInvalidRequest CatalogSearchResultKind = "invalid-request" + CatalogSearchResultKindMalformedCard CatalogSearchResultKind = "malformed-card" + CatalogSearchResultKindNegotiationRefused CatalogSearchResultKind = "negotiation-refused" + CatalogSearchResultKindNetworkFailure CatalogSearchResultKind = "network-failure" + CatalogSearchResultKindPolicyRejected CatalogSearchResultKind = "policy-rejected" + CatalogSearchResultKindSucceeded CatalogSearchResultKind = "succeeded" + CatalogSearchResultKindUnavailable CatalogSearchResultKind = "unavailable" + CatalogSearchResultKindUnsafeRetrieval CatalogSearchResultKind = "unsafe-retrieval" + CatalogSearchResultKindUnsupportedKind CatalogSearchResultKind = "unsupported-kind" ) // Why a catalog operation is not available on this runtime @@ -17305,7 +17101,7 @@ const ( type DebugCollectLogsDestinationKind string const ( - DebugCollectLogsDestinationKindArchive DebugCollectLogsDestinationKind = "archive" + DebugCollectLogsDestinationKindArchive DebugCollectLogsDestinationKind = "archive" DebugCollectLogsDestinationKindDirectory DebugCollectLogsDestinationKind = "directory" ) @@ -17425,21 +17221,20 @@ const ( EventsAgentScopePrimary EventsAgentScope = "primary" ) -// 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. +// Cursor status: 'ok' means the read succeeded against the requested history; 'expired' +// means the requested continuation is unavailable. Recovery is endpoint-specific: +// session.eventLog.read returns a boundary window of remaining active history that may +// overlap prior pages, while sessions.readPersistedEvents returns an empty terminal page +// and never switches journal generations. An expired persisted read is not successful +// completion; a complete persisted snapshot requires cursorStatus 'ok' and hasMore false. // Experimental: EventsCursorStatus is part of an experimental API and may change or be // removed. type EventsCursorStatus string const ( - // The cursor referred to history that is no longer available. + // The requested continuation is unavailable; see the endpoint's recovery semantics. EventsCursorStatusExpired EventsCursorStatus = "expired" - // The cursor was applied successfully. + // The read succeeded against the requested history. EventsCursorStatusOk EventsCursorStatus = "ok" ) @@ -17519,13 +17314,13 @@ const ( type ExternalToolTextResultForLlmContentType string const ( - ExternalToolTextResultForLlmContentTypeAudio ExternalToolTextResultForLlmContentType = "audio" - ExternalToolTextResultForLlmContentTypeImage ExternalToolTextResultForLlmContentType = "image" - ExternalToolTextResultForLlmContentTypeResource ExternalToolTextResultForLlmContentType = "resource" + ExternalToolTextResultForLlmContentTypeAudio ExternalToolTextResultForLlmContentType = "audio" + ExternalToolTextResultForLlmContentTypeImage ExternalToolTextResultForLlmContentType = "image" + ExternalToolTextResultForLlmContentTypeResource ExternalToolTextResultForLlmContentType = "resource" ExternalToolTextResultForLlmContentTypeResourceLink ExternalToolTextResultForLlmContentType = "resource_link" - ExternalToolTextResultForLlmContentTypeShellExit ExternalToolTextResultForLlmContentType = "shell_exit" - ExternalToolTextResultForLlmContentTypeTerminal ExternalToolTextResultForLlmContentType = "terminal" - ExternalToolTextResultForLlmContentTypeText ExternalToolTextResultForLlmContentType = "text" + ExternalToolTextResultForLlmContentTypeShellExit ExternalToolTextResultForLlmContentType = "shell_exit" + ExternalToolTextResultForLlmContentTypeTerminal ExternalToolTextResultForLlmContentType = "terminal" + ExternalToolTextResultForLlmContentTypeText ExternalToolTextResultForLlmContentType = "text" ) // Execution-critical factory storage operation. @@ -17587,7 +17382,7 @@ type FactoryPauseInfoType string const ( FactoryPauseInfoTypeCheckpoint FactoryPauseInfoType = "checkpoint" - FactoryPauseInfoTypeUser FactoryPauseInfoType = "user" + FactoryPauseInfoTypeUser FactoryPauseInfoType = "user" ) // Derived lifecycle state of a factory phase. @@ -17627,10 +17422,10 @@ type FactoryRunFailureType string const ( FactoryRunFailureTypeFactoryAccountingIncomplete FactoryRunFailureType = "factory_accounting_incomplete" - FactoryRunFailureTypeFactoryDurableFailure FactoryRunFailureType = "factory_durable_failure" - FactoryRunFailureTypeFactoryLimitReached FactoryRunFailureType = "factory_limit_reached" + FactoryRunFailureTypeFactoryDurableFailure FactoryRunFailureType = "factory_durable_failure" + FactoryRunFailureTypeFactoryLimitReached FactoryRunFailureType = "factory_limit_reached" FactoryRunFailureTypeFactoryProviderDisconnected FactoryRunFailureType = "factory_provider_disconnected" - FactoryRunFailureTypeFactoryResumeDeclined FactoryRunFailureType = "factory_resume_declined" + FactoryRunFailureTypeFactoryResumeDeclined FactoryRunFailureType = "factory_resume_declined" ) // Current or terminal state of a factory run. @@ -17674,7 +17469,7 @@ type GitHubTokenAcquireResultKind string const ( GitHubTokenAcquireResultKindCancelled GitHubTokenAcquireResultKind = "cancelled" - GitHubTokenAcquireResultKindToken GitHubTokenAcquireResultKind = "token" + GitHubTokenAcquireResultKindToken GitHubTokenAcquireResultKind = "token" ) // What initiated this compaction request, recorded as the `trigger` on the persisted @@ -18073,7 +17868,7 @@ type MCPHeadersHandlePendingHeadersRefreshRequestKind string const ( MCPHeadersHandlePendingHeadersRefreshRequestKindHeaders MCPHeadersHandlePendingHeadersRefreshRequestKind = "headers" - MCPHeadersHandlePendingHeadersRefreshRequestKindNone MCPHeadersHandlePendingHeadersRefreshRequestKind = "none" + MCPHeadersHandlePendingHeadersRefreshRequestKindNone MCPHeadersHandlePendingHeadersRefreshRequestKind = "none" ) // OAuth grant type override for this login. @@ -18096,7 +17891,7 @@ type MCPOauthPendingRequestResponseKind string const ( MCPOauthPendingRequestResponseKindCancelled MCPOauthPendingRequestResponseKind = "cancelled" - MCPOauthPendingRequestResponseKindToken MCPOauthPendingRequestResponseKind = "token" + MCPOauthPendingRequestResponseKindToken MCPOauthPendingRequestResponseKind = "token" ) // Why a passive MCP OAuth probe determined authentication is needed. @@ -18118,9 +17913,9 @@ const ( type MCPOauthProbeResultStatus string const ( - MCPOauthProbeResultStatusAuthenticated MCPOauthProbeResultStatus = "authenticated" - MCPOauthProbeResultStatusFailed MCPOauthProbeResultStatus = "failed" - MCPOauthProbeResultStatusNeedsAuth MCPOauthProbeResultStatus = "needs-auth" + MCPOauthProbeResultStatusAuthenticated MCPOauthProbeResultStatus = "authenticated" + MCPOauthProbeResultStatusFailed MCPOauthProbeResultStatus = "failed" + MCPOauthProbeResultStatusNeedsAuth MCPOauthProbeResultStatus = "needs-auth" MCPOauthProbeResultStatusNoAuthRequired MCPOauthProbeResultStatus = "no-auth-required" ) @@ -18151,18 +17946,18 @@ type MCPPlanInstallResultKind string const ( MCPPlanInstallResultKindAuthenticationRequired MCPPlanInstallResultKind = "authentication-required" - MCPPlanInstallResultKindContractViolation MCPPlanInstallResultKind = "contract-violation" - MCPPlanInstallResultKindHandleRejected MCPPlanInstallResultKind = "handle-rejected" - MCPPlanInstallResultKindInvalidRequest MCPPlanInstallResultKind = "invalid-request" - MCPPlanInstallResultKindMalformedCard MCPPlanInstallResultKind = "malformed-card" - MCPPlanInstallResultKindNegotiationRefused MCPPlanInstallResultKind = "negotiation-refused" - MCPPlanInstallResultKindNetworkFailure MCPPlanInstallResultKind = "network-failure" - MCPPlanInstallResultKindNotInstallable MCPPlanInstallResultKind = "not-installable" - MCPPlanInstallResultKindPlanned MCPPlanInstallResultKind = "planned" - MCPPlanInstallResultKindPolicyRejected MCPPlanInstallResultKind = "policy-rejected" - MCPPlanInstallResultKindUnavailable MCPPlanInstallResultKind = "unavailable" - MCPPlanInstallResultKindUnavailableTransport MCPPlanInstallResultKind = "unavailable-transport" - MCPPlanInstallResultKindUnsafeRetrieval MCPPlanInstallResultKind = "unsafe-retrieval" + MCPPlanInstallResultKindContractViolation MCPPlanInstallResultKind = "contract-violation" + MCPPlanInstallResultKindHandleRejected MCPPlanInstallResultKind = "handle-rejected" + MCPPlanInstallResultKindInvalidRequest MCPPlanInstallResultKind = "invalid-request" + MCPPlanInstallResultKindMalformedCard MCPPlanInstallResultKind = "malformed-card" + MCPPlanInstallResultKindNegotiationRefused MCPPlanInstallResultKind = "negotiation-refused" + MCPPlanInstallResultKindNetworkFailure MCPPlanInstallResultKind = "network-failure" + MCPPlanInstallResultKindNotInstallable MCPPlanInstallResultKind = "not-installable" + MCPPlanInstallResultKindPlanned MCPPlanInstallResultKind = "planned" + MCPPlanInstallResultKindPolicyRejected MCPPlanInstallResultKind = "policy-rejected" + MCPPlanInstallResultKindUnavailable MCPPlanInstallResultKind = "unavailable" + MCPPlanInstallResultKindUnavailableTransport MCPPlanInstallResultKind = "unavailable-transport" + MCPPlanInstallResultKindUnsafeRetrieval MCPPlanInstallResultKind = "unsafe-retrieval" ) // Discriminator for a candidate-backed install-plan source @@ -18190,7 +17985,7 @@ type MCPPlanInstallSourceKind string const ( MCPPlanInstallSourceKindCandidate MCPPlanInstallSourceKind = "candidate" - MCPPlanInstallSourceKindCard MCPPlanInstallSourceKind = "card" + MCPPlanInstallSourceKindCard MCPPlanInstallSourceKind = "card" ) // Discriminator for a package-backed transport choice @@ -18281,7 +18076,7 @@ const ( type MCPPlanRequiredValueKind string const ( - MCPPlanRequiredValueKindEnum MCPPlanRequiredValueKind = "enum" + MCPPlanRequiredValueKindEnum MCPPlanRequiredValueKind = "enum" MCPPlanRequiredValueKindScalar MCPPlanRequiredValueKind = "scalar" ) @@ -18324,9 +18119,9 @@ const ( type MCPPlanTransportChoiceTransport string const ( - MCPPlanTransportChoiceTransportHTTP MCPPlanTransportChoiceTransport = "http" - MCPPlanTransportChoiceTransportSSE MCPPlanTransportChoiceTransport = "sse" - MCPPlanTransportChoiceTransportStdio MCPPlanTransportChoiceTransport = "stdio" + MCPPlanTransportChoiceTransportHTTP MCPPlanTransportChoiceTransport = "http" + MCPPlanTransportChoiceTransportSSE MCPPlanTransportChoiceTransport = "sse" + MCPPlanTransportChoiceTransportStdio MCPPlanTransportChoiceTransport = "stdio" MCPPlanTransportChoiceTransportStreamableHTTP MCPPlanTransportChoiceTransport = "streamable-http" ) @@ -18391,7 +18186,7 @@ type MCPServerCardReferenceKind string const ( MCPServerCardReferenceKindEmbedded MCPServerCardReferenceKind = "embedded" - MCPServerCardReferenceKindURL MCPServerCardReferenceKind = "url" + MCPServerCardReferenceKindURL MCPServerCardReferenceKind = "url" ) // Discriminator for a URL-backed MCP server card @@ -18735,55 +18530,55 @@ const ( type PermissionDecisionApproveForLocationApprovalKind string const ( - PermissionDecisionApproveForLocationApprovalKindCommands PermissionDecisionApproveForLocationApprovalKind = "commands" - PermissionDecisionApproveForLocationApprovalKindCustomTool PermissionDecisionApproveForLocationApprovalKind = "custom-tool" - PermissionDecisionApproveForLocationApprovalKindExtensionEnvAccess PermissionDecisionApproveForLocationApprovalKind = "extension-env-access" - PermissionDecisionApproveForLocationApprovalKindExtensionManagement PermissionDecisionApproveForLocationApprovalKind = "extension-management" + PermissionDecisionApproveForLocationApprovalKindCommands PermissionDecisionApproveForLocationApprovalKind = "commands" + PermissionDecisionApproveForLocationApprovalKindCustomTool PermissionDecisionApproveForLocationApprovalKind = "custom-tool" + PermissionDecisionApproveForLocationApprovalKindExtensionEnvAccess PermissionDecisionApproveForLocationApprovalKind = "extension-env-access" + PermissionDecisionApproveForLocationApprovalKindExtensionManagement PermissionDecisionApproveForLocationApprovalKind = "extension-management" PermissionDecisionApproveForLocationApprovalKindExtensionPermissionAccess PermissionDecisionApproveForLocationApprovalKind = "extension-permission-access" - PermissionDecisionApproveForLocationApprovalKindFactory PermissionDecisionApproveForLocationApprovalKind = "factory" - PermissionDecisionApproveForLocationApprovalKindMCP PermissionDecisionApproveForLocationApprovalKind = "mcp" - PermissionDecisionApproveForLocationApprovalKindMCPSampling PermissionDecisionApproveForLocationApprovalKind = "mcp-sampling" - PermissionDecisionApproveForLocationApprovalKindMemory PermissionDecisionApproveForLocationApprovalKind = "memory" - PermissionDecisionApproveForLocationApprovalKindRead PermissionDecisionApproveForLocationApprovalKind = "read" - PermissionDecisionApproveForLocationApprovalKindWrite PermissionDecisionApproveForLocationApprovalKind = "write" + PermissionDecisionApproveForLocationApprovalKindFactory PermissionDecisionApproveForLocationApprovalKind = "factory" + PermissionDecisionApproveForLocationApprovalKindMCP PermissionDecisionApproveForLocationApprovalKind = "mcp" + PermissionDecisionApproveForLocationApprovalKindMCPSampling PermissionDecisionApproveForLocationApprovalKind = "mcp-sampling" + PermissionDecisionApproveForLocationApprovalKindMemory PermissionDecisionApproveForLocationApprovalKind = "memory" + PermissionDecisionApproveForLocationApprovalKindRead PermissionDecisionApproveForLocationApprovalKind = "read" + PermissionDecisionApproveForLocationApprovalKindWrite PermissionDecisionApproveForLocationApprovalKind = "write" ) // Kind discriminator for PermissionDecisionApproveForSessionApproval. type PermissionDecisionApproveForSessionApprovalKind string const ( - PermissionDecisionApproveForSessionApprovalKindCommands PermissionDecisionApproveForSessionApprovalKind = "commands" - PermissionDecisionApproveForSessionApprovalKindCustomTool PermissionDecisionApproveForSessionApprovalKind = "custom-tool" - PermissionDecisionApproveForSessionApprovalKindExtensionEnvAccess PermissionDecisionApproveForSessionApprovalKind = "extension-env-access" - PermissionDecisionApproveForSessionApprovalKindExtensionManagement PermissionDecisionApproveForSessionApprovalKind = "extension-management" + PermissionDecisionApproveForSessionApprovalKindCommands PermissionDecisionApproveForSessionApprovalKind = "commands" + PermissionDecisionApproveForSessionApprovalKindCustomTool PermissionDecisionApproveForSessionApprovalKind = "custom-tool" + PermissionDecisionApproveForSessionApprovalKindExtensionEnvAccess PermissionDecisionApproveForSessionApprovalKind = "extension-env-access" + PermissionDecisionApproveForSessionApprovalKindExtensionManagement PermissionDecisionApproveForSessionApprovalKind = "extension-management" PermissionDecisionApproveForSessionApprovalKindExtensionPermissionAccess PermissionDecisionApproveForSessionApprovalKind = "extension-permission-access" - PermissionDecisionApproveForSessionApprovalKindFactory PermissionDecisionApproveForSessionApprovalKind = "factory" - PermissionDecisionApproveForSessionApprovalKindMCP PermissionDecisionApproveForSessionApprovalKind = "mcp" - PermissionDecisionApproveForSessionApprovalKindMCPSampling PermissionDecisionApproveForSessionApprovalKind = "mcp-sampling" - PermissionDecisionApproveForSessionApprovalKindMemory PermissionDecisionApproveForSessionApprovalKind = "memory" - PermissionDecisionApproveForSessionApprovalKindRead PermissionDecisionApproveForSessionApprovalKind = "read" - PermissionDecisionApproveForSessionApprovalKindWrite PermissionDecisionApproveForSessionApprovalKind = "write" + PermissionDecisionApproveForSessionApprovalKindFactory PermissionDecisionApproveForSessionApprovalKind = "factory" + PermissionDecisionApproveForSessionApprovalKindMCP PermissionDecisionApproveForSessionApprovalKind = "mcp" + PermissionDecisionApproveForSessionApprovalKindMCPSampling PermissionDecisionApproveForSessionApprovalKind = "mcp-sampling" + PermissionDecisionApproveForSessionApprovalKindMemory PermissionDecisionApproveForSessionApprovalKind = "memory" + PermissionDecisionApproveForSessionApprovalKindRead PermissionDecisionApproveForSessionApprovalKind = "read" + PermissionDecisionApproveForSessionApprovalKindWrite PermissionDecisionApproveForSessionApprovalKind = "write" ) // Kind discriminator for PermissionDecision. type PermissionDecisionKind string const ( - PermissionDecisionKindApproved PermissionDecisionKind = "approved" - PermissionDecisionKindApprovedForLocation PermissionDecisionKind = "approved-for-location" - PermissionDecisionKindApprovedForSession PermissionDecisionKind = "approved-for-session" - PermissionDecisionKindApproveForLocation PermissionDecisionKind = "approve-for-location" - PermissionDecisionKindApproveForSession PermissionDecisionKind = "approve-for-session" - PermissionDecisionKindApproveOnce PermissionDecisionKind = "approve-once" - PermissionDecisionKindApprovePermanently PermissionDecisionKind = "approve-permanently" - PermissionDecisionKindCancelled PermissionDecisionKind = "cancelled" - PermissionDecisionKindDeniedByContentExclusionPolicy PermissionDecisionKind = "denied-by-content-exclusion-policy" - PermissionDecisionKindDeniedByPermissionRequestHook PermissionDecisionKind = "denied-by-permission-request-hook" - PermissionDecisionKindDeniedByRules PermissionDecisionKind = "denied-by-rules" - PermissionDecisionKindDeniedInteractivelyByUser PermissionDecisionKind = "denied-interactively-by-user" + PermissionDecisionKindApproved PermissionDecisionKind = "approved" + PermissionDecisionKindApprovedForLocation PermissionDecisionKind = "approved-for-location" + PermissionDecisionKindApprovedForSession PermissionDecisionKind = "approved-for-session" + PermissionDecisionKindApproveForLocation PermissionDecisionKind = "approve-for-location" + PermissionDecisionKindApproveForSession PermissionDecisionKind = "approve-for-session" + PermissionDecisionKindApproveOnce PermissionDecisionKind = "approve-once" + PermissionDecisionKindApprovePermanently PermissionDecisionKind = "approve-permanently" + PermissionDecisionKindCancelled PermissionDecisionKind = "cancelled" + PermissionDecisionKindDeniedByContentExclusionPolicy PermissionDecisionKind = "denied-by-content-exclusion-policy" + PermissionDecisionKindDeniedByPermissionRequestHook PermissionDecisionKind = "denied-by-permission-request-hook" + PermissionDecisionKindDeniedByRules PermissionDecisionKind = "denied-by-rules" + PermissionDecisionKindDeniedInteractivelyByUser PermissionDecisionKind = "denied-interactively-by-user" PermissionDecisionKindDeniedNoApprovalRuleAndCouldNotRequestFromUser PermissionDecisionKind = "denied-no-approval-rule-and-could-not-request-from-user" - PermissionDecisionKindReject PermissionDecisionKind = "reject" - PermissionDecisionKindUserNotAvailable PermissionDecisionKind = "user-not-available" + PermissionDecisionKindReject PermissionDecisionKind = "reject" + PermissionDecisionKindUserNotAvailable PermissionDecisionKind = "user-not-available" ) // Disposition of a permission request as observed by the responding client. @@ -18808,6 +18603,10 @@ type PermissionDecisionSource string const ( // The response followed the assisted-approval judge recommendation. PermissionDecisionSourceAssistedApproval PermissionDecisionSource = "assisted_approval" + // A live authorization record from an earlier human decision in this session contained the + // proposal, so it ran without another prompt. This is not a new human decision and never + // mints authority of its own. + PermissionDecisionSourceAuthorizationCarryForward PermissionDecisionSource = "authorization_carry_forward" // The host applied a standing policy or override rather than a judge recommendation or // human decision. PermissionDecisionSourceHostPolicy PermissionDecisionSource = "host_policy" @@ -18911,17 +18710,17 @@ const ( type PermissionsLocationsAddToolApprovalDetailsKind string const ( - PermissionsLocationsAddToolApprovalDetailsKindCommands PermissionsLocationsAddToolApprovalDetailsKind = "commands" - PermissionsLocationsAddToolApprovalDetailsKindCustomTool PermissionsLocationsAddToolApprovalDetailsKind = "custom-tool" - PermissionsLocationsAddToolApprovalDetailsKindExtensionEnvAccess PermissionsLocationsAddToolApprovalDetailsKind = "extension-env-access" - PermissionsLocationsAddToolApprovalDetailsKindExtensionManagement PermissionsLocationsAddToolApprovalDetailsKind = "extension-management" + PermissionsLocationsAddToolApprovalDetailsKindCommands PermissionsLocationsAddToolApprovalDetailsKind = "commands" + PermissionsLocationsAddToolApprovalDetailsKindCustomTool PermissionsLocationsAddToolApprovalDetailsKind = "custom-tool" + PermissionsLocationsAddToolApprovalDetailsKindExtensionEnvAccess PermissionsLocationsAddToolApprovalDetailsKind = "extension-env-access" + PermissionsLocationsAddToolApprovalDetailsKindExtensionManagement PermissionsLocationsAddToolApprovalDetailsKind = "extension-management" PermissionsLocationsAddToolApprovalDetailsKindExtensionPermissionAccess PermissionsLocationsAddToolApprovalDetailsKind = "extension-permission-access" - PermissionsLocationsAddToolApprovalDetailsKindFactory PermissionsLocationsAddToolApprovalDetailsKind = "factory" - PermissionsLocationsAddToolApprovalDetailsKindMCP PermissionsLocationsAddToolApprovalDetailsKind = "mcp" - PermissionsLocationsAddToolApprovalDetailsKindMCPSampling PermissionsLocationsAddToolApprovalDetailsKind = "mcp-sampling" - PermissionsLocationsAddToolApprovalDetailsKindMemory PermissionsLocationsAddToolApprovalDetailsKind = "memory" - PermissionsLocationsAddToolApprovalDetailsKindRead PermissionsLocationsAddToolApprovalDetailsKind = "read" - PermissionsLocationsAddToolApprovalDetailsKindWrite PermissionsLocationsAddToolApprovalDetailsKind = "write" + PermissionsLocationsAddToolApprovalDetailsKindFactory PermissionsLocationsAddToolApprovalDetailsKind = "factory" + PermissionsLocationsAddToolApprovalDetailsKindMCP PermissionsLocationsAddToolApprovalDetailsKind = "mcp" + PermissionsLocationsAddToolApprovalDetailsKindMCPSampling PermissionsLocationsAddToolApprovalDetailsKind = "mcp-sampling" + PermissionsLocationsAddToolApprovalDetailsKindMemory PermissionsLocationsAddToolApprovalDetailsKind = "memory" + PermissionsLocationsAddToolApprovalDetailsKindRead PermissionsLocationsAddToolApprovalDetailsKind = "read" + PermissionsLocationsAddToolApprovalDetailsKindWrite PermissionsLocationsAddToolApprovalDetailsKind = "write" ) // Whether the change applies to ephemeral session-scoped rules (cleared at session end) or @@ -19073,21 +18872,21 @@ const ( type PushAttachmentType string const ( - PushAttachmentTypeBlob PushAttachmentType = "blob" - PushAttachmentTypeDirectory PushAttachmentType = "directory" - PushAttachmentTypeExtensionContext PushAttachmentType = "extension_context" - PushAttachmentTypeFile PushAttachmentType = "file" - PushAttachmentTypeGitHubActionsJob PushAttachmentType = "github_actions_job" - PushAttachmentTypeGitHubCommit PushAttachmentType = "github_commit" - PushAttachmentTypeGitHubFile PushAttachmentType = "github_file" - PushAttachmentTypeGitHubFileDiff PushAttachmentType = "github_file_diff" - PushAttachmentTypeGitHubReference PushAttachmentType = "github_reference" - PushAttachmentTypeGitHubRelease PushAttachmentType = "github_release" - PushAttachmentTypeGitHubRepository PushAttachmentType = "github_repository" - PushAttachmentTypeGitHubSnippet PushAttachmentType = "github_snippet" + PushAttachmentTypeBlob PushAttachmentType = "blob" + PushAttachmentTypeDirectory PushAttachmentType = "directory" + PushAttachmentTypeExtensionContext PushAttachmentType = "extension_context" + PushAttachmentTypeFile PushAttachmentType = "file" + PushAttachmentTypeGitHubActionsJob PushAttachmentType = "github_actions_job" + PushAttachmentTypeGitHubCommit PushAttachmentType = "github_commit" + PushAttachmentTypeGitHubFile PushAttachmentType = "github_file" + PushAttachmentTypeGitHubFileDiff PushAttachmentType = "github_file_diff" + PushAttachmentTypeGitHubReference PushAttachmentType = "github_reference" + PushAttachmentTypeGitHubRelease PushAttachmentType = "github_release" + PushAttachmentTypeGitHubRepository PushAttachmentType = "github_repository" + PushAttachmentTypeGitHubSnippet PushAttachmentType = "github_snippet" PushAttachmentTypeGitHubTreeComparison PushAttachmentType = "github_tree_comparison" - PushAttachmentTypeGitHubURL PushAttachmentType = "github_url" - PushAttachmentTypeSelection PushAttachmentType = "selection" + PushAttachmentTypeGitHubURL PushAttachmentType = "github_url" + PushAttachmentTypeSelection PushAttachmentType = "selection" ) // Whether this item is a queued user message or a queued slash command / model change @@ -19145,10 +18944,10 @@ const ( type RemoteControlStatusState string const ( - RemoteControlStatusStateActive RemoteControlStatusState = "active" + RemoteControlStatusStateActive RemoteControlStatusState = "active" RemoteControlStatusStateConnecting RemoteControlStatusState = "connecting" - RemoteControlStatusStateError RemoteControlStatusState = "error" - RemoteControlStatusStateOff RemoteControlStatusState = "off" + RemoteControlStatusStateError RemoteControlStatusState = "error" + RemoteControlStatusStateOff RemoteControlStatusState = "off" ) // What a remote host says one of its sessions is doing right now. Deliberately coarse: this @@ -19414,7 +19213,7 @@ const ( type SessionLimitPredictionResultKind string const ( - SessionLimitPredictionResultKindAvailable SessionLimitPredictionResultKind = "available" + SessionLimitPredictionResultKindAvailable SessionLimitPredictionResultKind = "available" SessionLimitPredictionResultKindUnavailable SessionLimitPredictionResultKind = "unavailable" ) @@ -19531,12 +19330,12 @@ const ( type SessionOpenParamsKind string const ( - SessionOpenParamsKindAttach SessionOpenParamsKind = "attach" - SessionOpenParamsKindCloud SessionOpenParamsKind = "cloud" - SessionOpenParamsKindCreate SessionOpenParamsKind = "create" - SessionOpenParamsKindHandoff SessionOpenParamsKind = "handoff" - SessionOpenParamsKindRemote SessionOpenParamsKind = "remote" - SessionOpenParamsKindResume SessionOpenParamsKind = "resume" + SessionOpenParamsKindAttach SessionOpenParamsKind = "attach" + SessionOpenParamsKindCloud SessionOpenParamsKind = "cloud" + SessionOpenParamsKindCreate SessionOpenParamsKind = "create" + SessionOpenParamsKindHandoff SessionOpenParamsKind = "handoff" + SessionOpenParamsKindRemote SessionOpenParamsKind = "remote" + SessionOpenParamsKindResume SessionOpenParamsKind = "resume" SessionOpenParamsKindResumeLast SessionOpenParamsKind = "resumeLast" ) @@ -19544,10 +19343,10 @@ const ( type SessionsClientMetadataEntryStatus string const ( - SessionsClientMetadataEntryStatusCorrupt SessionsClientMetadataEntryStatus = "corrupt" - SessionsClientMetadataEntryStatusNotFound SessionsClientMetadataEntryStatus = "notFound" - SessionsClientMetadataEntryStatusOk SessionsClientMetadataEntryStatus = "ok" - SessionsClientMetadataEntryStatusUnavailable SessionsClientMetadataEntryStatus = "unavailable" + SessionsClientMetadataEntryStatusCorrupt SessionsClientMetadataEntryStatus = "corrupt" + SessionsClientMetadataEntryStatusNotFound SessionsClientMetadataEntryStatus = "notFound" + SessionsClientMetadataEntryStatusOk SessionsClientMetadataEntryStatus = "ok" + SessionsClientMetadataEntryStatusUnavailable SessionsClientMetadataEntryStatus = "unavailable" SessionsClientMetadataEntryStatusUnsupportedVersion SessionsClientMetadataEntryStatus = "unsupportedVersion" ) @@ -19703,13 +19502,13 @@ const ( type SettableAuthInfoType string const ( - SettableAuthInfoTypeAPIKey SettableAuthInfoType = "api-key" + SettableAuthInfoTypeAPIKey SettableAuthInfoType = "api-key" SettableAuthInfoTypeCopilotAPIToken SettableAuthInfoType = "copilot-api-token" - SettableAuthInfoTypeEnv SettableAuthInfoType = "env" - SettableAuthInfoTypeGhCLI SettableAuthInfoType = "gh-cli" - SettableAuthInfoTypeHMAC SettableAuthInfoType = "hmac" - SettableAuthInfoTypeToken SettableAuthInfoType = "token" - SettableAuthInfoTypeUser SettableAuthInfoType = "user" + SettableAuthInfoTypeEnv SettableAuthInfoType = "env" + SettableAuthInfoTypeGhCLI SettableAuthInfoType = "gh-cli" + SettableAuthInfoTypeHMAC SettableAuthInfoType = "hmac" + SettableAuthInfoTypeToken SettableAuthInfoType = "token" + SettableAuthInfoTypeUser SettableAuthInfoType = "user" ) // Controls automatic non-interactive profile loading where supported. Explicit initScripts @@ -19816,13 +19615,13 @@ type SlashCommandInvocationResultKind string const ( SlashCommandInvocationResultKindAddTimelineEntry SlashCommandInvocationResultKind = "add-timeline-entry" - SlashCommandInvocationResultKindAgentPrompt SlashCommandInvocationResultKind = "agent-prompt" - SlashCommandInvocationResultKindCompleted SlashCommandInvocationResultKind = "completed" + SlashCommandInvocationResultKindAgentPrompt SlashCommandInvocationResultKind = "agent-prompt" + SlashCommandInvocationResultKindCompleted SlashCommandInvocationResultKind = "completed" SlashCommandInvocationResultKindSelectSubcommand SlashCommandInvocationResultKind = "select-subcommand" - SlashCommandInvocationResultKindSetModel SlashCommandInvocationResultKind = "set-model" - SlashCommandInvocationResultKindSetPlanModel SlashCommandInvocationResultKind = "set-plan-model" - SlashCommandInvocationResultKindShowDialog SlashCommandInvocationResultKind = "show-dialog" - SlashCommandInvocationResultKindText SlashCommandInvocationResultKind = "text" + SlashCommandInvocationResultKindSetModel SlashCommandInvocationResultKind = "set-model" + SlashCommandInvocationResultKindSetPlanModel SlashCommandInvocationResultKind = "set-plan-model" + SlashCommandInvocationResultKindShowDialog SlashCommandInvocationResultKind = "show-dialog" + SlashCommandInvocationResultKindText SlashCommandInvocationResultKind = "text" ) // Coarse command category for grouping and behavior: runtime built-in, skill-backed @@ -19940,8 +19739,8 @@ type TaskClientUpdateKind string const ( TaskClientUpdateKindCancelled TaskClientUpdateKind = "cancelled" TaskClientUpdateKindCompleted TaskClientUpdateKind = "completed" - TaskClientUpdateKindFailed TaskClientUpdateKind = "failed" - TaskClientUpdateKindProgress TaskClientUpdateKind = "progress" + TaskClientUpdateKindFailed TaskClientUpdateKind = "failed" + TaskClientUpdateKindProgress TaskClientUpdateKind = "progress" ) // Semantic result of evaluating a task completion request @@ -19975,9 +19774,9 @@ const ( type TaskInfoType string const ( - TaskInfoTypeAgent TaskInfoType = "agent" + TaskInfoTypeAgent TaskInfoType = "agent" TaskInfoTypeClient TaskInfoType = "client" - TaskInfoTypeShell TaskInfoType = "shell" + TaskInfoTypeShell TaskInfoType = "shell" ) // Closed set of public task kinds a connection can negotiate. @@ -19997,9 +19796,9 @@ const ( type TaskProgressType string const ( - TaskProgressTypeAgent TaskProgressType = "agent" + TaskProgressTypeAgent TaskProgressType = "agent" TaskProgressTypeClient TaskProgressType = "client" - TaskProgressTypeShell TaskProgressType = "shell" + TaskProgressTypeShell TaskProgressType = "shell" ) // Whether the shell runs inside a managed PTY session or as an independent background @@ -20117,11 +19916,11 @@ const ( type UIElicitationSchemaPropertyType string const ( - UIElicitationSchemaPropertyTypeArray UIElicitationSchemaPropertyType = "array" + UIElicitationSchemaPropertyTypeArray UIElicitationSchemaPropertyType = "array" UIElicitationSchemaPropertyTypeBoolean UIElicitationSchemaPropertyType = "boolean" UIElicitationSchemaPropertyTypeInteger UIElicitationSchemaPropertyType = "integer" - UIElicitationSchemaPropertyTypeNumber UIElicitationSchemaPropertyType = "number" - UIElicitationSchemaPropertyTypeString UIElicitationSchemaPropertyType = "string" + UIElicitationSchemaPropertyTypeNumber UIElicitationSchemaPropertyType = "number" + UIElicitationSchemaPropertyTypeString UIElicitationSchemaPropertyType = "string" ) // Schema type indicator (always 'object') @@ -20168,16 +19967,16 @@ const ( type UserToolSessionApprovalKind string const ( - UserToolSessionApprovalKindCommands UserToolSessionApprovalKind = "commands" - UserToolSessionApprovalKindCustomTool UserToolSessionApprovalKind = "custom-tool" - UserToolSessionApprovalKindExtensionEnvAccess UserToolSessionApprovalKind = "extension-env-access" - UserToolSessionApprovalKindExtensionManagement UserToolSessionApprovalKind = "extension-management" + UserToolSessionApprovalKindCommands UserToolSessionApprovalKind = "commands" + UserToolSessionApprovalKindCustomTool UserToolSessionApprovalKind = "custom-tool" + UserToolSessionApprovalKindExtensionEnvAccess UserToolSessionApprovalKind = "extension-env-access" + UserToolSessionApprovalKindExtensionManagement UserToolSessionApprovalKind = "extension-management" UserToolSessionApprovalKindExtensionPermissionAccess UserToolSessionApprovalKind = "extension-permission-access" - UserToolSessionApprovalKindFactory UserToolSessionApprovalKind = "factory" - UserToolSessionApprovalKindMCP UserToolSessionApprovalKind = "mcp" - UserToolSessionApprovalKindMemory UserToolSessionApprovalKind = "memory" - UserToolSessionApprovalKindRead UserToolSessionApprovalKind = "read" - UserToolSessionApprovalKindWrite UserToolSessionApprovalKind = "write" + UserToolSessionApprovalKindFactory UserToolSessionApprovalKind = "factory" + UserToolSessionApprovalKindMCP UserToolSessionApprovalKind = "mcp" + UserToolSessionApprovalKindMemory UserToolSessionApprovalKind = "memory" + UserToolSessionApprovalKindRead UserToolSessionApprovalKind = "read" + UserToolSessionApprovalKindWrite UserToolSessionApprovalKind = "write" ) // Output verbosity level for supported models @@ -21597,10 +21396,30 @@ func (a *ServerSessionsAPI) PruneOld(ctx context.Context, params *SessionsPruneO } // 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. +// persisted journal without creating, resuming, or activating the session. The first read +// pins the currently opened journal generation and its byte-length boundary; opaque cursor +// continuations remain on that generation across runtime-owned compaction, truncation, and +// rewrite operations, which replace the live path atomically, and events appended after the +// boundary are excluded. For cold hydration, await the first successful page before +// activation and establish lossless live-event buffering before resume; merge subsequent +// live events by ID, preserving persisted order and letting live payloads win. +// Continuations are process-local, single-use capabilities bound to the originating session +// and storage context and must be paged sequentially; concurrent or repeated use of the +// same cursor expires that duplicate read rather than reading the generation twice. A +// complete snapshot has cursorStatus 'ok' and hasMore false. Snapshots expire after five +// idle minutes, with at most eight retained per process and idle-only eviction under +// pressure; completion and cancelled-worker exit release their handles. No transcript copy +// is created, but retained handles may keep replaced files' disk blocks alive until +// release. Pages have a soft 1 MiB serialized event-array budget including resolved binary +// assets; one oversized event is returned alone to guarantee progress. Working memory also +// includes a record/lookahead and asset resolution; resolving the first binary reference +// may scan the full pinned generation to build a bounded offset index. If the snapshot +// expires, is evicted, is cancelled before a continuation is established, or becomes +// unreadable after an observable unsupported in-place shortening, the continuation returns +// cursorStatus 'expired' with an empty terminal page and never falls back to a different +// generation. A missing or initially unreadable journal is an RPC error. Persisted history +// excludes ephemeral events and may omit payloads that are reconstructed only for an active +// session; use the active session event stream for post-resume live events. // // RPC method: sessions.readPersistedEvents. // @@ -21986,7 +21805,7 @@ func (s *ServerUserAPI) Settings() *ServerUserSettingsAPI { // ServerRPC provides typed server-scoped RPC methods. type ServerRPC struct { // Reuse a single struct instead of allocating one for each service on the heap. - common serverAPI + common serverAPI Account *ServerAccountAPI AgentRegistry *ServerAgentRegistryAPI @@ -22281,7 +22100,7 @@ func (a *InternalServerSessionsAPI) RegisterExtensionToolsOnSession(ctx context. // etc.). Not part of the public API. type InternalServerRPC struct { // Reuse a single struct instead of allocating one for each service on the heap. - common internalServerAPI + common internalServerAPI Sessions *InternalServerSessionsAPI } @@ -22323,7 +22142,7 @@ func NewInternalServerRPC(client *jsonrpc2.Client) *InternalServerRPC { } type sessionAPI struct { - client *jsonrpc2.Client + client *jsonrpc2.Client sessionID string } @@ -23461,15 +23280,25 @@ type FleetAPI sessionAPI // // RPC method: session.fleet.start. // -// Parameters: Optional user prompt to combine with the fleet orchestration instructions. +// Parameters: Parameters for starting fleet orchestration: an optional user prompt combined +// with the fleet instructions, plus the send options forwarded to the resulting turn. // // Returns: Indicates whether fleet mode was successfully activated. func (a *FleetAPI) Start(ctx context.Context, params *FleetStartRequest) (*FleetStartResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { + if params.Attachments != nil { + req["attachments"] = params.Attachments + } + if params.Billable != nil { + req["billable"] = *params.Billable + } if params.Prompt != nil { req["prompt"] = *params.Prompt } + if params.Wait != nil { + req["wait"] = *params.Wait + } } raw, err := a.client.Request(ctx, "session.fleet.start", req) if err != nil { @@ -24948,6 +24777,9 @@ func (a *ModeAPI) Set(ctx context.Context, params *ModeSetRequest) (*ModeSetResu if params.CompactionDecision != nil { req["compactionDecision"] = *params.CompactionDecision } + if params.ExpectedMode != nil { + req["expectedMode"] = *params.ExpectedMode + } if params.InheritPlanBaseFromSessionID != nil { req["inheritPlanBaseFromSessionId"] = *params.InheritPlanBaseFromSessionID } @@ -28204,7 +28036,7 @@ func (a *WorkspacesAPI) WriteAutopilotObjective(ctx context.Context, params *Wor // SessionRPC provides typed session-scoped RPC methods. type SessionRPC struct { // Reuse a single struct instead of allocating one for each service on the heap. - common sessionAPI + common sessionAPI Agent *AgentAPI AutopilotObjective *AutopilotObjectiveAPI @@ -28578,7 +28410,7 @@ func NewSessionRPC(client *jsonrpc2.Client, sessionID string) *SessionRPC { } type internalSessionAPI struct { - client *jsonrpc2.Client + client *jsonrpc2.Client sessionID string } @@ -29563,7 +29395,7 @@ func (a *InternalSettingsAPI) Snapshot(ctx context.Context) (*SessionSettingsSna // etc.). Not part of the public API. type InternalSessionRPC struct { // Reuse a single struct instead of allocating one for each service on the heap. - common internalSessionAPI + common internalSessionAPI Canvas *InternalCanvasAPI Commands *InternalCommandsAPI @@ -29836,11 +29668,11 @@ type TasksHandler interface { // ClientSessionAPIHandlers provides all client session API handler groups for a session. type ClientSessionAPIHandlers struct { - Canvas CanvasHandler - Factory FactoryHandler + Canvas CanvasHandler + Factory FactoryHandler ProviderToken ProviderTokenHandler - SessionFS SessionFSHandler - Tasks TasksHandler + SessionFS SessionFSHandler + Tasks TasksHandler } func clientSessionHandlerError(err error) *jsonrpc2.Error { @@ -30338,10 +30170,10 @@ type LlmInferenceHandler interface { // key; a single set of handlers serves the entire connection. type ClientGlobalAPIHandlers struct { ExtensionLaunchProvider ExtensionLaunchProviderHandler - GitHubTelemetry GitHubTelemetryHandler - GitHubToken GitHubTokenHandler - Hooks HooksHandler - LlmInference LlmInferenceHandler + GitHubTelemetry GitHubTelemetryHandler + GitHubToken GitHubTokenHandler + Hooks HooksHandler + LlmInference LlmInferenceHandler } func clientGlobalHandlerError(err error) *jsonrpc2.Error { diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go index dd63ac230e..106f7304f3 100644 --- a/go/rpc/zrpc_encoding.go +++ b/go/rpc/zrpc_encoding.go @@ -91,7 +91,7 @@ func (r APIKeyAuthInfo) MarshalJSON() ([]byte, error) { Type AuthInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -102,7 +102,7 @@ func (r CopilotAPITokenAuthInfo) MarshalJSON() ([]byte, error) { Type AuthInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -113,7 +113,7 @@ func (r EnvAuthInfo) MarshalJSON() ([]byte, error) { Type AuthInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -124,7 +124,7 @@ func (r GhCLIAuthInfo) MarshalJSON() ([]byte, error) { Type AuthInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -135,7 +135,7 @@ func (r HMACAuthInfo) MarshalJSON() ([]byte, error) { Type AuthInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -146,7 +146,7 @@ func (r TokenAuthInfo) MarshalJSON() ([]byte, error) { Type AuthInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -157,7 +157,7 @@ func (r TokenProviderAuthInfo) MarshalJSON() ([]byte, error) { Type AuthInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -168,16 +168,16 @@ func (r UserAuthInfo) MarshalJSON() ([]byte, error) { Type AuthInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } func (r *AccountAllUsers) UnmarshalJSON(data []byte) error { type rawAccountAllUsers struct { - AuthInfo json.RawMessage `json:"authInfo"` - SelectionID *string `json:"selectionId,omitempty"` - Token *string `json:"token,omitempty"` + AuthInfo json.RawMessage `json:"authInfo"` + SelectionID *string `json:"selectionId,omitempty"` + Token *string `json:"token,omitempty"` } var raw rawAccountAllUsers if err := json.Unmarshal(data, &raw); err != nil { @@ -197,8 +197,8 @@ func (r *AccountAllUsers) UnmarshalJSON(data []byte) error { func (r *AccountGetCurrentAuthResult) UnmarshalJSON(data []byte) error { type rawAccountGetCurrentAuthResult struct { - AuthErrors []string `json:"authErrors,omitzero"` - AuthInfo json.RawMessage `json:"authInfo,omitempty"` + AuthErrors []string `json:"authErrors,omitzero"` + AuthInfo json.RawMessage `json:"authInfo,omitempty"` } var raw rawAccountGetCurrentAuthResult if err := json.Unmarshal(data, &raw); err != nil { @@ -217,8 +217,8 @@ func (r *AccountGetCurrentAuthResult) UnmarshalJSON(data []byte) error { func (r *AccountLogoutRequest) UnmarshalJSON(data []byte) error { type rawAccountLogoutRequest struct { - AuthInfo json.RawMessage `json:"authInfo,omitempty"` - SelectionID *string `json:"selectionId,omitempty"` + AuthInfo json.RawMessage `json:"authInfo,omitempty"` + SelectionID *string `json:"selectionId,omitempty"` } var raw rawAccountLogoutRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -294,7 +294,7 @@ func (r AgentRegistrySpawnError) MarshalJSON() ([]byte, error) { Kind AgentRegistrySpawnResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -305,7 +305,7 @@ func (r AgentRegistrySpawnRegistryTimeout) MarshalJSON() ([]byte, error) { Kind AgentRegistrySpawnResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -316,7 +316,7 @@ func (r AgentRegistrySpawnSpawned) MarshalJSON() ([]byte, error) { Kind AgentRegistrySpawnResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -327,7 +327,7 @@ func (r AgentRegistrySpawnValidationError) MarshalJSON() ([]byte, error) { Kind AgentRegistrySpawnResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -457,7 +457,7 @@ func (r AttachmentBlob) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -468,7 +468,7 @@ func (r AttachmentDirectory) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -479,7 +479,7 @@ func (r AttachmentExtensionContext) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -490,7 +490,7 @@ func (r AttachmentFile) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -501,7 +501,7 @@ func (r AttachmentGitHubActionsJob) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -512,7 +512,7 @@ func (r AttachmentGitHubCommit) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -523,7 +523,7 @@ func (r AttachmentGitHubFile) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -534,7 +534,7 @@ func (r AttachmentGitHubFileDiff) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -545,7 +545,7 @@ func (r AttachmentGitHubReference) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -556,7 +556,7 @@ func (r AttachmentGitHubRelease) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -567,7 +567,7 @@ func (r AttachmentGitHubRepository) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -578,7 +578,7 @@ func (r AttachmentGitHubSnippet) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -589,7 +589,7 @@ func (r AttachmentGitHubTreeComparison) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -600,7 +600,7 @@ func (r AttachmentGitHubURL) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -611,7 +611,7 @@ func (r AttachmentSelection) MarshalJSON() ([]byte, error) { Type AttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -637,16 +637,16 @@ func unmarshalBuiltinToolSafeForTelemetry(data []byte) (BuiltinToolSafeForTeleme func (r *BuiltinToolDescriptor) UnmarshalJSON(data []byte) error { type rawBuiltinToolDescriptor struct { - Description string `json:"description"` - Format *BuiltinToolFormat `json:"format"` - HasSummariseIntention bool `json:"hasSummariseIntention"` - InputSchema *BuiltinToolInputSchema `json:"inputSchema"` - Instructions *string `json:"instructions"` - IsTerminal bool `json:"isTerminal"` - Name string `json:"name"` - SafeForTelemetry json.RawMessage `json:"safeForTelemetry"` - Title *string `json:"title"` - Type *string `json:"type"` + Description string `json:"description"` + Format *BuiltinToolFormat `json:"format"` + HasSummariseIntention bool `json:"hasSummariseIntention"` + InputSchema *BuiltinToolInputSchema `json:"inputSchema"` + Instructions *string `json:"instructions"` + IsTerminal bool `json:"isTerminal"` + Name string `json:"name"` + SafeForTelemetry json.RawMessage `json:"safeForTelemetry"` + Title *string `json:"title"` + Type *string `json:"type"` } var raw rawBuiltinToolDescriptor if err := json.Unmarshal(data, &raw); err != nil { @@ -759,7 +759,7 @@ func (r CatalogCandidateSourceEmbedded) MarshalJSON() ([]byte, error) { Kind CatalogCandidateSourceKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -770,22 +770,22 @@ func (r CatalogCandidateSourceURL) MarshalJSON() ([]byte, error) { Kind CatalogCandidateSourceKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *CatalogAiSkillCandidate) UnmarshalJSON(data []byte) error { type rawCatalogAiSkillCandidate struct { - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Handle string `json:"handle"` - HandleExpiresAt string `json:"handleExpiresAt"` - Installability CatalogAiSkillCandidateInstallability `json:"installability"` - MediaType CatalogAiSkillCandidateMediaType `json:"mediaType"` - Provenance CatalogAiSkillCandidateProvenance `json:"provenance"` - Publisher *string `json:"publisher,omitempty"` - Source json.RawMessage `json:"source"` + Description *string `json:"description,omitempty"` + DisplayName string `json:"displayName"` + Handle string `json:"handle"` + HandleExpiresAt string `json:"handleExpiresAt"` + Installability CatalogAiSkillCandidateInstallability `json:"installability"` + MediaType CatalogAiSkillCandidateMediaType `json:"mediaType"` + Provenance CatalogAiSkillCandidateProvenance `json:"provenance"` + Publisher *string `json:"publisher,omitempty"` + Source json.RawMessage `json:"source"` } var raw rawCatalogAiSkillCandidate if err := json.Unmarshal(data, &raw); err != nil { @@ -815,22 +815,22 @@ func (r CatalogAiSkillCandidate) MarshalJSON() ([]byte, error) { Kind CatalogCandidateKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *CatalogMCPServerCandidate) UnmarshalJSON(data []byte) error { type rawCatalogMCPServerCandidate struct { - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Handle string `json:"handle"` - HandleExpiresAt string `json:"handleExpiresAt"` - Installability CatalogMCPServerInstallability `json:"installability"` - MediaType MCPServerCardMediaType `json:"mediaType"` - Provenance CatalogMCPServerCandidateProvenance `json:"provenance"` - Publisher *string `json:"publisher,omitempty"` - Source json.RawMessage `json:"source"` + Description *string `json:"description,omitempty"` + DisplayName string `json:"displayName"` + Handle string `json:"handle"` + HandleExpiresAt string `json:"handleExpiresAt"` + Installability CatalogMCPServerInstallability `json:"installability"` + MediaType MCPServerCardMediaType `json:"mediaType"` + Provenance CatalogMCPServerCandidateProvenance `json:"provenance"` + Publisher *string `json:"publisher,omitempty"` + Source json.RawMessage `json:"source"` } var raw rawCatalogMCPServerCandidate if err := json.Unmarshal(data, &raw); err != nil { @@ -860,7 +860,7 @@ func (r CatalogMCPServerCandidate) MarshalJSON() ([]byte, error) { Kind CatalogCandidateKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -966,7 +966,7 @@ func (r CatalogAuthenticationRequiredError) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -977,7 +977,7 @@ func (r CatalogContractViolationError) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -988,7 +988,7 @@ func (r CatalogInvalidRequestError) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -999,7 +999,7 @@ func (r CatalogMalformedCardError) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1010,7 +1010,7 @@ func (r CatalogNegotiationRefusedError) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1021,7 +1021,7 @@ func (r CatalogNetworkFailureError) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1032,17 +1032,17 @@ func (r CatalogPolicyRejectedError) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *CatalogSearchSucceeded) UnmarshalJSON(data []byte) error { type rawCatalogSearchSucceeded struct { - Candidates []json.RawMessage `json:"candidates"` + Candidates []json.RawMessage `json:"candidates"` Negotiated CatalogNegotiatedContract `json:"negotiated"` - SearchID string `json:"searchId"` - Truncated bool `json:"truncated"` + SearchID string `json:"searchId"` + Truncated bool `json:"truncated"` } var raw rawCatalogSearchSucceeded if err := json.Unmarshal(data, &raw); err != nil { @@ -1070,7 +1070,7 @@ func (r CatalogSearchSucceeded) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1081,7 +1081,7 @@ func (r CatalogUnavailableError) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1092,7 +1092,7 @@ func (r CatalogUnsafeRetrievalError) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1103,7 +1103,7 @@ func (r CatalogUnsupportedKindError) MarshalJSON() ([]byte, error) { Kind CatalogSearchResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1147,7 +1147,7 @@ func (r QueuedCommandHandled) MarshalJSON() ([]byte, error) { alias }{ Handled: r.Handled(), - alias: alias(r), + alias: alias(r), }) } @@ -1158,14 +1158,14 @@ func (r QueuedCommandNotHandled) MarshalJSON() ([]byte, error) { alias }{ Handled: r.Handled(), - alias: alias(r), + alias: alias(r), }) } func (r *CommandsRespondToQueuedCommandRequest) UnmarshalJSON(data []byte) error { type rawCommandsRespondToQueuedCommandRequest struct { - RequestID string `json:"requestId"` - Result json.RawMessage `json:"result"` + RequestID string `json:"requestId"` + Result json.RawMessage `json:"result"` } var raw rawCommandsRespondToQueuedCommandRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -1229,7 +1229,7 @@ func (r DebugCollectLogsDestinationArchive) MarshalJSON() ([]byte, error) { Kind DebugCollectLogsDestinationKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1240,16 +1240,16 @@ func (r DebugCollectLogsDestinationDirectory) MarshalJSON() ([]byte, error) { Kind DebugCollectLogsDestinationKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *DebugCollectLogsRequest) UnmarshalJSON(data []byte) error { type rawDebugCollectLogsRequest struct { - AdditionalEntries []DebugCollectLogsEntry `json:"additionalEntries,omitzero"` - Destination json.RawMessage `json:"destination"` - Include *DebugCollectLogsInclude `json:"include,omitempty"` + AdditionalEntries []DebugCollectLogsEntry `json:"additionalEntries,omitzero"` + Destination json.RawMessage `json:"destination"` + Include *DebugCollectLogsInclude `json:"include,omitempty"` } var raw rawDebugCollectLogsRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -1376,7 +1376,7 @@ func (r ExternalToolTextResultForLlmContentAudio) MarshalJSON() ([]byte, error) Type ExternalToolTextResultForLlmContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1387,7 +1387,7 @@ func (r ExternalToolTextResultForLlmContentImage) MarshalJSON() ([]byte, error) Type ExternalToolTextResultForLlmContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1472,7 +1472,7 @@ func (r ExternalToolTextResultForLlmContentResource) MarshalJSON() ([]byte, erro Type ExternalToolTextResultForLlmContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1483,7 +1483,7 @@ func (r ExternalToolTextResultForLlmContentResourceLink) MarshalJSON() ([]byte, Type ExternalToolTextResultForLlmContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1494,7 +1494,7 @@ func (r ExternalToolTextResultForLlmContentShellExit) MarshalJSON() ([]byte, err Type ExternalToolTextResultForLlmContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1505,7 +1505,7 @@ func (r ExternalToolTextResultForLlmContentTerminal) MarshalJSON() ([]byte, erro Type ExternalToolTextResultForLlmContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1516,7 +1516,7 @@ func (r ExternalToolTextResultForLlmContentText) MarshalJSON() ([]byte, error) { Type ExternalToolTextResultForLlmContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1524,13 +1524,13 @@ func (r ExternalToolTextResultForLlmContentText) MarshalJSON() ([]byte, error) { func (r *ExternalToolTextResultForLlm) UnmarshalJSON(data []byte) error { type rawExternalToolTextResultForLlm struct { BinaryResultsForLlm []ExternalToolTextResultForLlmBinaryResultsForLlm `json:"binaryResultsForLlm,omitzero"` - Contents []json.RawMessage `json:"contents,omitzero"` - Error *string `json:"error,omitempty"` - ResultType *string `json:"resultType,omitempty"` - SessionLog *string `json:"sessionLog,omitempty"` - TextResultForLlm string `json:"textResultForLlm"` - ToolReferences []string `json:"toolReferences,omitzero"` - ToolTelemetry map[string]any `json:"toolTelemetry,omitzero"` + Contents []json.RawMessage `json:"contents,omitzero"` + Error *string `json:"error,omitempty"` + ResultType *string `json:"resultType,omitempty"` + SessionLog *string `json:"sessionLog,omitempty"` + TextResultForLlm string `json:"textResultForLlm"` + ToolReferences []string `json:"toolReferences,omitzero"` + ToolTelemetry map[string]any `json:"toolTelemetry,omitzero"` } var raw rawExternalToolTextResultForLlm if err := json.Unmarshal(data, &raw); err != nil { @@ -1640,7 +1640,7 @@ func (r FactoryRunFailureFactoryAccountingIncomplete) MarshalJSON() ([]byte, err Type FactoryRunFailureType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1651,7 +1651,7 @@ func (r FactoryRunFailureFactoryDurableFailure) MarshalJSON() ([]byte, error) { Type FactoryRunFailureType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1662,7 +1662,7 @@ func (r FactoryRunFailureFactoryLimitReached) MarshalJSON() ([]byte, error) { Type FactoryRunFailureType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1673,7 +1673,7 @@ func (r FactoryRunFailureFactoryProviderDisconnected) MarshalJSON() ([]byte, err Type FactoryRunFailureType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1684,7 +1684,7 @@ func (r FactoryRunFailureFactoryResumeDeclined) MarshalJSON() ([]byte, error) { Type FactoryRunFailureType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1736,7 +1736,7 @@ func (r FactoryPauseInfoCheckpoint) MarshalJSON() ([]byte, error) { Type FactoryPauseInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1747,18 +1747,18 @@ func (r FactoryPauseInfoUser) MarshalJSON() ([]byte, error) { Type FactoryPauseInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } func (r *FactoryRunTerminal) UnmarshalJSON(data []byte) error { type rawFactoryRunTerminal struct { - Error *string `json:"error,omitempty"` - Failure json.RawMessage `json:"failure,omitempty"` - PauseInfo json.RawMessage `json:"pauseInfo"` - Reason *string `json:"reason,omitempty"` - ResultPreview *string `json:"resultPreview,omitempty"` + Error *string `json:"error,omitempty"` + Failure json.RawMessage `json:"failure,omitempty"` + PauseInfo json.RawMessage `json:"pauseInfo"` + Reason *string `json:"reason,omitempty"` + ResultPreview *string `json:"resultPreview,omitempty"` } var raw rawFactoryRunTerminal if err := json.Unmarshal(data, &raw); err != nil { @@ -1786,15 +1786,15 @@ func (r *FactoryRunTerminal) UnmarshalJSON(data []byte) error { func (r *FactoryRunResult) UnmarshalJSON(data []byte) error { type rawFactoryRunResult struct { - Attempt *int64 `json:"attempt,omitempty"` - Error *string `json:"error,omitempty"` - Failure json.RawMessage `json:"failure,omitempty"` - PauseInfo json.RawMessage `json:"pauseInfo,omitempty"` - Reason *string `json:"reason,omitempty"` - Result any `json:"result,omitempty"` - RunID string `json:"runId"` - Snapshot any `json:"snapshot,omitempty"` - Status FactoryRunStatus `json:"status"` + Attempt *int64 `json:"attempt,omitempty"` + Error *string `json:"error,omitempty"` + Failure json.RawMessage `json:"failure,omitempty"` + PauseInfo json.RawMessage `json:"pauseInfo,omitempty"` + Reason *string `json:"reason,omitempty"` + Result any `json:"result,omitempty"` + RunID string `json:"runId"` + Snapshot any `json:"snapshot,omitempty"` + Status FactoryRunStatus `json:"status"` } var raw rawFactoryRunResult if err := json.Unmarshal(data, &raw); err != nil { @@ -1843,6 +1843,33 @@ func unmarshalFilterMapping(data []byte) (FilterMapping, error) { return nil, errors.New("data did not match any union variant for FilterMapping") } +func (r *FleetStartRequest) UnmarshalJSON(data []byte) error { + type rawFleetStartRequest struct { + Attachments []json.RawMessage `json:"attachments,omitzero"` + Billable *bool `json:"billable,omitempty"` + Prompt *string `json:"prompt,omitempty"` + Wait *bool `json:"wait,omitempty"` + } + var raw rawFleetStartRequest + if err := json.Unmarshal(data, &raw); err != nil { + return err + } + if raw.Attachments != nil { + r.Attachments = make([]Attachment, 0, len(raw.Attachments)) + for _, rawItem := range raw.Attachments { + value, err := unmarshalAttachment(rawItem) + if err != nil { + return err + } + r.Attachments = append(r.Attachments, value) + } + } + r.Billable = raw.Billable + r.Prompt = raw.Prompt + r.Wait = raw.Wait + return nil +} + func unmarshalGitHubTokenAcquireResult(data []byte) (GitHubTokenAcquireResult, error) { if string(data) == "null" { return nil, nil @@ -1890,7 +1917,7 @@ func (r GitHubTokenAcquireResultCancelled) MarshalJSON() ([]byte, error) { Kind GitHubTokenAcquireResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1901,16 +1928,16 @@ func (r GitHubTokenAcquireResultToken) MarshalJSON() ([]byte, error) { Kind GitHubTokenAcquireResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *HandlePendingToolCallRequest) UnmarshalJSON(data []byte) error { type rawHandlePendingToolCallRequest struct { - Error *string `json:"error,omitempty"` - RequestID string `json:"requestId"` - Result json.RawMessage `json:"result,omitempty"` + Error *string `json:"error,omitempty"` + RequestID string `json:"requestId"` + Result json.RawMessage `json:"result,omitempty"` } var raw rawHandlePendingToolCallRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -1983,7 +2010,7 @@ func (r *InstalledPluginSource) UnmarshalJSON(data []byte) error { func matchesMCPSerializableServerConfigMCPServerConfigHTTP(data []byte) bool { var rawGroup0 struct { Command json.RawMessage `json:"command"` - URL json.RawMessage `json:"url"` + URL json.RawMessage `json:"url"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { return false @@ -1997,7 +2024,7 @@ func matchesMCPSerializableServerConfigMCPServerConfigHTTP(data []byte) bool { func matchesMCPSerializableServerConfigMCPServerConfigStdio(data []byte) bool { var rawGroup0 struct { Command json.RawMessage `json:"command"` - URL json.RawMessage `json:"url"` + URL json.RawMessage `json:"url"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { return false @@ -2076,33 +2103,33 @@ func unmarshalMCPSafeForTelemetry(data []byte) (MCPSafeForTelemetry, error) { func (r *MCPServerConfigHTTP) UnmarshalJSON(data []byte) error { type rawMCPServerConfigHTTP struct { - Auth json.RawMessage `json:"auth,omitempty"` - ConfigWarnings []string `json:"configWarnings,omitzero"` - DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` - DisableSecretMasking *bool `json:"disableSecretMasking,omitempty"` - DisableToolCache *bool `json:"disableToolCache,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Events []string `json:"events,omitzero"` - ExcludeTools []string `json:"excludeTools,omitzero"` - FilterMapping json.RawMessage `json:"filterMapping,omitempty"` - Headers map[string]string `json:"headers,omitzero"` - HeadersRefreshTtlMs *int64 `json:"headersRefreshTtlMs,omitempty"` - IsDefaultServer *bool `json:"isDefaultServer,omitempty"` - Notifications []string `json:"notifications,omitzero"` - OauthClientID *string `json:"oauthClientId,omitempty"` - OauthGrantType *MCPServerConfigHTTPOauthGrantType `json:"oauthGrantType,omitempty"` - OauthPublicClient *bool `json:"oauthPublicClient,omitempty"` - Oidc json.RawMessage `json:"oidc,omitempty"` - SafeForTelemetry json.RawMessage `json:"safeForTelemetry,omitempty"` - Source *MCPServerSource `json:"source,omitempty"` - SourcePath *string `json:"sourcePath,omitempty"` - SourcePlugin *string `json:"sourcePlugin,omitempty"` - SourcePluginSpec *bool `json:"sourcePluginSpec,omitempty"` - SourcePluginVersion *string `json:"sourcePluginVersion,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - Tools []string `json:"tools,omitzero"` - Type *MCPServerConfigHTTPType `json:"type,omitempty"` - URL string `json:"url"` + Auth json.RawMessage `json:"auth,omitempty"` + ConfigWarnings []string `json:"configWarnings,omitzero"` + DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` + DisableSecretMasking *bool `json:"disableSecretMasking,omitempty"` + DisableToolCache *bool `json:"disableToolCache,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Events []string `json:"events,omitzero"` + ExcludeTools []string `json:"excludeTools,omitzero"` + FilterMapping json.RawMessage `json:"filterMapping,omitempty"` + Headers map[string]string `json:"headers,omitzero"` + HeadersRefreshTtlMs *int64 `json:"headersRefreshTtlMs,omitempty"` + IsDefaultServer *bool `json:"isDefaultServer,omitempty"` + Notifications []string `json:"notifications,omitzero"` + OauthClientID *string `json:"oauthClientId,omitempty"` + OauthGrantType *MCPServerConfigHTTPOauthGrantType `json:"oauthGrantType,omitempty"` + OauthPublicClient *bool `json:"oauthPublicClient,omitempty"` + Oidc json.RawMessage `json:"oidc,omitempty"` + SafeForTelemetry json.RawMessage `json:"safeForTelemetry,omitempty"` + Source *MCPServerSource `json:"source,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + SourcePlugin *string `json:"sourcePlugin,omitempty"` + SourcePluginSpec *bool `json:"sourcePluginSpec,omitempty"` + SourcePluginVersion *string `json:"sourcePluginVersion,omitempty"` + Timeout *int64 `json:"timeout,omitempty"` + Tools []string `json:"tools,omitzero"` + Type *MCPServerConfigHTTPType `json:"type,omitempty"` + URL string `json:"url"` } var raw rawMCPServerConfigHTTP if err := json.Unmarshal(data, &raw); err != nil { @@ -2164,31 +2191,31 @@ func (r *MCPServerConfigHTTP) UnmarshalJSON(data []byte) error { func (r *MCPServerConfigStdio) UnmarshalJSON(data []byte) error { type rawMCPServerConfigStdio struct { - Args []string `json:"args,omitzero"` - Auth json.RawMessage `json:"auth,omitempty"` - Command string `json:"command"` - ConfigWarnings []string `json:"configWarnings,omitzero"` - Cwd *string `json:"cwd,omitempty"` - DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` - DisableSecretMasking *bool `json:"disableSecretMasking,omitempty"` - DisableToolCache *bool `json:"disableToolCache,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Env map[string]string `json:"env,omitzero"` - Events []string `json:"events,omitzero"` - ExcludeTools []string `json:"excludeTools,omitzero"` - FilterMapping json.RawMessage `json:"filterMapping,omitempty"` - IsDefaultServer *bool `json:"isDefaultServer,omitempty"` - Notifications []string `json:"notifications,omitzero"` - Oidc json.RawMessage `json:"oidc,omitempty"` - SafeForTelemetry json.RawMessage `json:"safeForTelemetry,omitempty"` - Source *MCPServerSource `json:"source,omitempty"` - SourcePath *string `json:"sourcePath,omitempty"` - SourcePlugin *string `json:"sourcePlugin,omitempty"` - SourcePluginSpec *bool `json:"sourcePluginSpec,omitempty"` - SourcePluginVersion *string `json:"sourcePluginVersion,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - Tools []string `json:"tools,omitzero"` - Type *MCPServerConfigStdioType `json:"type,omitempty"` + Args []string `json:"args,omitzero"` + Auth json.RawMessage `json:"auth,omitempty"` + Command string `json:"command"` + ConfigWarnings []string `json:"configWarnings,omitzero"` + Cwd *string `json:"cwd,omitempty"` + DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` + DisableSecretMasking *bool `json:"disableSecretMasking,omitempty"` + DisableToolCache *bool `json:"disableToolCache,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Env map[string]string `json:"env,omitzero"` + Events []string `json:"events,omitzero"` + ExcludeTools []string `json:"excludeTools,omitzero"` + FilterMapping json.RawMessage `json:"filterMapping,omitempty"` + IsDefaultServer *bool `json:"isDefaultServer,omitempty"` + Notifications []string `json:"notifications,omitzero"` + Oidc json.RawMessage `json:"oidc,omitempty"` + SafeForTelemetry json.RawMessage `json:"safeForTelemetry,omitempty"` + Source *MCPServerSource `json:"source,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + SourcePlugin *string `json:"sourcePlugin,omitempty"` + SourcePluginSpec *bool `json:"sourcePluginSpec,omitempty"` + SourcePluginVersion *string `json:"sourcePluginVersion,omitempty"` + Timeout *int64 `json:"timeout,omitempty"` + Tools []string `json:"tools,omitzero"` + Type *MCPServerConfigStdioType `json:"type,omitempty"` } var raw rawMCPServerConfigStdio if err := json.Unmarshal(data, &raw); err != nil { @@ -2249,7 +2276,7 @@ func (r *MCPServerConfigStdio) UnmarshalJSON(data []byte) error { func (r *MCPConfigAddRequest) UnmarshalJSON(data []byte) error { type rawMCPConfigAddRequest struct { Config json.RawMessage `json:"config"` - Name string `json:"name"` + Name string `json:"name"` } var raw rawMCPConfigAddRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -2290,7 +2317,7 @@ func (r *MCPConfigList) UnmarshalJSON(data []byte) error { func (r *MCPConfigUpdateRequest) UnmarshalJSON(data []byte) error { type rawMCPConfigUpdateRequest struct { Config json.RawMessage `json:"config"` - Name string `json:"name"` + Name string `json:"name"` } var raw rawMCPConfigUpdateRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -2354,7 +2381,7 @@ func (r MCPHeadersHandlePendingHeadersRefreshRequestHeaders) MarshalJSON() ([]by Kind MCPHeadersHandlePendingHeadersRefreshRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2365,15 +2392,15 @@ func (r MCPHeadersHandlePendingHeadersRefreshRequestNone) MarshalJSON() ([]byte, Kind MCPHeadersHandlePendingHeadersRefreshRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *MCPHeadersHandlePendingHeadersRefreshRequestRequest) UnmarshalJSON(data []byte) error { type rawMCPHeadersHandlePendingHeadersRefreshRequestRequest struct { - RequestID string `json:"requestId"` - Result json.RawMessage `json:"result"` + RequestID string `json:"requestId"` + Result json.RawMessage `json:"result"` } var raw rawMCPHeadersHandlePendingHeadersRefreshRequestRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -2490,7 +2517,7 @@ func (r MCPPlanRequiredValueEnum) MarshalJSON() ([]byte, error) { Kind MCPPlanRequiredValueKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2501,19 +2528,19 @@ func (r MCPPlanRequiredValueScalar) MarshalJSON() ([]byte, error) { Kind MCPPlanRequiredValueKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *MCPPlanTransportChoicePackage) UnmarshalJSON(data []byte) error { type rawMCPPlanTransportChoicePackage struct { - ChoiceID string `json:"choiceId"` - InstallMethod MCPPlanPackageInstallMethod `json:"installMethod"` - PackageIdentifier string `json:"packageIdentifier"` - PackageType string `json:"packageType"` - RequiredValues []json.RawMessage `json:"requiredValues"` - SecretPlaceholders []MCPPlanSecretPlaceholder `json:"secretPlaceholders"` + ChoiceID string `json:"choiceId"` + InstallMethod MCPPlanPackageInstallMethod `json:"installMethod"` + PackageIdentifier string `json:"packageIdentifier"` + PackageType string `json:"packageType"` + RequiredValues []json.RawMessage `json:"requiredValues"` + SecretPlaceholders []MCPPlanSecretPlaceholder `json:"secretPlaceholders"` } var raw rawMCPPlanTransportChoicePackage if err := json.Unmarshal(data, &raw); err != nil { @@ -2544,18 +2571,18 @@ func (r MCPPlanTransportChoicePackage) MarshalJSON() ([]byte, error) { alias }{ Transport: r.Transport(), - alias: alias(r), + alias: alias(r), }) } func (r *MCPPlanTransportChoiceRemote) UnmarshalJSON(data []byte) error { type rawMCPPlanTransportChoiceRemote struct { - ChoiceID string `json:"choiceId"` - Endpoint string `json:"endpoint"` - InstallMethod MCPPlanRemoteInstallMethod `json:"installMethod"` - RequiredValues []json.RawMessage `json:"requiredValues"` + ChoiceID string `json:"choiceId"` + Endpoint string `json:"endpoint"` + InstallMethod MCPPlanRemoteInstallMethod `json:"installMethod"` + RequiredValues []json.RawMessage `json:"requiredValues"` SecretPlaceholders []MCPPlanSecretPlaceholder `json:"secretPlaceholders"` - Discriminator MCPPlanRemoteTransport `json:"transport,omitempty"` + Discriminator MCPPlanRemoteTransport `json:"transport,omitempty"` } var raw rawMCPPlanTransportChoiceRemote if err := json.Unmarshal(data, &raw); err != nil { @@ -2586,23 +2613,23 @@ func (r MCPPlanTransportChoiceRemote) MarshalJSON() ([]byte, error) { alias }{ Transport: r.Transport(), - alias: alias(r), + alias: alias(r), }) } func (r *MCPInstallPlan) UnmarshalJSON(data []byte) error { type rawMCPInstallPlan struct { - ConfigurationChanges []MCPPlanConfigurationChange `json:"configurationChanges"` - Identity MCPPlanResourceIdentity `json:"identity"` - PlanHandle string `json:"planHandle"` - PlanHandleExpiresAt string `json:"planHandleExpiresAt"` - Policy MCPPlanPolicyResult `json:"policy"` - Provenance MCPPlanProvenance `json:"provenance"` - RecommendedTransportChoiceID *string `json:"recommendedTransportChoiceId,omitempty"` - ReloadRequired bool `json:"reloadRequired"` - RequiresInteractiveConfiguration bool `json:"requiresInteractiveConfiguration"` - Target MCPPlanTarget `json:"target"` - TransportChoices []json.RawMessage `json:"transportChoices"` + ConfigurationChanges []MCPPlanConfigurationChange `json:"configurationChanges"` + Identity MCPPlanResourceIdentity `json:"identity"` + PlanHandle string `json:"planHandle"` + PlanHandleExpiresAt string `json:"planHandleExpiresAt"` + Policy MCPPlanPolicyResult `json:"policy"` + Provenance MCPPlanProvenance `json:"provenance"` + RecommendedTransportChoiceID *string `json:"recommendedTransportChoiceId,omitempty"` + ReloadRequired bool `json:"reloadRequired"` + RequiresInteractiveConfiguration bool `json:"requiresInteractiveConfiguration"` + Target MCPPlanTarget `json:"target"` + TransportChoices []json.RawMessage `json:"transportChoices"` } var raw rawMCPInstallPlan if err := json.Unmarshal(data, &raw); err != nil { @@ -2678,7 +2705,7 @@ func (r MCPOauthPendingRequestResponseCancelled) MarshalJSON() ([]byte, error) { Kind MCPOauthPendingRequestResponseKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2689,15 +2716,15 @@ func (r MCPOauthPendingRequestResponseToken) MarshalJSON() ([]byte, error) { Kind MCPOauthPendingRequestResponseKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *MCPOauthHandlePendingRequest) UnmarshalJSON(data []byte) error { type rawMCPOauthHandlePendingRequest struct { - RequestID string `json:"requestId"` - Result json.RawMessage `json:"result"` + RequestID string `json:"requestId"` + Result json.RawMessage `json:"result"` } var raw rawMCPOauthHandlePendingRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -2774,7 +2801,7 @@ func (r MCPOauthProbeResultAuthenticated) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -2785,7 +2812,7 @@ func (r MCPOauthProbeResultFailed) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -2796,7 +2823,7 @@ func (r MCPOauthProbeResultNeedsAuth) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -2807,7 +2834,7 @@ func (r MCPOauthProbeResultNoAuthRequired) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -2858,7 +2885,7 @@ func (r MCPPlanInstallSourceCandidate) MarshalJSON() ([]byte, error) { Kind MCPPlanInstallSourceKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2910,7 +2937,7 @@ func (r MCPServerCardEmbedded) MarshalJSON() ([]byte, error) { Kind MCPServerCardReferenceKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2921,7 +2948,7 @@ func (r MCPServerCardURL) MarshalJSON() ([]byte, error) { Kind MCPServerCardReferenceKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2950,7 +2977,7 @@ func (r MCPPlanInstallSourceCard) MarshalJSON() ([]byte, error) { Kind MCPPlanInstallSourceKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2958,8 +2985,8 @@ func (r MCPPlanInstallSourceCard) MarshalJSON() ([]byte, error) { func (r *MCPPlanInstallRequest) UnmarshalJSON(data []byte) error { type rawMCPPlanInstallRequest struct { Contract CatalogClientContract `json:"contract"` - Scope *MCPPlanScope `json:"scope,omitempty"` - Source json.RawMessage `json:"source"` + Scope *MCPPlanScope `json:"scope,omitempty"` + Source json.RawMessage `json:"source"` } var raw rawMCPPlanInstallRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -3090,7 +3117,7 @@ func (r CatalogHandleRejectedError) MarshalJSON() ([]byte, error) { Kind MCPPlanInstallResultKind `json:"kind"` alias }{ - Kind: r.mcpPlanInstallResultKind(), + Kind: r.mcpPlanInstallResultKind(), alias: alias(r), }) } @@ -3101,7 +3128,7 @@ func (r CatalogNotInstallableError) MarshalJSON() ([]byte, error) { Kind MCPPlanInstallResultKind `json:"kind"` alias }{ - Kind: r.mcpPlanInstallResultKind(), + Kind: r.mcpPlanInstallResultKind(), alias: alias(r), }) } @@ -3112,7 +3139,7 @@ func (r CatalogUnavailableTransportError) MarshalJSON() ([]byte, error) { Kind MCPPlanInstallResultKind `json:"kind"` alias }{ - Kind: r.mcpPlanInstallResultKind(), + Kind: r.mcpPlanInstallResultKind(), alias: alias(r), }) } @@ -3123,17 +3150,17 @@ func (r MCPPlanInstallPlanned) MarshalJSON() ([]byte, error) { Kind MCPPlanInstallResultKind `json:"kind"` alias }{ - Kind: r.mcpPlanInstallResultKind(), + Kind: r.mcpPlanInstallResultKind(), alias: alias(r), }) } func matchesMCPServerConfigHTTP(data []byte) bool { var rawGroup0 struct { - Command json.RawMessage `json:"command"` + Command json.RawMessage `json:"command"` ServerInstance json.RawMessage `json:"serverInstance"` - Type json.RawMessage `json:"type"` - URL json.RawMessage `json:"url"` + Type json.RawMessage `json:"type"` + URL json.RawMessage `json:"url"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { return false @@ -3152,10 +3179,10 @@ func matchesMCPServerConfigHTTP(data []byte) bool { func matchesMCPServerConfigMemory(data []byte) bool { var rawGroup0 struct { - Command json.RawMessage `json:"command"` + Command json.RawMessage `json:"command"` ServerInstance json.RawMessage `json:"serverInstance"` - Type json.RawMessage `json:"type"` - URL json.RawMessage `json:"url"` + Type json.RawMessage `json:"type"` + URL json.RawMessage `json:"url"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { return false @@ -3183,10 +3210,10 @@ func matchesMCPServerConfigMemory(data []byte) bool { func matchesMCPServerConfigStdio(data []byte) bool { var rawGroup0 struct { - Command json.RawMessage `json:"command"` + Command json.RawMessage `json:"command"` ServerInstance json.RawMessage `json:"serverInstance"` - Type json.RawMessage `json:"type"` - URL json.RawMessage `json:"url"` + Type json.RawMessage `json:"type"` + URL json.RawMessage `json:"url"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { return false @@ -3240,27 +3267,27 @@ func (r RawMCPServerConfigData) MarshalJSON() ([]byte, error) { func (r *MCPServerConfigMemory) UnmarshalJSON(data []byte) error { type rawMCPServerConfigMemory struct { - ConfigWarnings []string `json:"configWarnings,omitzero"` - DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` - DisableSecretMasking *bool `json:"disableSecretMasking,omitempty"` - DisableToolCache *bool `json:"disableToolCache,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Events []string `json:"events,omitzero"` - ExcludeTools []string `json:"excludeTools,omitzero"` - FilterMapping json.RawMessage `json:"filterMapping,omitempty"` - IsDefaultServer *bool `json:"isDefaultServer,omitempty"` - Notifications []string `json:"notifications,omitzero"` - Oidc json.RawMessage `json:"oidc,omitempty"` - SafeForTelemetry json.RawMessage `json:"safeForTelemetry,omitempty"` - ServerInstance any `json:"serverInstance"` - Source *MCPServerSource `json:"source,omitempty"` - SourcePath *string `json:"sourcePath,omitempty"` - SourcePlugin *string `json:"sourcePlugin,omitempty"` - SourcePluginSpec *bool `json:"sourcePluginSpec,omitempty"` - SourcePluginVersion *string `json:"sourcePluginVersion,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - Tools []string `json:"tools,omitzero"` - Type MCPServerConfigMemoryType `json:"type"` + ConfigWarnings []string `json:"configWarnings,omitzero"` + DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` + DisableSecretMasking *bool `json:"disableSecretMasking,omitempty"` + DisableToolCache *bool `json:"disableToolCache,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Events []string `json:"events,omitzero"` + ExcludeTools []string `json:"excludeTools,omitzero"` + FilterMapping json.RawMessage `json:"filterMapping,omitempty"` + IsDefaultServer *bool `json:"isDefaultServer,omitempty"` + Notifications []string `json:"notifications,omitzero"` + Oidc json.RawMessage `json:"oidc,omitempty"` + SafeForTelemetry json.RawMessage `json:"safeForTelemetry,omitempty"` + ServerInstance any `json:"serverInstance"` + Source *MCPServerSource `json:"source,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + SourcePlugin *string `json:"sourcePlugin,omitempty"` + SourcePluginSpec *bool `json:"sourcePluginSpec,omitempty"` + SourcePluginVersion *string `json:"sourcePluginVersion,omitempty"` + Timeout *int64 `json:"timeout,omitempty"` + Tools []string `json:"tools,omitzero"` + Type MCPServerConfigMemoryType `json:"type"` } var raw rawMCPServerConfigMemory if err := json.Unmarshal(data, &raw); err != nil { @@ -3310,19 +3337,19 @@ func (r *MCPServerConfigMemory) UnmarshalJSON(data []byte) error { func (r *MCPReloadConfig) UnmarshalJSON(data []byte) error { type rawMCPReloadConfig struct { - ActiveGitHubToken *string `json:"activeGitHubToken,omitempty"` - CLIEnabledServers []string `json:"cliEnabledServers,omitzero"` - ConfigFilter any `json:"configFilter,omitempty"` - DisabledServers []string `json:"disabledServers,omitzero"` - EnabledServers []string `json:"enabledServers,omitzero"` - ForceRestart *bool `json:"forceRestart,omitempty"` - GitHubMCPToolOptions any `json:"githubMcpToolOptions,omitempty"` - GitHubMCPUserOverride *bool `json:"githubMcpUserOverride,omitempty"` - IncludeWorkspaceSources *bool `json:"includeWorkspaceSources,omitempty"` - Mcp3pEnabled *bool `json:"mcp3pEnabled,omitempty"` - MCPServers map[string]json.RawMessage `json:"mcpServers"` - SecretStore any `json:"secretStore,omitempty"` - UseCachedToolSnapshots *bool `json:"useCachedToolSnapshots,omitempty"` + ActiveGitHubToken *string `json:"activeGitHubToken,omitempty"` + CLIEnabledServers []string `json:"cliEnabledServers,omitzero"` + ConfigFilter any `json:"configFilter,omitempty"` + DisabledServers []string `json:"disabledServers,omitzero"` + EnabledServers []string `json:"enabledServers,omitzero"` + ForceRestart *bool `json:"forceRestart,omitempty"` + GitHubMCPToolOptions any `json:"githubMcpToolOptions,omitempty"` + GitHubMCPUserOverride *bool `json:"githubMcpUserOverride,omitempty"` + IncludeWorkspaceSources *bool `json:"includeWorkspaceSources,omitempty"` + Mcp3pEnabled *bool `json:"mcp3pEnabled,omitempty"` + MCPServers map[string]json.RawMessage `json:"mcpServers"` + SecretStore any `json:"secretStore,omitempty"` + UseCachedToolSnapshots *bool `json:"useCachedToolSnapshots,omitempty"` } var raw rawMCPReloadConfig if err := json.Unmarshal(data, &raw); err != nil { @@ -3355,8 +3382,8 @@ func (r *MCPReloadConfig) UnmarshalJSON(data []byte) error { func (r *MCPRestartServerRequest) UnmarshalJSON(data []byte) error { type rawMCPRestartServerRequest struct { - Config json.RawMessage `json:"config,omitempty"` - ServerName string `json:"serverName"` + Config json.RawMessage `json:"config,omitempty"` + ServerName string `json:"serverName"` } var raw rawMCPRestartServerRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -3375,8 +3402,8 @@ func (r *MCPRestartServerRequest) UnmarshalJSON(data []byte) error { func (r *MCPStartServerRequest) UnmarshalJSON(data []byte) error { type rawMCPStartServerRequest struct { - Config json.RawMessage `json:"config,omitempty"` - ServerName string `json:"serverName"` + Config json.RawMessage `json:"config,omitempty"` + ServerName string `json:"serverName"` } var raw rawMCPStartServerRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -3518,7 +3545,7 @@ func (r PermissionDecisionApproved) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3618,7 +3645,7 @@ func (r UserToolSessionApprovalCommands) MarshalJSON() ([]byte, error) { Kind UserToolSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3629,7 +3656,7 @@ func (r UserToolSessionApprovalCustomTool) MarshalJSON() ([]byte, error) { Kind UserToolSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3640,7 +3667,7 @@ func (r UserToolSessionApprovalExtensionEnvAccess) MarshalJSON() ([]byte, error) Kind UserToolSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3651,7 +3678,7 @@ func (r UserToolSessionApprovalExtensionManagement) MarshalJSON() ([]byte, error Kind UserToolSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3662,7 +3689,7 @@ func (r UserToolSessionApprovalExtensionPermissionAccess) MarshalJSON() ([]byte, Kind UserToolSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3673,7 +3700,7 @@ func (r UserToolSessionApprovalFactory) MarshalJSON() ([]byte, error) { Kind UserToolSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3684,7 +3711,7 @@ func (r UserToolSessionApprovalMCP) MarshalJSON() ([]byte, error) { Kind UserToolSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3695,7 +3722,7 @@ func (r UserToolSessionApprovalMemory) MarshalJSON() ([]byte, error) { Kind UserToolSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3706,7 +3733,7 @@ func (r UserToolSessionApprovalRead) MarshalJSON() ([]byte, error) { Kind UserToolSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3717,15 +3744,15 @@ func (r UserToolSessionApprovalWrite) MarshalJSON() ([]byte, error) { Kind UserToolSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *PermissionDecisionApprovedForLocation) UnmarshalJSON(data []byte) error { type rawPermissionDecisionApprovedForLocation struct { - Approval json.RawMessage `json:"approval"` - LocationKey string `json:"locationKey"` + Approval json.RawMessage `json:"approval"` + LocationKey string `json:"locationKey"` } var raw rawPermissionDecisionApprovedForLocation if err := json.Unmarshal(data, &raw); err != nil { @@ -3748,7 +3775,7 @@ func (r PermissionDecisionApprovedForLocation) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3777,7 +3804,7 @@ func (r PermissionDecisionApprovedForSession) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3883,7 +3910,7 @@ func (r PermissionDecisionApproveForLocationApprovalCommands) MarshalJSON() ([]b Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3894,7 +3921,7 @@ func (r PermissionDecisionApproveForLocationApprovalCustomTool) MarshalJSON() ([ Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3905,7 +3932,7 @@ func (r PermissionDecisionApproveForLocationApprovalExtensionEnvAccess) MarshalJ Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3916,7 +3943,7 @@ func (r PermissionDecisionApproveForLocationApprovalExtensionManagement) Marshal Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3927,7 +3954,7 @@ func (r PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess) M Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3938,7 +3965,7 @@ func (r PermissionDecisionApproveForLocationApprovalFactory) MarshalJSON() ([]by Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3949,7 +3976,7 @@ func (r PermissionDecisionApproveForLocationApprovalMCP) MarshalJSON() ([]byte, Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3960,7 +3987,7 @@ func (r PermissionDecisionApproveForLocationApprovalMCPSampling) MarshalJSON() ( Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3971,7 +3998,7 @@ func (r PermissionDecisionApproveForLocationApprovalMemory) MarshalJSON() ([]byt Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3982,7 +4009,7 @@ func (r PermissionDecisionApproveForLocationApprovalRead) MarshalJSON() ([]byte, Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -3993,15 +4020,15 @@ func (r PermissionDecisionApproveForLocationApprovalWrite) MarshalJSON() ([]byte Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *PermissionDecisionApproveForLocation) UnmarshalJSON(data []byte) error { type rawPermissionDecisionApproveForLocation struct { - Approval json.RawMessage `json:"approval"` - LocationKey string `json:"locationKey"` + Approval json.RawMessage `json:"approval"` + LocationKey string `json:"locationKey"` } var raw rawPermissionDecisionApproveForLocation if err := json.Unmarshal(data, &raw); err != nil { @@ -4024,7 +4051,7 @@ func (r PermissionDecisionApproveForLocation) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4130,7 +4157,7 @@ func (r PermissionDecisionApproveForSessionApprovalCommands) MarshalJSON() ([]by Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4141,7 +4168,7 @@ func (r PermissionDecisionApproveForSessionApprovalCustomTool) MarshalJSON() ([] Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4152,7 +4179,7 @@ func (r PermissionDecisionApproveForSessionApprovalExtensionEnvAccess) MarshalJS Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4163,7 +4190,7 @@ func (r PermissionDecisionApproveForSessionApprovalExtensionManagement) MarshalJ Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4174,7 +4201,7 @@ func (r PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess) Ma Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4185,7 +4212,7 @@ func (r PermissionDecisionApproveForSessionApprovalFactory) MarshalJSON() ([]byt Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4196,7 +4223,7 @@ func (r PermissionDecisionApproveForSessionApprovalMCP) MarshalJSON() ([]byte, e Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4207,7 +4234,7 @@ func (r PermissionDecisionApproveForSessionApprovalMCPSampling) MarshalJSON() ([ Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4218,7 +4245,7 @@ func (r PermissionDecisionApproveForSessionApprovalMemory) MarshalJSON() ([]byte Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4229,7 +4256,7 @@ func (r PermissionDecisionApproveForSessionApprovalRead) MarshalJSON() ([]byte, Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4240,7 +4267,7 @@ func (r PermissionDecisionApproveForSessionApprovalWrite) MarshalJSON() ([]byte, Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4248,7 +4275,7 @@ func (r PermissionDecisionApproveForSessionApprovalWrite) MarshalJSON() ([]byte, func (r *PermissionDecisionApproveForSession) UnmarshalJSON(data []byte) error { type rawPermissionDecisionApproveForSession struct { Approval json.RawMessage `json:"approval,omitempty"` - Domain *string `json:"domain,omitempty"` + Domain *string `json:"domain,omitempty"` } var raw rawPermissionDecisionApproveForSession if err := json.Unmarshal(data, &raw); err != nil { @@ -4271,7 +4298,7 @@ func (r PermissionDecisionApproveForSession) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4282,7 +4309,7 @@ func (r PermissionDecisionApproveOnce) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4293,7 +4320,7 @@ func (r PermissionDecisionApprovePermanently) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4304,7 +4331,7 @@ func (r PermissionDecisionCancelled) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4315,7 +4342,7 @@ func (r PermissionDecisionDeniedByContentExclusionPolicy) MarshalJSON() ([]byte, Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4326,7 +4353,7 @@ func (r PermissionDecisionDeniedByPermissionRequestHook) MarshalJSON() ([]byte, Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4337,7 +4364,7 @@ func (r PermissionDecisionDeniedByRules) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4348,7 +4375,7 @@ func (r PermissionDecisionDeniedInteractivelyByUser) MarshalJSON() ([]byte, erro Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4359,7 +4386,7 @@ func (r PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser) Marsha Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4370,7 +4397,7 @@ func (r PermissionDecisionReject) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4381,7 +4408,7 @@ func (r PermissionDecisionUserNotAvailable) MarshalJSON() ([]byte, error) { Kind PermissionDecisionKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4389,8 +4416,8 @@ func (r PermissionDecisionUserNotAvailable) MarshalJSON() ([]byte, error) { func (r *PermissionDecisionRequest) UnmarshalJSON(data []byte) error { type rawPermissionDecisionRequest struct { DecisionContext *PermissionDecisionContext `json:"decisionContext,omitempty"` - RequestID string `json:"requestId"` - Result json.RawMessage `json:"result"` + RequestID string `json:"requestId"` + Result json.RawMessage `json:"result"` } var raw rawPermissionDecisionRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -4509,7 +4536,7 @@ func (r PermissionsLocationsAddToolApprovalDetailsCommands) MarshalJSON() ([]byt Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4520,7 +4547,7 @@ func (r PermissionsLocationsAddToolApprovalDetailsCustomTool) MarshalJSON() ([]b Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4531,7 +4558,7 @@ func (r PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess) MarshalJSO Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4542,7 +4569,7 @@ func (r PermissionsLocationsAddToolApprovalDetailsExtensionManagement) MarshalJS Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4553,7 +4580,7 @@ func (r PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess) Mar Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4564,7 +4591,7 @@ func (r PermissionsLocationsAddToolApprovalDetailsFactory) MarshalJSON() ([]byte Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4575,7 +4602,7 @@ func (r PermissionsLocationsAddToolApprovalDetailsMCP) MarshalJSON() ([]byte, er Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4586,7 +4613,7 @@ func (r PermissionsLocationsAddToolApprovalDetailsMCPSampling) MarshalJSON() ([] Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4597,7 +4624,7 @@ func (r PermissionsLocationsAddToolApprovalDetailsMemory) MarshalJSON() ([]byte, Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4608,7 +4635,7 @@ func (r PermissionsLocationsAddToolApprovalDetailsRead) MarshalJSON() ([]byte, e Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -4619,15 +4646,15 @@ func (r PermissionsLocationsAddToolApprovalDetailsWrite) MarshalJSON() ([]byte, Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *PermissionLocationAddToolApprovalParams) UnmarshalJSON(data []byte) error { type rawPermissionLocationAddToolApprovalParams struct { - Approval json.RawMessage `json:"approval"` - LocationKey string `json:"locationKey"` + Approval json.RawMessage `json:"approval"` + LocationKey string `json:"locationKey"` } var raw rawPermissionLocationAddToolApprovalParams if err := json.Unmarshal(data, &raw); err != nil { @@ -4769,7 +4796,7 @@ func (r ExtensionContextPushInput) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4780,7 +4807,7 @@ func (r PushAttachmentBlob) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4791,7 +4818,7 @@ func (r PushAttachmentDirectory) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4802,7 +4829,7 @@ func (r PushAttachmentFile) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4813,7 +4840,7 @@ func (r PushAttachmentGitHubActionsJob) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4824,7 +4851,7 @@ func (r PushAttachmentGitHubCommit) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4835,7 +4862,7 @@ func (r PushAttachmentGitHubFile) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4846,7 +4873,7 @@ func (r PushAttachmentGitHubFileDiff) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4857,7 +4884,7 @@ func (r PushAttachmentGitHubReference) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4868,7 +4895,7 @@ func (r PushAttachmentGitHubRelease) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4879,7 +4906,7 @@ func (r PushAttachmentGitHubRepository) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4890,7 +4917,7 @@ func (r PushAttachmentGitHubSnippet) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4901,7 +4928,7 @@ func (r PushAttachmentGitHubTreeComparison) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4912,7 +4939,7 @@ func (r PushAttachmentGitHubURL) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -4923,25 +4950,25 @@ func (r PushAttachmentSelection) MarshalJSON() ([]byte, error) { Type PushAttachmentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } func (r *QueueInsertMessage) UnmarshalJSON(data []byte) error { type rawQueueInsertMessage struct { - AgentMode *SendAgentMode `json:"agentMode,omitempty"` - Attachments []json.RawMessage `json:"attachments,omitzero"` - Billable *bool `json:"billable,omitempty"` - Delivery *string `json:"delivery,omitempty"` - DisplayPrompt *string `json:"displayPrompt,omitempty"` - Mode *SendMode `json:"mode,omitempty"` - Prepend *bool `json:"prepend,omitempty"` - Prompt string `json:"prompt"` + AgentMode *SendAgentMode `json:"agentMode,omitempty"` + Attachments []json.RawMessage `json:"attachments,omitzero"` + Billable *bool `json:"billable,omitempty"` + Delivery *string `json:"delivery,omitempty"` + DisplayPrompt *string `json:"displayPrompt,omitempty"` + Mode *SendMode `json:"mode,omitempty"` + Prepend *bool `json:"prepend,omitempty"` + Prompt string `json:"prompt"` RequestHeaders map[string]string `json:"requestHeaders,omitzero"` - RequiredTool *string `json:"requiredTool,omitempty"` - Source *string `json:"source,omitempty"` - Wait *bool `json:"wait,omitempty"` + RequiredTool *string `json:"requiredTool,omitempty"` + Source *string `json:"source,omitempty"` + Wait *bool `json:"wait,omitempty"` } var raw rawQueueInsertMessage if err := json.Unmarshal(data, &raw); err != nil { @@ -5088,8 +5115,8 @@ func (r *RemoteControlStatusResult) UnmarshalJSON(data []byte) error { func (r *RemoteControlStopResult) UnmarshalJSON(data []byte) error { type rawRemoteControlStopResult struct { - Status json.RawMessage `json:"status"` - Stopped bool `json:"stopped"` + Status json.RawMessage `json:"status"` + Stopped bool `json:"stopped"` } var raw rawRemoteControlStopResult if err := json.Unmarshal(data, &raw); err != nil { @@ -5108,8 +5135,8 @@ func (r *RemoteControlStopResult) UnmarshalJSON(data []byte) error { func (r *RemoteControlTransferResult) UnmarshalJSON(data []byte) error { type rawRemoteControlTransferResult struct { - Status json.RawMessage `json:"status"` - Transferred bool `json:"transferred"` + Status json.RawMessage `json:"status"` + Transferred bool `json:"transferred"` } var raw rawRemoteControlTransferResult if err := json.Unmarshal(data, &raw); err != nil { @@ -5129,7 +5156,7 @@ func (r *RemoteControlTransferResult) UnmarshalJSON(data []byte) error { func (r *SendAttachmentsToMessageParams) UnmarshalJSON(data []byte) error { type rawSendAttachmentsToMessageParams struct { Attachments []json.RawMessage `json:"attachments"` - InstanceID *string `json:"instanceId,omitempty"` + InstanceID *string `json:"instanceId,omitempty"` } var raw rawSendAttachmentsToMessageParams if err := json.Unmarshal(data, &raw); err != nil { @@ -5151,12 +5178,12 @@ func (r *SendAttachmentsToMessageParams) UnmarshalJSON(data []byte) error { func (r *SendMessageItem) UnmarshalJSON(data []byte) error { type rawSendMessageItem struct { - Attachments []json.RawMessage `json:"attachments,omitzero"` - Billable *bool `json:"billable,omitempty"` - DisplayPrompt *string `json:"displayPrompt,omitempty"` - Prompt string `json:"prompt"` - RequiredTool *string `json:"requiredTool,omitempty"` - Source *string `json:"source,omitempty"` + Attachments []json.RawMessage `json:"attachments,omitzero"` + Billable *bool `json:"billable,omitempty"` + DisplayPrompt *string `json:"displayPrompt,omitempty"` + Prompt string `json:"prompt"` + RequiredTool *string `json:"requiredTool,omitempty"` + Source *string `json:"source,omitempty"` } var raw rawSendMessageItem if err := json.Unmarshal(data, &raw); err != nil { @@ -5182,20 +5209,20 @@ func (r *SendMessageItem) UnmarshalJSON(data []byte) error { func (r *SendRequest) UnmarshalJSON(data []byte) error { type rawSendRequest struct { - AgentMode *SendAgentMode `json:"agentMode,omitempty"` - Attachments []json.RawMessage `json:"attachments,omitzero"` - Billable *bool `json:"billable,omitempty"` - DisplayPrompt *string `json:"displayPrompt,omitempty"` - Mode *SendMode `json:"mode,omitempty"` - Prepend *bool `json:"prepend,omitempty"` - Prompt string `json:"prompt"` + AgentMode *SendAgentMode `json:"agentMode,omitempty"` + Attachments []json.RawMessage `json:"attachments,omitzero"` + Billable *bool `json:"billable,omitempty"` + DisplayPrompt *string `json:"displayPrompt,omitempty"` + Mode *SendMode `json:"mode,omitempty"` + Prepend *bool `json:"prepend,omitempty"` + Prompt string `json:"prompt"` RequestHeaders map[string]string `json:"requestHeaders,omitzero"` - RequiredTool *string `json:"requiredTool,omitempty"` - ResponseFormat *ResponseFormat `json:"responseFormat,omitempty"` - Source *string `json:"source,omitempty"` - Traceparent *string `json:"traceparent,omitempty"` - Tracestate *string `json:"tracestate,omitempty"` - Wait *bool `json:"wait,omitempty"` + RequiredTool *string `json:"requiredTool,omitempty"` + ResponseFormat *ResponseFormat `json:"responseFormat,omitempty"` + Source *string `json:"source,omitempty"` + Traceparent *string `json:"traceparent,omitempty"` + Tracestate *string `json:"tracestate,omitempty"` + Wait *bool `json:"wait,omitempty"` } var raw rawSendRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -5248,7 +5275,7 @@ func (r *SessionAuthLogoutUserRequest) UnmarshalJSON(data []byte) error { func (r *SessionAuthSwitchRequest) UnmarshalJSON(data []byte) error { type rawSessionAuthSwitchRequest struct { AuthInfo json.RawMessage `json:"authInfo"` - Token *string `json:"token,omitempty"` + Token *string `json:"token,omitempty"` } var raw rawSessionAuthSwitchRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -5364,7 +5391,7 @@ func (r SessionLimitPredictionResultAvailable) MarshalJSON() ([]byte, error) { Kind SessionLimitPredictionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5375,7 +5402,7 @@ func (r SessionLimitPredictionResultUnavailable) MarshalJSON() ([]byte, error) { Kind SessionLimitPredictionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5419,7 +5446,7 @@ func (r LocalSessionMetadataValue) MarshalJSON() ([]byte, error) { alias }{ IsRemote: r.sessionListEntryIsRemote(), - alias: alias(r), + alias: alias(r), }) } @@ -5430,7 +5457,7 @@ func (r RemoteSessionMetadataValue) MarshalJSON() ([]byte, error) { alias }{ IsRemote: r.sessionListEntryIsRemote(), - alias: alias(r), + alias: alias(r), }) } @@ -5457,78 +5484,79 @@ func (r *SessionList) UnmarshalJSON(data []byte) error { func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { type rawSessionOpenOptions struct { - AdditionalContentExclusionPolicies []SessionOpenOptionsAdditionalContentExclusionPolicy `json:"additionalContentExclusionPolicies,omitzero"` - AdditionalDirectories []string `json:"additionalDirectories,omitzero"` - AgentContext *string `json:"agentContext,omitempty"` - AllowAllMCPServerInstructions *bool `json:"allowAllMcpServerInstructions,omitempty"` - AskUserDisabled *bool `json:"askUserDisabled,omitempty"` - AuthClientIDMetadataURL *string `json:"authClientIdMetadataUrl,omitempty"` - AuthInfo json.RawMessage `json:"authInfo,omitempty"` - AvailableTools []string `json:"availableTools,omitzero"` - Capi *CapiSessionOptions `json:"capi,omitempty"` - ClientKind *string `json:"clientKind,omitempty"` - ClientName *string `json:"clientName,omitempty"` - CoauthorEnabled *bool `json:"coauthorEnabled,omitempty"` - ConfigDir *string `json:"configDir,omitempty"` - ContinueOnAutoMode *bool `json:"continueOnAutoMode,omitempty"` - CopilotURL *string `json:"copilotUrl,omitempty"` - CustomAgentsLocalOnly *bool `json:"customAgentsLocalOnly,omitempty"` - DetachedFromSpawningParentEngagementID *string `json:"detachedFromSpawningParentEngagementId,omitempty"` - DetachedFromSpawningParentSessionID *string `json:"detachedFromSpawningParentSessionId,omitempty"` - DisabledInstructionSources []string `json:"disabledInstructionSources,omitzero"` - DisabledMCPServers []string `json:"disabledMcpServers,omitzero"` - DisabledSkills []string `json:"disabledSkills,omitzero"` - EnableCitations *bool `json:"enableCitations,omitempty"` - EnableFileChangeTracking *bool `json:"enableFileChangeTracking,omitempty"` - EnableManagedSettings *bool `json:"enableManagedSettings,omitempty"` - EnableOnDemandInstructionDiscovery *bool `json:"enableOnDemandInstructionDiscovery,omitempty"` - EnableScriptSafety *bool `json:"enableScriptSafety,omitempty"` - EnableSkills *bool `json:"enableSkills,omitempty"` - EnableStreaming *bool `json:"enableStreaming,omitempty"` - EnvValueMode *SessionOpenOptionsEnvValueMode `json:"envValueMode,omitempty"` - EventsLogDirectory *string `json:"eventsLogDirectory,omitempty"` - EventsLogIncludesSubagents *bool `json:"eventsLogIncludesSubagents,omitempty"` - ExcludedBuiltinAgents []string `json:"excludedBuiltinAgents,omitzero"` - ExcludedTools []string `json:"excludedTools,omitzero"` - ExpAssignments any `json:"expAssignments,omitempty"` - FeatureFlags map[string]bool `json:"featureFlags,omitzero"` - HasSkillProvider *bool `json:"hasSkillProvider,omitempty"` - IncludedBuiltinAgents []string `json:"includedBuiltinAgents,omitzero"` - IncludedBuiltinSkills []string `json:"includedBuiltinSkills,omitzero"` - InstalledPlugins []InstalledPlugin `json:"installedPlugins,omitzero"` - IntegrationID *string `json:"integrationId,omitempty"` - IsExperimentalMode *bool `json:"isExperimentalMode,omitempty"` - LogInteractiveShells *bool `json:"logInteractiveShells,omitempty"` - LspClientName *string `json:"lspClientName,omitempty"` - ManagedSettings *SessionManagedSettings `json:"managedSettings,omitempty"` - MaxInlineBinaryBytes *int64 `json:"maxInlineBinaryBytes,omitempty"` - Memory *MemoryConfiguration `json:"memory,omitempty"` - Model *string `json:"model,omitempty"` - ModelCapabilitiesOverrides *ModelCapabilitiesOverride `json:"modelCapabilitiesOverrides,omitempty"` - Models []ProviderModelConfig `json:"models,omitzero"` - Name *string `json:"name,omitempty"` - Provider *ProviderConfig `json:"provider,omitempty"` - Providers []NamedProviderConfig `json:"providers,omitzero"` - ReasoningEffort *string `json:"reasoningEffort,omitempty"` - ReasoningSummary *SessionOpenOptionsReasoningSummary `json:"reasoningSummary,omitempty"` - RemoteDefaultedOn *bool `json:"remoteDefaultedOn,omitempty"` - RemoteExporting *bool `json:"remoteExporting,omitempty"` - RemoteSteerable *bool `json:"remoteSteerable,omitempty"` - RunningInInteractiveMode *bool `json:"runningInInteractiveMode,omitempty"` - SandboxConfig *SandboxConfig `json:"sandboxConfig,omitempty"` - SandboxConfigSource *SandboxConfigSource `json:"sandboxConfigSource,omitempty"` - SessionCapabilities []SessionCapability `json:"sessionCapabilities,omitzero"` - SessionID *string `json:"sessionId,omitempty"` - SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"` - Shell *ShellOptions `json:"shell,omitempty"` - ShellInitProfile *string `json:"shellInitProfile,omitempty"` - ShellProcessFlags []string `json:"shellProcessFlags,omitzero"` - SkillDirectories []string `json:"skillDirectories,omitzero"` - SkipCustomInstructions *bool `json:"skipCustomInstructions,omitempty"` - TrajectoryFile *string `json:"trajectoryFile,omitempty"` - Verbosity *Verbosity `json:"verbosity,omitempty"` - WorkingDirectory *string `json:"workingDirectory,omitempty"` - WorkingDirectoryContext *SessionContext `json:"workingDirectoryContext,omitempty"` + AdditionalContentExclusionPolicies []SessionOpenOptionsAdditionalContentExclusionPolicy `json:"additionalContentExclusionPolicies,omitzero"` + AdditionalDirectories []string `json:"additionalDirectories,omitzero"` + AgentContext *string `json:"agentContext,omitempty"` + AllowAllMCPServerInstructions *bool `json:"allowAllMcpServerInstructions,omitempty"` + AskUserDisabled *bool `json:"askUserDisabled,omitempty"` + AuthClientIDMetadataURL *string `json:"authClientIdMetadataUrl,omitempty"` + AuthInfo json.RawMessage `json:"authInfo,omitempty"` + AvailableTools []string `json:"availableTools,omitzero"` + Capi *CapiSessionOptions `json:"capi,omitempty"` + ClientKind *string `json:"clientKind,omitempty"` + ClientName *string `json:"clientName,omitempty"` + CoauthorEnabled *bool `json:"coauthorEnabled,omitempty"` + ConfigDir *string `json:"configDir,omitempty"` + ContinueOnAutoMode *bool `json:"continueOnAutoMode,omitempty"` + CopilotURL *string `json:"copilotUrl,omitempty"` + CustomAgentsLocalOnly *bool `json:"customAgentsLocalOnly,omitempty"` + DetachedFromSpawningParentEngagementID *string `json:"detachedFromSpawningParentEngagementId,omitempty"` + DetachedFromSpawningParentSessionID *string `json:"detachedFromSpawningParentSessionId,omitempty"` + DisabledInstructionSources []string `json:"disabledInstructionSources,omitzero"` + DisabledMCPServers []string `json:"disabledMcpServers,omitzero"` + DisabledSkills []string `json:"disabledSkills,omitzero"` + EnableCitations *bool `json:"enableCitations,omitempty"` + EnableFileChangeTracking *bool `json:"enableFileChangeTracking,omitempty"` + EnableManagedSettings *bool `json:"enableManagedSettings,omitempty"` + EnableOnDemandInstructionDiscovery *bool `json:"enableOnDemandInstructionDiscovery,omitempty"` + EnableScriptSafety *bool `json:"enableScriptSafety,omitempty"` + EnableSkills *bool `json:"enableSkills,omitempty"` + EnableStreaming *bool `json:"enableStreaming,omitempty"` + EnvValueMode *SessionOpenOptionsEnvValueMode `json:"envValueMode,omitempty"` + EventsLogDirectory *string `json:"eventsLogDirectory,omitempty"` + EventsLogIncludesSubagents *bool `json:"eventsLogIncludesSubagents,omitempty"` + ExcludedBuiltinAgents []string `json:"excludedBuiltinAgents,omitzero"` + ExcludedTools []string `json:"excludedTools,omitzero"` + ExpAssignments any `json:"expAssignments,omitempty"` + FeatureFlags map[string]bool `json:"featureFlags,omitzero"` + HasSkillProvider *bool `json:"hasSkillProvider,omitempty"` + IncludedBuiltinAgents []string `json:"includedBuiltinAgents,omitzero"` + IncludedBuiltinSkills []string `json:"includedBuiltinSkills,omitzero"` + InstalledPlugins []InstalledPlugin `json:"installedPlugins,omitzero"` + IntegrationID *string `json:"integrationId,omitempty"` + IsExperimentalMode *bool `json:"isExperimentalMode,omitempty"` + LogInteractiveShells *bool `json:"logInteractiveShells,omitempty"` + LspClientName *string `json:"lspClientName,omitempty"` + ManagedSettings *SessionManagedSettings `json:"managedSettings,omitempty"` + MaxInlineBinaryBytes *int64 `json:"maxInlineBinaryBytes,omitempty"` + Memory *MemoryConfiguration `json:"memory,omitempty"` + Model *string `json:"model,omitempty"` + ModelCapabilitiesOverrides *ModelCapabilitiesOverride `json:"modelCapabilitiesOverrides,omitempty"` + Models []ProviderModelConfig `json:"models,omitzero"` + Name *string `json:"name,omitempty"` + Provider *ProviderConfig `json:"provider,omitempty"` + Providers []NamedProviderConfig `json:"providers,omitzero"` + ReasoningEffort *string `json:"reasoningEffort,omitempty"` + ReasoningSummary *SessionOpenOptionsReasoningSummary `json:"reasoningSummary,omitempty"` + RefreshCustomInstructions *bool `json:"refreshCustomInstructions,omitempty"` + RemoteDefaultedOn *bool `json:"remoteDefaultedOn,omitempty"` + RemoteExporting *bool `json:"remoteExporting,omitempty"` + RemoteSteerable *bool `json:"remoteSteerable,omitempty"` + RunningInInteractiveMode *bool `json:"runningInInteractiveMode,omitempty"` + SandboxConfig *SandboxConfig `json:"sandboxConfig,omitempty"` + SandboxConfigSource *SandboxConfigSource `json:"sandboxConfigSource,omitempty"` + SessionCapabilities []SessionCapability `json:"sessionCapabilities,omitzero"` + SessionID *string `json:"sessionId,omitempty"` + SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"` + Shell *ShellOptions `json:"shell,omitempty"` + ShellInitProfile *string `json:"shellInitProfile,omitempty"` + ShellProcessFlags []string `json:"shellProcessFlags,omitzero"` + SkillDirectories []string `json:"skillDirectories,omitzero"` + SkipCustomInstructions *bool `json:"skipCustomInstructions,omitempty"` + TrajectoryFile *string `json:"trajectoryFile,omitempty"` + Verbosity *Verbosity `json:"verbosity,omitempty"` + WorkingDirectory *string `json:"workingDirectory,omitempty"` + WorkingDirectoryContext *SessionContext `json:"workingDirectoryContext,omitempty"` } var raw rawSessionOpenOptions if err := json.Unmarshal(data, &raw); err != nil { @@ -5594,6 +5622,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { r.Providers = raw.Providers r.ReasoningEffort = raw.ReasoningEffort r.ReasoningSummary = raw.ReasoningSummary + r.RefreshCustomInstructions = raw.RefreshCustomInstructions r.RemoteDefaultedOn = raw.RemoteDefaultedOn r.RemoteExporting = raw.RemoteExporting r.RemoteSteerable = raw.RemoteSteerable @@ -5692,7 +5721,7 @@ func (r SessionsOpenAttach) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5703,7 +5732,7 @@ func (r SessionsOpenCloud) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5714,7 +5743,7 @@ func (r SessionsOpenCreate) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5725,7 +5754,7 @@ func (r SessionsOpenHandoff) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5736,7 +5765,7 @@ func (r SessionsOpenRemote) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5747,7 +5776,7 @@ func (r SessionsOpenResume) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5758,7 +5787,7 @@ func (r SessionsOpenResumeLast) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5829,7 +5858,7 @@ func (r SessionsClientMetadataEntryCorrupt) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -5840,7 +5869,7 @@ func (r SessionsClientMetadataEntryNotFound) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -5851,7 +5880,7 @@ func (r SessionsClientMetadataEntryOk) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -5862,7 +5891,7 @@ func (r SessionsClientMetadataEntryUnavailable) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -5873,7 +5902,7 @@ func (r SessionsClientMetadataEntryUnsupportedVersion) MarshalJSON() ([]byte, er alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -5954,7 +5983,7 @@ func (r SettableTokenAuthInfo) MarshalJSON() ([]byte, error) { Type SettableAuthInfoType `json:"type"` alias }{ - Type: r.settableAuthInfoType(), + Type: r.settableAuthInfoType(), alias: alias(r), }) } @@ -6060,7 +6089,7 @@ func (r SlashCommandAddTimelineEntryResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6071,7 +6100,7 @@ func (r SlashCommandAgentPromptResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6082,7 +6111,7 @@ func (r SlashCommandCompletedResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6093,7 +6122,7 @@ func (r SlashCommandSelectSubcommandResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6104,7 +6133,7 @@ func (r SlashCommandSetModelResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6115,7 +6144,7 @@ func (r SlashCommandSetPlanModelResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6126,7 +6155,7 @@ func (r SlashCommandShowDialogResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6137,7 +6166,7 @@ func (r SlashCommandTextResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6201,7 +6230,7 @@ func (r TaskClientUpdateCancelled) MarshalJSON() ([]byte, error) { Kind TaskClientUpdateKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6212,7 +6241,7 @@ func (r TaskClientUpdateCompleted) MarshalJSON() ([]byte, error) { Kind TaskClientUpdateKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6223,7 +6252,7 @@ func (r TaskClientUpdateFailed) MarshalJSON() ([]byte, error) { Kind TaskClientUpdateKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6234,7 +6263,7 @@ func (r TaskClientUpdateProgress) MarshalJSON() ([]byte, error) { Kind TaskClientUpdateKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6292,7 +6321,7 @@ func (r TaskAgentInfo) MarshalJSON() ([]byte, error) { Type TaskInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6303,7 +6332,7 @@ func (r TaskClientInfo) MarshalJSON() ([]byte, error) { Type TaskInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6314,7 +6343,7 @@ func (r TaskShellInfo) MarshalJSON() ([]byte, error) { Type TaskInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6393,7 +6422,7 @@ func (r TaskAgentProgress) MarshalJSON() ([]byte, error) { Type TaskProgressType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6404,7 +6433,7 @@ func (r TaskClientProgress) MarshalJSON() ([]byte, error) { Type TaskProgressType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6415,7 +6444,7 @@ func (r TaskShellProgress) MarshalJSON() ([]byte, error) { Type TaskProgressType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6476,9 +6505,9 @@ func (r *TasksPromoteCurrentToBackgroundResult) UnmarshalJSON(data []byte) error func (r *TasksUpdateRequest) UnmarshalJSON(data []byte) error { type rawTasksUpdateRequest struct { - ID string `json:"id"` - Sequence int64 `json:"sequence"` - Update json.RawMessage `json:"update"` + ID string `json:"id"` + Sequence int64 `json:"sequence"` + Update json.RawMessage `json:"update"` } var raw rawTasksUpdateRequest if err := json.Unmarshal(data, &raw); err != nil { @@ -6498,23 +6527,23 @@ func (r *TasksUpdateRequest) UnmarshalJSON(data []byte) error { func (r *ToolResultExpanded) UnmarshalJSON(data []byte) error { type rawToolResultExpanded struct { - BinaryResultsForLlm []ExternalToolTextResultForLlmBinaryResultsForLlm `json:"binaryResultsForLlm,omitzero"` - CitableSources []any `json:"citableSources,omitzero"` - Contents []json.RawMessage `json:"contents,omitzero"` - Error *string `json:"error,omitempty"` - MCPMeta map[string]any `json:"mcpMeta,omitzero"` - NewMessages []ToolResultNewMessage `json:"newMessages,omitzero"` - PostToolUseFailureHooksProcessed *bool `json:"postToolUseFailureHooksProcessed,omitempty"` - ResultType ToolResultType `json:"resultType"` - SessionLog *string `json:"sessionLog,omitempty"` - SkillInvocation any `json:"skillInvocation,omitempty"` - SkipLargeOutputProcessing *bool `json:"skipLargeOutputProcessing,omitempty"` - StructuredContent any `json:"structuredContent,omitempty"` - TaskCompletionDecision *TaskCompletionDecision `json:"taskCompletionDecision,omitempty"` - TextResultForLlm string `json:"textResultForLlm"` - ToolReferences []string `json:"toolReferences,omitzero"` - ToolTelemetry any `json:"toolTelemetry,omitempty"` - UIResource any `json:"uiResource,omitempty"` + BinaryResultsForLlm []ExternalToolTextResultForLlmBinaryResultsForLlm `json:"binaryResultsForLlm,omitzero"` + CitableSources []any `json:"citableSources,omitzero"` + Contents []json.RawMessage `json:"contents,omitzero"` + Error *string `json:"error,omitempty"` + MCPMeta map[string]any `json:"mcpMeta,omitzero"` + NewMessages []ToolResultNewMessage `json:"newMessages,omitzero"` + PostToolUseFailureHooksProcessed *bool `json:"postToolUseFailureHooksProcessed,omitempty"` + ResultType ToolResultType `json:"resultType"` + SessionLog *string `json:"sessionLog,omitempty"` + SkillInvocation any `json:"skillInvocation,omitempty"` + SkipLargeOutputProcessing *bool `json:"skipLargeOutputProcessing,omitempty"` + StructuredContent any `json:"structuredContent,omitempty"` + TaskCompletionDecision *TaskCompletionDecision `json:"taskCompletionDecision,omitempty"` + TextResultForLlm string `json:"textResultForLlm"` + ToolReferences []string `json:"toolReferences,omitzero"` + ToolTelemetry any `json:"toolTelemetry,omitempty"` + UIResource any `json:"uiResource,omitempty"` } var raw rawToolResultExpanded if err := json.Unmarshal(data, &raw); err != nil { @@ -6611,8 +6640,8 @@ func matchesUIElicitationSchemaPropertyUIElicitationArrayAnyOfField(data []byte) } var rawGroup0Items struct { AnyOf json.RawMessage `json:"anyOf"` - Enum json.RawMessage `json:"enum"` - Type json.RawMessage `json:"type"` + Enum json.RawMessage `json:"enum"` + Type json.RawMessage `json:"type"` } if err := json.Unmarshal(rawGroup0.Items, &rawGroup0Items); err != nil { return false @@ -6638,8 +6667,8 @@ func matchesUIElicitationSchemaPropertyUIElicitationArrayEnumField(data []byte) } var rawGroup0Items struct { AnyOf json.RawMessage `json:"anyOf"` - Enum json.RawMessage `json:"enum"` - Type json.RawMessage `json:"type"` + Enum json.RawMessage `json:"enum"` + Type json.RawMessage `json:"type"` } if err := json.Unmarshal(rawGroup0.Items, &rawGroup0Items); err != nil { return false @@ -6664,7 +6693,7 @@ func matchesUIElicitationSchemaPropertyUIElicitationArrayEnumField(data []byte) func matchesUIElicitationSchemaPropertyString(data []byte) bool { var rawGroup0 struct { - Enum json.RawMessage `json:"enum"` + Enum json.RawMessage `json:"enum"` OneOf json.RawMessage `json:"oneOf"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { @@ -6678,7 +6707,7 @@ func matchesUIElicitationSchemaPropertyString(data []byte) bool { func matchesUIElicitationSchemaPropertyUIElicitationStringEnumField(data []byte) bool { var rawGroup0 struct { - Enum json.RawMessage `json:"enum"` + Enum json.RawMessage `json:"enum"` OneOf json.RawMessage `json:"oneOf"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { @@ -6692,7 +6721,7 @@ func matchesUIElicitationSchemaPropertyUIElicitationStringEnumField(data []byte) func matchesUIElicitationSchemaPropertyUIElicitationStringOneOfField(data []byte) bool { var rawGroup0 struct { - Enum json.RawMessage `json:"enum"` + Enum json.RawMessage `json:"enum"` OneOf json.RawMessage `json:"oneOf"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { @@ -6796,7 +6825,7 @@ func (r UIElicitationArrayAnyOfField) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6807,7 +6836,7 @@ func (r UIElicitationArrayEnumField) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6818,7 +6847,7 @@ func (r UIElicitationSchemaPropertyBoolean) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6829,7 +6858,7 @@ func (r UIElicitationSchemaPropertyNumber) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6840,7 +6869,7 @@ func (r UIElicitationSchemaPropertyString) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6851,7 +6880,7 @@ func (r UIElicitationStringEnumField) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6862,7 +6891,7 @@ func (r UIElicitationStringOneOfField) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6870,8 +6899,8 @@ func (r UIElicitationStringOneOfField) MarshalJSON() ([]byte, error) { func (r *UIElicitationSchema) UnmarshalJSON(data []byte) error { type rawUIElicitationSchema struct { Properties map[string]json.RawMessage `json:"properties"` - Required []string `json:"required,omitzero"` - Type UIElicitationSchemaType `json:"type"` + Required []string `json:"required,omitzero"` + Type UIElicitationSchemaType `json:"type"` } var raw rawUIElicitationSchema if err := json.Unmarshal(data, &raw); err != nil { @@ -6894,9 +6923,9 @@ func (r *UIElicitationSchema) UnmarshalJSON(data []byte) error { func (r *UIElicitationResponse) UnmarshalJSON(data []byte) error { type rawUIElicitationResponse struct { - Action UIElicitationResponseAction `json:"action"` - Content map[string]json.RawMessage `json:"content,omitzero"` - Meta map[string]any `json:"_meta,omitzero"` + Action UIElicitationResponseAction `json:"action"` + Content map[string]json.RawMessage `json:"content,omitzero"` + Meta map[string]any `json:"_meta,omitzero"` } var raw rawUIElicitationResponse if err := json.Unmarshal(data, &raw); err != nil { @@ -6915,4 +6944,4 @@ func (r *UIElicitationResponse) UnmarshalJSON(data []byte) error { } r.Meta = raw.Meta return nil -} +} \ No newline at end of file diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index db4db7f740..57f655796e 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -16,13 +16,13 @@ func (r *SessionEvent) Marshal() ([]byte, error) { func (e *SessionEvent) UnmarshalJSON(data []byte) error { type rawEvent struct { - AgentID *string `json:"agentId,omitempty"` - Data json.RawMessage `json:"data"` - Ephemeral *bool `json:"ephemeral,omitempty"` - ID string `json:"id"` - ParentID *string `json:"parentId"` - Timestamp time.Time `json:"timestamp"` - Type SessionEventType `json:"type"` + AgentID *string `json:"agentId,omitempty"` + Data json.RawMessage `json:"data"` + Ephemeral *bool `json:"ephemeral,omitempty"` + ID string `json:"id"` + ParentID *string `json:"parentId"` + Timestamp time.Time `json:"timestamp"` + Type SessionEventType `json:"type"` } var raw rawEvent if err := json.Unmarshal(data, &raw); err != nil { @@ -341,12 +341,36 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypePermissionCarriedForward: + var d PermissionCarriedForwardData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypePermissionCompleted: var d PermissionCompletedData if err := json.Unmarshal(raw.Data, &d); err != nil { return err } e.Data = &d + case SessionEventTypePermissionMessageAuthorization: + var d PermissionMessageAuthorizationData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypePermissionMessageAuthorizationDegraded: + var d PermissionMessageAuthorizationDegradedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypePermissionMessageAuthorizationRead: + var d PermissionMessageAuthorizationReadData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypePermissionRequested: var d PermissionRequestedData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -865,20 +889,20 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { func (e SessionEvent) MarshalJSON() ([]byte, error) { type rawEvent struct { - AgentID *string `json:"agentId,omitempty"` - Data any `json:"data"` - Ephemeral *bool `json:"ephemeral,omitempty"` - ID string `json:"id"` - ParentID *string `json:"parentId"` - Timestamp time.Time `json:"timestamp"` - Type SessionEventType `json:"type"` + AgentID *string `json:"agentId,omitempty"` + Data any `json:"data"` + Ephemeral *bool `json:"ephemeral,omitempty"` + ID string `json:"id"` + ParentID *string `json:"parentId"` + Timestamp time.Time `json:"timestamp"` + Type SessionEventType `json:"type"` } return json.Marshal(rawEvent{ - AgentID: e.AgentID, - Data: e.Data, + AgentID: e.AgentID, + Data: e.Data, Ephemeral: e.Ephemeral, - ID: e.ID, - ParentID: e.ParentID, + ID: e.ID, + ParentID: e.ParentID, Timestamp: e.Timestamp, Type: e.Type(), }) @@ -892,21 +916,22 @@ func (r RawSessionEventData) MarshalJSON() ([]byte, error) { return r.Raw, nil } + func (r *UserMessageData) UnmarshalJSON(data []byte) error { type rawUserMessageData struct { - AgentMode *UserMessageAgentMode `json:"agentMode,omitempty"` - Attachments []json.RawMessage `json:"attachments,omitzero"` - Content string `json:"content"` - 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"` - SupportedNativeDocumentMIMETypes []string `json:"supportedNativeDocumentMimeTypes,omitzero"` - TransformedContent *string `json:"transformedContent,omitempty"` - TurnID *string `json:"turnId,omitempty"` + AgentMode *UserMessageAgentMode `json:"agentMode,omitempty"` + Attachments []json.RawMessage `json:"attachments,omitzero"` + Content string `json:"content"` + 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"` + SupportedNativeDocumentMIMETypes []string `json:"supportedNativeDocumentMimeTypes,omitzero"` + TransformedContent *string `json:"transformedContent,omitempty"` + TurnID *string `json:"turnId,omitempty"` } var raw rawUserMessageData if err := json.Unmarshal(data, &raw); err != nil { @@ -990,7 +1015,7 @@ func (r CitationLocationBlock) MarshalJSON() ([]byte, error) { Type CitationLocationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1001,7 +1026,7 @@ func (r CitationLocationChar) MarshalJSON() ([]byte, error) { Type CitationLocationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1012,17 +1037,17 @@ func (r CitationLocationPage) MarshalJSON() ([]byte, error) { Type CitationLocationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } func (r *CitationReference) UnmarshalJSON(data []byte) error { type rawCitationReference struct { - CitedText *string `json:"citedText,omitempty"` - Location json.RawMessage `json:"location,omitempty"` - ProviderMetadata any `json:"providerMetadata,omitempty"` - SourceID string `json:"sourceId"` + CitedText *string `json:"citedText,omitempty"` + Location json.RawMessage `json:"location,omitempty"` + ProviderMetadata any `json:"providerMetadata,omitempty"` + SourceID string `json:"sourceId"` } var raw rawCitationReference if err := json.Unmarshal(data, &raw); err != nil { @@ -1043,9 +1068,9 @@ func (r *CitationReference) UnmarshalJSON(data []byte) error { func matchesPersistedBinaryResultBinaryAssetReference(data []byte) bool { var rawGroup0 struct { - AssetID json.RawMessage `json:"assetId"` - ByteLength json.RawMessage `json:"byteLength"` - Data json.RawMessage `json:"data"` + AssetID json.RawMessage `json:"assetId"` + ByteLength json.RawMessage `json:"byteLength"` + Data json.RawMessage `json:"data"` OmittedReason json.RawMessage `json:"omittedReason"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { @@ -1065,9 +1090,9 @@ func matchesPersistedBinaryResultBinaryAssetReference(data []byte) bool { func matchesPersistedBinaryResultOmittedBinaryResult(data []byte) bool { var rawGroup0 struct { - AssetID json.RawMessage `json:"assetId"` - ByteLength json.RawMessage `json:"byteLength"` - Data json.RawMessage `json:"data"` + AssetID json.RawMessage `json:"assetId"` + ByteLength json.RawMessage `json:"byteLength"` + Data json.RawMessage `json:"data"` OmittedReason json.RawMessage `json:"omittedReason"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { @@ -1087,9 +1112,9 @@ func matchesPersistedBinaryResultOmittedBinaryResult(data []byte) bool { func matchesPersistedBinaryResultPersistedBinaryImage(data []byte) bool { var rawGroup0 struct { - AssetID json.RawMessage `json:"assetId"` - ByteLength json.RawMessage `json:"byteLength"` - Data json.RawMessage `json:"data"` + AssetID json.RawMessage `json:"assetId"` + ByteLength json.RawMessage `json:"byteLength"` + Data json.RawMessage `json:"data"` OmittedReason json.RawMessage `json:"omittedReason"` } if err := json.Unmarshal(data, &rawGroup0); err != nil { @@ -1188,7 +1213,7 @@ func (r BinaryAssetReference) MarshalJSON() ([]byte, error) { Type PersistedBinaryResultType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1199,7 +1224,7 @@ func (r OmittedBinaryResult) MarshalJSON() ([]byte, error) { Type PersistedBinaryResultType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1210,7 +1235,7 @@ func (r PersistedBinaryImage) MarshalJSON() ([]byte, error) { Type PersistedBinaryResultType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1292,7 +1317,7 @@ func (r ToolExecutionCompleteContentAudio) MarshalJSON() ([]byte, error) { Type ToolExecutionCompleteContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1303,7 +1328,7 @@ func (r ToolExecutionCompleteContentImage) MarshalJSON() ([]byte, error) { Type ToolExecutionCompleteContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1376,7 +1401,7 @@ func (r ToolExecutionCompleteContentResource) MarshalJSON() ([]byte, error) { Type ToolExecutionCompleteContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1387,7 +1412,7 @@ func (r ToolExecutionCompleteContentResourceLink) MarshalJSON() ([]byte, error) Type ToolExecutionCompleteContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1398,7 +1423,7 @@ func (r ToolExecutionCompleteContentShellExit) MarshalJSON() ([]byte, error) { Type ToolExecutionCompleteContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1409,7 +1434,7 @@ func (r ToolExecutionCompleteContentTerminal) MarshalJSON() ([]byte, error) { Type ToolExecutionCompleteContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1420,21 +1445,21 @@ func (r ToolExecutionCompleteContentText) MarshalJSON() ([]byte, error) { Type ToolExecutionCompleteContentType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } func (r *ToolExecutionCompleteResult) UnmarshalJSON(data []byte) error { type rawToolExecutionCompleteResult struct { - BinaryResultsForLlm []json.RawMessage `json:"binaryResultsForLlm,omitzero"` - CitableSources []CitableSource `json:"citableSources,omitzero"` - Content string `json:"content"` - Contents []json.RawMessage `json:"contents,omitzero"` - DetailedContent *string `json:"detailedContent,omitempty"` - MCPMeta any `json:"mcpMeta,omitempty"` - StructuredContent any `json:"structuredContent,omitempty"` - UIResource *ToolExecutionCompleteUIResource `json:"uiResource,omitempty"` + BinaryResultsForLlm []json.RawMessage `json:"binaryResultsForLlm,omitzero"` + CitableSources []CitableSource `json:"citableSources,omitzero"` + Content string `json:"content"` + Contents []json.RawMessage `json:"contents,omitzero"` + DetailedContent *string `json:"detailedContent,omitempty"` + MCPMeta any `json:"mcpMeta,omitempty"` + StructuredContent any `json:"structuredContent,omitempty"` + UIResource *ToolExecutionCompleteUIResource `json:"uiResource,omitempty"` } var raw rawToolExecutionCompleteResult if err := json.Unmarshal(data, &raw); err != nil { @@ -1552,7 +1577,7 @@ func (r SystemNotificationAgentCompleted) MarshalJSON() ([]byte, error) { Type SystemNotificationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1563,7 +1588,7 @@ func (r SystemNotificationAgentIdle) MarshalJSON() ([]byte, error) { Type SystemNotificationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1615,7 +1640,7 @@ func (r SystemNotificationFactoryPauseInfoCheckpoint) MarshalJSON() ([]byte, err Type SystemNotificationFactoryPauseInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1626,24 +1651,24 @@ func (r SystemNotificationFactoryPauseInfoUser) MarshalJSON() ([]byte, error) { Type SystemNotificationFactoryPauseInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } func (r *SystemNotificationFactoryCompleted) UnmarshalJSON(data []byte) error { type rawSystemNotificationFactoryCompleted struct { - Attempt int64 `json:"attempt"` - ConsumedNanoAiu int64 `json:"consumedNanoAiu"` - ConsumedSubagents int64 `json:"consumedSubagents"` - ElapsedMs int64 `json:"elapsedMs"` - FactoryName string `json:"factoryName"` - Failure any `json:"failure,omitempty"` - PauseInfo json.RawMessage `json:"pauseInfo,omitempty"` - ResultPreview *string `json:"resultPreview,omitempty"` - RetryGuidance *string `json:"retryGuidance,omitempty"` - RunID string `json:"runId"` - Status SystemNotificationFactoryCompletedStatus `json:"status"` + Attempt int64 `json:"attempt"` + ConsumedNanoAiu int64 `json:"consumedNanoAiu"` + ConsumedSubagents int64 `json:"consumedSubagents"` + ElapsedMs int64 `json:"elapsedMs"` + FactoryName string `json:"factoryName"` + Failure any `json:"failure,omitempty"` + PauseInfo json.RawMessage `json:"pauseInfo,omitempty"` + ResultPreview *string `json:"resultPreview,omitempty"` + RetryGuidance *string `json:"retryGuidance,omitempty"` + RunID string `json:"runId"` + Status SystemNotificationFactoryCompletedStatus `json:"status"` } var raw rawSystemNotificationFactoryCompleted if err := json.Unmarshal(data, &raw); err != nil { @@ -1675,7 +1700,7 @@ func (r SystemNotificationFactoryCompleted) MarshalJSON() ([]byte, error) { Type SystemNotificationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1686,7 +1711,7 @@ func (r SystemNotificationInstructionDiscovered) MarshalJSON() ([]byte, error) { Type SystemNotificationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1697,7 +1722,7 @@ func (r SystemNotificationNewInboxMessage) MarshalJSON() ([]byte, error) { Type SystemNotificationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1708,7 +1733,7 @@ func (r SystemNotificationShellCompleted) MarshalJSON() ([]byte, error) { Type SystemNotificationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1719,7 +1744,7 @@ func (r SystemNotificationShellDetachedCompleted) MarshalJSON() ([]byte, error) Type SystemNotificationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -1730,15 +1755,15 @@ func (r SystemNotificationUnclassified) MarshalJSON() ([]byte, error) { Type SystemNotificationType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } func (r *SystemNotificationData) UnmarshalJSON(data []byte) error { type rawSystemNotificationData struct { - Content string `json:"content"` - Kind json.RawMessage `json:"kind"` + Content string `json:"content"` + Kind json.RawMessage `json:"kind"` } var raw rawSystemNotificationData if err := json.Unmarshal(data, &raw); err != nil { @@ -1862,7 +1887,7 @@ func (r PermissionRequestCustomTool) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1873,7 +1898,7 @@ func (r PermissionRequestExtensionEnvAccess) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1884,7 +1909,7 @@ func (r PermissionRequestExtensionManagement) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1895,7 +1920,7 @@ func (r PermissionRequestExtensionPermissionAccess) MarshalJSON() ([]byte, error Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1906,7 +1931,7 @@ func (r PermissionRequestFactory) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1917,7 +1942,7 @@ func (r PermissionRequestHook) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1928,7 +1953,7 @@ func (r PermissionRequestMCP) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1939,7 +1964,7 @@ func (r PermissionRequestMemory) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1950,7 +1975,7 @@ func (r PermissionRequestRead) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1961,7 +1986,7 @@ func (r PermissionRequestShell) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1972,7 +1997,7 @@ func (r PermissionRequestURL) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -1983,7 +2008,7 @@ func (r PermissionRequestWrite) MarshalJSON() ([]byte, error) { Kind PermissionRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2101,7 +2126,7 @@ func (r PermissionPromptRequestCommands) MarshalJSON() ([]byte, error) { Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2112,7 +2137,7 @@ func (r PermissionPromptRequestCustomTool) MarshalJSON() ([]byte, error) { Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2123,7 +2148,7 @@ func (r PermissionPromptRequestExtensionEnvAccess) MarshalJSON() ([]byte, error) Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2134,7 +2159,7 @@ func (r PermissionPromptRequestExtensionManagement) MarshalJSON() ([]byte, error Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2145,7 +2170,7 @@ func (r PermissionPromptRequestExtensionPermissionAccess) MarshalJSON() ([]byte, Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2156,7 +2181,7 @@ func (r PermissionPromptRequestFactory) MarshalJSON() ([]byte, error) { Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2167,7 +2192,7 @@ func (r PermissionPromptRequestHook) MarshalJSON() ([]byte, error) { Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2178,7 +2203,7 @@ func (r PermissionPromptRequestMCP) MarshalJSON() ([]byte, error) { Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2189,7 +2214,7 @@ func (r PermissionPromptRequestMemory) MarshalJSON() ([]byte, error) { Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2200,7 +2225,7 @@ func (r PermissionPromptRequestPath) MarshalJSON() ([]byte, error) { Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2211,7 +2236,7 @@ func (r PermissionPromptRequestRead) MarshalJSON() ([]byte, error) { Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2222,7 +2247,7 @@ func (r PermissionPromptRequestURL) MarshalJSON() ([]byte, error) { Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2233,19 +2258,19 @@ func (r PermissionPromptRequestWrite) MarshalJSON() ([]byte, error) { Kind PermissionPromptRequestKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *PermissionRequestedData) UnmarshalJSON(data []byte) error { type rawPermissionRequestedData struct { - AgentMode *SessionMode `json:"agentMode,omitempty"` + AgentMode *SessionMode `json:"agentMode,omitempty"` PermissionRequest json.RawMessage `json:"permissionRequest"` - PromptRequest json.RawMessage `json:"promptRequest,omitempty"` - RequestID string `json:"requestId"` - ResolvedByHook *bool `json:"resolvedByHook,omitempty"` - RiskAssessment any `json:"riskAssessment,omitempty"` + PromptRequest json.RawMessage `json:"promptRequest,omitempty"` + RequestID string `json:"requestId"` + ResolvedByHook *bool `json:"resolvedByHook,omitempty"` + RiskAssessment any `json:"riskAssessment,omitempty"` } var raw rawPermissionRequestedData if err := json.Unmarshal(data, &raw); err != nil { @@ -2361,16 +2386,16 @@ func (r PermissionApproved) MarshalJSON() ([]byte, error) { Kind PermissionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *PermissionApprovedForLocation) UnmarshalJSON(data []byte) error { type rawPermissionApprovedForLocation struct { - Approval json.RawMessage `json:"approval"` - LocationKey string `json:"locationKey"` - ManagedApprovalHandled *bool `json:"managedApprovalHandled,omitempty"` + Approval json.RawMessage `json:"approval"` + LocationKey string `json:"locationKey"` + ManagedApprovalHandled *bool `json:"managedApprovalHandled,omitempty"` } var raw rawPermissionApprovedForLocation if err := json.Unmarshal(data, &raw); err != nil { @@ -2394,15 +2419,15 @@ func (r PermissionApprovedForLocation) MarshalJSON() ([]byte, error) { Kind PermissionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *PermissionApprovedForSession) UnmarshalJSON(data []byte) error { type rawPermissionApprovedForSession struct { - Approval json.RawMessage `json:"approval"` - ManagedApprovalHandled *bool `json:"managedApprovalHandled,omitempty"` + Approval json.RawMessage `json:"approval"` + ManagedApprovalHandled *bool `json:"managedApprovalHandled,omitempty"` } var raw rawPermissionApprovedForSession if err := json.Unmarshal(data, &raw); err != nil { @@ -2425,7 +2450,7 @@ func (r PermissionApprovedForSession) MarshalJSON() ([]byte, error) { Kind PermissionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2436,7 +2461,7 @@ func (r PermissionCancelled) MarshalJSON() ([]byte, error) { Kind PermissionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2447,7 +2472,7 @@ func (r PermissionDeniedByContentExclusionPolicy) MarshalJSON() ([]byte, error) Kind PermissionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2458,7 +2483,7 @@ func (r PermissionDeniedByPermissionRequestHook) MarshalJSON() ([]byte, error) { Kind PermissionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2469,7 +2494,7 @@ func (r PermissionDeniedByRules) MarshalJSON() ([]byte, error) { Kind PermissionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2480,7 +2505,7 @@ func (r PermissionDeniedInteractivelyByUser) MarshalJSON() ([]byte, error) { Kind PermissionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -2491,21 +2516,23 @@ func (r PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser) MarshalJSON() Kind PermissionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } func (r *PermissionCompletedData) UnmarshalJSON(data []byte) error { type rawPermissionCompletedData struct { - RequestID string `json:"requestId"` - Result json.RawMessage `json:"result"` - ToolCallID *string `json:"toolCallId,omitempty"` + DecisionSource *PermissionDecisionSource `json:"decisionSource,omitempty"` + RequestID string `json:"requestId"` + Result json.RawMessage `json:"result"` + ToolCallID *string `json:"toolCallId,omitempty"` } var raw rawPermissionCompletedData if err := json.Unmarshal(data, &raw); err != nil { return err } + r.DecisionSource = raw.DecisionSource r.RequestID = raw.RequestID if raw.Result != nil { value, err := unmarshalPermissionResult(raw.Result) @@ -2537,4 +2564,4 @@ func (r *SessionExtensionsAttachmentsPushedData) UnmarshalJSON(data []byte) erro } } return nil -} +} \ No newline at end of file diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index a16d3e45bf..72a4c78b4a 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -48,12 +48,11 @@ func (RawSessionEventData) sessionEventData() {} func (r RawSessionEventData) Type() SessionEventType { return r.EventType } - // SessionEventType identifies the kind of session event. type SessionEventType string const ( - SessionEventTypeAbort SessionEventType = "abort" + SessionEventTypeAbort SessionEventType = "abort" SessionEventTypeAgentInterrupted SessionEventType = "agent.interrupted" // Experimental: SessionEventTypeAssistantFusionPhaseActivity identifies an experimental // event that may change or be removed. @@ -67,33 +66,33 @@ const ( // Experimental: SessionEventTypeAssistantFusionPhaseStarted identifies an experimental // event that may change or be removed. SessionEventTypeAssistantFusionPhaseStarted SessionEventType = "assistant.fusion_phase_started" - SessionEventTypeAssistantIdle SessionEventType = "assistant.idle" - SessionEventTypeAssistantIntent SessionEventType = "assistant.intent" - SessionEventTypeAssistantMessage SessionEventType = "assistant.message" - SessionEventTypeAssistantMessageDelta SessionEventType = "assistant.message_delta" - SessionEventTypeAssistantMessageStart SessionEventType = "assistant.message_start" - SessionEventTypeAssistantReasoning SessionEventType = "assistant.reasoning" - SessionEventTypeAssistantReasoningDelta SessionEventType = "assistant.reasoning_delta" + SessionEventTypeAssistantIdle SessionEventType = "assistant.idle" + SessionEventTypeAssistantIntent SessionEventType = "assistant.intent" + SessionEventTypeAssistantMessage SessionEventType = "assistant.message" + SessionEventTypeAssistantMessageDelta SessionEventType = "assistant.message_delta" + SessionEventTypeAssistantMessageStart SessionEventType = "assistant.message_start" + SessionEventTypeAssistantReasoning SessionEventType = "assistant.reasoning" + SessionEventTypeAssistantReasoningDelta SessionEventType = "assistant.reasoning_delta" SessionEventTypeAssistantServerToolProgress SessionEventType = "assistant.server_tool_progress" - SessionEventTypeAssistantStreamingDelta SessionEventType = "assistant.streaming_delta" - SessionEventTypeAssistantToolCallDelta SessionEventType = "assistant.tool_call_delta" - SessionEventTypeAssistantTurnEnd SessionEventType = "assistant.turn_end" - SessionEventTypeAssistantTurnRetry SessionEventType = "assistant.turn_retry" - SessionEventTypeAssistantTurnStart SessionEventType = "assistant.turn_start" - SessionEventTypeAssistantUsage SessionEventType = "assistant.usage" - SessionEventTypeAutoModeSwitchCompleted SessionEventType = "auto_mode_switch.completed" - SessionEventTypeAutoModeSwitchRequested SessionEventType = "auto_mode_switch.requested" - SessionEventTypeCapabilitiesChanged SessionEventType = "capabilities.changed" - SessionEventTypeCommandCompleted SessionEventType = "command.completed" - SessionEventTypeCommandExecute SessionEventType = "command.execute" - SessionEventTypeCommandQueued SessionEventType = "command.queued" - SessionEventTypeCommandsChanged SessionEventType = "commands.changed" - SessionEventTypeElicitationCompleted SessionEventType = "elicitation.completed" - SessionEventTypeElicitationRequested SessionEventType = "elicitation.requested" - SessionEventTypeExitPlanModeCompleted SessionEventType = "exit_plan_mode.completed" - SessionEventTypeExitPlanModeRequested SessionEventType = "exit_plan_mode.requested" - SessionEventTypeExternalToolCompleted SessionEventType = "external_tool.completed" - SessionEventTypeExternalToolRequested SessionEventType = "external_tool.requested" + SessionEventTypeAssistantStreamingDelta SessionEventType = "assistant.streaming_delta" + SessionEventTypeAssistantToolCallDelta SessionEventType = "assistant.tool_call_delta" + SessionEventTypeAssistantTurnEnd SessionEventType = "assistant.turn_end" + SessionEventTypeAssistantTurnRetry SessionEventType = "assistant.turn_retry" + SessionEventTypeAssistantTurnStart SessionEventType = "assistant.turn_start" + SessionEventTypeAssistantUsage SessionEventType = "assistant.usage" + SessionEventTypeAutoModeSwitchCompleted SessionEventType = "auto_mode_switch.completed" + SessionEventTypeAutoModeSwitchRequested SessionEventType = "auto_mode_switch.requested" + SessionEventTypeCapabilitiesChanged SessionEventType = "capabilities.changed" + SessionEventTypeCommandCompleted SessionEventType = "command.completed" + SessionEventTypeCommandExecute SessionEventType = "command.execute" + SessionEventTypeCommandQueued SessionEventType = "command.queued" + SessionEventTypeCommandsChanged SessionEventType = "commands.changed" + SessionEventTypeElicitationCompleted SessionEventType = "elicitation.completed" + SessionEventTypeElicitationRequested SessionEventType = "elicitation.requested" + SessionEventTypeExitPlanModeCompleted SessionEventType = "exit_plan_mode.completed" + SessionEventTypeExitPlanModeRequested SessionEventType = "exit_plan_mode.requested" + SessionEventTypeExternalToolCompleted SessionEventType = "external_tool.completed" + SessionEventTypeExternalToolRequested SessionEventType = "external_tool.requested" // Experimental: SessionEventTypeFactoryRunSettled identifies an experimental event that may // change or be removed. SessionEventTypeFactoryRunSettled SessionEventType = "factory.run_settled" @@ -102,36 +101,48 @@ const ( SessionEventTypeFactoryRunStarted SessionEventType = "factory.run_started" // Experimental: SessionEventTypeFactoryRunUpdated identifies an experimental event that may // change or be removed. - SessionEventTypeFactoryRunUpdated SessionEventType = "factory.run_updated" - SessionEventTypeHookEnd SessionEventType = "hook.end" - SessionEventTypeHookProgress SessionEventType = "hook.progress" - SessionEventTypeHookStart SessionEventType = "hook.start" - SessionEventTypeMCPAppToolCallComplete SessionEventType = "mcp_app.tool_call_complete" + SessionEventTypeFactoryRunUpdated SessionEventType = "factory.run_updated" + SessionEventTypeHookEnd SessionEventType = "hook.end" + SessionEventTypeHookProgress SessionEventType = "hook.progress" + SessionEventTypeHookStart SessionEventType = "hook.start" + SessionEventTypeMCPAppToolCallComplete SessionEventType = "mcp_app.tool_call_complete" SessionEventTypeMCPHeadersRefreshCompleted SessionEventType = "mcp.headers_refresh_completed" - SessionEventTypeMCPHeadersRefreshRequired SessionEventType = "mcp.headers_refresh_required" - SessionEventTypeMCPOauthCompleted SessionEventType = "mcp.oauth_completed" - SessionEventTypeMCPOauthRequired SessionEventType = "mcp.oauth_required" - SessionEventTypeMCPPromptsListChanged SessionEventType = "mcp.prompts.list_changed" - SessionEventTypeMCPResourcesListChanged SessionEventType = "mcp.resources.list_changed" - SessionEventTypeMCPToolsListChanged SessionEventType = "mcp.tools.list_changed" - SessionEventTypeModelCallFailure SessionEventType = "model.call_failure" - SessionEventTypeModelCallFinished SessionEventType = "model.call_finished" - SessionEventTypeModelCallStart SessionEventType = "model.call_start" - SessionEventTypePendingMessagesModified SessionEventType = "pending_messages.modified" - SessionEventTypePermissionCompleted SessionEventType = "permission.completed" - SessionEventTypePermissionRequested SessionEventType = "permission.requested" - SessionEventTypePromptCacheBreak SessionEventType = "prompt_cache_break" - SessionEventTypeSamplingCompleted SessionEventType = "sampling.completed" - SessionEventTypeSamplingRequested SessionEventType = "sampling.requested" - SessionEventTypeSandboxDecision SessionEventType = "sandbox.decision" + SessionEventTypeMCPHeadersRefreshRequired SessionEventType = "mcp.headers_refresh_required" + SessionEventTypeMCPOauthCompleted SessionEventType = "mcp.oauth_completed" + SessionEventTypeMCPOauthRequired SessionEventType = "mcp.oauth_required" + SessionEventTypeMCPPromptsListChanged SessionEventType = "mcp.prompts.list_changed" + SessionEventTypeMCPResourcesListChanged SessionEventType = "mcp.resources.list_changed" + SessionEventTypeMCPToolsListChanged SessionEventType = "mcp.tools.list_changed" + SessionEventTypeModelCallFailure SessionEventType = "model.call_failure" + SessionEventTypeModelCallFinished SessionEventType = "model.call_finished" + SessionEventTypeModelCallStart SessionEventType = "model.call_start" + SessionEventTypePendingMessagesModified SessionEventType = "pending_messages.modified" + // Experimental: SessionEventTypePermissionCarriedForward identifies an experimental event + // that may change or be removed. + SessionEventTypePermissionCarriedForward SessionEventType = "permission.carriedForward" + SessionEventTypePermissionCompleted SessionEventType = "permission.completed" + // Experimental: SessionEventTypePermissionMessageAuthorization identifies an experimental + // event that may change or be removed. + SessionEventTypePermissionMessageAuthorization SessionEventType = "permission.messageAuthorization" + // Experimental: SessionEventTypePermissionMessageAuthorizationDegraded identifies an + // experimental event that may change or be removed. + SessionEventTypePermissionMessageAuthorizationDegraded SessionEventType = "permission.messageAuthorizationDegraded" + // Experimental: SessionEventTypePermissionMessageAuthorizationRead identifies an + // experimental event that may change or be removed. + SessionEventTypePermissionMessageAuthorizationRead SessionEventType = "permission.messageAuthorizationRead" + SessionEventTypePermissionRequested SessionEventType = "permission.requested" + SessionEventTypePromptCacheBreak SessionEventType = "prompt_cache_break" + SessionEventTypeSamplingCompleted SessionEventType = "sampling.completed" + SessionEventTypeSamplingRequested SessionEventType = "sampling.requested" + SessionEventTypeSandboxDecision SessionEventType = "sandbox.decision" // Experimental: SessionEventTypeSessionAutoModeResolved identifies an experimental event // that may change or be removed. - SessionEventTypeSessionAutoModeResolved SessionEventType = "session.auto_mode_resolved" + SessionEventTypeSessionAutoModeResolved SessionEventType = "session.auto_mode_resolved" SessionEventTypeSessionAutopilotObjectiveChanged SessionEventType = "session.autopilot_objective_changed" // Experimental: SessionEventTypeSessionAutoTierRecommendation identifies an experimental // event that may change or be removed. SessionEventTypeSessionAutoTierRecommendation SessionEventType = "session.auto_tier_recommendation" - SessionEventTypeSessionAutoTierSwitchFailed SessionEventType = "session.auto_tier_switch_failed" + SessionEventTypeSessionAutoTierSwitchFailed SessionEventType = "session.auto_tier_switch_failed" SessionEventTypeSessionBackgroundTasksChanged SessionEventType = "session.background_tasks_changed" // Experimental: SessionEventTypeSessionBinaryAsset identifies an experimental event that // may change or be removed. @@ -153,19 +164,19 @@ const ( SessionEventTypeSessionCanvasRemoved SessionEventType = "session.canvas.removed" // Experimental: SessionEventTypeSessionCanvasUnavailable identifies an experimental event // that may change or be removed. - SessionEventTypeSessionCanvasUnavailable SessionEventType = "session.canvas.unavailable" + SessionEventTypeSessionCanvasUnavailable SessionEventType = "session.canvas.unavailable" SessionEventTypeSessionCompactionComplete SessionEventType = "session.compaction_complete" - SessionEventTypeSessionCompactionStart SessionEventType = "session.compaction_start" + 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" - SessionEventTypeSessionCustomNotification SessionEventType = "session.custom_notification" - SessionEventTypeSessionError SessionEventType = "session.error" + SessionEventTypeSessionCompletionReceipt SessionEventType = "session.completion_receipt" + SessionEventTypeSessionContextChanged SessionEventType = "session.context_changed" + SessionEventTypeSessionContextCleared SessionEventType = "session.context_cleared" + SessionEventTypeSessionCustomAgentsUpdated SessionEventType = "session.custom_agents_updated" + SessionEventTypeSessionCustomNotification SessionEventType = "session.custom_notification" + SessionEventTypeSessionError SessionEventType = "session.error" SessionEventTypeSessionExtensionsAttachmentsPushed SessionEventType = "session.extensions.attachments_pushed" - SessionEventTypeSessionExtensionsLoaded SessionEventType = "session.extensions_loaded" + SessionEventTypeSessionExtensionsLoaded SessionEventType = "session.extensions_loaded" // Experimental: SessionEventTypeSessionFusionCompleted identifies an experimental event // that may change or be removed. SessionEventTypeSessionFusionCompleted SessionEventType = "session.fusion_completed" @@ -177,10 +188,10 @@ const ( SessionEventTypeSessionFusionRouteFailed SessionEventType = "session.fusion_route_failed" // Experimental: SessionEventTypeSessionFusionRouteStarted identifies an experimental event // that may change or be removed. - SessionEventTypeSessionFusionRouteStarted SessionEventType = "session.fusion_route_started" - SessionEventTypeSessionHandoff SessionEventType = "session.handoff" - SessionEventTypeSessionIdle SessionEventType = "session.idle" - SessionEventTypeSessionInfo SessionEventType = "session.info" + SessionEventTypeSessionFusionRouteStarted SessionEventType = "session.fusion_route_started" + SessionEventTypeSessionHandoff SessionEventType = "session.handoff" + SessionEventTypeSessionIdle SessionEventType = "session.idle" + SessionEventTypeSessionInfo SessionEventType = "session.info" SessionEventTypeSessionLimitsExhaustedCompleted SessionEventType = "session_limits_exhausted.completed" SessionEventTypeSessionLimitsExhaustedRequested SessionEventType = "session_limits_exhausted.requested" // Experimental: SessionEventTypeSessionManagedSettingsEnforced identifies an experimental @@ -190,56 +201,56 @@ const ( // event that may change or be removed. SessionEventTypeSessionManagedSettingsResolved SessionEventType = "session.managed_settings_resolved" SessionEventTypeSessionMCPServerNeedsReconnect SessionEventType = "session.mcp_server_needs_reconnect" - SessionEventTypeSessionMCPServerRemoved SessionEventType = "session.mcp_server_removed" - SessionEventTypeSessionMCPServersLoaded SessionEventType = "session.mcp_servers_loaded" - SessionEventTypeSessionMCPServerStatusChanged SessionEventType = "session.mcp_server_status_changed" - SessionEventTypeSessionModeChanged SessionEventType = "session.mode_changed" - SessionEventTypeSessionModelChange SessionEventType = "session.model_change" - SessionEventTypeSessionModeNoticeDelivered SessionEventType = "session.mode_notice_delivered" + SessionEventTypeSessionMCPServerRemoved SessionEventType = "session.mcp_server_removed" + SessionEventTypeSessionMCPServersLoaded SessionEventType = "session.mcp_servers_loaded" + SessionEventTypeSessionMCPServerStatusChanged SessionEventType = "session.mcp_server_status_changed" + SessionEventTypeSessionModeChanged SessionEventType = "session.mode_changed" + SessionEventTypeSessionModelChange SessionEventType = "session.model_change" + SessionEventTypeSessionModeNoticeDelivered SessionEventType = "session.mode_notice_delivered" // Experimental: SessionEventTypeSessionPermissionsChanged identifies an experimental event // that may change or be removed. - SessionEventTypeSessionPermissionsChanged SessionEventType = "session.permissions_changed" - SessionEventTypeSessionPlanChanged SessionEventType = "session.plan_changed" + SessionEventTypeSessionPermissionsChanged SessionEventType = "session.permissions_changed" + SessionEventTypeSessionPlanChanged SessionEventType = "session.plan_changed" SessionEventTypeSessionRemoteSteerableChanged SessionEventType = "session.remote_steerable_changed" - SessionEventTypeSessionResume SessionEventType = "session.resume" - SessionEventTypeSessionScheduleCancelled SessionEventType = "session.schedule_cancelled" - SessionEventTypeSessionScheduleCreated SessionEventType = "session.schedule_created" - SessionEventTypeSessionScheduleRearmed SessionEventType = "session.schedule_rearmed" - SessionEventTypeSessionSessionLimitsChanged SessionEventType = "session.session_limits_changed" - SessionEventTypeSessionShutdown SessionEventType = "session.shutdown" - SessionEventTypeSessionSkillsLoaded SessionEventType = "session.skills_loaded" - SessionEventTypeSessionSnapshotRewind SessionEventType = "session.snapshot_rewind" - SessionEventTypeSessionStart SessionEventType = "session.start" - SessionEventTypeSessionTaskComplete SessionEventType = "session.task_complete" - SessionEventTypeSessionTitleChanged SessionEventType = "session.title_changed" - SessionEventTypeSessionTodosChanged SessionEventType = "session.todos_changed" - SessionEventTypeSessionToolsUpdated SessionEventType = "session.tools_updated" - SessionEventTypeSessionTruncation SessionEventType = "session.truncation" - SessionEventTypeSessionUsageCheckpoint SessionEventType = "session.usage_checkpoint" - SessionEventTypeSessionUsageInfo SessionEventType = "session.usage_info" - SessionEventTypeSessionWarning SessionEventType = "session.warning" - SessionEventTypeSessionWorkspaceFileChanged SessionEventType = "session.workspace_file_changed" - SessionEventTypeSkillInvoked SessionEventType = "skill.invoked" - SessionEventTypeSubagentCompleted SessionEventType = "subagent.completed" - SessionEventTypeSubagentConfigured SessionEventType = "subagent.configured" - SessionEventTypeSubagentDeselected SessionEventType = "subagent.deselected" - SessionEventTypeSubagentFailed SessionEventType = "subagent.failed" - SessionEventTypeSubagentSelected SessionEventType = "subagent.selected" - SessionEventTypeSubagentStarted SessionEventType = "subagent.started" - SessionEventTypeSystemMessage SessionEventType = "system.message" - SessionEventTypeSystemNotification SessionEventType = "system.notification" - SessionEventTypeToolExecutionComplete SessionEventType = "tool.execution_complete" - SessionEventTypeToolExecutionPartialResult SessionEventType = "tool.execution_partial_result" - SessionEventTypeToolExecutionProgress SessionEventType = "tool.execution_progress" - SessionEventTypeToolExecutionStart SessionEventType = "tool.execution_start" - SessionEventTypeToolSearchActivated SessionEventType = "tool_search.activated" - SessionEventTypeToolUserRequested SessionEventType = "tool.user_requested" + SessionEventTypeSessionResume SessionEventType = "session.resume" + SessionEventTypeSessionScheduleCancelled SessionEventType = "session.schedule_cancelled" + SessionEventTypeSessionScheduleCreated SessionEventType = "session.schedule_created" + SessionEventTypeSessionScheduleRearmed SessionEventType = "session.schedule_rearmed" + SessionEventTypeSessionSessionLimitsChanged SessionEventType = "session.session_limits_changed" + SessionEventTypeSessionShutdown SessionEventType = "session.shutdown" + SessionEventTypeSessionSkillsLoaded SessionEventType = "session.skills_loaded" + SessionEventTypeSessionSnapshotRewind SessionEventType = "session.snapshot_rewind" + SessionEventTypeSessionStart SessionEventType = "session.start" + SessionEventTypeSessionTaskComplete SessionEventType = "session.task_complete" + SessionEventTypeSessionTitleChanged SessionEventType = "session.title_changed" + SessionEventTypeSessionTodosChanged SessionEventType = "session.todos_changed" + SessionEventTypeSessionToolsUpdated SessionEventType = "session.tools_updated" + SessionEventTypeSessionTruncation SessionEventType = "session.truncation" + SessionEventTypeSessionUsageCheckpoint SessionEventType = "session.usage_checkpoint" + SessionEventTypeSessionUsageInfo SessionEventType = "session.usage_info" + SessionEventTypeSessionWarning SessionEventType = "session.warning" + SessionEventTypeSessionWorkspaceFileChanged SessionEventType = "session.workspace_file_changed" + SessionEventTypeSkillInvoked SessionEventType = "skill.invoked" + SessionEventTypeSubagentCompleted SessionEventType = "subagent.completed" + SessionEventTypeSubagentConfigured SessionEventType = "subagent.configured" + SessionEventTypeSubagentDeselected SessionEventType = "subagent.deselected" + SessionEventTypeSubagentFailed SessionEventType = "subagent.failed" + SessionEventTypeSubagentSelected SessionEventType = "subagent.selected" + SessionEventTypeSubagentStarted SessionEventType = "subagent.started" + SessionEventTypeSystemMessage SessionEventType = "system.message" + SessionEventTypeSystemNotification SessionEventType = "system.notification" + SessionEventTypeToolExecutionComplete SessionEventType = "tool.execution_complete" + SessionEventTypeToolExecutionPartialResult SessionEventType = "tool.execution_partial_result" + SessionEventTypeToolExecutionProgress SessionEventType = "tool.execution_progress" + SessionEventTypeToolExecutionStart SessionEventType = "tool.execution_start" + SessionEventTypeToolSearchActivated SessionEventType = "tool_search.activated" + SessionEventTypeToolUserRequested SessionEventType = "tool.user_requested" // Experimental: SessionEventTypeUIEphemeralQuery identifies an experimental event that may // change or be removed. - SessionEventTypeUIEphemeralQuery SessionEventType = "ui.ephemeral_query" + SessionEventTypeUIEphemeralQuery SessionEventType = "ui.ephemeral_query" SessionEventTypeUserInputCompleted SessionEventType = "user_input.completed" SessionEventTypeUserInputRequested SessionEventType = "user_input.requested" - SessionEventTypeUserMessage SessionEventType = "user.message" + SessionEventTypeUserMessage SessionEventType = "user.message" ) // A detected loss of a previously cached prompt prefix @@ -309,7 +320,7 @@ type PromptCacheBreakData struct { ToolsReordered *bool `json:"toolsReordered,omitempty"` } -func (*PromptCacheBreakData) sessionEventData() {} +func (*PromptCacheBreakData) sessionEventData() {} func (*PromptCacheBreakData) Type() SessionEventType { return SessionEventTypePromptCacheBreak } // A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. @@ -323,9 +334,7 @@ type SessionAutoTierSwitchFailedData struct { } func (*SessionAutoTierSwitchFailedData) sessionEventData() {} -func (*SessionAutoTierSwitchFailedData) Type() SessionEventType { - return SessionEventTypeSessionAutoTierSwitchFailed -} +func (*SessionAutoTierSwitchFailedData) Type() SessionEventType { return SessionEventTypeSessionAutoTierSwitchFailed } // Agent intent description for current activity or plan type AssistantIntentData struct { @@ -333,7 +342,7 @@ type AssistantIntentData struct { Intent string `json:"intent"` } -func (*AssistantIntentData) sessionEventData() {} +func (*AssistantIntentData) sessionEventData() {} func (*AssistantIntentData) Type() SessionEventType { return SessionEventTypeAssistantIntent } // Agent mode change details including previous and new modes @@ -344,7 +353,7 @@ type SessionModeChangedData struct { PreviousMode SessionMode `json:"previousMode"` } -func (*SessionModeChangedData) sessionEventData() {} +func (*SessionModeChangedData) sessionEventData() {} func (*SessionModeChangedData) Type() SessionEventType { return SessionEventTypeSessionModeChanged } // Assistant reasoning content for timeline display with complete thinking text @@ -357,7 +366,7 @@ type AssistantReasoningData struct { Rte *bool `json:"rte,omitempty"` } -func (*AssistantReasoningData) sessionEventData() {} +func (*AssistantReasoningData) sessionEventData() {} func (*AssistantReasoningData) Type() SessionEventType { return SessionEventTypeAssistantReasoning } // Assistant response containing text content, optional tool requests, and interaction metadata @@ -417,7 +426,7 @@ type AssistantMessageData struct { TurnID *string `json:"turnId,omitempty"` } -func (*AssistantMessageData) sessionEventData() {} +func (*AssistantMessageData) sessionEventData() {} func (*AssistantMessageData) Type() SessionEventType { return SessionEventTypeAssistantMessage } // Auto Intent resolution: the concrete model the session settled on for the first prompt of an auto-mode session, and why. Lets SDK clients render the chosen model and the full reason it was picked. The core selection fields (chosenModel/reasoningBucket/categoryScores) are stable; the routing-analytics fields (predictedLabel/confidence/candidateModels) mirror the upstream intent service and may evolve, hence the event's experimental stability. @@ -456,9 +465,7 @@ type SessionAutoModeResolvedData struct { } func (*SessionAutoModeResolvedData) sessionEventData() {} -func (*SessionAutoModeResolvedData) Type() SessionEventType { - return SessionEventTypeSessionAutoModeResolved -} +func (*SessionAutoModeResolvedData) Type() SessionEventType { return SessionEventTypeSessionAutoModeResolved } // Auto mode switch completion notification type AutoModeSwitchCompletedData struct { @@ -469,9 +476,7 @@ type AutoModeSwitchCompletedData struct { } func (*AutoModeSwitchCompletedData) sessionEventData() {} -func (*AutoModeSwitchCompletedData) Type() SessionEventType { - return SessionEventTypeAutoModeSwitchCompleted -} +func (*AutoModeSwitchCompletedData) Type() SessionEventType { return SessionEventTypeAutoModeSwitchCompleted } // Auto mode switch request notification requiring user approval type AutoModeSwitchRequestedData struct { @@ -484,9 +489,7 @@ type AutoModeSwitchRequestedData struct { } func (*AutoModeSwitchRequestedData) sessionEventData() {} -func (*AutoModeSwitchRequestedData) Type() SessionEventType { - return SessionEventTypeAutoModeSwitchRequested -} +func (*AutoModeSwitchRequestedData) Type() SessionEventType { return SessionEventTypeAutoModeSwitchRequested } // Autopilot objective state file operation details indicating what changed type SessionAutopilotObjectiveChangedData struct { @@ -499,9 +502,7 @@ type SessionAutopilotObjectiveChangedData struct { } func (*SessionAutopilotObjectiveChangedData) sessionEventData() {} -func (*SessionAutopilotObjectiveChangedData) Type() SessionEventType { - return SessionEventTypeSessionAutopilotObjectiveChanged -} +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. @@ -525,9 +526,7 @@ type SessionCompletionReceiptData struct { } func (*SessionCompletionReceiptData) sessionEventData() {} -func (*SessionCompletionReceiptData) Type() SessionEventType { - return SessionEventTypeSessionCompletionReceipt -} +func (*SessionCompletionReceiptData) Type() SessionEventType { return SessionEventTypeSessionCompletionReceipt } // Canonical bytes for a content-addressed binary asset shared by reference across events type SessionBinaryAssetData struct { @@ -547,7 +546,7 @@ type SessionBinaryAssetData struct { Discriminator BinaryAssetType `json:"type"` } -func (*SessionBinaryAssetData) sessionEventData() {} +func (*SessionBinaryAssetData) sessionEventData() {} func (*SessionBinaryAssetData) Type() SessionEventType { return SessionEventTypeSessionBinaryAsset } // Context window breakdown at the start of LLM-powered conversation compaction @@ -569,9 +568,7 @@ type SessionCompactionStartData struct { } func (*SessionCompactionStartData) sessionEventData() {} -func (*SessionCompactionStartData) Type() SessionEventType { - return SessionEventTypeSessionCompactionStart -} +func (*SessionCompactionStartData) Type() SessionEventType { return SessionEventTypeSessionCompactionStart } // Context-cleared details emitted when the host clears the conversation (the session.history.clearContext RPC / Session.clearContextMessages) type SessionContextClearedData struct { @@ -582,9 +579,7 @@ type SessionContextClearedData struct { } func (*SessionContextClearedData) sessionEventData() {} -func (*SessionContextClearedData) Type() SessionEventType { - return SessionEventTypeSessionContextCleared -} +func (*SessionContextClearedData) Type() SessionEventType { return SessionEventTypeSessionContextCleared } // Conversation compaction results including success status, metrics, and optional error details type SessionCompactionCompleteData struct { @@ -636,9 +631,7 @@ type SessionCompactionCompleteData struct { } func (*SessionCompactionCompleteData) sessionEventData() {} -func (*SessionCompactionCompleteData) Type() SessionEventType { - return SessionEventTypeSessionCompactionComplete -} +func (*SessionCompactionCompleteData) Type() SessionEventType { return SessionEventTypeSessionCompactionComplete } // Conversation truncation statistics including token counts and removed content metrics type SessionTruncationData struct { @@ -660,7 +653,7 @@ type SessionTruncationData struct { TokensRemovedDuringTruncation int64 `json:"tokensRemovedDuringTruncation"` } -func (*SessionTruncationData) sessionEventData() {} +func (*SessionTruncationData) sessionEventData() {} func (*SessionTruncationData) Type() SessionEventType { return SessionEventTypeSessionTruncation } // Current context window usage statistics including token and message counts @@ -681,7 +674,7 @@ type SessionUsageInfoData struct { ToolDefinitionsTokens *int64 `json:"toolDefinitionsTokens,omitempty"` } -func (*SessionUsageInfoData) sessionEventData() {} +func (*SessionUsageInfoData) sessionEventData() {} func (*SessionUsageInfoData) Type() SessionEventType { return SessionEventTypeSessionUsageInfo } // Custom agent selection details including name and available tools @@ -694,7 +687,7 @@ type SubagentSelectedData struct { Tools []string `json:"tools"` } -func (*SubagentSelectedData) sessionEventData() {} +func (*SubagentSelectedData) sessionEventData() {} func (*SubagentSelectedData) Type() SessionEventType { return SessionEventTypeSubagentSelected } // Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability. @@ -713,9 +706,7 @@ type SessionCanvasRecordedData struct { } func (*SessionCanvasRecordedData) sessionEventData() {} -func (*SessionCanvasRecordedData) Type() SessionEventType { - return SessionEventTypeSessionCanvasRecorded -} +func (*SessionCanvasRecordedData) Type() SessionEventType { return SessionEventTypeSessionCanvasRecorded } // Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay. // Experimental: SessionCanvasRemovedData is part of an experimental API and may change or be removed. @@ -728,7 +719,7 @@ type SessionCanvasRemovedData struct { InstanceID string `json:"instanceId"` } -func (*SessionCanvasRemovedData) sessionEventData() {} +func (*SessionCanvasRemovedData) sessionEventData() {} func (*SessionCanvasRemovedData) Type() SessionEventType { return SessionEventTypeSessionCanvasRemoved } // Durable session usage checkpoint for reconstructing aggregate accounting on resume @@ -747,9 +738,7 @@ type SessionUsageCheckpointData struct { } func (*SessionUsageCheckpointData) sessionEventData() {} -func (*SessionUsageCheckpointData) Type() SessionEventType { - return SessionEventTypeSessionUsageCheckpoint -} +func (*SessionUsageCheckpointData) Type() SessionEventType { return SessionEventTypeSessionUsageCheckpoint } // Dynamic headers refresh request for a remote MCP server type MCPHeadersRefreshRequiredData struct { @@ -764,9 +753,7 @@ type MCPHeadersRefreshRequiredData struct { } func (*MCPHeadersRefreshRequiredData) sessionEventData() {} -func (*MCPHeadersRefreshRequiredData) Type() SessionEventType { - return SessionEventTypeMCPHeadersRefreshRequired -} +func (*MCPHeadersRefreshRequiredData) Type() SessionEventType { return SessionEventTypeMCPHeadersRefreshRequired } // Elicitation request completion with the user's response type ElicitationCompletedData struct { @@ -778,7 +765,7 @@ type ElicitationCompletedData struct { RequestID string `json:"requestId"` } -func (*ElicitationCompletedData) sessionEventData() {} +func (*ElicitationCompletedData) sessionEventData() {} func (*ElicitationCompletedData) Type() SessionEventType { return SessionEventTypeElicitationCompleted } // Elicitation request; may be form-based (structured input) or URL-based (browser redirect) @@ -799,7 +786,7 @@ type ElicitationRequestedData struct { URL *string `json:"url,omitempty"` } -func (*ElicitationRequestedData) sessionEventData() {} +func (*ElicitationRequestedData) sessionEventData() {} func (*ElicitationRequestedData) Type() SessionEventType { return SessionEventTypeElicitationRequested } // Empty payload for `session.background_tasks_changed`, indicating background task state changed. @@ -807,15 +794,13 @@ type SessionBackgroundTasksChangedData struct { } func (*SessionBackgroundTasksChangedData) sessionEventData() {} -func (*SessionBackgroundTasksChangedData) Type() SessionEventType { - return SessionEventTypeSessionBackgroundTasksChanged -} +func (*SessionBackgroundTasksChangedData) Type() SessionEventType { return SessionEventTypeSessionBackgroundTasksChanged } // Empty payload; the event signals that the custom agent was deselected, returning to the default agent type SubagentDeselectedData struct { } -func (*SubagentDeselectedData) sessionEventData() {} +func (*SubagentDeselectedData) sessionEventData() {} func (*SubagentDeselectedData) Type() SessionEventType { return SessionEventTypeSubagentDeselected } // Empty payload; the event signals that the pending message queue has changed @@ -823,9 +808,7 @@ type PendingMessagesModifiedData struct { } func (*PendingMessagesModifiedData) sessionEventData() {} -func (*PendingMessagesModifiedData) Type() SessionEventType { - return SessionEventTypePendingMessagesModified -} +func (*PendingMessagesModifiedData) Type() SessionEventType { return SessionEventTypePendingMessagesModified } // Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values, then the policy helper, per ordinary key, while permissions compose restrictively across device, server, policy-helper, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes. // Experimental: SessionManagedSettingsResolvedData is part of an experimental API and may change or be removed. @@ -855,9 +838,7 @@ type SessionManagedSettingsResolvedData struct { } func (*SessionManagedSettingsResolvedData) sessionEventData() {} -func (*SessionManagedSettingsResolvedData) Type() SessionEventType { - return SessionEventTypeSessionManagedSettingsResolved -} +func (*SessionManagedSettingsResolvedData) Type() SessionEventType { return SessionEventTypeSessionManagedSettingsResolved } // Ephemeral invalidation signal for a changed factory run. // Experimental: FactoryRunUpdatedData is part of an experimental API and may change or be removed. @@ -868,7 +849,7 @@ type FactoryRunUpdatedData struct { RunID string `json:"runId"` } -func (*FactoryRunUpdatedData) sessionEventData() {} +func (*FactoryRunUpdatedData) sessionEventData() {} func (*FactoryRunUpdatedData) Type() SessionEventType { return SessionEventTypeFactoryRunUpdated } // Ephemeral progress update from a running hook process @@ -879,7 +860,7 @@ type HookProgressData struct { Temporary *bool `json:"temporary,omitempty"` } -func (*HookProgressData) sessionEventData() {} +func (*HookProgressData) sessionEventData() {} func (*HookProgressData) Type() SessionEventType { return SessionEventTypeHookProgress } // Ephemeral signal that a factory run attempt began executing. @@ -893,7 +874,7 @@ type FactoryRunStartedData struct { RunID string `json:"runId"` } -func (*FactoryRunStartedData) sessionEventData() {} +func (*FactoryRunStartedData) sessionEventData() {} func (*FactoryRunStartedData) Type() SessionEventType { return SessionEventTypeFactoryRunStarted } // Ephemeral signal that a factory run reached a terminal status. @@ -913,7 +894,7 @@ type FactoryRunSettledData struct { Status FactoryRunSettledStatus `json:"status"` } -func (*FactoryRunSettledData) sessionEventData() {} +func (*FactoryRunSettledData) sessionEventData() {} func (*FactoryRunSettledData) Type() SessionEventType { return SessionEventTypeFactoryRunSettled } // Error details for timeline display including message and optional diagnostic information @@ -940,7 +921,7 @@ type SessionErrorData struct { URL *string `json:"url,omitempty"` } -func (*SessionErrorData) sessionEventData() {} +func (*SessionErrorData) sessionEventData() {} func (*SessionErrorData) Type() SessionEventType { return SessionEventTypeSessionError } // Experimental content-safe activity signal for a running HydraFusion phase. @@ -967,9 +948,7 @@ type AssistantFusionPhaseActivityData struct { } func (*AssistantFusionPhaseActivityData) sessionEventData() {} -func (*AssistantFusionPhaseActivityData) Type() SessionEventType { - return SessionEventTypeAssistantFusionPhaseActivity -} +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. @@ -1008,9 +987,7 @@ type AssistantFusionPhaseCompletedData struct { } func (*AssistantFusionPhaseCompletedData) sessionEventData() {} -func (*AssistantFusionPhaseCompletedData) Type() SessionEventType { - return SessionEventTypeAssistantFusionPhaseCompleted -} +func (*AssistantFusionPhaseCompletedData) Type() SessionEventType { return SessionEventTypeAssistantFusionPhaseCompleted } // Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn. // Experimental: SessionFusionRouteFailedData is part of an experimental API and may change or be removed. @@ -1032,9 +1009,7 @@ type SessionFusionRouteFailedData struct { } func (*SessionFusionRouteFailedData) sessionEventData() {} -func (*SessionFusionRouteFailedData) Type() SessionEventType { - return SessionEventTypeSessionFusionRouteFailed -} +func (*SessionFusionRouteFailedData) Type() SessionEventType { return SessionEventTypeSessionFusionRouteFailed } // Experimental durable aggregate outcome of a HydraFusion turn. // Experimental: SessionFusionCompletedData is part of an experimental API and may change or be removed. @@ -1078,9 +1053,7 @@ type SessionFusionCompletedData struct { } func (*SessionFusionCompletedData) sessionEventData() {} -func (*SessionFusionCompletedData) Type() SessionEventType { - return SessionEventTypeSessionFusionCompleted -} +func (*SessionFusionCompletedData) Type() SessionEventType { return SessionEventTypeSessionFusionCompleted } // Experimental durable typed HydraFusion phase failure and degradation transition. // Experimental: AssistantFusionPhaseFailedData is part of an experimental API and may change or be removed. @@ -1112,9 +1085,7 @@ type AssistantFusionPhaseFailedData struct { } func (*AssistantFusionPhaseFailedData) sessionEventData() {} -func (*AssistantFusionPhaseFailedData) Type() SessionEventType { - return SessionEventTypeAssistantFusionPhaseFailed -} +func (*AssistantFusionPhaseFailedData) Type() SessionEventType { return SessionEventTypeAssistantFusionPhaseFailed } // Experimental durable validated HydraFusion route and turn policy. // Experimental: SessionFusionResolvedData is part of an experimental API and may change or be removed. @@ -1165,9 +1136,7 @@ type SessionFusionResolvedData struct { } func (*SessionFusionResolvedData) sessionEventData() {} -func (*SessionFusionResolvedData) Type() SessionEventType { - return SessionEventTypeSessionFusionResolved -} +func (*SessionFusionResolvedData) Type() SessionEventType { return SessionEventTypeSessionFusionResolved } // Experimental transient HydraFusion phase/model/role signal. // Experimental: AssistantFusionPhaseStartedData is part of an experimental API and may change or be removed. @@ -1189,9 +1158,7 @@ type AssistantFusionPhaseStartedData struct { } func (*AssistantFusionPhaseStartedData) sessionEventData() {} -func (*AssistantFusionPhaseStartedData) Type() SessionEventType { - return SessionEventTypeAssistantFusionPhaseStarted -} +func (*AssistantFusionPhaseStartedData) Type() SessionEventType { return SessionEventTypeAssistantFusionPhaseStarted } // Experimental transient signal that HydraFusion routing has started for an eligible turn. // Experimental: SessionFusionRouteStartedData is part of an experimental API and may change or be removed. @@ -1207,9 +1174,7 @@ type SessionFusionRouteStartedData struct { } func (*SessionFusionRouteStartedData) sessionEventData() {} -func (*SessionFusionRouteStartedData) Type() SessionEventType { - return SessionEventTypeSessionFusionRouteStarted -} +func (*SessionFusionRouteStartedData) Type() SessionEventType { return SessionEventTypeSessionFusionRouteStarted } // External tool completion notification signaling UI dismissal type ExternalToolCompletedData struct { @@ -1218,9 +1183,7 @@ type ExternalToolCompletedData struct { } func (*ExternalToolCompletedData) sessionEventData() {} -func (*ExternalToolCompletedData) Type() SessionEventType { - return SessionEventTypeExternalToolCompleted -} +func (*ExternalToolCompletedData) Type() SessionEventType { return SessionEventTypeExternalToolCompleted } // External tool invocation request for client-side tool execution type ExternalToolRequestedData struct { @@ -1245,9 +1208,7 @@ type ExternalToolRequestedData struct { } func (*ExternalToolRequestedData) sessionEventData() {} -func (*ExternalToolRequestedData) Type() SessionEventType { - return SessionEventTypeExternalToolRequested -} +func (*ExternalToolRequestedData) Type() SessionEventType { return SessionEventTypeExternalToolRequested } // Failed LLM API call metadata for telemetry type ModelCallFailureData struct { @@ -1305,7 +1266,7 @@ type ModelCallFailureData struct { Transport *ModelCallFailureTransport `json:"transport,omitempty"` } -func (*ModelCallFailureData) sessionEventData() {} +func (*ModelCallFailureData) sessionEventData() {} func (*ModelCallFailureData) Type() SessionEventType { return SessionEventTypeModelCallFailure } // Final lifecycle outcome for one logical model dispatch. A logical dispatch may include internal reconnect or fallback work, so event count is not provider HTTP-request count. @@ -1324,9 +1285,44 @@ type ModelCallFinishedData struct { TurnID string `json:"turnId"` } -func (*ModelCallFinishedData) sessionEventData() {} +func (*ModelCallFinishedData) sessionEventData() {} func (*ModelCallFinishedData) Type() SessionEventType { return SessionEventTypeModelCallFinished } +// Freezes one blinded, verbatim-verified authorization claim the runtime minted from a human user message, so a resumed session re-establishes the same grant deterministically instead of re-running the extraction model. This mints no authority on its own: it records what a blinded proposer pointed at and the trusted discriminator the runtime established, and deterministic establishment runs on replay. Persisted so recorded authority survives compaction and process resume. +// Experimental: PermissionMessageAuthorizationData is part of an experimental API and may change or be removed. +type PermissionMessageAuthorizationData struct { + // The kind of effect authorized, as an action-class identifier. + // Experimental: ActionClass is part of an experimental API and may change or be removed. + ActionClass string `json:"actionClass"` + // Whether the claim granted or denied authority. + // Experimental: Polarity is part of an experimental API and may change or be removed. + Polarity PermissionMessageAuthorizationPolarity `json:"polarity"` + // Deterministic identity of the record, derived from the turn and span offsets so re-extracting the same span mints nothing new. + // Experimental: RecordID is part of an experimental API and may change or be removed. + RecordID string `json:"recordId"` + // End byte offset of the authorizing span within the turn. + // Experimental: SpanEnd is part of an experimental API and may change or be removed. + SpanEnd int64 `json:"spanEnd"` + // Start byte offset of the authorizing span within the turn. + // Experimental: SpanStart is part of an experimental API and may change or be removed. + SpanStart int64 `json:"spanStart"` + // Concrete named targets that appear verbatim inside the span. + // Experimental: TargetMembers is part of an experimental API and may change or be removed. + TargetMembers []string `json:"targetMembers,omitzero"` + // The task the permission is scoped to, when the human named one. + // Experimental: Task is part of an experimental API and may change or be removed. + Task *string `json:"task,omitempty"` + // The human turn the quoted span was read from. + // Experimental: TurnIndex is part of an experimental API and may change or be removed. + TurnIndex int64 `json:"turnIndex"` + // The trusted version discriminator, when one exists. Exact shell-command grants carry the byte-identical commands grounded in the human span; world-derived classes carry a file object, remote tip, or runner only when that state was captured safely. An opaque object mirroring the runtime's adjacently-tagged resolution. + // Experimental: World is part of an experimental API and may change or be removed. + World any `json:"world,omitempty"` +} + +func (*PermissionMessageAuthorizationData) sessionEventData() {} +func (*PermissionMessageAuthorizationData) Type() SessionEventType { return SessionEventTypePermissionMessageAuthorization } + // Hook invocation completion details including output, success status, and error information type HookEndData struct { // Error details when the hook failed @@ -1343,7 +1339,7 @@ type HookEndData struct { Success bool `json:"success"` } -func (*HookEndData) sessionEventData() {} +func (*HookEndData) sessionEventData() {} func (*HookEndData) Type() SessionEventType { return SessionEventTypeHookEnd } // Hook invocation start details including type and input data @@ -1358,7 +1354,7 @@ type HookStartData struct { ParentToolCallID *string `json:"parentToolCallId,omitempty"` } -func (*HookStartData) sessionEventData() {} +func (*HookStartData) sessionEventData() {} func (*HookStartData) Type() SessionEventType { return SessionEventTypeHookStart } // Informational message for timeline display with categorization @@ -1373,7 +1369,7 @@ type SessionInfoData struct { URL *string `json:"url,omitempty"` } -func (*SessionInfoData) sessionEventData() {} +func (*SessionInfoData) sessionEventData() {} func (*SessionInfoData) Type() SessionEventType { return SessionEventTypeSessionInfo } // LLM API call usage metrics including tokens, costs, quotas, and billing information @@ -1473,7 +1469,7 @@ type AssistantUsageData struct { Transport *AssistantUsageTransport `json:"transport,omitempty"` } -func (*AssistantUsageData) sessionEventData() {} +func (*AssistantUsageData) sessionEventData() {} func (*AssistantUsageData) Type() SessionEventType { return SessionEventTypeAssistantUsage } // Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message @@ -1487,9 +1483,7 @@ type AssistantServerToolProgressData struct { } func (*AssistantServerToolProgressData) sessionEventData() {} -func (*AssistantServerToolProgressData) Type() SessionEventType { - return SessionEventTypeAssistantServerToolProgress -} +func (*AssistantServerToolProgressData) Type() SessionEventType { return SessionEventTypeAssistantServerToolProgress } // Live-only Auto preference recommendation from Copilot API after a successful Auto model call. // Experimental: SessionAutoTierRecommendationData is part of an experimental API and may change or be removed. @@ -1499,9 +1493,7 @@ type SessionAutoTierRecommendationData struct { } func (*SessionAutoTierRecommendationData) sessionEventData() {} -func (*SessionAutoTierRecommendationData) Type() SessionEventType { - return SessionEventTypeSessionAutoTierRecommendation -} +func (*SessionAutoTierRecommendationData) Type() SessionEventType { return SessionEventTypeSessionAutoTierRecommendation } // MCP App view called a tool on a connected MCP server (SEP-1865) type MCPAppToolCallCompleteData struct { @@ -1524,9 +1516,7 @@ type MCPAppToolCallCompleteData struct { } func (*MCPAppToolCallCompleteData) sessionEventData() {} -func (*MCPAppToolCallCompleteData) Type() SessionEventType { - return SessionEventTypeMCPAppToolCallComplete -} +func (*MCPAppToolCallCompleteData) Type() SessionEventType { return SessionEventTypeMCPAppToolCallComplete } // MCP OAuth request completion notification type MCPOauthCompletedData struct { @@ -1536,7 +1526,7 @@ type MCPOauthCompletedData struct { RequestID string `json:"requestId"` } -func (*MCPOauthCompletedData) sessionEventData() {} +func (*MCPOauthCompletedData) sessionEventData() {} func (*MCPOauthCompletedData) Type() SessionEventType { return SessionEventTypeMCPOauthCompleted } // MCP headers refresh request completion notification @@ -1548,9 +1538,7 @@ type MCPHeadersRefreshCompletedData struct { } func (*MCPHeadersRefreshCompletedData) sessionEventData() {} -func (*MCPHeadersRefreshCompletedData) Type() SessionEventType { - return SessionEventTypeMCPHeadersRefreshCompleted -} +func (*MCPHeadersRefreshCompletedData) Type() SessionEventType { return SessionEventTypeMCPHeadersRefreshCompleted } // Metadata for an additional model inference attempt within an existing assistant turn type AssistantTurnRetryData struct { @@ -1562,7 +1550,7 @@ type AssistantTurnRetryData struct { TurnID string `json:"turnId"` } -func (*AssistantTurnRetryData) sessionEventData() {} +func (*AssistantTurnRetryData) sessionEventData() {} func (*AssistantTurnRetryData) Type() SessionEventType { return SessionEventTypeAssistantTurnRetry } // Metadata for work the user interrupted while the agent was running @@ -1595,7 +1583,7 @@ type AgentInterruptedData struct { Turn int64 `json:"turn"` } -func (*AgentInterruptedData) sessionEventData() {} +func (*AgentInterruptedData) sessionEventData() {} func (*AgentInterruptedData) Type() SessionEventType { return SessionEventTypeAgentInterrupted } // Model API dispatch metadata for internal telemetry @@ -1612,7 +1600,7 @@ type ModelCallStartData struct { TurnID string `json:"turnId"` } -func (*ModelCallStartData) sessionEventData() {} +func (*ModelCallStartData) sessionEventData() {} func (*ModelCallStartData) Type() SessionEventType { return SessionEventTypeModelCallStart } // Model change details including previous and new model identifiers @@ -1645,7 +1633,7 @@ type SessionModelChangeData struct { Verbosity *Verbosity `json:"verbosity,omitempty"` } -func (*SessionModelChangeData) sessionEventData() {} +func (*SessionModelChangeData) sessionEventData() {} func (*SessionModelChangeData) Type() SessionEventType { return SessionEventTypeSessionModelChange } // Notifies that the session's remote steering capability has changed @@ -1655,9 +1643,7 @@ type SessionRemoteSteerableChangedData struct { } func (*SessionRemoteSteerableChangedData) sessionEventData() {} -func (*SessionRemoteSteerableChangedData) Type() SessionEventType { - return SessionEventTypeSessionRemoteSteerableChanged -} +func (*SessionRemoteSteerableChangedData) Type() SessionEventType { return SessionEventTypeSessionRemoteSteerableChanged } // OAuth authentication request for an MCP server type MCPOauthRequiredData struct { @@ -1679,7 +1665,7 @@ type MCPOauthRequiredData struct { WwwAuthenticateParams *MCPOauthWwwAuthenticateParams `json:"wwwAuthenticateParams,omitempty"` } -func (*MCPOauthRequiredData) sessionEventData() {} +func (*MCPOauthRequiredData) sessionEventData() {} func (*MCPOauthRequiredData) Type() SessionEventType { return SessionEventTypeMCPOauthRequired } // Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined. @@ -1697,9 +1683,7 @@ type SessionCustomNotificationData struct { } func (*SessionCustomNotificationData) sessionEventData() {} -func (*SessionCustomNotificationData) Type() SessionEventType { - return SessionEventTypeSessionCustomNotification -} +func (*SessionCustomNotificationData) Type() SessionEventType { return SessionEventTypeSessionCustomNotification } // Ordered output and terminal state for a transient query that does not modify conversation history. // Experimental: UIEphemeralQueryData is part of an experimental API and may change or be removed. @@ -1716,7 +1700,7 @@ type UIEphemeralQueryData struct { RequestID string `json:"requestId"` } -func (*UIEphemeralQueryData) sessionEventData() {} +func (*UIEphemeralQueryData) sessionEventData() {} func (*UIEphemeralQueryData) Type() SessionEventType { return SessionEventTypeUIEphemeralQuery } // Payload emitted whenever the main agent's processing loop goes idle, including while related background work (running agents or in-flight attached shell commands) is still pending and the session-level idle event is therefore deferred @@ -1725,7 +1709,7 @@ type AssistantIdleData struct { Aborted *bool `json:"aborted,omitempty"` } -func (*AssistantIdleData) sessionEventData() {} +func (*AssistantIdleData) sessionEventData() {} func (*AssistantIdleData) Type() SessionEventType { return SessionEventTypeAssistantIdle } // Payload identifying the MCP server associated with a list change. @@ -1735,9 +1719,7 @@ type MCPPromptsListChangedData struct { } func (*MCPPromptsListChangedData) sessionEventData() {} -func (*MCPPromptsListChangedData) Type() SessionEventType { - return SessionEventTypeMCPPromptsListChanged -} +func (*MCPPromptsListChangedData) Type() SessionEventType { return SessionEventTypeMCPPromptsListChanged } // Payload identifying the MCP server associated with a list change. type MCPResourcesListChangedData struct { @@ -1746,9 +1728,7 @@ type MCPResourcesListChangedData struct { } func (*MCPResourcesListChangedData) sessionEventData() {} -func (*MCPResourcesListChangedData) Type() SessionEventType { - return SessionEventTypeMCPResourcesListChanged -} +func (*MCPResourcesListChangedData) Type() SessionEventType { return SessionEventTypeMCPResourcesListChanged } // Payload identifying the MCP server associated with a list change. type MCPToolsListChangedData struct { @@ -1756,7 +1736,7 @@ type MCPToolsListChangedData struct { ServerName string `json:"serverName"` } -func (*MCPToolsListChangedData) sessionEventData() {} +func (*MCPToolsListChangedData) sessionEventData() {} func (*MCPToolsListChangedData) Type() SessionEventType { return SessionEventTypeMCPToolsListChanged } // Payload indicating the session is idle with no background agents or attached shell commands in flight @@ -1767,14 +1747,14 @@ type SessionIdleData struct { Mode *SessionMode `json:"mode,omitempty"` } -func (*SessionIdleData) sessionEventData() {} +func (*SessionIdleData) sessionEventData() {} func (*SessionIdleData) Type() SessionEventType { return SessionEventTypeSessionIdle } // Payload of `sandbox.decision`, a bounded governance record of what the process sandbox was configured to do and whether it took effect. Discriminated by `kind`. type SandboxDecisionData struct { } -func (*SandboxDecisionData) sessionEventData() {} +func (*SandboxDecisionData) sessionEventData() {} func (*SandboxDecisionData) Type() SessionEventType { return SessionEventTypeSandboxDecision } // Payload of `session.canvas.closed` with the closed canvas instance ID, provider ID, and canvas ID. @@ -1788,7 +1768,7 @@ type SessionCanvasClosedData struct { InstanceID string `json:"instanceId"` } -func (*SessionCanvasClosedData) sessionEventData() {} +func (*SessionCanvasClosedData) sessionEventData() {} func (*SessionCanvasClosedData) Type() SessionEventType { return SessionEventTypeSessionCanvasClosed } // Payload of `session.canvas.opened` with canvas instance and provider IDs plus optional icon, title, status, URL, and input. @@ -1814,7 +1794,7 @@ type SessionCanvasOpenedData struct { URL *string `json:"url,omitempty"` } -func (*SessionCanvasOpenedData) sessionEventData() {} +func (*SessionCanvasOpenedData) sessionEventData() {} func (*SessionCanvasOpenedData) Type() SessionEventType { return SessionEventTypeSessionCanvasOpened } // Payload of `session.canvas.registry_changed` listing the canvas declarations currently available. @@ -1825,9 +1805,7 @@ type SessionCanvasRegistryChangedData struct { } func (*SessionCanvasRegistryChangedData) sessionEventData() {} -func (*SessionCanvasRegistryChangedData) Type() SessionEventType { - return SessionEventTypeSessionCanvasRegistryChanged -} +func (*SessionCanvasRegistryChangedData) Type() SessionEventType { return SessionEventTypeSessionCanvasRegistryChanged } // Payload of `session.custom_agents_updated` with loaded custom agents plus non-fatal warnings and fatal errors. type SessionCustomAgentsUpdatedData struct { @@ -1840,9 +1818,7 @@ type SessionCustomAgentsUpdatedData struct { } func (*SessionCustomAgentsUpdatedData) sessionEventData() {} -func (*SessionCustomAgentsUpdatedData) Type() SessionEventType { - return SessionEventTypeSessionCustomAgentsUpdated -} +func (*SessionCustomAgentsUpdatedData) Type() SessionEventType { return SessionEventTypeSessionCustomAgentsUpdated } // Payload of `session.extensions.attachments_pushed` with extension-contributed attachments for the next send. type SessionExtensionsAttachmentsPushedData struct { @@ -1851,9 +1827,7 @@ type SessionExtensionsAttachmentsPushedData struct { } func (*SessionExtensionsAttachmentsPushedData) sessionEventData() {} -func (*SessionExtensionsAttachmentsPushedData) Type() SessionEventType { - return SessionEventTypeSessionExtensionsAttachmentsPushed -} +func (*SessionExtensionsAttachmentsPushedData) Type() SessionEventType { return SessionEventTypeSessionExtensionsAttachmentsPushed } // Payload of `session.extensions_loaded` listing discovered extensions and their statuses. type SessionExtensionsLoadedData struct { @@ -1862,9 +1836,7 @@ type SessionExtensionsLoadedData struct { } func (*SessionExtensionsLoadedData) sessionEventData() {} -func (*SessionExtensionsLoadedData) Type() SessionEventType { - return SessionEventTypeSessionExtensionsLoaded -} +func (*SessionExtensionsLoadedData) Type() SessionEventType { return SessionEventTypeSessionExtensionsLoaded } // Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. type SessionMCPServerNeedsReconnectData struct { @@ -1873,9 +1845,7 @@ type SessionMCPServerNeedsReconnectData struct { } func (*SessionMCPServerNeedsReconnectData) sessionEventData() {} -func (*SessionMCPServerNeedsReconnectData) Type() SessionEventType { - return SessionEventTypeSessionMCPServerNeedsReconnect -} +func (*SessionMCPServerNeedsReconnectData) Type() SessionEventType { return SessionEventTypeSessionMCPServerNeedsReconnect } // Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. type SessionMCPServerRemovedData struct { @@ -1884,9 +1854,7 @@ type SessionMCPServerRemovedData struct { } func (*SessionMCPServerRemovedData) sessionEventData() {} -func (*SessionMCPServerRemovedData) Type() SessionEventType { - return SessionEventTypeSessionMCPServerRemoved -} +func (*SessionMCPServerRemovedData) Type() SessionEventType { return SessionEventTypeSessionMCPServerRemoved } // Payload of `session.mcp_server_status_changed` for one MCP server's status and optional failure error. type SessionMCPServerStatusChangedData struct { @@ -1899,9 +1867,7 @@ type SessionMCPServerStatusChangedData struct { } func (*SessionMCPServerStatusChangedData) sessionEventData() {} -func (*SessionMCPServerStatusChangedData) Type() SessionEventType { - return SessionEventTypeSessionMCPServerStatusChanged -} +func (*SessionMCPServerStatusChangedData) Type() SessionEventType { return SessionEventTypeSessionMCPServerStatusChanged } // Payload of `session.mcp_servers_loaded` listing MCP server status summaries. type SessionMCPServersLoadedData struct { @@ -1910,9 +1876,7 @@ type SessionMCPServersLoadedData struct { } func (*SessionMCPServersLoadedData) sessionEventData() {} -func (*SessionMCPServersLoadedData) Type() SessionEventType { - return SessionEventTypeSessionMCPServersLoaded -} +func (*SessionMCPServersLoadedData) Type() SessionEventType { return SessionEventTypeSessionMCPServersLoaded } // Payload of `session.skills_loaded` listing resolved skill metadata. type SessionSkillsLoadedData struct { @@ -1920,7 +1884,7 @@ type SessionSkillsLoadedData struct { Skills []SkillsLoadedSkill `json:"skills"` } -func (*SessionSkillsLoadedData) sessionEventData() {} +func (*SessionSkillsLoadedData) sessionEventData() {} func (*SessionSkillsLoadedData) Type() SessionEventType { return SessionEventTypeSessionSkillsLoaded } // Payload of `session.tools_updated` identifying the model whose resolved tools were updated. @@ -1929,7 +1893,7 @@ type SessionToolsUpdatedData struct { Model string `json:"model"` } -func (*SessionToolsUpdatedData) sessionEventData() {} +func (*SessionToolsUpdatedData) sessionEventData() {} func (*SessionToolsUpdatedData) Type() SessionEventType { return SessionEventTypeSessionToolsUpdated } // Payload of `user.message` with displayed and model-transformed content, attachments, source/delivery metadata, mode, and telemetry IDs. @@ -1962,11 +1926,14 @@ type UserMessageData struct { TurnID *string `json:"turnId,omitempty"` } -func (*UserMessageData) sessionEventData() {} +func (*UserMessageData) sessionEventData() {} func (*UserMessageData) Type() SessionEventType { return SessionEventTypeUserMessage } // Permission request completion notification signaling UI dismissal type PermissionCompletedData struct { + // Who decided this permission request. Absent on completions recorded before this field existed, which consumers must treat as "not a human decision" rather than assuming one. Authorization records are minted only for `human_response`; an assisted-approval verdict, a host policy, an unattended fallback, and a hook resolution all produce the same `result` a person does, so this is the only field that distinguishes them. + // Experimental: DecisionSource is part of an experimental API and may change or be removed. + DecisionSource *PermissionDecisionSource `json:"decisionSource,omitempty"` // Request ID of the resolved permission request; clients should dismiss any UI for this request RequestID string `json:"requestId"` // The result of the permission request @@ -1975,7 +1942,7 @@ type PermissionCompletedData struct { ToolCallID *string `json:"toolCallId,omitempty"` } -func (*PermissionCompletedData) sessionEventData() {} +func (*PermissionCompletedData) sessionEventData() {} func (*PermissionCompletedData) Type() SessionEventType { return SessionEventTypePermissionCompleted } // Permission request notification requiring client approval with request details @@ -1994,7 +1961,7 @@ type PermissionRequestedData struct { RiskAssessment any `json:"riskAssessment,omitempty"` } -func (*PermissionRequestedData) sessionEventData() {} +func (*PermissionRequestedData) sessionEventData() {} func (*PermissionRequestedData) Type() SessionEventType { return SessionEventTypePermissionRequested } // Permission-mode transition details. @@ -2012,9 +1979,7 @@ type SessionPermissionsChangedData struct { } func (*SessionPermissionsChangedData) sessionEventData() {} -func (*SessionPermissionsChangedData) Type() SessionEventType { - return SessionEventTypeSessionPermissionsChanged -} +func (*SessionPermissionsChangedData) Type() SessionEventType { return SessionEventTypeSessionPermissionsChanged } // Persisted generic client-side tool activations restored when a session resumes. type ToolSearchActivatedData struct { @@ -2024,7 +1989,7 @@ type ToolSearchActivatedData struct { ToolNames []string `json:"toolNames"` } -func (*ToolSearchActivatedData) sessionEventData() {} +func (*ToolSearchActivatedData) sessionEventData() {} func (*ToolSearchActivatedData) Type() SessionEventType { return SessionEventTypeToolSearchActivated } // Plan approval request with plan content and available user actions @@ -2044,9 +2009,7 @@ type ExitPlanModeRequestedData struct { } func (*ExitPlanModeRequestedData) sessionEventData() {} -func (*ExitPlanModeRequestedData) Type() SessionEventType { - return SessionEventTypeExitPlanModeRequested -} +func (*ExitPlanModeRequestedData) Type() SessionEventType { return SessionEventTypeExitPlanModeRequested } // Plan file operation details indicating what changed type SessionPlanChangedData struct { @@ -2054,7 +2017,7 @@ type SessionPlanChangedData struct { Operation PlanChangedOperation `json:"operation"` } -func (*SessionPlanChangedData) sessionEventData() {} +func (*SessionPlanChangedData) sessionEventData() {} func (*SessionPlanChangedData) Type() SessionEventType { return SessionEventTypeSessionPlanChanged } // Plan mode exit completion with the user's approval decision and optional feedback @@ -2072,9 +2035,7 @@ type ExitPlanModeCompletedData struct { } func (*ExitPlanModeCompletedData) sessionEventData() {} -func (*ExitPlanModeCompletedData) Type() SessionEventType { - return SessionEventTypeExitPlanModeCompleted -} +func (*ExitPlanModeCompletedData) Type() SessionEventType { return SessionEventTypeExitPlanModeCompleted } // Queued command completion notification signaling UI dismissal type CommandCompletedData struct { @@ -2082,7 +2043,7 @@ type CommandCompletedData struct { RequestID string `json:"requestId"` } -func (*CommandCompletedData) sessionEventData() {} +func (*CommandCompletedData) sessionEventData() {} func (*CommandCompletedData) Type() SessionEventType { return SessionEventTypeCommandCompleted } // Queued slash command dispatch request for client execution @@ -2093,9 +2054,29 @@ type CommandQueuedData struct { RequestID string `json:"requestId"` } -func (*CommandQueuedData) sessionEventData() {} +func (*CommandQueuedData) sessionEventData() {} func (*CommandQueuedData) Type() SessionEventType { return SessionEventTypeCommandQueued } +// Records that a live authorization record from an earlier human decision in this session contained a permission proposal, so it ran without another prompt. This mints no authority: it accounts for one more effect against the prior grant, which is what lets a replayed session agree with the live one about how much of that grant is left. +// Experimental: PermissionCarriedForwardData is part of an experimental API and may change or be removed. +type PermissionCarriedForwardData struct { + // Always `authorization_carry_forward`. Stated explicitly so a consumer reading this event cannot mistake it for a human, host-policy, or assisted-approval decision. + // Experimental: DecisionSource is part of an experimental API and may change or be removed. + DecisionSource PermissionDecisionSource `json:"decisionSource"` + // Identity of the prior authorization record that contained the proposal. + // Experimental: RecordID is part of an experimental API and may change or be removed. + RecordID string `json:"recordId"` + // Authorization edge minted for this admission. Not a prompt id: no prompt was raised, so no client should expect a request with this id. + // Experimental: RequestID is part of an experimental API and may change or be removed. + RequestID string `json:"requestId"` + // Tool call this admission authorizes. Its execution receipts the prior grant, which is how a single-effect approval is spent rather than carried forward again. + // Experimental: ToolCallID is part of an experimental API and may change or be removed. + ToolCallID string `json:"toolCallId"` +} + +func (*PermissionCarriedForwardData) sessionEventData() {} +func (*PermissionCarriedForwardData) Type() SessionEventType { return SessionEventTypePermissionCarriedForward } + // Records that a mode transition notice reached the model so cache-stable mode tools can remain offered across resume. type SessionModeNoticeDeliveredData struct { // Model-visible transition notice persisted for a mid-turn delivery @@ -2105,10 +2086,30 @@ type SessionModeNoticeDeliveredData struct { } func (*SessionModeNoticeDeliveredData) sessionEventData() {} -func (*SessionModeNoticeDeliveredData) Type() SessionEventType { - return SessionEventTypeSessionModeNoticeDelivered +func (*SessionModeNoticeDeliveredData) Type() SessionEventType { return SessionEventTypeSessionModeNoticeDelivered } + +// Records that message-backed authorization could not safely represent one human turn before compaction. The runtime may compact the original message after this marker is durable, but message-derived carry-forward and assisted auto-approval remain disabled for the rest of the session so subsequent commands continue through the ordinary permission prompt. +// Experimental: PermissionMessageAuthorizationDegradedData is part of an experimental API and may change or be removed. +type PermissionMessageAuthorizationDegradedData struct { + // The human turn that could not be represented safely. + // Experimental: TurnIndex is part of an experimental API and may change or be removed. + TurnIndex int64 `json:"turnIndex"` } +func (*PermissionMessageAuthorizationDegradedData) sessionEventData() {} +func (*PermissionMessageAuthorizationDegradedData) Type() SessionEventType { return SessionEventTypePermissionMessageAuthorizationDegraded } + +// Records that one human turn has been read by the blinded authorization proposer, whether or not it minted anything, so a resumed session does not re-run the extraction model on a turn the live session already read. Persisted purely to avoid wasted model calls across resume; it is never a correctness mechanism. +// Experimental: PermissionMessageAuthorizationReadData is part of an experimental API and may change or be removed. +type PermissionMessageAuthorizationReadData struct { + // The human turn that was read by the proposer. + // Experimental: TurnIndex is part of an experimental API and may change or be removed. + TurnIndex int64 `json:"turnIndex"` +} + +func (*PermissionMessageAuthorizationReadData) sessionEventData() {} +func (*PermissionMessageAuthorizationReadData) Type() SessionEventType { return SessionEventTypePermissionMessageAuthorizationRead } + // Registered command dispatch request routed to the owning client type CommandExecuteData struct { // Raw argument string after the command name @@ -2121,7 +2122,7 @@ type CommandExecuteData struct { RequestID string `json:"requestId"` } -func (*CommandExecuteData) sessionEventData() {} +func (*CommandExecuteData) sessionEventData() {} func (*CommandExecuteData) Type() SessionEventType { return SessionEventTypeCommandExecute } // Resolved runtime configuration for a configured sub-agent @@ -2136,7 +2137,7 @@ type SubagentConfiguredData struct { ReasoningEffort *string `json:"reasoningEffort,omitempty"` } -func (*SubagentConfiguredData) sessionEventData() {} +func (*SubagentConfiguredData) sessionEventData() {} func (*SubagentConfiguredData) Type() SessionEventType { return SessionEventTypeSubagentConfigured } // Runtime enforcement of enterprise managed settings: fires when the session blocks or caps a runtime action because enterprise policy governs it, so SDK clients can explain *why* an action was governed. Unlike `session.managed_settings_resolved` (which reports *what* is managed), this reports a concrete governed action — e.g. a user or host tried to turn on a bypass-permissions escalation while policy disables it. Emitted live (not persisted to the session event log) on user/host-initiated attempts only, never for silent policy application. Marked experimental while the managed-settings surface stabilizes. @@ -2155,9 +2156,7 @@ type SessionManagedSettingsEnforcedData struct { } func (*SessionManagedSettingsEnforcedData) sessionEventData() {} -func (*SessionManagedSettingsEnforcedData) Type() SessionEventType { - return SessionEventTypeSessionManagedSettingsEnforced -} +func (*SessionManagedSettingsEnforcedData) Type() SessionEventType { return SessionEventTypeSessionManagedSettingsEnforced } // SDK command registration change notification type CommandsChangedData struct { @@ -2165,7 +2164,7 @@ type CommandsChangedData struct { Commands []CommandsChangedCommand `json:"commands"` } -func (*CommandsChangedData) sessionEventData() {} +func (*CommandsChangedData) sessionEventData() {} func (*CommandsChangedData) Type() SessionEventType { return SessionEventTypeCommandsChanged } // Sampling request completion notification signaling UI dismissal @@ -2174,7 +2173,7 @@ type SamplingCompletedData struct { RequestID string `json:"requestId"` } -func (*SamplingCompletedData) sessionEventData() {} +func (*SamplingCompletedData) sessionEventData() {} func (*SamplingCompletedData) Type() SessionEventType { return SessionEventTypeSamplingCompleted } // Sampling request from an MCP server; contains the server name and a requestId for correlation @@ -2187,7 +2186,7 @@ type SamplingRequestedData struct { ServerName string `json:"serverName"` } -func (*SamplingRequestedData) sessionEventData() {} +func (*SamplingRequestedData) sessionEventData() {} func (*SamplingRequestedData) Type() SessionEventType { return SessionEventTypeSamplingRequested } // Scheduled prompt cancelled from the schedule manager dialog @@ -2197,9 +2196,7 @@ type SessionScheduleCancelledData struct { } func (*SessionScheduleCancelledData) sessionEventData() {} -func (*SessionScheduleCancelledData) Type() SessionEventType { - return SessionEventTypeSessionScheduleCancelled -} +func (*SessionScheduleCancelledData) Type() SessionEventType { return SessionEventTypeSessionScheduleCancelled } // Scheduled prompt registered via /every or /after type SessionScheduleCreatedData struct { @@ -2226,9 +2223,7 @@ type SessionScheduleCreatedData struct { } func (*SessionScheduleCreatedData) sessionEventData() {} -func (*SessionScheduleCreatedData) Type() SessionEventType { - return SessionEventTypeSessionScheduleCreated -} +func (*SessionScheduleCreatedData) Type() SessionEventType { return SessionEventTypeSessionScheduleCreated } // Self-paced schedule re-armed for its next run type SessionScheduleRearmedData struct { @@ -2239,9 +2234,7 @@ type SessionScheduleRearmedData struct { } func (*SessionScheduleRearmedData) sessionEventData() {} -func (*SessionScheduleRearmedData) Type() SessionEventType { - return SessionEventTypeSessionScheduleRearmed -} +func (*SessionScheduleRearmedData) Type() SessionEventType { return SessionEventTypeSessionScheduleRearmed } // Session capability change notification type CapabilitiesChangedData struct { @@ -2249,7 +2242,7 @@ type CapabilitiesChangedData struct { UI *CapabilitiesChangedUI `json:"ui,omitempty"` } -func (*CapabilitiesChangedData) sessionEventData() {} +func (*CapabilitiesChangedData) sessionEventData() {} func (*CapabilitiesChangedData) Type() SessionEventType { return SessionEventTypeCapabilitiesChanged } // Session handoff metadata including source, context, and repository information @@ -2270,7 +2263,7 @@ type SessionHandoffData struct { Summary *string `json:"summary,omitempty"` } -func (*SessionHandoffData) sessionEventData() {} +func (*SessionHandoffData) sessionEventData() {} func (*SessionHandoffData) Type() SessionEventType { return SessionEventTypeSessionHandoff } // Session initialization metadata including context and configuration @@ -2311,7 +2304,7 @@ type SessionStartData struct { Version int64 `json:"version"` } -func (*SessionStartData) sessionEventData() {} +func (*SessionStartData) sessionEventData() {} func (*SessionStartData) Type() SessionEventType { return SessionEventTypeSessionStart } // Session limit exhaustion notification requiring user action. @@ -2325,9 +2318,7 @@ type SessionLimitsExhaustedRequestedData struct { } func (*SessionLimitsExhaustedRequestedData) sessionEventData() {} -func (*SessionLimitsExhaustedRequestedData) Type() SessionEventType { - return SessionEventTypeSessionLimitsExhaustedRequested -} +func (*SessionLimitsExhaustedRequestedData) Type() SessionEventType { return SessionEventTypeSessionLimitsExhaustedRequested } // Session limit exhaustion prompt completion notification. type SessionLimitsExhaustedCompletedData struct { @@ -2338,9 +2329,7 @@ type SessionLimitsExhaustedCompletedData struct { } func (*SessionLimitsExhaustedCompletedData) sessionEventData() {} -func (*SessionLimitsExhaustedCompletedData) Type() SessionEventType { - return SessionEventTypeSessionLimitsExhaustedCompleted -} +func (*SessionLimitsExhaustedCompletedData) Type() SessionEventType { return SessionEventTypeSessionLimitsExhaustedCompleted } // Session limits update details. Null clears the limits. type SessionSessionLimitsChangedData struct { @@ -2349,9 +2338,7 @@ type SessionSessionLimitsChangedData struct { } func (*SessionSessionLimitsChangedData) sessionEventData() {} -func (*SessionSessionLimitsChangedData) Type() SessionEventType { - return SessionEventTypeSessionSessionLimitsChanged -} +func (*SessionSessionLimitsChangedData) Type() SessionEventType { return SessionEventTypeSessionSessionLimitsChanged } // Session resume metadata including current context and event count type SessionResumeData struct { @@ -2387,7 +2374,7 @@ type SessionResumeData struct { Verbosity *Verbosity `json:"verbosity,omitempty"` } -func (*SessionResumeData) sessionEventData() {} +func (*SessionResumeData) sessionEventData() {} func (*SessionResumeData) Type() SessionEventType { return SessionEventTypeSessionResume } // Session rewind details including target event and count of removed events @@ -2399,9 +2386,7 @@ type SessionSnapshotRewindData struct { } func (*SessionSnapshotRewindData) sessionEventData() {} -func (*SessionSnapshotRewindData) Type() SessionEventType { - return SessionEventTypeSessionSnapshotRewind -} +func (*SessionSnapshotRewindData) Type() SessionEventType { return SessionEventTypeSessionSnapshotRewind } // Session termination metrics including usage statistics, code changes, and shutdown reason type SessionShutdownData struct { @@ -2441,7 +2426,7 @@ type SessionShutdownData struct { TotalPremiumRequests *float64 `json:"totalPremiumRequests,omitempty"` } -func (*SessionShutdownData) sessionEventData() {} +func (*SessionShutdownData) sessionEventData() {} func (*SessionShutdownData) Type() SessionEventType { return SessionEventTypeSessionShutdown } // Session title change payload containing the new display title @@ -2450,14 +2435,14 @@ type SessionTitleChangedData struct { Title string `json:"title"` } -func (*SessionTitleChangedData) sessionEventData() {} +func (*SessionTitleChangedData) sessionEventData() {} func (*SessionTitleChangedData) Type() SessionEventType { return SessionEventTypeSessionTitleChanged } // Signal-only event: the agent's todos or todo_deps table was written to. No payload — clients should call session.plan.readSqlTodosWithDependencies() to fetch the current state. Events arrive in order; clients can debounce on arrival if needed. type SessionTodosChangedData struct { } -func (*SessionTodosChangedData) sessionEventData() {} +func (*SessionTodosChangedData) sessionEventData() {} func (*SessionTodosChangedData) Type() SessionEventType { return SessionEventTypeSessionTodosChanged } // Skill invocation details including content, allowed tools, and plugin metadata @@ -2486,7 +2471,7 @@ type SkillInvokedData struct { Trigger *SkillInvokedTrigger `json:"trigger,omitempty"` } -func (*SkillInvokedData) sessionEventData() {} +func (*SkillInvokedData) sessionEventData() {} func (*SkillInvokedData) Type() SessionEventType { return SessionEventTypeSkillInvoked } // Streaming assistant message delta for incremental response updates @@ -2501,9 +2486,7 @@ type AssistantMessageDeltaData struct { } func (*AssistantMessageDeltaData) sessionEventData() {} -func (*AssistantMessageDeltaData) Type() SessionEventType { - return SessionEventTypeAssistantMessageDelta -} +func (*AssistantMessageDeltaData) Type() SessionEventType { return SessionEventTypeAssistantMessageDelta } // Streaming assistant message start metadata type AssistantMessageStartData struct { @@ -2514,9 +2497,7 @@ type AssistantMessageStartData struct { } func (*AssistantMessageStartData) sessionEventData() {} -func (*AssistantMessageStartData) Type() SessionEventType { - return SessionEventTypeAssistantMessageStart -} +func (*AssistantMessageStartData) Type() SessionEventType { return SessionEventTypeAssistantMessageStart } // Streaming reasoning delta for incremental extended thinking updates type AssistantReasoningDeltaData struct { @@ -2527,9 +2508,7 @@ type AssistantReasoningDeltaData struct { } func (*AssistantReasoningDeltaData) sessionEventData() {} -func (*AssistantReasoningDeltaData) Type() SessionEventType { - return SessionEventTypeAssistantReasoningDelta -} +func (*AssistantReasoningDeltaData) Type() SessionEventType { return SessionEventTypeAssistantReasoningDelta } // Streaming response progress with cumulative byte count type AssistantStreamingDeltaData struct { @@ -2538,9 +2517,7 @@ type AssistantStreamingDeltaData struct { } func (*AssistantStreamingDeltaData) sessionEventData() {} -func (*AssistantStreamingDeltaData) Type() SessionEventType { - return SessionEventTypeAssistantStreamingDelta -} +func (*AssistantStreamingDeltaData) Type() SessionEventType { return SessionEventTypeAssistantStreamingDelta } // Streaming tool execution output for incremental result display type ToolExecutionPartialResultData struct { @@ -2551,9 +2528,7 @@ type ToolExecutionPartialResultData struct { } func (*ToolExecutionPartialResultData) sessionEventData() {} -func (*ToolExecutionPartialResultData) Type() SessionEventType { - return SessionEventTypeToolExecutionPartialResult -} +func (*ToolExecutionPartialResultData) Type() SessionEventType { return SessionEventTypeToolExecutionPartialResult } // Streaming tool-call input delta for incremental tool-call updates type AssistantToolCallDeltaData struct { @@ -2568,9 +2543,7 @@ type AssistantToolCallDeltaData struct { } func (*AssistantToolCallDeltaData) sessionEventData() {} -func (*AssistantToolCallDeltaData) Type() SessionEventType { - return SessionEventTypeAssistantToolCallDelta -} +func (*AssistantToolCallDeltaData) Type() SessionEventType { return SessionEventTypeAssistantToolCallDelta } // Sub-agent completion details for successful execution type SubagentCompletedData struct { @@ -2606,7 +2579,7 @@ type SubagentCompletedData struct { TotalToolCalls *int64 `json:"totalToolCalls,omitempty"` } -func (*SubagentCompletedData) sessionEventData() {} +func (*SubagentCompletedData) sessionEventData() {} func (*SubagentCompletedData) Type() SessionEventType { return SessionEventTypeSubagentCompleted } // Sub-agent failure details including error message and agent information @@ -2643,7 +2616,7 @@ type SubagentFailedData struct { TotalToolCalls *int64 `json:"totalToolCalls,omitempty"` } -func (*SubagentFailedData) sessionEventData() {} +func (*SubagentFailedData) sessionEventData() {} func (*SubagentFailedData) Type() SessionEventType { return SessionEventTypeSubagentFailed } // Sub-agent startup details including parent tool call and agent information @@ -2672,7 +2645,7 @@ type SubagentStartedData struct { ToolCallID string `json:"toolCallId"` } -func (*SubagentStartedData) sessionEventData() {} +func (*SubagentStartedData) sessionEventData() {} func (*SubagentStartedData) Type() SessionEventType { return SessionEventTypeSubagentStarted } // System-generated notification for runtime events like background task completion @@ -2683,7 +2656,7 @@ type SystemNotificationData struct { Kind SystemNotification `json:"kind"` } -func (*SystemNotificationData) sessionEventData() {} +func (*SystemNotificationData) sessionEventData() {} func (*SystemNotificationData) Type() SessionEventType { return SessionEventTypeSystemNotification } // System/developer instruction content with role and optional template metadata @@ -2700,14 +2673,14 @@ type SystemMessageData struct { Role SystemMessageRole `json:"role"` } -func (*SystemMessageData) sessionEventData() {} +func (*SystemMessageData) sessionEventData() {} func (*SystemMessageData) Type() SessionEventType { return SessionEventTypeSystemMessage } // Task completion notification with summary from the agent type SessionTaskCompleteData struct { } -func (*SessionTaskCompleteData) sessionEventData() {} +func (*SessionTaskCompleteData) sessionEventData() {} func (*SessionTaskCompleteData) Type() SessionEventType { return SessionEventTypeSessionTaskComplete } // Tool execution completion results including success status, detailed output, and error information @@ -2748,9 +2721,7 @@ type ToolExecutionCompleteData struct { } func (*ToolExecutionCompleteData) sessionEventData() {} -func (*ToolExecutionCompleteData) Type() SessionEventType { - return SessionEventTypeToolExecutionComplete -} +func (*ToolExecutionCompleteData) Type() SessionEventType { return SessionEventTypeToolExecutionComplete } // Tool execution progress notification with status message type ToolExecutionProgressData struct { @@ -2761,9 +2732,7 @@ type ToolExecutionProgressData struct { } func (*ToolExecutionProgressData) sessionEventData() {} -func (*ToolExecutionProgressData) Type() SessionEventType { - return SessionEventTypeToolExecutionProgress -} +func (*ToolExecutionProgressData) Type() SessionEventType { return SessionEventTypeToolExecutionProgress } // Tool execution startup details including MCP server information when applicable type ToolExecutionStartData struct { @@ -2797,7 +2766,7 @@ type ToolExecutionStartData struct { TurnID *string `json:"turnId,omitempty"` } -func (*ToolExecutionStartData) sessionEventData() {} +func (*ToolExecutionStartData) sessionEventData() {} func (*ToolExecutionStartData) Type() SessionEventType { return SessionEventTypeToolExecutionStart } // Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume. @@ -2812,9 +2781,7 @@ type SessionCanvasUnavailableData struct { } func (*SessionCanvasUnavailableData) sessionEventData() {} -func (*SessionCanvasUnavailableData) Type() SessionEventType { - return SessionEventTypeSessionCanvasUnavailable -} +func (*SessionCanvasUnavailableData) Type() SessionEventType { return SessionEventTypeSessionCanvasUnavailable } // Turn abort information including the reason for termination type AbortData struct { @@ -2822,7 +2789,7 @@ type AbortData struct { Reason AbortReason `json:"reason"` } -func (*AbortData) sessionEventData() {} +func (*AbortData) sessionEventData() {} func (*AbortData) Type() SessionEventType { return SessionEventTypeAbort } // Turn completion metadata including the turn identifier @@ -2833,7 +2800,7 @@ type AssistantTurnEndData struct { TurnID string `json:"turnId"` } -func (*AssistantTurnEndData) sessionEventData() {} +func (*AssistantTurnEndData) sessionEventData() {} func (*AssistantTurnEndData) Type() SessionEventType { return SessionEventTypeAssistantTurnEnd } // Turn initialization metadata including identifier and interaction tracking @@ -2846,7 +2813,7 @@ type AssistantTurnStartData struct { TurnID string `json:"turnId"` } -func (*AssistantTurnStartData) sessionEventData() {} +func (*AssistantTurnStartData) sessionEventData() {} func (*AssistantTurnStartData) Type() SessionEventType { return SessionEventTypeAssistantTurnStart } // User input request completion with the user's response @@ -2859,7 +2826,7 @@ type UserInputCompletedData struct { WasFreeform *bool `json:"wasFreeform,omitempty"` } -func (*UserInputCompletedData) sessionEventData() {} +func (*UserInputCompletedData) sessionEventData() {} func (*UserInputCompletedData) Type() SessionEventType { return SessionEventTypeUserInputCompleted } // User input request notification with question and optional predefined choices @@ -2876,7 +2843,7 @@ type UserInputRequestedData struct { ToolCallID *string `json:"toolCallId,omitempty"` } -func (*UserInputRequestedData) sessionEventData() {} +func (*UserInputRequestedData) sessionEventData() {} func (*UserInputRequestedData) Type() SessionEventType { return SessionEventTypeUserInputRequested } // User-initiated tool invocation request with tool name and arguments @@ -2889,7 +2856,7 @@ type ToolUserRequestedData struct { ToolName string `json:"toolName"` } -func (*ToolUserRequestedData) sessionEventData() {} +func (*ToolUserRequestedData) sessionEventData() {} func (*ToolUserRequestedData) Type() SessionEventType { return SessionEventTypeToolUserRequested } // Warning message for timeline display with categorization @@ -2904,7 +2871,7 @@ type SessionWarningData struct { WarningType string `json:"warningType"` } -func (*SessionWarningData) sessionEventData() {} +func (*SessionWarningData) sessionEventData() {} func (*SessionWarningData) Type() SessionEventType { return SessionEventTypeSessionWarning } // Working directory and git context at session start @@ -2930,9 +2897,7 @@ type SessionContextChangedData struct { } func (*SessionContextChangedData) sessionEventData() {} -func (*SessionContextChangedData) Type() SessionEventType { - return SessionEventTypeSessionContextChanged -} +func (*SessionContextChangedData) Type() SessionEventType { return SessionEventTypeSessionContextChanged } // Workspace file change details including path and operation type type SessionWorkspaceFileChangedData struct { @@ -2943,9 +2908,7 @@ type SessionWorkspaceFileChangedData struct { } func (*SessionWorkspaceFileChangedData) sessionEventData() {} -func (*SessionWorkspaceFileChangedData) Type() SessionEventType { - return SessionEventTypeSessionWorkspaceFileChanged -} +func (*SessionWorkspaceFileChangedData) Type() SessionEventType { return SessionEventTypeSessionWorkspaceFileChanged } // Neutral provider-tagged reasoning content blocks preserved verbatim for round-tripping // Experimental: AssistantMessageReasoningBlocks is part of an experimental API and may change or be removed. @@ -3137,7 +3100,6 @@ func (RawCitationLocation) citationLocation() {} func (r RawCitationLocation) Type() CitationLocationType { return r.Discriminator } - // A content-block range within a structured source document. type CitationLocationBlock struct { // Index of the last content block of the cited range (zero-based, exclusive). @@ -3150,7 +3112,6 @@ func (CitationLocationBlock) citationLocation() {} func (CitationLocationBlock) Type() CitationLocationType { return CitationLocationTypeBlock } - // A character range within the source's text content. type CitationLocationChar struct { // End character offset within the source text (zero-based, exclusive). @@ -3163,7 +3124,6 @@ func (CitationLocationChar) citationLocation() {} func (CitationLocationChar) Type() CitationLocationType { return CitationLocationTypeChar } - // A page range within a paginated source document. type CitationLocationPage struct { // Last page number of the cited range (inclusive). @@ -3438,11 +3398,11 @@ type FusionScores struct { // Experimental: FusionStagedTerminal is part of an experimental API and may change or be removed. // Internal: FusionStagedTerminal is an internal SDK API and is not part of the public surface. type FusionStagedTerminal struct { - Arguments string `json:"arguments"` - AssistantMessage any `json:"assistantMessage"` - PhaseID string `json:"phaseId"` - ToolCallID string `json:"toolCallId"` - ToolName string `json:"toolName"` + Arguments string `json:"arguments"` + AssistantMessage any `json:"assistantMessage"` + PhaseID string `json:"phaseId"` + ToolCallID string `json:"toolCallId"` + ToolName string `json:"toolName"` } // Per-session configuration for the built-in GitHub MCP server @@ -3603,7 +3563,6 @@ func (RawPermissionPromptRequest) permissionPromptRequest() {} func (r RawPermissionPromptRequest) Kind() PermissionPromptRequestKind { return r.Discriminator } - // Shell command permission prompt type PermissionPromptRequestCommands struct { // Assisted-approval judge information for this request; present only in assisted mode. @@ -3635,7 +3594,6 @@ func (PermissionPromptRequestCommands) permissionPromptRequest() {} func (PermissionPromptRequestCommands) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindCommands } - // Custom tool invocation permission prompt type PermissionPromptRequestCustomTool struct { // Arguments to pass to the custom tool @@ -3655,7 +3613,6 @@ func (PermissionPromptRequestCustomTool) permissionPromptRequest() {} func (PermissionPromptRequestCustomTool) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindCustomTool } - // Extension sensitive environment variable access prompt type PermissionPromptRequestExtensionEnvAccess struct { // Assisted-approval judge information for this request; present only in assisted mode. @@ -3673,7 +3630,6 @@ func (PermissionPromptRequestExtensionEnvAccess) permissionPromptRequest() {} func (PermissionPromptRequestExtensionEnvAccess) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindExtensionEnvAccess } - // Extension management permission prompt type PermissionPromptRequestExtensionManagement struct { // Assisted-approval judge information for this request; present only in assisted mode. @@ -3691,7 +3647,6 @@ func (PermissionPromptRequestExtensionManagement) permissionPromptRequest() {} func (PermissionPromptRequestExtensionManagement) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindExtensionManagement } - // Extension permission access prompt type PermissionPromptRequestExtensionPermissionAccess struct { // Assisted-approval judge information for this request; present only in assisted mode. @@ -3709,7 +3664,6 @@ func (PermissionPromptRequestExtensionPermissionAccess) permissionPromptRequest( func (PermissionPromptRequestExtensionPermissionAccess) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindExtensionPermissionAccess } - // Factory run or authoring permission prompt type PermissionPromptRequestFactory struct { // Canonical key used for scoped factory approvals @@ -3753,7 +3707,6 @@ func (PermissionPromptRequestFactory) permissionPromptRequest() {} func (PermissionPromptRequestFactory) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindFactory } - // Hook confirmation permission prompt type PermissionPromptRequestHook struct { // Assisted-approval judge information for this request; present only in assisted mode. @@ -3773,7 +3726,6 @@ func (PermissionPromptRequestHook) permissionPromptRequest() {} func (PermissionPromptRequestHook) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindHook } - // MCP tool invocation permission prompt type PermissionPromptRequestMCP struct { // Arguments to pass to the MCP tool @@ -3800,7 +3752,6 @@ func (PermissionPromptRequestMCP) permissionPromptRequest() {} func (PermissionPromptRequestMCP) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindMCP } - // Memory operation permission prompt type PermissionPromptRequestMemory struct { // Whether this is a store or vote memory operation @@ -3826,7 +3777,6 @@ func (PermissionPromptRequestMemory) permissionPromptRequest() {} func (PermissionPromptRequestMemory) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindMemory } - // Path access permission prompt type PermissionPromptRequestPath struct { // Underlying permission kind that needs path approval @@ -3844,7 +3794,6 @@ func (PermissionPromptRequestPath) permissionPromptRequest() {} func (PermissionPromptRequestPath) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindPath } - // File read permission prompt type PermissionPromptRequestRead struct { // Assisted-approval judge information for this request; present only in assisted mode. @@ -3856,6 +3805,9 @@ type PermissionPromptRequestRead struct { ManagedApprovalRequired *bool `json:"managedApprovalRequired,omitempty"` // Path of the file or directory being read Path string `json:"path"` + // Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display path. + // Experimental: ResolvedPath is part of an experimental API and may change or be removed. + ResolvedPath *string `json:"resolvedPath,omitempty"` // Tool call ID that triggered this permission request ToolCallID *string `json:"toolCallId,omitempty"` } @@ -3864,7 +3816,6 @@ func (PermissionPromptRequestRead) permissionPromptRequest() {} func (PermissionPromptRequestRead) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindRead } - // URL access permission prompt type PermissionPromptRequestURL struct { // Assisted-approval judge information for this request; present only in assisted mode. @@ -3890,7 +3841,6 @@ func (PermissionPromptRequestURL) permissionPromptRequest() {} func (PermissionPromptRequestURL) Kind() PermissionPromptRequestKind { return PermissionPromptRequestKindURL } - // File write permission prompt type PermissionPromptRequestWrite struct { // Assisted-approval judge information for this request; present only in assisted mode. @@ -3908,6 +3858,9 @@ type PermissionPromptRequestWrite struct { ManagedApprovalRequired *bool `json:"managedApprovalRequired,omitempty"` // Complete new file contents for newly created files NewFileContents *string `json:"newFileContents,omitempty"` + // Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display fileName. + // Experimental: ResolvedPath is part of an experimental API and may change or be removed. + ResolvedPath *string `json:"resolvedPath,omitempty"` // Tool call ID that triggered this permission request ToolCallID *string `json:"toolCallId,omitempty"` } @@ -3933,7 +3886,6 @@ func (RawPermissionRequest) permissionRequest() {} func (r RawPermissionRequest) Kind() PermissionRequestKind { return r.Discriminator } - // Custom tool invocation permission request type PermissionRequestCustomTool struct { // Arguments to pass to the custom tool @@ -3954,7 +3906,6 @@ func (PermissionRequestCustomTool) permissionRequest() {} func (PermissionRequestCustomTool) Kind() PermissionRequestKind { return PermissionRequestKindCustomTool } - // Extension sensitive environment variable access request type PermissionRequestExtensionEnvAccess struct { // Names of the sensitive environment variables the extension is requesting. Values never appear here. @@ -3971,7 +3922,6 @@ func (PermissionRequestExtensionEnvAccess) permissionRequest() {} func (PermissionRequestExtensionEnvAccess) Kind() PermissionRequestKind { return PermissionRequestKindExtensionEnvAccess } - // Extension management permission request type PermissionRequestExtensionManagement struct { // Name of the extension being managed @@ -3988,7 +3938,6 @@ func (PermissionRequestExtensionManagement) permissionRequest() {} func (PermissionRequestExtensionManagement) Kind() PermissionRequestKind { return PermissionRequestKindExtensionManagement } - // Extension permission access request type PermissionRequestExtensionPermissionAccess struct { // Capabilities the extension is requesting @@ -4005,7 +3954,6 @@ func (PermissionRequestExtensionPermissionAccess) permissionRequest() {} func (PermissionRequestExtensionPermissionAccess) Kind() PermissionRequestKind { return PermissionRequestKindExtensionPermissionAccess } - // Factory run or authoring permission request type PermissionRequestFactory struct { // Canonical key used for scoped factory approvals @@ -4046,7 +3994,6 @@ func (PermissionRequestFactory) permissionRequest() {} func (PermissionRequestFactory) Kind() PermissionRequestKind { return PermissionRequestKindFactory } - // Hook confirmation permission request type PermissionRequestHook struct { // Optional message from the hook explaining why confirmation is needed @@ -4065,7 +4012,6 @@ func (PermissionRequestHook) permissionRequest() {} func (PermissionRequestHook) Kind() PermissionRequestKind { return PermissionRequestKindHook } - // MCP tool invocation permission request type PermissionRequestMCP struct { // Arguments to pass to the MCP tool @@ -4091,7 +4037,6 @@ func (PermissionRequestMCP) permissionRequest() {} func (PermissionRequestMCP) Kind() PermissionRequestKind { return PermissionRequestKindMCP } - // Memory operation permission request type PermissionRequestMemory struct { // Whether this is a store or vote memory operation @@ -4123,7 +4068,6 @@ func (PermissionRequestMemory) permissionRequest() {} func (PermissionRequestMemory) Kind() PermissionRequestKind { return PermissionRequestKindMemory } - // File or directory read permission request type PermissionRequestRead struct { // Human-readable description of why the file is being read @@ -4136,6 +4080,9 @@ type PermissionRequestRead struct { RequestSandboxBypass *bool `json:"requestSandboxBypass,omitempty"` // What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. Only meaningful when requestSandboxBypass is true. RequestSandboxBypassReason *string `json:"requestSandboxBypassReason,omitempty"` + // Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display path. + // Experimental: ResolvedPath is part of an experimental API and may change or be removed. + ResolvedPath *string `json:"resolvedPath,omitempty"` // Tool call ID that triggered this permission request ToolCallID *string `json:"toolCallId,omitempty"` } @@ -4144,7 +4091,6 @@ func (PermissionRequestRead) permissionRequest() {} func (PermissionRequestRead) Kind() PermissionRequestKind { return PermissionRequestKindRead } - // Shell command permission request type PermissionRequestShell struct { // Whether the UI can offer session-wide approval for this command pattern @@ -4171,6 +4117,12 @@ type PermissionRequestShell struct { RequestSandboxBypassReason *string `json:"requestSandboxBypassReason,omitempty"` // True when the requested escalation is a permissive retry rather than a full bypass: the command re-runs inside the sandbox with its file and process restrictions recording instead of blocking, while the network policy stays enforced. Always accompanied by requestSandboxBypass, so hosts that do not recognize this field still treat the request as the escalation it is. Hosts that do recognize it must not describe the command as running outside the sandbox, which would overstate the privilege being granted. RequestSandboxPermissive *bool `json:"requestSandboxPermissive,omitempty"` + // Runtime-resolved canonical object each possiblePaths entry names, keyed by the requested spelling, used for authorization identity checks. Internal and experimental; clients should continue to display possiblePaths. + // Experimental: ResolvedPaths is part of an experimental API and may change or be removed. + ResolvedPaths map[string]string `json:"resolvedPaths,omitzero"` + // Runtime-resolved canonical working directory the command runs in, used for authorization identity checks. Internal and experimental; clients should not display it. + // Experimental: ResolvedWorkingDirectory is part of an experimental API and may change or be removed. + ResolvedWorkingDirectory *string `json:"resolvedWorkingDirectory,omitempty"` // Tool call ID that triggered this permission request ToolCallID *string `json:"toolCallId,omitempty"` // Optional warning message about risks of running this command @@ -4181,7 +4133,6 @@ func (PermissionRequestShell) permissionRequest() {} func (PermissionRequestShell) Kind() PermissionRequestKind { return PermissionRequestKindShell } - // URL access permission request type PermissionRequestURL struct { // Human-readable description of why the URL is being accessed @@ -4204,7 +4155,6 @@ func (PermissionRequestURL) permissionRequest() {} func (PermissionRequestURL) Kind() PermissionRequestKind { return PermissionRequestKindURL } - // File write permission request type PermissionRequestWrite struct { // Whether the UI can offer session-wide approval for file write operations @@ -4223,6 +4173,9 @@ type PermissionRequestWrite struct { RequestSandboxBypass *bool `json:"requestSandboxBypass,omitempty"` // Justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. RequestSandboxBypassReason *string `json:"requestSandboxBypassReason,omitempty"` + // Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display fileName. + // Experimental: ResolvedPath is part of an experimental API and may change or be removed. + ResolvedPath *string `json:"resolvedPath,omitempty"` // Tool call ID that triggered this permission request ToolCallID *string `json:"toolCallId,omitempty"` } @@ -4269,7 +4222,6 @@ func (RawPermissionResult) permissionResult() {} func (r RawPermissionResult) Kind() PermissionResultKind { return r.Discriminator } - // Permission response variant indicating the request was approved without persisting an approval rule. type PermissionApproved struct { // Whether a managed approval policy already handled this request @@ -4280,7 +4232,6 @@ func (PermissionApproved) permissionResult() {} func (PermissionApproved) Kind() PermissionResultKind { return PermissionResultKindApproved } - // Permission response variant that approves a request and persists the provided approval to a project location key. type PermissionApprovedForLocation struct { // The approval to persist for this location @@ -4295,7 +4246,6 @@ func (PermissionApprovedForLocation) permissionResult() {} func (PermissionApprovedForLocation) Kind() PermissionResultKind { return PermissionResultKindApprovedForLocation } - // Permission response variant that approves a request and remembers the provided approval for the rest of the session. type PermissionApprovedForSession struct { // The approval to add as a session-scoped rule @@ -4308,7 +4258,6 @@ func (PermissionApprovedForSession) permissionResult() {} func (PermissionApprovedForSession) Kind() PermissionResultKind { return PermissionResultKindApprovedForSession } - // Permission response variant indicating the request was cancelled before use, with an optional reason. type PermissionCancelled struct { // Optional explanation of why the request was cancelled @@ -4319,7 +4268,6 @@ func (PermissionCancelled) permissionResult() {} func (PermissionCancelled) Kind() PermissionResultKind { return PermissionResultKindCancelled } - // Permission response variant denying a path under content exclusion policy, with the path and message. type PermissionDeniedByContentExclusionPolicy struct { // Human-readable explanation of why the path was excluded @@ -4332,7 +4280,6 @@ func (PermissionDeniedByContentExclusionPolicy) permissionResult() {} func (PermissionDeniedByContentExclusionPolicy) Kind() PermissionResultKind { return PermissionResultKindDeniedByContentExclusionPolicy } - // Permission response variant denied by a permission-request hook, with optional message and interrupt flag. type PermissionDeniedByPermissionRequestHook struct { // Whether to interrupt the current agent turn @@ -4345,7 +4292,6 @@ func (PermissionDeniedByPermissionRequestHook) permissionResult() {} func (PermissionDeniedByPermissionRequestHook) Kind() PermissionResultKind { return PermissionResultKindDeniedByPermissionRequestHook } - // Permission response variant denied because matching approval rules explicitly blocked the request. type PermissionDeniedByRules struct { // Rules that denied the request @@ -4356,7 +4302,6 @@ func (PermissionDeniedByRules) permissionResult() {} func (PermissionDeniedByRules) Kind() PermissionResultKind { return PermissionResultKindDeniedByRules } - // Permission response variant denied in an interactive user prompt, with optional feedback and force-reject flag. type PermissionDeniedInteractivelyByUser struct { // Optional feedback from the user explaining the denial @@ -4369,7 +4314,6 @@ func (PermissionDeniedInteractivelyByUser) permissionResult() {} func (PermissionDeniedInteractivelyByUser) Kind() PermissionResultKind { return PermissionResultKindDeniedInteractivelyByUser } - // Permission response variant denied because no approval rule matched and user confirmation was unavailable. type PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser struct { } @@ -4395,7 +4339,6 @@ func (RawPersistedBinaryResult) persistedBinaryResult() {} func (r RawPersistedBinaryResult) Type() PersistedBinaryResultType { return r.Discriminator } - // A reference to binary data persisted once on a session.binary_asset event and shared by id type BinaryAssetReference struct { // Content-addressed id of the session.binary_asset event that holds this binary's bytes (e.g. "sha256:..."). @@ -4407,7 +4350,7 @@ type BinaryAssetReference struct { // Optional metadata from the producing tool. Metadata map[string]any `json:"metadata,omitzero"` // MIME type of the referenced binary data - MIMEType string `json:"mimeType"` + MIMEType string `json:"mimeType"` Discriminator BinaryAssetReferenceType `json:"type,omitempty"` } @@ -4418,7 +4361,6 @@ func (r BinaryAssetReference) Type() PersistedBinaryResultType { } return PersistedBinaryResultType(r.Discriminator) } - // A binary result whose data was omitted from persistence due to the inline size limit type OmittedBinaryResult struct { // Decoded byte length of the omitted binary data @@ -4431,7 +4373,7 @@ type OmittedBinaryResult struct { MIMEType string `json:"mimeType"` // Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable OmittedReason OmittedBinaryOmittedReason `json:"omittedReason"` - Discriminator OmittedBinaryType `json:"type,omitempty"` + Discriminator OmittedBinaryType `json:"type,omitempty"` } func (OmittedBinaryResult) persistedBinaryResult() {} @@ -4441,7 +4383,6 @@ func (r OmittedBinaryResult) Type() PersistedBinaryResultType { } return PersistedBinaryResultType(r.Discriminator) } - // Binary result returned by a tool for the model type PersistedBinaryImage struct { // Base64-encoded binary data @@ -4451,7 +4392,7 @@ type PersistedBinaryImage struct { // Optional metadata from the producing tool. Metadata map[string]any `json:"metadata,omitzero"` // MIME type of the binary data - MIMEType string `json:"mimeType"` + MIMEType string `json:"mimeType"` Discriminator PersistedBinaryImageType `json:"type,omitempty"` } @@ -4589,7 +4530,6 @@ func (RawSystemNotification) systemNotification() {} func (r RawSystemNotification) Type() SystemNotificationType { return r.Discriminator } - // System notification metadata for a background agent that completed or failed, including agent ID, type, status, description, and prompt. type SystemNotificationAgentCompleted struct { // Unique task identifier @@ -4610,7 +4550,6 @@ func (SystemNotificationAgentCompleted) systemNotification() {} func (SystemNotificationAgentCompleted) Type() SystemNotificationType { return SystemNotificationTypeAgentCompleted } - // System notification metadata for a background agent that became idle, including agent ID, type, and description. type SystemNotificationAgentIdle struct { // Unique task identifier @@ -4627,7 +4566,6 @@ func (SystemNotificationAgentIdle) systemNotification() {} func (SystemNotificationAgentIdle) Type() SystemNotificationType { return SystemNotificationTypeAgentIdle } - // System notification metadata for a factory execution attempt that reached a terminal state. type SystemNotificationFactoryCompleted struct { // Execution attempt that reached this terminal state. @@ -4658,7 +4596,6 @@ func (SystemNotificationFactoryCompleted) systemNotification() {} func (SystemNotificationFactoryCompleted) Type() SystemNotificationType { return SystemNotificationTypeFactoryCompleted } - // System notification metadata for an instruction file discovered during tool access, including source, trigger file, and tool. type SystemNotificationInstructionDiscovered struct { // Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/') @@ -4675,7 +4612,6 @@ func (SystemNotificationInstructionDiscovered) systemNotification() {} func (SystemNotificationInstructionDiscovered) Type() SystemNotificationType { return SystemNotificationTypeInstructionDiscovered } - // System notification metadata for a new inbox message, including entry ID, sender details, and summary. type SystemNotificationNewInboxMessage struct { // Unique identifier of the inbox entry @@ -4692,7 +4628,6 @@ func (SystemNotificationNewInboxMessage) systemNotification() {} func (SystemNotificationNewInboxMessage) Type() SystemNotificationType { return SystemNotificationTypeNewInboxMessage } - // System notification metadata for a shell session that completed, including shell ID, optional exit code, and description. type SystemNotificationShellCompleted struct { // Human-readable description of the command @@ -4707,7 +4642,6 @@ func (SystemNotificationShellCompleted) systemNotification() {} func (SystemNotificationShellCompleted) Type() SystemNotificationType { return SystemNotificationTypeShellCompleted } - // System notification metadata for a detached shell session that completed, including shell ID and description. type SystemNotificationShellDetachedCompleted struct { // Human-readable description of the command @@ -4720,7 +4654,6 @@ func (SystemNotificationShellDetachedCompleted) systemNotification() {} func (SystemNotificationShellDetachedCompleted) Type() SystemNotificationType { return SystemNotificationTypeShellDetachedCompleted } - // System notification metadata from an external host that does not match a runtime-owned notification kind. type SystemNotificationUnclassified struct { // Opaque metadata supplied by the external host, when present. @@ -4747,7 +4680,6 @@ func (RawSystemNotificationFactoryPauseInfo) systemNotificationFactoryPauseInfo( func (r RawSystemNotificationFactoryPauseInfo) Type() SystemNotificationFactoryPauseInfoType { return r.Discriminator } - type SystemNotificationFactoryPauseInfoCheckpoint struct { // Stable author-defined checkpoint key that initiated the pause. Key string `json:"key"` @@ -4757,7 +4689,6 @@ func (SystemNotificationFactoryPauseInfoCheckpoint) systemNotificationFactoryPau func (SystemNotificationFactoryPauseInfoCheckpoint) Type() SystemNotificationFactoryPauseInfoType { return SystemNotificationFactoryPauseInfoTypeCheckpoint } - type SystemNotificationFactoryPauseInfoUser struct { } @@ -4781,7 +4712,6 @@ func (RawToolExecutionCompleteContent) toolExecutionCompleteContent() {} func (r RawToolExecutionCompleteContent) Type() ToolExecutionCompleteContentType { return r.Discriminator } - // Audio content block with base64-encoded data type ToolExecutionCompleteContentAudio struct { // Base64-encoded audio data @@ -4794,7 +4724,6 @@ func (ToolExecutionCompleteContentAudio) toolExecutionCompleteContent() {} func (ToolExecutionCompleteContentAudio) Type() ToolExecutionCompleteContentType { return ToolExecutionCompleteContentTypeAudio } - // Image content block with base64-encoded data type ToolExecutionCompleteContentImage struct { // Base64-encoded image data @@ -4807,7 +4736,6 @@ func (ToolExecutionCompleteContentImage) toolExecutionCompleteContent() {} func (ToolExecutionCompleteContentImage) Type() ToolExecutionCompleteContentType { return ToolExecutionCompleteContentTypeImage } - // Embedded resource content block with inline text or binary data type ToolExecutionCompleteContentResource struct { // The embedded resource contents, either text or base64-encoded binary @@ -4818,7 +4746,6 @@ func (ToolExecutionCompleteContentResource) toolExecutionCompleteContent() {} func (ToolExecutionCompleteContentResource) Type() ToolExecutionCompleteContentType { return ToolExecutionCompleteContentTypeResource } - // Resource link content block referencing an external resource type ToolExecutionCompleteContentResourceLink struct { // Human-readable description of the resource @@ -4841,7 +4768,6 @@ func (ToolExecutionCompleteContentResourceLink) toolExecutionCompleteContent() { func (ToolExecutionCompleteContentResourceLink) Type() ToolExecutionCompleteContentType { return ToolExecutionCompleteContentTypeResourceLink } - // Shell command exit metadata with optional output preview type ToolExecutionCompleteContentShellExit struct { // Working directory where the shell command was executed @@ -4862,7 +4788,6 @@ func (ToolExecutionCompleteContentShellExit) toolExecutionCompleteContent() {} func (ToolExecutionCompleteContentShellExit) Type() ToolExecutionCompleteContentType { return ToolExecutionCompleteContentTypeShellExit } - // Deprecated for shell command exit metadata. Use ToolExecutionCompleteContentShellExit instead. type ToolExecutionCompleteContentTerminal struct { // Working directory where the command was executed @@ -4877,7 +4802,6 @@ func (ToolExecutionCompleteContentTerminal) toolExecutionCompleteContent() {} func (ToolExecutionCompleteContentTerminal) Type() ToolExecutionCompleteContentType { return ToolExecutionCompleteContentTypeTerminal } - // Plain text content block type ToolExecutionCompleteContentText struct { // The text content @@ -5292,8 +5216,8 @@ type CitationLocationType string const ( CitationLocationTypeBlock CitationLocationType = "block" - CitationLocationTypeChar CitationLocationType = "char" - CitationLocationTypePage CitationLocationType = "page" + CitationLocationTypeChar CitationLocationType = "char" + CitationLocationTypePage CitationLocationType = "page" ) // The system that produced a citation. @@ -5745,23 +5669,34 @@ const ( OmittedBinaryTypeResource OmittedBinaryType = "resource" ) +// Which direction a message-backed authorization claim moves authority in. +// Experimental: PermissionMessageAuthorizationPolarity is part of an experimental API and may change or be removed. +type PermissionMessageAuthorizationPolarity string + +const ( + // The human's words refused an effect. + PermissionMessageAuthorizationPolarityDenial PermissionMessageAuthorizationPolarity = "denial" + // The human's words authorized an effect. + PermissionMessageAuthorizationPolarityGrant PermissionMessageAuthorizationPolarity = "grant" +) + // Kind discriminator for PermissionPromptRequest. type PermissionPromptRequestKind string const ( - PermissionPromptRequestKindCommands PermissionPromptRequestKind = "commands" - PermissionPromptRequestKindCustomTool PermissionPromptRequestKind = "custom-tool" - PermissionPromptRequestKindExtensionEnvAccess PermissionPromptRequestKind = "extension-env-access" - PermissionPromptRequestKindExtensionManagement PermissionPromptRequestKind = "extension-management" + PermissionPromptRequestKindCommands PermissionPromptRequestKind = "commands" + PermissionPromptRequestKindCustomTool PermissionPromptRequestKind = "custom-tool" + PermissionPromptRequestKindExtensionEnvAccess PermissionPromptRequestKind = "extension-env-access" + PermissionPromptRequestKindExtensionManagement PermissionPromptRequestKind = "extension-management" PermissionPromptRequestKindExtensionPermissionAccess PermissionPromptRequestKind = "extension-permission-access" - PermissionPromptRequestKindFactory PermissionPromptRequestKind = "factory" - PermissionPromptRequestKindHook PermissionPromptRequestKind = "hook" - PermissionPromptRequestKindMCP PermissionPromptRequestKind = "mcp" - PermissionPromptRequestKindMemory PermissionPromptRequestKind = "memory" - PermissionPromptRequestKindPath PermissionPromptRequestKind = "path" - PermissionPromptRequestKindRead PermissionPromptRequestKind = "read" - PermissionPromptRequestKindURL PermissionPromptRequestKind = "url" - PermissionPromptRequestKindWrite PermissionPromptRequestKind = "write" + PermissionPromptRequestKindFactory PermissionPromptRequestKind = "factory" + PermissionPromptRequestKindHook PermissionPromptRequestKind = "hook" + PermissionPromptRequestKindMCP PermissionPromptRequestKind = "mcp" + PermissionPromptRequestKindMemory PermissionPromptRequestKind = "memory" + PermissionPromptRequestKindPath PermissionPromptRequestKind = "path" + PermissionPromptRequestKindRead PermissionPromptRequestKind = "read" + PermissionPromptRequestKindURL PermissionPromptRequestKind = "url" + PermissionPromptRequestKindWrite PermissionPromptRequestKind = "write" ) // Underlying permission kind that needs path approval @@ -5789,18 +5724,18 @@ const ( type PermissionRequestKind string const ( - PermissionRequestKindCustomTool PermissionRequestKind = "custom-tool" - PermissionRequestKindExtensionEnvAccess PermissionRequestKind = "extension-env-access" - PermissionRequestKindExtensionManagement PermissionRequestKind = "extension-management" + PermissionRequestKindCustomTool PermissionRequestKind = "custom-tool" + PermissionRequestKindExtensionEnvAccess PermissionRequestKind = "extension-env-access" + PermissionRequestKindExtensionManagement PermissionRequestKind = "extension-management" PermissionRequestKindExtensionPermissionAccess PermissionRequestKind = "extension-permission-access" - PermissionRequestKindFactory PermissionRequestKind = "factory" - PermissionRequestKindHook PermissionRequestKind = "hook" - PermissionRequestKindMCP PermissionRequestKind = "mcp" - PermissionRequestKindMemory PermissionRequestKind = "memory" - PermissionRequestKindRead PermissionRequestKind = "read" - PermissionRequestKindShell PermissionRequestKind = "shell" - PermissionRequestKindURL PermissionRequestKind = "url" - PermissionRequestKindWrite PermissionRequestKind = "write" + PermissionRequestKindFactory PermissionRequestKind = "factory" + PermissionRequestKindHook PermissionRequestKind = "hook" + PermissionRequestKindMCP PermissionRequestKind = "mcp" + PermissionRequestKindMemory PermissionRequestKind = "memory" + PermissionRequestKindRead PermissionRequestKind = "read" + PermissionRequestKindShell PermissionRequestKind = "shell" + PermissionRequestKindURL PermissionRequestKind = "url" + PermissionRequestKindWrite PermissionRequestKind = "write" ) // Whether this is a store or vote memory operation @@ -5837,14 +5772,14 @@ const ( type PermissionResultKind string const ( - PermissionResultKindApproved PermissionResultKind = "approved" - PermissionResultKindApprovedForLocation PermissionResultKind = "approved-for-location" - PermissionResultKindApprovedForSession PermissionResultKind = "approved-for-session" - PermissionResultKindCancelled PermissionResultKind = "cancelled" - PermissionResultKindDeniedByContentExclusionPolicy PermissionResultKind = "denied-by-content-exclusion-policy" - PermissionResultKindDeniedByPermissionRequestHook PermissionResultKind = "denied-by-permission-request-hook" - PermissionResultKindDeniedByRules PermissionResultKind = "denied-by-rules" - PermissionResultKindDeniedInteractivelyByUser PermissionResultKind = "denied-interactively-by-user" + PermissionResultKindApproved PermissionResultKind = "approved" + PermissionResultKindApprovedForLocation PermissionResultKind = "approved-for-location" + PermissionResultKindApprovedForSession PermissionResultKind = "approved-for-session" + PermissionResultKindCancelled PermissionResultKind = "cancelled" + PermissionResultKindDeniedByContentExclusionPolicy PermissionResultKind = "denied-by-content-exclusion-policy" + PermissionResultKindDeniedByPermissionRequestHook PermissionResultKind = "denied-by-permission-request-hook" + PermissionResultKindDeniedByRules PermissionResultKind = "denied-by-rules" + PermissionResultKindDeniedInteractivelyByUser PermissionResultKind = "denied-interactively-by-user" PermissionResultKindDeniedNoApprovalRuleAndCouldNotRequestFromUser PermissionResultKind = "denied-no-approval-rule-and-could-not-request-from-user" ) @@ -5863,7 +5798,7 @@ const ( type PersistedBinaryResultType string const ( - PersistedBinaryResultTypeImage PersistedBinaryResultType = "image" + PersistedBinaryResultTypeImage PersistedBinaryResultType = "image" PersistedBinaryResultTypeResource PersistedBinaryResultType = "resource" ) @@ -6002,21 +5937,21 @@ type SystemNotificationFactoryPauseInfoType string const ( SystemNotificationFactoryPauseInfoTypeCheckpoint SystemNotificationFactoryPauseInfoType = "checkpoint" - SystemNotificationFactoryPauseInfoTypeUser SystemNotificationFactoryPauseInfoType = "user" + SystemNotificationFactoryPauseInfoTypeUser SystemNotificationFactoryPauseInfoType = "user" ) // Type discriminator for SystemNotification. type SystemNotificationType string const ( - SystemNotificationTypeAgentCompleted SystemNotificationType = "agent_completed" - SystemNotificationTypeAgentIdle SystemNotificationType = "agent_idle" - SystemNotificationTypeFactoryCompleted SystemNotificationType = "factory_completed" - SystemNotificationTypeInstructionDiscovered SystemNotificationType = "instruction_discovered" - SystemNotificationTypeNewInboxMessage SystemNotificationType = "new_inbox_message" - SystemNotificationTypeShellCompleted SystemNotificationType = "shell_completed" + SystemNotificationTypeAgentCompleted SystemNotificationType = "agent_completed" + SystemNotificationTypeAgentIdle SystemNotificationType = "agent_idle" + SystemNotificationTypeFactoryCompleted SystemNotificationType = "factory_completed" + SystemNotificationTypeInstructionDiscovered SystemNotificationType = "instruction_discovered" + SystemNotificationTypeNewInboxMessage SystemNotificationType = "new_inbox_message" + SystemNotificationTypeShellCompleted SystemNotificationType = "shell_completed" SystemNotificationTypeShellDetachedCompleted SystemNotificationType = "shell_detached_completed" - SystemNotificationTypeUnclassified SystemNotificationType = "unclassified" + SystemNotificationTypeUnclassified SystemNotificationType = "unclassified" ) // Theme variant this icon is intended for @@ -6033,13 +5968,13 @@ const ( type ToolExecutionCompleteContentType string const ( - ToolExecutionCompleteContentTypeAudio ToolExecutionCompleteContentType = "audio" - ToolExecutionCompleteContentTypeImage ToolExecutionCompleteContentType = "image" - ToolExecutionCompleteContentTypeResource ToolExecutionCompleteContentType = "resource" + ToolExecutionCompleteContentTypeAudio ToolExecutionCompleteContentType = "audio" + ToolExecutionCompleteContentTypeImage ToolExecutionCompleteContentType = "image" + ToolExecutionCompleteContentTypeResource ToolExecutionCompleteContentType = "resource" ToolExecutionCompleteContentTypeResourceLink ToolExecutionCompleteContentType = "resource_link" - ToolExecutionCompleteContentTypeShellExit ToolExecutionCompleteContentType = "shell_exit" - ToolExecutionCompleteContentTypeTerminal ToolExecutionCompleteContentType = "terminal" - ToolExecutionCompleteContentTypeText ToolExecutionCompleteContentType = "text" + ToolExecutionCompleteContentTypeShellExit ToolExecutionCompleteContentType = "shell_exit" + ToolExecutionCompleteContentTypeTerminal ToolExecutionCompleteContentType = "terminal" + ToolExecutionCompleteContentTypeText ToolExecutionCompleteContentType = "text" ) // Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration. @@ -6128,5 +6063,5 @@ const ( // Type aliases for convenience. type ( PermissionRequestCommand = PermissionRequestShellCommand - PossibleURL = PermissionRequestShellPossibleURL -) + PossibleURL = PermissionRequestShellPossibleURL +) \ No newline at end of file diff --git a/go/zsession_events.go b/go/zsession_events.go index 25d7ef5460..79bfd578f1 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -7,949 +7,961 @@ import "github.com/github/copilot-sdk/go/rpc" // Session-event types are generated in the rpc package and aliased here for source compatibility. type ( - AbortData = rpc.AbortData - AbortReason = rpc.AbortReason - AgentInterruptedActivity = rpc.AgentInterruptedActivity - AgentInterruptedCancelPhase = rpc.AgentInterruptedCancelPhase - AgentInterruptedData = rpc.AgentInterruptedData - AgentModelPolicy = rpc.AgentModelPolicy - AssistantFusionPhaseActivityData = rpc.AssistantFusionPhaseActivityData - AssistantFusionPhaseCompletedData = rpc.AssistantFusionPhaseCompletedData - AssistantFusionPhaseFailedData = rpc.AssistantFusionPhaseFailedData - AssistantFusionPhaseStartedData = rpc.AssistantFusionPhaseStartedData - AssistantIdleData = rpc.AssistantIdleData - AssistantIntentData = rpc.AssistantIntentData - AssistantMessageData = rpc.AssistantMessageData - AssistantMessageDeltaData = rpc.AssistantMessageDeltaData - AssistantMessageReasoningBlocks = rpc.AssistantMessageReasoningBlocks - AssistantMessageServerTools = rpc.AssistantMessageServerTools - AssistantMessageStartData = rpc.AssistantMessageStartData - AssistantMessageToolRequest = rpc.AssistantMessageToolRequest - AssistantMessageToolRequestCaller = rpc.AssistantMessageToolRequestCaller - AssistantMessageToolRequestCallerType = rpc.AssistantMessageToolRequestCallerType - AssistantMessageToolRequestType = rpc.AssistantMessageToolRequestType - AssistantReasoningData = rpc.AssistantReasoningData - AssistantReasoningDeltaData = rpc.AssistantReasoningDeltaData - AssistantServerToolProgressData = rpc.AssistantServerToolProgressData - AssistantStreamingDeltaData = rpc.AssistantStreamingDeltaData - AssistantToolCallDeltaData = rpc.AssistantToolCallDeltaData - AssistantTurnEndData = rpc.AssistantTurnEndData - AssistantTurnRetryData = rpc.AssistantTurnRetryData - AssistantTurnStartData = rpc.AssistantTurnStartData - AssistantUsageAPIEndpoint = rpc.AssistantUsageAPIEndpoint - AssistantUsageCopilotUsage = rpc.AssistantUsageCopilotUsage - AssistantUsageCopilotUsageTokenDetail = rpc.AssistantUsageCopilotUsageTokenDetail - AssistantUsageData = rpc.AssistantUsageData - AssistantUsageTransport = rpc.AssistantUsageTransport - AssistedApprovalJudgeFailureReason = rpc.AssistedApprovalJudgeFailureReason - AssistedApprovalRecommendation = rpc.AssistedApprovalRecommendation - Attachment = rpc.Attachment - AttachmentBlob = rpc.AttachmentBlob - AttachmentDirectory = rpc.AttachmentDirectory - AttachmentExtensionContext = rpc.AttachmentExtensionContext - AttachmentFile = rpc.AttachmentFile - AttachmentFileLineRange = rpc.AttachmentFileLineRange - AttachmentGitHubActionsJob = rpc.AttachmentGitHubActionsJob - AttachmentGitHubCommit = rpc.AttachmentGitHubCommit - AttachmentGitHubFile = rpc.AttachmentGitHubFile - AttachmentGitHubFileDiff = rpc.AttachmentGitHubFileDiff - AttachmentGitHubFileDiffSide = rpc.AttachmentGitHubFileDiffSide - AttachmentGitHubReference = rpc.AttachmentGitHubReference - AttachmentGitHubReferenceType = rpc.AttachmentGitHubReferenceType - AttachmentGitHubRelease = rpc.AttachmentGitHubRelease - AttachmentGitHubRepository = rpc.AttachmentGitHubRepository - AttachmentGitHubSnippet = rpc.AttachmentGitHubSnippet - AttachmentGitHubTreeComparison = rpc.AttachmentGitHubTreeComparison - AttachmentGitHubTreeComparisonSide = rpc.AttachmentGitHubTreeComparisonSide - AttachmentGitHubURL = rpc.AttachmentGitHubURL - AttachmentSelection = rpc.AttachmentSelection - AttachmentSelectionDetails = rpc.AttachmentSelectionDetails - AttachmentSelectionDetailsEnd = rpc.AttachmentSelectionDetailsEnd - AttachmentSelectionDetailsStart = rpc.AttachmentSelectionDetailsStart - AttachmentType = rpc.AttachmentType - AutoModeResolvedReasoningBucket = rpc.AutoModeResolvedReasoningBucket - AutoModeSwitchCompletedData = rpc.AutoModeSwitchCompletedData - AutoModeSwitchRequestedData = rpc.AutoModeSwitchRequestedData - AutoModeSwitchResponse = rpc.AutoModeSwitchResponse - AutopilotObjectiveChangedOperation = rpc.AutopilotObjectiveChangedOperation - AutopilotObjectiveChangedStatus = rpc.AutopilotObjectiveChangedStatus - AutoTierSwitchFailureReason = rpc.AutoTierSwitchFailureReason - BinaryAssetReference = rpc.BinaryAssetReference - BinaryAssetReferenceType = rpc.BinaryAssetReferenceType - BinaryAssetType = rpc.BinaryAssetType - CanvasRegistryChangedCanvas = rpc.CanvasRegistryChangedCanvas - CanvasRegistryChangedCanvasAction = rpc.CanvasRegistryChangedCanvasAction - CapabilitiesChangedData = rpc.CapabilitiesChangedData - CapabilitiesChangedUI = rpc.CapabilitiesChangedUI - CitableSource = rpc.CitableSource - CitationLocation = rpc.CitationLocation - CitationLocationBlock = rpc.CitationLocationBlock - CitationLocationChar = rpc.CitationLocationChar - CitationLocationPage = rpc.CitationLocationPage - CitationLocationType = rpc.CitationLocationType - CitationProvider = rpc.CitationProvider - CitationReference = rpc.CitationReference - Citations = rpc.Citations - CitationSource = rpc.CitationSource - CitationSpan = rpc.CitationSpan - CommandCompletedData = rpc.CommandCompletedData - CommandExecuteData = rpc.CommandExecuteData - CommandQueuedData = rpc.CommandQueuedData - CommandsChangedCommand = rpc.CommandsChangedCommand - CommandsChangedData = rpc.CommandsChangedData - 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 - ElicitationCompletedData = rpc.ElicitationCompletedData - ElicitationRequestedData = rpc.ElicitationRequestedData - ElicitationRequestedMode = rpc.ElicitationRequestedMode - ElicitationRequestedSchema = rpc.ElicitationRequestedSchema - ElicitationRequestedSchemaType = rpc.ElicitationRequestedSchemaType - EmbeddedBlobResourceContents = rpc.EmbeddedBlobResourceContents - EmbeddedTextResourceContents = rpc.EmbeddedTextResourceContents - ExitPlanModeAction = rpc.ExitPlanModeAction - ExitPlanModeCompletedData = rpc.ExitPlanModeCompletedData - ExitPlanModeRequestedData = rpc.ExitPlanModeRequestedData - ExtensionsLoadedExtension = rpc.ExtensionsLoadedExtension - ExtensionsLoadedExtensionSource = rpc.ExtensionsLoadedExtensionSource - ExtensionsLoadedExtensionStatus = rpc.ExtensionsLoadedExtensionStatus - ExternalToolCompletedData = rpc.ExternalToolCompletedData - ExternalToolRequestedData = rpc.ExternalToolRequestedData - FactoryPermissionOperation = rpc.FactoryPermissionOperation - FactoryPermissionPhase = rpc.FactoryPermissionPhase - FactoryRunSettledData = rpc.FactoryRunSettledData - FactoryRunSettledStatus = rpc.FactoryRunSettledStatus - FactoryRunStartedData = rpc.FactoryRunStartedData - FactoryRunUpdatedData = rpc.FactoryRunUpdatedData - FusionAttribution = rpc.FusionAttribution - FusionConversationScope = rpc.FusionConversationScope - 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 - FusionTurnKind = rpc.FusionTurnKind - GitHubRepoRef = rpc.GitHubRepoRef - HandoffRepository = rpc.HandoffRepository - HandoffSourceType = rpc.HandoffSourceType - HeaderEntry = rpc.HeaderEntry - HookEndData = rpc.HookEndData - HookEndError = rpc.HookEndError - HookProgressData = rpc.HookProgressData - HookStartData = rpc.HookStartData - ManagedSettingsEnforcedAction = rpc.ManagedSettingsEnforcedAction - ManagedSettingsEnforcedEscalation = rpc.ManagedSettingsEnforcedEscalation - ManagedSettingsResolvedSource = rpc.ManagedSettingsResolvedSource - MCPAppToolCallCompleteData = rpc.MCPAppToolCallCompleteData - MCPAppToolCallCompleteError = rpc.MCPAppToolCallCompleteError - MCPAppToolCallCompleteToolMeta = rpc.MCPAppToolCallCompleteToolMeta - MCPAppToolCallCompleteToolMetaUI = rpc.MCPAppToolCallCompleteToolMetaUI - MCPHeadersRefreshCompletedData = rpc.MCPHeadersRefreshCompletedData - MCPHeadersRefreshCompletedOutcome = rpc.MCPHeadersRefreshCompletedOutcome - MCPHeadersRefreshRequiredData = rpc.MCPHeadersRefreshRequiredData - MCPHeadersRefreshRequiredReason = rpc.MCPHeadersRefreshRequiredReason - MCPOauthCompletedData = rpc.MCPOauthCompletedData - MCPOauthCompletionOutcome = rpc.MCPOauthCompletionOutcome - MCPOauthHTTPResponse = rpc.MCPOauthHTTPResponse - MCPOauthRequestReason = rpc.MCPOauthRequestReason - MCPOauthRequiredData = rpc.MCPOauthRequiredData - MCPOauthRequiredStaticClientConfig = rpc.MCPOauthRequiredStaticClientConfig - MCPOauthRequiredStaticClientConfigGrantType = rpc.MCPOauthRequiredStaticClientConfigGrantType - MCPOauthWwwAuthenticateParams = rpc.MCPOauthWwwAuthenticateParams - MCPPromptsListChangedData = rpc.MCPPromptsListChangedData - MCPResourcesListChangedData = rpc.MCPResourcesListChangedData - MCPServerMetadata = rpc.MCPServerMetadata - MCPServersLoadedServer = rpc.MCPServersLoadedServer - MCPServerSource = rpc.MCPServerSource - MCPServerStatus = rpc.MCPServerStatus - MCPServerTransport = rpc.MCPServerTransport - MCPToolsListChangedData = rpc.MCPToolsListChangedData - ModelCallFailureBadRequestKind = rpc.ModelCallFailureBadRequestKind - ModelCallFailureData = rpc.ModelCallFailureData - ModelCallFailureKind = rpc.ModelCallFailureKind - ModelCallFailureRequestFingerprint = rpc.ModelCallFailureRequestFingerprint - ModelCallFailureSource = rpc.ModelCallFailureSource - ModelCallFailureTransport = rpc.ModelCallFailureTransport - ModelCallFinishedData = rpc.ModelCallFinishedData - ModelCallFinishedOutcome = rpc.ModelCallFinishedOutcome - ModelCallStartData = rpc.ModelCallStartData - ModelChangeSource = rpc.ModelChangeSource - OmittedBinaryOmittedReason = rpc.OmittedBinaryOmittedReason - OmittedBinaryResult = rpc.OmittedBinaryResult - OmittedBinaryType = rpc.OmittedBinaryType - PendingMessagesModifiedData = rpc.PendingMessagesModifiedData - PermissionApproved = rpc.PermissionApproved - PermissionApprovedForLocation = rpc.PermissionApprovedForLocation - PermissionApprovedForSession = rpc.PermissionApprovedForSession - PermissionAssistedApproval = rpc.PermissionAssistedApproval - PermissionCancelled = rpc.PermissionCancelled - PermissionCompletedData = rpc.PermissionCompletedData - PermissionDeniedByContentExclusionPolicy = rpc.PermissionDeniedByContentExclusionPolicy - PermissionDeniedByPermissionRequestHook = rpc.PermissionDeniedByPermissionRequestHook - PermissionDeniedByRules = rpc.PermissionDeniedByRules - PermissionDeniedInteractivelyByUser = rpc.PermissionDeniedInteractivelyByUser - PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser = rpc.PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser - PermissionMode = rpc.PermissionMode - PermissionPromptRequest = rpc.PermissionPromptRequest - PermissionPromptRequestCommands = rpc.PermissionPromptRequestCommands - PermissionPromptRequestCustomTool = rpc.PermissionPromptRequestCustomTool - PermissionPromptRequestExtensionEnvAccess = rpc.PermissionPromptRequestExtensionEnvAccess - PermissionPromptRequestExtensionManagement = rpc.PermissionPromptRequestExtensionManagement - PermissionPromptRequestExtensionPermissionAccess = rpc.PermissionPromptRequestExtensionPermissionAccess - PermissionPromptRequestFactory = rpc.PermissionPromptRequestFactory - PermissionPromptRequestHook = rpc.PermissionPromptRequestHook - PermissionPromptRequestKind = rpc.PermissionPromptRequestKind - PermissionPromptRequestMCP = rpc.PermissionPromptRequestMCP - PermissionPromptRequestMemory = rpc.PermissionPromptRequestMemory - PermissionPromptRequestPath = rpc.PermissionPromptRequestPath - PermissionPromptRequestPathAccessKind = rpc.PermissionPromptRequestPathAccessKind - PermissionPromptRequestRead = rpc.PermissionPromptRequestRead - PermissionPromptRequestURL = rpc.PermissionPromptRequestURL - PermissionPromptRequestWrite = rpc.PermissionPromptRequestWrite - PermissionRecommendation = rpc.PermissionRecommendation - PermissionRequest = rpc.PermissionRequest - PermissionRequestCommand = rpc.PermissionRequestCommand - PermissionRequestCustomTool = rpc.PermissionRequestCustomTool - PermissionRequestedData = rpc.PermissionRequestedData - PermissionRequestExtensionEnvAccess = rpc.PermissionRequestExtensionEnvAccess - PermissionRequestExtensionManagement = rpc.PermissionRequestExtensionManagement - PermissionRequestExtensionPermissionAccess = rpc.PermissionRequestExtensionPermissionAccess - PermissionRequestFactory = rpc.PermissionRequestFactory - PermissionRequestHook = rpc.PermissionRequestHook - PermissionRequestKind = rpc.PermissionRequestKind - PermissionRequestMCP = rpc.PermissionRequestMCP - PermissionRequestMemory = rpc.PermissionRequestMemory - PermissionRequestMemoryAction = rpc.PermissionRequestMemoryAction - PermissionRequestMemoryDirection = rpc.PermissionRequestMemoryDirection - PermissionRequestMemoryScope = rpc.PermissionRequestMemoryScope - PermissionRequestRead = rpc.PermissionRequestRead - PermissionRequestShell = rpc.PermissionRequestShell - PermissionRequestShellCommand = rpc.PermissionRequestShellCommand - PermissionRequestShellCommandSegment = rpc.PermissionRequestShellCommandSegment - PermissionRequestShellPossibleURL = rpc.PermissionRequestShellPossibleURL - PermissionRequestURL = rpc.PermissionRequestURL - PermissionRequestWrite = rpc.PermissionRequestWrite - PermissionResult = rpc.PermissionResult - PermissionResultKind = rpc.PermissionResultKind - PermissionRule = rpc.PermissionRule - PersistedBinaryImage = rpc.PersistedBinaryImage - PersistedBinaryImageType = rpc.PersistedBinaryImageType - PersistedBinaryResult = rpc.PersistedBinaryResult - PersistedBinaryResultType = rpc.PersistedBinaryResultType - PlanChangedOperation = rpc.PlanChangedOperation - PossibleURL = rpc.PossibleURL - PromptCacheBreakData = rpc.PromptCacheBreakData - RawCitationLocation = rpc.RawCitationLocation - RawPermissionPromptRequest = rpc.RawPermissionPromptRequest - RawPermissionRequest = rpc.RawPermissionRequest - RawPermissionResult = rpc.RawPermissionResult - RawPersistedBinaryResult = rpc.RawPersistedBinaryResult - RawSessionEventData = rpc.RawSessionEventData - RawSystemNotification = rpc.RawSystemNotification - RawSystemNotificationFactoryPauseInfo = rpc.RawSystemNotificationFactoryPauseInfo - RawToolExecutionCompleteContent = rpc.RawToolExecutionCompleteContent - ReasoningSummary = rpc.ReasoningSummary - RecommendedAutoTier = rpc.RecommendedAutoTier - RemediationAction = rpc.RemediationAction - SamplingCompletedData = rpc.SamplingCompletedData - SamplingRequestedData = rpc.SamplingRequestedData - SandboxDecisionData = rpc.SandboxDecisionData - ScheduleOrigin = rpc.ScheduleOrigin - SessionAutoModeResolvedData = rpc.SessionAutoModeResolvedData - SessionAutopilotObjectiveChangedData = rpc.SessionAutopilotObjectiveChangedData - SessionAutoTierRecommendationData = rpc.SessionAutoTierRecommendationData - SessionAutoTierSwitchFailedData = rpc.SessionAutoTierSwitchFailedData - SessionBackgroundTasksChangedData = rpc.SessionBackgroundTasksChangedData - SessionBinaryAssetData = rpc.SessionBinaryAssetData - SessionCanvasClosedData = rpc.SessionCanvasClosedData - SessionCanvasOpenedData = rpc.SessionCanvasOpenedData - SessionCanvasRecordedData = rpc.SessionCanvasRecordedData - SessionCanvasRegistryChangedData = rpc.SessionCanvasRegistryChangedData - SessionCanvasRemovedData = rpc.SessionCanvasRemovedData - SessionCanvasUnavailableData = rpc.SessionCanvasUnavailableData - SessionCompactionCompleteData = rpc.SessionCompactionCompleteData - SessionCompactionStartData = rpc.SessionCompactionStartData - SessionCompletionReceiptData = rpc.SessionCompletionReceiptData - SessionContextChangedData = rpc.SessionContextChangedData - SessionContextClearedData = rpc.SessionContextClearedData - SessionCustomAgentsUpdatedData = rpc.SessionCustomAgentsUpdatedData - SessionCustomNotificationData = rpc.SessionCustomNotificationData - SessionErrorData = rpc.SessionErrorData - SessionEvent = rpc.SessionEvent - SessionEventData = rpc.SessionEventData - SessionEventType = rpc.SessionEventType - SessionExtensionsAttachmentsPushedData = rpc.SessionExtensionsAttachmentsPushedData - SessionExtensionsLoadedData = rpc.SessionExtensionsLoadedData - SessionFusionCompletedData = rpc.SessionFusionCompletedData - SessionFusionResolvedData = rpc.SessionFusionResolvedData - SessionFusionRouteFailedData = rpc.SessionFusionRouteFailedData - SessionFusionRouteStartedData = rpc.SessionFusionRouteStartedData - SessionHandoffData = rpc.SessionHandoffData - SessionIdleData = rpc.SessionIdleData - SessionInfoData = rpc.SessionInfoData - SessionLimitsConfig = rpc.SessionLimitsConfig - SessionLimitsExhaustedCompletedData = rpc.SessionLimitsExhaustedCompletedData - SessionLimitsExhaustedRequestedData = rpc.SessionLimitsExhaustedRequestedData - SessionLimitsExhaustedResponse = rpc.SessionLimitsExhaustedResponse - SessionLimitsExhaustedResponseAction = rpc.SessionLimitsExhaustedResponseAction - SessionManagedSettingsEnforcedData = rpc.SessionManagedSettingsEnforcedData - SessionManagedSettingsResolvedData = rpc.SessionManagedSettingsResolvedData - SessionMCPServerNeedsReconnectData = rpc.SessionMCPServerNeedsReconnectData - SessionMCPServerRemovedData = rpc.SessionMCPServerRemovedData - SessionMCPServersLoadedData = rpc.SessionMCPServersLoadedData - SessionMCPServerStatusChangedData = rpc.SessionMCPServerStatusChangedData - SessionMode = rpc.SessionMode - SessionModeChangedData = rpc.SessionModeChangedData - SessionModelChangeData = rpc.SessionModelChangeData - SessionModeNoticeDeliveredData = rpc.SessionModeNoticeDeliveredData - SessionPermissionsChangedData = rpc.SessionPermissionsChangedData - SessionPlanChangedData = rpc.SessionPlanChangedData - SessionRemoteSteerableChangedData = rpc.SessionRemoteSteerableChangedData - SessionResumeData = rpc.SessionResumeData - SessionScheduleCancelledData = rpc.SessionScheduleCancelledData - SessionScheduleCreatedData = rpc.SessionScheduleCreatedData - SessionScheduleRearmedData = rpc.SessionScheduleRearmedData - SessionSessionLimitsChangedData = rpc.SessionSessionLimitsChangedData - SessionShutdownData = rpc.SessionShutdownData - SessionSkillsLoadedData = rpc.SessionSkillsLoadedData - SessionSnapshotRewindData = rpc.SessionSnapshotRewindData - SessionStartData = rpc.SessionStartData - SessionTaskCompleteData = rpc.SessionTaskCompleteData - SessionTitleChangedData = rpc.SessionTitleChangedData - SessionTodosChangedData = rpc.SessionTodosChangedData - SessionToolsUpdatedData = rpc.SessionToolsUpdatedData - SessionTruncationData = rpc.SessionTruncationData - SessionUsageCheckpointData = rpc.SessionUsageCheckpointData - SessionUsageInfoData = rpc.SessionUsageInfoData - SessionWarningData = rpc.SessionWarningData - SessionWorkspaceFileChangedData = rpc.SessionWorkspaceFileChangedData - ShutdownAgentMetric = rpc.ShutdownAgentMetric - ShutdownCodeChanges = rpc.ShutdownCodeChanges - ShutdownModelMetric = rpc.ShutdownModelMetric - ShutdownModelMetricRequests = rpc.ShutdownModelMetricRequests - ShutdownModelMetricTokenDetail = rpc.ShutdownModelMetricTokenDetail - ShutdownModelMetricUsage = rpc.ShutdownModelMetricUsage - ShutdownTokenDetail = rpc.ShutdownTokenDetail - ShutdownType = rpc.ShutdownType - SkillInvokedData = rpc.SkillInvokedData - SkillInvokedTrigger = rpc.SkillInvokedTrigger - SkillsLoadedSkill = rpc.SkillsLoadedSkill - SkillSource = rpc.SkillSource - SubagentCompletedData = rpc.SubagentCompletedData - SubagentConfiguredData = rpc.SubagentConfiguredData - SubagentDeselectedData = rpc.SubagentDeselectedData - SubagentFailedData = rpc.SubagentFailedData - SubagentModelSelectionSource = rpc.SubagentModelSelectionSource - SubagentSelectedData = rpc.SubagentSelectedData - SubagentStartedData = rpc.SubagentStartedData - SubagentTaskModelSource = rpc.SubagentTaskModelSource - SystemMessageData = rpc.SystemMessageData - SystemMessageMetadata = rpc.SystemMessageMetadata - SystemMessageRole = rpc.SystemMessageRole - SystemNotification = rpc.SystemNotification - SystemNotificationAgentCompleted = rpc.SystemNotificationAgentCompleted - SystemNotificationAgentCompletedStatus = rpc.SystemNotificationAgentCompletedStatus - SystemNotificationAgentIdle = rpc.SystemNotificationAgentIdle - SystemNotificationData = rpc.SystemNotificationData - SystemNotificationFactoryCompleted = rpc.SystemNotificationFactoryCompleted - SystemNotificationFactoryCompletedStatus = rpc.SystemNotificationFactoryCompletedStatus - SystemNotificationFactoryPauseInfo = rpc.SystemNotificationFactoryPauseInfo - SystemNotificationFactoryPauseInfoCheckpoint = rpc.SystemNotificationFactoryPauseInfoCheckpoint - SystemNotificationFactoryPauseInfoType = rpc.SystemNotificationFactoryPauseInfoType - SystemNotificationFactoryPauseInfoUser = rpc.SystemNotificationFactoryPauseInfoUser - SystemNotificationInstructionDiscovered = rpc.SystemNotificationInstructionDiscovered - SystemNotificationNewInboxMessage = rpc.SystemNotificationNewInboxMessage - SystemNotificationShellCompleted = rpc.SystemNotificationShellCompleted - SystemNotificationShellDetachedCompleted = rpc.SystemNotificationShellDetachedCompleted - SystemNotificationType = rpc.SystemNotificationType - SystemNotificationUnclassified = rpc.SystemNotificationUnclassified - TaskCompleteData = rpc.TaskCompleteData - TaskCompletionOutcome = rpc.TaskCompletionOutcome - ToolExecutionCompleteContent = rpc.ToolExecutionCompleteContent - ToolExecutionCompleteContentAudio = rpc.ToolExecutionCompleteContentAudio - ToolExecutionCompleteContentImage = rpc.ToolExecutionCompleteContentImage - ToolExecutionCompleteContentResource = rpc.ToolExecutionCompleteContentResource - ToolExecutionCompleteContentResourceDetails = rpc.ToolExecutionCompleteContentResourceDetails - ToolExecutionCompleteContentResourceLink = rpc.ToolExecutionCompleteContentResourceLink - ToolExecutionCompleteContentResourceLinkIcon = rpc.ToolExecutionCompleteContentResourceLinkIcon - ToolExecutionCompleteContentResourceLinkIconTheme = rpc.ToolExecutionCompleteContentResourceLinkIconTheme - ToolExecutionCompleteContentShellExit = rpc.ToolExecutionCompleteContentShellExit - ToolExecutionCompleteContentTerminal = rpc.ToolExecutionCompleteContentTerminal - ToolExecutionCompleteContentText = rpc.ToolExecutionCompleteContentText - ToolExecutionCompleteContentType = rpc.ToolExecutionCompleteContentType - ToolExecutionCompleteData = rpc.ToolExecutionCompleteData - ToolExecutionCompleteError = rpc.ToolExecutionCompleteError - ToolExecutionCompleteResult = rpc.ToolExecutionCompleteResult - ToolExecutionCompleteToolDescription = rpc.ToolExecutionCompleteToolDescription - ToolExecutionCompleteToolDescriptionMeta = rpc.ToolExecutionCompleteToolDescriptionMeta - ToolExecutionCompleteToolDescriptionMetaUI = rpc.ToolExecutionCompleteToolDescriptionMetaUI - ToolExecutionCompleteToolDescriptionMetaUIVisibility = rpc.ToolExecutionCompleteToolDescriptionMetaUIVisibility - ToolExecutionCompleteUIResource = rpc.ToolExecutionCompleteUIResource - ToolExecutionCompleteUIResourceMeta = rpc.ToolExecutionCompleteUIResourceMeta - ToolExecutionCompleteUIResourceMetaUI = rpc.ToolExecutionCompleteUIResourceMetaUI - ToolExecutionCompleteUIResourceMetaUICsp = rpc.ToolExecutionCompleteUIResourceMetaUICsp - ToolExecutionCompleteUIResourceMetaUIPermissions = rpc.ToolExecutionCompleteUIResourceMetaUIPermissions - ToolExecutionCompleteUIResourceMetaUIPermissionsCamera = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsCamera + AbortData = rpc.AbortData + AbortReason = rpc.AbortReason + AgentInterruptedActivity = rpc.AgentInterruptedActivity + AgentInterruptedCancelPhase = rpc.AgentInterruptedCancelPhase + AgentInterruptedData = rpc.AgentInterruptedData + AgentModelPolicy = rpc.AgentModelPolicy + AssistantFusionPhaseActivityData = rpc.AssistantFusionPhaseActivityData + AssistantFusionPhaseCompletedData = rpc.AssistantFusionPhaseCompletedData + AssistantFusionPhaseFailedData = rpc.AssistantFusionPhaseFailedData + AssistantFusionPhaseStartedData = rpc.AssistantFusionPhaseStartedData + AssistantIdleData = rpc.AssistantIdleData + AssistantIntentData = rpc.AssistantIntentData + AssistantMessageData = rpc.AssistantMessageData + AssistantMessageDeltaData = rpc.AssistantMessageDeltaData + AssistantMessageReasoningBlocks = rpc.AssistantMessageReasoningBlocks + AssistantMessageServerTools = rpc.AssistantMessageServerTools + AssistantMessageStartData = rpc.AssistantMessageStartData + AssistantMessageToolRequest = rpc.AssistantMessageToolRequest + AssistantMessageToolRequestCaller = rpc.AssistantMessageToolRequestCaller + AssistantMessageToolRequestCallerType = rpc.AssistantMessageToolRequestCallerType + AssistantMessageToolRequestType = rpc.AssistantMessageToolRequestType + AssistantReasoningData = rpc.AssistantReasoningData + AssistantReasoningDeltaData = rpc.AssistantReasoningDeltaData + AssistantServerToolProgressData = rpc.AssistantServerToolProgressData + AssistantStreamingDeltaData = rpc.AssistantStreamingDeltaData + AssistantToolCallDeltaData = rpc.AssistantToolCallDeltaData + AssistantTurnEndData = rpc.AssistantTurnEndData + AssistantTurnRetryData = rpc.AssistantTurnRetryData + AssistantTurnStartData = rpc.AssistantTurnStartData + AssistantUsageAPIEndpoint = rpc.AssistantUsageAPIEndpoint + AssistantUsageCopilotUsage = rpc.AssistantUsageCopilotUsage + AssistantUsageCopilotUsageTokenDetail = rpc.AssistantUsageCopilotUsageTokenDetail + AssistantUsageData = rpc.AssistantUsageData + AssistantUsageTransport = rpc.AssistantUsageTransport + AssistedApprovalJudgeFailureReason = rpc.AssistedApprovalJudgeFailureReason + AssistedApprovalRecommendation = rpc.AssistedApprovalRecommendation + Attachment = rpc.Attachment + AttachmentBlob = rpc.AttachmentBlob + AttachmentDirectory = rpc.AttachmentDirectory + AttachmentExtensionContext = rpc.AttachmentExtensionContext + AttachmentFile = rpc.AttachmentFile + AttachmentFileLineRange = rpc.AttachmentFileLineRange + AttachmentGitHubActionsJob = rpc.AttachmentGitHubActionsJob + AttachmentGitHubCommit = rpc.AttachmentGitHubCommit + AttachmentGitHubFile = rpc.AttachmentGitHubFile + AttachmentGitHubFileDiff = rpc.AttachmentGitHubFileDiff + AttachmentGitHubFileDiffSide = rpc.AttachmentGitHubFileDiffSide + AttachmentGitHubReference = rpc.AttachmentGitHubReference + AttachmentGitHubReferenceType = rpc.AttachmentGitHubReferenceType + AttachmentGitHubRelease = rpc.AttachmentGitHubRelease + AttachmentGitHubRepository = rpc.AttachmentGitHubRepository + AttachmentGitHubSnippet = rpc.AttachmentGitHubSnippet + AttachmentGitHubTreeComparison = rpc.AttachmentGitHubTreeComparison + AttachmentGitHubTreeComparisonSide = rpc.AttachmentGitHubTreeComparisonSide + AttachmentGitHubURL = rpc.AttachmentGitHubURL + AttachmentSelection = rpc.AttachmentSelection + AttachmentSelectionDetails = rpc.AttachmentSelectionDetails + AttachmentSelectionDetailsEnd = rpc.AttachmentSelectionDetailsEnd + AttachmentSelectionDetailsStart = rpc.AttachmentSelectionDetailsStart + AttachmentType = rpc.AttachmentType + AutoModeResolvedReasoningBucket = rpc.AutoModeResolvedReasoningBucket + AutoModeSwitchCompletedData = rpc.AutoModeSwitchCompletedData + AutoModeSwitchRequestedData = rpc.AutoModeSwitchRequestedData + AutoModeSwitchResponse = rpc.AutoModeSwitchResponse + AutopilotObjectiveChangedOperation = rpc.AutopilotObjectiveChangedOperation + AutopilotObjectiveChangedStatus = rpc.AutopilotObjectiveChangedStatus + AutoTierSwitchFailureReason = rpc.AutoTierSwitchFailureReason + BinaryAssetReference = rpc.BinaryAssetReference + BinaryAssetReferenceType = rpc.BinaryAssetReferenceType + BinaryAssetType = rpc.BinaryAssetType + CanvasRegistryChangedCanvas = rpc.CanvasRegistryChangedCanvas + CanvasRegistryChangedCanvasAction = rpc.CanvasRegistryChangedCanvasAction + CapabilitiesChangedData = rpc.CapabilitiesChangedData + CapabilitiesChangedUI = rpc.CapabilitiesChangedUI + CitableSource = rpc.CitableSource + CitationLocation = rpc.CitationLocation + CitationLocationBlock = rpc.CitationLocationBlock + CitationLocationChar = rpc.CitationLocationChar + CitationLocationPage = rpc.CitationLocationPage + CitationLocationType = rpc.CitationLocationType + CitationProvider = rpc.CitationProvider + CitationReference = rpc.CitationReference + Citations = rpc.Citations + CitationSource = rpc.CitationSource + CitationSpan = rpc.CitationSpan + CommandCompletedData = rpc.CommandCompletedData + CommandExecuteData = rpc.CommandExecuteData + CommandQueuedData = rpc.CommandQueuedData + CommandsChangedCommand = rpc.CommandsChangedCommand + CommandsChangedData = rpc.CommandsChangedData + 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 + ElicitationCompletedData = rpc.ElicitationCompletedData + ElicitationRequestedData = rpc.ElicitationRequestedData + ElicitationRequestedMode = rpc.ElicitationRequestedMode + ElicitationRequestedSchema = rpc.ElicitationRequestedSchema + ElicitationRequestedSchemaType = rpc.ElicitationRequestedSchemaType + EmbeddedBlobResourceContents = rpc.EmbeddedBlobResourceContents + EmbeddedTextResourceContents = rpc.EmbeddedTextResourceContents + ExitPlanModeAction = rpc.ExitPlanModeAction + ExitPlanModeCompletedData = rpc.ExitPlanModeCompletedData + ExitPlanModeRequestedData = rpc.ExitPlanModeRequestedData + ExtensionsLoadedExtension = rpc.ExtensionsLoadedExtension + ExtensionsLoadedExtensionSource = rpc.ExtensionsLoadedExtensionSource + ExtensionsLoadedExtensionStatus = rpc.ExtensionsLoadedExtensionStatus + ExternalToolCompletedData = rpc.ExternalToolCompletedData + ExternalToolRequestedData = rpc.ExternalToolRequestedData + FactoryPermissionOperation = rpc.FactoryPermissionOperation + FactoryPermissionPhase = rpc.FactoryPermissionPhase + FactoryRunSettledData = rpc.FactoryRunSettledData + FactoryRunSettledStatus = rpc.FactoryRunSettledStatus + FactoryRunStartedData = rpc.FactoryRunStartedData + FactoryRunUpdatedData = rpc.FactoryRunUpdatedData + FusionAttribution = rpc.FusionAttribution + FusionConversationScope = rpc.FusionConversationScope + 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 + FusionTurnKind = rpc.FusionTurnKind + GitHubRepoRef = rpc.GitHubRepoRef + HandoffRepository = rpc.HandoffRepository + HandoffSourceType = rpc.HandoffSourceType + HeaderEntry = rpc.HeaderEntry + HookEndData = rpc.HookEndData + HookEndError = rpc.HookEndError + HookProgressData = rpc.HookProgressData + HookStartData = rpc.HookStartData + ManagedSettingsEnforcedAction = rpc.ManagedSettingsEnforcedAction + ManagedSettingsEnforcedEscalation = rpc.ManagedSettingsEnforcedEscalation + ManagedSettingsResolvedSource = rpc.ManagedSettingsResolvedSource + MCPAppToolCallCompleteData = rpc.MCPAppToolCallCompleteData + MCPAppToolCallCompleteError = rpc.MCPAppToolCallCompleteError + MCPAppToolCallCompleteToolMeta = rpc.MCPAppToolCallCompleteToolMeta + MCPAppToolCallCompleteToolMetaUI = rpc.MCPAppToolCallCompleteToolMetaUI + MCPHeadersRefreshCompletedData = rpc.MCPHeadersRefreshCompletedData + MCPHeadersRefreshCompletedOutcome = rpc.MCPHeadersRefreshCompletedOutcome + MCPHeadersRefreshRequiredData = rpc.MCPHeadersRefreshRequiredData + MCPHeadersRefreshRequiredReason = rpc.MCPHeadersRefreshRequiredReason + MCPOauthCompletedData = rpc.MCPOauthCompletedData + MCPOauthCompletionOutcome = rpc.MCPOauthCompletionOutcome + MCPOauthHTTPResponse = rpc.MCPOauthHTTPResponse + MCPOauthRequestReason = rpc.MCPOauthRequestReason + MCPOauthRequiredData = rpc.MCPOauthRequiredData + MCPOauthRequiredStaticClientConfig = rpc.MCPOauthRequiredStaticClientConfig + MCPOauthRequiredStaticClientConfigGrantType = rpc.MCPOauthRequiredStaticClientConfigGrantType + MCPOauthWwwAuthenticateParams = rpc.MCPOauthWwwAuthenticateParams + MCPPromptsListChangedData = rpc.MCPPromptsListChangedData + MCPResourcesListChangedData = rpc.MCPResourcesListChangedData + MCPServerMetadata = rpc.MCPServerMetadata + MCPServersLoadedServer = rpc.MCPServersLoadedServer + MCPServerSource = rpc.MCPServerSource + MCPServerStatus = rpc.MCPServerStatus + MCPServerTransport = rpc.MCPServerTransport + MCPToolsListChangedData = rpc.MCPToolsListChangedData + ModelCallFailureBadRequestKind = rpc.ModelCallFailureBadRequestKind + ModelCallFailureData = rpc.ModelCallFailureData + ModelCallFailureKind = rpc.ModelCallFailureKind + ModelCallFailureRequestFingerprint = rpc.ModelCallFailureRequestFingerprint + ModelCallFailureSource = rpc.ModelCallFailureSource + ModelCallFailureTransport = rpc.ModelCallFailureTransport + ModelCallFinishedData = rpc.ModelCallFinishedData + ModelCallFinishedOutcome = rpc.ModelCallFinishedOutcome + ModelCallStartData = rpc.ModelCallStartData + ModelChangeSource = rpc.ModelChangeSource + OmittedBinaryOmittedReason = rpc.OmittedBinaryOmittedReason + OmittedBinaryResult = rpc.OmittedBinaryResult + OmittedBinaryType = rpc.OmittedBinaryType + PendingMessagesModifiedData = rpc.PendingMessagesModifiedData + PermissionApproved = rpc.PermissionApproved + PermissionApprovedForLocation = rpc.PermissionApprovedForLocation + PermissionApprovedForSession = rpc.PermissionApprovedForSession + PermissionAssistedApproval = rpc.PermissionAssistedApproval + PermissionCancelled = rpc.PermissionCancelled + PermissionCarriedForwardData = rpc.PermissionCarriedForwardData + PermissionCompletedData = rpc.PermissionCompletedData + PermissionDeniedByContentExclusionPolicy = rpc.PermissionDeniedByContentExclusionPolicy + PermissionDeniedByPermissionRequestHook = rpc.PermissionDeniedByPermissionRequestHook + PermissionDeniedByRules = rpc.PermissionDeniedByRules + PermissionDeniedInteractivelyByUser = rpc.PermissionDeniedInteractivelyByUser + PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser = rpc.PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser + PermissionMessageAuthorizationData = rpc.PermissionMessageAuthorizationData + PermissionMessageAuthorizationDegradedData = rpc.PermissionMessageAuthorizationDegradedData + PermissionMessageAuthorizationPolarity = rpc.PermissionMessageAuthorizationPolarity + PermissionMessageAuthorizationReadData = rpc.PermissionMessageAuthorizationReadData + PermissionMode = rpc.PermissionMode + PermissionPromptRequest = rpc.PermissionPromptRequest + PermissionPromptRequestCommands = rpc.PermissionPromptRequestCommands + PermissionPromptRequestCustomTool = rpc.PermissionPromptRequestCustomTool + PermissionPromptRequestExtensionEnvAccess = rpc.PermissionPromptRequestExtensionEnvAccess + PermissionPromptRequestExtensionManagement = rpc.PermissionPromptRequestExtensionManagement + PermissionPromptRequestExtensionPermissionAccess = rpc.PermissionPromptRequestExtensionPermissionAccess + PermissionPromptRequestFactory = rpc.PermissionPromptRequestFactory + PermissionPromptRequestHook = rpc.PermissionPromptRequestHook + PermissionPromptRequestKind = rpc.PermissionPromptRequestKind + PermissionPromptRequestMCP = rpc.PermissionPromptRequestMCP + PermissionPromptRequestMemory = rpc.PermissionPromptRequestMemory + PermissionPromptRequestPath = rpc.PermissionPromptRequestPath + PermissionPromptRequestPathAccessKind = rpc.PermissionPromptRequestPathAccessKind + PermissionPromptRequestRead = rpc.PermissionPromptRequestRead + PermissionPromptRequestURL = rpc.PermissionPromptRequestURL + PermissionPromptRequestWrite = rpc.PermissionPromptRequestWrite + PermissionRecommendation = rpc.PermissionRecommendation + PermissionRequest = rpc.PermissionRequest + PermissionRequestCommand = rpc.PermissionRequestCommand + PermissionRequestCustomTool = rpc.PermissionRequestCustomTool + PermissionRequestedData = rpc.PermissionRequestedData + PermissionRequestExtensionEnvAccess = rpc.PermissionRequestExtensionEnvAccess + PermissionRequestExtensionManagement = rpc.PermissionRequestExtensionManagement + PermissionRequestExtensionPermissionAccess = rpc.PermissionRequestExtensionPermissionAccess + PermissionRequestFactory = rpc.PermissionRequestFactory + PermissionRequestHook = rpc.PermissionRequestHook + PermissionRequestKind = rpc.PermissionRequestKind + PermissionRequestMCP = rpc.PermissionRequestMCP + PermissionRequestMemory = rpc.PermissionRequestMemory + PermissionRequestMemoryAction = rpc.PermissionRequestMemoryAction + PermissionRequestMemoryDirection = rpc.PermissionRequestMemoryDirection + PermissionRequestMemoryScope = rpc.PermissionRequestMemoryScope + PermissionRequestRead = rpc.PermissionRequestRead + PermissionRequestShell = rpc.PermissionRequestShell + PermissionRequestShellCommand = rpc.PermissionRequestShellCommand + PermissionRequestShellCommandSegment = rpc.PermissionRequestShellCommandSegment + PermissionRequestShellPossibleURL = rpc.PermissionRequestShellPossibleURL + PermissionRequestURL = rpc.PermissionRequestURL + PermissionRequestWrite = rpc.PermissionRequestWrite + PermissionResult = rpc.PermissionResult + PermissionResultKind = rpc.PermissionResultKind + PermissionRule = rpc.PermissionRule + PersistedBinaryImage = rpc.PersistedBinaryImage + PersistedBinaryImageType = rpc.PersistedBinaryImageType + PersistedBinaryResult = rpc.PersistedBinaryResult + PersistedBinaryResultType = rpc.PersistedBinaryResultType + PlanChangedOperation = rpc.PlanChangedOperation + PossibleURL = rpc.PossibleURL + PromptCacheBreakData = rpc.PromptCacheBreakData + RawCitationLocation = rpc.RawCitationLocation + RawPermissionPromptRequest = rpc.RawPermissionPromptRequest + RawPermissionRequest = rpc.RawPermissionRequest + RawPermissionResult = rpc.RawPermissionResult + RawPersistedBinaryResult = rpc.RawPersistedBinaryResult + RawSessionEventData = rpc.RawSessionEventData + RawSystemNotification = rpc.RawSystemNotification + RawSystemNotificationFactoryPauseInfo = rpc.RawSystemNotificationFactoryPauseInfo + RawToolExecutionCompleteContent = rpc.RawToolExecutionCompleteContent + ReasoningSummary = rpc.ReasoningSummary + RecommendedAutoTier = rpc.RecommendedAutoTier + RemediationAction = rpc.RemediationAction + SamplingCompletedData = rpc.SamplingCompletedData + SamplingRequestedData = rpc.SamplingRequestedData + SandboxDecisionData = rpc.SandboxDecisionData + ScheduleOrigin = rpc.ScheduleOrigin + SessionAutoModeResolvedData = rpc.SessionAutoModeResolvedData + SessionAutopilotObjectiveChangedData = rpc.SessionAutopilotObjectiveChangedData + SessionAutoTierRecommendationData = rpc.SessionAutoTierRecommendationData + SessionAutoTierSwitchFailedData = rpc.SessionAutoTierSwitchFailedData + SessionBackgroundTasksChangedData = rpc.SessionBackgroundTasksChangedData + SessionBinaryAssetData = rpc.SessionBinaryAssetData + SessionCanvasClosedData = rpc.SessionCanvasClosedData + SessionCanvasOpenedData = rpc.SessionCanvasOpenedData + SessionCanvasRecordedData = rpc.SessionCanvasRecordedData + SessionCanvasRegistryChangedData = rpc.SessionCanvasRegistryChangedData + SessionCanvasRemovedData = rpc.SessionCanvasRemovedData + SessionCanvasUnavailableData = rpc.SessionCanvasUnavailableData + SessionCompactionCompleteData = rpc.SessionCompactionCompleteData + SessionCompactionStartData = rpc.SessionCompactionStartData + SessionCompletionReceiptData = rpc.SessionCompletionReceiptData + SessionContextChangedData = rpc.SessionContextChangedData + SessionContextClearedData = rpc.SessionContextClearedData + SessionCustomAgentsUpdatedData = rpc.SessionCustomAgentsUpdatedData + SessionCustomNotificationData = rpc.SessionCustomNotificationData + SessionErrorData = rpc.SessionErrorData + SessionEvent = rpc.SessionEvent + SessionEventData = rpc.SessionEventData + SessionEventType = rpc.SessionEventType + SessionExtensionsAttachmentsPushedData = rpc.SessionExtensionsAttachmentsPushedData + SessionExtensionsLoadedData = rpc.SessionExtensionsLoadedData + SessionFusionCompletedData = rpc.SessionFusionCompletedData + SessionFusionResolvedData = rpc.SessionFusionResolvedData + SessionFusionRouteFailedData = rpc.SessionFusionRouteFailedData + SessionFusionRouteStartedData = rpc.SessionFusionRouteStartedData + SessionHandoffData = rpc.SessionHandoffData + SessionIdleData = rpc.SessionIdleData + SessionInfoData = rpc.SessionInfoData + SessionLimitsConfig = rpc.SessionLimitsConfig + SessionLimitsExhaustedCompletedData = rpc.SessionLimitsExhaustedCompletedData + SessionLimitsExhaustedRequestedData = rpc.SessionLimitsExhaustedRequestedData + SessionLimitsExhaustedResponse = rpc.SessionLimitsExhaustedResponse + SessionLimitsExhaustedResponseAction = rpc.SessionLimitsExhaustedResponseAction + SessionManagedSettingsEnforcedData = rpc.SessionManagedSettingsEnforcedData + SessionManagedSettingsResolvedData = rpc.SessionManagedSettingsResolvedData + SessionMCPServerNeedsReconnectData = rpc.SessionMCPServerNeedsReconnectData + SessionMCPServerRemovedData = rpc.SessionMCPServerRemovedData + SessionMCPServersLoadedData = rpc.SessionMCPServersLoadedData + SessionMCPServerStatusChangedData = rpc.SessionMCPServerStatusChangedData + SessionMode = rpc.SessionMode + SessionModeChangedData = rpc.SessionModeChangedData + SessionModelChangeData = rpc.SessionModelChangeData + SessionModeNoticeDeliveredData = rpc.SessionModeNoticeDeliveredData + SessionPermissionsChangedData = rpc.SessionPermissionsChangedData + SessionPlanChangedData = rpc.SessionPlanChangedData + SessionRemoteSteerableChangedData = rpc.SessionRemoteSteerableChangedData + SessionResumeData = rpc.SessionResumeData + SessionScheduleCancelledData = rpc.SessionScheduleCancelledData + SessionScheduleCreatedData = rpc.SessionScheduleCreatedData + SessionScheduleRearmedData = rpc.SessionScheduleRearmedData + SessionSessionLimitsChangedData = rpc.SessionSessionLimitsChangedData + SessionShutdownData = rpc.SessionShutdownData + SessionSkillsLoadedData = rpc.SessionSkillsLoadedData + SessionSnapshotRewindData = rpc.SessionSnapshotRewindData + SessionStartData = rpc.SessionStartData + SessionTaskCompleteData = rpc.SessionTaskCompleteData + SessionTitleChangedData = rpc.SessionTitleChangedData + SessionTodosChangedData = rpc.SessionTodosChangedData + SessionToolsUpdatedData = rpc.SessionToolsUpdatedData + SessionTruncationData = rpc.SessionTruncationData + SessionUsageCheckpointData = rpc.SessionUsageCheckpointData + SessionUsageInfoData = rpc.SessionUsageInfoData + SessionWarningData = rpc.SessionWarningData + SessionWorkspaceFileChangedData = rpc.SessionWorkspaceFileChangedData + ShutdownAgentMetric = rpc.ShutdownAgentMetric + ShutdownCodeChanges = rpc.ShutdownCodeChanges + ShutdownModelMetric = rpc.ShutdownModelMetric + ShutdownModelMetricRequests = rpc.ShutdownModelMetricRequests + ShutdownModelMetricTokenDetail = rpc.ShutdownModelMetricTokenDetail + ShutdownModelMetricUsage = rpc.ShutdownModelMetricUsage + ShutdownTokenDetail = rpc.ShutdownTokenDetail + ShutdownType = rpc.ShutdownType + SkillInvokedData = rpc.SkillInvokedData + SkillInvokedTrigger = rpc.SkillInvokedTrigger + SkillsLoadedSkill = rpc.SkillsLoadedSkill + SkillSource = rpc.SkillSource + SubagentCompletedData = rpc.SubagentCompletedData + SubagentConfiguredData = rpc.SubagentConfiguredData + SubagentDeselectedData = rpc.SubagentDeselectedData + SubagentFailedData = rpc.SubagentFailedData + SubagentModelSelectionSource = rpc.SubagentModelSelectionSource + SubagentSelectedData = rpc.SubagentSelectedData + SubagentStartedData = rpc.SubagentStartedData + SubagentTaskModelSource = rpc.SubagentTaskModelSource + SystemMessageData = rpc.SystemMessageData + SystemMessageMetadata = rpc.SystemMessageMetadata + SystemMessageRole = rpc.SystemMessageRole + SystemNotification = rpc.SystemNotification + SystemNotificationAgentCompleted = rpc.SystemNotificationAgentCompleted + SystemNotificationAgentCompletedStatus = rpc.SystemNotificationAgentCompletedStatus + SystemNotificationAgentIdle = rpc.SystemNotificationAgentIdle + SystemNotificationData = rpc.SystemNotificationData + SystemNotificationFactoryCompleted = rpc.SystemNotificationFactoryCompleted + SystemNotificationFactoryCompletedStatus = rpc.SystemNotificationFactoryCompletedStatus + SystemNotificationFactoryPauseInfo = rpc.SystemNotificationFactoryPauseInfo + SystemNotificationFactoryPauseInfoCheckpoint = rpc.SystemNotificationFactoryPauseInfoCheckpoint + SystemNotificationFactoryPauseInfoType = rpc.SystemNotificationFactoryPauseInfoType + SystemNotificationFactoryPauseInfoUser = rpc.SystemNotificationFactoryPauseInfoUser + SystemNotificationInstructionDiscovered = rpc.SystemNotificationInstructionDiscovered + SystemNotificationNewInboxMessage = rpc.SystemNotificationNewInboxMessage + SystemNotificationShellCompleted = rpc.SystemNotificationShellCompleted + SystemNotificationShellDetachedCompleted = rpc.SystemNotificationShellDetachedCompleted + SystemNotificationType = rpc.SystemNotificationType + SystemNotificationUnclassified = rpc.SystemNotificationUnclassified + TaskCompleteData = rpc.TaskCompleteData + TaskCompletionOutcome = rpc.TaskCompletionOutcome + ToolExecutionCompleteContent = rpc.ToolExecutionCompleteContent + ToolExecutionCompleteContentAudio = rpc.ToolExecutionCompleteContentAudio + ToolExecutionCompleteContentImage = rpc.ToolExecutionCompleteContentImage + ToolExecutionCompleteContentResource = rpc.ToolExecutionCompleteContentResource + ToolExecutionCompleteContentResourceDetails = rpc.ToolExecutionCompleteContentResourceDetails + ToolExecutionCompleteContentResourceLink = rpc.ToolExecutionCompleteContentResourceLink + ToolExecutionCompleteContentResourceLinkIcon = rpc.ToolExecutionCompleteContentResourceLinkIcon + ToolExecutionCompleteContentResourceLinkIconTheme = rpc.ToolExecutionCompleteContentResourceLinkIconTheme + ToolExecutionCompleteContentShellExit = rpc.ToolExecutionCompleteContentShellExit + ToolExecutionCompleteContentTerminal = rpc.ToolExecutionCompleteContentTerminal + ToolExecutionCompleteContentText = rpc.ToolExecutionCompleteContentText + ToolExecutionCompleteContentType = rpc.ToolExecutionCompleteContentType + ToolExecutionCompleteData = rpc.ToolExecutionCompleteData + ToolExecutionCompleteError = rpc.ToolExecutionCompleteError + ToolExecutionCompleteResult = rpc.ToolExecutionCompleteResult + ToolExecutionCompleteToolDescription = rpc.ToolExecutionCompleteToolDescription + ToolExecutionCompleteToolDescriptionMeta = rpc.ToolExecutionCompleteToolDescriptionMeta + ToolExecutionCompleteToolDescriptionMetaUI = rpc.ToolExecutionCompleteToolDescriptionMetaUI + ToolExecutionCompleteToolDescriptionMetaUIVisibility = rpc.ToolExecutionCompleteToolDescriptionMetaUIVisibility + ToolExecutionCompleteUIResource = rpc.ToolExecutionCompleteUIResource + ToolExecutionCompleteUIResourceMeta = rpc.ToolExecutionCompleteUIResourceMeta + ToolExecutionCompleteUIResourceMetaUI = rpc.ToolExecutionCompleteUIResourceMetaUI + ToolExecutionCompleteUIResourceMetaUICsp = rpc.ToolExecutionCompleteUIResourceMetaUICsp + ToolExecutionCompleteUIResourceMetaUIPermissions = rpc.ToolExecutionCompleteUIResourceMetaUIPermissions + ToolExecutionCompleteUIResourceMetaUIPermissionsCamera = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsCamera ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite - ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation - ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone - ToolExecutionPartialResultData = rpc.ToolExecutionPartialResultData - ToolExecutionProgressData = rpc.ToolExecutionProgressData - ToolExecutionStartData = rpc.ToolExecutionStartData - ToolExecutionStartShellToolInfo = rpc.ToolExecutionStartShellToolInfo - ToolExecutionStartToolDescription = rpc.ToolExecutionStartToolDescription - ToolExecutionStartToolDescriptionMeta = rpc.ToolExecutionStartToolDescriptionMeta - ToolExecutionStartToolDescriptionMetaUI = rpc.ToolExecutionStartToolDescriptionMetaUI - ToolExecutionStartToolDescriptionMetaUIVisibility = rpc.ToolExecutionStartToolDescriptionMetaUIVisibility - ToolSearchActivatedData = rpc.ToolSearchActivatedData - ToolUserRequestedData = rpc.ToolUserRequestedData - UIEphemeralQueryData = rpc.UIEphemeralQueryData - UIEphemeralQueryPhase = rpc.UIEphemeralQueryPhase - UserInputCompletedData = rpc.UserInputCompletedData - UserInputRequestedData = rpc.UserInputRequestedData - UserMessageAgentMode = rpc.UserMessageAgentMode - UserMessageData = rpc.UserMessageData - UserMessageDelivery = rpc.UserMessageDelivery - UserToolSessionApproval = rpc.UserToolSessionApproval - UserToolSessionApprovalCommands = rpc.UserToolSessionApprovalCommands - UserToolSessionApprovalCustomTool = rpc.UserToolSessionApprovalCustomTool - UserToolSessionApprovalExtensionEnvAccess = rpc.UserToolSessionApprovalExtensionEnvAccess - UserToolSessionApprovalExtensionManagement = rpc.UserToolSessionApprovalExtensionManagement - UserToolSessionApprovalExtensionPermissionAccess = rpc.UserToolSessionApprovalExtensionPermissionAccess - UserToolSessionApprovalFactory = rpc.UserToolSessionApprovalFactory - UserToolSessionApprovalKind = rpc.UserToolSessionApprovalKind - UserToolSessionApprovalMCP = rpc.UserToolSessionApprovalMCP - UserToolSessionApprovalMemory = rpc.UserToolSessionApprovalMemory - UserToolSessionApprovalRead = rpc.UserToolSessionApprovalRead - UserToolSessionApprovalWrite = rpc.UserToolSessionApprovalWrite - Verbosity = rpc.Verbosity - WorkingDirectoryContext = rpc.WorkingDirectoryContext - WorkingDirectoryContextHostType = rpc.WorkingDirectoryContextHostType - WorkspaceFileChangedOperation = rpc.WorkspaceFileChangedOperation + ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation + ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone + ToolExecutionPartialResultData = rpc.ToolExecutionPartialResultData + ToolExecutionProgressData = rpc.ToolExecutionProgressData + ToolExecutionStartData = rpc.ToolExecutionStartData + ToolExecutionStartShellToolInfo = rpc.ToolExecutionStartShellToolInfo + ToolExecutionStartToolDescription = rpc.ToolExecutionStartToolDescription + ToolExecutionStartToolDescriptionMeta = rpc.ToolExecutionStartToolDescriptionMeta + ToolExecutionStartToolDescriptionMetaUI = rpc.ToolExecutionStartToolDescriptionMetaUI + ToolExecutionStartToolDescriptionMetaUIVisibility = rpc.ToolExecutionStartToolDescriptionMetaUIVisibility + ToolSearchActivatedData = rpc.ToolSearchActivatedData + ToolUserRequestedData = rpc.ToolUserRequestedData + UIEphemeralQueryData = rpc.UIEphemeralQueryData + UIEphemeralQueryPhase = rpc.UIEphemeralQueryPhase + UserInputCompletedData = rpc.UserInputCompletedData + UserInputRequestedData = rpc.UserInputRequestedData + UserMessageAgentMode = rpc.UserMessageAgentMode + UserMessageData = rpc.UserMessageData + UserMessageDelivery = rpc.UserMessageDelivery + UserToolSessionApproval = rpc.UserToolSessionApproval + UserToolSessionApprovalCommands = rpc.UserToolSessionApprovalCommands + UserToolSessionApprovalCustomTool = rpc.UserToolSessionApprovalCustomTool + UserToolSessionApprovalExtensionEnvAccess = rpc.UserToolSessionApprovalExtensionEnvAccess + UserToolSessionApprovalExtensionManagement = rpc.UserToolSessionApprovalExtensionManagement + UserToolSessionApprovalExtensionPermissionAccess = rpc.UserToolSessionApprovalExtensionPermissionAccess + UserToolSessionApprovalFactory = rpc.UserToolSessionApprovalFactory + UserToolSessionApprovalKind = rpc.UserToolSessionApprovalKind + UserToolSessionApprovalMCP = rpc.UserToolSessionApprovalMCP + UserToolSessionApprovalMemory = rpc.UserToolSessionApprovalMemory + UserToolSessionApprovalRead = rpc.UserToolSessionApprovalRead + UserToolSessionApprovalWrite = rpc.UserToolSessionApprovalWrite + Verbosity = rpc.Verbosity + WorkingDirectoryContext = rpc.WorkingDirectoryContext + WorkingDirectoryContextHostType = rpc.WorkingDirectoryContextHostType + WorkspaceFileChangedOperation = rpc.WorkspaceFileChangedOperation ) // Session-event constants are generated in the rpc package and re-exported here for source compatibility. const ( - AbortReasonAutopilotCreditLimit = rpc.AbortReasonAutopilotCreditLimit - AbortReasonRemoteCommand = rpc.AbortReasonRemoteCommand - AbortReasonUserAbort = rpc.AbortReasonUserAbort - AbortReasonUserInitiated = rpc.AbortReasonUserInitiated - AgentInterruptedActivityBackgroundAgent = rpc.AgentInterruptedActivityBackgroundAgent - AgentInterruptedActivityModelCall = rpc.AgentInterruptedActivityModelCall - AgentInterruptedActivityRetryBackoff = rpc.AgentInterruptedActivityRetryBackoff - AgentInterruptedActivityToolCall = rpc.AgentInterruptedActivityToolCall - AgentInterruptedCancelPhaseMidStream = rpc.AgentInterruptedCancelPhaseMidStream - AgentInterruptedCancelPhasePreFirstToken = rpc.AgentInterruptedCancelPhasePreFirstToken - AgentModelPolicyPreferred = rpc.AgentModelPolicyPreferred - AgentModelPolicyRequired = rpc.AgentModelPolicyRequired - AssistantMessageToolRequestCallerTypeProgram = rpc.AssistantMessageToolRequestCallerTypeProgram - AssistantMessageToolRequestTypeCustom = rpc.AssistantMessageToolRequestTypeCustom - AssistantMessageToolRequestTypeFunction = rpc.AssistantMessageToolRequestTypeFunction - AssistantUsageAPIEndpointChatCompletions = rpc.AssistantUsageAPIEndpointChatCompletions - AssistantUsageAPIEndpointResponses = rpc.AssistantUsageAPIEndpointResponses - AssistantUsageAPIEndpointV1Messages = rpc.AssistantUsageAPIEndpointV1Messages - AssistantUsageAPIEndpointWsResponses = rpc.AssistantUsageAPIEndpointWsResponses - AssistantUsageTransportHTTP = rpc.AssistantUsageTransportHTTP - AssistantUsageTransportWebsocket = rpc.AssistantUsageTransportWebsocket - AssistedApprovalJudgeFailureReasonAbort = rpc.AssistedApprovalJudgeFailureReasonAbort - AssistedApprovalJudgeFailureReasonEmptyResponse = rpc.AssistedApprovalJudgeFailureReasonEmptyResponse - AssistedApprovalJudgeFailureReasonModelError = rpc.AssistedApprovalJudgeFailureReasonModelError - AssistedApprovalJudgeFailureReasonParseError = rpc.AssistedApprovalJudgeFailureReasonParseError - AssistedApprovalJudgeFailureReasonTimeout = rpc.AssistedApprovalJudgeFailureReasonTimeout - AssistedApprovalRecommendationApprove = rpc.AssistedApprovalRecommendationApprove - AssistedApprovalRecommendationError = rpc.AssistedApprovalRecommendationError - AssistedApprovalRecommendationExcluded = rpc.AssistedApprovalRecommendationExcluded - AssistedApprovalRecommendationRequireApproval = rpc.AssistedApprovalRecommendationRequireApproval - AttachmentGitHubReferenceTypeDiscussion = rpc.AttachmentGitHubReferenceTypeDiscussion - AttachmentGitHubReferenceTypeIssue = rpc.AttachmentGitHubReferenceTypeIssue - AttachmentGitHubReferenceTypePr = rpc.AttachmentGitHubReferenceTypePr - AttachmentTypeBlob = rpc.AttachmentTypeBlob - AttachmentTypeDirectory = rpc.AttachmentTypeDirectory - AttachmentTypeExtensionContext = rpc.AttachmentTypeExtensionContext - AttachmentTypeFile = rpc.AttachmentTypeFile - AttachmentTypeGitHubActionsJob = rpc.AttachmentTypeGitHubActionsJob - AttachmentTypeGitHubCommit = rpc.AttachmentTypeGitHubCommit - AttachmentTypeGitHubFile = rpc.AttachmentTypeGitHubFile - AttachmentTypeGitHubFileDiff = rpc.AttachmentTypeGitHubFileDiff - AttachmentTypeGitHubReference = rpc.AttachmentTypeGitHubReference - AttachmentTypeGitHubRelease = rpc.AttachmentTypeGitHubRelease - AttachmentTypeGitHubRepository = rpc.AttachmentTypeGitHubRepository - AttachmentTypeGitHubSnippet = rpc.AttachmentTypeGitHubSnippet - AttachmentTypeGitHubTreeComparison = rpc.AttachmentTypeGitHubTreeComparison - AttachmentTypeGitHubURL = rpc.AttachmentTypeGitHubURL - AttachmentTypeSelection = rpc.AttachmentTypeSelection - AutoModeResolvedReasoningBucketHigh = rpc.AutoModeResolvedReasoningBucketHigh - AutoModeResolvedReasoningBucketLow = rpc.AutoModeResolvedReasoningBucketLow - AutoModeResolvedReasoningBucketMedium = rpc.AutoModeResolvedReasoningBucketMedium - AutoModeSwitchResponseNo = rpc.AutoModeSwitchResponseNo - AutoModeSwitchResponseYes = rpc.AutoModeSwitchResponseYes - AutoModeSwitchResponseYesAlways = rpc.AutoModeSwitchResponseYesAlways - AutopilotObjectiveChangedOperationCreate = rpc.AutopilotObjectiveChangedOperationCreate - AutopilotObjectiveChangedOperationDelete = rpc.AutopilotObjectiveChangedOperationDelete - AutopilotObjectiveChangedOperationUpdate = rpc.AutopilotObjectiveChangedOperationUpdate - AutopilotObjectiveChangedStatusActive = rpc.AutopilotObjectiveChangedStatusActive - AutopilotObjectiveChangedStatusCapReached = rpc.AutopilotObjectiveChangedStatusCapReached - AutopilotObjectiveChangedStatusCompleted = rpc.AutopilotObjectiveChangedStatusCompleted - AutopilotObjectiveChangedStatusPaused = rpc.AutopilotObjectiveChangedStatusPaused - AutoTierFast = rpc.AutoTierFast - AutoTierSwitchFailureReasonPolicyRejected = rpc.AutoTierSwitchFailureReasonPolicyRejected - AutoTierSwitchFailureReasonRequestFailed = rpc.AutoTierSwitchFailureReasonRequestFailed - AutoTierSwitchFailureReasonSetupFailed = rpc.AutoTierSwitchFailureReasonSetupFailed - AutoTierSwitchFailureReasonUnsupported = rpc.AutoTierSwitchFailureReasonUnsupported - BinaryAssetReferenceTypeImage = rpc.BinaryAssetReferenceTypeImage - BinaryAssetReferenceTypeResource = rpc.BinaryAssetReferenceTypeResource - BinaryAssetTypeImage = rpc.BinaryAssetTypeImage - BinaryAssetTypeResource = rpc.BinaryAssetTypeResource - CitationLocationTypeBlock = rpc.CitationLocationTypeBlock - CitationLocationTypeChar = rpc.CitationLocationTypeChar - CitationLocationTypePage = rpc.CitationLocationTypePage - CitationProviderAnthropic = rpc.CitationProviderAnthropic - CitationProviderClient = rpc.CitationProviderClient - CitationProviderOpenai = rpc.CitationProviderOpenai - CompactionTriggerContextLimitRetry = rpc.CompactionTriggerContextLimitRetry - CompactionTriggerManual = rpc.CompactionTriggerManual - 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 - ElicitationCompletedActionCancel = rpc.ElicitationCompletedActionCancel - ElicitationCompletedActionDecline = rpc.ElicitationCompletedActionDecline - ElicitationRequestedModeForm = rpc.ElicitationRequestedModeForm - ElicitationRequestedModeURL = rpc.ElicitationRequestedModeURL - ElicitationRequestedSchemaTypeObject = rpc.ElicitationRequestedSchemaTypeObject - ExitPlanModeActionAutopilot = rpc.ExitPlanModeActionAutopilot - ExitPlanModeActionAutopilotFleet = rpc.ExitPlanModeActionAutopilotFleet - ExitPlanModeActionExitOnly = rpc.ExitPlanModeActionExitOnly - ExitPlanModeActionInteractive = rpc.ExitPlanModeActionInteractive - ExtensionsLoadedExtensionSourcePlugin = rpc.ExtensionsLoadedExtensionSourcePlugin - ExtensionsLoadedExtensionSourceProject = rpc.ExtensionsLoadedExtensionSourceProject - ExtensionsLoadedExtensionSourceSession = rpc.ExtensionsLoadedExtensionSourceSession - ExtensionsLoadedExtensionSourceUser = rpc.ExtensionsLoadedExtensionSourceUser - ExtensionsLoadedExtensionStatusDisabled = rpc.ExtensionsLoadedExtensionStatusDisabled - ExtensionsLoadedExtensionStatusFailed = rpc.ExtensionsLoadedExtensionStatusFailed - ExtensionsLoadedExtensionStatusRunning = rpc.ExtensionsLoadedExtensionStatusRunning - ExtensionsLoadedExtensionStatusStarting = rpc.ExtensionsLoadedExtensionStatusStarting - FactoryPermissionOperationAuthor = rpc.FactoryPermissionOperationAuthor - FactoryPermissionOperationRun = rpc.FactoryPermissionOperationRun - FactoryRunSettledStatusCancelled = rpc.FactoryRunSettledStatusCancelled - FactoryRunSettledStatusCompleted = rpc.FactoryRunSettledStatusCompleted - FactoryRunSettledStatusError = rpc.FactoryRunSettledStatusError - FactoryRunSettledStatusHalted = rpc.FactoryRunSettledStatusHalted - FactoryRunSettledStatusPaused = rpc.FactoryRunSettledStatusPaused - FusionConversationScopeReview = rpc.FusionConversationScopeReview - FusionConversationScopeRoot = rpc.FusionConversationScopeRoot - FusionFollowUpActionReroute = rpc.FusionFollowUpActionReroute - FusionFollowUpActionReusePrimary = rpc.FusionFollowUpActionReusePrimary - 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 - FusionPhaseKindJudge = rpc.FusionPhaseKindJudge - FusionPhaseKindPrimary = rpc.FusionPhaseKindPrimary - FusionPhaseKindRepair = rpc.FusionPhaseKindRepair - FusionPhaseKindRevision = rpc.FusionPhaseKindRevision - FusionPhaseStatusCancelled = rpc.FusionPhaseStatusCancelled - FusionPhaseStatusFailed = rpc.FusionPhaseStatusFailed - FusionPhaseStatusSucceeded = rpc.FusionPhaseStatusSucceeded - FusionProjectionModeAppend = rpc.FusionProjectionModeAppend - FusionProjectionModeNone = rpc.FusionProjectionModeNone - FusionProjectionModeStaged = rpc.FusionProjectionModeStaged - FusionTurnKindCompaction = rpc.FusionTurnKindCompaction - FusionTurnKindUser = rpc.FusionTurnKindUser - HandoffSourceTypeLocal = rpc.HandoffSourceTypeLocal - HandoffSourceTypeRemote = rpc.HandoffSourceTypeRemote - ManagedSettingsEnforcedActionBypassPermissionsBlocked = rpc.ManagedSettingsEnforcedActionBypassPermissionsBlocked - ManagedSettingsEnforcedEscalationAllowAll = rpc.ManagedSettingsEnforcedEscalationAllowAll - ManagedSettingsEnforcedEscalationApproveAll = rpc.ManagedSettingsEnforcedEscalationApproveAll - ManagedSettingsEnforcedEscalationAssistedApproval = rpc.ManagedSettingsEnforcedEscalationAssistedApproval - ManagedSettingsEnforcedEscalationServerWideMCPApproval = rpc.ManagedSettingsEnforcedEscalationServerWideMCPApproval - ManagedSettingsEnforcedEscalationUnrestrictedPaths = rpc.ManagedSettingsEnforcedEscalationUnrestrictedPaths - ManagedSettingsEnforcedEscalationUnrestrictedURLs = rpc.ManagedSettingsEnforcedEscalationUnrestrictedURLs - ManagedSettingsResolvedSourceClient = rpc.ManagedSettingsResolvedSourceClient - ManagedSettingsResolvedSourceDevice = rpc.ManagedSettingsResolvedSourceDevice - ManagedSettingsResolvedSourceMixed = rpc.ManagedSettingsResolvedSourceMixed - ManagedSettingsResolvedSourceNone = rpc.ManagedSettingsResolvedSourceNone - ManagedSettingsResolvedSourcePolicyHelper = rpc.ManagedSettingsResolvedSourcePolicyHelper - ManagedSettingsResolvedSourceServer = rpc.ManagedSettingsResolvedSourceServer - MCPHeadersRefreshCompletedOutcomeHeaders = rpc.MCPHeadersRefreshCompletedOutcomeHeaders - MCPHeadersRefreshCompletedOutcomeNone = rpc.MCPHeadersRefreshCompletedOutcomeNone - MCPHeadersRefreshCompletedOutcomeTimeout = rpc.MCPHeadersRefreshCompletedOutcomeTimeout - MCPHeadersRefreshRequiredReasonAuthFailed = rpc.MCPHeadersRefreshRequiredReasonAuthFailed - MCPHeadersRefreshRequiredReasonStartup = rpc.MCPHeadersRefreshRequiredReasonStartup - MCPHeadersRefreshRequiredReasonTtlExpired = rpc.MCPHeadersRefreshRequiredReasonTtlExpired - MCPOauthCompletionOutcomeCancelled = rpc.MCPOauthCompletionOutcomeCancelled - MCPOauthCompletionOutcomeToken = rpc.MCPOauthCompletionOutcomeToken - MCPOauthRequestReasonInitial = rpc.MCPOauthRequestReasonInitial - MCPOauthRequestReasonReauth = rpc.MCPOauthRequestReasonReauth - MCPOauthRequestReasonRefresh = rpc.MCPOauthRequestReasonRefresh - MCPOauthRequestReasonUpscope = rpc.MCPOauthRequestReasonUpscope - MCPOauthRequiredStaticClientConfigGrantTypeClientCredentials = rpc.MCPOauthRequiredStaticClientConfigGrantTypeClientCredentials - MCPServerSourceBuiltin = rpc.MCPServerSourceBuiltin - MCPServerSourcePlugin = rpc.MCPServerSourcePlugin - MCPServerSourceUser = rpc.MCPServerSourceUser - MCPServerSourceWorkspace = rpc.MCPServerSourceWorkspace - MCPServerStatusConnected = rpc.MCPServerStatusConnected - MCPServerStatusDisabled = rpc.MCPServerStatusDisabled - MCPServerStatusFailed = rpc.MCPServerStatusFailed - MCPServerStatusNeedsAuth = rpc.MCPServerStatusNeedsAuth - MCPServerStatusNotConfigured = rpc.MCPServerStatusNotConfigured - MCPServerStatusPending = rpc.MCPServerStatusPending - MCPServerStatusStopped = rpc.MCPServerStatusStopped - MCPServerTransportHTTP = rpc.MCPServerTransportHTTP - MCPServerTransportMemory = rpc.MCPServerTransportMemory - MCPServerTransportSSE = rpc.MCPServerTransportSSE - MCPServerTransportStdio = rpc.MCPServerTransportStdio - ModelCallFailureBadRequestKindBodyless = rpc.ModelCallFailureBadRequestKindBodyless - ModelCallFailureBadRequestKindStructuredError = rpc.ModelCallFailureBadRequestKindStructuredError - ModelCallFailureKindAPI = rpc.ModelCallFailureKindAPI - ModelCallFailureKindTransport = rpc.ModelCallFailureKindTransport - ModelCallFailureSourceMCPSampling = rpc.ModelCallFailureSourceMCPSampling - ModelCallFailureSourceSubagent = rpc.ModelCallFailureSourceSubagent - ModelCallFailureSourceTopLevel = rpc.ModelCallFailureSourceTopLevel - ModelCallFailureTransportHTTP = rpc.ModelCallFailureTransportHTTP - ModelCallFailureTransportWebsocket = rpc.ModelCallFailureTransportWebsocket - ModelCallFinishedOutcomeCancelled = rpc.ModelCallFinishedOutcomeCancelled - ModelCallFinishedOutcomeError = rpc.ModelCallFinishedOutcomeError - ModelCallFinishedOutcomeRejected = rpc.ModelCallFinishedOutcomeRejected - ModelCallFinishedOutcomeSuccess = rpc.ModelCallFinishedOutcomeSuccess - ModelChangeSourceAgent = rpc.ModelChangeSourceAgent - ModelChangeSourceAutomatic = rpc.ModelChangeSourceAutomatic - ModelChangeSourceConfigCommand = rpc.ModelChangeSourceConfigCommand - ModelChangeSourceManagedSettings = rpc.ModelChangeSourceManagedSettings - ModelChangeSourceModelCommand = rpc.ModelChangeSourceModelCommand - ModelChangeSourceModelPicker = rpc.ModelChangeSourceModelPicker - ModelChangeSourcePlanMode = rpc.ModelChangeSourcePlanMode - ModelChangeSourceRepoSettings = rpc.ModelChangeSourceRepoSettings - ModelChangeSourceSDK = rpc.ModelChangeSourceSDK - ModelChangeSourceSettingsCommand = rpc.ModelChangeSourceSettingsCommand - ModelChangeSourceStartup = rpc.ModelChangeSourceStartup - OmittedBinaryOmittedReasonAssetUnavailable = rpc.OmittedBinaryOmittedReasonAssetUnavailable - OmittedBinaryOmittedReasonTooLarge = rpc.OmittedBinaryOmittedReasonTooLarge - OmittedBinaryTypeImage = rpc.OmittedBinaryTypeImage - OmittedBinaryTypeResource = rpc.OmittedBinaryTypeResource - PermissionModeAllowAll = rpc.PermissionModeAllowAll - PermissionModeAssisted = rpc.PermissionModeAssisted - PermissionModeManual = rpc.PermissionModeManual - PermissionPromptRequestKindCommands = rpc.PermissionPromptRequestKindCommands - PermissionPromptRequestKindCustomTool = rpc.PermissionPromptRequestKindCustomTool - PermissionPromptRequestKindExtensionEnvAccess = rpc.PermissionPromptRequestKindExtensionEnvAccess - PermissionPromptRequestKindExtensionManagement = rpc.PermissionPromptRequestKindExtensionManagement - PermissionPromptRequestKindExtensionPermissionAccess = rpc.PermissionPromptRequestKindExtensionPermissionAccess - PermissionPromptRequestKindFactory = rpc.PermissionPromptRequestKindFactory - PermissionPromptRequestKindHook = rpc.PermissionPromptRequestKindHook - PermissionPromptRequestKindMCP = rpc.PermissionPromptRequestKindMCP - PermissionPromptRequestKindMemory = rpc.PermissionPromptRequestKindMemory - PermissionPromptRequestKindPath = rpc.PermissionPromptRequestKindPath - PermissionPromptRequestKindRead = rpc.PermissionPromptRequestKindRead - PermissionPromptRequestKindURL = rpc.PermissionPromptRequestKindURL - PermissionPromptRequestKindWrite = rpc.PermissionPromptRequestKindWrite - PermissionPromptRequestPathAccessKindRead = rpc.PermissionPromptRequestPathAccessKindRead - PermissionPromptRequestPathAccessKindShell = rpc.PermissionPromptRequestPathAccessKindShell - PermissionPromptRequestPathAccessKindWrite = rpc.PermissionPromptRequestPathAccessKindWrite - PermissionRecommendationApprove = rpc.PermissionRecommendationApprove - PermissionRequestKindCustomTool = rpc.PermissionRequestKindCustomTool - PermissionRequestKindExtensionEnvAccess = rpc.PermissionRequestKindExtensionEnvAccess - PermissionRequestKindExtensionManagement = rpc.PermissionRequestKindExtensionManagement - PermissionRequestKindExtensionPermissionAccess = rpc.PermissionRequestKindExtensionPermissionAccess - PermissionRequestKindFactory = rpc.PermissionRequestKindFactory - PermissionRequestKindHook = rpc.PermissionRequestKindHook - PermissionRequestKindMCP = rpc.PermissionRequestKindMCP - PermissionRequestKindMemory = rpc.PermissionRequestKindMemory - PermissionRequestKindRead = rpc.PermissionRequestKindRead - PermissionRequestKindShell = rpc.PermissionRequestKindShell - PermissionRequestKindURL = rpc.PermissionRequestKindURL - PermissionRequestKindWrite = rpc.PermissionRequestKindWrite - PermissionRequestMemoryActionStore = rpc.PermissionRequestMemoryActionStore - PermissionRequestMemoryActionVote = rpc.PermissionRequestMemoryActionVote - PermissionRequestMemoryDirectionDownvote = rpc.PermissionRequestMemoryDirectionDownvote - PermissionRequestMemoryDirectionUpvote = rpc.PermissionRequestMemoryDirectionUpvote - PermissionRequestMemoryScopeRepository = rpc.PermissionRequestMemoryScopeRepository - PermissionRequestMemoryScopeUser = rpc.PermissionRequestMemoryScopeUser - PermissionResultKindApproved = rpc.PermissionResultKindApproved - PermissionResultKindApprovedForLocation = rpc.PermissionResultKindApprovedForLocation - PermissionResultKindApprovedForSession = rpc.PermissionResultKindApprovedForSession - PermissionResultKindCancelled = rpc.PermissionResultKindCancelled - PermissionResultKindDeniedByContentExclusionPolicy = rpc.PermissionResultKindDeniedByContentExclusionPolicy - PermissionResultKindDeniedByPermissionRequestHook = rpc.PermissionResultKindDeniedByPermissionRequestHook - PermissionResultKindDeniedByRules = rpc.PermissionResultKindDeniedByRules - PermissionResultKindDeniedInteractivelyByUser = rpc.PermissionResultKindDeniedInteractivelyByUser + AbortReasonAutopilotCreditLimit = rpc.AbortReasonAutopilotCreditLimit + AbortReasonRemoteCommand = rpc.AbortReasonRemoteCommand + AbortReasonUserAbort = rpc.AbortReasonUserAbort + AbortReasonUserInitiated = rpc.AbortReasonUserInitiated + AgentInterruptedActivityBackgroundAgent = rpc.AgentInterruptedActivityBackgroundAgent + AgentInterruptedActivityModelCall = rpc.AgentInterruptedActivityModelCall + AgentInterruptedActivityRetryBackoff = rpc.AgentInterruptedActivityRetryBackoff + AgentInterruptedActivityToolCall = rpc.AgentInterruptedActivityToolCall + AgentInterruptedCancelPhaseMidStream = rpc.AgentInterruptedCancelPhaseMidStream + AgentInterruptedCancelPhasePreFirstToken = rpc.AgentInterruptedCancelPhasePreFirstToken + AgentModelPolicyPreferred = rpc.AgentModelPolicyPreferred + AgentModelPolicyRequired = rpc.AgentModelPolicyRequired + AssistantMessageToolRequestCallerTypeProgram = rpc.AssistantMessageToolRequestCallerTypeProgram + AssistantMessageToolRequestTypeCustom = rpc.AssistantMessageToolRequestTypeCustom + AssistantMessageToolRequestTypeFunction = rpc.AssistantMessageToolRequestTypeFunction + AssistantUsageAPIEndpointChatCompletions = rpc.AssistantUsageAPIEndpointChatCompletions + AssistantUsageAPIEndpointResponses = rpc.AssistantUsageAPIEndpointResponses + AssistantUsageAPIEndpointV1Messages = rpc.AssistantUsageAPIEndpointV1Messages + AssistantUsageAPIEndpointWsResponses = rpc.AssistantUsageAPIEndpointWsResponses + AssistantUsageTransportHTTP = rpc.AssistantUsageTransportHTTP + AssistantUsageTransportWebsocket = rpc.AssistantUsageTransportWebsocket + AssistedApprovalJudgeFailureReasonAbort = rpc.AssistedApprovalJudgeFailureReasonAbort + AssistedApprovalJudgeFailureReasonEmptyResponse = rpc.AssistedApprovalJudgeFailureReasonEmptyResponse + AssistedApprovalJudgeFailureReasonModelError = rpc.AssistedApprovalJudgeFailureReasonModelError + AssistedApprovalJudgeFailureReasonParseError = rpc.AssistedApprovalJudgeFailureReasonParseError + AssistedApprovalJudgeFailureReasonTimeout = rpc.AssistedApprovalJudgeFailureReasonTimeout + AssistedApprovalRecommendationApprove = rpc.AssistedApprovalRecommendationApprove + AssistedApprovalRecommendationError = rpc.AssistedApprovalRecommendationError + AssistedApprovalRecommendationExcluded = rpc.AssistedApprovalRecommendationExcluded + AssistedApprovalRecommendationRequireApproval = rpc.AssistedApprovalRecommendationRequireApproval + AttachmentGitHubReferenceTypeDiscussion = rpc.AttachmentGitHubReferenceTypeDiscussion + AttachmentGitHubReferenceTypeIssue = rpc.AttachmentGitHubReferenceTypeIssue + AttachmentGitHubReferenceTypePr = rpc.AttachmentGitHubReferenceTypePr + AttachmentTypeBlob = rpc.AttachmentTypeBlob + AttachmentTypeDirectory = rpc.AttachmentTypeDirectory + AttachmentTypeExtensionContext = rpc.AttachmentTypeExtensionContext + AttachmentTypeFile = rpc.AttachmentTypeFile + AttachmentTypeGitHubActionsJob = rpc.AttachmentTypeGitHubActionsJob + AttachmentTypeGitHubCommit = rpc.AttachmentTypeGitHubCommit + AttachmentTypeGitHubFile = rpc.AttachmentTypeGitHubFile + AttachmentTypeGitHubFileDiff = rpc.AttachmentTypeGitHubFileDiff + AttachmentTypeGitHubReference = rpc.AttachmentTypeGitHubReference + AttachmentTypeGitHubRelease = rpc.AttachmentTypeGitHubRelease + AttachmentTypeGitHubRepository = rpc.AttachmentTypeGitHubRepository + AttachmentTypeGitHubSnippet = rpc.AttachmentTypeGitHubSnippet + AttachmentTypeGitHubTreeComparison = rpc.AttachmentTypeGitHubTreeComparison + AttachmentTypeGitHubURL = rpc.AttachmentTypeGitHubURL + AttachmentTypeSelection = rpc.AttachmentTypeSelection + AutoModeResolvedReasoningBucketHigh = rpc.AutoModeResolvedReasoningBucketHigh + AutoModeResolvedReasoningBucketLow = rpc.AutoModeResolvedReasoningBucketLow + AutoModeResolvedReasoningBucketMedium = rpc.AutoModeResolvedReasoningBucketMedium + AutoModeSwitchResponseNo = rpc.AutoModeSwitchResponseNo + AutoModeSwitchResponseYes = rpc.AutoModeSwitchResponseYes + AutoModeSwitchResponseYesAlways = rpc.AutoModeSwitchResponseYesAlways + AutopilotObjectiveChangedOperationCreate = rpc.AutopilotObjectiveChangedOperationCreate + AutopilotObjectiveChangedOperationDelete = rpc.AutopilotObjectiveChangedOperationDelete + AutopilotObjectiveChangedOperationUpdate = rpc.AutopilotObjectiveChangedOperationUpdate + AutopilotObjectiveChangedStatusActive = rpc.AutopilotObjectiveChangedStatusActive + AutopilotObjectiveChangedStatusCapReached = rpc.AutopilotObjectiveChangedStatusCapReached + AutopilotObjectiveChangedStatusCompleted = rpc.AutopilotObjectiveChangedStatusCompleted + AutopilotObjectiveChangedStatusPaused = rpc.AutopilotObjectiveChangedStatusPaused + AutoTierFast = rpc.AutoTierFast + AutoTierSwitchFailureReasonPolicyRejected = rpc.AutoTierSwitchFailureReasonPolicyRejected + AutoTierSwitchFailureReasonRequestFailed = rpc.AutoTierSwitchFailureReasonRequestFailed + AutoTierSwitchFailureReasonSetupFailed = rpc.AutoTierSwitchFailureReasonSetupFailed + AutoTierSwitchFailureReasonUnsupported = rpc.AutoTierSwitchFailureReasonUnsupported + BinaryAssetReferenceTypeImage = rpc.BinaryAssetReferenceTypeImage + BinaryAssetReferenceTypeResource = rpc.BinaryAssetReferenceTypeResource + BinaryAssetTypeImage = rpc.BinaryAssetTypeImage + BinaryAssetTypeResource = rpc.BinaryAssetTypeResource + CitationLocationTypeBlock = rpc.CitationLocationTypeBlock + CitationLocationTypeChar = rpc.CitationLocationTypeChar + CitationLocationTypePage = rpc.CitationLocationTypePage + CitationProviderAnthropic = rpc.CitationProviderAnthropic + CitationProviderClient = rpc.CitationProviderClient + CitationProviderOpenai = rpc.CitationProviderOpenai + CompactionTriggerContextLimitRetry = rpc.CompactionTriggerContextLimitRetry + CompactionTriggerManual = rpc.CompactionTriggerManual + 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 + ElicitationCompletedActionCancel = rpc.ElicitationCompletedActionCancel + ElicitationCompletedActionDecline = rpc.ElicitationCompletedActionDecline + ElicitationRequestedModeForm = rpc.ElicitationRequestedModeForm + ElicitationRequestedModeURL = rpc.ElicitationRequestedModeURL + ElicitationRequestedSchemaTypeObject = rpc.ElicitationRequestedSchemaTypeObject + ExitPlanModeActionAutopilot = rpc.ExitPlanModeActionAutopilot + ExitPlanModeActionAutopilotFleet = rpc.ExitPlanModeActionAutopilotFleet + ExitPlanModeActionExitOnly = rpc.ExitPlanModeActionExitOnly + ExitPlanModeActionInteractive = rpc.ExitPlanModeActionInteractive + ExtensionsLoadedExtensionSourcePlugin = rpc.ExtensionsLoadedExtensionSourcePlugin + ExtensionsLoadedExtensionSourceProject = rpc.ExtensionsLoadedExtensionSourceProject + ExtensionsLoadedExtensionSourceSession = rpc.ExtensionsLoadedExtensionSourceSession + ExtensionsLoadedExtensionSourceUser = rpc.ExtensionsLoadedExtensionSourceUser + ExtensionsLoadedExtensionStatusDisabled = rpc.ExtensionsLoadedExtensionStatusDisabled + ExtensionsLoadedExtensionStatusFailed = rpc.ExtensionsLoadedExtensionStatusFailed + ExtensionsLoadedExtensionStatusRunning = rpc.ExtensionsLoadedExtensionStatusRunning + ExtensionsLoadedExtensionStatusStarting = rpc.ExtensionsLoadedExtensionStatusStarting + FactoryPermissionOperationAuthor = rpc.FactoryPermissionOperationAuthor + FactoryPermissionOperationRun = rpc.FactoryPermissionOperationRun + FactoryRunSettledStatusCancelled = rpc.FactoryRunSettledStatusCancelled + FactoryRunSettledStatusCompleted = rpc.FactoryRunSettledStatusCompleted + FactoryRunSettledStatusError = rpc.FactoryRunSettledStatusError + FactoryRunSettledStatusHalted = rpc.FactoryRunSettledStatusHalted + FactoryRunSettledStatusPaused = rpc.FactoryRunSettledStatusPaused + FusionConversationScopeReview = rpc.FusionConversationScopeReview + FusionConversationScopeRoot = rpc.FusionConversationScopeRoot + FusionFollowUpActionReroute = rpc.FusionFollowUpActionReroute + FusionFollowUpActionReusePrimary = rpc.FusionFollowUpActionReusePrimary + 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 + FusionPhaseKindJudge = rpc.FusionPhaseKindJudge + FusionPhaseKindPrimary = rpc.FusionPhaseKindPrimary + FusionPhaseKindRepair = rpc.FusionPhaseKindRepair + FusionPhaseKindRevision = rpc.FusionPhaseKindRevision + FusionPhaseStatusCancelled = rpc.FusionPhaseStatusCancelled + FusionPhaseStatusFailed = rpc.FusionPhaseStatusFailed + FusionPhaseStatusSucceeded = rpc.FusionPhaseStatusSucceeded + FusionProjectionModeAppend = rpc.FusionProjectionModeAppend + FusionProjectionModeNone = rpc.FusionProjectionModeNone + FusionProjectionModeStaged = rpc.FusionProjectionModeStaged + FusionTurnKindCompaction = rpc.FusionTurnKindCompaction + FusionTurnKindUser = rpc.FusionTurnKindUser + HandoffSourceTypeLocal = rpc.HandoffSourceTypeLocal + HandoffSourceTypeRemote = rpc.HandoffSourceTypeRemote + ManagedSettingsEnforcedActionBypassPermissionsBlocked = rpc.ManagedSettingsEnforcedActionBypassPermissionsBlocked + ManagedSettingsEnforcedEscalationAllowAll = rpc.ManagedSettingsEnforcedEscalationAllowAll + ManagedSettingsEnforcedEscalationApproveAll = rpc.ManagedSettingsEnforcedEscalationApproveAll + ManagedSettingsEnforcedEscalationAssistedApproval = rpc.ManagedSettingsEnforcedEscalationAssistedApproval + ManagedSettingsEnforcedEscalationServerWideMCPApproval = rpc.ManagedSettingsEnforcedEscalationServerWideMCPApproval + ManagedSettingsEnforcedEscalationUnrestrictedPaths = rpc.ManagedSettingsEnforcedEscalationUnrestrictedPaths + ManagedSettingsEnforcedEscalationUnrestrictedURLs = rpc.ManagedSettingsEnforcedEscalationUnrestrictedURLs + ManagedSettingsResolvedSourceClient = rpc.ManagedSettingsResolvedSourceClient + ManagedSettingsResolvedSourceDevice = rpc.ManagedSettingsResolvedSourceDevice + ManagedSettingsResolvedSourceMixed = rpc.ManagedSettingsResolvedSourceMixed + ManagedSettingsResolvedSourceNone = rpc.ManagedSettingsResolvedSourceNone + ManagedSettingsResolvedSourcePolicyHelper = rpc.ManagedSettingsResolvedSourcePolicyHelper + ManagedSettingsResolvedSourceServer = rpc.ManagedSettingsResolvedSourceServer + MCPHeadersRefreshCompletedOutcomeHeaders = rpc.MCPHeadersRefreshCompletedOutcomeHeaders + MCPHeadersRefreshCompletedOutcomeNone = rpc.MCPHeadersRefreshCompletedOutcomeNone + MCPHeadersRefreshCompletedOutcomeTimeout = rpc.MCPHeadersRefreshCompletedOutcomeTimeout + MCPHeadersRefreshRequiredReasonAuthFailed = rpc.MCPHeadersRefreshRequiredReasonAuthFailed + MCPHeadersRefreshRequiredReasonStartup = rpc.MCPHeadersRefreshRequiredReasonStartup + MCPHeadersRefreshRequiredReasonTtlExpired = rpc.MCPHeadersRefreshRequiredReasonTtlExpired + MCPOauthCompletionOutcomeCancelled = rpc.MCPOauthCompletionOutcomeCancelled + MCPOauthCompletionOutcomeToken = rpc.MCPOauthCompletionOutcomeToken + MCPOauthRequestReasonInitial = rpc.MCPOauthRequestReasonInitial + MCPOauthRequestReasonReauth = rpc.MCPOauthRequestReasonReauth + MCPOauthRequestReasonRefresh = rpc.MCPOauthRequestReasonRefresh + MCPOauthRequestReasonUpscope = rpc.MCPOauthRequestReasonUpscope + MCPOauthRequiredStaticClientConfigGrantTypeClientCredentials = rpc.MCPOauthRequiredStaticClientConfigGrantTypeClientCredentials + MCPServerSourceBuiltin = rpc.MCPServerSourceBuiltin + MCPServerSourcePlugin = rpc.MCPServerSourcePlugin + MCPServerSourceUser = rpc.MCPServerSourceUser + MCPServerSourceWorkspace = rpc.MCPServerSourceWorkspace + MCPServerStatusConnected = rpc.MCPServerStatusConnected + MCPServerStatusDisabled = rpc.MCPServerStatusDisabled + MCPServerStatusFailed = rpc.MCPServerStatusFailed + MCPServerStatusNeedsAuth = rpc.MCPServerStatusNeedsAuth + MCPServerStatusNotConfigured = rpc.MCPServerStatusNotConfigured + MCPServerStatusPending = rpc.MCPServerStatusPending + MCPServerStatusStopped = rpc.MCPServerStatusStopped + MCPServerTransportHTTP = rpc.MCPServerTransportHTTP + MCPServerTransportMemory = rpc.MCPServerTransportMemory + MCPServerTransportSSE = rpc.MCPServerTransportSSE + MCPServerTransportStdio = rpc.MCPServerTransportStdio + ModelCallFailureBadRequestKindBodyless = rpc.ModelCallFailureBadRequestKindBodyless + ModelCallFailureBadRequestKindStructuredError = rpc.ModelCallFailureBadRequestKindStructuredError + ModelCallFailureKindAPI = rpc.ModelCallFailureKindAPI + ModelCallFailureKindTransport = rpc.ModelCallFailureKindTransport + ModelCallFailureSourceMCPSampling = rpc.ModelCallFailureSourceMCPSampling + ModelCallFailureSourceSubagent = rpc.ModelCallFailureSourceSubagent + ModelCallFailureSourceTopLevel = rpc.ModelCallFailureSourceTopLevel + ModelCallFailureTransportHTTP = rpc.ModelCallFailureTransportHTTP + ModelCallFailureTransportWebsocket = rpc.ModelCallFailureTransportWebsocket + ModelCallFinishedOutcomeCancelled = rpc.ModelCallFinishedOutcomeCancelled + ModelCallFinishedOutcomeError = rpc.ModelCallFinishedOutcomeError + ModelCallFinishedOutcomeRejected = rpc.ModelCallFinishedOutcomeRejected + ModelCallFinishedOutcomeSuccess = rpc.ModelCallFinishedOutcomeSuccess + ModelChangeSourceAgent = rpc.ModelChangeSourceAgent + ModelChangeSourceAutomatic = rpc.ModelChangeSourceAutomatic + ModelChangeSourceConfigCommand = rpc.ModelChangeSourceConfigCommand + ModelChangeSourceManagedSettings = rpc.ModelChangeSourceManagedSettings + ModelChangeSourceModelCommand = rpc.ModelChangeSourceModelCommand + ModelChangeSourceModelPicker = rpc.ModelChangeSourceModelPicker + ModelChangeSourcePlanMode = rpc.ModelChangeSourcePlanMode + ModelChangeSourceRepoSettings = rpc.ModelChangeSourceRepoSettings + ModelChangeSourceSDK = rpc.ModelChangeSourceSDK + ModelChangeSourceSettingsCommand = rpc.ModelChangeSourceSettingsCommand + ModelChangeSourceStartup = rpc.ModelChangeSourceStartup + OmittedBinaryOmittedReasonAssetUnavailable = rpc.OmittedBinaryOmittedReasonAssetUnavailable + OmittedBinaryOmittedReasonTooLarge = rpc.OmittedBinaryOmittedReasonTooLarge + OmittedBinaryTypeImage = rpc.OmittedBinaryTypeImage + OmittedBinaryTypeResource = rpc.OmittedBinaryTypeResource + PermissionDecisionSourceAuthorizationCarryForward = rpc.PermissionDecisionSourceAuthorizationCarryForward + PermissionMessageAuthorizationPolarityDenial = rpc.PermissionMessageAuthorizationPolarityDenial + PermissionMessageAuthorizationPolarityGrant = rpc.PermissionMessageAuthorizationPolarityGrant + PermissionModeAllowAll = rpc.PermissionModeAllowAll + PermissionModeAssisted = rpc.PermissionModeAssisted + PermissionModeManual = rpc.PermissionModeManual + PermissionPromptRequestKindCommands = rpc.PermissionPromptRequestKindCommands + PermissionPromptRequestKindCustomTool = rpc.PermissionPromptRequestKindCustomTool + PermissionPromptRequestKindExtensionEnvAccess = rpc.PermissionPromptRequestKindExtensionEnvAccess + PermissionPromptRequestKindExtensionManagement = rpc.PermissionPromptRequestKindExtensionManagement + PermissionPromptRequestKindExtensionPermissionAccess = rpc.PermissionPromptRequestKindExtensionPermissionAccess + PermissionPromptRequestKindFactory = rpc.PermissionPromptRequestKindFactory + PermissionPromptRequestKindHook = rpc.PermissionPromptRequestKindHook + PermissionPromptRequestKindMCP = rpc.PermissionPromptRequestKindMCP + PermissionPromptRequestKindMemory = rpc.PermissionPromptRequestKindMemory + PermissionPromptRequestKindPath = rpc.PermissionPromptRequestKindPath + PermissionPromptRequestKindRead = rpc.PermissionPromptRequestKindRead + PermissionPromptRequestKindURL = rpc.PermissionPromptRequestKindURL + PermissionPromptRequestKindWrite = rpc.PermissionPromptRequestKindWrite + PermissionPromptRequestPathAccessKindRead = rpc.PermissionPromptRequestPathAccessKindRead + PermissionPromptRequestPathAccessKindShell = rpc.PermissionPromptRequestPathAccessKindShell + PermissionPromptRequestPathAccessKindWrite = rpc.PermissionPromptRequestPathAccessKindWrite + PermissionRecommendationApprove = rpc.PermissionRecommendationApprove + PermissionRequestKindCustomTool = rpc.PermissionRequestKindCustomTool + PermissionRequestKindExtensionEnvAccess = rpc.PermissionRequestKindExtensionEnvAccess + PermissionRequestKindExtensionManagement = rpc.PermissionRequestKindExtensionManagement + PermissionRequestKindExtensionPermissionAccess = rpc.PermissionRequestKindExtensionPermissionAccess + PermissionRequestKindFactory = rpc.PermissionRequestKindFactory + PermissionRequestKindHook = rpc.PermissionRequestKindHook + PermissionRequestKindMCP = rpc.PermissionRequestKindMCP + PermissionRequestKindMemory = rpc.PermissionRequestKindMemory + PermissionRequestKindRead = rpc.PermissionRequestKindRead + PermissionRequestKindShell = rpc.PermissionRequestKindShell + PermissionRequestKindURL = rpc.PermissionRequestKindURL + PermissionRequestKindWrite = rpc.PermissionRequestKindWrite + PermissionRequestMemoryActionStore = rpc.PermissionRequestMemoryActionStore + PermissionRequestMemoryActionVote = rpc.PermissionRequestMemoryActionVote + PermissionRequestMemoryDirectionDownvote = rpc.PermissionRequestMemoryDirectionDownvote + PermissionRequestMemoryDirectionUpvote = rpc.PermissionRequestMemoryDirectionUpvote + PermissionRequestMemoryScopeRepository = rpc.PermissionRequestMemoryScopeRepository + PermissionRequestMemoryScopeUser = rpc.PermissionRequestMemoryScopeUser + PermissionResultKindApproved = rpc.PermissionResultKindApproved + PermissionResultKindApprovedForLocation = rpc.PermissionResultKindApprovedForLocation + PermissionResultKindApprovedForSession = rpc.PermissionResultKindApprovedForSession + PermissionResultKindCancelled = rpc.PermissionResultKindCancelled + PermissionResultKindDeniedByContentExclusionPolicy = rpc.PermissionResultKindDeniedByContentExclusionPolicy + PermissionResultKindDeniedByPermissionRequestHook = rpc.PermissionResultKindDeniedByPermissionRequestHook + PermissionResultKindDeniedByRules = rpc.PermissionResultKindDeniedByRules + PermissionResultKindDeniedInteractivelyByUser = rpc.PermissionResultKindDeniedInteractivelyByUser PermissionResultKindDeniedNoApprovalRuleAndCouldNotRequestFromUser = rpc.PermissionResultKindDeniedNoApprovalRuleAndCouldNotRequestFromUser - PersistedBinaryImageTypeImage = rpc.PersistedBinaryImageTypeImage - PersistedBinaryImageTypeResource = rpc.PersistedBinaryImageTypeResource - PersistedBinaryResultTypeImage = rpc.PersistedBinaryResultTypeImage - PersistedBinaryResultTypeResource = rpc.PersistedBinaryResultTypeResource - PlanChangedOperationCreate = rpc.PlanChangedOperationCreate - PlanChangedOperationDelete = rpc.PlanChangedOperationDelete - PlanChangedOperationUpdate = rpc.PlanChangedOperationUpdate - ReasoningSummaryConcise = rpc.ReasoningSummaryConcise - ReasoningSummaryDetailed = rpc.ReasoningSummaryDetailed - ReasoningSummaryNone = rpc.ReasoningSummaryNone - RecommendedAutoTierBalance = rpc.RecommendedAutoTierBalance - RecommendedAutoTierEfficiency = rpc.RecommendedAutoTierEfficiency - RecommendedAutoTierIntelligence = rpc.RecommendedAutoTierIntelligence - RemediationActionAllowSandboxOutbound = rpc.RemediationActionAllowSandboxOutbound - RemediationActionReviewSandboxPolicy = rpc.RemediationActionReviewSandboxPolicy - RemediationActionShowAccount = rpc.RemediationActionShowAccount - RemediationActionSignIn = rpc.RemediationActionSignIn - RemediationActionSwitchAccount = rpc.RemediationActionSwitchAccount - ScheduleOriginModel = rpc.ScheduleOriginModel - ScheduleOriginUser = rpc.ScheduleOriginUser - SessionEventTypeAbort = rpc.SessionEventTypeAbort - SessionEventTypeAgentInterrupted = rpc.SessionEventTypeAgentInterrupted - SessionEventTypeAssistantFusionPhaseActivity = rpc.SessionEventTypeAssistantFusionPhaseActivity - SessionEventTypeAssistantFusionPhaseCompleted = rpc.SessionEventTypeAssistantFusionPhaseCompleted - SessionEventTypeAssistantFusionPhaseFailed = rpc.SessionEventTypeAssistantFusionPhaseFailed - SessionEventTypeAssistantFusionPhaseStarted = rpc.SessionEventTypeAssistantFusionPhaseStarted - SessionEventTypeAssistantIdle = rpc.SessionEventTypeAssistantIdle - SessionEventTypeAssistantIntent = rpc.SessionEventTypeAssistantIntent - SessionEventTypeAssistantMessage = rpc.SessionEventTypeAssistantMessage - SessionEventTypeAssistantMessageDelta = rpc.SessionEventTypeAssistantMessageDelta - SessionEventTypeAssistantMessageStart = rpc.SessionEventTypeAssistantMessageStart - SessionEventTypeAssistantReasoning = rpc.SessionEventTypeAssistantReasoning - SessionEventTypeAssistantReasoningDelta = rpc.SessionEventTypeAssistantReasoningDelta - SessionEventTypeAssistantServerToolProgress = rpc.SessionEventTypeAssistantServerToolProgress - SessionEventTypeAssistantStreamingDelta = rpc.SessionEventTypeAssistantStreamingDelta - SessionEventTypeAssistantToolCallDelta = rpc.SessionEventTypeAssistantToolCallDelta - SessionEventTypeAssistantTurnEnd = rpc.SessionEventTypeAssistantTurnEnd - SessionEventTypeAssistantTurnRetry = rpc.SessionEventTypeAssistantTurnRetry - SessionEventTypeAssistantTurnStart = rpc.SessionEventTypeAssistantTurnStart - SessionEventTypeAssistantUsage = rpc.SessionEventTypeAssistantUsage - SessionEventTypeAutoModeSwitchCompleted = rpc.SessionEventTypeAutoModeSwitchCompleted - SessionEventTypeAutoModeSwitchRequested = rpc.SessionEventTypeAutoModeSwitchRequested - SessionEventTypeCapabilitiesChanged = rpc.SessionEventTypeCapabilitiesChanged - SessionEventTypeCommandCompleted = rpc.SessionEventTypeCommandCompleted - SessionEventTypeCommandExecute = rpc.SessionEventTypeCommandExecute - SessionEventTypeCommandQueued = rpc.SessionEventTypeCommandQueued - SessionEventTypeCommandsChanged = rpc.SessionEventTypeCommandsChanged - SessionEventTypeElicitationCompleted = rpc.SessionEventTypeElicitationCompleted - SessionEventTypeElicitationRequested = rpc.SessionEventTypeElicitationRequested - SessionEventTypeExitPlanModeCompleted = rpc.SessionEventTypeExitPlanModeCompleted - SessionEventTypeExitPlanModeRequested = rpc.SessionEventTypeExitPlanModeRequested - SessionEventTypeExternalToolCompleted = rpc.SessionEventTypeExternalToolCompleted - SessionEventTypeExternalToolRequested = rpc.SessionEventTypeExternalToolRequested - SessionEventTypeFactoryRunSettled = rpc.SessionEventTypeFactoryRunSettled - SessionEventTypeFactoryRunStarted = rpc.SessionEventTypeFactoryRunStarted - SessionEventTypeFactoryRunUpdated = rpc.SessionEventTypeFactoryRunUpdated - SessionEventTypeHookEnd = rpc.SessionEventTypeHookEnd - SessionEventTypeHookProgress = rpc.SessionEventTypeHookProgress - SessionEventTypeHookStart = rpc.SessionEventTypeHookStart - SessionEventTypeMCPAppToolCallComplete = rpc.SessionEventTypeMCPAppToolCallComplete - SessionEventTypeMCPHeadersRefreshCompleted = rpc.SessionEventTypeMCPHeadersRefreshCompleted - SessionEventTypeMCPHeadersRefreshRequired = rpc.SessionEventTypeMCPHeadersRefreshRequired - SessionEventTypeMCPOauthCompleted = rpc.SessionEventTypeMCPOauthCompleted - SessionEventTypeMCPOauthRequired = rpc.SessionEventTypeMCPOauthRequired - SessionEventTypeMCPPromptsListChanged = rpc.SessionEventTypeMCPPromptsListChanged - SessionEventTypeMCPResourcesListChanged = rpc.SessionEventTypeMCPResourcesListChanged - SessionEventTypeMCPToolsListChanged = rpc.SessionEventTypeMCPToolsListChanged - SessionEventTypeModelCallFailure = rpc.SessionEventTypeModelCallFailure - SessionEventTypeModelCallFinished = rpc.SessionEventTypeModelCallFinished - SessionEventTypeModelCallStart = rpc.SessionEventTypeModelCallStart - SessionEventTypePendingMessagesModified = rpc.SessionEventTypePendingMessagesModified - SessionEventTypePermissionCompleted = rpc.SessionEventTypePermissionCompleted - SessionEventTypePermissionRequested = rpc.SessionEventTypePermissionRequested - SessionEventTypePromptCacheBreak = rpc.SessionEventTypePromptCacheBreak - SessionEventTypeSamplingCompleted = rpc.SessionEventTypeSamplingCompleted - SessionEventTypeSamplingRequested = rpc.SessionEventTypeSamplingRequested - SessionEventTypeSandboxDecision = rpc.SessionEventTypeSandboxDecision - SessionEventTypeSessionAutoModeResolved = rpc.SessionEventTypeSessionAutoModeResolved - SessionEventTypeSessionAutopilotObjectiveChanged = rpc.SessionEventTypeSessionAutopilotObjectiveChanged - SessionEventTypeSessionAutoTierRecommendation = rpc.SessionEventTypeSessionAutoTierRecommendation - SessionEventTypeSessionAutoTierSwitchFailed = rpc.SessionEventTypeSessionAutoTierSwitchFailed - SessionEventTypeSessionBackgroundTasksChanged = rpc.SessionEventTypeSessionBackgroundTasksChanged - SessionEventTypeSessionBinaryAsset = rpc.SessionEventTypeSessionBinaryAsset - SessionEventTypeSessionCanvasClosed = rpc.SessionEventTypeSessionCanvasClosed - SessionEventTypeSessionCanvasOpened = rpc.SessionEventTypeSessionCanvasOpened - SessionEventTypeSessionCanvasRecorded = rpc.SessionEventTypeSessionCanvasRecorded - SessionEventTypeSessionCanvasRegistryChanged = rpc.SessionEventTypeSessionCanvasRegistryChanged - SessionEventTypeSessionCanvasRemoved = rpc.SessionEventTypeSessionCanvasRemoved - SessionEventTypeSessionCanvasUnavailable = rpc.SessionEventTypeSessionCanvasUnavailable - SessionEventTypeSessionCompactionComplete = rpc.SessionEventTypeSessionCompactionComplete - SessionEventTypeSessionCompactionStart = rpc.SessionEventTypeSessionCompactionStart - SessionEventTypeSessionCompletionReceipt = rpc.SessionEventTypeSessionCompletionReceipt - SessionEventTypeSessionContextChanged = rpc.SessionEventTypeSessionContextChanged - SessionEventTypeSessionContextCleared = rpc.SessionEventTypeSessionContextCleared - SessionEventTypeSessionCustomAgentsUpdated = rpc.SessionEventTypeSessionCustomAgentsUpdated - SessionEventTypeSessionCustomNotification = rpc.SessionEventTypeSessionCustomNotification - SessionEventTypeSessionError = rpc.SessionEventTypeSessionError - SessionEventTypeSessionExtensionsAttachmentsPushed = rpc.SessionEventTypeSessionExtensionsAttachmentsPushed - SessionEventTypeSessionExtensionsLoaded = rpc.SessionEventTypeSessionExtensionsLoaded - SessionEventTypeSessionFusionCompleted = rpc.SessionEventTypeSessionFusionCompleted - SessionEventTypeSessionFusionResolved = rpc.SessionEventTypeSessionFusionResolved - SessionEventTypeSessionFusionRouteFailed = rpc.SessionEventTypeSessionFusionRouteFailed - SessionEventTypeSessionFusionRouteStarted = rpc.SessionEventTypeSessionFusionRouteStarted - SessionEventTypeSessionHandoff = rpc.SessionEventTypeSessionHandoff - SessionEventTypeSessionIdle = rpc.SessionEventTypeSessionIdle - SessionEventTypeSessionInfo = rpc.SessionEventTypeSessionInfo - SessionEventTypeSessionLimitsExhaustedCompleted = rpc.SessionEventTypeSessionLimitsExhaustedCompleted - SessionEventTypeSessionLimitsExhaustedRequested = rpc.SessionEventTypeSessionLimitsExhaustedRequested - SessionEventTypeSessionManagedSettingsEnforced = rpc.SessionEventTypeSessionManagedSettingsEnforced - SessionEventTypeSessionManagedSettingsResolved = rpc.SessionEventTypeSessionManagedSettingsResolved - SessionEventTypeSessionMCPServerNeedsReconnect = rpc.SessionEventTypeSessionMCPServerNeedsReconnect - SessionEventTypeSessionMCPServerRemoved = rpc.SessionEventTypeSessionMCPServerRemoved - SessionEventTypeSessionMCPServersLoaded = rpc.SessionEventTypeSessionMCPServersLoaded - SessionEventTypeSessionMCPServerStatusChanged = rpc.SessionEventTypeSessionMCPServerStatusChanged - SessionEventTypeSessionModeChanged = rpc.SessionEventTypeSessionModeChanged - SessionEventTypeSessionModelChange = rpc.SessionEventTypeSessionModelChange - SessionEventTypeSessionModeNoticeDelivered = rpc.SessionEventTypeSessionModeNoticeDelivered - SessionEventTypeSessionPermissionsChanged = rpc.SessionEventTypeSessionPermissionsChanged - SessionEventTypeSessionPlanChanged = rpc.SessionEventTypeSessionPlanChanged - SessionEventTypeSessionRemoteSteerableChanged = rpc.SessionEventTypeSessionRemoteSteerableChanged - SessionEventTypeSessionResume = rpc.SessionEventTypeSessionResume - SessionEventTypeSessionScheduleCancelled = rpc.SessionEventTypeSessionScheduleCancelled - SessionEventTypeSessionScheduleCreated = rpc.SessionEventTypeSessionScheduleCreated - SessionEventTypeSessionScheduleRearmed = rpc.SessionEventTypeSessionScheduleRearmed - SessionEventTypeSessionSessionLimitsChanged = rpc.SessionEventTypeSessionSessionLimitsChanged - SessionEventTypeSessionShutdown = rpc.SessionEventTypeSessionShutdown - SessionEventTypeSessionSkillsLoaded = rpc.SessionEventTypeSessionSkillsLoaded - SessionEventTypeSessionSnapshotRewind = rpc.SessionEventTypeSessionSnapshotRewind - SessionEventTypeSessionStart = rpc.SessionEventTypeSessionStart - SessionEventTypeSessionTaskComplete = rpc.SessionEventTypeSessionTaskComplete - SessionEventTypeSessionTitleChanged = rpc.SessionEventTypeSessionTitleChanged - SessionEventTypeSessionTodosChanged = rpc.SessionEventTypeSessionTodosChanged - SessionEventTypeSessionToolsUpdated = rpc.SessionEventTypeSessionToolsUpdated - SessionEventTypeSessionTruncation = rpc.SessionEventTypeSessionTruncation - SessionEventTypeSessionUsageCheckpoint = rpc.SessionEventTypeSessionUsageCheckpoint - SessionEventTypeSessionUsageInfo = rpc.SessionEventTypeSessionUsageInfo - SessionEventTypeSessionWarning = rpc.SessionEventTypeSessionWarning - SessionEventTypeSessionWorkspaceFileChanged = rpc.SessionEventTypeSessionWorkspaceFileChanged - SessionEventTypeSkillInvoked = rpc.SessionEventTypeSkillInvoked - SessionEventTypeSubagentCompleted = rpc.SessionEventTypeSubagentCompleted - SessionEventTypeSubagentConfigured = rpc.SessionEventTypeSubagentConfigured - SessionEventTypeSubagentDeselected = rpc.SessionEventTypeSubagentDeselected - SessionEventTypeSubagentFailed = rpc.SessionEventTypeSubagentFailed - SessionEventTypeSubagentSelected = rpc.SessionEventTypeSubagentSelected - SessionEventTypeSubagentStarted = rpc.SessionEventTypeSubagentStarted - SessionEventTypeSystemMessage = rpc.SessionEventTypeSystemMessage - SessionEventTypeSystemNotification = rpc.SessionEventTypeSystemNotification - SessionEventTypeToolExecutionComplete = rpc.SessionEventTypeToolExecutionComplete - SessionEventTypeToolExecutionPartialResult = rpc.SessionEventTypeToolExecutionPartialResult - SessionEventTypeToolExecutionProgress = rpc.SessionEventTypeToolExecutionProgress - SessionEventTypeToolExecutionStart = rpc.SessionEventTypeToolExecutionStart - SessionEventTypeToolSearchActivated = rpc.SessionEventTypeToolSearchActivated - SessionEventTypeToolUserRequested = rpc.SessionEventTypeToolUserRequested - SessionEventTypeUIEphemeralQuery = rpc.SessionEventTypeUIEphemeralQuery - SessionEventTypeUserInputCompleted = rpc.SessionEventTypeUserInputCompleted - SessionEventTypeUserInputRequested = rpc.SessionEventTypeUserInputRequested - SessionEventTypeUserMessage = rpc.SessionEventTypeUserMessage - SessionLimitsExhaustedResponseActionAdd = rpc.SessionLimitsExhaustedResponseActionAdd - SessionLimitsExhaustedResponseActionCancel = rpc.SessionLimitsExhaustedResponseActionCancel - SessionLimitsExhaustedResponseActionSet = rpc.SessionLimitsExhaustedResponseActionSet - SessionLimitsExhaustedResponseActionUnset = rpc.SessionLimitsExhaustedResponseActionUnset - SessionModeAutopilot = rpc.SessionModeAutopilot - SessionModeInteractive = rpc.SessionModeInteractive - SessionModePlan = rpc.SessionModePlan - ShutdownTypeError = rpc.ShutdownTypeError - ShutdownTypeRoutine = rpc.ShutdownTypeRoutine - SkillInvokedTriggerAgentInvoked = rpc.SkillInvokedTriggerAgentInvoked - SkillInvokedTriggerContextLoad = rpc.SkillInvokedTriggerContextLoad - SkillInvokedTriggerUserInvoked = rpc.SkillInvokedTriggerUserInvoked - SkillSourceBuiltin = rpc.SkillSourceBuiltin - SkillSourceCustom = rpc.SkillSourceCustom - SkillSourceInherited = rpc.SkillSourceInherited - SkillSourcePersonalAgents = rpc.SkillSourcePersonalAgents - SkillSourcePersonalCopilot = rpc.SkillSourcePersonalCopilot - SkillSourcePlugin = rpc.SkillSourcePlugin - SkillSourceProject = rpc.SkillSourceProject - SkillSourceSDK = rpc.SkillSourceSDK - SubagentModelSelectionSourceAgentDefinitionDefault = rpc.SubagentModelSelectionSourceAgentDefinitionDefault - SubagentModelSelectionSourceComplementaryDefault = rpc.SubagentModelSelectionSourceComplementaryDefault - SubagentModelSelectionSourceConfiguredPreference = rpc.SubagentModelSelectionSourceConfiguredPreference - SubagentModelSelectionSourceConfiguredRequired = rpc.SubagentModelSelectionSourceConfiguredRequired - SubagentModelSelectionSourceExplicitOverride = rpc.SubagentModelSelectionSourceExplicitOverride - SubagentModelSelectionSourceRuntimePolicy = rpc.SubagentModelSelectionSourceRuntimePolicy - SubagentModelSelectionSourceSessionInheritance = rpc.SubagentModelSelectionSourceSessionInheritance - SubagentTaskModelSourceCustomAgentDefinition = rpc.SubagentTaskModelSourceCustomAgentDefinition - SubagentTaskModelSourceSubagentConfiguration = rpc.SubagentTaskModelSourceSubagentConfiguration - SubagentTaskModelSourceTaskArgument = rpc.SubagentTaskModelSourceTaskArgument - SubagentTaskModelSourceUnset = rpc.SubagentTaskModelSourceUnset - SystemMessageRoleDeveloper = rpc.SystemMessageRoleDeveloper - SystemMessageRoleSystem = rpc.SystemMessageRoleSystem - SystemNotificationAgentCompletedStatusCompleted = rpc.SystemNotificationAgentCompletedStatusCompleted - SystemNotificationAgentCompletedStatusFailed = rpc.SystemNotificationAgentCompletedStatusFailed - SystemNotificationFactoryCompletedStatusCancelled = rpc.SystemNotificationFactoryCompletedStatusCancelled - SystemNotificationFactoryCompletedStatusCompleted = rpc.SystemNotificationFactoryCompletedStatusCompleted - SystemNotificationFactoryCompletedStatusError = rpc.SystemNotificationFactoryCompletedStatusError - SystemNotificationFactoryCompletedStatusHalted = rpc.SystemNotificationFactoryCompletedStatusHalted - SystemNotificationFactoryCompletedStatusPaused = rpc.SystemNotificationFactoryCompletedStatusPaused - SystemNotificationFactoryPauseInfoTypeCheckpoint = rpc.SystemNotificationFactoryPauseInfoTypeCheckpoint - SystemNotificationFactoryPauseInfoTypeUser = rpc.SystemNotificationFactoryPauseInfoTypeUser - SystemNotificationTypeAgentCompleted = rpc.SystemNotificationTypeAgentCompleted - SystemNotificationTypeAgentIdle = rpc.SystemNotificationTypeAgentIdle - SystemNotificationTypeFactoryCompleted = rpc.SystemNotificationTypeFactoryCompleted - SystemNotificationTypeInstructionDiscovered = rpc.SystemNotificationTypeInstructionDiscovered - SystemNotificationTypeNewInboxMessage = rpc.SystemNotificationTypeNewInboxMessage - SystemNotificationTypeShellCompleted = rpc.SystemNotificationTypeShellCompleted - SystemNotificationTypeShellDetachedCompleted = rpc.SystemNotificationTypeShellDetachedCompleted - SystemNotificationTypeUnclassified = rpc.SystemNotificationTypeUnclassified - TaskCompletionOutcomeBlocked = rpc.TaskCompletionOutcomeBlocked - TaskCompletionOutcomeCompleted = rpc.TaskCompletionOutcomeCompleted - TaskCompletionOutcomeContinue = rpc.TaskCompletionOutcomeContinue - ToolExecutionCompleteContentResourceLinkIconThemeDark = rpc.ToolExecutionCompleteContentResourceLinkIconThemeDark - ToolExecutionCompleteContentResourceLinkIconThemeLight = rpc.ToolExecutionCompleteContentResourceLinkIconThemeLight - ToolExecutionCompleteContentTypeAudio = rpc.ToolExecutionCompleteContentTypeAudio - ToolExecutionCompleteContentTypeImage = rpc.ToolExecutionCompleteContentTypeImage - ToolExecutionCompleteContentTypeResource = rpc.ToolExecutionCompleteContentTypeResource - ToolExecutionCompleteContentTypeResourceLink = rpc.ToolExecutionCompleteContentTypeResourceLink - ToolExecutionCompleteContentTypeShellExit = rpc.ToolExecutionCompleteContentTypeShellExit - ToolExecutionCompleteContentTypeTerminal = rpc.ToolExecutionCompleteContentTypeTerminal - ToolExecutionCompleteContentTypeText = rpc.ToolExecutionCompleteContentTypeText - ToolExecutionCompleteToolDescriptionMetaUIVisibilityApp = rpc.ToolExecutionCompleteToolDescriptionMetaUIVisibilityApp - ToolExecutionCompleteToolDescriptionMetaUIVisibilityModel = rpc.ToolExecutionCompleteToolDescriptionMetaUIVisibilityModel - ToolExecutionStartToolDescriptionMetaUIVisibilityApp = rpc.ToolExecutionStartToolDescriptionMetaUIVisibilityApp - ToolExecutionStartToolDescriptionMetaUIVisibilityModel = rpc.ToolExecutionStartToolDescriptionMetaUIVisibilityModel - UIEphemeralQueryPhaseAborted = rpc.UIEphemeralQueryPhaseAborted - UIEphemeralQueryPhaseChunk = rpc.UIEphemeralQueryPhaseChunk - UIEphemeralQueryPhaseCompleted = rpc.UIEphemeralQueryPhaseCompleted - UIEphemeralQueryPhaseFailed = rpc.UIEphemeralQueryPhaseFailed - UIEphemeralQueryPhaseStarted = rpc.UIEphemeralQueryPhaseStarted - UserMessageAgentModeAutopilot = rpc.UserMessageAgentModeAutopilot - UserMessageAgentModeInteractive = rpc.UserMessageAgentModeInteractive - UserMessageAgentModePlan = rpc.UserMessageAgentModePlan - UserMessageAgentModeShell = rpc.UserMessageAgentModeShell - UserMessageDeliveryIdle = rpc.UserMessageDeliveryIdle - UserMessageDeliveryQueued = rpc.UserMessageDeliveryQueued - UserMessageDeliverySteering = rpc.UserMessageDeliverySteering - UserToolSessionApprovalKindCommands = rpc.UserToolSessionApprovalKindCommands - UserToolSessionApprovalKindCustomTool = rpc.UserToolSessionApprovalKindCustomTool - UserToolSessionApprovalKindExtensionEnvAccess = rpc.UserToolSessionApprovalKindExtensionEnvAccess - UserToolSessionApprovalKindExtensionManagement = rpc.UserToolSessionApprovalKindExtensionManagement - UserToolSessionApprovalKindExtensionPermissionAccess = rpc.UserToolSessionApprovalKindExtensionPermissionAccess - UserToolSessionApprovalKindFactory = rpc.UserToolSessionApprovalKindFactory - UserToolSessionApprovalKindMCP = rpc.UserToolSessionApprovalKindMCP - UserToolSessionApprovalKindMemory = rpc.UserToolSessionApprovalKindMemory - UserToolSessionApprovalKindRead = rpc.UserToolSessionApprovalKindRead - UserToolSessionApprovalKindWrite = rpc.UserToolSessionApprovalKindWrite - VerbosityHigh = rpc.VerbosityHigh - VerbosityLow = rpc.VerbosityLow - VerbosityMedium = rpc.VerbosityMedium - WorkingDirectoryContextHostTypeADO = rpc.WorkingDirectoryContextHostTypeADO - WorkingDirectoryContextHostTypeGitHub = rpc.WorkingDirectoryContextHostTypeGitHub - WorkspaceFileChangedOperationCreate = rpc.WorkspaceFileChangedOperationCreate - WorkspaceFileChangedOperationUpdate = rpc.WorkspaceFileChangedOperationUpdate -) + PersistedBinaryImageTypeImage = rpc.PersistedBinaryImageTypeImage + PersistedBinaryImageTypeResource = rpc.PersistedBinaryImageTypeResource + PersistedBinaryResultTypeImage = rpc.PersistedBinaryResultTypeImage + PersistedBinaryResultTypeResource = rpc.PersistedBinaryResultTypeResource + PlanChangedOperationCreate = rpc.PlanChangedOperationCreate + PlanChangedOperationDelete = rpc.PlanChangedOperationDelete + PlanChangedOperationUpdate = rpc.PlanChangedOperationUpdate + ReasoningSummaryConcise = rpc.ReasoningSummaryConcise + ReasoningSummaryDetailed = rpc.ReasoningSummaryDetailed + ReasoningSummaryNone = rpc.ReasoningSummaryNone + RecommendedAutoTierBalance = rpc.RecommendedAutoTierBalance + RecommendedAutoTierEfficiency = rpc.RecommendedAutoTierEfficiency + RecommendedAutoTierIntelligence = rpc.RecommendedAutoTierIntelligence + RemediationActionAllowSandboxOutbound = rpc.RemediationActionAllowSandboxOutbound + RemediationActionReviewSandboxPolicy = rpc.RemediationActionReviewSandboxPolicy + RemediationActionShowAccount = rpc.RemediationActionShowAccount + RemediationActionSignIn = rpc.RemediationActionSignIn + RemediationActionSwitchAccount = rpc.RemediationActionSwitchAccount + ScheduleOriginModel = rpc.ScheduleOriginModel + ScheduleOriginUser = rpc.ScheduleOriginUser + SessionEventTypeAbort = rpc.SessionEventTypeAbort + SessionEventTypeAgentInterrupted = rpc.SessionEventTypeAgentInterrupted + SessionEventTypeAssistantFusionPhaseActivity = rpc.SessionEventTypeAssistantFusionPhaseActivity + SessionEventTypeAssistantFusionPhaseCompleted = rpc.SessionEventTypeAssistantFusionPhaseCompleted + SessionEventTypeAssistantFusionPhaseFailed = rpc.SessionEventTypeAssistantFusionPhaseFailed + SessionEventTypeAssistantFusionPhaseStarted = rpc.SessionEventTypeAssistantFusionPhaseStarted + SessionEventTypeAssistantIdle = rpc.SessionEventTypeAssistantIdle + SessionEventTypeAssistantIntent = rpc.SessionEventTypeAssistantIntent + SessionEventTypeAssistantMessage = rpc.SessionEventTypeAssistantMessage + SessionEventTypeAssistantMessageDelta = rpc.SessionEventTypeAssistantMessageDelta + SessionEventTypeAssistantMessageStart = rpc.SessionEventTypeAssistantMessageStart + SessionEventTypeAssistantReasoning = rpc.SessionEventTypeAssistantReasoning + SessionEventTypeAssistantReasoningDelta = rpc.SessionEventTypeAssistantReasoningDelta + SessionEventTypeAssistantServerToolProgress = rpc.SessionEventTypeAssistantServerToolProgress + SessionEventTypeAssistantStreamingDelta = rpc.SessionEventTypeAssistantStreamingDelta + SessionEventTypeAssistantToolCallDelta = rpc.SessionEventTypeAssistantToolCallDelta + SessionEventTypeAssistantTurnEnd = rpc.SessionEventTypeAssistantTurnEnd + SessionEventTypeAssistantTurnRetry = rpc.SessionEventTypeAssistantTurnRetry + SessionEventTypeAssistantTurnStart = rpc.SessionEventTypeAssistantTurnStart + SessionEventTypeAssistantUsage = rpc.SessionEventTypeAssistantUsage + SessionEventTypeAutoModeSwitchCompleted = rpc.SessionEventTypeAutoModeSwitchCompleted + SessionEventTypeAutoModeSwitchRequested = rpc.SessionEventTypeAutoModeSwitchRequested + SessionEventTypeCapabilitiesChanged = rpc.SessionEventTypeCapabilitiesChanged + SessionEventTypeCommandCompleted = rpc.SessionEventTypeCommandCompleted + SessionEventTypeCommandExecute = rpc.SessionEventTypeCommandExecute + SessionEventTypeCommandQueued = rpc.SessionEventTypeCommandQueued + SessionEventTypeCommandsChanged = rpc.SessionEventTypeCommandsChanged + SessionEventTypeElicitationCompleted = rpc.SessionEventTypeElicitationCompleted + SessionEventTypeElicitationRequested = rpc.SessionEventTypeElicitationRequested + SessionEventTypeExitPlanModeCompleted = rpc.SessionEventTypeExitPlanModeCompleted + SessionEventTypeExitPlanModeRequested = rpc.SessionEventTypeExitPlanModeRequested + SessionEventTypeExternalToolCompleted = rpc.SessionEventTypeExternalToolCompleted + SessionEventTypeExternalToolRequested = rpc.SessionEventTypeExternalToolRequested + SessionEventTypeFactoryRunSettled = rpc.SessionEventTypeFactoryRunSettled + SessionEventTypeFactoryRunStarted = rpc.SessionEventTypeFactoryRunStarted + SessionEventTypeFactoryRunUpdated = rpc.SessionEventTypeFactoryRunUpdated + SessionEventTypeHookEnd = rpc.SessionEventTypeHookEnd + SessionEventTypeHookProgress = rpc.SessionEventTypeHookProgress + SessionEventTypeHookStart = rpc.SessionEventTypeHookStart + SessionEventTypeMCPAppToolCallComplete = rpc.SessionEventTypeMCPAppToolCallComplete + SessionEventTypeMCPHeadersRefreshCompleted = rpc.SessionEventTypeMCPHeadersRefreshCompleted + SessionEventTypeMCPHeadersRefreshRequired = rpc.SessionEventTypeMCPHeadersRefreshRequired + SessionEventTypeMCPOauthCompleted = rpc.SessionEventTypeMCPOauthCompleted + SessionEventTypeMCPOauthRequired = rpc.SessionEventTypeMCPOauthRequired + SessionEventTypeMCPPromptsListChanged = rpc.SessionEventTypeMCPPromptsListChanged + SessionEventTypeMCPResourcesListChanged = rpc.SessionEventTypeMCPResourcesListChanged + SessionEventTypeMCPToolsListChanged = rpc.SessionEventTypeMCPToolsListChanged + SessionEventTypeModelCallFailure = rpc.SessionEventTypeModelCallFailure + SessionEventTypeModelCallFinished = rpc.SessionEventTypeModelCallFinished + SessionEventTypeModelCallStart = rpc.SessionEventTypeModelCallStart + SessionEventTypePendingMessagesModified = rpc.SessionEventTypePendingMessagesModified + SessionEventTypePermissionCarriedForward = rpc.SessionEventTypePermissionCarriedForward + SessionEventTypePermissionCompleted = rpc.SessionEventTypePermissionCompleted + SessionEventTypePermissionMessageAuthorization = rpc.SessionEventTypePermissionMessageAuthorization + SessionEventTypePermissionMessageAuthorizationDegraded = rpc.SessionEventTypePermissionMessageAuthorizationDegraded + SessionEventTypePermissionMessageAuthorizationRead = rpc.SessionEventTypePermissionMessageAuthorizationRead + SessionEventTypePermissionRequested = rpc.SessionEventTypePermissionRequested + SessionEventTypePromptCacheBreak = rpc.SessionEventTypePromptCacheBreak + SessionEventTypeSamplingCompleted = rpc.SessionEventTypeSamplingCompleted + SessionEventTypeSamplingRequested = rpc.SessionEventTypeSamplingRequested + SessionEventTypeSandboxDecision = rpc.SessionEventTypeSandboxDecision + SessionEventTypeSessionAutoModeResolved = rpc.SessionEventTypeSessionAutoModeResolved + SessionEventTypeSessionAutopilotObjectiveChanged = rpc.SessionEventTypeSessionAutopilotObjectiveChanged + SessionEventTypeSessionAutoTierRecommendation = rpc.SessionEventTypeSessionAutoTierRecommendation + SessionEventTypeSessionAutoTierSwitchFailed = rpc.SessionEventTypeSessionAutoTierSwitchFailed + SessionEventTypeSessionBackgroundTasksChanged = rpc.SessionEventTypeSessionBackgroundTasksChanged + SessionEventTypeSessionBinaryAsset = rpc.SessionEventTypeSessionBinaryAsset + SessionEventTypeSessionCanvasClosed = rpc.SessionEventTypeSessionCanvasClosed + SessionEventTypeSessionCanvasOpened = rpc.SessionEventTypeSessionCanvasOpened + SessionEventTypeSessionCanvasRecorded = rpc.SessionEventTypeSessionCanvasRecorded + SessionEventTypeSessionCanvasRegistryChanged = rpc.SessionEventTypeSessionCanvasRegistryChanged + SessionEventTypeSessionCanvasRemoved = rpc.SessionEventTypeSessionCanvasRemoved + SessionEventTypeSessionCanvasUnavailable = rpc.SessionEventTypeSessionCanvasUnavailable + SessionEventTypeSessionCompactionComplete = rpc.SessionEventTypeSessionCompactionComplete + SessionEventTypeSessionCompactionStart = rpc.SessionEventTypeSessionCompactionStart + SessionEventTypeSessionCompletionReceipt = rpc.SessionEventTypeSessionCompletionReceipt + SessionEventTypeSessionContextChanged = rpc.SessionEventTypeSessionContextChanged + SessionEventTypeSessionContextCleared = rpc.SessionEventTypeSessionContextCleared + SessionEventTypeSessionCustomAgentsUpdated = rpc.SessionEventTypeSessionCustomAgentsUpdated + SessionEventTypeSessionCustomNotification = rpc.SessionEventTypeSessionCustomNotification + SessionEventTypeSessionError = rpc.SessionEventTypeSessionError + SessionEventTypeSessionExtensionsAttachmentsPushed = rpc.SessionEventTypeSessionExtensionsAttachmentsPushed + SessionEventTypeSessionExtensionsLoaded = rpc.SessionEventTypeSessionExtensionsLoaded + SessionEventTypeSessionFusionCompleted = rpc.SessionEventTypeSessionFusionCompleted + SessionEventTypeSessionFusionResolved = rpc.SessionEventTypeSessionFusionResolved + SessionEventTypeSessionFusionRouteFailed = rpc.SessionEventTypeSessionFusionRouteFailed + SessionEventTypeSessionFusionRouteStarted = rpc.SessionEventTypeSessionFusionRouteStarted + SessionEventTypeSessionHandoff = rpc.SessionEventTypeSessionHandoff + SessionEventTypeSessionIdle = rpc.SessionEventTypeSessionIdle + SessionEventTypeSessionInfo = rpc.SessionEventTypeSessionInfo + SessionEventTypeSessionLimitsExhaustedCompleted = rpc.SessionEventTypeSessionLimitsExhaustedCompleted + SessionEventTypeSessionLimitsExhaustedRequested = rpc.SessionEventTypeSessionLimitsExhaustedRequested + SessionEventTypeSessionManagedSettingsEnforced = rpc.SessionEventTypeSessionManagedSettingsEnforced + SessionEventTypeSessionManagedSettingsResolved = rpc.SessionEventTypeSessionManagedSettingsResolved + SessionEventTypeSessionMCPServerNeedsReconnect = rpc.SessionEventTypeSessionMCPServerNeedsReconnect + SessionEventTypeSessionMCPServerRemoved = rpc.SessionEventTypeSessionMCPServerRemoved + SessionEventTypeSessionMCPServersLoaded = rpc.SessionEventTypeSessionMCPServersLoaded + SessionEventTypeSessionMCPServerStatusChanged = rpc.SessionEventTypeSessionMCPServerStatusChanged + SessionEventTypeSessionModeChanged = rpc.SessionEventTypeSessionModeChanged + SessionEventTypeSessionModelChange = rpc.SessionEventTypeSessionModelChange + SessionEventTypeSessionModeNoticeDelivered = rpc.SessionEventTypeSessionModeNoticeDelivered + SessionEventTypeSessionPermissionsChanged = rpc.SessionEventTypeSessionPermissionsChanged + SessionEventTypeSessionPlanChanged = rpc.SessionEventTypeSessionPlanChanged + SessionEventTypeSessionRemoteSteerableChanged = rpc.SessionEventTypeSessionRemoteSteerableChanged + SessionEventTypeSessionResume = rpc.SessionEventTypeSessionResume + SessionEventTypeSessionScheduleCancelled = rpc.SessionEventTypeSessionScheduleCancelled + SessionEventTypeSessionScheduleCreated = rpc.SessionEventTypeSessionScheduleCreated + SessionEventTypeSessionScheduleRearmed = rpc.SessionEventTypeSessionScheduleRearmed + SessionEventTypeSessionSessionLimitsChanged = rpc.SessionEventTypeSessionSessionLimitsChanged + SessionEventTypeSessionShutdown = rpc.SessionEventTypeSessionShutdown + SessionEventTypeSessionSkillsLoaded = rpc.SessionEventTypeSessionSkillsLoaded + SessionEventTypeSessionSnapshotRewind = rpc.SessionEventTypeSessionSnapshotRewind + SessionEventTypeSessionStart = rpc.SessionEventTypeSessionStart + SessionEventTypeSessionTaskComplete = rpc.SessionEventTypeSessionTaskComplete + SessionEventTypeSessionTitleChanged = rpc.SessionEventTypeSessionTitleChanged + SessionEventTypeSessionTodosChanged = rpc.SessionEventTypeSessionTodosChanged + SessionEventTypeSessionToolsUpdated = rpc.SessionEventTypeSessionToolsUpdated + SessionEventTypeSessionTruncation = rpc.SessionEventTypeSessionTruncation + SessionEventTypeSessionUsageCheckpoint = rpc.SessionEventTypeSessionUsageCheckpoint + SessionEventTypeSessionUsageInfo = rpc.SessionEventTypeSessionUsageInfo + SessionEventTypeSessionWarning = rpc.SessionEventTypeSessionWarning + SessionEventTypeSessionWorkspaceFileChanged = rpc.SessionEventTypeSessionWorkspaceFileChanged + SessionEventTypeSkillInvoked = rpc.SessionEventTypeSkillInvoked + SessionEventTypeSubagentCompleted = rpc.SessionEventTypeSubagentCompleted + SessionEventTypeSubagentConfigured = rpc.SessionEventTypeSubagentConfigured + SessionEventTypeSubagentDeselected = rpc.SessionEventTypeSubagentDeselected + SessionEventTypeSubagentFailed = rpc.SessionEventTypeSubagentFailed + SessionEventTypeSubagentSelected = rpc.SessionEventTypeSubagentSelected + SessionEventTypeSubagentStarted = rpc.SessionEventTypeSubagentStarted + SessionEventTypeSystemMessage = rpc.SessionEventTypeSystemMessage + SessionEventTypeSystemNotification = rpc.SessionEventTypeSystemNotification + SessionEventTypeToolExecutionComplete = rpc.SessionEventTypeToolExecutionComplete + SessionEventTypeToolExecutionPartialResult = rpc.SessionEventTypeToolExecutionPartialResult + SessionEventTypeToolExecutionProgress = rpc.SessionEventTypeToolExecutionProgress + SessionEventTypeToolExecutionStart = rpc.SessionEventTypeToolExecutionStart + SessionEventTypeToolSearchActivated = rpc.SessionEventTypeToolSearchActivated + SessionEventTypeToolUserRequested = rpc.SessionEventTypeToolUserRequested + SessionEventTypeUIEphemeralQuery = rpc.SessionEventTypeUIEphemeralQuery + SessionEventTypeUserInputCompleted = rpc.SessionEventTypeUserInputCompleted + SessionEventTypeUserInputRequested = rpc.SessionEventTypeUserInputRequested + SessionEventTypeUserMessage = rpc.SessionEventTypeUserMessage + SessionLimitsExhaustedResponseActionAdd = rpc.SessionLimitsExhaustedResponseActionAdd + SessionLimitsExhaustedResponseActionCancel = rpc.SessionLimitsExhaustedResponseActionCancel + SessionLimitsExhaustedResponseActionSet = rpc.SessionLimitsExhaustedResponseActionSet + SessionLimitsExhaustedResponseActionUnset = rpc.SessionLimitsExhaustedResponseActionUnset + SessionModeAutopilot = rpc.SessionModeAutopilot + SessionModeInteractive = rpc.SessionModeInteractive + SessionModePlan = rpc.SessionModePlan + ShutdownTypeError = rpc.ShutdownTypeError + ShutdownTypeRoutine = rpc.ShutdownTypeRoutine + SkillInvokedTriggerAgentInvoked = rpc.SkillInvokedTriggerAgentInvoked + SkillInvokedTriggerContextLoad = rpc.SkillInvokedTriggerContextLoad + SkillInvokedTriggerUserInvoked = rpc.SkillInvokedTriggerUserInvoked + SkillSourceBuiltin = rpc.SkillSourceBuiltin + SkillSourceCustom = rpc.SkillSourceCustom + SkillSourceInherited = rpc.SkillSourceInherited + SkillSourcePersonalAgents = rpc.SkillSourcePersonalAgents + SkillSourcePersonalCopilot = rpc.SkillSourcePersonalCopilot + SkillSourcePlugin = rpc.SkillSourcePlugin + SkillSourceProject = rpc.SkillSourceProject + SkillSourceSDK = rpc.SkillSourceSDK + SubagentModelSelectionSourceAgentDefinitionDefault = rpc.SubagentModelSelectionSourceAgentDefinitionDefault + SubagentModelSelectionSourceComplementaryDefault = rpc.SubagentModelSelectionSourceComplementaryDefault + SubagentModelSelectionSourceConfiguredPreference = rpc.SubagentModelSelectionSourceConfiguredPreference + SubagentModelSelectionSourceConfiguredRequired = rpc.SubagentModelSelectionSourceConfiguredRequired + SubagentModelSelectionSourceExplicitOverride = rpc.SubagentModelSelectionSourceExplicitOverride + SubagentModelSelectionSourceRuntimePolicy = rpc.SubagentModelSelectionSourceRuntimePolicy + SubagentModelSelectionSourceSessionInheritance = rpc.SubagentModelSelectionSourceSessionInheritance + SubagentTaskModelSourceCustomAgentDefinition = rpc.SubagentTaskModelSourceCustomAgentDefinition + SubagentTaskModelSourceSubagentConfiguration = rpc.SubagentTaskModelSourceSubagentConfiguration + SubagentTaskModelSourceTaskArgument = rpc.SubagentTaskModelSourceTaskArgument + SubagentTaskModelSourceUnset = rpc.SubagentTaskModelSourceUnset + SystemMessageRoleDeveloper = rpc.SystemMessageRoleDeveloper + SystemMessageRoleSystem = rpc.SystemMessageRoleSystem + SystemNotificationAgentCompletedStatusCompleted = rpc.SystemNotificationAgentCompletedStatusCompleted + SystemNotificationAgentCompletedStatusFailed = rpc.SystemNotificationAgentCompletedStatusFailed + SystemNotificationFactoryCompletedStatusCancelled = rpc.SystemNotificationFactoryCompletedStatusCancelled + SystemNotificationFactoryCompletedStatusCompleted = rpc.SystemNotificationFactoryCompletedStatusCompleted + SystemNotificationFactoryCompletedStatusError = rpc.SystemNotificationFactoryCompletedStatusError + SystemNotificationFactoryCompletedStatusHalted = rpc.SystemNotificationFactoryCompletedStatusHalted + SystemNotificationFactoryCompletedStatusPaused = rpc.SystemNotificationFactoryCompletedStatusPaused + SystemNotificationFactoryPauseInfoTypeCheckpoint = rpc.SystemNotificationFactoryPauseInfoTypeCheckpoint + SystemNotificationFactoryPauseInfoTypeUser = rpc.SystemNotificationFactoryPauseInfoTypeUser + SystemNotificationTypeAgentCompleted = rpc.SystemNotificationTypeAgentCompleted + SystemNotificationTypeAgentIdle = rpc.SystemNotificationTypeAgentIdle + SystemNotificationTypeFactoryCompleted = rpc.SystemNotificationTypeFactoryCompleted + SystemNotificationTypeInstructionDiscovered = rpc.SystemNotificationTypeInstructionDiscovered + SystemNotificationTypeNewInboxMessage = rpc.SystemNotificationTypeNewInboxMessage + SystemNotificationTypeShellCompleted = rpc.SystemNotificationTypeShellCompleted + SystemNotificationTypeShellDetachedCompleted = rpc.SystemNotificationTypeShellDetachedCompleted + SystemNotificationTypeUnclassified = rpc.SystemNotificationTypeUnclassified + TaskCompletionOutcomeBlocked = rpc.TaskCompletionOutcomeBlocked + TaskCompletionOutcomeCompleted = rpc.TaskCompletionOutcomeCompleted + TaskCompletionOutcomeContinue = rpc.TaskCompletionOutcomeContinue + ToolExecutionCompleteContentResourceLinkIconThemeDark = rpc.ToolExecutionCompleteContentResourceLinkIconThemeDark + ToolExecutionCompleteContentResourceLinkIconThemeLight = rpc.ToolExecutionCompleteContentResourceLinkIconThemeLight + ToolExecutionCompleteContentTypeAudio = rpc.ToolExecutionCompleteContentTypeAudio + ToolExecutionCompleteContentTypeImage = rpc.ToolExecutionCompleteContentTypeImage + ToolExecutionCompleteContentTypeResource = rpc.ToolExecutionCompleteContentTypeResource + ToolExecutionCompleteContentTypeResourceLink = rpc.ToolExecutionCompleteContentTypeResourceLink + ToolExecutionCompleteContentTypeShellExit = rpc.ToolExecutionCompleteContentTypeShellExit + ToolExecutionCompleteContentTypeTerminal = rpc.ToolExecutionCompleteContentTypeTerminal + ToolExecutionCompleteContentTypeText = rpc.ToolExecutionCompleteContentTypeText + ToolExecutionCompleteToolDescriptionMetaUIVisibilityApp = rpc.ToolExecutionCompleteToolDescriptionMetaUIVisibilityApp + ToolExecutionCompleteToolDescriptionMetaUIVisibilityModel = rpc.ToolExecutionCompleteToolDescriptionMetaUIVisibilityModel + ToolExecutionStartToolDescriptionMetaUIVisibilityApp = rpc.ToolExecutionStartToolDescriptionMetaUIVisibilityApp + ToolExecutionStartToolDescriptionMetaUIVisibilityModel = rpc.ToolExecutionStartToolDescriptionMetaUIVisibilityModel + UIEphemeralQueryPhaseAborted = rpc.UIEphemeralQueryPhaseAborted + UIEphemeralQueryPhaseChunk = rpc.UIEphemeralQueryPhaseChunk + UIEphemeralQueryPhaseCompleted = rpc.UIEphemeralQueryPhaseCompleted + UIEphemeralQueryPhaseFailed = rpc.UIEphemeralQueryPhaseFailed + UIEphemeralQueryPhaseStarted = rpc.UIEphemeralQueryPhaseStarted + UserMessageAgentModeAutopilot = rpc.UserMessageAgentModeAutopilot + UserMessageAgentModeInteractive = rpc.UserMessageAgentModeInteractive + UserMessageAgentModePlan = rpc.UserMessageAgentModePlan + UserMessageAgentModeShell = rpc.UserMessageAgentModeShell + UserMessageDeliveryIdle = rpc.UserMessageDeliveryIdle + UserMessageDeliveryQueued = rpc.UserMessageDeliveryQueued + UserMessageDeliverySteering = rpc.UserMessageDeliverySteering + UserToolSessionApprovalKindCommands = rpc.UserToolSessionApprovalKindCommands + UserToolSessionApprovalKindCustomTool = rpc.UserToolSessionApprovalKindCustomTool + UserToolSessionApprovalKindExtensionEnvAccess = rpc.UserToolSessionApprovalKindExtensionEnvAccess + UserToolSessionApprovalKindExtensionManagement = rpc.UserToolSessionApprovalKindExtensionManagement + UserToolSessionApprovalKindExtensionPermissionAccess = rpc.UserToolSessionApprovalKindExtensionPermissionAccess + UserToolSessionApprovalKindFactory = rpc.UserToolSessionApprovalKindFactory + UserToolSessionApprovalKindMCP = rpc.UserToolSessionApprovalKindMCP + UserToolSessionApprovalKindMemory = rpc.UserToolSessionApprovalKindMemory + UserToolSessionApprovalKindRead = rpc.UserToolSessionApprovalKindRead + UserToolSessionApprovalKindWrite = rpc.UserToolSessionApprovalKindWrite + VerbosityHigh = rpc.VerbosityHigh + VerbosityLow = rpc.VerbosityLow + VerbosityMedium = rpc.VerbosityMedium + WorkingDirectoryContextHostTypeADO = rpc.WorkingDirectoryContextHostTypeADO + WorkingDirectoryContextHostTypeGitHub = rpc.WorkingDirectoryContextHostTypeGitHub + WorkspaceFileChangedOperationCreate = rpc.WorkspaceFileChangedOperationCreate + WorkspaceFileChangedOperationUpdate = rpc.WorkspaceFileChangedOperationUpdate +) \ No newline at end of file diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/PermissionCarriedForwardEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionCarriedForwardEvent.java new file mode 100644 index 0000000000..27a5d0df91 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionCarriedForwardEvent.java @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * 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 "permission.carriedForward". Records that a live authorization record from an earlier human decision in this session contained a permission proposal, so it ran without another prompt. This mints no authority: it accounts for one more effect against the prior grant, which is what lets a replayed session agree with the live one about how much of that grant is left. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class PermissionCarriedForwardEvent extends SessionEvent { + + @Override + public String getType() { return "permission.carriedForward"; } + + @JsonProperty("data") + private PermissionCarriedForwardEventData data; + + public PermissionCarriedForwardEventData getData() { return data; } + public void setData(PermissionCarriedForwardEventData data) { this.data = data; } + + /** Data payload for {@link PermissionCarriedForwardEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record PermissionCarriedForwardEventData( + /** Authorization edge minted for this admission. Not a prompt id: no prompt was raised, so no client should expect a request with this id. */ + @JsonProperty("requestId") String requestId, + /** Tool call this admission authorizes. Its execution receipts the prior grant, which is how a single-effect approval is spent rather than carried forward again. */ + @JsonProperty("toolCallId") String toolCallId, + /** Identity of the prior authorization record that contained the proposal. */ + @JsonProperty("recordId") String recordId, + /** Always `authorization_carry_forward`. Stated explicitly so a consumer reading this event cannot mistake it for a human, host-policy, or assisted-approval decision. */ + @JsonProperty("decisionSource") PermissionDecisionSource decisionSource + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/PermissionCompletedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionCompletedEvent.java index a21c25e8db..51e19ad373 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/PermissionCompletedEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionCompletedEvent.java @@ -39,7 +39,9 @@ public record PermissionCompletedEventData( /** Optional tool call ID associated with this permission prompt; clients may use it to correlate UI created from tool-scoped prompts */ @JsonProperty("toolCallId") String toolCallId, /** The result of the permission request */ - @JsonProperty("result") Object result + @JsonProperty("result") Object result, + /** Who decided this permission request. Absent on completions recorded before this field existed, which consumers must treat as "not a human decision" rather than assuming one. Authorization records are minted only for `human_response`; an assisted-approval verdict, a host policy, an unattended fallback, and a hook resolution all produce the same `result` a person does, so this is the only field that distinguishes them. */ + @JsonProperty("decisionSource") PermissionDecisionSource decisionSource ) { } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/PermissionDecisionSource.java b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionDecisionSource.java new file mode 100644 index 0000000000..a8a8d73ed4 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionDecisionSource.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; + +/** + * Controlled reason or actor responsible for a permission response. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum PermissionDecisionSource { + /** The {@code assisted_approval} variant. */ + ASSISTED_APPROVAL("assisted_approval"), + /** The {@code human_response} variant. */ + HUMAN_RESPONSE("human_response"), + /** The {@code host_policy} variant. */ + HOST_POLICY("host_policy"), + /** The {@code unattended_fallback} variant. */ + UNATTENDED_FALLBACK("unattended_fallback"), + /** The {@code authorization_carry_forward} variant. */ + AUTHORIZATION_CARRY_FORWARD("authorization_carry_forward"); + + private final String value; + PermissionDecisionSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static PermissionDecisionSource fromValue(String value) { + for (PermissionDecisionSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown PermissionDecisionSource value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationDegradedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationDegradedEvent.java new file mode 100644 index 0000000000..dc37375dcf --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationDegradedEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "permission.messageAuthorizationDegraded". Records that message-backed authorization could not safely represent one human turn before compaction. The runtime may compact the original message after this marker is durable, but message-derived carry-forward and assisted auto-approval remain disabled for the rest of the session so subsequent commands continue through the ordinary permission prompt. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class PermissionMessageAuthorizationDegradedEvent extends SessionEvent { + + @Override + public String getType() { return "permission.messageAuthorizationDegraded"; } + + @JsonProperty("data") + private PermissionMessageAuthorizationDegradedEventData data; + + public PermissionMessageAuthorizationDegradedEventData getData() { return data; } + public void setData(PermissionMessageAuthorizationDegradedEventData data) { this.data = data; } + + /** Data payload for {@link PermissionMessageAuthorizationDegradedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record PermissionMessageAuthorizationDegradedEventData( + /** The human turn that could not be represented safely. */ + @JsonProperty("turnIndex") Long turnIndex + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationEvent.java new file mode 100644 index 0000000000..c87dce05cb --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationEvent.java @@ -0,0 +1,58 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Session event "permission.messageAuthorization". Freezes one blinded, verbatim-verified authorization claim the runtime minted from a human user message, so a resumed session re-establishes the same grant deterministically instead of re-running the extraction model. This mints no authority on its own: it records what a blinded proposer pointed at and the trusted discriminator the runtime established, and deterministic establishment runs on replay. Persisted so recorded authority survives compaction and process resume. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class PermissionMessageAuthorizationEvent extends SessionEvent { + + @Override + public String getType() { return "permission.messageAuthorization"; } + + @JsonProperty("data") + private PermissionMessageAuthorizationEventData data; + + public PermissionMessageAuthorizationEventData getData() { return data; } + public void setData(PermissionMessageAuthorizationEventData data) { this.data = data; } + + /** Data payload for {@link PermissionMessageAuthorizationEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record PermissionMessageAuthorizationEventData( + /** Deterministic identity of the record, derived from the turn and span offsets so re-extracting the same span mints nothing new. */ + @JsonProperty("recordId") String recordId, + /** The human turn the quoted span was read from. */ + @JsonProperty("turnIndex") Long turnIndex, + /** Whether the claim granted or denied authority. */ + @JsonProperty("polarity") PermissionMessageAuthorizationPolarity polarity, + /** The kind of effect authorized, as an action-class identifier. */ + @JsonProperty("actionClass") String actionClass, + /** Start byte offset of the authorizing span within the turn. */ + @JsonProperty("spanStart") Long spanStart, + /** End byte offset of the authorizing span within the turn. */ + @JsonProperty("spanEnd") Long spanEnd, + /** Concrete named targets that appear verbatim inside the span. */ + @JsonProperty("targetMembers") List targetMembers, + /** The task the permission is scoped to, when the human named one. */ + @JsonProperty("task") String task, + /** The trusted version discriminator, when one exists. Exact shell-command grants carry the byte-identical commands grounded in the human span; world-derived classes carry a file object, remote tip, or runner only when that state was captured safely. An opaque object mirroring the runtime's adjacently-tagged resolution. */ + @JsonProperty("world") Object world + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationPolarity.java b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationPolarity.java new file mode 100644 index 0000000000..14bc8e2895 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationPolarity.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; + +/** + * Which direction a message-backed authorization claim moves authority in. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum PermissionMessageAuthorizationPolarity { + /** The {@code grant} variant. */ + GRANT("grant"), + /** The {@code denial} variant. */ + DENIAL("denial"); + + private final String value; + PermissionMessageAuthorizationPolarity(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static PermissionMessageAuthorizationPolarity fromValue(String value) { + for (PermissionMessageAuthorizationPolarity v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown PermissionMessageAuthorizationPolarity value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationReadEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationReadEvent.java new file mode 100644 index 0000000000..b05b7fc0bc --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/PermissionMessageAuthorizationReadEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "permission.messageAuthorizationRead". Records that one human turn has been read by the blinded authorization proposer, whether or not it minted anything, so a resumed session does not re-run the extraction model on a turn the live session already read. Persisted purely to avoid wasted model calls across resume; it is never a correctness mechanism. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class PermissionMessageAuthorizationReadEvent extends SessionEvent { + + @Override + public String getType() { return "permission.messageAuthorizationRead"; } + + @JsonProperty("data") + private PermissionMessageAuthorizationReadEventData data; + + public PermissionMessageAuthorizationReadEventData getData() { return data; } + public void setData(PermissionMessageAuthorizationReadEventData data) { this.data = data; } + + /** Data payload for {@link PermissionMessageAuthorizationReadEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record PermissionMessageAuthorizationReadEventData( + /** The human turn that was read by the proposer. */ + @JsonProperty("turnIndex") Long turnIndex + ) { + } +} 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 a04aefe9f3..f41a34923b 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 @@ -111,6 +111,10 @@ @JsonSubTypes.Type(value = SystemNotificationEvent.class, name = "system.notification"), @JsonSubTypes.Type(value = PermissionRequestedEvent.class, name = "permission.requested"), @JsonSubTypes.Type(value = PermissionCompletedEvent.class, name = "permission.completed"), + @JsonSubTypes.Type(value = PermissionCarriedForwardEvent.class, name = "permission.carriedForward"), + @JsonSubTypes.Type(value = PermissionMessageAuthorizationEvent.class, name = "permission.messageAuthorization"), + @JsonSubTypes.Type(value = PermissionMessageAuthorizationReadEvent.class, name = "permission.messageAuthorizationRead"), + @JsonSubTypes.Type(value = PermissionMessageAuthorizationDegradedEvent.class, name = "permission.messageAuthorizationDegraded"), @JsonSubTypes.Type(value = UserInputRequestedEvent.class, name = "user_input.requested"), @JsonSubTypes.Type(value = UserInputCompletedEvent.class, name = "user_input.completed"), @JsonSubTypes.Type(value = ElicitationRequestedEvent.class, name = "elicitation.requested"), @@ -251,6 +255,10 @@ public abstract sealed class SessionEvent permits SystemNotificationEvent, PermissionRequestedEvent, PermissionCompletedEvent, + PermissionCarriedForwardEvent, + PermissionMessageAuthorizationEvent, + PermissionMessageAuthorizationReadEvent, + PermissionMessageAuthorizationDegradedEvent, UserInputRequestedEvent, UserInputCompletedEvent, ElicitationRequestedEvent, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CopilotUserResponse.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CopilotUserResponse.java index cd6d5c83bd..ad501eac0d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CopilotUserResponse.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CopilotUserResponse.java @@ -43,7 +43,7 @@ public record CopilotUserResponse( @JsonProperty("endpoints") CopilotUserResponseEndpoints endpoints, /** Logins of the organizations the user belongs to. */ @JsonProperty("organization_login_list") List organizationLoginList, - /** Organizations the user belongs to, each with an optional login and display name. */ + /** Organizations the user belongs to, each with an optional ID, login, and display name. */ @JsonProperty("organization_list") Object organizationList, /** Whether the Codex agent is enabled for the user. */ @JsonProperty("codex_agent_enabled") Boolean codexAgentEnabled, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.java index 20f37bdfa4..32600aa4df 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.java @@ -10,7 +10,7 @@ import javax.annotation.processing.Generated; /** - * Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history (the beginning for a forward read, the tail for a backward read). The fallback page is a fresh boundary snapshot, not a continuation of the requested cursor, so it may overlap already-rendered events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate by event id) before continuing from the returned cursor. + * Cursor status: 'ok' means the read succeeded against the requested history; 'expired' means the requested continuation is unavailable. Recovery is endpoint-specific: session.eventLog.read returns a boundary window of remaining active history that may overlap prior pages, while sessions.readPersistedEvents returns an empty terminal page and never switches journal generations. An expired persisted read is not successful completion; a complete persisted snapshot requires cursorStatus 'ok' and hasMore false. * * @since 1.0.0 */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java index 06b2db9825..a673267f32 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/JsonSchemaResponseFormat.java @@ -23,7 +23,7 @@ public record JsonSchemaResponseFormat( /** Name of the output schema, subject to the provider's naming restrictions. */ @JsonProperty("name") String name, - /** JSON Schema passed unchanged to the inference provider. Supported keywords and schema restrictions are determined by that provider. */ + /** JSON Schema passed unchanged to the inference provider. Schemas larger than 32 MiB when JSON-encoded are rejected before admission, using the runtime's existing request-size ceiling. This is not a guarantee that the entire model request fits. Supported keywords and schema restrictions are determined by the provider. */ @JsonProperty("schema") Object schema, /** Optional description passed to OpenAI providers. */ @JsonProperty("description") String description, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PermissionDecisionSource.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PermissionDecisionSource.java index 56f5793c5e..66313b8070 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PermissionDecisionSource.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PermissionDecisionSource.java @@ -23,7 +23,9 @@ public enum PermissionDecisionSource { /** The {@code host_policy} variant. */ HOST_POLICY("host_policy"), /** The {@code unattended_fallback} variant. */ - UNATTENDED_FALLBACK("unattended_fallback"); + UNATTENDED_FALLBACK("unattended_fallback"), + /** The {@code authorization_carry_forward} variant. */ + AUTHORIZATION_CARRY_FORWARD("authorization_carry_forward"); private final String value; PermissionDecisionSource(String value) { this.value = value; } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.java index 857578d0fb..cda7ea4d25 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.java @@ -30,9 +30,9 @@ public record SessionEventLogReadResult( @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. */ + /** True when more events are available in the read's direction. For a backward read, true means older persisted events remain before the returned window. A persisted-event page may contain fewer than `max` events because of its byte budget while still reporting hasMore true; continue according to this flag rather than the event count. */ @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. */ + /** Cursor status: 'ok' means the cursor was applied successfully. For session.eventLog.read, 'expired' means the cursor referred to an event that no longer exists in active history and the read fell back to a boundary of the remaining history: the beginning for a forward read or the newest window for a backward read. That fallback may overlap already rendered events, so active-session consumers should reset, rebase, or deduplicate before continuing. sessions.readPersistedEvents has stricter snapshot semantics: 'expired' returns an empty terminal page and never switches to a replacement journal generation. Other persisted-read I/O failures are RPC errors with diagnostics, not cursor expiry. */ @JsonProperty("cursorStatus") EventsCursorStatus cursorStatus ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFleetApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFleetApi.java index 183117612e..ca855b70a9 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFleetApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFleetApi.java @@ -31,7 +31,7 @@ public final class SessionFleetApi { } /** - * Optional user prompt to combine with the fleet orchestration instructions. + * Parameters for starting fleet orchestration: an optional user prompt combined with the fleet instructions, plus the send options forwarded to the resulting turn. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFleetStartParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFleetStartParams.java index c2f0471cdc..e69e7a93d0 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFleetStartParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFleetStartParams.java @@ -11,10 +11,11 @@ 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 user prompt to combine with the fleet orchestration instructions. + * Parameters for starting fleet orchestration: an optional user prompt combined with the fleet instructions, plus the send options forwarded to the resulting turn. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -27,6 +28,12 @@ public record SessionFleetStartParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, /** Optional user prompt to combine with fleet instructions */ - @JsonProperty("prompt") String prompt + @JsonProperty("prompt") String prompt, + /** Optional attachments (files, directories, selections, blobs, GitHub references) to include with the fleet request */ + @JsonProperty("attachments") List attachments, + /** If false, this request will not trigger a Premium Request Unit charge. User requests default to billable. */ + @JsonProperty("billable") Boolean billable, + /** If true, await completion of the agentic loop for this fleet request before returning. Defaults to false. */ + @JsonProperty("wait") Boolean wait_ ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetParams.java index 4c01d16d03..9a20862a13 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetParams.java @@ -28,6 +28,8 @@ public record SessionModeSetParams( @JsonProperty("sessionId") String sessionId, /** The session mode the agent is operating in */ @JsonProperty("mode") SessionMode mode, + /** Mode the session must currently be in for the change to apply. When set and the session is in a different mode the request is a no-op and reports status 'unchanged'. */ + @JsonProperty("expectedMode") SessionMode expectedMode, /** Session whose plan-mode base state should be inherited. */ @JsonProperty("inheritPlanBaseFromSessionId") String inheritPlanBaseFromSessionId, /** Whether a dedicated plan model is configured. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetResult.java index e3af446682..9221e4608b 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetResult.java @@ -29,6 +29,8 @@ public record SessionModeSetResult( @JsonProperty("status") String status, /** Whether applying the mode changed the active model. */ @JsonProperty("modelChanged") Boolean modelChanged, + /** Whether the requested mode was applied to the session. False only when an 'expectedMode' precondition did not hold, in which case any model change reported alongside it was still applied. */ + @JsonProperty("modeApplied") Boolean modeApplied, /** Compaction confirmation required before the mode change can complete. */ @JsonProperty("confirmation") ModelSwitchConfirmation confirmation, /** User-facing warning produced while applying the mode change. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java index a1c234903e..52577dd16a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java @@ -127,6 +127,8 @@ public record SessionOpenOptions( @JsonProperty("customAgentsLocalOnly") Boolean customAgentsLocalOnly, /** Whether to skip custom instruction sources. */ @JsonProperty("skipCustomInstructions") Boolean skipCustomInstructions, + /** Whether to invalidate cached custom-instruction discovery before constructing the session. Use when instruction files may have changed earlier in the same runtime process. */ + @JsonProperty("refreshCustomInstructions") Boolean refreshCustomInstructions, /** Instruction source IDs disabled for this session. */ @JsonProperty("disabledInstructionSources") List disabledInstructionSources, /** Whether commit-message coauthor trailers are enabled. */ 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 index 4da93409be..4c7bce7276 100644 --- 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 @@ -26,11 +26,11 @@ 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. */ + /** Opaque, process-local, single-use cursor returned by the previous persisted-event read. Omit on the first call and issue continuations sequentially; reusing the same cursor returns an expired terminal page. */ @JsonProperty("cursor") String cursor, - /** Maximum number of events to return in this batch (1–1000, default 200). */ + /** Maximum number of events to return in this batch (1–1000, default 200). Pages may contain fewer events to keep the serialized event array within a soft 1 MiB budget including resolved binary assets; one oversized event is returned alone to guarantee progress. */ @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. */ + /** Direction to page through persisted history. Forward starts at the beginning; backward starts with the newest events. Events in each page remain chronological. This selects the initial read only; a continuation always uses the direction bound into its cursor. */ @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 index f022df5ae2..49af36f635 100644 --- 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 @@ -30,9 +30,9 @@ public record SessionsReadPersistedEventsResult( @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. */ + /** True when more events are available in the read's direction. For a backward read, true means older persisted events remain before the returned window. A persisted-event page may contain fewer than `max` events because of its byte budget while still reporting hasMore true; continue according to this flag rather than the event count. */ @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. */ + /** Cursor status: 'ok' means the cursor was applied successfully. For session.eventLog.read, 'expired' means the cursor referred to an event that no longer exists in active history and the read fell back to a boundary of the remaining history: the beginning for a forward read or the newest window for a backward read. That fallback may overlap already rendered events, so active-session consumers should reset, rebase, or deduplicate before continuing. sessions.readPersistedEvents has stricter snapshot semantics: 'expired' returns an empty terminal page and never switches to a replacement journal generation. Other persisted-read I/O failures are RPC errors with diagnostics, not cursor expiry. */ @JsonProperty("cursorStatus") EventsCursorStatus cursorStatus ) { } diff --git a/nodejs/README.md b/nodejs/README.md index 221fcaf9bc..a80f751f17 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -351,7 +351,12 @@ The schema is not a persisted session default: autonomous resume-pending work after a restart does not restore it. A terminal tool that clears context ends the old run; its fresh seed does not inherit the schema or origin. Such a run can finish without a structured result, in which case the typed wait throws. -Remote sessions and HydraFusion routes reject response formats. +After a successful terminal tool, the runtime disables tools while the model +produces the structured result. Stop-hook corrections remain supported. +Remote sessions and known HydraFusion routes reject response formats before +admission. Schemas larger than 32 MiB when JSON-encoded are also rejected before +admission, using the runtime's existing request-size ceiling. This does not +guarantee the schema plus conversation and tools fits the provider's budget. Structured waits select the last root-agent message whose `originatingMessageId` matches the ID returned by their send, then return at a non-autopilot diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index f25b121ea9..b3c85ea787 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, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerMetadata, McpServerSource, McpServerStatus, ModelChangeSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, RemediationAction, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompleteData, TaskCompletionOutcome, UserToolSessionApproval, Verbosity } from "./session-events.js"; +import type { AbortReason, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerMetadata, McpServerSource, McpServerStatus, ModelChangeSource, PermissionDecisionSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, RemediationAction, 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 }; @@ -1016,16 +1016,16 @@ export type EventsReadDirection = /** Tail-first: return the newest events and page toward older events. */ | "backward"; /** - * Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history (the beginning for a forward read, the tail for a backward read). The fallback page is a fresh boundary snapshot, not a continuation of the requested cursor, so it may overlap already-rendered events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate by event id) before continuing from the returned cursor. + * Cursor status: 'ok' means the read succeeded against the requested history; 'expired' means the requested continuation is unavailable. Recovery is endpoint-specific: session.eventLog.read returns a boundary window of remaining active history that may overlap prior pages, while sessions.readPersistedEvents returns an empty terminal page and never switches journal generations. An expired persisted read is not successful completion; a complete persisted snapshot requires cursorStatus 'ok' and hasMore false. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "EventsCursorStatus". */ /** @experimental */ export type EventsCursorStatus = - /** The cursor was applied successfully. */ + /** The read succeeded against the requested history. */ | "ok" - /** The cursor referred to history that is no longer available. */ + /** The requested continuation is unavailable; see the endpoint's recovery semantics. */ | "expired"; /** * Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin (installed plugin), or session (session-state//extensions/) @@ -2643,22 +2643,6 @@ export type PermissionDecisionOutcome = | "autopilot_denied" /** The response came from an interactive user prompt. */ | "prompted_user"; -/** - * Controlled reason or actor responsible for a permission response. - * - * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema - * via the `definition` "PermissionDecisionSource". - */ -/** @experimental */ -export type PermissionDecisionSource = - /** The response followed the assisted-approval judge recommendation. */ - | "assisted_approval" - /** A human supplied the response through an interactive prompt. */ - | "human_response" - /** The host applied a standing policy or override rather than a judge recommendation or human decision. */ - | "host_policy" - /** The host denied the request because no interactive user response was available. */ - | "unattended_fallback"; /** * Client surface that submitted a permission response. * @@ -4270,7 +4254,7 @@ export interface CopilotUserResponse { */ organization_login_list?: string[]; /** - * Organizations the user belongs to, each with an optional login and display name. + * Organizations the user belongs to, each with an optional ID, login, and display name. */ organization_list?: | ( @@ -4278,6 +4262,10 @@ export interface CopilotUserResponse { [k: string]: unknown | undefined; } | ({ + /** + * Numeric database ID of the organization. + */ + id?: number; /** * GitHub login of the organization. */ @@ -7567,7 +7555,7 @@ export interface EventsReadResult { */ cursor: string; /** - * 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. + * True when more events are available in the read's direction. For a backward read, true means older persisted events remain before the returned window. A persisted-event page may contain fewer than `max` events because of its byte budget while still reporting hasMore true; continue according to this flag rather than the event count. */ hasMore: boolean; cursorStatus: EventsCursorStatus; @@ -9030,7 +9018,7 @@ export interface FactoryToolRunRequest { toolCallId?: string; } /** - * Optional user prompt to combine with the fleet orchestration instructions. + * Parameters for starting fleet orchestration: an optional user prompt combined with the fleet instructions, plus the send options forwarded to the resulting turn. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "FleetStartRequest". @@ -9041,6 +9029,20 @@ export interface FleetStartRequest { * Optional user prompt to combine with fleet instructions */ prompt?: string; + /** + * Optional attachments (files, directories, selections, blobs, GitHub references) to include with the fleet request + */ + attachments?: Attachment[]; + /** + * If false, this request will not trigger a Premium Request Unit charge. User requests default to billable. + * + * @internal + */ + billable?: boolean; + /** + * If true, await completion of the agentic loop for this fleet request before returning. Defaults to false. + */ + wait?: boolean; } /** * Indicates whether fleet mode was successfully activated. @@ -9983,7 +9985,7 @@ export interface JsonSchemaResponseFormat { */ name: string; /** - * JSON Schema passed unchanged to the inference provider. Supported keywords and schema restrictions are determined by that provider. + * JSON Schema passed unchanged to the inference provider. Schemas larger than 32 MiB when JSON-encoded are rejected before admission, using the runtime's existing request-size ceiling. This is not a guarantee that the entire model request fits. Supported keywords and schema restrictions are determined by the provider. */ schema: JsonValue; /** @@ -13554,6 +13556,7 @@ export interface ModelSwitchToResult { /** @experimental */ export interface ModeSetRequest { mode: SessionMode; + expectedMode?: SessionMode; /** * Session whose plan-mode base state should be inherited. */ @@ -13608,6 +13611,10 @@ export interface ModeSetResult { * Whether applying the mode changed the active model. */ modelChanged: boolean; + /** + * Whether the requested mode was applied to the session. False only when an 'expectedMode' precondition did not hold, in which case any model change reported alongside it was still applied. + */ + modeApplied?: boolean; confirmation?: ModelSwitchConfirmation; /** * User-facing warning produced while applying the mode change. @@ -19269,6 +19276,10 @@ export interface SessionOpenOptions { * Whether to skip custom instruction sources. */ skipCustomInstructions?: boolean; + /** + * Whether to invalidate cached custom-instruction discovery before constructing the session. Use when instruction files may have changed earlier in the same runtime process. + */ + refreshCustomInstructions?: boolean; /** * Instruction source IDs disabled for this session. */ @@ -20446,11 +20457,11 @@ export interface SessionsReadPersistedEventsRequest { */ sessionId: string; /** - * Opaque cursor returned by a previous persisted-event read. Omit on the first call. + * Opaque, process-local, single-use cursor returned by the previous persisted-event read. Omit on the first call and issue continuations sequentially; reusing the same cursor returns an expired terminal page. */ cursor?: string; /** - * Maximum number of events to return in this batch (1–1000, default 200). + * Maximum number of events to return in this batch (1–1000, default 200). Pages may contain fewer events to keep the serialized event array within a soft 1 MiB budget including resolved binary assets; one oversized event is returned alone to guarantee progress. */ max?: number; direction?: EventsReadDirection; @@ -24703,7 +24714,7 @@ export function createServerRpc(connection: MessageConnection) { getClientMetadata: async (params: SessionsGetClientMetadataRequest): Promise => connection.sendRequest("sessions.getClientMetadata", 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. + * Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The first read pins the currently opened journal generation and its byte-length boundary; opaque cursor continuations remain on that generation across runtime-owned compaction, truncation, and rewrite operations, which replace the live path atomically, and events appended after the boundary are excluded. For cold hydration, await the first successful page before activation and establish lossless live-event buffering before resume; merge subsequent live events by ID, preserving persisted order and letting live payloads win. Continuations are process-local, single-use capabilities bound to the originating session and storage context and must be paged sequentially; concurrent or repeated use of the same cursor expires that duplicate read rather than reading the generation twice. A complete snapshot has cursorStatus 'ok' and hasMore false. Snapshots expire after five idle minutes, with at most eight retained per process and idle-only eviction under pressure; completion and cancelled-worker exit release their handles. No transcript copy is created, but retained handles may keep replaced files' disk blocks alive until release. Pages have a soft 1 MiB serialized event-array budget including resolved binary assets; one oversized event is returned alone to guarantee progress. Working memory also includes a record/lookahead and asset resolution; resolving the first binary reference may scan the full pinned generation to build a bounded offset index. If the snapshot expires, is evicted, is cancelled before a continuation is established, or becomes unreadable after an observable unsupported in-place shortening, the continuation returns cursorStatus 'expired' with an empty terminal page and never falls back to a different generation. A missing or initially unreadable journal is an RPC error. Persisted history excludes ephemeral events and may omit payloads that are reconstructed only for an active session; use the active session event stream for post-resume live events. * * @param params Pagination options for reading an inactive or active local session's persisted event journal. * @@ -25580,7 +25591,7 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin /** * Starts fleet mode by submitting the fleet orchestration prompt to the session. * - * @param params Optional user prompt to combine with the fleet orchestration instructions. + * @param params Parameters for starting fleet orchestration: an optional user prompt combined with the fleet instructions, plus the send options forwarded to the resulting turn. * * @returns Indicates whether fleet mode was successfully activated. */ diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 87906dc30c..b96210397b 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -91,6 +91,10 @@ export type SessionEvent = | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent + | PermissionCarriedForwardEvent + | PermissionMessageAuthorizationEvent + | PermissionMessageAuthorizationReadEvent + | PermissionMessageAuthorizationDegradedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent @@ -929,6 +933,20 @@ export type PermissionPromptRequestPathAccessKind = | "shell" /** Write access to a filesystem path. */ | "write"; +/** + * Controlled reason or actor responsible for a permission response. + */ +export type PermissionDecisionSource = + /** The response followed the assisted-approval judge recommendation. */ + | "assisted_approval" + /** A human supplied the response through an interactive prompt. */ + | "human_response" + /** The host applied a standing policy or override rather than a judge recommendation or human decision. */ + | "host_policy" + /** The host denied the request because no interactive user response was available. */ + | "unattended_fallback" + /** A live authorization record from an earlier human decision in this session contained the proposal, so it ran without another prompt. This is not a new human decision and never mints authority of its own. */ + | "authorization_carry_forward"; /** * The result of the permission request */ @@ -956,6 +974,15 @@ export type UserToolSessionApproval = | UserToolSessionApprovalFactory | UserToolSessionApprovalExtensionPermissionAccess | UserToolSessionApprovalExtensionEnvAccess; +/** + * Which direction a message-backed authorization claim moves authority in. + */ +/** @experimental */ +export type PermissionMessageAuthorizationPolarity = + /** The human's words authorized an effect. */ + | "grant" + /** The human's words refused an effect. */ + | "denial"; /** * Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent. */ @@ -8113,6 +8140,20 @@ export interface PermissionRequestShell { * True when the requested escalation is a permissive retry rather than a full bypass: the command re-runs inside the sandbox with its file and process restrictions recording instead of blocking, while the network policy stays enforced. Always accompanied by requestSandboxBypass, so hosts that do not recognize this field still treat the request as the escalation it is. Hosts that do recognize it must not describe the command as running outside the sandbox, which would overstate the privilege being granted. */ requestSandboxPermissive?: boolean; + /** + * Runtime-resolved canonical object each possiblePaths entry names, keyed by the requested spelling, used for authorization identity checks. Internal and experimental; clients should continue to display possiblePaths. + * + * @experimental + */ + resolvedPaths?: { + [k: string]: string | undefined; + }; + /** + * Runtime-resolved canonical working directory the command runs in, used for authorization identity checks. Internal and experimental; clients should not display it. + * + * @experimental + */ + resolvedWorkingDirectory?: string; /** * Tool call ID that triggered this permission request */ @@ -8197,6 +8238,12 @@ export interface PermissionRequestWrite { * Justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. */ requestSandboxBypassReason?: string; + /** + * Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display fileName. + * + * @experimental + */ + resolvedPath?: string; /** * Tool call ID that triggered this permission request */ @@ -8230,6 +8277,12 @@ export interface PermissionRequestRead { * What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. Only meaningful when requestSandboxBypass is true. */ requestSandboxBypassReason?: string; + /** + * Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display path. + * + * @experimental + */ + resolvedPath?: string; /** * Tool call ID that triggered this permission request */ @@ -8660,6 +8713,12 @@ export interface PermissionPromptRequestWrite { * Complete new file contents for newly created files */ newFileContents?: string; + /** + * Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display fileName. + * + * @experimental + */ + resolvedPath?: string; /** * Tool call ID that triggered this permission request */ @@ -8691,6 +8750,12 @@ export interface PermissionPromptRequestRead { * Path of the file or directory being read */ path: string; + /** + * Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display path. + * + * @experimental + */ + resolvedPath?: string; /** * Tool call ID that triggered this permission request */ @@ -9100,6 +9165,12 @@ export interface PermissionCompletedEvent { * Permission request completion notification signaling UI dismissal */ export interface PermissionCompletedData { + /** + * Who decided this permission request. Absent on completions recorded before this field existed, which consumers must treat as "not a human decision" rather than assuming one. Authorization records are minted only for `human_response`; an assisted-approval verdict, a host policy, an unattended fallback, and a hook resolution all produce the same `result` a person does, so this is the only field that distinguishes them. + * + * @experimental + */ + decisionSource?: PermissionDecisionSource; /** * Request ID of the resolved permission request; clients should dismiss any UI for this request */ @@ -9382,6 +9453,244 @@ export interface PermissionDeniedByPermissionRequestHook { */ message?: string; } +/** + * Session event "permission.carriedForward". Records that a live authorization record from an earlier human decision in this session contained a permission proposal, so it ran without another prompt. This mints no authority: it accounts for one more effect against the prior grant, which is what lets a replayed session agree with the live one about how much of that grant is left. + */ +/** @experimental */ +export interface PermissionCarriedForwardEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: PermissionCarriedForwardData; + /** + * 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 "permission.carriedForward". + */ + type: "permission.carriedForward"; +} +/** + * Records that a live authorization record from an earlier human decision in this session contained a permission proposal, so it ran without another prompt. This mints no authority: it accounts for one more effect against the prior grant, which is what lets a replayed session agree with the live one about how much of that grant is left. + */ +/** @experimental */ +export interface PermissionCarriedForwardData { + /** + * Always `authorization_carry_forward`. Stated explicitly so a consumer reading this event cannot mistake it for a human, host-policy, or assisted-approval decision. + * + * @experimental + */ + decisionSource: PermissionDecisionSource; + /** + * Identity of the prior authorization record that contained the proposal. + * + * @experimental + */ + recordId: string; + /** + * Authorization edge minted for this admission. Not a prompt id: no prompt was raised, so no client should expect a request with this id. + * + * @experimental + */ + requestId: string; + /** + * Tool call this admission authorizes. Its execution receipts the prior grant, which is how a single-effect approval is spent rather than carried forward again. + * + * @experimental + */ + toolCallId: string; +} +/** + * Session event "permission.messageAuthorization". Freezes one blinded, verbatim-verified authorization claim the runtime minted from a human user message, so a resumed session re-establishes the same grant deterministically instead of re-running the extraction model. This mints no authority on its own: it records what a blinded proposer pointed at and the trusted discriminator the runtime established, and deterministic establishment runs on replay. Persisted so recorded authority survives compaction and process resume. + */ +/** @experimental */ +export interface PermissionMessageAuthorizationEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: PermissionMessageAuthorizationData; + /** + * 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 "permission.messageAuthorization". + */ + type: "permission.messageAuthorization"; +} +/** + * Freezes one blinded, verbatim-verified authorization claim the runtime minted from a human user message, so a resumed session re-establishes the same grant deterministically instead of re-running the extraction model. This mints no authority on its own: it records what a blinded proposer pointed at and the trusted discriminator the runtime established, and deterministic establishment runs on replay. Persisted so recorded authority survives compaction and process resume. + */ +/** @experimental */ +export interface PermissionMessageAuthorizationData { + /** + * The kind of effect authorized, as an action-class identifier. + * + * @experimental + */ + actionClass: string; + /** + * Whether the claim granted or denied authority. + * + * @experimental + */ + polarity: PermissionMessageAuthorizationPolarity; + /** + * Deterministic identity of the record, derived from the turn and span offsets so re-extracting the same span mints nothing new. + * + * @experimental + */ + recordId: string; + /** + * End byte offset of the authorizing span within the turn. + * + * @experimental + */ + spanEnd: number; + /** + * Start byte offset of the authorizing span within the turn. + * + * @experimental + */ + spanStart: number; + /** + * Concrete named targets that appear verbatim inside the span. + * + * @experimental + */ + targetMembers?: string[]; + /** + * The task the permission is scoped to, when the human named one. + * + * @experimental + */ + task?: string; + /** + * The human turn the quoted span was read from. + * + * @experimental + */ + turnIndex: number; + /** + * The trusted version discriminator, when one exists. Exact shell-command grants carry the byte-identical commands grounded in the human span; world-derived classes carry a file object, remote tip, or runner only when that state was captured safely. An opaque object mirroring the runtime's adjacently-tagged resolution. + * + * @experimental + */ + world?: JsonValue; +} +/** + * Session event "permission.messageAuthorizationRead". Records that one human turn has been read by the blinded authorization proposer, whether or not it minted anything, so a resumed session does not re-run the extraction model on a turn the live session already read. Persisted purely to avoid wasted model calls across resume; it is never a correctness mechanism. + */ +/** @experimental */ +export interface PermissionMessageAuthorizationReadEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: PermissionMessageAuthorizationReadData; + /** + * 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 "permission.messageAuthorizationRead". + */ + type: "permission.messageAuthorizationRead"; +} +/** + * Records that one human turn has been read by the blinded authorization proposer, whether or not it minted anything, so a resumed session does not re-run the extraction model on a turn the live session already read. Persisted purely to avoid wasted model calls across resume; it is never a correctness mechanism. + */ +/** @experimental */ +export interface PermissionMessageAuthorizationReadData { + /** + * The human turn that was read by the proposer. + * + * @experimental + */ + turnIndex: number; +} +/** + * Session event "permission.messageAuthorizationDegraded". Records that message-backed authorization could not safely represent one human turn before compaction. The runtime may compact the original message after this marker is durable, but message-derived carry-forward and assisted auto-approval remain disabled for the rest of the session so subsequent commands continue through the ordinary permission prompt. + */ +/** @experimental */ +export interface PermissionMessageAuthorizationDegradedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: PermissionMessageAuthorizationDegradedData; + /** + * 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 "permission.messageAuthorizationDegraded". + */ + type: "permission.messageAuthorizationDegraded"; +} +/** + * Records that message-backed authorization could not safely represent one human turn before compaction. The runtime may compact the original message after this marker is durable, but message-derived carry-forward and assisted auto-approval remain disabled for the rest of the session so subsequent commands continue through the ordinary permission prompt. + */ +/** @experimental */ +export interface PermissionMessageAuthorizationDegradedData { + /** + * The human turn that could not be represented safely. + * + * @experimental + */ + turnIndex: number; +} /** * Session event "user_input.requested". User input request notification with question and optional predefined choices */ diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index c41191ede9..d4a1ad7587 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -89,10 +89,10 @@ export type { SessionFsSqliteStatement } from "./sessionFsProvider.js"; export type { SessionFsSqliteTransactionErrorClass } from "./sessionFsProvider.js"; export { SessionFsSqliteTransactionFailure } from "./sessionFsProvider.js"; export type { LlmInferenceHeaders } from "./generated/rpc.js"; +export type { PermissionDecisionSource } from "./generated/session-events.js"; export type { PermissionDecisionContext, PermissionDecisionOutcome, - PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, } from "./generated/rpc.js"; diff --git a/nodejs/test/e2e/structured_output.e2e.test.ts b/nodejs/test/e2e/structured_output.e2e.test.ts index d6ec59b6e6..62bb5153fa 100644 --- a/nodejs/test/e2e/structured_output.e2e.test.ts +++ b/nodejs/test/e2e/structured_output.e2e.test.ts @@ -16,7 +16,11 @@ import { createSdkTestContext, DEFAULT_GITHUB_TOKEN, isCI } from "./harness/sdkT import { waitForCondition } from "./harness/sdkTestHelper"; describe("Structured output", async () => { - const { copilotClient: client, openAiEndpoint } = await createSdkTestContext(); + const { copilotClient: client, openAiEndpoint } = await createSdkTestContext({ + copilotClientOptions: { + env: { COPILOT_CLI_ENABLED_FEATURE_FLAGS: "HYDRAFUSION,HYDRAFUSION_ROLLOUT" }, + }, + }); const provider: ProviderConfig = { type: "openai", wireApi: "completions", @@ -77,6 +81,7 @@ describe("Structured output", async () => { it("node_zod_typed_result_after_terminal_tool_and_steering", async () => { const events: SessionEvent[] = []; + let calls = 0; let session: CopilotSession; session = await client.createSession({ model: "gpt-4.1", @@ -92,6 +97,7 @@ describe("Structured output", async () => { skipPermission: true, isTerminal: true, handler: async () => { + calls++; await session.send({ prompt: "Continue with the original calculation. Do not call any more tools.", mode: "immediate", @@ -108,6 +114,7 @@ describe("Structured output", async () => { ); expectTypeOf(result).toEqualTypeOf<{ answer: number; contract: "typed_tool" }>(); expect(result).toEqual({ answer: 63, contract: "typed_tool" }); + expect(calls).toBe(1); expect(events.some((event) => event.type === "tool.execution_complete")).toBe(true); expect(events.some((event) => event.type === "assistant.message_delta")).toBe(true); const replies = events.filter( @@ -117,6 +124,9 @@ describe("Structured output", async () => { expect(replies.at(-1)?.data.toolRequests ?? []).toEqual([]); const exchanges = await openAiEndpoint.getExchanges(); expect(exchanges.length).toBeGreaterThanOrEqual(2); + for (const exchange of exchanges.slice(1)) { + expect(exchange.request).toHaveProperty("tool_choice", "none"); + } for (const exchange of exchanges) { expect(exchange.request).toHaveProperty( "response_format.json_schema.schema", @@ -125,6 +135,104 @@ describe("Structured output", async () => { } }); + it("typed_wait_returns_stop_hook_correction_after_terminal_tool", async () => { + let calls = 0; + let stops = 0; + const replies: AssistantMessageEvent[] = []; + const session = await client.createSession({ + model: "gpt-4.1", + provider, + onPermissionRequest: approveAll, + availableTools: [], + tools: [ + defineTool("lookup_number", { + description: "Return the number needed for the calculation.", + parameters: z.object({}), + skipPermission: true, + isTerminal: true, + handler: () => { + calls++; + return 58; + }, + }), + ], + onEvent: (event) => { + if (event.type === "assistant.message" && !event.agentId) replies.push(event); + }, + hooks: { + onAgentStop: () => + ++stops === 1 + ? { + decision: "block", + reason: "Correct the answer to 99, not 63. Do not use tools.", + } + : undefined, + }, + }); + const schema = z.object({ answer: z.number().int() }); + const result = await session.sendAndWait( + "Call lookup_number exactly once, then add 5 to the returned number. Do not guess its result.", + schema + ); + expect(result).toEqual({ answer: 99 }); + expect(calls).toBe(1); + expect(stops).toBe(2); + const answers = replies.filter((reply) => !reply.data.toolRequests?.length); + expect(answers.map((reply): unknown => JSON.parse(reply.data.content))).toEqual([ + { answer: 63 }, + { answer: 99 }, + ]); + expect(answers[0].data.originatingMessageId).toBeTruthy(); + expect(answers[1].data.originatingMessageId).toBe(answers[0].data.originatingMessageId); + const exchanges = await openAiEndpoint.getExchanges(); + expect(exchanges).toHaveLength(3); + expect(exchanges[1].request).toHaveProperty("tool_choice", "none"); + for (const exchange of exchanges) { + expect(exchange.request).toHaveProperty( + "response_format.json_schema.schema", + schema.toJSONSchema() + ); + } + }); + + it("rejects_unsupported_or_oversized_schemas_before_admission", async () => { + for (const model of ["gpt-4.1", "hydrafusion"]) { + const session = await client.createSession({ + model, + provider, + onPermissionRequest: approveAll, + availableTools: [], + }); + const schema = { + type: "object", + description: model === "gpt-4.1" ? "x".repeat(32 * 1024 * 1024) : "Small schema", + }; + const message = model === "gpt-4.1" ? /32 MiB/ : /HydraFusion/; + await expect( + session.sendAndWait({ + prompt: "Must not be admitted", + responseSchema: schema, + }) + ).rejects.toThrow(message); + await expect( + session.rpc.sendMessages({ + messages: [], + responseFormat: { + type: "json_schema", + jsonSchema: { name: "response", schema }, + }, + }) + ).rejects.toThrow(message); + expect((await session.rpc.queue.pendingItems()).items).toEqual([]); + expect( + (await session.getEvents()).filter( + (event) => event.type === "user.message" || event.type === "session.error" + ) + ).toEqual([]); + } + expect(await openAiEndpoint.getExchanges()).toEqual([]); + }); + it("node_send_selects_correlated_response_after_idle", async () => { let releaseHook!: () => void; let hookEntered = false; diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 936313d50d..dd7a79b1cb 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, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerMetadata, McpServerSource, McpServerStatus, ModelChangeSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, RemediationAction, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompletionOutcome, UserToolSessionApproval, Verbosity +from .session_events import AbortReason, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerMetadata, McpServerSource, McpServerStatus, ModelChangeSource, PermissionDecisionSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, RemediationAction, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompletionOutcome, UserToolSessionApproval, Verbosity if TYPE_CHECKING: from .._jsonrpc import JsonRpcClient @@ -2728,7 +2728,8 @@ class EventsReadDirection(Enum): (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. + starts with the newest events. Events in each page remain chronological. This selects the + initial read only; a continuation always uses the direction bound into its cursor. """ BACKWARD = "backward" FORWARD = "forward" @@ -2782,30 +2783,6 @@ def to_dict(self) -> dict: result["cursor"] = from_str(self.cursor) return result -# Experimental: this type is part of an experimental API and may change or be removed. -class EventsCursorStatus(Enum): - """Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor - referred to an event that no longer exists in history (e.g. truncated or compacted away) - and the read fell back to a boundary of the remaining history (the beginning for a - forward read, the tail for a backward read). The fallback page is a fresh boundary - snapshot, not a continuation of the requested cursor, so it may overlap already-rendered - events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate - by event id) before continuing from the returned cursor. - - Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor - referred to an event that no longer exists in history (e.g. truncated or compacted away) - and the read fell back to a boundary of the remaining history. For a forward read the - fallback starts from the beginning of the remaining history; for a backward read it falls - back to the tail (the newest window). Because the fallback page is a fresh boundary - snapshot rather than a continuation of the requested cursor, it may overlap events the - consumer has already rendered — a backward fallback to the tail in particular can repeat - the newest window. On 'expired', consumers should reset or rebase their local pagination - state (or deduplicate by event id) before continuing from the returned cursor rather than - blindly appending/prepending the fallback page. - """ - EXPIRED = "expired" - OK = "ok" - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ExecuteCommandParams: @@ -3646,21 +3623,45 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class FleetStartRequest: - """Optional user prompt to combine with the fleet orchestration instructions.""" - + """Parameters for starting fleet orchestration: an optional user prompt combined with the + fleet instructions, plus the send options forwarded to the resulting turn. + """ + attachments: list[Attachment] | None = None + """Optional attachments (files, directories, selections, blobs, GitHub references) to + include with the fleet request + """ + # Internal: this field is an internal SDK API and is not part of the public surface. + billable: bool | None = None + """If false, this request will not trigger a Premium Request Unit charge. User requests + default to billable. + """ prompt: str | None = None """Optional user prompt to combine with fleet instructions""" + wait: bool | None = None + """If true, await completion of the agentic loop for this fleet request before returning. + Defaults to false. + """ + @staticmethod def from_dict(obj: Any) -> 'FleetStartRequest': assert isinstance(obj, dict) + attachments = from_union([lambda x: from_list(Attachment.from_dict, x), from_none], obj.get("attachments")) + billable = from_union([from_bool, from_none], obj.get("billable")) prompt = from_union([from_str, from_none], obj.get("prompt")) - return FleetStartRequest(prompt) + wait = from_union([from_bool, from_none], obj.get("wait")) + return FleetStartRequest(attachments, billable, prompt, wait) def to_dict(self) -> dict: result: dict = {} + if self.attachments is not None: + result["attachments"] = from_union([lambda x: from_list(lambda x: to_class(Attachment, x), x), from_none], self.attachments) + if self.billable is not None: + result["billable"] = from_union([from_bool, from_none], self.billable) if self.prompt is not None: result["prompt"] = from_union([from_str, from_none], self.prompt) + if self.wait is not None: + result["wait"] = from_union([from_bool, from_none], self.wait) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -4421,8 +4422,10 @@ class JSONSchemaResponseFormat: """Name of the output schema, subject to the provider's naming restrictions.""" schema: Any = None - """JSON Schema passed unchanged to the inference provider. Supported keywords and schema - restrictions are determined by that provider. + """JSON Schema passed unchanged to the inference provider. Schemas larger than 32 MiB when + JSON-encoded are rejected before admission, using the runtime's existing request-size + ceiling. This is not a guarantee that the entire model request fits. Supported keywords + and schema restrictions are determined by the provider. """ description: str | None = None """Optional description passed to OpenAI providers.""" @@ -7646,17 +7649,6 @@ class PermissionResponseCapability(Enum): INTERACTIVE = "interactive" NONE = "none" -# Experimental: this type is part of an experimental API and may change or be removed. -class PermissionDecisionSource(Enum): - """Controlled reason or actor responsible for the response. - - Controlled reason or actor responsible for a permission response. - """ - ASSISTED_APPROVAL = "assisted_approval" - HOST_POLICY = "host_policy" - HUMAN_RESPONSE = "human_response" - UNATTENDED_FALLBACK = "unattended_fallback" - # Experimental: this type is part of an experimental API and may change or be removed. class PermissionDecisionSurface(Enum): """Client surface that submitted the response. @@ -17243,14 +17235,20 @@ class SessionsReadPersistedEventsRequest: """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.""" - + """Opaque, process-local, single-use cursor returned by the previous persisted-event read. + Omit on the first call and issue continuations sequentially; reusing the same cursor + returns an expired terminal page. + """ 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. + starts with the newest events. Events in each page remain chronological. This selects the + initial read only; a continuation always uses the direction bound into its cursor. """ max: int | None = None - """Maximum number of events to return in this batch (1–1000, default 200).""" + """Maximum number of events to return in this batch (1–1000, default 200). Pages may contain + fewer events to keep the serialized event array within a soft 1 MiB budget including + resolved binary assets; one oversized event is returned alone to guarantee progress. + """ @staticmethod def from_dict(obj: Any) -> 'SessionsReadPersistedEventsRequest': @@ -17363,60 +17361,6 @@ def to_dict(self) -> dict: result["waitMs"] = from_union([from_int, from_none], self.wait_ms) return result -# Experimental: this type is part of an experimental API and may change or be removed. -@dataclass -class EventsReadResult: - """Batch of session events returned by a read, with cursor and continuation metadata.""" - - cursor: str - """Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue - from where this read left off. Always present, even when no events were returned. For a - backward read this cursor pages toward OLDER events; keep passing `direction: backward` - with it (the cursor is also self-describing, so backward paging continues correctly). - """ - cursor_status: EventsCursorStatus - """Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor - referred to an event that no longer exists in history (e.g. truncated or compacted away) - and the read fell back to a boundary of the remaining history. For a forward read the - fallback starts from the beginning of the remaining history; for a backward read it falls - back to the tail (the newest window). Because the fallback page is a fresh boundary - snapshot rather than a continuation of the requested cursor, it may overlap events the - consumer has already rendered — a backward fallback to the tail in particular can repeat - the newest window. On 'expired', consumers should reset or rebase their local pagination - state (or deduplicate by event id) before continuing from the returned cursor rather than - blindly appending/prepending the fallback page. - """ - events: list[SessionEvent] - """Session events for this batch, merged into a single stream in creation order: durable - (persisted) events and ephemeral events interleave exactly as they were emitted. Set - `includeEphemeral: false` to receive only durable events. Ephemeral events are never - replayable once pruned from the in-memory ring, so a consumer that needs them should keep - reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window - contains persisted events only, still in chronological (oldest-to-newest) append order. - """ - has_more: bool - """True when more events are available in the read's direction. For a forward read, true - means the batch returned `max` events and more are available immediately. For a backward - read, true means older persisted events remain before the returned window. - """ - - @staticmethod - def from_dict(obj: Any) -> 'EventsReadResult': - assert isinstance(obj, dict) - cursor = from_str(obj.get("cursor")) - cursor_status = EventsCursorStatus(obj.get("cursorStatus")) - events = from_list(SessionEvent.from_dict, obj.get("events")) - has_more = from_bool(obj.get("hasMore")) - return EventsReadResult(cursor, cursor_status, events, has_more) - - def to_dict(self) -> dict: - result: dict = {} - result["cursor"] = from_str(self.cursor) - result["cursorStatus"] = to_enum(EventsCursorStatus, self.cursor_status) - result["events"] = from_list(lambda x: to_class(SessionEvent, x), self.events) - result["hasMore"] = from_bool(self.has_more) - return result - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ExtensionLaunchProviderResolveRequest: @@ -20510,6 +20454,10 @@ class ModeSetRequest: compaction_decision: str | None = None """Explicit response to a model-switch compaction preflight.""" + expected_mode: SessionMode | None = None + """Mode the session must currently be in for the change to apply. When set and the session + is in a different mode the request is a no-op and reports status 'unchanged'. + """ inherit_plan_base_from_session_id: str | None = None """Session whose plan-mode base state should be inherited.""" @@ -20542,6 +20490,7 @@ def from_dict(obj: Any) -> 'ModeSetRequest': assert isinstance(obj, dict) mode = SessionMode(obj.get("mode")) compaction_decision = from_union([from_str, from_none], obj.get("compactionDecision")) + expected_mode = from_union([SessionMode, from_none], obj.get("expectedMode")) inherit_plan_base_from_session_id = from_union([from_str, from_none], obj.get("inheritPlanBaseFromSessionId")) persist_plan_selection = from_union([from_bool, from_none], obj.get("persistPlanSelection")) picker_settings_context = from_union([ModelPickerSettingsContext.from_dict, from_none], obj.get("pickerSettingsContext")) @@ -20551,13 +20500,15 @@ def from_dict(obj: Any) -> 'ModeSetRequest': plan_model_configured = from_union([from_bool, from_none], obj.get("planModelConfigured")) plan_reasoning_effort = from_union([from_str, from_none], obj.get("planReasoningEffort")) restore_plan_model = from_union([from_bool, from_none], obj.get("restorePlanModel")) - return ModeSetRequest(mode, compaction_decision, inherit_plan_base_from_session_id, persist_plan_selection, picker_settings_context, plan_context_tier, plan_exit_action, plan_model, plan_model_configured, plan_reasoning_effort, restore_plan_model) + return ModeSetRequest(mode, compaction_decision, expected_mode, inherit_plan_base_from_session_id, persist_plan_selection, picker_settings_context, plan_context_tier, plan_exit_action, plan_model, plan_model_configured, plan_reasoning_effort, restore_plan_model) def to_dict(self) -> dict: result: dict = {} result["mode"] = to_enum(SessionMode, self.mode) if self.compaction_decision is not None: result["compactionDecision"] = from_union([from_str, from_none], self.compaction_decision) + if self.expected_mode is not None: + result["expectedMode"] = from_union([lambda x: to_enum(SessionMode, x), from_none], self.expected_mode) if self.inherit_plan_base_from_session_id is not None: result["inheritPlanBaseFromSessionId"] = from_union([from_str, from_none], self.inherit_plan_base_from_session_id) if self.persist_plan_selection is not None: @@ -20636,6 +20587,11 @@ class ModeSetResult: message: str | None = None """User-facing outcome message for the model switch triggered by the mode change.""" + mode_applied: bool | None = None + """Whether the requested mode was applied to the session. False only when an 'expectedMode' + precondition did not hold, in which case any model change reported alongside it was still + applied. + """ warning: str | None = None """User-facing warning produced while applying the mode change.""" @@ -20649,8 +20605,9 @@ def from_dict(obj: Any) -> 'ModeSetResult': defer_implementation = from_union([from_bool, from_none], obj.get("deferImplementation")) deprecation_warnings = from_union([lambda x: from_list(from_str, x), from_none], obj.get("deprecationWarnings")) message = from_union([from_str, from_none], obj.get("message")) + mode_applied = from_union([from_bool, from_none], obj.get("modeApplied")) warning = from_union([from_str, from_none], obj.get("warning")) - return ModeSetResult(model_changed, status, arm_interactive_continuation, confirmation, defer_implementation, deprecation_warnings, message, warning) + return ModeSetResult(model_changed, status, arm_interactive_continuation, confirmation, defer_implementation, deprecation_warnings, message, mode_applied, warning) def to_dict(self) -> dict: result: dict = {} @@ -20666,6 +20623,8 @@ def to_dict(self) -> dict: result["deprecationWarnings"] = from_union([lambda x: from_list(from_str, x), from_none], self.deprecation_warnings) if self.message is not None: result["message"] = from_union([from_str, from_none], self.message) + if self.mode_applied is not None: + result["modeApplied"] = from_union([from_bool, from_none], self.mode_applied) if self.warning is not None: result["warning"] = from_union([from_str, from_none], self.warning) return result @@ -33063,6 +33022,10 @@ class SessionOpenOptions: reasoning_summary: ReasoningSummary | None = None """Initial reasoning summary mode for supported model clients.""" + refresh_custom_instructions: bool | None = None + """Whether to invalidate cached custom-instruction discovery before constructing the + session. Use when instruction files may have changed earlier in the same runtime process. + """ remote_defaulted_on: bool | None = None """Telemetry-only remote-defaulted flag.""" @@ -33176,6 +33139,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': providers = from_union([lambda x: from_list(NamedProviderConfig.from_dict, x), from_none], obj.get("providers")) reasoning_effort = from_union([from_str, from_none], obj.get("reasoningEffort")) reasoning_summary = from_union([ReasoningSummary, from_none], obj.get("reasoningSummary")) + refresh_custom_instructions = from_union([from_bool, from_none], obj.get("refreshCustomInstructions")) remote_defaulted_on = from_union([from_bool, from_none], obj.get("remoteDefaultedOn")) remote_exporting = from_union([from_bool, from_none], obj.get("remoteExporting")) remote_steerable = from_union([from_bool, from_none], obj.get("remoteSteerable")) @@ -33194,7 +33158,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': verbosity = from_union([Verbosity, from_none], obj.get("verbosity")) working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) working_directory_context = from_union([SessionContext.from_dict, from_none], obj.get("workingDirectoryContext")) - return SessionOpenOptions(additional_content_exclusion_policies, additional_directories, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, auth_client_id_metadata_url, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_mcp_servers, disabled_skills, enable_citations, enable_file_change_tracking, enable_managed_settings, enable_on_demand_instruction_discovery, enable_script_safety, enable_skills, enable_streaming, env_value_mode, events_log_directory, events_log_includes_subagents, excluded_builtin_agents, excluded_tools, exp_assignments, feature_flags, has_skill_provider, included_builtin_agents, included_builtin_skills, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, managed_settings, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, sandbox_config_source, session_capabilities, session_id, session_limits, shell, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, verbosity, working_directory, working_directory_context) + return SessionOpenOptions(additional_content_exclusion_policies, additional_directories, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, auth_client_id_metadata_url, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_mcp_servers, disabled_skills, enable_citations, enable_file_change_tracking, enable_managed_settings, enable_on_demand_instruction_discovery, enable_script_safety, enable_skills, enable_streaming, env_value_mode, events_log_directory, events_log_includes_subagents, excluded_builtin_agents, excluded_tools, exp_assignments, feature_flags, has_skill_provider, included_builtin_agents, included_builtin_skills, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, managed_settings, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, refresh_custom_instructions, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, sandbox_config_source, session_capabilities, session_id, session_limits, shell, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, verbosity, working_directory, working_directory_context) def to_dict(self) -> dict: result: dict = {} @@ -33306,6 +33270,8 @@ def to_dict(self) -> dict: result["reasoningEffort"] = from_union([from_str, from_none], self.reasoning_effort) if self.reasoning_summary is not None: result["reasoningSummary"] = from_union([lambda x: to_enum(ReasoningSummary, x), from_none], self.reasoning_summary) + if self.refresh_custom_instructions is not None: + result["refreshCustomInstructions"] = from_union([from_bool, from_none], self.refresh_custom_instructions) if self.remote_defaulted_on is not None: result["remoteDefaultedOn"] = from_union([from_bool, from_none], self.remote_defaulted_on) if self.remote_exporting is not None: @@ -33995,7 +33961,7 @@ class CopilotUserResponse: """Per-category monthly quota allotments, keyed by quota category.""" organization_list: Any = None - """Organizations the user belongs to, each with an optional login and display name.""" + """Organizations the user belongs to, each with an optional ID, login, and display name.""" organization_login_list: list[str] | None = None """Logins of the organizations the user belongs to.""" @@ -34622,6 +34588,80 @@ def to_dict(self) -> dict: result["login"] = from_union([from_str, from_none], self.login) return result +# Experimental: this type is part of an experimental API and may change or be removed. +class EventsCursorStatus(Enum): + """Cursor status: 'ok' means the read succeeded against the requested history; 'expired' + means the requested continuation is unavailable. Recovery is endpoint-specific: + session.eventLog.read returns a boundary window of remaining active history that may + overlap prior pages, while sessions.readPersistedEvents returns an empty terminal page + and never switches journal generations. An expired persisted read is not successful + completion; a complete persisted snapshot requires cursorStatus 'ok' and hasMore false. + + Cursor status: 'ok' means the cursor was applied successfully. For session.eventLog.read, + 'expired' means the cursor referred to an event that no longer exists in active history + and the read fell back to a boundary of the remaining history: the beginning for a + forward read or the newest window for a backward read. That fallback may overlap already + rendered events, so active-session consumers should reset, rebase, or deduplicate before + continuing. sessions.readPersistedEvents has stricter snapshot semantics: 'expired' + returns an empty terminal page and never switches to a replacement journal generation. + Other persisted-read I/O failures are RPC errors with diagnostics, not cursor expiry. + """ + EXPIRED = "expired" + OK = "ok" + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class EventsReadResult: + """Batch of session events returned by a read, with cursor and continuation metadata.""" + + cursor: str + """Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue + from where this read left off. Always present, even when no events were returned. For a + backward read this cursor pages toward OLDER events; keep passing `direction: backward` + with it (the cursor is also self-describing, so backward paging continues correctly). + """ + cursor_status: EventsCursorStatus + """Cursor status: 'ok' means the cursor was applied successfully. For session.eventLog.read, + 'expired' means the cursor referred to an event that no longer exists in active history + and the read fell back to a boundary of the remaining history: the beginning for a + forward read or the newest window for a backward read. That fallback may overlap already + rendered events, so active-session consumers should reset, rebase, or deduplicate before + continuing. sessions.readPersistedEvents has stricter snapshot semantics: 'expired' + returns an empty terminal page and never switches to a replacement journal generation. + Other persisted-read I/O failures are RPC errors with diagnostics, not cursor expiry. + """ + events: list[SessionEvent] + """Session events for this batch, merged into a single stream in creation order: durable + (persisted) events and ephemeral events interleave exactly as they were emitted. Set + `includeEphemeral: false` to receive only durable events. Ephemeral events are never + replayable once pruned from the in-memory ring, so a consumer that needs them should keep + reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window + contains persisted events only, still in chronological (oldest-to-newest) append order. + """ + has_more: bool + """True when more events are available in the read's direction. For a backward read, true + means older persisted events remain before the returned window. A persisted-event page + may contain fewer than `max` events because of its byte budget while still reporting + hasMore true; continue according to this flag rather than the event count. + """ + + @staticmethod + def from_dict(obj: Any) -> 'EventsReadResult': + assert isinstance(obj, dict) + cursor = from_str(obj.get("cursor")) + cursor_status = EventsCursorStatus(obj.get("cursorStatus")) + events = from_list(SessionEvent.from_dict, obj.get("events")) + has_more = from_bool(obj.get("hasMore")) + return EventsReadResult(cursor, cursor_status, events, has_more) + + def to_dict(self) -> dict: + result: dict = {} + result["cursor"] = from_str(self.cursor) + result["cursorStatus"] = to_enum(EventsCursorStatus, self.cursor_status) + result["events"] = from_list(lambda x: to_class(SessionEvent, x), self.events) + result["hasMore"] = from_bool(self.has_more) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class FactoryAgentSummary: @@ -37797,7 +37837,6 @@ class RPC: permission_decision_outcome: PermissionDecisionOutcome permission_decision_reject: PermissionDecisionReject permission_decision_request: PermissionDecisionRequest - permission_decision_source: PermissionDecisionSource permission_decision_surface: PermissionDecisionSurface permission_decision_user_not_available: PermissionDecisionUserNotAvailable permission_location_add_tool_approval_params: PermissionLocationAddToolApprovalParams @@ -39037,7 +39076,6 @@ def from_dict(obj: Any) -> 'RPC': permission_decision_outcome = PermissionDecisionOutcome(obj.get("PermissionDecisionOutcome")) permission_decision_reject = PermissionDecisionReject.from_dict(obj.get("PermissionDecisionReject")) permission_decision_request = PermissionDecisionRequest.from_dict(obj.get("PermissionDecisionRequest")) - permission_decision_source = PermissionDecisionSource(obj.get("PermissionDecisionSource")) permission_decision_surface = PermissionDecisionSurface(obj.get("PermissionDecisionSurface")) permission_decision_user_not_available = PermissionDecisionUserNotAvailable.from_dict(obj.get("PermissionDecisionUserNotAvailable")) permission_location_add_tool_approval_params = PermissionLocationAddToolApprovalParams.from_dict(obj.get("PermissionLocationAddToolApprovalParams")) @@ -39643,7 +39681,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, autopilot_objective_credit_limit, autopilot_objective_get_state_result, autopilot_objective_state, autopilot_objective_status, 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, client_metadata, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, 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_pause_checkpoint_action, factory_pause_checkpoint_request, factory_pause_checkpoint_result, factory_pause_info, factory_pause_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, json_schema_response_format, 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_source_file, mcp_source_plugin, mcp_source_ref, 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, metadata_update_client_metadata_request, 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_allowed_models_request, model_set_allowed_models_result, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, 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_install_staging_mode, 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, response_format, 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_disable_for_session_request, sandbox_disable_for_session_result, 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_factory_pause_at_checkpoint_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_client_metadata_entry, 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_client_metadata_request, sessions_get_client_metadata_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, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, 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_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, 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_register_request, tasks_register_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_update_request, tasks_update_result, 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, autopilot_objective_credit_limit, autopilot_objective_get_state_result, autopilot_objective_state, autopilot_objective_status, 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, client_metadata, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, 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_pause_checkpoint_action, factory_pause_checkpoint_request, factory_pause_checkpoint_result, factory_pause_info, factory_pause_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, json_schema_response_format, 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_source_file, mcp_source_plugin, mcp_source_ref, 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, metadata_update_client_metadata_request, 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_allowed_models_request, model_set_allowed_models_result, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, 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_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_install_staging_mode, 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, response_format, 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_disable_for_session_request, sandbox_disable_for_session_result, 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_factory_pause_at_checkpoint_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_client_metadata_entry, 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_client_metadata_request, sessions_get_client_metadata_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, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, 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_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, 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_register_request, tasks_register_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_update_request, tasks_update_result, 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 = {} @@ -40277,7 +40315,6 @@ def to_dict(self) -> dict: result["PermissionDecisionOutcome"] = to_enum(PermissionDecisionOutcome, self.permission_decision_outcome) result["PermissionDecisionReject"] = to_class(PermissionDecisionReject, self.permission_decision_reject) result["PermissionDecisionRequest"] = to_class(PermissionDecisionRequest, self.permission_decision_request) - result["PermissionDecisionSource"] = to_enum(PermissionDecisionSource, self.permission_decision_source) result["PermissionDecisionSurface"] = to_enum(PermissionDecisionSurface, self.permission_decision_surface) result["PermissionDecisionUserNotAvailable"] = to_class(PermissionDecisionUserNotAvailable, self.permission_decision_user_not_available) result["PermissionLocationAddToolApprovalParams"] = to_class(PermissionLocationAddToolApprovalParams, self.permission_location_add_tool_approval_params) @@ -41780,7 +41817,7 @@ async def get_client_metadata(self, params: SessionsGetClientMetadataRequest, *, return list(await self._client.request("sessions.getClientMetadata", 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." + "Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The first read pins the currently opened journal generation and its byte-length boundary; opaque cursor continuations remain on that generation across runtime-owned compaction, truncation, and rewrite operations, which replace the live path atomically, and events appended after the boundary are excluded. For cold hydration, await the first successful page before activation and establish lossless live-event buffering before resume; merge subsequent live events by ID, preserving persisted order and letting live payloads win. Continuations are process-local, single-use capabilities bound to the originating session and storage context and must be paged sequentially; concurrent or repeated use of the same cursor expires that duplicate read rather than reading the generation twice. A complete snapshot has cursorStatus 'ok' and hasMore false. Snapshots expire after five idle minutes, with at most eight retained per process and idle-only eviction under pressure; completion and cancelled-worker exit release their handles. No transcript copy is created, but retained handles may keep replaced files' disk blocks alive until release. Pages have a soft 1 MiB serialized event-array budget including resolved binary assets; one oversized event is returned alone to guarantee progress. Working memory also includes a record/lookahead and asset resolution; resolving the first binary reference may scan the full pinned generation to build a bounded offset index. If the snapshot expires, is evicted, is cancelled before a continuation is established, or becomes unreadable after an observable unsupported in-place shortening, the continuation returns cursorStatus 'expired' with an empty terminal page and never falls back to a different generation. A missing or initially unreadable journal is an RPC error. Persisted history excludes ephemeral events and may omit payloads that are reconstructed only for an active session; use the active session event stream for post-resume live events.\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))) @@ -42404,7 +42441,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def start(self, params: FleetStartRequest, *, timeout: float | None = None) -> FleetStartResult: - "Starts fleet mode by submitting the fleet orchestration prompt to the session.\n\nArgs:\n params: Optional user prompt to combine with the fleet orchestration instructions.\n\nReturns:\n Indicates whether fleet mode was successfully activated." + "Starts fleet mode by submitting the fleet orchestration prompt to the session.\n\nArgs:\n params: Parameters for starting fleet orchestration: an optional user prompt combined with the fleet instructions, plus the send options forwarded to the resulting turn.\n\nReturns:\n Indicates whether fleet mode was successfully activated." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return FleetStartResult.from_dict(await self._client.request("session.fleet.start", params_dict, **_timeout_kwargs(timeout))) @@ -44983,7 +45020,6 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "PermissionDecisionReject", "PermissionDecisionRejectKind", "PermissionDecisionRequest", - "PermissionDecisionSource", "PermissionDecisionSurface", "PermissionDecisionUserNotAvailable", "PermissionDecisionUserNotAvailableKind", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index a893d68fd6..5126b81bf7 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -221,6 +221,14 @@ class SessionEventType(Enum): SYSTEM_NOTIFICATION = "system.notification" PERMISSION_REQUESTED = "permission.requested" PERMISSION_COMPLETED = "permission.completed" + # Experimental: this event is part of an experimental API and may change or be removed. + PERMISSION_CARRIED_FORWARD = "permission.carriedForward" + # Experimental: this event is part of an experimental API and may change or be removed. + PERMISSION_MESSAGE_AUTHORIZATION = "permission.messageAuthorization" + # Experimental: this event is part of an experimental API and may change or be removed. + PERMISSION_MESSAGE_AUTHORIZATION_READ = "permission.messageAuthorizationRead" + # Experimental: this event is part of an experimental API and may change or be removed. + PERMISSION_MESSAGE_AUTHORIZATION_DEGRADED = "permission.messageAuthorizationDegraded" USER_INPUT_REQUESTED = "user_input.requested" USER_INPUT_COMPLETED = "user_input.completed" ELICITATION_REQUESTED = "elicitation.requested" @@ -1483,6 +1491,148 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class PermissionCarriedForwardData: + "Records that a live authorization record from an earlier human decision in this session contained a permission proposal, so it ran without another prompt. This mints no authority: it accounts for one more effect against the prior grant, which is what lets a replayed session agree with the live one about how much of that grant is left." + # Experimental: this field is part of an experimental API and may change or be removed. + decision_source: PermissionDecisionSource + # Experimental: this field is part of an experimental API and may change or be removed. + record_id: str + # Experimental: this field is part of an experimental API and may change or be removed. + request_id: str + # Experimental: this field is part of an experimental API and may change or be removed. + tool_call_id: str + + @staticmethod + def from_dict(obj: Any) -> "PermissionCarriedForwardData": + assert isinstance(obj, dict) + decision_source = parse_enum(PermissionDecisionSource, obj.get("decisionSource")) + record_id = from_str(obj.get("recordId")) + request_id = from_str(obj.get("requestId")) + tool_call_id = from_str(obj.get("toolCallId")) + return PermissionCarriedForwardData( + decision_source=decision_source, + record_id=record_id, + request_id=request_id, + tool_call_id=tool_call_id, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["decisionSource"] = to_enum(PermissionDecisionSource, self.decision_source) + result["recordId"] = from_str(self.record_id) + result["requestId"] = from_str(self.request_id) + result["toolCallId"] = from_str(self.tool_call_id) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class PermissionMessageAuthorizationData: + "Freezes one blinded, verbatim-verified authorization claim the runtime minted from a human user message, so a resumed session re-establishes the same grant deterministically instead of re-running the extraction model. This mints no authority on its own: it records what a blinded proposer pointed at and the trusted discriminator the runtime established, and deterministic establishment runs on replay. Persisted so recorded authority survives compaction and process resume." + # Experimental: this field is part of an experimental API and may change or be removed. + action_class: str + # Experimental: this field is part of an experimental API and may change or be removed. + polarity: PermissionMessageAuthorizationPolarity + # Experimental: this field is part of an experimental API and may change or be removed. + record_id: str + # Experimental: this field is part of an experimental API and may change or be removed. + span_end: int + # Experimental: this field is part of an experimental API and may change or be removed. + span_start: int + # Experimental: this field is part of an experimental API and may change or be removed. + turn_index: int + # Experimental: this field is part of an experimental API and may change or be removed. + target_members: list[str] | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + task: str | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + world: Any = None + + @staticmethod + def from_dict(obj: Any) -> "PermissionMessageAuthorizationData": + assert isinstance(obj, dict) + action_class = from_str(obj.get("actionClass")) + polarity = parse_enum(PermissionMessageAuthorizationPolarity, obj.get("polarity")) + record_id = from_str(obj.get("recordId")) + span_end = from_int(obj.get("spanEnd")) + span_start = from_int(obj.get("spanStart")) + turn_index = from_int(obj.get("turnIndex")) + target_members = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("targetMembers")) + task = from_union([from_none, from_str], obj.get("task")) + world = obj.get("world") + return PermissionMessageAuthorizationData( + action_class=action_class, + polarity=polarity, + record_id=record_id, + span_end=span_end, + span_start=span_start, + turn_index=turn_index, + target_members=target_members, + task=task, + world=world, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["actionClass"] = from_str(self.action_class) + result["polarity"] = to_enum(PermissionMessageAuthorizationPolarity, self.polarity) + result["recordId"] = from_str(self.record_id) + result["spanEnd"] = to_int(self.span_end) + result["spanStart"] = to_int(self.span_start) + result["turnIndex"] = to_int(self.turn_index) + if self.target_members is not None: + result["targetMembers"] = from_union([from_none, lambda x: from_list(from_str, x)], self.target_members) + if self.task is not None: + result["task"] = from_union([from_none, from_str], self.task) + if self.world is not None: + result["world"] = self.world + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class PermissionMessageAuthorizationDegradedData: + "Records that message-backed authorization could not safely represent one human turn before compaction. The runtime may compact the original message after this marker is durable, but message-derived carry-forward and assisted auto-approval remain disabled for the rest of the session so subsequent commands continue through the ordinary permission prompt." + # Experimental: this field is part of an experimental API and may change or be removed. + turn_index: int + + @staticmethod + def from_dict(obj: Any) -> "PermissionMessageAuthorizationDegradedData": + assert isinstance(obj, dict) + turn_index = from_int(obj.get("turnIndex")) + return PermissionMessageAuthorizationDegradedData( + turn_index=turn_index, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["turnIndex"] = to_int(self.turn_index) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class PermissionMessageAuthorizationReadData: + "Records that one human turn has been read by the blinded authorization proposer, whether or not it minted anything, so a resumed session does not re-run the extraction model on a turn the live session already read. Persisted purely to avoid wasted model calls across resume; it is never a correctness mechanism." + # Experimental: this field is part of an experimental API and may change or be removed. + turn_index: int + + @staticmethod + def from_dict(obj: Any) -> "PermissionMessageAuthorizationReadData": + assert isinstance(obj, dict) + turn_index = from_int(obj.get("turnIndex")) + return PermissionMessageAuthorizationReadData( + turn_index=turn_index, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["turnIndex"] = to_int(self.turn_index) + return result + + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionAutoModeResolvedData: @@ -5881,6 +6031,8 @@ class PermissionCompletedData: "Permission request completion notification signaling UI dismissal" request_id: str result: PermissionResult + # Experimental: this field is part of an experimental API and may change or be removed. + decision_source: PermissionDecisionSource | None = None tool_call_id: str | None = None @staticmethod @@ -5888,10 +6040,12 @@ def from_dict(obj: Any) -> "PermissionCompletedData": assert isinstance(obj, dict) request_id = from_str(obj.get("requestId")) result = _load_PermissionResult(obj.get("result")) + decision_source = from_union([from_none, lambda x: parse_enum(PermissionDecisionSource, x)], obj.get("decisionSource")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) return PermissionCompletedData( request_id=request_id, result=result, + decision_source=decision_source, tool_call_id=tool_call_id, ) @@ -5899,6 +6053,8 @@ def to_dict(self) -> dict: result: dict = {} result["requestId"] = from_str(self.request_id) result["result"] = self.result.to_dict() + if self.decision_source is not None: + result["decisionSource"] = from_union([from_none, lambda x: to_enum(PermissionDecisionSource, x)], self.decision_source) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) return result @@ -6537,6 +6693,8 @@ class PermissionPromptRequestRead: # Experimental: this field is part of an experimental API and may change or be removed. assisted_approval: PermissionAssistedApproval | None = None managed_approval_required: bool | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + resolved_path: str | None = None tool_call_id: str | None = None @staticmethod @@ -6546,12 +6704,14 @@ def from_dict(obj: Any) -> "PermissionPromptRequestRead": path = from_str(obj.get("path")) assisted_approval = from_union([from_none, PermissionAssistedApproval.from_dict], obj.get("assistedApproval")) managed_approval_required = from_union([from_none, from_bool], obj.get("managedApprovalRequired")) + resolved_path = from_union([from_none, from_str], obj.get("resolvedPath")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) return PermissionPromptRequestRead( intention=intention, path=path, assisted_approval=assisted_approval, managed_approval_required=managed_approval_required, + resolved_path=resolved_path, tool_call_id=tool_call_id, ) @@ -6564,6 +6724,8 @@ def to_dict(self) -> dict: result["assistedApproval"] = from_union([from_none, lambda x: to_class(PermissionAssistedApproval, x)], self.assisted_approval) if self.managed_approval_required is not None: result["managedApprovalRequired"] = from_union([from_none, from_bool], self.managed_approval_required) + if self.resolved_path is not None: + result["resolvedPath"] = from_union([from_none, from_str], self.resolved_path) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) return result @@ -6637,6 +6799,8 @@ class PermissionPromptRequestWrite: assisted_approval: PermissionAssistedApproval | None = None managed_approval_required: bool | None = None new_file_contents: str | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + resolved_path: str | None = None tool_call_id: str | None = None @staticmethod @@ -6649,6 +6813,7 @@ def from_dict(obj: Any) -> "PermissionPromptRequestWrite": assisted_approval = from_union([from_none, PermissionAssistedApproval.from_dict], obj.get("assistedApproval")) managed_approval_required = from_union([from_none, from_bool], obj.get("managedApprovalRequired")) new_file_contents = from_union([from_none, from_str], obj.get("newFileContents")) + resolved_path = from_union([from_none, from_str], obj.get("resolvedPath")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) return PermissionPromptRequestWrite( can_offer_session_approval=can_offer_session_approval, @@ -6658,6 +6823,7 @@ def from_dict(obj: Any) -> "PermissionPromptRequestWrite": assisted_approval=assisted_approval, managed_approval_required=managed_approval_required, new_file_contents=new_file_contents, + resolved_path=resolved_path, tool_call_id=tool_call_id, ) @@ -6674,6 +6840,8 @@ def to_dict(self) -> dict: result["managedApprovalRequired"] = from_union([from_none, from_bool], self.managed_approval_required) if self.new_file_contents is not None: result["newFileContents"] = from_union([from_none, from_str], self.new_file_contents) + if self.resolved_path is not None: + result["resolvedPath"] = from_union([from_none, from_str], self.resolved_path) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) return result @@ -7097,6 +7265,8 @@ class PermissionRequestRead: managed_approval_required: bool | None = None request_sandbox_bypass: bool | None = None request_sandbox_bypass_reason: str | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + resolved_path: str | None = None tool_call_id: str | None = None @staticmethod @@ -7107,6 +7277,7 @@ def from_dict(obj: Any) -> "PermissionRequestRead": managed_approval_required = from_union([from_none, from_bool], obj.get("managedApprovalRequired")) request_sandbox_bypass = from_union([from_none, from_bool], obj.get("requestSandboxBypass")) request_sandbox_bypass_reason = from_union([from_none, from_str], obj.get("requestSandboxBypassReason")) + resolved_path = from_union([from_none, from_str], obj.get("resolvedPath")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) return PermissionRequestRead( intention=intention, @@ -7114,6 +7285,7 @@ def from_dict(obj: Any) -> "PermissionRequestRead": managed_approval_required=managed_approval_required, request_sandbox_bypass=request_sandbox_bypass, request_sandbox_bypass_reason=request_sandbox_bypass_reason, + resolved_path=resolved_path, tool_call_id=tool_call_id, ) @@ -7128,6 +7300,8 @@ def to_dict(self) -> dict: result["requestSandboxBypass"] = from_union([from_none, from_bool], self.request_sandbox_bypass) if self.request_sandbox_bypass_reason is not None: result["requestSandboxBypassReason"] = from_union([from_none, from_str], self.request_sandbox_bypass_reason) + if self.resolved_path is not None: + result["resolvedPath"] = from_union([from_none, from_str], self.resolved_path) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) return result @@ -7149,6 +7323,10 @@ class PermissionRequestShell: request_sandbox_bypass: bool | None = None request_sandbox_bypass_reason: str | None = None request_sandbox_permissive: bool | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + resolved_paths: dict[str, str] | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + resolved_working_directory: str | None = None tool_call_id: str | None = None warning: str | None = None @@ -7167,6 +7345,8 @@ def from_dict(obj: Any) -> "PermissionRequestShell": request_sandbox_bypass = from_union([from_none, from_bool], obj.get("requestSandboxBypass")) request_sandbox_bypass_reason = from_union([from_none, from_str], obj.get("requestSandboxBypassReason")) request_sandbox_permissive = from_union([from_none, from_bool], obj.get("requestSandboxPermissive")) + resolved_paths = from_union([from_none, lambda x: from_dict(from_str, x)], obj.get("resolvedPaths")) + resolved_working_directory = from_union([from_none, from_str], obj.get("resolvedWorkingDirectory")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) warning = from_union([from_none, from_str], obj.get("warning")) return PermissionRequestShell( @@ -7182,6 +7362,8 @@ def from_dict(obj: Any) -> "PermissionRequestShell": request_sandbox_bypass=request_sandbox_bypass, request_sandbox_bypass_reason=request_sandbox_bypass_reason, request_sandbox_permissive=request_sandbox_permissive, + resolved_paths=resolved_paths, + resolved_working_directory=resolved_working_directory, tool_call_id=tool_call_id, warning=warning, ) @@ -7206,6 +7388,10 @@ def to_dict(self) -> dict: result["requestSandboxBypassReason"] = from_union([from_none, from_str], self.request_sandbox_bypass_reason) if self.request_sandbox_permissive is not None: result["requestSandboxPermissive"] = from_union([from_none, from_bool], self.request_sandbox_permissive) + if self.resolved_paths is not None: + result["resolvedPaths"] = from_union([from_none, lambda x: from_dict(from_str, x)], self.resolved_paths) + if self.resolved_working_directory is not None: + result["resolvedWorkingDirectory"] = from_union([from_none, from_str], self.resolved_working_directory) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) if self.warning is not None: @@ -7340,6 +7526,8 @@ class PermissionRequestWrite: new_file_contents: str | None = None request_sandbox_bypass: bool | None = None request_sandbox_bypass_reason: str | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + resolved_path: str | None = None tool_call_id: str | None = None @staticmethod @@ -7353,6 +7541,7 @@ def from_dict(obj: Any) -> "PermissionRequestWrite": new_file_contents = from_union([from_none, from_str], obj.get("newFileContents")) request_sandbox_bypass = from_union([from_none, from_bool], obj.get("requestSandboxBypass")) request_sandbox_bypass_reason = from_union([from_none, from_str], obj.get("requestSandboxBypassReason")) + resolved_path = from_union([from_none, from_str], obj.get("resolvedPath")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) return PermissionRequestWrite( can_offer_session_approval=can_offer_session_approval, @@ -7363,6 +7552,7 @@ def from_dict(obj: Any) -> "PermissionRequestWrite": new_file_contents=new_file_contents, request_sandbox_bypass=request_sandbox_bypass, request_sandbox_bypass_reason=request_sandbox_bypass_reason, + resolved_path=resolved_path, tool_call_id=tool_call_id, ) @@ -7381,6 +7571,8 @@ def to_dict(self) -> dict: result["requestSandboxBypass"] = from_union([from_none, from_bool], self.request_sandbox_bypass) if self.request_sandbox_bypass_reason is not None: result["requestSandboxBypassReason"] = from_union([from_none, from_str], self.request_sandbox_bypass_reason) + if self.resolved_path is not None: + result["resolvedPath"] = from_union([from_none, from_str], self.resolved_path) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) return result @@ -12130,6 +12322,15 @@ class FusionTurnKind(Enum): COMPACTION = "compaction" +# Experimental: this enum is part of an experimental API and may change or be removed. +class PermissionMessageAuthorizationPolarity(Enum): + "Which direction a message-backed authorization claim moves authority in." + # The human's words authorized an effect. + GRANT = "grant" + # The human's words refused an effect. + DENIAL = "denial" + + # Experimental: this enum is part of an experimental API and may change or be removed. class PermissionMode(Enum): "Permission mode for the session." @@ -12666,6 +12867,20 @@ class OmittedBinaryType(Enum): RESOURCE = "resource" +class PermissionDecisionSource(Enum): + "Controlled reason or actor responsible for a permission response." + # The response followed the assisted-approval judge recommendation. + ASSISTED_APPROVAL = "assisted_approval" + # A human supplied the response through an interactive prompt. + HUMAN_RESPONSE = "human_response" + # The host applied a standing policy or override rather than a judge recommendation or human decision. + HOST_POLICY = "host_policy" + # The host denied the request because no interactive user response was available. + UNATTENDED_FALLBACK = "unattended_fallback" + # A live authorization record from an earlier human decision in this session contained the proposal, so it ran without another prompt. This is not a new human decision and never mints authority of its own. + AUTHORIZATION_CARRY_FORWARD = "authorization_carry_forward" + + class PermissionPromptRequestPathAccessKind(Enum): "Underlying permission kind that needs path approval" # Read access to a filesystem path. @@ -12968,7 +13183,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionAutoTierRecommendationData | SessionAutoTierSwitchFailedData | 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 | SessionMcpServerRemovedData | SessionMcpServerNeedsReconnectData | 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 | SessionAutoTierRecommendationData | SessionAutoTierSwitchFailedData | 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 | PermissionCarriedForwardData | PermissionMessageAuthorizationData | PermissionMessageAuthorizationReadData | PermissionMessageAuthorizationDegradedData | 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 | SessionMcpServerRemovedData | SessionMcpServerNeedsReconnectData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -13080,6 +13295,10 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SYSTEM_NOTIFICATION: data = SystemNotificationData.from_dict(data_obj) case SessionEventType.PERMISSION_REQUESTED: data = PermissionRequestedData.from_dict(data_obj) case SessionEventType.PERMISSION_COMPLETED: data = PermissionCompletedData.from_dict(data_obj) + case SessionEventType.PERMISSION_CARRIED_FORWARD: data = PermissionCarriedForwardData.from_dict(data_obj) + case SessionEventType.PERMISSION_MESSAGE_AUTHORIZATION: data = PermissionMessageAuthorizationData.from_dict(data_obj) + case SessionEventType.PERMISSION_MESSAGE_AUTHORIZATION_READ: data = PermissionMessageAuthorizationReadData.from_dict(data_obj) + case SessionEventType.PERMISSION_MESSAGE_AUTHORIZATION_DEGRADED: data = PermissionMessageAuthorizationDegradedData.from_dict(data_obj) case SessionEventType.USER_INPUT_REQUESTED: data = UserInputRequestedData.from_dict(data_obj) case SessionEventType.USER_INPUT_COMPLETED: data = UserInputCompletedData.from_dict(data_obj) case SessionEventType.ELICITATION_REQUESTED: data = ElicitationRequestedData.from_dict(data_obj) @@ -13351,12 +13570,18 @@ def session_event_to_dict(x: SessionEvent) -> Any: "PermissionApprovedForSession", "PermissionAssistedApproval", "PermissionCancelled", + "PermissionCarriedForwardData", "PermissionCompletedData", + "PermissionDecisionSource", "PermissionDeniedByContentExclusionPolicy", "PermissionDeniedByPermissionRequestHook", "PermissionDeniedByRules", "PermissionDeniedInteractivelyByUser", "PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser", + "PermissionMessageAuthorizationData", + "PermissionMessageAuthorizationDegradedData", + "PermissionMessageAuthorizationPolarity", + "PermissionMessageAuthorizationReadData", "PermissionMode", "PermissionPromptRequest", "PermissionPromptRequestCommands", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 33230f0dd7..3a29f45366 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -12,9 +12,10 @@ use serde::{Deserialize, Serialize}; use super::session_events::{ AbortReason, AgentModelPolicy, AutoTier, ContextTier, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerMetadata, McpServerSource, McpServerStatus, - ModelChangeSource, OmittedBinaryOmittedReason, PermissionMode, PermissionPromptRequest, - PermissionRule, ReasoningSummary, RemediationAction, SessionLimitsConfig, SessionMode, - ShutdownType, SkillSource, TaskCompletionOutcome, UserToolSessionApproval, Verbosity, + ModelChangeSource, OmittedBinaryOmittedReason, PermissionDecisionSource, PermissionMode, + PermissionPromptRequest, PermissionRule, ReasoningSummary, RemediationAction, + SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompletionOutcome, + UserToolSessionApproval, Verbosity, }; use crate::types::{RequestId, SessionEvent, SessionId}; @@ -1143,7 +1144,7 @@ pub struct CopilotUserResponse { /// Per-category monthly quota allotments, keyed by quota category. #[serde(rename = "monthly_quotas", skip_serializing_if = "Option::is_none")] pub monthly_quotas: Option>, - /// Organizations the user belongs to, each with an optional login and display name. + /// Organizations the user belongs to, each with an optional ID, login, and display name. #[serde(rename = "organization_list", skip_serializing_if = "Option::is_none")] pub organization_list: Option, /// Logins of the organizations the user belongs to. @@ -4780,11 +4781,11 @@ pub struct EventLogTailResult { pub struct EventsReadResult { /// Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. 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. + /// Cursor status: 'ok' means the cursor was applied successfully. For session.eventLog.read, 'expired' means the cursor referred to an event that no longer exists in active history and the read fell back to a boundary of the remaining history: the beginning for a forward read or the newest window for a backward read. That fallback may overlap already rendered events, so active-session consumers should reset, rebase, or deduplicate before continuing. sessions.readPersistedEvents has stricter snapshot semantics: 'expired' returns an empty terminal page and never switches to a replacement journal generation. Other persisted-read I/O failures are RPC errors with diagnostics, not cursor expiry. 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. + /// True when more events are available in the read's direction. For a backward read, true means older persisted events remain before the returned window. A persisted-event page may contain fewer than `max` events because of its byte budget while still reporting hasMore true; continue according to this flag rather than the event count. pub has_more: bool, } @@ -6150,7 +6151,7 @@ pub(crate) struct FactoryToolRunRequest { pub tool_call_id: Option, } -/// Optional user prompt to combine with the fleet orchestration instructions. +/// Parameters for starting fleet orchestration: an optional user prompt combined with the fleet instructions, plus the send options forwarded to the resulting turn. /// ///
/// @@ -6161,9 +6162,19 @@ pub(crate) struct FactoryToolRunRequest { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct FleetStartRequest { + /// Optional attachments (files, directories, selections, blobs, GitHub references) to include with the fleet request + #[serde(skip_serializing_if = "Option::is_none")] + pub attachments: Option>, + /// If false, this request will not trigger a Premium Request Unit charge. User requests default to billable. + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) billable: Option, /// Optional user prompt to combine with fleet instructions #[serde(skip_serializing_if = "Option::is_none")] pub prompt: Option, + /// If true, await completion of the agentic loop for this fleet request before returning. Defaults to false. + #[serde(skip_serializing_if = "Option::is_none")] + pub wait: Option, } /// Indicates whether fleet mode was successfully activated. @@ -7139,7 +7150,7 @@ pub struct JsonSchemaResponseFormat { pub description: Option, /// Name of the output schema, subject to the provider's naming restrictions. pub name: String, - /// JSON Schema passed unchanged to the inference provider. Supported keywords and schema restrictions are determined by that provider. + /// JSON Schema passed unchanged to the inference provider. Schemas larger than 32 MiB when JSON-encoded are rejected before admission, using the runtime's existing request-size ceiling. This is not a guarantee that the entire model request fits. Supported keywords and schema restrictions are determined by the provider. pub schema: serde_json::Value, /// Optional strict enforcement setting for OpenAI providers. Omitted uses the provider default. Anthropic always enforces its supported schema subset. #[serde(skip_serializing_if = "Option::is_none")] @@ -11083,6 +11094,9 @@ pub struct ModeSetRequest { /// Explicit response to a model-switch compaction preflight. #[serde(skip_serializing_if = "Option::is_none")] pub compaction_decision: Option, + /// Mode the session must currently be in for the change to apply. When set and the session is in a different mode the request is a no-op and reports status 'unchanged'. + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_mode: Option, /// Session whose plan-mode base state should be inherited. #[serde(skip_serializing_if = "Option::is_none")] pub inherit_plan_base_from_session_id: Option, @@ -11140,6 +11154,9 @@ pub struct ModeSetResult { /// User-facing outcome message for the model switch triggered by the mode change. #[serde(skip_serializing_if = "Option::is_none")] pub message: Option, + /// Whether the requested mode was applied to the session. False only when an 'expectedMode' precondition did not hold, in which case any model change reported alongside it was still applied. + #[serde(skip_serializing_if = "Option::is_none")] + pub mode_applied: Option, /// Whether applying the mode changed the active model. pub model_changed: bool, /// Lifecycle status of the requested mode change. @@ -17518,6 +17535,9 @@ pub struct SessionOpenOptions { /// Initial reasoning summary mode for supported model clients. #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_summary: Option, + /// Whether to invalidate cached custom-instruction discovery before constructing the session. Use when instruction files may have changed earlier in the same runtime process. + #[serde(skip_serializing_if = "Option::is_none")] + pub refresh_custom_instructions: Option, /// Telemetry-only remote-defaulted flag. #[serde(skip_serializing_if = "Option::is_none")] pub remote_defaulted_on: Option, @@ -18625,13 +18645,13 @@ pub struct SessionsPruneOldRequest { #[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. + /// Opaque, process-local, single-use cursor returned by the previous persisted-event read. Omit on the first call and issue continuations sequentially; reusing the same cursor returns an expired terminal page. #[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. + /// Direction to page through persisted history. Forward starts at the beginning; backward starts with the newest events. Events in each page remain chronological. This selects the initial read only; a continuation always uses the direction bound into its cursor. #[serde(skip_serializing_if = "Option::is_none")] pub direction: Option, - /// Maximum number of events to return in this batch (1–1000, default 200). + /// Maximum number of events to return in this batch (1–1000, default 200). Pages may contain fewer events to keep the serialized event array within a soft 1 MiB budget including resolved binary assets; one oversized event is returned alone to guarantee progress. #[serde(skip_serializing_if = "Option::is_none")] pub max: Option, /// Session ID whose persisted event journal should be read. @@ -22842,11 +22862,11 @@ pub struct SessionsListResult { 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. + /// Cursor status: 'ok' means the cursor was applied successfully. For session.eventLog.read, 'expired' means the cursor referred to an event that no longer exists in active history and the read fell back to a boundary of the remaining history: the beginning for a forward read or the newest window for a backward read. That fallback may overlap already rendered events, so active-session consumers should reset, rebase, or deduplicate before continuing. sessions.readPersistedEvents has stricter snapshot semantics: 'expired' returns an empty terminal page and never switches to a replacement journal generation. Other persisted-read I/O failures are RPC errors with diagnostics, not cursor expiry. 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. + /// True when more events are available in the read's direction. For a backward read, true means older persisted events remain before the returned window. A persisted-event page may contain fewer than `max` events because of its byte budget while still reporting hasMore true; continue according to this flag rather than the event count. pub has_more: bool, } @@ -24126,6 +24146,9 @@ pub struct SessionModeSetResult { /// User-facing outcome message for the model switch triggered by the mode change. #[serde(skip_serializing_if = "Option::is_none")] pub message: Option, + /// Whether the requested mode was applied to the session. False only when an 'expectedMode' precondition did not hold, in which case any model change reported alongside it was still applied. + #[serde(skip_serializing_if = "Option::is_none")] + pub mode_applied: Option, /// Whether applying the mode changed the active model. pub model_changed: bool, /// Lifecycle status of the requested mode change. @@ -27915,11 +27938,11 @@ pub struct SessionQueueProcessParams { pub struct SessionEventLogReadResult { /// Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. 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. + /// Cursor status: 'ok' means the cursor was applied successfully. For session.eventLog.read, 'expired' means the cursor referred to an event that no longer exists in active history and the read fell back to a boundary of the remaining history: the beginning for a forward read or the newest window for a backward read. That fallback may overlap already rendered events, so active-session consumers should reset, rebase, or deduplicate before continuing. sessions.readPersistedEvents has stricter snapshot semantics: 'expired' returns an empty terminal page and never switches to a replacement journal generation. Other persisted-read I/O failures are RPC errors with diagnostics, not cursor expiry. 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. + /// True when more events are available in the read's direction. For a backward read, true means older persisted events remain before the returned window. A persisted-event page may contain fewer than `max` events because of its byte budget while still reporting hasMore true; continue according to this flag rather than the event count. pub has_more: bool, } @@ -30533,7 +30556,7 @@ pub enum EventsReadDirection { Unknown, } -/// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history (the beginning for a forward read, the tail for a backward read). The fallback page is a fresh boundary snapshot, not a continuation of the requested cursor, so it may overlap already-rendered events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate by event id) before continuing from the returned cursor. +/// Cursor status: 'ok' means the read succeeded against the requested history; 'expired' means the requested continuation is unavailable. Recovery is endpoint-specific: session.eventLog.read returns a boundary window of remaining active history that may overlap prior pages, while sessions.readPersistedEvents returns an empty terminal page and never switches journal generations. An expired persisted read is not successful completion; a complete persisted snapshot requires cursorStatus 'ok' and hasMore false. /// ///
/// @@ -30543,10 +30566,10 @@ pub enum EventsReadDirection { ///
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum EventsCursorStatus { - /// The cursor was applied successfully. + /// The read succeeded against the requested history. #[serde(rename = "ok")] Ok, - /// The cursor referred to history that is no longer available. + /// The requested continuation is unavailable; see the endpoint's recovery semantics. #[serde(rename = "expired")] Expired, /// Unknown variant for forward compatibility. @@ -33042,34 +33065,6 @@ pub enum PermissionResponseCapability { Unknown, } -/// Controlled reason or actor responsible for a permission response. -/// -///
-/// -/// **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 PermissionDecisionSource { - /// The response followed the assisted-approval judge recommendation. - #[serde(rename = "assisted_approval")] - AssistedApproval, - /// A human supplied the response through an interactive prompt. - #[serde(rename = "human_response")] - HumanResponse, - /// The host applied a standing policy or override rather than a judge recommendation or human decision. - #[serde(rename = "host_policy")] - HostPolicy, - /// The host denied the request because no interactive user response was available. - #[serde(rename = "unattended_fallback")] - UnattendedFallback, - /// Unknown variant for forward compatibility. - #[default] - #[serde(other)] - Unknown, -} - /// Client surface that submitted a permission response. /// ///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 789514b708..fd54f8dcb8 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -1983,7 +1983,7 @@ 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. + /// Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The first read pins the currently opened journal generation and its byte-length boundary; opaque cursor continuations remain on that generation across runtime-owned compaction, truncation, and rewrite operations, which replace the live path atomically, and events appended after the boundary are excluded. For cold hydration, await the first successful page before activation and establish lossless live-event buffering before resume; merge subsequent live events by ID, preserving persisted order and letting live payloads win. Continuations are process-local, single-use capabilities bound to the originating session and storage context and must be paged sequentially; concurrent or repeated use of the same cursor expires that duplicate read rather than reading the generation twice. A complete snapshot has cursorStatus 'ok' and hasMore false. Snapshots expire after five idle minutes, with at most eight retained per process and idle-only eviction under pressure; completion and cancelled-worker exit release their handles. No transcript copy is created, but retained handles may keep replaced files' disk blocks alive until release. Pages have a soft 1 MiB serialized event-array budget including resolved binary assets; one oversized event is returned alone to guarantee progress. Working memory also includes a record/lookahead and asset resolution; resolving the first binary reference may scan the full pinned generation to build a bounded offset index. If the snapshot expires, is evicted, is cancelled before a continuation is established, or becomes unreadable after an observable unsupported in-place shortening, the continuation returns cursorStatus 'expired' with an empty terminal page and never falls back to a different generation. A missing or initially unreadable journal is an RPC error. Persisted history excludes ephemeral events and may omit payloads that are reconstructed only for an active session; use the active session event stream for post-resume live events. /// /// Wire method: `sessions.readPersistedEvents`. /// @@ -5351,7 +5351,7 @@ impl<'a> SessionRpcFleet<'a> { /// /// # Parameters /// - /// * `params` - Optional user prompt to combine with the fleet orchestration instructions. + /// * `params` - Parameters for starting fleet orchestration: an optional user prompt combined with the fleet instructions, plus the send options forwarded to the resulting turn. /// /// # Returns /// diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index ea672dbe20..5d8fda7f6f 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -267,6 +267,42 @@ pub enum SessionEventType { PermissionRequested, #[serde(rename = "permission.completed")] PermissionCompleted, + /// + ///
+ /// + /// **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 = "permission.carriedForward")] + PermissionCarriedForward, + /// + ///
+ /// + /// **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 = "permission.messageAuthorization")] + PermissionMessageAuthorization, + /// + ///
+ /// + /// **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 = "permission.messageAuthorizationRead")] + PermissionMessageAuthorizationRead, + /// + ///
+ /// + /// **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 = "permission.messageAuthorizationDegraded")] + PermissionMessageAuthorizationDegraded, #[serde(rename = "user_input.requested")] UserInputRequested, #[serde(rename = "user_input.completed")] @@ -721,6 +757,42 @@ pub enum SessionEventData { PermissionRequested(PermissionRequestedData), #[serde(rename = "permission.completed")] PermissionCompleted(PermissionCompletedData), + /// + ///
+ /// + /// **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 = "permission.carriedForward")] + PermissionCarriedForward(PermissionCarriedForwardData), + /// + ///
+ /// + /// **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 = "permission.messageAuthorization")] + PermissionMessageAuthorization(PermissionMessageAuthorizationData), + /// + ///
+ /// + /// **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 = "permission.messageAuthorizationRead")] + PermissionMessageAuthorizationRead(PermissionMessageAuthorizationReadData), + /// + ///
+ /// + /// **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 = "permission.messageAuthorizationDegraded")] + PermissionMessageAuthorizationDegraded(PermissionMessageAuthorizationDegradedData), #[serde(rename = "user_input.requested")] UserInputRequested(UserInputRequestedData), #[serde(rename = "user_input.completed")] @@ -4509,6 +4581,26 @@ pub struct PermissionRequestShell { /// True when the requested escalation is a permissive retry rather than a full bypass: the command re-runs inside the sandbox with its file and process restrictions recording instead of blocking, while the network policy stays enforced. Always accompanied by requestSandboxBypass, so hosts that do not recognize this field still treat the request as the escalation it is. Hosts that do recognize it must not describe the command as running outside the sandbox, which would overstate the privilege being granted. #[serde(skip_serializing_if = "Option::is_none")] pub request_sandbox_permissive: Option, + /// Runtime-resolved canonical object each possiblePaths entry names, keyed by the requested spelling, used for authorization identity checks. Internal and experimental; clients should continue to display possiblePaths. + /// + ///
+ /// + /// **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 resolved_paths: Option>, + /// Runtime-resolved canonical working directory the command runs in, used for authorization identity checks. Internal and experimental; clients should not display it. + /// + ///
+ /// + /// **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 resolved_working_directory: Option, /// Tool call ID that triggered this permission request #[serde(skip_serializing_if = "Option::is_none")] pub tool_call_id: Option, @@ -4543,6 +4635,16 @@ pub struct PermissionRequestWrite { /// Justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. #[serde(skip_serializing_if = "Option::is_none")] pub request_sandbox_bypass_reason: Option, + /// Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display fileName. + /// + ///
+ /// + /// **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 resolved_path: Option, /// Tool call ID that triggered this permission request #[serde(skip_serializing_if = "Option::is_none")] pub tool_call_id: Option, @@ -4567,6 +4669,16 @@ pub struct PermissionRequestRead { /// What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. Only meaningful when requestSandboxBypass is true. #[serde(skip_serializing_if = "Option::is_none")] pub request_sandbox_bypass_reason: Option, + /// Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display path. + /// + ///
+ /// + /// **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 resolved_path: Option, /// Tool call ID that triggered this permission request #[serde(skip_serializing_if = "Option::is_none")] pub tool_call_id: Option, @@ -4941,6 +5053,16 @@ pub struct PermissionPromptRequestWrite { /// Complete new file contents for newly created files #[serde(skip_serializing_if = "Option::is_none")] pub new_file_contents: Option, + /// Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display fileName. + /// + ///
+ /// + /// **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 resolved_path: Option, /// Tool call ID that triggered this permission request #[serde(skip_serializing_if = "Option::is_none")] pub tool_call_id: Option, @@ -4969,6 +5091,16 @@ pub struct PermissionPromptRequestRead { pub managed_approval_required: Option, /// Path of the file or directory being read pub path: String, + /// Runtime-resolved canonical path used for authorization identity checks. Internal and experimental; clients should continue to display path. + /// + ///
+ /// + /// **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 resolved_path: Option, /// Tool call ID that triggered this permission request #[serde(skip_serializing_if = "Option::is_none")] pub tool_call_id: Option, @@ -5554,6 +5686,16 @@ pub struct PermissionDeniedByPermissionRequestHook { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PermissionCompletedData { + /// Who decided this permission request. Absent on completions recorded before this field existed, which consumers must treat as "not a human decision" rather than assuming one. Authorization records are minted only for `human_response`; an assisted-approval verdict, a host policy, an unattended fallback, and a hook resolution all produce the same `result` a person does, so this is the only field that distinguishes them. + /// + ///
+ /// + /// **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 decision_source: Option, /// Request ID of the resolved permission request; clients should dismiss any UI for this request pub request_id: RequestId, /// The result of the permission request @@ -5563,6 +5705,196 @@ pub struct PermissionCompletedData { pub tool_call_id: Option, } +/// Session event "permission.carriedForward". Records that a live authorization record from an earlier human decision in this session contained a permission proposal, so it ran without another prompt. This mints no authority: it accounts for one more effect against the prior grant, which is what lets a replayed session agree with the live one about how much of that grant is left. +/// +///
+/// +/// **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 PermissionCarriedForwardData { + /// Always `authorization_carry_forward`. Stated explicitly so a consumer reading this event cannot mistake it for a human, host-policy, or assisted-approval decision. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub decision_source: PermissionDecisionSource, + /// Identity of the prior authorization record that contained the proposal. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub record_id: String, + /// Authorization edge minted for this admission. Not a prompt id: no prompt was raised, so no client should expect a request with this id. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub request_id: RequestId, + /// Tool call this admission authorizes. Its execution receipts the prior grant, which is how a single-effect approval is spent rather than carried forward again. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub tool_call_id: String, +} + +/// Session event "permission.messageAuthorization". Freezes one blinded, verbatim-verified authorization claim the runtime minted from a human user message, so a resumed session re-establishes the same grant deterministically instead of re-running the extraction model. This mints no authority on its own: it records what a blinded proposer pointed at and the trusted discriminator the runtime established, and deterministic establishment runs on replay. Persisted so recorded authority survives compaction and process resume. +/// +///
+/// +/// **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 PermissionMessageAuthorizationData { + /// The kind of effect authorized, as an action-class identifier. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub action_class: String, + /// Whether the claim granted or denied authority. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub polarity: PermissionMessageAuthorizationPolarity, + /// Deterministic identity of the record, derived from the turn and span offsets so re-extracting the same span mints nothing new. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub record_id: String, + /// End byte offset of the authorizing span within the turn. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub span_end: i64, + /// Start byte offset of the authorizing span within the turn. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub span_start: i64, + /// Concrete named targets that appear verbatim inside the span. + /// + ///
+ /// + /// **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 target_members: Option>, + /// The task the permission is scoped to, when the human named one. + /// + ///
+ /// + /// **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 task: Option, + /// The human turn the quoted span was read from. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub turn_index: i64, + /// The trusted version discriminator, when one exists. Exact shell-command grants carry the byte-identical commands grounded in the human span; world-derived classes carry a file object, remote tip, or runner only when that state was captured safely. An opaque object mirroring the runtime's adjacently-tagged resolution. + /// + ///
+ /// + /// **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 world: Option, +} + +/// Session event "permission.messageAuthorizationRead". Records that one human turn has been read by the blinded authorization proposer, whether or not it minted anything, so a resumed session does not re-run the extraction model on a turn the live session already read. Persisted purely to avoid wasted model calls across resume; it is never a correctness mechanism. +/// +///
+/// +/// **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 PermissionMessageAuthorizationReadData { + /// The human turn that was read by the proposer. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub turn_index: i64, +} + +/// Session event "permission.messageAuthorizationDegraded". Records that message-backed authorization could not safely represent one human turn before compaction. The runtime may compact the original message after this marker is durable, but message-derived carry-forward and assisted auto-approval remain disabled for the rest of the session so subsequent commands continue through the ordinary permission prompt. +/// +///
+/// +/// **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 PermissionMessageAuthorizationDegradedData { + /// The human turn that could not be represented safely. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ pub turn_index: i64, +} + /// Session event "user_input.requested". User input request notification with question and optional predefined choices #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -8277,6 +8609,30 @@ pub enum PermissionPromptRequest { ExtensionEnvAccess(PermissionPromptRequestExtensionEnvAccess), } +/// Controlled reason or actor responsible for a permission response. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum PermissionDecisionSource { + /// The response followed the assisted-approval judge recommendation. + #[serde(rename = "assisted_approval")] + AssistedApproval, + /// A human supplied the response through an interactive prompt. + #[serde(rename = "human_response")] + HumanResponse, + /// The host applied a standing policy or override rather than a judge recommendation or human decision. + #[serde(rename = "host_policy")] + HostPolicy, + /// The host denied the request because no interactive user response was available. + #[serde(rename = "unattended_fallback")] + UnattendedFallback, + /// A live authorization record from an earlier human decision in this session contained the proposal, so it ran without another prompt. This is not a new human decision and never mints authority of its own. + #[serde(rename = "authorization_carry_forward")] + AuthorizationCarryForward, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// The permission request was approved #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum PermissionApprovedKind { @@ -8462,6 +8818,28 @@ pub enum PermissionResult { DeniedByPermissionRequestHook(PermissionDeniedByPermissionRequestHook), } +/// Which direction a message-backed authorization claim moves authority in. +/// +///
+/// +/// **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 PermissionMessageAuthorizationPolarity { + /// The human's words authorized an effect. + #[serde(rename = "grant")] + Grant, + /// The human's words refused an effect. + #[serde(rename = "denial")] + Denial, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum ElicitationRequestedMode { diff --git a/test/snapshots/structured_output/typed_wait_returns_stop_hook_correction_after_terminal_tool.yaml b/test/snapshots/structured_output/typed_wait_returns_stop_hook_correction_after_terminal_tool.yaml new file mode 100644 index 0000000000..028d3ee99f --- /dev/null +++ b/test/snapshots/structured_output/typed_wait_returns_stop_hook_correction_after_terminal_tool.yaml @@ -0,0 +1,24 @@ +models: + - gpt-4.1 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: Call lookup_number exactly once, then add 5 to the returned number. Do not guess its result. + - role: assistant + tool_calls: + - id: toolcall_0 + type: function + function: + name: lookup_number + arguments: "{}" + - role: tool + tool_call_id: toolcall_0 + content: "58" + - role: assistant + content: '{"answer":63}' + - role: user + content: Correct the answer to 99, not 63. Do not use tools. + - role: assistant + content: '{"answer":99}'