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 4e7a3ee1e9..724f13dd0a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,6 +58,103 @@ 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. + +If the SDK's pinned release is newer than the runtime feature branch, preserve +the released APIs rather than overwriting them with older local schemas. +Three-way merge each feature schema with its runtime-base schema and the pinned +package's schema, then pass the merged files to the generators. For example, +with `RUNTIME_BASE` set to the feature branch's base commit and +`PINNED_SCHEMAS_DIR` pointing to the released package's `schemas` directory: + +```bash +MERGED_SCHEMAS_DIR=$(mktemp -d) +for name in api session-events; do + git -C "$RUNTIME_ROOT" show "$RUNTIME_BASE:generated/$name.schema.json" \ + > "$MERGED_SCHEMAS_DIR/base-$name.schema.json" + git merge-file -p "$RUNTIME_ROOT/generated/$name.schema.json" \ + "$MERGED_SCHEMAS_DIR/base-$name.schema.json" \ + "$PINNED_SCHEMAS_DIR/$name.schema.json" \ + > "$MERGED_SCHEMAS_DIR/$name.schema.json" || break +done +``` + +Resolve any schema conflicts before generating. The existing +`getApiSchemaPath()` and `getSessionEventsSchemaPath()` helpers in +`scripts/codegen/utils.ts` locate schemas for the current pin. This approach +preserves newer released contracts while adding the exact runtime feature delta; +generated SDK wrappers should never be merged by dropping unrelated APIs. + +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. +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 c518a40326..d2ae8f6d71 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,133 @@ 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. + +With `SendAsync`, collect root `AssistantMessageEvent` events whose +`Data.OriginatingMessageId` matches the returned message ID, then select the last +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 +idle. Independent queued sends retain their own schemas and IDs. + +```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 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. +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 +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 8471e9e4e1..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; } @@ -5454,6 +5458,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. 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; } + + /// 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 @@ -5494,6 +5532,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; @@ -5521,7 +5563,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; } } @@ -5566,7 +5608,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; } @@ -5582,6 +5624,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; @@ -8225,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; } @@ -8246,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; } @@ -9121,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; } @@ -9132,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. @@ -23839,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}")] @@ -23859,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. @@ -24838,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))] @@ -32888,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) @@ -33509,39 +33507,41 @@ 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); } /// 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. /// 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); } @@ -34380,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. @@ -34392,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); } } @@ -34820,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); } } @@ -38310,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")] @@ -38706,6 +38720,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))] @@ -39028,6 +39043,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))] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index 2a81531d45..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 @@ -3825,6 +3885,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, 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; } + /// Actual output token count from the API response (completion_tokens), used for accurate token accounting. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("outputTokens")] @@ -5195,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; } @@ -5209,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 { @@ -8975,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")] @@ -9034,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")] @@ -9075,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")] @@ -9602,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")] @@ -9635,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")] @@ -15196,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}")] @@ -16851,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/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..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. /// /// @@ -331,6 +332,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 +391,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 +2291,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 1cc4919093..4cda151f1d 100644 --- a/dotnet/src/Types.cs +++ b/dotnet/src/Types.cs @@ -4091,6 +4091,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; @@ -4128,6 +4129,18 @@ 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. + /// 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)] + 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..6de9c92ccd --- /dev/null +++ b/dotnet/test/E2E/StructuredOutputE2ETests.cs @@ -0,0 +1,430 @@ +/*--------------------------------------------------------------------------------------------- + * 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", 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); + 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); + break; + case SessionIdleEvent: + completion.TrySetResult(); + break; + case SessionErrorEvent error: + completion.TrySetException(new InvalidOperationException(error.Data.Message)); + break; + } + }); + 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)); + 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.Empty(message.Data.ToolRequests ?? []); + 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 Send_Selects_Correlated_Response_After_Idle() + { + 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 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); + break; + case SessionErrorEvent error: + idleReceived.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); + 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.Contains(replies, message => message.Data.ToolRequests is { Length: > 0 }); + Assert.Empty(reply.Data.ToolRequests ?? []); + Assert.Same(reply, replies.Last()); + } + finally + { + releaseHook.TrySetResult(); + } + } + + [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 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 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() + { + 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; } + } + + 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/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/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..45b529d20f --- /dev/null +++ b/dotnet/test/Unit/StructuredOutputTests.cs @@ -0,0 +1,508 @@ +/*--------------------------------------------------------------------------------------------- + * 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_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) }); + 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", + ["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() + { + 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 fcdd3875de..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 @@ -4704,6 +4656,26 @@ 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. 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. + 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 @@ -5452,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 } @@ -5685,7 +5652,6 @@ func (RawMCPOauthPendingRequestResponseData) mcpOauthPendingRequestResponse() {} func (r RawMCPOauthPendingRequestResponseData) Kind() MCPOauthPendingRequestResponseKind { return r.Discriminator } - type MCPOauthPendingRequestResponseCancelled struct { } @@ -5693,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"` @@ -5737,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"` @@ -5747,7 +5711,6 @@ func (MCPOauthProbeResultAuthenticated) mcpOauthProbeResult() {} func (MCPOauthProbeResultAuthenticated) Status() MCPOauthProbeResultStatus { return MCPOauthProbeResultStatusAuthenticated } - type MCPOauthProbeResultFailed struct { // Human-readable probe failure detail. Error string `json:"error"` @@ -5760,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"` @@ -5774,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"` @@ -5860,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 @@ -5895,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 @@ -5920,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. @@ -5940,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 @@ -5975,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. @@ -5996,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. @@ -6059,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 @@ -6090,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. @@ -6182,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 @@ -6207,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 @@ -6224,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() {} @@ -6263,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. @@ -6520,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. @@ -6649,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 { @@ -6710,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. @@ -6726,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 @@ -6756,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 @@ -6813,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. @@ -7681,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 @@ -7717,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. @@ -7899,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. @@ -7910,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 @@ -7926,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 @@ -7940,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 @@ -7956,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 @@ -7972,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. @@ -7985,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. @@ -7998,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 @@ -8012,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 @@ -8028,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 @@ -8044,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 @@ -8058,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 @@ -8074,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 @@ -8086,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 @@ -8100,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. @@ -8125,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. @@ -8139,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. @@ -8153,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 @@ -8171,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 @@ -8187,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 @@ -8202,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. @@ -8217,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 @@ -8234,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. @@ -8248,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 } @@ -8303,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. @@ -8317,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. @@ -8331,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 @@ -8349,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 @@ -8365,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 @@ -8380,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. @@ -8395,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 @@ -8416,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. @@ -8425,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 } @@ -8787,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. @@ -8801,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. @@ -8815,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 @@ -8833,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 @@ -8849,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 @@ -8864,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. @@ -8879,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 @@ -8900,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. @@ -8909,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. @@ -8937,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. @@ -9676,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. @@ -9691,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. @@ -9708,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. @@ -9723,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. @@ -9740,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. @@ -9764,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. @@ -9783,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. @@ -9802,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. @@ -9819,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. @@ -9840,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. @@ -9859,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. @@ -9879,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. @@ -9900,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. @@ -9917,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. @@ -9930,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. @@ -10070,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 @@ -10464,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. @@ -10493,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. @@ -10506,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. @@ -10521,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. @@ -10633,6 +10490,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 { @@ -11049,8 +10914,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. @@ -11061,6 +10929,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 @@ -11081,8 +10955,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"` } @@ -11114,6 +10991,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. @@ -11941,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 @@ -12058,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"` @@ -12068,7 +11950,6 @@ func (SessionLimitPredictionResultAvailable) sessionLimitPredictionResult() {} func (SessionLimitPredictionResultAvailable) Kind() SessionLimitPredictionResultKind { return SessionLimitPredictionResultKindAvailable } - type SessionLimitPredictionResultUnavailable struct { // Reason no prediction is available. Reason SessionLimitPredictionUnavailableReason `json:"reason"` @@ -12117,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 @@ -12539,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. @@ -12637,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. @@ -12650,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. @@ -12674,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. @@ -12689,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. @@ -12726,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. @@ -12743,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. @@ -12762,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. @@ -12936,7 +12812,6 @@ func (RawSessionsClientMetadataEntryData) sessionsClientMetadataEntry() {} func (r RawSessionsClientMetadataEntryData) Status() SessionsClientMetadataEntryStatus { return r.Discriminator } - type SessionsClientMetadataEntryCorrupt struct { // Requested session ID. SessionID string `json:"sessionId"` @@ -12946,7 +12821,6 @@ func (SessionsClientMetadataEntryCorrupt) sessionsClientMetadataEntry() {} func (SessionsClientMetadataEntryCorrupt) Status() SessionsClientMetadataEntryStatus { return SessionsClientMetadataEntryStatusCorrupt } - type SessionsClientMetadataEntryNotFound struct { // Requested session ID. SessionID string `json:"sessionId"` @@ -12956,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"` @@ -12968,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. @@ -12983,7 +12855,6 @@ func (SessionsClientMetadataEntryUnavailable) sessionsClientMetadataEntry() {} func (SessionsClientMetadataEntryUnavailable) Status() SessionsClientMetadataEntryStatus { return SessionsClientMetadataEntryStatusUnavailable } - type SessionsClientMetadataEntryUnsupportedVersion struct { // Requested session ID. SessionID string `json:"sessionId"` @@ -13483,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"` @@ -13866,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. @@ -14342,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 { @@ -14358,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 @@ -14381,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 @@ -14400,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 @@ -14421,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 { @@ -14445,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 { @@ -14461,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 { @@ -14475,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. @@ -14606,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 @@ -14619,7 +14485,6 @@ func (TaskClientUpdateCancelled) taskClientUpdate() {} func (TaskClientUpdateCancelled) Kind() TaskClientUpdateKind { return TaskClientUpdateKindCancelled } - // Reports successful terminal completion. type TaskClientUpdateCompleted struct { // Optional final progress message @@ -14632,7 +14497,6 @@ func (TaskClientUpdateCompleted) taskClientUpdate() {} func (TaskClientUpdateCompleted) Kind() TaskClientUpdateKind { return TaskClientUpdateKindCompleted } - // Reports terminal failure. type TaskClientUpdateFailed struct { // Optional owner-supplied terminal failure code @@ -14647,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 @@ -14720,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. @@ -14772,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 { @@ -14824,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. @@ -14883,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 @@ -14899,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. @@ -14924,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 @@ -15491,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. @@ -15514,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. @@ -15537,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. @@ -15554,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. @@ -15568,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"` } @@ -15579,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. @@ -15602,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. @@ -15623,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. @@ -16060,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. @@ -16073,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. @@ -16086,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 @@ -16103,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 @@ -16117,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 @@ -16131,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. @@ -16144,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 @@ -16160,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. @@ -16171,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. @@ -16182,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. @@ -16711,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" ) @@ -16774,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. @@ -16796,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. @@ -16910,7 +16750,7 @@ const ( type CatalogCandidateKind string const ( - CatalogCandidateKindAiSkill CatalogCandidateKind = "ai-skill" + CatalogCandidateKindAiSkill CatalogCandidateKind = "ai-skill" CatalogCandidateKindMCPServer CatalogCandidateKind = "mcp-server" ) @@ -16919,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 @@ -17116,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 @@ -17261,7 +17101,7 @@ const ( type DebugCollectLogsDestinationKind string const ( - DebugCollectLogsDestinationKindArchive DebugCollectLogsDestinationKind = "archive" + DebugCollectLogsDestinationKindArchive DebugCollectLogsDestinationKind = "archive" DebugCollectLogsDestinationKindDirectory DebugCollectLogsDestinationKind = "directory" ) @@ -17381,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" ) @@ -17475,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. @@ -17543,7 +17382,7 @@ type FactoryPauseInfoType string const ( FactoryPauseInfoTypeCheckpoint FactoryPauseInfoType = "checkpoint" - FactoryPauseInfoTypeUser FactoryPauseInfoType = "user" + FactoryPauseInfoTypeUser FactoryPauseInfoType = "user" ) // Derived lifecycle state of a factory phase. @@ -17583,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. @@ -17630,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 @@ -18029,7 +17868,7 @@ type MCPHeadersHandlePendingHeadersRefreshRequestKind string const ( MCPHeadersHandlePendingHeadersRefreshRequestKindHeaders MCPHeadersHandlePendingHeadersRefreshRequestKind = "headers" - MCPHeadersHandlePendingHeadersRefreshRequestKindNone MCPHeadersHandlePendingHeadersRefreshRequestKind = "none" + MCPHeadersHandlePendingHeadersRefreshRequestKindNone MCPHeadersHandlePendingHeadersRefreshRequestKind = "none" ) // OAuth grant type override for this login. @@ -18052,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. @@ -18074,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" ) @@ -18107,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 @@ -18146,7 +17985,7 @@ type MCPPlanInstallSourceKind string const ( MCPPlanInstallSourceKindCandidate MCPPlanInstallSourceKind = "candidate" - MCPPlanInstallSourceKindCard MCPPlanInstallSourceKind = "card" + MCPPlanInstallSourceKindCard MCPPlanInstallSourceKind = "card" ) // Discriminator for a package-backed transport choice @@ -18237,7 +18076,7 @@ const ( type MCPPlanRequiredValueKind string const ( - MCPPlanRequiredValueKindEnum MCPPlanRequiredValueKind = "enum" + MCPPlanRequiredValueKindEnum MCPPlanRequiredValueKind = "enum" MCPPlanRequiredValueKindScalar MCPPlanRequiredValueKind = "scalar" ) @@ -18280,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" ) @@ -18347,7 +18186,7 @@ type MCPServerCardReferenceKind string const ( MCPServerCardReferenceKindEmbedded MCPServerCardReferenceKind = "embedded" - MCPServerCardReferenceKindURL MCPServerCardReferenceKind = "url" + MCPServerCardReferenceKindURL MCPServerCardReferenceKind = "url" ) // Discriminator for a URL-backed MCP server card @@ -18691,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. @@ -18764,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" @@ -18867,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 @@ -19029,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 @@ -19101,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 @@ -19154,6 +18997,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. @@ -19363,7 +19213,7 @@ const ( type SessionLimitPredictionResultKind string const ( - SessionLimitPredictionResultKindAvailable SessionLimitPredictionResultKind = "available" + SessionLimitPredictionResultKindAvailable SessionLimitPredictionResultKind = "available" SessionLimitPredictionResultKindUnavailable SessionLimitPredictionResultKind = "unavailable" ) @@ -19480,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" ) @@ -19493,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" ) @@ -19652,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 @@ -19765,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 @@ -19889,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 @@ -19924,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. @@ -19946,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 @@ -20066,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') @@ -20117,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 @@ -21546,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. // @@ -21935,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 @@ -22230,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 } @@ -22272,7 +22142,7 @@ func NewInternalServerRPC(client *jsonrpc2.Client) *InternalServerRPC { } type sessionAPI struct { - client *jsonrpc2.Client + client *jsonrpc2.Client sessionID string } @@ -23410,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 { @@ -24897,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 } @@ -28153,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 @@ -28351,6 +28234,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 } @@ -28406,6 +28292,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 } @@ -28521,7 +28410,7 @@ func NewSessionRPC(client *jsonrpc2.Client, sessionID string) *SessionRPC { } type internalSessionAPI struct { - client *jsonrpc2.Client + client *jsonrpc2.Client sessionID string } @@ -29506,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 @@ -29779,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 { @@ -30281,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 0b95171d79..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,19 +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"` - 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 { @@ -5218,6 +5246,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 @@ -5246,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 { @@ -5362,7 +5391,7 @@ func (r SessionLimitPredictionResultAvailable) MarshalJSON() ([]byte, error) { Kind SessionLimitPredictionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5373,7 +5402,7 @@ func (r SessionLimitPredictionResultUnavailable) MarshalJSON() ([]byte, error) { Kind SessionLimitPredictionResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5417,7 +5446,7 @@ func (r LocalSessionMetadataValue) MarshalJSON() ([]byte, error) { alias }{ IsRemote: r.sessionListEntryIsRemote(), - alias: alias(r), + alias: alias(r), }) } @@ -5428,7 +5457,7 @@ func (r RemoteSessionMetadataValue) MarshalJSON() ([]byte, error) { alias }{ IsRemote: r.sessionListEntryIsRemote(), - alias: alias(r), + alias: alias(r), }) } @@ -5455,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 { @@ -5592,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 @@ -5690,7 +5721,7 @@ func (r SessionsOpenAttach) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5701,7 +5732,7 @@ func (r SessionsOpenCloud) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5712,7 +5743,7 @@ func (r SessionsOpenCreate) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5723,7 +5754,7 @@ func (r SessionsOpenHandoff) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5734,7 +5765,7 @@ func (r SessionsOpenRemote) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5745,7 +5776,7 @@ func (r SessionsOpenResume) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5756,7 +5787,7 @@ func (r SessionsOpenResumeLast) MarshalJSON() ([]byte, error) { Kind SessionOpenParamsKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -5827,7 +5858,7 @@ func (r SessionsClientMetadataEntryCorrupt) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -5838,7 +5869,7 @@ func (r SessionsClientMetadataEntryNotFound) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -5849,7 +5880,7 @@ func (r SessionsClientMetadataEntryOk) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -5860,7 +5891,7 @@ func (r SessionsClientMetadataEntryUnavailable) MarshalJSON() ([]byte, error) { alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -5871,7 +5902,7 @@ func (r SessionsClientMetadataEntryUnsupportedVersion) MarshalJSON() ([]byte, er alias }{ Status: r.Status(), - alias: alias(r), + alias: alias(r), }) } @@ -5952,7 +5983,7 @@ func (r SettableTokenAuthInfo) MarshalJSON() ([]byte, error) { Type SettableAuthInfoType `json:"type"` alias }{ - Type: r.settableAuthInfoType(), + Type: r.settableAuthInfoType(), alias: alias(r), }) } @@ -6058,7 +6089,7 @@ func (r SlashCommandAddTimelineEntryResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6069,7 +6100,7 @@ func (r SlashCommandAgentPromptResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6080,7 +6111,7 @@ func (r SlashCommandCompletedResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6091,7 +6122,7 @@ func (r SlashCommandSelectSubcommandResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6102,7 +6133,7 @@ func (r SlashCommandSetModelResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6113,7 +6144,7 @@ func (r SlashCommandSetPlanModelResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6124,7 +6155,7 @@ func (r SlashCommandShowDialogResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6135,7 +6166,7 @@ func (r SlashCommandTextResult) MarshalJSON() ([]byte, error) { Kind SlashCommandInvocationResultKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6199,7 +6230,7 @@ func (r TaskClientUpdateCancelled) MarshalJSON() ([]byte, error) { Kind TaskClientUpdateKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6210,7 +6241,7 @@ func (r TaskClientUpdateCompleted) MarshalJSON() ([]byte, error) { Kind TaskClientUpdateKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6221,7 +6252,7 @@ func (r TaskClientUpdateFailed) MarshalJSON() ([]byte, error) { Kind TaskClientUpdateKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6232,7 +6263,7 @@ func (r TaskClientUpdateProgress) MarshalJSON() ([]byte, error) { Kind TaskClientUpdateKind `json:"kind"` alias }{ - Kind: r.Kind(), + Kind: r.Kind(), alias: alias(r), }) } @@ -6290,7 +6321,7 @@ func (r TaskAgentInfo) MarshalJSON() ([]byte, error) { Type TaskInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6301,7 +6332,7 @@ func (r TaskClientInfo) MarshalJSON() ([]byte, error) { Type TaskInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6312,7 +6343,7 @@ func (r TaskShellInfo) MarshalJSON() ([]byte, error) { Type TaskInfoType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6391,7 +6422,7 @@ func (r TaskAgentProgress) MarshalJSON() ([]byte, error) { Type TaskProgressType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6402,7 +6433,7 @@ func (r TaskClientProgress) MarshalJSON() ([]byte, error) { Type TaskProgressType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6413,7 +6444,7 @@ func (r TaskShellProgress) MarshalJSON() ([]byte, error) { Type TaskProgressType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6474,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 { @@ -6496,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 { @@ -6609,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 @@ -6636,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 @@ -6662,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 { @@ -6676,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 { @@ -6690,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 { @@ -6794,7 +6825,7 @@ func (r UIElicitationArrayAnyOfField) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6805,7 +6836,7 @@ func (r UIElicitationArrayEnumField) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6816,7 +6847,7 @@ func (r UIElicitationSchemaPropertyBoolean) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6827,7 +6858,7 @@ func (r UIElicitationSchemaPropertyNumber) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6838,7 +6869,7 @@ func (r UIElicitationSchemaPropertyString) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6849,7 +6880,7 @@ func (r UIElicitationStringEnumField) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6860,7 +6891,7 @@ func (r UIElicitationStringOneOfField) MarshalJSON() ([]byte, error) { Type UIElicitationSchemaPropertyType `json:"type"` alias }{ - Type: r.Type(), + Type: r.Type(), alias: alias(r), }) } @@ -6868,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 { @@ -6892,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 { @@ -6913,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 f355637137..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 @@ -386,6 +395,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, 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"` // Tool call ID of the parent tool invocation when this event originates from a sub-agent @@ -415,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. @@ -454,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 { @@ -467,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 { @@ -482,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 { @@ -497,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. @@ -523,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 { @@ -545,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 @@ -567,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 { @@ -580,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 { @@ -634,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 { @@ -658,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 @@ -679,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 @@ -692,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. @@ -711,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. @@ -726,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 @@ -745,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 { @@ -762,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 { @@ -776,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) @@ -797,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. @@ -805,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 @@ -821,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. @@ -853,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. @@ -866,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 @@ -877,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. @@ -891,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. @@ -911,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 @@ -938,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. @@ -965,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. @@ -1006,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. @@ -1030,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. @@ -1076,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. @@ -1110,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. @@ -1163,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. @@ -1187,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. @@ -1205,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 { @@ -1216,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 { @@ -1243,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 { @@ -1303,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. @@ -1322,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 @@ -1341,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 @@ -1356,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 @@ -1371,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 @@ -1471,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 @@ -1485,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. @@ -1497,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 { @@ -1522,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 { @@ -1534,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 @@ -1546,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 { @@ -1560,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 @@ -1593,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 @@ -1610,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 @@ -1643,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 @@ -1653,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 { @@ -1677,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. @@ -1695,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. @@ -1714,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 @@ -1723,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. @@ -1733,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 { @@ -1744,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 { @@ -1754,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 @@ -1765,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. @@ -1786,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. @@ -1812,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. @@ -1823,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 { @@ -1838,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 { @@ -1849,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 { @@ -1860,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 { @@ -1871,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 { @@ -1882,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 { @@ -1897,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 { @@ -1908,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 { @@ -1918,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. @@ -1927,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. @@ -1960,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 @@ -1973,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 @@ -1992,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. @@ -2010,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 { @@ -2022,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 @@ -2042,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 { @@ -2052,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 @@ -2070,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 { @@ -2080,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 @@ -2091,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 @@ -2103,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 @@ -2119,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 @@ -2134,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. @@ -2153,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 { @@ -2163,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 @@ -2172,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 @@ -2185,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 @@ -2195,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 { @@ -2224,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 { @@ -2237,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 { @@ -2247,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 @@ -2268,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 @@ -2309,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. @@ -2323,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 { @@ -2336,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 { @@ -2347,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 { @@ -2385,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 @@ -2397,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 { @@ -2439,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 @@ -2448,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 @@ -2484,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 @@ -2499,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 { @@ -2512,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 { @@ -2525,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 { @@ -2536,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 { @@ -2549,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 { @@ -2566,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 { @@ -2604,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 @@ -2641,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 @@ -2670,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 @@ -2681,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 @@ -2698,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 @@ -2746,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 { @@ -2759,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 { @@ -2795,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. @@ -2810,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 { @@ -2820,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 @@ -2831,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 @@ -2844,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 @@ -2857,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 @@ -2874,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 @@ -2887,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 @@ -2902,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 @@ -2928,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 { @@ -2941,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. @@ -3135,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). @@ -3148,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). @@ -3161,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). @@ -3436,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 @@ -3601,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. @@ -3633,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 @@ -3653,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. @@ -3671,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. @@ -3689,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. @@ -3707,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 @@ -3751,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. @@ -3771,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 @@ -3798,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 @@ -3824,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 @@ -3842,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. @@ -3854,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"` } @@ -3862,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. @@ -3888,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. @@ -3906,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"` } @@ -3931,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 @@ -3952,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. @@ -3969,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 @@ -3986,7 +3938,6 @@ func (PermissionRequestExtensionManagement) permissionRequest() {} func (PermissionRequestExtensionManagement) Kind() PermissionRequestKind { return PermissionRequestKindExtensionManagement } - // Extension permission access request type PermissionRequestExtensionPermissionAccess struct { // Capabilities the extension is requesting @@ -4003,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 @@ -4044,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 @@ -4063,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 @@ -4089,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 @@ -4121,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 @@ -4134,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"` } @@ -4142,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 @@ -4169,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 @@ -4179,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 @@ -4202,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 @@ -4221,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"` } @@ -4267,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 @@ -4278,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 @@ -4293,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 @@ -4306,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 @@ -4317,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 @@ -4330,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 @@ -4343,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 @@ -4354,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 @@ -4367,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 { } @@ -4393,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:..."). @@ -4405,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"` } @@ -4416,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 @@ -4429,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() {} @@ -4439,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 @@ -4449,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"` } @@ -4587,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 @@ -4608,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 @@ -4625,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. @@ -4656,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/') @@ -4673,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 @@ -4690,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 @@ -4705,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 @@ -4718,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. @@ -4745,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"` @@ -4755,7 +4689,6 @@ func (SystemNotificationFactoryPauseInfoCheckpoint) systemNotificationFactoryPau func (SystemNotificationFactoryPauseInfoCheckpoint) Type() SystemNotificationFactoryPauseInfoType { return SystemNotificationFactoryPauseInfoTypeCheckpoint } - type SystemNotificationFactoryPauseInfoUser struct { } @@ -4779,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 @@ -4792,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 @@ -4805,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 @@ -4816,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 @@ -4839,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 @@ -4860,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 @@ -4875,7 +4802,6 @@ func (ToolExecutionCompleteContentTerminal) toolExecutionCompleteContent() {} func (ToolExecutionCompleteContentTerminal) Type() ToolExecutionCompleteContentType { return ToolExecutionCompleteContentTypeTerminal } - // Plain text content block type ToolExecutionCompleteContentText struct { // The text content @@ -5290,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. @@ -5743,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 @@ -5787,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 @@ -5835,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" ) @@ -5861,7 +5798,7 @@ const ( type PersistedBinaryResultType string const ( - PersistedBinaryResultTypeImage PersistedBinaryResultType = "image" + PersistedBinaryResultTypeImage PersistedBinaryResultType = "image" PersistedBinaryResultTypeResource PersistedBinaryResultType = "resource" ) @@ -6000,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 @@ -6031,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. @@ -6126,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/AssistantMessageEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java index 9ba4f05618..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,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, 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, /** 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/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 new file mode 100644 index 0000000000..a673267f32 --- /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. 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, + /** 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/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/SessionSendMessagesParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionSendMessagesParams.java index 2943192041..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, @@ -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/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/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/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 7effb81e95..a80f751f17 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -301,6 +301,87 @@ 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. +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 +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. +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 +`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. + +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; +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 035f0f5e60..21f34d7c84 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 b2ce8c05e9..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. * @@ -3025,6 +3009,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. * @@ -4256,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?: | ( @@ -4264,6 +4262,10 @@ export interface CopilotUserResponse { [k: string]: unknown | undefined; } | ({ + /** + * Numeric database ID of the organization. + */ + id?: number; /** * GitHub login of the organization. */ @@ -7553,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; @@ -9016,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". @@ -9027,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. @@ -9956,6 +9972,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. 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; + /** + * 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. * @@ -13515,6 +13556,7 @@ export interface ModelSwitchToResult { /** @experimental */ export interface ModeSetRequest { mode: SessionMode; + expectedMode?: SessionMode; /** * Session whose plan-mode base state should be inherited. */ @@ -13569,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. @@ -17820,7 +17866,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; @@ -17835,6 +17881,7 @@ export interface SendMessagesRequest { requestHeaders?: { [k: string]: string | undefined; }; + responseFormat?: ResponseFormat; /** * W3C Trace Context traceparent header for distributed tracing of this agent turn */ @@ -17857,7 +17904,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[]; } @@ -17907,6 +17954,7 @@ export interface SendRequest { requestHeaders?: { [k: string]: string | undefined; }; + responseFormat?: ResponseFormat; /** * W3C Trace Context traceparent header for distributed tracing of this agent turn */ @@ -19228,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. */ @@ -20405,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; @@ -24662,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. * @@ -25539,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 b33830dc7d..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. */ @@ -5049,6 +5076,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, 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; /** * Actual output token count from the API response (completion_tokens), used for accurate token accounting */ @@ -8109,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 */ @@ -8193,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 */ @@ -8226,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 */ @@ -8656,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 */ @@ -8687,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 */ @@ -9096,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 */ @@ -9378,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/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..356999d2c2 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; @@ -693,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 @@ -725,6 +729,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 +754,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 +773,52 @@ 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; + 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; + + 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 +871,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 efff9b47df..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"; @@ -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) @@ -3395,6 +3403,20 @@ 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. + * 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. + * 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..62bb5153fa --- /dev/null +++ b/nodejs/test/e2e/structured_output.e2e.test.ts @@ -0,0 +1,487 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +import { describe, expect, expectTypeOf, it } from "vitest"; +import { z } from "zod"; +import { + approveAll, + defineTool, + type AssistantMessageEvent, + 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({ + copilotClientOptions: { + env: { COPILOT_CLI_ENABLED_FEATURE_FLAGS: "HYDRAFUSION,HYDRAFUSION_ROLLOUT" }, + }, + }); + 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 calls = 0; + 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 () => { + calls++; + 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(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( + (event) => event.type === "assistant.message" && !event.agentId + ); + expect(replies.some((event) => event.data.toolRequests?.length)).toBe(true); + 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", + schema.toJSONSchema() + ); + } + }); + + 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; + 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[] = []; + const errors: string[] = []; + let idle = false; + const unsubscribe = session.on((event) => { + if (event.agentId) return; + if (event.type === "assistant.message") { + replies.push(event); + } else if (event.type === "session.error") { + 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") }); + try { + 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(replies.some((event) => event.data.toolRequests?.length)).toBe(true); + expect(reply.data.toolRequests ?? []).toEqual([]); + expect(replies.at(-1)).toBe(reply); + } finally { + 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("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; + 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..9068ab125a --- /dev/null +++ b/nodejs/test/structured-output.test.ts @@ -0,0 +1,297 @@ +/*--------------------------------------------------------------------------------------------- + * 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.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); + 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("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"); + await sent(sends); + session._dispatchEvent(user("one")); + session._dispatchEvent( + event("assistant.message", { + messageId: "final-reply", + originatingMessageId: "one", + 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("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); + 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 6a25a8018f..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. @@ -4408,6 +4409,51 @@ 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. 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.""" + + 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.""" @@ -7603,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. @@ -9873,6 +9908,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: @@ -10522,8 +10560,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 @@ -17194,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': @@ -17314,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: @@ -20461,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.""" @@ -20493,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")) @@ -20502,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: @@ -20587,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.""" @@ -20600,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 = {} @@ -20617,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 @@ -23286,116 +23294,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: @@ -23667,6 +23565,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: @@ -23795,83 +23730,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: @@ -29275,6 +29133,216 @@ 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, 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 + 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: @@ -32954,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.""" @@ -33067,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")) @@ -33085,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 = {} @@ -33197,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: @@ -33886,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.""" @@ -34513,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: @@ -37394,6 +37543,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 @@ -37687,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 @@ -37875,6 +38024,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 @@ -38632,6 +38782,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")) @@ -38925,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")) @@ -39113,6 +39263,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")) @@ -39530,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, 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, 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 = {} @@ -39870,6 +40021,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) @@ -40163,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) @@ -40351,6 +40502,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) @@ -41665,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))) @@ -42289,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))) @@ -44512,6 +44664,7 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "InstructionsGetSourcesResult", "InterruptMainTurnRequest", "InterruptMainTurnResult", + "JSONSchemaResponseFormat", "KindEnum", "LimitPredictionApi", "LlmInferenceHTTPRequestChunkRequest", @@ -44867,7 +45020,6 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "PermissionDecisionReject", "PermissionDecisionRejectKind", "PermissionDecisionRequest", - "PermissionDecisionSource", "PermissionDecisionSurface", "PermissionDecisionUserNotAvailable", "PermissionDecisionUserNotAvailableKind", @@ -45090,6 +45242,8 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "RemoteSessionMetadataValue", "RemoteSessionMode", "RemoteSessionRepository", + "ResponseFormat", + "ResponseFormatType", "RunOptions", "SandboxApi", "SandboxConfig", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index f70a1caa70..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: @@ -2449,6 +2599,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 @@ -2478,6 +2629,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")) @@ -2503,6 +2655,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, @@ -2540,6 +2693,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: @@ -5876,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 @@ -5883,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, ) @@ -5894,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 @@ -6532,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 @@ -6541,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, ) @@ -6559,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 @@ -6632,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 @@ -6644,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, @@ -6653,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, ) @@ -6669,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 @@ -7092,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 @@ -7102,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, @@ -7109,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, ) @@ -7123,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 @@ -7144,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 @@ -7162,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( @@ -7177,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, ) @@ -7201,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: @@ -7335,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 @@ -7348,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, @@ -7358,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, ) @@ -7376,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 @@ -12125,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." @@ -12661,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. @@ -12963,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 @@ -13075,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) @@ -13346,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 7500c30745..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. @@ -7123,6 +7134,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. 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")] + pub strict: Option, +} + /// A request body chunk or cancellation signal. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -11060,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, @@ -11117,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. @@ -15084,6 +15124,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. /// ///
@@ -15649,6 +15706,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. /// ///
@@ -15663,7 +15729,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")] @@ -15674,6 +15740,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, @@ -15696,10 +15765,19 @@ 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, } +#[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 /// ///
@@ -15737,6 +15815,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")] @@ -17454,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, @@ -18561,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. @@ -22778,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, } @@ -23023,7 +23107,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, } @@ -24062,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. @@ -27851,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, } @@ -30469,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. /// ///
/// @@ -30479,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. @@ -32978,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. /// ///
@@ -33698,6 +33757,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. /// ///
@@ -33735,6 +33802,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 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 611f04d40f..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")] @@ -2880,6 +2952,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, 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 #[serde(skip_serializing_if = "Option::is_none")] pub output_tokens: Option, @@ -4506,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, @@ -4540,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, @@ -4564,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, @@ -4938,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, @@ -4966,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, @@ -5551,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 @@ -5560,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")] @@ -8274,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 { @@ -8459,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/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 3e7728a138..9fe2ffae05 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"); @@ -2607,7 +2614,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/concurrent_typed_sends_return_their_own_results.yaml b/test/snapshots/structured_output/concurrent_typed_sends_return_their_own_results.yaml new file mode 100644 index 0000000000..24f06c4278 --- /dev/null +++ b/test/snapshots/structured_output/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/infers_typed_result_after_custom_tool.yaml b/test/snapshots/structured_output/infers_typed_result_after_custom_tool.yaml new file mode 100644 index 0000000000..d3cd70234d --- /dev/null +++ b/test/snapshots/structured_output/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/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_send_selects_correlated_response_after_idle.yaml b/test/snapshots/structured_output/node_send_selects_correlated_response_after_idle.yaml new file mode 100644 index 0000000000..3e3a73c531 --- /dev/null +++ b/test/snapshots/structured_output/node_send_selects_correlated_response_after_idle.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/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/send_selects_correlated_response_after_idle.yaml b/test/snapshots/structured_output/send_selects_correlated_response_after_idle.yaml new file mode 100644 index 0000000000..35406a19ba --- /dev/null +++ b/test/snapshots/structured_output/send_selects_correlated_response_after_idle.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}' diff --git a/test/snapshots/structured_output/sends_explicit_schema_for_message_and_batch.yaml b/test/snapshots/structured_output/sends_explicit_schema_for_message_and_batch.yaml new file mode 100644 index 0000000000..f450faacb7 --- /dev/null +++ b/test/snapshots/structured_output/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}' 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}' 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}' 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}'