diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs
index d09976bc80..cd6d8c9b7d 100644
--- a/dotnet/src/Generated/Rpc.cs
+++ b/dotnet/src/Generated/Rpc.cs
@@ -65,7 +65,7 @@ internal sealed class ConnectResult
[Experimental(Diagnostics.Experimental)]
internal sealed class ConnectRequest
{
- /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification, in addition to the runtime's normal GitHub/CTS emission (dual-write). Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled.
+ /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events.
[JsonPropertyName("enableGitHubTelemetryForwarding")]
public bool? EnableGitHubTelemetryForwarding { get; set; }
@@ -346,6 +346,24 @@ internal sealed class ModelsListRequest
public string? GitHubToken { get; set; }
}
+/// A well-known model in the runtime's built-in catalog.
+[Experimental(Diagnostics.Experimental)]
+public sealed class BuiltInModelCatalogEntry
+{
+ /// Well-known runtime model ID suitable for `ProviderConfig.modelId` or `ProviderModelConfig.modelId`. This is not necessarily the provider-facing deployment or model name and does not indicate CAPI entitlement or provider availability.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+}
+
+/// The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata.
+[Experimental(Diagnostics.Experimental)]
+public sealed class BuiltInModelCatalog
+{
+ /// Built-in model entries.
+ [JsonPropertyName("models")]
+ public IList Models { get => field ??= []; set; }
+}
+
/// Built-in tool metadata with identifier, optional namespaced name, description, input-parameter schema, and usage instructions.
[Experimental(Diagnostics.Experimental)]
public sealed class Tool
@@ -2484,6 +2502,87 @@ internal sealed class SessionsListRequest
public bool? ThrowOnError { get; set; }
}
+/// Persisted local session metadata, including identifiers, timestamps, summary/name, client, context, detached state, and task ID.
+[Experimental(Diagnostics.Experimental)]
+public sealed class LocalSessionMetadataValue
+{
+ /// Runtime client name that created/last resumed this session.
+ [JsonPropertyName("clientName")]
+ public string? ClientName { get; set; }
+
+ /// Pre-resolved working-directory context for session startup.
+ [JsonPropertyName("context")]
+ public SessionContext? Context { get; set; }
+
+ /// True for detached maintenance sessions that should be hidden from normal resume lists.
+ [JsonPropertyName("isDetached")]
+ public bool? IsDetached { get; set; }
+
+ /// Always false for local sessions.
+ [JsonPropertyName("isRemote")]
+ public bool IsRemote { get; set; }
+
+ /// GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control.
+ [JsonPropertyName("mcTaskId")]
+ public string? McTaskId { get; set; }
+
+ /// Last-modified time of the session's persisted state, as ISO 8601.
+ [JsonPropertyName("modifiedTime")]
+ public string ModifiedTime { get; set; } = string.Empty;
+
+ /// Optional human-friendly name set via /rename.
+ [JsonPropertyName("name")]
+ public string? Name { get; set; }
+
+ /// Stable session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// Session creation time as an ISO 8601 timestamp.
+ [JsonPropertyName("startTime")]
+ public string StartTime { get; set; } = string.Empty;
+
+ /// Short summary of the session, when one has been derived.
+ [JsonPropertyName("summary")]
+ public string? Summary { get; set; }
+}
+
+/// Persisted local session metadata when the session exists.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsGetMetadataResult
+{
+ /// Local session metadata, omitted when the session does not exist.
+ [JsonPropertyName("session")]
+ public LocalSessionMetadataValue? Session { get; set; }
+}
+
+/// Session ID whose persisted metadata should be read.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsGetMetadataRequest
+{
+ /// Session ID to inspect.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Recent local session IDs that contain user-visible history.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsListNonEmptySessionIdsResult
+{
+ /// Session IDs ordered newest-first.
+ [JsonPropertyName("sessionIds")]
+ public IList SessionIds { get => field ??= []; set; }
+}
+
+/// Limit for non-empty local session IDs.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsListNonEmptySessionIdsRequest
+{
+ /// Maximum number of session IDs to return.
+ [JsonPropertyName("limit")]
+ public long? Limit { get; set; }
+}
+
/// ID of the local session bound to the given GitHub task, or omitted when none.
[Experimental(Diagnostics.Experimental)]
public sealed class SessionsFindByTaskIDResult
@@ -2634,6 +2733,19 @@ internal sealed class SessionsBulkDeleteRequest
public IList SessionIds { get => field ??= []; set; }
}
+/// Session ID to delete from disk.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsDeleteRequest
+{
+ /// Session ID to delete.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// Internal resolved session directory path to delete.
+ [JsonPropertyName("sessionPath")]
+ public string? SessionPath { get; set; }
+}
+
/// Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag.
[Experimental(Diagnostics.Experimental)]
public sealed class SessionPruneResult
@@ -2710,51 +2822,6 @@ internal sealed class SessionsReleaseLockRequest
public string SessionId { get; set; } = string.Empty;
}
-/// Persisted local session metadata, including identifiers, timestamps, summary/name, client, context, detached state, and task ID.
-[Experimental(Diagnostics.Experimental)]
-public sealed class LocalSessionMetadataValue
-{
- /// Runtime client name that created/last resumed this session.
- [JsonPropertyName("clientName")]
- public string? ClientName { get; set; }
-
- /// Pre-resolved working-directory context for session startup.
- [JsonPropertyName("context")]
- public SessionContext? Context { get; set; }
-
- /// True for detached maintenance sessions that should be hidden from normal resume lists.
- [JsonPropertyName("isDetached")]
- public bool? IsDetached { get; set; }
-
- /// Always false for local sessions.
- [JsonPropertyName("isRemote")]
- public bool IsRemote { get; set; }
-
- /// GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control.
- [JsonPropertyName("mcTaskId")]
- public string? McTaskId { get; set; }
-
- /// Last-modified time of the session's persisted state, as ISO 8601.
- [JsonPropertyName("modifiedTime")]
- public string ModifiedTime { get; set; } = string.Empty;
-
- /// Optional human-friendly name set via /rename.
- [JsonPropertyName("name")]
- public string? Name { get; set; }
-
- /// Stable session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-
- /// Session creation time as an ISO 8601 timestamp.
- [JsonPropertyName("startTime")]
- public string StartTime { get; set; } = string.Empty;
-
- /// Short summary of the session, when one has been derived.
- [JsonPropertyName("summary")]
- public string? Summary { get; set; }
-}
-
/// The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted.
[Experimental(Diagnostics.Experimental)]
public sealed class SessionEnrichMetadataResult
@@ -3451,8 +3518,8 @@ internal sealed class SendRequest
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
- /// Optional provenance tag copied to the resulting user.message event. Must match one of three forms: the literal `system`, `command-<command-id>` for messages originating from a command (e.g. slash command, Mission Control command), or `schedule-<numeric-id>` for messages originating from a scheduled job.
- [RegularExpression("^(system|command-.*|schedule-\\d+)$")]
+ /// 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.
+ [RegularExpression("^(user|system|command-.*|schedule-\\d+|agent-.+)$")]
[JsonInclude]
[JsonPropertyName("source")]
internal string? Source { get; set; }
@@ -3504,8 +3571,8 @@ public sealed class SendMessageItem
[JsonPropertyName("requiredTool")]
public string? RequiredTool { get; set; }
- /// Optional provenance tag copied to the resulting user.message event. Must match one of three forms: the literal `system`, `command-<command-id>` for messages originating from a command (e.g. slash command, Mission Control command), or `schedule-<numeric-id>` for messages originating from a scheduled job.
- [RegularExpression("^(system|command-.*|schedule-\\d+)$")]
+ /// 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.
+ [RegularExpression("^(user|system|command-.*|schedule-\\d+|agent-.+)$")]
[JsonInclude]
[JsonPropertyName("source")]
internal string? Source { get; set; }
@@ -3552,6 +3619,27 @@ internal sealed class SendMessagesRequest
public bool? Wait { get; set; }
}
+/// Internal request for sending a system notification.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SendSystemNotificationRequest
+{
+ /// Optional structured notification kind.
+ [JsonPropertyName("kind")]
+ public JsonElement? Kind { get; set; }
+
+ /// Notification text to deliver to the model.
+ [JsonPropertyName("message")]
+ public string Message { get; set; } = string.Empty;
+
+ /// Internal delivery options, including passive policy.
+ [JsonPropertyName("options")]
+ public JsonElement? Options { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
/// Result of aborting the current turn.
[Experimental(Diagnostics.Experimental)]
public sealed class AbortResult
@@ -3578,6 +3666,37 @@ internal sealed class AbortRequest
public string SessionId { get; set; } = string.Empty;
}
+/// Result of interrupting the main agent turn.
+[Experimental(Diagnostics.Experimental)]
+public sealed class InterruptMainTurnResult
+{
+ /// Whether an in-flight main agent turn was interrupted. False when the main loop was not processing.
+ [JsonPropertyName("interrupted")]
+ public bool Interrupted { get; set; }
+}
+
+/// Parameters for interrupting the main agent turn.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class InterruptMainTurnRequest
+{
+ /// When true, the user's queued prompts are preserved and run as the next turn once the interrupted turn unwinds; when false (the default), the queue is cleared like a plain abort.
+ [JsonPropertyName("flushQueued")]
+ public bool? FlushQueued { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionCancelAllBackgroundAgentsRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
/// Parameters for shutting down the session.
[Experimental(Diagnostics.Experimental)]
internal sealed class ShutdownRequest
@@ -4095,6 +4214,7 @@ internal sealed class CanvasActionInvokeRequest
UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
[JsonDerivedType(typeof(FactoryRunFailureFactoryLimitReached), "factory_limit_reached")]
[JsonDerivedType(typeof(FactoryRunFailureFactoryResumeDeclined), "factory_resume_declined")]
+[JsonDerivedType(typeof(FactoryRunFailureFactoryDurableFailure), "factory_durable_failure")]
public partial class FactoryRunFailure
{
/// The type discriminator.
@@ -4141,6 +4261,27 @@ public partial class FactoryRunFailureFactoryResumeDeclined : FactoryRunFailure
public required string RunId { get; set; }
}
+/// The factory_durable_failure variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class FactoryRunFailureFactoryDurableFailure : FactoryRunFailure
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "factory_durable_failure";
+
+ /// Stable failure code.
+ [JsonPropertyName("code")]
+ public required string Code { get; set; }
+
+ /// Execution-critical durable operation that failed.
+ [JsonPropertyName("operation")]
+ public required FactoryDurableOperation Operation { get; set; }
+
+ /// Factory run identifier.
+ [JsonPropertyName("runId")]
+ public required string RunId { get; set; }
+}
+
/// Complete current or terminal factory run envelope.
[Experimental(Diagnostics.Experimental)]
public sealed class FactoryRunResult
@@ -4178,6 +4319,10 @@ public sealed class FactoryRunResult
[Experimental(Diagnostics.Experimental)]
public sealed class FactoryRunLimits
{
+ /// Maximum AI credits consumed by factory subagents and their descendants. The post-paid ceiling is soft: parallel turns can settle beyond it before the run stops.
+ [JsonPropertyName("maxAiCredits")]
+ public double? MaxAiCredits { get; set; }
+
/// Maximum number of factory subagents that may run concurrently.
[JsonPropertyName("maxConcurrentSubagents")]
public long? MaxConcurrentSubagents { get; set; }
@@ -4186,9 +4331,9 @@ public sealed class FactoryRunLimits
[JsonPropertyName("maxTotalSubagents")]
public long? MaxTotalSubagents { get; set; }
- /// Factory active-run timeout in milliseconds.
- [JsonPropertyName("timeout")]
- public double? Timeout { get; set; }
+ /// Maximum accumulated active-execution time in seconds. Active execution includes the entire extension body, subprocess waits, queued-agent waits, and sleeps; time between resumed attempts is not counted.
+ [JsonPropertyName("timeoutSeconds")]
+ public double? TimeoutSeconds { get; set; }
}
/// Options controlling factory invocation.
@@ -4225,10 +4370,27 @@ internal sealed class FactoryRunRequest
public string SessionId { get; set; } = string.Empty;
}
-/// Parameters for retrieving a factory run.
+/// Resolved persisted factory identity and resumed run envelope.
[Experimental(Diagnostics.Experimental)]
-internal sealed class FactoryGetRunRequest
+public sealed class FactoryResumeResult
+{
+ /// Persisted factory name resolved for the resumed run.
+ [JsonPropertyName("factoryName")]
+ public string FactoryName { get; set; } = string.Empty;
+
+ /// Terminal resumed run envelope.
+ [JsonPropertyName("run")]
+ public FactoryRunResult Run { get => field ??= new(); set; }
+}
+
+/// Parameters for resuming a factory run from its persisted identity.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class FactoryResumeRequest
{
+ /// Optional per-invocation resource ceiling overrides.
+ [JsonPropertyName("limits")]
+ public FactoryRunLimits? Limits { get; set; }
+
/// Factory run identifier.
[JsonPropertyName("runId")]
public string RunId { get; set; } = string.Empty;
@@ -4238,9 +4400,9 @@ internal sealed class FactoryGetRunRequest
public string SessionId { get; set; } = string.Empty;
}
-/// Parameters for cancelling a factory run.
+/// Parameters for retrieving a factory run.
[Experimental(Diagnostics.Experimental)]
-internal sealed class FactoryCancelRequest
+internal sealed class FactoryGetRunRequest
{
/// Factory run identifier.
[JsonPropertyName("runId")]
@@ -4251,64 +4413,546 @@ internal sealed class FactoryCancelRequest
public string SessionId { get; set; } = string.Empty;
}
-/// Acknowledgement that a factory request was accepted.
+/// Declared or approved factory resource ceilings.
[Experimental(Diagnostics.Experimental)]
-public sealed class FactoryAckResult
+public sealed class FactoryDeclaredLimits
{
+ /// Gets or sets the maxAiCredits value.
+ [JsonPropertyName("maxAiCredits")]
+ public double? MaxAiCredits { get; set; }
+
+ /// Gets or sets the maxConcurrentSubagents value.
+ [JsonPropertyName("maxConcurrentSubagents")]
+ public long? MaxConcurrentSubagents { get; set; }
+
+ /// Gets or sets the maxTotalSubagents value.
+ [JsonPropertyName("maxTotalSubagents")]
+ public long? MaxTotalSubagents { get; set; }
+
+ /// Gets or sets the timeoutSeconds value.
+ [JsonPropertyName("timeoutSeconds")]
+ public double? TimeoutSeconds { get; set; }
}
-/// One ordered factory progress line.
+/// Durable factory resource consumption.
[Experimental(Diagnostics.Experimental)]
-public sealed class FactoryLogLine
+public sealed class FactoryRunConsumed
{
- /// Progress line kind.
- [JsonPropertyName("kind")]
- public FactoryLogLineKind Kind { get; set; }
+ /// Gets or sets the activeMs value.
+ [JsonPropertyName("activeMs")]
+ public long ActiveMs { get; set; }
- /// Monotonic sequence number within the factory run.
- [JsonPropertyName("seq")]
- public long Seq { get; set; }
+ /// Gets or sets the nanoAiu value.
+ [JsonPropertyName("nanoAiu")]
+ public long NanoAiu { get; set; }
- /// Progress text.
- [JsonPropertyName("text")]
- public string Text { get; set; } = string.Empty;
+ /// Gets or sets the subagents value.
+ [JsonPropertyName("subagents")]
+ public long Subagents { get; set; }
}
-/// Parameters for recording factory progress.
+/// Current factory phase identity.
[Experimental(Diagnostics.Experimental)]
-internal sealed class FactoryLogRequest
+public sealed class FactoryCurrentPhase
{
- /// Ordered progress lines to append.
- [JsonPropertyName("lines")]
- public IList Lines { get => field ??= []; set; }
-
- /// Factory run identifier.
- [JsonPropertyName("runId")]
- public string RunId { get; set; } = string.Empty;
+ /// Gets or sets the id value.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Gets or sets the ordinal value.
+ [JsonPropertyName("ordinal")]
+ public long? Ordinal { get; set; }
}
-/// Result of one factory-scoped subagent call.
+/// Prompt-safe terminal factory outcome.
[Experimental(Diagnostics.Experimental)]
-public sealed class FactoryAgentResult
+public sealed class FactoryRunTerminal
{
- /// Agent result, omitted when the agent produced no result.
- [JsonPropertyName("result")]
- public JsonElement? Result { get; set; }
+ /// Gets or sets the error value.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+
+ /// Gets or sets the failure value.
+ [JsonPropertyName("failure")]
+ public FactoryRunFailure? Failure { get; set; }
+
+ /// Gets or sets the reason value.
+ [JsonPropertyName("reason")]
+ public string? Reason { get; set; }
+
+ /// Gets or sets the resultPreview value.
+ [JsonPropertyName("resultPreview")]
+ public string? ResultPreview { get; set; }
}
-/// Options for one factory-scoped subagent call.
+/// Durable factory run summary with read-time live overlays.
[Experimental(Diagnostics.Experimental)]
-public sealed class FactoryAgentOptions
+public sealed class FactoryRunSummary
{
- /// Optional label distinguishing otherwise identical memoized agent calls.
- [JsonPropertyName("label")]
- public string? Label { get; set; }
+ /// Gets or sets the activeSegmentStartedAt value.
+ [JsonPropertyName("activeSegmentStartedAt")]
+ public long? ActiveSegmentStartedAt { get; set; }
- /// Optional model identifier for the subagent.
+ /// Gets or sets the approved value.
+ [JsonPropertyName("approved")]
+ public FactoryDeclaredLimits? Approved { get; set; }
+
+ /// Gets or sets the completedAt value.
+ [JsonPropertyName("completedAt")]
+ public long? CompletedAt { get; set; }
+
+ /// Gets or sets the consumed value.
+ [JsonPropertyName("consumed")]
+ public FactoryRunConsumed Consumed { get => field ??= new(); set; }
+
+ /// Gets or sets the createdAt value.
+ [JsonPropertyName("createdAt")]
+ public long CreatedAt { get; set; }
+
+ /// Gets or sets the currentPhase value.
+ [JsonPropertyName("currentPhase")]
+ public FactoryCurrentPhase? CurrentPhase { get; set; }
+
+ /// Gets or sets the declaredLimits value.
+ [JsonPropertyName("declaredLimits")]
+ public FactoryDeclaredLimits DeclaredLimits { get => field ??= new(); set; }
+
+ /// Gets or sets the declaredPhaseCount value.
+ [JsonPropertyName("declaredPhaseCount")]
+ public long DeclaredPhaseCount { get; set; }
+
+ /// Gets or sets the description value.
+ [JsonPropertyName("description")]
+ public string Description { get; set; } = string.Empty;
+
+ /// Gets or sets the factoryName value.
+ [JsonPropertyName("factoryName")]
+ public string FactoryName { get; set; } = string.Empty;
+
+ /// Gets or sets the liveAgentCount value.
+ [JsonPropertyName("liveAgentCount")]
+ public long LiveAgentCount { get; set; }
+
+ /// Gets or sets the observedAt value.
+ [JsonPropertyName("observedAt")]
+ public long ObservedAt { get; set; }
+
+ /// Gets or sets the revision value.
+ [JsonPropertyName("revision")]
+ public long Revision { get; set; }
+
+ /// Gets or sets the runId value.
+ [JsonPropertyName("runId")]
+ public string RunId { get; set; } = string.Empty;
+
+ /// Gets or sets the startedAt value.
+ [JsonPropertyName("startedAt")]
+ public long? StartedAt { get; set; }
+
+ /// Gets or sets the status value.
+ [JsonPropertyName("status")]
+ public FactoryRunStatus Status { get; set; }
+
+ /// Gets or sets the terminal value.
+ [JsonPropertyName("terminal")]
+ public FactoryRunTerminal? Terminal { get; set; }
+
+ /// Gets or sets the totalSpawnedAgentCount value.
+ [JsonPropertyName("totalSpawnedAgentCount")]
+ public long TotalSpawnedAgentCount { get; set; }
+
+ /// Gets or sets the updatedAt value.
+ [JsonPropertyName("updatedAt")]
+ public long UpdatedAt { get; set; }
+}
+
+/// Factory runs in durable creation order.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryListRunsResult
+{
+ /// Gets or sets the runs value.
+ [JsonPropertyName("runs")]
+ public IList Runs { get => field ??= []; set; }
+}
+
+/// Empty parameters for listing factory runs.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class FactoryListRunsRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Prompt-safe durable identity and live status for a direct factory agent.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryAgentSummary
+{
+ /// Gets or sets the activeMs value.
+ [JsonPropertyName("activeMs")]
+ public long ActiveMs { get; set; }
+
+ /// Gets or sets the activity value.
+ [JsonPropertyName("activity")]
+ public string? Activity { get; set; }
+
+ /// Gets or sets the agentId value.
+ [JsonPropertyName("agentId")]
+ public string AgentId { get; set; } = string.Empty;
+
+ /// Gets or sets the agentType value.
+ [JsonPropertyName("agentType")]
+ public string AgentType { get; set; } = string.Empty;
+
+ /// Gets or sets the completedAt value.
+ [JsonPropertyName("completedAt")]
+ public long? CompletedAt { get; set; }
+
+ /// Gets or sets the label value.
+ [JsonPropertyName("label")]
+ public string Label { get; set; } = string.Empty;
+
+ /// Gets or sets the phaseId value.
+ [JsonPropertyName("phaseId")]
+ public string? PhaseId { get; set; }
+
+ /// Gets or sets the requestedModel value.
+ [JsonPropertyName("requestedModel")]
+ public string? RequestedModel { get; set; }
+
+ /// Gets or sets the resolvedModel value.
+ [JsonPropertyName("resolvedModel")]
+ public string? ResolvedModel { get; set; }
+
+ /// Gets or sets the runId value.
+ [JsonPropertyName("runId")]
+ public string RunId { get; set; } = string.Empty;
+
+ /// Gets or sets the startedAt value.
+ [JsonPropertyName("startedAt")]
+ public long? StartedAt { get; set; }
+
+ /// Gets or sets the status value.
+ [JsonPropertyName("status")]
+ public string Status { get; set; } = string.Empty;
+
+ /// Gets or sets the toolCallId value.
+ [JsonPropertyName("toolCallId")]
+ public string ToolCallId { get; set; } = string.Empty;
+}
+
+/// Durable lifecycle and timing for one factory phase.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryPhaseObservation
+{
+ /// Gets or sets the accumulatedActiveMs value.
+ [JsonPropertyName("accumulatedActiveMs")]
+ public long AccumulatedActiveMs { get; set; }
+
+ /// Gets or sets the completedAt value.
+ [JsonPropertyName("completedAt")]
+ public long? CompletedAt { get; set; }
+
+ /// Gets or sets the currentActiveMs value.
+ [JsonPropertyName("currentActiveMs")]
+ public long CurrentActiveMs { get; set; }
+
+ /// Gets or sets the detail value.
+ [JsonPropertyName("detail")]
+ public string? Detail { get; set; }
+
+ /// Gets or sets the entryCount value.
+ [JsonPropertyName("entryCount")]
+ public long EntryCount { get; set; }
+
+ /// Gets or sets the id value.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Gets or sets the lastEnteredRunAttempt value.
+ [JsonPropertyName("lastEnteredRunAttempt")]
+ public long LastEnteredRunAttempt { get; set; }
+
+ /// Gets or sets the liveAgentCount value.
+ [JsonPropertyName("liveAgentCount")]
+ public long LiveAgentCount { get; set; }
+
+ /// Gets or sets the ordinal value.
+ [JsonPropertyName("ordinal")]
+ public long? Ordinal { get; set; }
+
+ /// Gets or sets the startedAt value.
+ [JsonPropertyName("startedAt")]
+ public long? StartedAt { get; set; }
+
+ /// Gets or sets the status value.
+ [JsonPropertyName("status")]
+ public FactoryPhaseStatus Status { get; set; }
+
+ /// Gets or sets the title value.
+ [JsonPropertyName("title")]
+ public string Title { get; set; } = string.Empty;
+
+ /// Gets or sets the totalAgentCount value.
+ [JsonPropertyName("totalAgentCount")]
+ public long TotalAgentCount { get; set; }
+}
+
+/// One durable factory progress record.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryProgressLine
+{
+ /// Resume attempt that emitted this record.
+ [JsonPropertyName("attempt")]
+ public long Attempt { get; set; }
+
+ /// Progress record kind.
+ [JsonPropertyName("kind")]
+ public FactoryLogLineKind Kind { get; set; }
+
+ /// Phase active when the record was emitted, or null before any phase.
+ [JsonPropertyName("phaseId")]
+ public string? PhaseId { get; set; }
+
+ /// Epoch milliseconds when the record was persisted.
+ [JsonPropertyName("recordedAt")]
+ public long RecordedAt { get; set; }
+
+ /// Global monotonic sequence number within the run.
+ [JsonPropertyName("seq")]
+ public long Seq { get; set; }
+
+ /// Prompt-safe progress text.
+ [JsonPropertyName("text")]
+ public string Text { get; set; } = string.Empty;
+}
+
+/// A bidirectional page of factory progress.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryProgressPage
+{
+ /// Gets or sets the hasMoreNewer value.
+ [JsonPropertyName("hasMoreNewer")]
+ public bool HasMoreNewer { get; set; }
+
+ /// Gets or sets the hasMoreOlder value.
+ [JsonPropertyName("hasMoreOlder")]
+ public bool HasMoreOlder { get; set; }
+
+ /// Gets or sets the newestSeq value.
+ [JsonPropertyName("newestSeq")]
+ public long? NewestSeq { get; set; }
+
+ /// Gets or sets the oldestSeq value.
+ [JsonPropertyName("oldestSeq")]
+ public long? OldestSeq { get; set; }
+
+ /// Gets or sets the records value.
+ [JsonPropertyName("records")]
+ public IList Records { get => field ??= []; set; }
+
+ /// Run revision reflected by this page.
+ [JsonPropertyName("revision")]
+ public long Revision { get; set; }
+}
+
+/// Full factory run observability detail.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryRunDetail
+{
+ /// Gets or sets the activeSegmentStartedAt value.
+ [JsonPropertyName("activeSegmentStartedAt")]
+ public long? ActiveSegmentStartedAt { get; set; }
+
+ /// Gets or sets the agents value.
+ [JsonPropertyName("agents")]
+ public IList Agents { get => field ??= []; set; }
+
+ /// Gets or sets the approved value.
+ [JsonPropertyName("approved")]
+ public FactoryDeclaredLimits? Approved { get; set; }
+
+ /// Gets or sets the completedAt value.
+ [JsonPropertyName("completedAt")]
+ public long? CompletedAt { get; set; }
+
+ /// Gets or sets the consumed value.
+ [JsonPropertyName("consumed")]
+ public FactoryRunConsumed Consumed { get => field ??= new(); set; }
+
+ /// Gets or sets the createdAt value.
+ [JsonPropertyName("createdAt")]
+ public long CreatedAt { get; set; }
+
+ /// Gets or sets the currentPhase value.
+ [JsonPropertyName("currentPhase")]
+ public FactoryCurrentPhase? CurrentPhase { get; set; }
+
+ /// Gets or sets the declaredLimits value.
+ [JsonPropertyName("declaredLimits")]
+ public FactoryDeclaredLimits DeclaredLimits { get => field ??= new(); set; }
+
+ /// Gets or sets the declaredPhaseCount value.
+ [JsonPropertyName("declaredPhaseCount")]
+ public long DeclaredPhaseCount { get; set; }
+
+ /// Gets or sets the description value.
+ [JsonPropertyName("description")]
+ public string Description { get; set; } = string.Empty;
+
+ /// Gets or sets the factoryName value.
+ [JsonPropertyName("factoryName")]
+ public string FactoryName { get; set; } = string.Empty;
+
+ /// Gets or sets the liveAgentCount value.
+ [JsonPropertyName("liveAgentCount")]
+ public long LiveAgentCount { get; set; }
+
+ /// Gets or sets the observedAt value.
+ [JsonPropertyName("observedAt")]
+ public long ObservedAt { get; set; }
+
+ /// Gets or sets the phases value.
+ [JsonPropertyName("phases")]
+ public IList Phases { get => field ??= []; set; }
+
+ /// Gets or sets the progress value.
+ [JsonPropertyName("progress")]
+ public FactoryProgressPage Progress { get => field ??= new(); set; }
+
+ /// Gets or sets the revision value.
+ [JsonPropertyName("revision")]
+ public long Revision { get; set; }
+
+ /// Gets or sets the runId value.
+ [JsonPropertyName("runId")]
+ public string RunId { get; set; } = string.Empty;
+
+ /// Gets or sets the startedAt value.
+ [JsonPropertyName("startedAt")]
+ public long? StartedAt { get; set; }
+
+ /// Gets or sets the status value.
+ [JsonPropertyName("status")]
+ public FactoryRunStatus Status { get; set; }
+
+ /// Gets or sets the terminal value.
+ [JsonPropertyName("terminal")]
+ public FactoryRunTerminal? Terminal { get; set; }
+
+ /// Gets or sets the totalSpawnedAgentCount value.
+ [JsonPropertyName("totalSpawnedAgentCount")]
+ public long TotalSpawnedAgentCount { get; set; }
+
+ /// Gets or sets the updatedAt value.
+ [JsonPropertyName("updatedAt")]
+ public long UpdatedAt { get; set; }
+}
+
+/// Parameters for paging factory progress.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class FactoryGetRunProgressRequest
+{
+ /// Exclusive forward cursor.
+ [JsonPropertyName("afterSeq")]
+ public long? AfterSeq { get; set; }
+
+ /// Exclusive backward cursor.
+ [JsonPropertyName("beforeSeq")]
+ public long? BeforeSeq { get; set; }
+
+ /// Maximum records to return. Defaults to 200 and is capped at 500.
+ [JsonPropertyName("limit")]
+ public int? Limit { get; set; }
+
+ /// Optional phase identifier used to scope records and cursors.
+ [JsonPropertyName("phaseId")]
+ public string? PhaseId { get; set; }
+
+ /// Factory run identifier.
+ [JsonPropertyName("runId")]
+ public string RunId { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Parameters for cancelling a factory run.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class FactoryCancelRequest
+{
+ /// Factory run identifier.
+ [JsonPropertyName("runId")]
+ public string RunId { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Acknowledgement that a factory request was accepted.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryAckResult
+{
+}
+
+/// One ordered factory progress line.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryLogLine
+{
+ /// Progress line kind.
+ [JsonPropertyName("kind")]
+ public FactoryLogLineKind Kind { get; set; }
+
+ /// Monotonic sequence number within the factory run.
+ [JsonPropertyName("seq")]
+ public long Seq { get; set; }
+
+ /// Progress text.
+ [JsonPropertyName("text")]
+ public string Text { get; set; } = string.Empty;
+}
+
+/// Parameters for recording factory progress.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class FactoryLogRequest
+{
+ /// Opaque token identifying the current factory execution attempt.
+ [JsonPropertyName("executionToken")]
+ public string ExecutionToken { get; set; } = string.Empty;
+
+ /// Ordered progress lines to append.
+ [JsonPropertyName("lines")]
+ public IList Lines { get => field ??= []; set; }
+
+ /// Factory run identifier.
+ [JsonPropertyName("runId")]
+ public string RunId { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Result of one factory-scoped subagent call.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryAgentResult
+{
+ /// Agent result, omitted when the agent produced no result.
+ [JsonPropertyName("result")]
+ public JsonElement? Result { get; set; }
+}
+
+/// Options for one factory-scoped subagent call.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryAgentOptions
+{
+ /// Optional label distinguishing otherwise identical memoized agent calls.
+ [JsonPropertyName("label")]
+ public string? Label { get; set; }
+
+ /// Optional model identifier for the subagent.
[JsonPropertyName("model")]
public string? Model { get; set; }
@@ -4321,6 +4965,10 @@ public sealed class FactoryAgentOptions
[Experimental(Diagnostics.Experimental)]
internal sealed class FactoryAgentRequest
{
+ /// Opaque token identifying the current factory execution attempt.
+ [JsonPropertyName("executionToken")]
+ public string ExecutionToken { get; set; } = string.Empty;
+
/// Factory run identifier that owns the subagent.
[JsonPropertyName("factoryRunId")]
public string FactoryRunId { get; set; } = string.Empty;
@@ -4355,6 +5003,10 @@ public sealed class FactoryJournalGetResult
[Experimental(Diagnostics.Experimental)]
internal sealed class FactoryJournalGetRequest
{
+ /// Opaque token identifying the current factory execution attempt.
+ [JsonPropertyName("executionToken")]
+ public string ExecutionToken { get; set; } = string.Empty;
+
/// Namespaced journal key.
[JsonPropertyName("key")]
public string Key { get; set; } = string.Empty;
@@ -4372,6 +5024,10 @@ internal sealed class FactoryJournalGetRequest
[Experimental(Diagnostics.Experimental)]
internal sealed class FactoryJournalPutRequest
{
+ /// Opaque token identifying the current factory execution attempt.
+ [JsonPropertyName("executionToken")]
+ public string ExecutionToken { get; set; } = string.Empty;
+
/// Namespaced journal key.
[JsonPropertyName("key")]
public string Key { get; set; } = string.Empty;
@@ -4873,137 +5529,296 @@ public sealed class WorkspacesGetWorkspaceResultWorkspace
public bool? UserNamed { get; set; }
}
-/// Current workspace metadata for the session, including its absolute filesystem path when available.
+/// Current workspace metadata for the session, including its absolute filesystem path when available.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesGetWorkspaceResult
+{
+ /// Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions).
+ [JsonPropertyName("path")]
+ public string? Path { get; set; }
+
+ /// Current workspace metadata, or null if not available.
+ [JsonPropertyName("workspace")]
+ public WorkspacesGetWorkspaceResultWorkspace? Workspace { get; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionWorkspacesGetWorkspaceRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Workspace metadata fields to update.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class WorkspacesUpdateMetadataRequest
+{
+ /// Opaque workspace context supplied by the session host.
+ [JsonPropertyName("context")]
+ public JsonElement? Context { get; set; }
+
+ /// Optional workspace display name override.
+ [JsonPropertyName("name")]
+ public string? Name { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Optional session context used when creating a local workspace.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class WorkspacesEnsureRequest
+{
+ /// Opaque workspace context supplied by the session host.
+ [JsonPropertyName("context")]
+ public JsonElement? Context { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Relative paths of files stored in the session workspace files directory.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesListFilesResult
+{
+ /// Relative file paths in the workspace files directory.
+ [JsonPropertyName("files")]
+ public IList Files { get => field ??= []; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionWorkspacesListFilesRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Contents of the requested workspace file as a UTF-8 string.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesReadFileResult
+{
+ /// File content as a UTF-8 string.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
+}
+
+/// Relative path of the workspace file to read.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class WorkspacesReadFileRequest
+{
+ /// Relative path within the workspace files directory.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Relative path and UTF-8 content for the workspace file to create or overwrite.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class WorkspacesCreateFileRequest
+{
+ /// File content to write as a UTF-8 string.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
+
+ /// Relative path within the workspace files directory.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesCheckpoints
+{
+ /// Filename of the checkpoint within the workspace checkpoints directory.
+ [JsonPropertyName("filename")]
+ public string Filename { get; set; } = string.Empty;
+
+ /// Checkpoint number assigned by the workspace manager.
+ [JsonPropertyName("number")]
+ public long Number { get; set; }
+
+ /// Human-readable checkpoint title.
+ [JsonPropertyName("title")]
+ public string Title { get; set; } = string.Empty;
+}
+
+/// Workspace checkpoints in chronological order; empty when the workspace is not enabled.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesListCheckpointsResult
+{
+ /// Workspace checkpoints in chronological order. Empty when workspace is not enabled.
+ [JsonPropertyName("checkpoints")]
+ public IList Checkpoints { get => field ??= []; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionWorkspacesListCheckpointsRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesReadCheckpointResult
+{
+ /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
+ [JsonPropertyName("content")]
+ public string? Content { get; set; }
+}
+
+/// Checkpoint number to read.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class WorkspacesReadCheckpointRequest
+{
+ /// Checkpoint number to read.
+ [JsonPropertyName("number")]
+ public long Number { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// RPC data type for WorkspacesAddSummaryResultSummary operations.
+public sealed class WorkspacesAddSummaryResultSummary
+{
+}
+
+/// RPC data type for WorkspacesAddSummaryResultWorkspace operations.
+public sealed class WorkspacesAddSummaryResultWorkspace
+{
+}
+
+/// Persisted summary metadata and refreshed workspace metadata.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesGetWorkspaceResult
+public sealed class WorkspacesAddSummaryResult
{
- /// Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions).
- [JsonPropertyName("path")]
- public string? Path { get; set; }
+ /// Gets or sets the summary value.
+ [JsonPropertyName("summary")]
+ public WorkspacesAddSummaryResultSummary? Summary { get; set; }
- /// Current workspace metadata, or null if not available.
+ /// Gets or sets the workspace value.
[JsonPropertyName("workspace")]
- public WorkspacesGetWorkspaceResultWorkspace? Workspace { get; set; }
+ public WorkspacesAddSummaryResultWorkspace? Workspace { get; set; }
}
-/// Identifies the target session.
+/// Compaction summary checkpoint to persist.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionWorkspacesGetWorkspaceRequest
+internal sealed class WorkspacesAddSummaryRequest
{
+ /// Markdown summary content to persist.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
-}
-/// Relative paths of files stored in the session workspace files directory.
-[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesListFilesResult
-{
- /// Relative file paths in the workspace files directory.
- [JsonPropertyName("files")]
- public IList Files { get => field ??= []; set; }
+ /// Summary title shown in checkpoint listings.
+ [JsonPropertyName("title")]
+ public string Title { get; set; } = string.Empty;
}
-/// Identifies the target session.
+/// Rollback point for local workspace summaries.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionWorkspacesListFilesRequest
+internal sealed class WorkspacesTruncateSummariesRequest
{
+ /// Number of newest summaries to keep.
+ [JsonPropertyName("keepCount")]
+ public long KeepCount { get; set; }
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Contents of the requested workspace file as a UTF-8 string.
+/// Autopilot objective file content, or null when missing.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesReadFileResult
+public sealed class WorkspacesReadAutopilotObjectiveResult
{
- /// File content as a UTF-8 string.
+ /// Autopilot objective file content, or null when missing.
[JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
+ public string? Content { get; set; }
}
-/// Relative path of the workspace file to read.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class WorkspacesReadFileRequest
+internal sealed class SessionWorkspacesReadAutopilotObjectiveRequest
{
- /// Relative path within the workspace files directory.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Relative path and UTF-8 content for the workspace file to create or overwrite.
+/// Result of writing the autopilot objective file.
[Experimental(Diagnostics.Experimental)]
-internal sealed class WorkspacesCreateFileRequest
+public sealed class WorkspacesWriteAutopilotObjectiveResult
{
- /// File content to write as a UTF-8 string.
+ /// Filesystem operation performed.
+ [JsonPropertyName("operation")]
+ public string Operation { get; set; } = string.Empty;
+}
+
+/// Autopilot objective file content to persist.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class WorkspacesWriteAutopilotObjectiveRequest
+{
+ /// Autopilot objective file content.
[JsonPropertyName("content")]
public string Content { get; set; } = string.Empty;
- /// Relative path within the workspace files directory.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename.
-[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesCheckpoints
-{
- /// Filename of the checkpoint within the workspace checkpoints directory.
- [JsonPropertyName("filename")]
- public string Filename { get; set; } = string.Empty;
-
- /// Checkpoint number assigned by the workspace manager.
- [JsonPropertyName("number")]
- public long Number { get; set; }
-
- /// Human-readable checkpoint title.
- [JsonPropertyName("title")]
- public string Title { get; set; } = string.Empty;
-}
-
-/// Workspace checkpoints in chronological order; empty when the workspace is not enabled.
+/// Result of deleting the autopilot objective file.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesListCheckpointsResult
+public sealed class WorkspacesDeleteAutopilotObjectiveResult
{
- /// Workspace checkpoints in chronological order. Empty when workspace is not enabled.
- [JsonPropertyName("checkpoints")]
- public IList Checkpoints { get => field ??= []; set; }
+ /// True when a file was deleted.
+ [JsonPropertyName("deleted")]
+ public bool Deleted { get; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionWorkspacesListCheckpointsRequest
+internal sealed class SessionWorkspacesDeleteAutopilotObjectiveRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
+/// Whether the autopilot objective file exists.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesReadCheckpointResult
+public sealed class WorkspacesAutopilotObjectiveExistsResult
{
- /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
- [JsonPropertyName("content")]
- public string? Content { get; set; }
+ /// True when the objective file exists.
+ [JsonPropertyName("exists")]
+ public bool Exists { get; set; }
}
-/// Checkpoint number to read.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class WorkspacesReadCheckpointRequest
+internal sealed class SessionWorkspacesAutopilotObjectiveExistsRequest
{
- /// Checkpoint number to read.
- [JsonPropertyName("number")]
- public long Number { get; set; }
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
@@ -5067,7 +5882,7 @@ public sealed class WorkspaceDiffFileChange
[JsonPropertyName("oldPath")]
public string? OldPath { get; set; }
- /// Path to the changed file, relative to the workspace root.
+ /// Path to the changed file, relative to the workspace root when the file lives under it. A file changed outside the workspace root keeps a `../`-relative path, or an absolute path when no relative path exists (for example a different Windows drive).
[JsonPropertyName("path")]
public string Path { get; set; } = string.Empty;
}
@@ -5084,7 +5899,7 @@ public sealed class WorkspaceDiffResult
[JsonPropertyName("changes")]
public IList Changes { get => field ??= []; set; }
- /// Whether a requested branch diff fell back to unstaged changes because branch diff failed.
+ /// Whether the requested diff fell back to unstaged changes, either because branch diff failed or session diff was unavailable.
[JsonPropertyName("isFallback")]
public bool IsFallback { get; set; }
@@ -5095,6 +5910,10 @@ public sealed class WorkspaceDiffResult
/// Diff mode requested by the client.
[JsonPropertyName("requestedMode")]
public WorkspaceDiffMode RequestedMode { get; set; }
+
+ /// Why the session diff could not be produced, when applicable. Set only when `session` mode was requested and `isFallback` is true, so a client can tell the permanent `file-change-tracking-disabled` apart from the transient `session-busy`, which the same request answers once the session settles. Never set for `unstaged` or `branch` mode, and never `unsupported-remote-session`: a remote session's captures live on its own host, so a `session`-mode diff is rejected for one rather than answered with a controller-side fallback.
+ [JsonPropertyName("unavailableReason")]
+ public HistoryRewindUnavailableReason? UnavailableReason { get; set; }
}
/// Parameters for computing a workspace diff.
@@ -6344,13 +7163,13 @@ internal sealed class McpConfigureGitHubRequest
public string SessionId { get; set; } = string.Empty;
}
-/// Server name and configuration for an individual MCP server start.
+/// Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server.
[Experimental(Diagnostics.Experimental)]
internal sealed class McpStartServerRequest
{
- /// MCP server configuration (stdio process or remote HTTP/SSE).
+ /// MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server with its already-registered configuration (config-free start-by-name).
[JsonPropertyName("config")]
- public JsonElement Config { get; set; }
+ public JsonElement? Config { get; set; }
/// Name of the MCP server to start.
[JsonPropertyName("serverName")]
@@ -6583,6 +7402,28 @@ internal sealed class McpOauthLoginRequest
public string SessionId { get; set; } = string.Empty;
}
+/// Indicates whether the pending MCP OAuth response was accepted.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpOauthRespondResult
+{
+ /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
+
+/// Pending MCP OAuth request id to respond to.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpOauthRespondRequest
+{
+ /// OAuth request identifier from the mcp.oauth_required event.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
/// Indicates whether the pending MCP headers refresh response was accepted.
[Experimental(Diagnostics.Experimental)]
public sealed class McpHeadersHandlePendingHeadersRefreshRequestResult
@@ -7746,6 +8587,50 @@ public sealed class SandboxConfig
public SandboxConfigUserPolicy? UserPolicy { get; set; }
}
+/// A host-provided script sourced before each built-in shell command when its shell target matches the active shell.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ShellInitScript
+{
+ /// Path to the script to source.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
+
+ /// Built-in shell that may source this script.
+ [JsonPropertyName("shell")]
+ public ShellInitScriptShell Shell { get; set; }
+}
+
+/// Per-session settings for built-in shell tools.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ShellOptions
+{
+ /// Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected.
+ [JsonPropertyName("initProfile")]
+ public ShellInitProfile? InitProfile { get; set; }
+
+ ///
+ /// Ordered host-provided script paths sourced before each built-in shell command when the
+ /// entry's shell target matches the active shell. Use these for rc files, environment setup scripts,
+ /// or other custom scripts. A script that returns a nonzero status is reported, and later scripts
+ /// and the user command continue while the shell remains running. Because scripts are sourced into
+ /// the command shell, `exit`, `exec`, failures under `set -e`, or other shell-terminating behavior
+ /// can prevent continuation. Script standard output is preserved; Bash script stderr is discarded,
+ /// PowerShell exception messages are replaced, and runtime-generated failure notices omit
+ /// configured script paths. When sandboxing is enabled, each script must already be readable under
+ /// the active sandbox filesystem policy. Pass an empty array to clear the list.
+ ///
+ [JsonPropertyName("initScripts")]
+ public IList? InitScripts { get; set; }
+
+ ///
+ /// Flags passed to the active built-in shell process on startup, replacing its default flags.
+ /// When omitted, the built-in Bash shell uses `--norc --noprofile`,
+ /// and the built-in PowerShell shell uses `-NoProfile -NoLogo`.
+ ///
+ [JsonPropertyName("processFlags")]
+ public IList? ProcessFlags { get; set; }
+}
+
/// Patch of mutable session options to apply to the running session.
[Experimental(Diagnostics.Experimental)]
internal sealed class SessionUpdateOptionsParams
@@ -7815,7 +8700,7 @@ internal sealed class SessionUpdateOptionsParams
[JsonPropertyName("enableHostGitOperations")]
public bool? EnableHostGitOperations { get; set; }
- /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag.
+ /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`.
[JsonPropertyName("enableOnDemandInstructionDiscovery")]
public bool? EnableOnDemandInstructionDiscovery { get; set; }
@@ -7847,6 +8732,10 @@ internal sealed class SessionUpdateOptionsParams
[JsonPropertyName("eventsLogDirectory")]
public string? EventsLogDirectory { get; set; }
+ /// Whether subagent callback events should be forwarded into the session event log sink.
+ [JsonPropertyName("eventsLogIncludesSubagents")]
+ public bool? EventsLogIncludesSubagents { get; set; }
+
/// Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available.
[JsonPropertyName("excludedBuiltinAgents")]
public IList? ExcludedBuiltinAgents { get; set; }
@@ -7935,11 +8824,19 @@ internal sealed class SessionUpdateOptionsParams
[JsonPropertyName("sessionLimits")]
public SessionLimitsConfig? SessionLimits { get; set; }
- /// Shell init profile (`None` or `NonInteractive`).
+ /// Per-session settings for built-in shell tools.
+ [JsonPropertyName("shell")]
+ public ShellOptions? Shell { get; set; }
+
+ /// Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`).
+ [EditorBrowsable(EditorBrowsableState.Never)]
+#if NET5_0_OR_GREATER
+ [Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")]
+#endif
[JsonPropertyName("shellInitProfile")]
public string? ShellInitProfile { get; set; }
- /// Per-shell process flags (e.g., `pwsh` arguments).
+ /// PowerShell process flags applied to built-in and user-requested shell commands.
[JsonPropertyName("shellProcessFlags")]
public IList? ShellProcessFlags { get; set; }
@@ -9319,6 +10216,10 @@ public sealed class UIExitPlanModeResponse
[JsonPropertyName("autoApproveEdits")]
public bool? AutoApproveEdits { get; set; }
+ /// When true, the agent is instructed to end its turn without starting implementation so the client can restore the session model and auto-submit a fresh implementation turn on it. Set only when a distinct plan configuration (a different model, reasoning effort, or context tier) actually ran the planning turn.
+ [JsonPropertyName("deferImplementation")]
+ public bool? DeferImplementation { get; set; }
+
/// Feedback from the user when they declined the plan or requested changes.
[JsonPropertyName("feedback")]
public string? Feedback { get; set; }
@@ -10276,10 +11177,14 @@ public sealed class PermissionsResetSessionApprovalsResult
public bool Success { get; set; }
}
-/// No parameters; clears all session-scoped tool permission approvals.
+/// Clears session-scoped tool permission approvals, and optionally the location-scoped ones.
[Experimental(Diagnostics.Experimental)]
internal sealed class PermissionsResetSessionApprovalsRequest
{
+ /// Whether location-scoped approvals are cleared too. Defaults to `true`.
+ [JsonPropertyName("includeLocation")]
+ public bool? IncludeLocation { get; set; }
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
@@ -11450,6 +12355,45 @@ internal sealed class SessionSettingsEvaluatePredicateRequest
public string? ToolName { get; set; }
}
+/// Content-exclusion decision for one requested path.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ContentExclusionPathCheck
+{
+ /// Whether the session's complete content-exclusion policy excludes the path.
+ [JsonPropertyName("excluded")]
+ public bool Excluded { get; set; }
+
+ /// The path supplied by the caller.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
+}
+
+/// Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ContentExclusionCheckPathsResult
+{
+ /// Whether the session's policy service was available for the complete batch. When false, checks is empty and callers must treat every requested path as excluded.
+ [JsonPropertyName("available")]
+ public bool Available { get; set; }
+
+ /// Per-path decisions in request order. Empty when available is false.
+ [JsonPropertyName("checks")]
+ public IList Checks { get => field ??= []; set; }
+}
+
+/// Local file system absolute paths within the session working directory to check against its content-exclusion policy.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ContentExclusionCheckPathsRequest
+{
+ /// Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates.
+ [JsonPropertyName("paths")]
+ public IList Paths { get => field ??= []; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
/// Identifier of the spawned process, used to correlate streamed output and exit notifications.
[Experimental(Diagnostics.Experimental)]
public sealed class ShellExecResult
@@ -11653,21 +12597,206 @@ internal sealed class HistoryCompactRequestWithSession
/// Number of events that were removed by the truncation.
[Experimental(Diagnostics.Experimental)]
-public sealed class HistoryTruncateResult
+public sealed class HistoryTruncateResult
+{
+ /// Failure detail when checkpointCleanupFailed is true.
+ [JsonPropertyName("checkpointCleanupError")]
+ public string? CheckpointCleanupError { get; set; }
+
+ /// True when conversation truncation succeeded but post-truncation workspace checkpoint cleanup failed. History is already truncated; callers may still prune snapshots but should report a checkpoint-cleanup rather than a truncation failure.
+ [JsonPropertyName("checkpointCleanupFailed")]
+ public bool? CheckpointCleanupFailed { get; set; }
+
+ /// Number of events that were removed.
+ [JsonPropertyName("eventsRemoved")]
+ public long EventsRemoved { get; set; }
+}
+
+/// Identifier of the event to truncate to; this event and all later events are removed.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class HistoryTruncateRequest
+{
+ /// Event ID to truncate to. This event and all events after it are removed from the session.
+ [JsonPropertyName("eventId")]
+ public string EventId { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// A root user turn that the session can rewind to.
+[Experimental(Diagnostics.Experimental)]
+public sealed class HistoryRewindPoint
+{
+ /// Whether at least one file in this turn or a later turn can be restored.
+ [JsonPropertyName("canRestoreFiles")]
+ public bool CanRestoreFiles { get; set; }
+
+ /// ID of the user.message event that begins the discarded suffix.
+ [JsonPropertyName("eventId")]
+ public string EventId { get; set; } = string.Empty;
+
+ /// Number of unique files in this turn and all later turns that have captured changes.
+ [JsonPropertyName("fileCount")]
+ public long FileCount { get; set; }
+
+ /// Whether this turn was an automatically injected autopilot continuation.
+ [JsonPropertyName("isAutopilotContinuation")]
+ public bool IsAutopilotContinuation { get; set; }
+
+ /// Lines added by this turn's captured file changes.
+ [JsonPropertyName("linesAdded")]
+ public long LinesAdded { get; set; }
+
+ /// Lines removed by this turn's captured file changes.
+ [JsonPropertyName("linesRemoved")]
+ public long LinesRemoved { get; set; }
+
+ /// ISO timestamp of the user turn.
+ [JsonPropertyName("timestamp")]
+ public string Timestamp { get; set; } = string.Empty;
+
+ /// Whether this turn itself captured any file changes.
+ [JsonPropertyName("turnChangedFiles")]
+ public bool TurnChangedFiles { get; set; }
+
+ /// User-visible message text for the turn.
+ [JsonPropertyName("userMessage")]
+ public string UserMessage { get; set; } = string.Empty;
+}
+
+/// Rewind points and file-change-tracking availability for the session.
+[Experimental(Diagnostics.Experimental)]
+public sealed class HistoryListRewindPointsResult
+{
+ /// Whether this session captured file changes from its first turn.
+ [JsonPropertyName("fileChangeTrackingEnabled")]
+ public bool FileChangeTrackingEnabled { get; set; }
+
+ /// Root user turns in chronological order. Empty when `unavailableReason` is set.
+ [JsonPropertyName("points")]
+ public IList Points { get => field ??= []; set; }
+
+ /// Why the listed points could not be produced, when applicable; the points list is empty whenever it is set. `unsupported-remote-session` is permanent for the session and comes with `fileChangeTrackingEnabled: false`. `session-busy` is transient and only ever reported by a session that *is* tracking (`fileChangeTrackingEnabled: true`), because the file-change captures cannot be read while work that may still mutate them is in flight; the same request succeeds once the session settles, so a client that wants points should retry rather than treat it as a failure. It is never `file-change-tracking-disabled`: an untracked local session still lists conversation-only points and reports that through `fileChangeTrackingEnabled: false`.
+ [JsonPropertyName("unavailableReason")]
+ public HistoryRewindUnavailableReason? UnavailableReason { get; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionHistoryListRewindPointsRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// A file that a conversation-and-files rewind would restore.
+[Experimental(Diagnostics.Experimental)]
+public sealed class HistoryRewindFilePreview
+{
+ /// Aggregate change made across the discarded turns.
+ [JsonPropertyName("changeType")]
+ public HistoryRewindChangeType ChangeType { get; set; }
+
+ /// Lines added across the discarded turns.
+ [JsonPropertyName("linesAdded")]
+ public long LinesAdded { get; set; }
+
+ /// Lines removed across the discarded turns.
+ [JsonPropertyName("linesRemoved")]
+ public long LinesRemoved { get; set; }
+
+ /// Absolute path of the captured file.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
+}
+
+/// Files and aggregate changes for a prospective rewind.
+[Experimental(Diagnostics.Experimental)]
+public sealed class HistoryPreviewRewindResult
+{
+ /// Whether file restore is available for this session. This is authoritative: switch on it and read `reason` only when it is false.
+ [JsonPropertyName("available")]
+ public bool Available { get; set; }
+
+ /// Number of unique files in the preview.
+ [JsonPropertyName("fileCount")]
+ public long FileCount { get; set; }
+
+ /// Files ordered by path.
+ [JsonPropertyName("files")]
+ public IList Files { get => field ??= []; set; }
+
+ /// Why file restore is unavailable, when applicable. Populated only when `available` is false and never set when `available` is true.
+ [JsonPropertyName("reason")]
+ public HistoryRewindUnavailableReason? Reason { get; set; }
+}
+
+/// Event boundary to preview for conversation-and-files rewind.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class HistoryPreviewRewindRequest
+{
+ /// ID of the user.message event that begins the discarded suffix.
+ [JsonPropertyName("eventId")]
+ public string EventId { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// A captured file that rewind intentionally left unchanged.
+[Experimental(Diagnostics.Experimental)]
+public sealed class HistorySkippedFileRestore
+{
+ /// Absolute path of the skipped file.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
+
+ /// Reason the file was not restored.
+ [JsonPropertyName("reason")]
+ public HistoryFileRestoreSkipReason Reason { get; set; }
+}
+
+/// Structured outcome of a rewind request.
+[Experimental(Diagnostics.Experimental)]
+public sealed class HistoryRewindResult
{
- /// Number of events that were removed.
+ /// Failure detail. Set only for the failure and partial-failure outcomes (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`).
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+
+ /// Number of persisted events removed by conversation truncation. Present only when truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`) and for `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`.
[JsonPropertyName("eventsRemoved")]
- public long EventsRemoved { get; set; }
+ public long? EventsRemoved { get; set; }
+
+ /// Overall rewind outcome. This discriminates the result: it governs which of the remaining fields are populated, so consumers must switch on it before reading `eventsRemoved`, `restoredFiles`, `skippedFiles`, or `error`. See each field for the outcomes that populate it.
+ [JsonPropertyName("outcome")]
+ public HistoryRewindOutcome Outcome { get; set; }
+
+ /// Absolute paths restored to their captured preimages. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it.
+ [JsonPropertyName("restoredFiles")]
+ public IList RestoredFiles { get => field ??= []; set; }
+
+ /// Captured files intentionally left unchanged. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it.
+ [JsonPropertyName("skippedFiles")]
+ public IList SkippedFiles { get => field ??= []; set; }
}
-/// Identifier of the event to truncate to; this event and all later events are removed.
+/// Boundary and mode for rewinding session history.
[Experimental(Diagnostics.Experimental)]
-internal sealed class HistoryTruncateRequest
+internal sealed class HistoryRewindRequest
{
- /// Event ID to truncate to. This event and all events after it are removed from the session.
+ /// ID of the user.message event that begins the discarded suffix.
[JsonPropertyName("eventId")]
public string EventId { get; set; } = string.Empty;
+ /// Whether to rewind only conversation history or also restore captured files.
+ [JsonPropertyName("mode")]
+ public HistoryRewindMode Mode { get; set; }
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
@@ -11762,6 +12891,119 @@ internal sealed class SessionQueuePendingItemsRequest
public string SessionId { get; set; } = string.Empty;
}
+/// Internal snapshot of native queue state for local session orchestration.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class QueueSnapshotResult
+{
+ /// Insertion orders for queued items, aligned with `items`.
+ [JsonPropertyName("itemOrders")]
+ public IList? ItemOrders { get; set; }
+
+ /// User-facing pending items in FIFO order.
+ [JsonPropertyName("items")]
+ public IList Items { get => field ??= []; set; }
+
+ /// Insertion orders for immediate steering messages, aligned with `steeringMessages`.
+ [JsonPropertyName("steeringMessageOrders")]
+ public IList? SteeringMessageOrders { get; set; }
+
+ /// Immediate steering messages waiting for an active turn.
+ [JsonPropertyName("steeringMessages")]
+ public IList SteeringMessages { get => field ??= []; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionQueueSnapshotRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Whether the native queue has pending work.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class QueueHasPendingResult
+{
+ /// True when queued or immediate native work is pending.
+ [JsonPropertyName("hasPending")]
+ public bool HasPending { get; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionQueueHasPendingRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Whether a deferred-idle drain should run.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class QueueBeginDeferredIdleDrainResult
+{
+ /// True when the host should run finishDeferredIdleDrain asynchronously.
+ [JsonPropertyName("shouldDrain")]
+ public bool ShouldDrain { get; set; }
+}
+
+/// Inputs for starting a deferred-idle drain.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class QueueBeginDeferredIdleDrainRequest
+{
+ /// Whether the host still has active background work.
+ [JsonPropertyName("activeBackgroundWork")]
+ public bool ActiveBackgroundWork { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Action selected by the native deferred-idle drain.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class QueueFinishDeferredIdleDrainResult
+{
+ /// Whether the deferred idle was caused by an aborted foreground turn.
+ [JsonPropertyName("aborted")]
+ public bool Aborted { get; set; }
+
+ /// One of none, processQueue, or emitSessionIdle.
+ [JsonPropertyName("action")]
+ public string Action { get; set; } = string.Empty;
+}
+
+/// Inputs for completing a deferred-idle drain.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class QueueFinishDeferredIdleDrainRequest
+{
+ /// Whether the host still has active background work.
+ [JsonPropertyName("activeBackgroundWork")]
+ public bool ActiveBackgroundWork { get; set; }
+
+ /// Whether native queued work remains.
+ [JsonPropertyName("hasPending")]
+ public bool HasPending { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Inputs for marking session.idle deferred in native state.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class QueueDeferSessionIdleRequest
+{
+ /// Whether the deferred idle was caused by an aborted foreground turn.
+ [JsonPropertyName("aborted")]
+ public bool Aborted { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
/// Indicates whether a user-facing pending item was removed.
[Experimental(Diagnostics.Experimental)]
public sealed class QueueRemoveMostRecentResult
@@ -11789,6 +13031,46 @@ internal sealed class SessionQueueClearRequest
public string SessionId { get; set; } = string.Empty;
}
+/// Internal filter for consuming queued system notifications.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class QueueConsumeSystemNotificationsRequest
+{
+ /// Opaque runtime-owned filter object.
+ [JsonPropertyName("filter")]
+ public JsonElement Filter { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Result of enqueueing the resume-pending wake item.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class QueueEnqueueResumePendingResult
+{
+ /// True when a wake item was newly queued.
+ [JsonPropertyName("queued")]
+ public bool Queued { get; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionQueueEnqueueResumePendingRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionQueueProcessRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
/// Batch of session events returned by a read, with cursor and continuation metadata.
[Experimental(Diagnostics.Experimental)]
public sealed class EventsReadResult
@@ -12243,6 +13525,159 @@ internal sealed class SessionScheduleListRequest
public string SessionId { get; set; } = string.Empty;
}
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionScheduleHydrateRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Whether the session currently has an active self-paced schedule.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ScheduleHasSelfPacedResult
+{
+ /// True when at least one active schedule is self-paced.
+ [JsonPropertyName("hasSelfPaced")]
+ public bool HasSelfPaced { get; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionScheduleHasSelfPacedRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Result of registering or re-arming a scheduled prompt.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ScheduleAddResult
+{
+ /// The registered or updated schedule entry.
+ [JsonPropertyName("entry")]
+ public ScheduleEntry? Entry { get; set; }
+
+ /// User-facing validation error, when registration failed.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+}
+
+/// Register a relative-interval scheduled prompt.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ScheduleAddRequest
+{
+ /// Optional display-only prompt label.
+ [JsonPropertyName("displayPrompt")]
+ public string? DisplayPrompt { get; set; }
+
+ /// Human-readable interval such as `30s`, `5m`, or `2h`.
+ [JsonPropertyName("interval")]
+ public string Interval { get; set; } = string.Empty;
+
+ /// Prompt text to enqueue when the schedule fires.
+ [JsonPropertyName("prompt")]
+ public string Prompt { get; set; } = string.Empty;
+
+ /// Whether the schedule should re-arm after each tick. Defaults to true.
+ [JsonPropertyName("recurring")]
+ public bool? Recurring { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Register a cron scheduled prompt.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ScheduleAddCronRequest
+{
+ /// 5-field cron expression.
+ [JsonPropertyName("cron")]
+ public string Cron { get; set; } = string.Empty;
+
+ /// Optional display-only prompt label.
+ [JsonPropertyName("displayPrompt")]
+ public string? DisplayPrompt { get; set; }
+
+ /// Prompt text to enqueue when the schedule fires.
+ [JsonPropertyName("prompt")]
+ public string Prompt { get; set; } = string.Empty;
+
+ /// Whether the schedule should re-arm after each tick. Defaults to true.
+ [JsonPropertyName("recurring")]
+ public bool? Recurring { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// IANA timezone for evaluating the cron expression.
+ [JsonPropertyName("tz")]
+ public string? Tz { get; set; }
+}
+
+/// Register an absolute-time scheduled prompt.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ScheduleAddAtRequest
+{
+ /// Epoch milliseconds when the prompt should fire.
+ [JsonPropertyName("at")]
+ public long At { get; set; }
+
+ /// Optional display-only prompt label.
+ [JsonPropertyName("displayPrompt")]
+ public string? DisplayPrompt { get; set; }
+
+ /// Prompt text to enqueue when the schedule fires.
+ [JsonPropertyName("prompt")]
+ public string Prompt { get; set; } = string.Empty;
+
+ /// Whether the schedule should re-arm after each tick. Defaults to false.
+ [JsonPropertyName("recurring")]
+ public bool? Recurring { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Register a self-paced scheduled prompt.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ScheduleAddSelfPacedRequest
+{
+ /// Optional display-only prompt label.
+ [JsonPropertyName("displayPrompt")]
+ public string? DisplayPrompt { get; set; }
+
+ /// Prompt text to enqueue when the schedule fires.
+ [JsonPropertyName("prompt")]
+ public string Prompt { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Re-arm a self-paced scheduled prompt.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ScheduleRearmSelfPacedRequest
+{
+ /// Epoch milliseconds when the prompt should next fire.
+ [JsonPropertyName("at")]
+ public long At { get; set; }
+
+ /// Id of the self-paced scheduled prompt.
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
/// Remove a scheduled prompt by id. The result entry is omitted if the id was unknown.
[Experimental(Diagnostics.Experimental)]
public sealed class ScheduleStopResult
@@ -12293,7 +13728,7 @@ public sealed class FactoryExecuteResult
{
/// Factory result value.
[JsonPropertyName("result")]
- public JsonElement Result { get; set; }
+ public JsonElement? Result { get; set; }
}
/// Parameters sent to the owning extension to execute a factory closure.
@@ -12304,6 +13739,10 @@ public sealed class FactoryExecuteRequest
[JsonPropertyName("args")]
public JsonElement Args { get; set; }
+ /// Opaque token identifying this factory execution attempt.
+ [JsonPropertyName("executionToken")]
+ public string ExecutionToken { get; set; } = string.Empty;
+
/// Registered factory name.
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
@@ -12615,34 +14054,90 @@ public sealed class SessionFsSqliteQueryResult
[JsonPropertyName("lastInsertRowid")]
public long? LastInsertRowid { get; set; }
- /// For SELECT: array of row objects. For others: empty array.
- [JsonPropertyName("rows")]
- public IList> Rows { get => field ??= []; set; }
+ /// For SELECT: array of row objects. For others: empty array.
+ [JsonPropertyName("rows")]
+ public IList> Rows { get => field ??= []; set; }
+
+ /// Number of rows affected (for INSERT/UPDATE/DELETE).
+ [JsonPropertyName("rowsAffected")]
+ public long RowsAffected { get; set; }
+}
+
+/// SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. The provider applies its SQLite busy timeout for every call.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionFsSqliteQueryRequest
+{
+ /// Optional named bind parameters.
+ [JsonPropertyName("params")]
+ public IDictionary? Params { get; set; }
+
+ /// SQL query to execute.
+ [JsonPropertyName("query")]
+ public string Query { get; set; } = string.Empty;
+
+ /// How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected).
+ [JsonPropertyName("queryType")]
+ public SessionFsSqliteQueryType QueryType { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Classified SQLite transaction failure. busyOrLocked guarantees rollback; postCommitAmbiguous must never be retried.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionFsSqliteTransactionError
+{
+ /// Gets or sets the errorClass value.
+ [JsonPropertyName("errorClass")]
+ public SessionFsSqliteTransactionErrorClass ErrorClass { get; set; }
+
+ /// Gets or sets the message value.
+ [JsonPropertyName("message")]
+ public string Message { get; set; } = string.Empty;
+}
- /// Number of rows affected (for INSERT/UPDATE/DELETE).
- [JsonPropertyName("rowsAffected")]
- public long RowsAffected { get; set; }
+/// Per-statement results, or a classified transaction error.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionFsSqliteTransactionResult
+{
+ /// Gets or sets the error value.
+ [JsonPropertyName("error")]
+ public SessionFsSqliteTransactionError? Error { get; set; }
+
+ /// Gets or sets the results value.
+ [JsonPropertyName("results")]
+ public IList Results { get => field ??= []; set; }
}
-/// SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database.
+/// One statement in an atomic SQLite transaction.
[Experimental(Diagnostics.Experimental)]
-public sealed class SessionFsSqliteQueryRequest
+public sealed class SessionFsSqliteTransactionStatement
{
/// Optional named bind parameters.
[JsonPropertyName("params")]
public IDictionary? Params { get; set; }
- /// SQL query to execute.
+ /// SQL statement to execute.
[JsonPropertyName("query")]
public string Query { get; set; } = string.Empty;
- /// How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected).
+ /// How to execute the statement.
[JsonPropertyName("queryType")]
public SessionFsSqliteQueryType QueryType { get; set; }
+}
+/// Statements to execute atomically. Providers apply busy handling for every call.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionFsSqliteTransactionRequest
+{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
+
+ /// Gets or sets the statements value.
+ [JsonPropertyName("statements")]
+ public IList Statements { get => field ??= []; set; }
}
/// Indicates whether the per-session SQLite database already exists.
@@ -15578,8 +17073,11 @@ public FactoryRunFailureKind(string value)
/// The run admitted the approved maximum total number of subagents.
public static FactoryRunFailureKind MaxTotalSubagents { get; } = new("maxTotalSubagents");
- /// The run reached the approved timeout deadline.
- public static FactoryRunFailureKind Timeout { get; } = new("timeout");
+ /// The run reached the approved accumulated active-execution time in seconds.
+ public static FactoryRunFailureKind TimeoutSeconds { get; } = new("timeoutSeconds");
+
+ /// The run's settled subagent model usage exceeded the approved AI-credit ceiling, or no headroom remained for another subagent.
+ public static FactoryRunFailureKind MaxAiCredits { get; } = new("maxAiCredits");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FactoryRunFailureKind left, FactoryRunFailureKind right) => left.Equals(right);
@@ -15618,6 +17116,93 @@ public override void Write(Utf8JsonWriter writer, FactoryRunFailureKind value, J
}
+/// Execution-critical factory storage operation.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct FactoryDurableOperation : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public FactoryDurableOperation(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// Creating the durable run and declared phases.
+ public static FactoryDurableOperation CreateRun { get; } = new("createRun");
+
+ /// Persisting the transition to running.
+ public static FactoryDurableOperation MarkRunStarted { get; } = new("markRunStarted");
+
+ /// Persisting the terminal run envelope.
+ public static FactoryDurableOperation FinishRun { get; } = new("finishRun");
+
+ /// Persisting subagent admission accounting.
+ public static FactoryDurableOperation ReserveAgent { get; } = new("reserveAgent");
+
+ /// Rolling back an uncommitted subagent admission.
+ public static FactoryDurableOperation ReleaseAgent { get; } = new("releaseAgent");
+
+ /// Persisting an idempotent model-usage charge.
+ public static FactoryDurableOperation ChargeCredit { get; } = new("chargeCredit");
+
+ /// Persisting active execution time.
+ public static FactoryDurableOperation AddElapsed { get; } = new("addElapsed");
+
+ /// Reading the authoritative AI-credit total.
+ public static FactoryDurableOperation ReconcileCreditTotal { get; } = new("reconcileCreditTotal");
+
+ /// Reading a journal entry without treating storage failure as a cache miss.
+ public static FactoryDurableOperation JournalGet { get; } = new("journalGet");
+
+ /// Persisting a journal entry before reporting success.
+ public static FactoryDurableOperation JournalPut { get; } = new("journalPut");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(FactoryDurableOperation left, FactoryDurableOperation right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(FactoryDurableOperation left, FactoryDurableOperation right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is FactoryDurableOperation other && Equals(other);
+
+ ///
+ public bool Equals(FactoryDurableOperation 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 FactoryDurableOperation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, FactoryDurableOperation value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FactoryDurableOperation));
+ }
+ }
+}
+
+
/// Current or terminal state of a factory run.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
@@ -15693,6 +17278,75 @@ public override void Write(Utf8JsonWriter writer, FactoryRunStatus value, JsonSe
}
+/// Derived lifecycle state of a factory phase.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct FactoryPhaseStatus : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public FactoryPhaseStatus(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// The phase has not been entered yet.
+ public static FactoryPhaseStatus Pending { get; } = new("pending");
+
+ /// The phase is currently entered and accumulating active time.
+ public static FactoryPhaseStatus Active { get; } = new("active");
+
+ /// The phase was entered and has since been closed.
+ public static FactoryPhaseStatus Completed { get; } = new("completed");
+
+ /// The phase was never entered because a later phase was entered or the run reached a terminal state.
+ public static FactoryPhaseStatus Skipped { get; } = new("skipped");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(FactoryPhaseStatus left, FactoryPhaseStatus right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(FactoryPhaseStatus left, FactoryPhaseStatus right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is FactoryPhaseStatus other && Equals(other);
+
+ ///
+ public bool Equals(FactoryPhaseStatus 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 FactoryPhaseStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, FactoryPhaseStatus value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FactoryPhaseStatus));
+ }
+ }
+}
+
+
/// Kind of factory progress line.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
@@ -15954,6 +17608,72 @@ public override void Write(Utf8JsonWriter writer, WorkspaceDiffMode value, JsonS
}
+/// Reason a rewind read (rewind points, file-restore preview, or session diff) could not be answered from the session's file-change captures.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct HistoryRewindUnavailableReason : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public HistoryRewindUnavailableReason(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// The session did not opt into file-change tracking before its first turn.
+ public static HistoryRewindUnavailableReason FileChangeTrackingDisabled { get; } = new("file-change-tracking-disabled");
+
+ /// The session still has work that may mutate files or history. Transient: the same request succeeds once the session settles, so callers should retry rather than treat it as a failure.
+ public static HistoryRewindUnavailableReason SessionBusy { get; } = new("session-busy");
+
+ /// Remote-backed rewind routing is not supported.
+ public static HistoryRewindUnavailableReason UnsupportedRemoteSession { get; } = new("unsupported-remote-session");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(HistoryRewindUnavailableReason left, HistoryRewindUnavailableReason right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(HistoryRewindUnavailableReason left, HistoryRewindUnavailableReason right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is HistoryRewindUnavailableReason other && Equals(other);
+
+ ///
+ public bool Equals(HistoryRewindUnavailableReason 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 HistoryRewindUnavailableReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, HistoryRewindUnavailableReason value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HistoryRewindUnavailableReason));
+ }
+ }
+}
+
+
/// Whether task execution is synchronously awaited or managed in the background.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
@@ -17615,23 +19335,149 @@ public SessionCapability(string value)
/// Cross-session history tools and session-store SQL prompt/tool metadata.
public static SessionCapability SessionStore { get; } = new("session-store");
- /// MCP Apps UI passthrough.
- public static SessionCapability McpApps { get; } = new("mcp-apps");
+ /// MCP Apps UI passthrough.
+ public static SessionCapability McpApps { get; } = new("mcp-apps");
+
+ /// Host-provided canvas rendering support.
+ public static SessionCapability CanvasRenderer { get; } = new("canvas-renderer");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(SessionCapability left, SessionCapability right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(SessionCapability left, SessionCapability right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is SessionCapability other && Equals(other);
+
+ ///
+ public bool Equals(SessionCapability 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 SessionCapability Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, SessionCapability value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionCapability));
+ }
+ }
+}
+
+
+/// Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct ShellInitProfile : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public ShellInitProfile(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// Disable automatic non-interactive profile loading. Explicit initScripts still run.
+ public static ShellInitProfile None { get; } = new("none");
+
+ /// Allow automatic non-interactive profile loading when supported. Explicit initScripts still run.
+ public static ShellInitProfile NonInteractive { get; } = new("non-interactive");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(ShellInitProfile left, ShellInitProfile right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(ShellInitProfile left, ShellInitProfile right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is ShellInitProfile other && Equals(other);
+
+ ///
+ public bool Equals(ShellInitProfile 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 ShellInitProfile Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, ShellInitProfile value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ShellInitProfile));
+ }
+ }
+}
+
+
+/// Supported built-in shells for initialization scripts.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct ShellInitScriptShell : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public ShellInitScriptShell(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
- /// Host-provided canvas rendering support.
- public static SessionCapability CanvasRenderer { get; } = new("canvas-renderer");
+ /// Source the script in the built-in Bash shell on macOS and Linux.
+ public static ShellInitScriptShell Bash { get; } = new("bash");
- /// Returns a value indicating whether two instances are equivalent.
- public static bool operator ==(SessionCapability left, SessionCapability right) => left.Equals(right);
+ /// Source the script in the built-in PowerShell shell on Windows.
+ public static ShellInitScriptShell Powershell { get; } = new("powershell");
- /// Returns a value indicating whether two instances are not equivalent.
- public static bool operator !=(SessionCapability left, SessionCapability right) => !(left == right);
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(ShellInitScriptShell left, ShellInitScriptShell right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(ShellInitScriptShell left, ShellInitScriptShell right) => !(left == right);
///
- public override bool Equals(object? obj) => obj is SessionCapability other && Equals(other);
+ public override bool Equals(object? obj) => obj is ShellInitScriptShell other && Equals(other);
///
- public bool Equals(SessionCapability other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase);
+ public bool Equals(ShellInitScriptShell other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase);
///
public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value);
@@ -17639,20 +19485,20 @@ public SessionCapability(string value)
///
public override string ToString() => Value;
- /// Provides a for serializing instances.
+ /// Provides a for serializing instances.
[EditorBrowsable(EditorBrowsableState.Never)]
- public sealed class Converter : JsonConverter
+ public sealed class Converter : JsonConverter
{
///
- public override SessionCapability Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ public override ShellInitScriptShell Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
- public override void Write(Utf8JsonWriter writer, SessionCapability value, JsonSerializerOptions options)
+ public override void Write(Utf8JsonWriter writer, ShellInitScriptShell value, JsonSerializerOptions options)
{
- GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionCapability));
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ShellInitScriptShell));
}
}
}
@@ -19089,6 +20935,282 @@ public override void Write(Utf8JsonWriter writer, ShellKillSignal value, JsonSer
}
+/// Aggregate file change represented by a rewind preview.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct HistoryRewindChangeType : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public HistoryRewindChangeType(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// The discarded turns created the file.
+ public static HistoryRewindChangeType Created { get; } = new("created");
+
+ /// The discarded turns deleted the file.
+ public static HistoryRewindChangeType Deleted { get; } = new("deleted");
+
+ /// The discarded turns modified the file.
+ public static HistoryRewindChangeType Modified { get; } = new("modified");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(HistoryRewindChangeType left, HistoryRewindChangeType right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(HistoryRewindChangeType left, HistoryRewindChangeType right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is HistoryRewindChangeType other && Equals(other);
+
+ ///
+ public bool Equals(HistoryRewindChangeType 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 HistoryRewindChangeType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, HistoryRewindChangeType value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HistoryRewindChangeType));
+ }
+ }
+}
+
+
+/// Outcome of a rewind request.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct HistoryRewindOutcome : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public HistoryRewindOutcome(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// The requested rewind completed; reachable in either mode.
+ public static HistoryRewindOutcome Success { get; } = new("success");
+
+ /// The session still has work that may mutate files or history; reachable in either mode.
+ public static HistoryRewindOutcome SessionBusy { get; } = new("session-busy");
+
+ /// A conversation-and-files rewind was requested for a session that did not enable capture; conversation-only rewinds never produce this.
+ public static HistoryRewindOutcome FileChangeTrackingDisabled { get; } = new("file-change-tracking-disabled");
+
+ /// Remote-backed rewind routing is not supported; reachable in either mode.
+ public static HistoryRewindOutcome UnsupportedRemoteSession { get; } = new("unsupported-remote-session");
+
+ /// File restore failed and all applied file changes were rolled back; only conversation-and-files rewinds produce this.
+ public static HistoryRewindOutcome FilesRolledBack { get; } = new("files-rolled-back");
+
+ /// File restore failed and its rollback could not fully restore the pre-rewind state; only conversation-and-files rewinds produce this.
+ public static HistoryRewindOutcome RollbackIncomplete { get; } = new("rollback-incomplete");
+
+ /// Conversation truncation failed. In conversation-and-files mode any files that were restored are left in place because conversation history cannot be un-truncated; in conversation-only mode no files are restored. Consult restoredFiles for what, if anything, was applied.
+ public static HistoryRewindOutcome TruncationFailed { get; } = new("truncation-failed");
+
+ /// The conversation was rewound (and, in conversation-and-files mode, captured files were restored), but persisted checkpoints could not be cleaned up; reachable in either mode.
+ public static HistoryRewindOutcome CheckpointCleanupFailed { get; } = new("checkpoint-cleanup-failed");
+
+ /// Files and conversation were rewound, but obsolete file snapshots could not be removed; only conversation-and-files rewinds produce this.
+ public static HistoryRewindOutcome SnapshotPruneFailed { get; } = new("snapshot-prune-failed");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(HistoryRewindOutcome left, HistoryRewindOutcome right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(HistoryRewindOutcome left, HistoryRewindOutcome right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is HistoryRewindOutcome other && Equals(other);
+
+ ///
+ public bool Equals(HistoryRewindOutcome 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 HistoryRewindOutcome Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, HistoryRewindOutcome value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HistoryRewindOutcome));
+ }
+ }
+}
+
+
+/// Reason a captured file was not restored.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct HistoryFileRestoreSkipReason : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public HistoryFileRestoreSkipReason(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// The file changed after Copilot's last captured write.
+ public static HistoryFileRestoreSkipReason UserModified { get; } = new("user-modified");
+
+ /// A faithful preimage was not captured.
+ public static HistoryFileRestoreSkipReason SkippedCapture { get; } = new("skipped-capture");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(HistoryFileRestoreSkipReason left, HistoryFileRestoreSkipReason right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(HistoryFileRestoreSkipReason left, HistoryFileRestoreSkipReason right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is HistoryFileRestoreSkipReason other && Equals(other);
+
+ ///
+ public bool Equals(HistoryFileRestoreSkipReason 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 HistoryFileRestoreSkipReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, HistoryFileRestoreSkipReason value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HistoryFileRestoreSkipReason));
+ }
+ }
+}
+
+
+/// Scope of a rewind operation.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct HistoryRewindMode : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public HistoryRewindMode(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// Discard conversation events while leaving files unchanged.
+ public static HistoryRewindMode Conversation { get; } = new("conversation");
+
+ /// Discard conversation events and restore captured files changed by those turns.
+ public static HistoryRewindMode ConversationAndFiles { get; } = new("conversation-and-files");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(HistoryRewindMode left, HistoryRewindMode right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(HistoryRewindMode left, HistoryRewindMode right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is HistoryRewindMode other && Equals(other);
+
+ ///
+ public bool Equals(HistoryRewindMode 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 HistoryRewindMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, HistoryRewindMode value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HistoryRewindMode));
+ }
+ }
+}
+
+
/// Whether this item is a queued user message or a queued slash command / model change.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
@@ -19599,6 +21721,72 @@ public override void Write(Utf8JsonWriter writer, SessionFsSqliteQueryType value
}
+/// SQLite transaction failure classification.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct SessionFsSqliteTransactionErrorClass : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public SessionFsSqliteTransactionErrorClass(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// SQLite reported BUSY or LOCKED before commit; the transaction was rolled back and may be retried.
+ public static SessionFsSqliteTransactionErrorClass BusyOrLocked { get; } = new("busyOrLocked");
+
+ /// The statement, database, or provider failed definitively and must not be retried automatically.
+ public static SessionFsSqliteTransactionErrorClass Fatal { get; } = new("fatal");
+
+ /// The transport failed after the provider may have committed; retrying could duplicate effects.
+ public static SessionFsSqliteTransactionErrorClass PostCommitAmbiguous { get; } = new("postCommitAmbiguous");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(SessionFsSqliteTransactionErrorClass left, SessionFsSqliteTransactionErrorClass right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(SessionFsSqliteTransactionErrorClass left, SessionFsSqliteTransactionErrorClass right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is SessionFsSqliteTransactionErrorClass other && Equals(other);
+
+ ///
+ public bool Equals(SessionFsSqliteTransactionErrorClass 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 SessionFsSqliteTransactionErrorClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, SessionFsSqliteTransactionErrorClass value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsSqliteTransactionErrorClass));
+ }
+ }
+}
+
+
/// Transport the runtime would otherwise use for this request. `http` (the default when absent) covers plain HTTP and SSE responses; `websocket` indicates a full-duplex message channel where each body chunk maps to one WebSocket message and the `binary` flag distinguishes text from binary frames. The SDK consumer uses this to decide whether to service the request with an HTTP client or a WebSocket client. It is the one piece of request metadata the consumer cannot reliably infer from the URL or headers alone.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
@@ -19685,7 +21873,7 @@ public async Task PingAsync(string? message = null, CancellationToke
/// Performs the SDK server connection handshake and validates the optional connection token. Marked internal because this is JSON-RPC transport plumbing invoked automatically by an SDK client's own `connect()` wrapper, not a user-facing method. Stays internal as long as the SDK client owns the handshake; would only become public if the SDK ever exposed the raw schema surface to consumers without a connection wrapper.
/// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN.
- /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification, in addition to the runtime's normal GitHub/CTS emission (dual-write). Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled.
+ /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events.
/// The to monitor for cancellation requests. The default is .
/// Handshake result reporting the server's protocol version and package version on success.
[Experimental(Diagnostics.Experimental)]
@@ -19812,6 +22000,14 @@ public async Task ListAsync(string? gitHubToken = null, CancellationT
var request = new ModelsListRequest { GitHubToken = gitHubToken };
return await CopilotClient.InvokeRpcAsync(_rpc, "models.list", [request], cancellationToken);
}
+
+ /// Returns the running runtime's complete catalog of well-known built-in model IDs without authentication or network access.
+ /// The to monitor for cancellation requests. The default is .
+ /// The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata.
+ public async Task GetBuiltInCatalogAsync(CancellationToken cancellationToken = default)
+ {
+ return await CopilotClient.InvokeRpcAsync(_rpc, "models.getBuiltInCatalog", [], cancellationToken);
+ }
}
/// Provides server-scoped Tools APIs.
@@ -20569,6 +22765,28 @@ public async Task ListAsync(SessionSource? source = null, long? met
return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.list", [request], cancellationToken);
}
+ /// Reads lightweight persisted metadata for one local session without opening it.
+ /// Session ID to inspect.
+ /// The to monitor for cancellation requests. The default is .
+ /// Persisted local session metadata when the session exists.
+ internal async Task GetMetadataAsync(string sessionId, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(sessionId);
+
+ var request = new SessionsGetMetadataRequest { SessionId = sessionId };
+ return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.getMetadata", [request], cancellationToken);
+ }
+
+ /// Lists recent local session IDs that contain user-visible history, omitting housekeeping-only sessions.
+ /// Maximum number of session IDs to return.
+ /// The to monitor for cancellation requests. The default is .
+ /// Recent local session IDs that contain user-visible history.
+ internal async Task ListNonEmptySessionIdsAsync(long? limit = null, CancellationToken cancellationToken = default)
+ {
+ var request = new SessionsListNonEmptySessionIdsRequest { Limit = limit };
+ return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.listNonEmptySessionIds", [request], cancellationToken);
+ }
+
/// Finds the local session bound to a GitHub task ID, if any.
/// GitHub task ID to look up.
/// The to monitor for cancellation requests. The default is .
@@ -20671,6 +22889,18 @@ public async Task BulkDeleteAsync(IList session
return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.bulkDelete", [request], cancellationToken);
}
+ /// Deletes one local session from disk after running the same lifecycle hooks as the session manager.
+ /// Session ID to delete.
+ /// Internal resolved session directory path to delete.
+ /// The to monitor for cancellation requests. The default is .
+ internal async Task DeleteAsync(string sessionId, string? sessionPath = null, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(sessionId);
+
+ var request = new SessionsDeleteRequest { SessionId = sessionId, SessionPath = sessionPath };
+ await CopilotClient.InvokeRpcAsync(_rpc, "sessions.delete", [request], cancellationToken);
+ }
+
/// Deletes sessions older than the given threshold, with optional dry-run and exclusion list.
/// Delete sessions whose modifiedTime is at least this many days old.
/// When true, only report what would be deleted without performing any deletion.
@@ -21062,6 +23292,12 @@ internal SessionRpc(CopilotSession session)
Interlocked.CompareExchange(ref field, new(_session), null) ??
field;
+ /// ContentExclusion APIs.
+ public ContentExclusionApi ContentExclusion =>
+ field ??
+ Interlocked.CompareExchange(ref field, new(_session), null) ??
+ field;
+
/// Shell APIs.
public ShellApi Shell =>
field ??
@@ -21129,7 +23365,7 @@ public async Task SuspendAsync(CancellationToken cancellationToken = default)
/// If true, adds the message to the front of the queue instead of the end.
/// If false, this message will not trigger a Premium Request Unit charge. User messages default to billable.
/// 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.
- /// Optional provenance tag copied to the resulting user.message event. Must match one of three forms: the literal `system`, `command-<command-id>` for messages originating from a command (e.g. slash command, Mission Control command), or `schedule-<numeric-id>` for messages originating from a scheduled job.
+ /// 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.
/// W3C Trace Context traceparent header for distributed tracing of this agent turn.
@@ -21168,6 +23404,21 @@ public async Task SendMessagesAsync(IList m
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.sendMessages", [request], cancellationToken);
}
+ /// Queues or sends an internal system notification to the session according to its passive policy.
+ /// Notification text to deliver to the model.
+ /// Optional structured notification kind.
+ /// Internal delivery options, including passive policy.
+ /// The to monitor for cancellation requests. The default is .
+ [Experimental(Diagnostics.Experimental)]
+ internal async Task SendSystemNotificationAsync(string message, object? kind = null, object? options = null, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(message);
+ _session.ThrowIfDisposed();
+
+ var request = new SendSystemNotificationRequest { SessionId = _session.SessionId, Message = message, Kind = CopilotClient.ToJsonElementForWire(kind), Options = CopilotClient.ToJsonElementForWire(options) };
+ await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.sendSystemNotification", [request], cancellationToken);
+ }
+
/// Aborts the current agent turn.
/// Finite reason code describing why the current turn was aborted.
/// The to monitor for cancellation requests. The default is .
@@ -21181,6 +23432,31 @@ public async Task AbortAsync(AbortReason? reason = null, Cancellati
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.abort", [request], cancellationToken);
}
+ /// Interrupts the current main agent turn while leaving running background work (subagents, sidekicks, and promoted attached shells) alive. No-op when the main loop is not processing.
+ /// When true, the user's queued prompts are preserved and run as the next turn once the interrupted turn unwinds; when false (the default), the queue is cleared like a plain abort.
+ /// The to monitor for cancellation requests. The default is .
+ /// Result of interrupting the main agent turn.
+ [Experimental(Diagnostics.Experimental)]
+ public async Task InterruptMainTurnAsync(bool? flushQueued = null, CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new InterruptMainTurnRequest { SessionId = _session.SessionId, FlushQueued = flushQueued };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.interruptMainTurn", [request], cancellationToken);
+ }
+
+ /// Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running.
+ /// The to monitor for cancellation requests. The default is .
+ /// The number of running background agents (task-registry agents) that were cancelled.
+ [Experimental(Diagnostics.Experimental)]
+ public async Task CancelAllBackgroundAgentsAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionCancelAllBackgroundAgentsRequest { SessionId = _session.SessionId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.cancelAllBackgroundAgents", [request], cancellationToken);
+ }
+
/// Shuts down the session and persists its final state. Awaits any deferred sessionEnd hooks before resolving so user-supplied hook scripts complete before the runtime tears down.
/// Why the session is being shut down. Defaults to "routine" when omitted.
/// Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'.
@@ -21400,6 +23676,20 @@ public async Task RunAsync(string name, object args, RunOption
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.run", [request], cancellationToken);
}
+ /// Resumes a factory run using its persisted name, arguments, journal, and accounting.
+ /// Factory run identifier.
+ /// Optional per-invocation resource ceiling overrides.
+ /// The to monitor for cancellation requests. The default is .
+ /// Resolved persisted factory identity and resumed run envelope.
+ public async Task ResumeAsync(string runId, FactoryRunLimits? limits = null, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(runId);
+ _session.ThrowIfDisposed();
+
+ var request = new FactoryResumeRequest { SessionId = _session.SessionId, RunId = runId, Limits = limits };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.resume", [request], cancellationToken);
+ }
+
/// Gets the current or settled envelope for a factory run.
/// Factory run identifier.
/// The to monitor for cancellation requests. The default is .
@@ -21413,6 +23703,47 @@ public async Task GetRunAsync(string runId, CancellationToken
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.getRun", [request], cancellationToken);
}
+ /// Lists durable factory runs for this session in creation order.
+ /// The to monitor for cancellation requests. The default is .
+ /// Factory runs in durable creation order.
+ public async Task ListRunsAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new FactoryListRunsRequest { SessionId = _session.SessionId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.listRuns", [request], cancellationToken);
+ }
+
+ /// Gets durable and live observability detail for one factory run.
+ /// Factory run identifier.
+ /// The to monitor for cancellation requests. The default is .
+ /// Full factory run observability detail.
+ public async Task GetRunDetailAsync(string runId, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(runId);
+ _session.ThrowIfDisposed();
+
+ var request = new FactoryGetRunRequest { SessionId = _session.SessionId, RunId = runId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.getRunDetail", [request], cancellationToken);
+ }
+
+ /// Pages durable progress for one factory run.
+ /// Factory run identifier.
+ /// Optional phase identifier used to scope records and cursors.
+ /// Exclusive forward cursor.
+ /// Exclusive backward cursor.
+ /// Maximum records to return. Defaults to 200 and is capped at 500.
+ /// The to monitor for cancellation requests. The default is .
+ /// A bidirectional page of factory progress.
+ public async Task GetRunProgressAsync(string runId, string? phaseId = null, long? afterSeq = null, long? beforeSeq = null, int? limit = null, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(runId);
+ _session.ThrowIfDisposed();
+
+ var request = new FactoryGetRunProgressRequest { SessionId = _session.SessionId, RunId = runId, PhaseId = phaseId, AfterSeq = afterSeq, BeforeSeq = beforeSeq, Limit = limit };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.getRunProgress", [request], cancellationToken);
+ }
+
/// Requests cancellation of a factory run and returns its run envelope.
/// Factory run identifier.
/// The to monitor for cancellation requests. The default is .
@@ -21428,33 +23759,37 @@ public async Task CancelAsync(string runId, CancellationToken
/// Records a batch of ordered factory progress lines.
/// Factory run identifier.
+ /// Opaque token identifying the current factory execution attempt.
/// Ordered progress lines to append.
/// The to monitor for cancellation requests. The default is .
/// Acknowledgement that a factory request was accepted.
- public async Task LogAsync(string runId, IList lines, CancellationToken cancellationToken = default)
+ public async Task LogAsync(string runId, string executionToken, IList lines, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(runId);
+ ArgumentNullException.ThrowIfNull(executionToken);
ArgumentNullException.ThrowIfNull(lines);
_session.ThrowIfDisposed();
- var request = new FactoryLogRequest { SessionId = _session.SessionId, RunId = runId, Lines = lines };
+ var request = new FactoryLogRequest { SessionId = _session.SessionId, RunId = runId, ExecutionToken = executionToken, Lines = lines };
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.log", [request], cancellationToken);
}
/// Runs one factory-scoped subagent and returns its result.
/// Factory run identifier that owns the subagent.
+ /// Opaque token identifying the current factory execution attempt.
/// Prompt to send to the subagent.
/// Subagent execution options.
/// The to monitor for cancellation requests. The default is .
/// Result of one factory-scoped subagent call.
- public async Task AgentAsync(string factoryRunId, string prompt, FactoryAgentOptions opts, CancellationToken cancellationToken = default)
+ public async Task AgentAsync(string factoryRunId, string executionToken, string prompt, FactoryAgentOptions opts, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(factoryRunId);
+ ArgumentNullException.ThrowIfNull(executionToken);
ArgumentNullException.ThrowIfNull(prompt);
ArgumentNullException.ThrowIfNull(opts);
_session.ThrowIfDisposed();
- var request = new FactoryAgentRequest { SessionId = _session.SessionId, FactoryRunId = factoryRunId, Prompt = prompt, Opts = opts };
+ var request = new FactoryAgentRequest { SessionId = _session.SessionId, FactoryRunId = factoryRunId, ExecutionToken = executionToken, Prompt = prompt, Opts = opts };
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.agent", [request], cancellationToken);
}
@@ -21478,33 +23813,37 @@ internal FactoryJournalApi(CopilotSession session)
/// Reads a memoized factory journal entry.
/// Factory run identifier.
+ /// Opaque token identifying the current factory execution attempt.
/// Namespaced journal key.
/// The to monitor for cancellation requests. The default is .
/// Result of reading a factory journal entry.
- public async Task GetAsync(string runId, string key, CancellationToken cancellationToken = default)
+ public async Task GetAsync(string runId, string executionToken, string key, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(runId);
+ ArgumentNullException.ThrowIfNull(executionToken);
ArgumentNullException.ThrowIfNull(key);
_session.ThrowIfDisposed();
- var request = new FactoryJournalGetRequest { SessionId = _session.SessionId, RunId = runId, Key = key };
+ var request = new FactoryJournalGetRequest { SessionId = _session.SessionId, RunId = runId, ExecutionToken = executionToken, Key = key };
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.journal.get", [request], cancellationToken);
}
/// Stores a memoized factory journal entry.
/// Factory run identifier.
+ /// Opaque token identifying the current factory execution attempt.
/// Namespaced journal key.
/// JSON result to memoize.
/// The to monitor for cancellation requests. The default is .
/// Acknowledgement that a factory request was accepted.
- public async Task PutAsync(string runId, string key, object resultJson, CancellationToken cancellationToken = default)
+ public async Task PutAsync(string runId, string executionToken, string key, object resultJson, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(runId);
+ ArgumentNullException.ThrowIfNull(executionToken);
ArgumentNullException.ThrowIfNull(key);
ArgumentNullException.ThrowIfNull(resultJson);
_session.ThrowIfDisposed();
- var request = new FactoryJournalPutRequest { SessionId = _session.SessionId, RunId = runId, Key = key, ResultJson = CopilotClient.ToJsonElementForWire(resultJson)!.Value };
+ var request = new FactoryJournalPutRequest { SessionId = _session.SessionId, RunId = runId, ExecutionToken = executionToken, Key = key, ResultJson = CopilotClient.ToJsonElementForWire(resultJson)!.Value };
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.journal.put", [request], cancellationToken);
}
}
@@ -21746,6 +24085,31 @@ public async Task GetWorkspaceAsync(CancellationTo
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.getWorkspace", [request], cancellationToken);
}
+ /// Updates workspace metadata for a local session and returns the refreshed workspace.
+ /// Opaque workspace context supplied by the session host.
+ /// Optional workspace display name override.
+ /// The to monitor for cancellation requests. The default is .
+ /// Current workspace metadata for the session, including its absolute filesystem path when available.
+ public async Task UpdateMetadataAsync(object? context = null, string? name = null, CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new WorkspacesUpdateMetadataRequest { SessionId = _session.SessionId, Context = CopilotClient.ToJsonElementForWire(context), Name = name };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.updateMetadata", [request], cancellationToken);
+ }
+
+ /// Ensures a local session workspace exists and returns it.
+ /// Opaque workspace context supplied by the session host.
+ /// The to monitor for cancellation requests. The default is .
+ /// Current workspace metadata for the session, including its absolute filesystem path when available.
+ public async Task EnsureAsync(object? context = null, CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new WorkspacesEnsureRequest { SessionId = _session.SessionId, Context = CopilotClient.ToJsonElementForWire(context) };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.ensure", [request], cancellationToken);
+ }
+
/// Lists files stored in the session workspace files directory.
/// The to monitor for cancellation requests. The default is .
/// Relative paths of files stored in the session workspace files directory.
@@ -21807,6 +24171,79 @@ public async Task ReadCheckpointAsync(long numbe
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.readCheckpoint", [request], cancellationToken);
}
+ /// Adds a compaction summary checkpoint to the local session workspace.
+ /// Summary title shown in checkpoint listings.
+ /// Markdown summary content to persist.
+ /// The to monitor for cancellation requests. The default is .
+ /// Persisted summary metadata and refreshed workspace metadata.
+ public async Task AddSummaryAsync(string title, string content, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(title);
+ ArgumentNullException.ThrowIfNull(content);
+ _session.ThrowIfDisposed();
+
+ var request = new WorkspacesAddSummaryRequest { SessionId = _session.SessionId, Title = title, Content = content };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.addSummary", [request], cancellationToken);
+ }
+
+ /// Truncates local workspace compaction summaries after a rollback.
+ /// Number of newest summaries to keep.
+ /// The to monitor for cancellation requests. The default is .
+ /// Current workspace metadata for the session, including its absolute filesystem path when available.
+ public async Task TruncateSummariesAsync(long keepCount, CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new WorkspacesTruncateSummariesRequest { SessionId = _session.SessionId, KeepCount = keepCount };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.truncateSummaries", [request], cancellationToken);
+ }
+
+ /// Reads the autopilot objective state file from the local session workspace.
+ /// The to monitor for cancellation requests. The default is .
+ /// Autopilot objective file content, or null when missing.
+ public async Task ReadAutopilotObjectiveAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionWorkspacesReadAutopilotObjectiveRequest { SessionId = _session.SessionId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.readAutopilotObjective", [request], cancellationToken);
+ }
+
+ /// Writes the autopilot objective state file in the local session workspace.
+ /// Autopilot objective file content.
+ /// The to monitor for cancellation requests. The default is .
+ /// Result of writing the autopilot objective file.
+ public async Task WriteAutopilotObjectiveAsync(string content, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(content);
+ _session.ThrowIfDisposed();
+
+ var request = new WorkspacesWriteAutopilotObjectiveRequest { SessionId = _session.SessionId, Content = content };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.writeAutopilotObjective", [request], cancellationToken);
+ }
+
+ /// Deletes the autopilot objective state file from the local session workspace.
+ /// The to monitor for cancellation requests. The default is .
+ /// Result of deleting the autopilot objective file.
+ public async Task DeleteAutopilotObjectiveAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionWorkspacesDeleteAutopilotObjectiveRequest { SessionId = _session.SessionId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.deleteAutopilotObjective", [request], cancellationToken);
+ }
+
+ /// Checks whether the local session workspace has an autopilot objective state file.
+ /// The to monitor for cancellation requests. The default is .
+ /// Whether the autopilot objective file exists.
+ public async Task AutopilotObjectiveExistsAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionWorkspacesAutopilotObjectiveExistsRequest { SessionId = _session.SessionId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.autopilotObjectiveExists", [request], cancellationToken);
+ }
+
/// Saves pasted content as a UTF-8 file in the session workspace.
/// Pasted content to save as a UTF-8 file.
/// The to monitor for cancellation requests. The default is .
@@ -21820,7 +24257,7 @@ public async Task SaveLargePasteAsync(string con
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.saveLargePaste", [request], cancellationToken);
}
- /// Computes a diff for the session workspace.
+ /// Computes a diff for the session workspace. Never rejects for a busy session: a `session`-mode diff that cannot read the session's file-change captures falls back to an unstaged git diff with `isFallback: true` and reports why in `unavailableReason`.
/// Diff mode requested by the client.
/// When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false.
/// The to monitor for cancellation requests. The default is .
@@ -22369,17 +24806,16 @@ internal async Task ConfigureGitHubAsync(object authIn
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.configureGitHub", [request], cancellationToken);
}
- /// Starts an individual MCP server on the live session from a caller-supplied config. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server.
+ /// Starts an individual MCP server on the live session. Omit `config` for a config-free start-by-name of an already-configured server (reuses the server's already-registered configuration); supply `config` to start from a caller-supplied configuration. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server.
/// Name of the MCP server to start.
- /// MCP server configuration (stdio process or remote HTTP/SSE).
+ /// MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server with its already-registered configuration (config-free start-by-name).
/// The to monitor for cancellation requests. The default is .
- public async Task StartServerAsync(string serverName, object config, CancellationToken cancellationToken = default)
+ public async Task StartServerAsync(string serverName, object? config = null, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(serverName);
- ArgumentNullException.ThrowIfNull(config);
_session.ThrowIfDisposed();
- var request = new McpStartServerRequest { SessionId = _session.SessionId, ServerName = serverName, Config = CopilotClient.ToJsonElementForWire(config)!.Value };
+ var request = new McpStartServerRequest { SessionId = _session.SessionId, ServerName = serverName, Config = CopilotClient.ToJsonElementForWire(config) };
await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.startServer", [request], cancellationToken);
}
@@ -22521,6 +24957,19 @@ public async Task LoginAsync(string serverName, bool? force
var request = new McpOauthLoginRequest { SessionId = _session.SessionId, ServerName = serverName, ForceReauth = forceReauth, ClientName = clientName, CallbackSuccessMessage = callbackSuccessMessage, ClientId = clientId, ClientSecret = clientSecret, PublicClient = publicClient, GrantType = grantType };
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.oauth.login", [request], cancellationToken);
}
+
+ /// Responds to a pending MCP OAuth authorization request by its request id.
+ /// OAuth request identifier from the mcp.oauth_required event.
+ /// The to monitor for cancellation requests. The default is .
+ /// Indicates whether the pending MCP OAuth response was accepted.
+ public async Task RespondAsync(string requestId, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(requestId);
+ _session.ThrowIfDisposed();
+
+ var request = new McpOauthRespondRequest { SessionId = _session.SessionId, RequestId = requestId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.oauth.respond", [request], cancellationToken);
+ }
}
/// Provides session-scoped McpHeaders APIs.
@@ -22803,15 +25252,16 @@ internal OptionsApi(CopilotSession session)
/// Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available.
/// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set.
/// Whether shell-script safety heuristics are enabled.
- /// Shell init profile (`None` or `NonInteractive`).
- /// Per-shell process flags (e.g., `pwsh` arguments).
+ /// Per-session settings for built-in shell tools.
+ /// Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`).
+ /// PowerShell process flags applied to built-in and user-requested shell commands.
/// Resolved sandbox configuration.
/// Whether interactive shell sessions are logged.
/// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch).
/// Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers.
/// Additional directories to search for skills.
/// Skill IDs that should be excluded from this session.
- /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag.
+ /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`.
/// Maximum decoded byte size of a single model-facing binary tool result (e.g. an image) persisted inline in session events and re-presented to the model on later turns / resume. Larger results are persisted as a metadata-only marker and shown to the model as a short text note. Defaults to 10 MB.
/// Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes.
/// Whether to default custom agents to local-only execution.
@@ -22828,6 +25278,7 @@ internal OptionsApi(CopilotSession session)
/// Whether to surface reasoning-summary events from the model.
/// Runtime context discriminator (e.g., `cli`, `actions`).
/// Override directory for the session-events log. When unset, the runtime's default events log directory is used.
+ /// Whether subagent callback events should be forwarded into the session event log sink.
/// Additional content-exclusion policies to merge into the session's policy set.
/// Whether to expose the `manage_schedule` tool to the agent. The runtime always owns the per-session schedule registry; this flag only controls tool exposure (typically gated to staff users).
/// Replaces the session's capability set with the given list. Use to enable or disable capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the field to leave the existing capability set unchanged.
@@ -22841,11 +25292,11 @@ internal OptionsApi(CopilotSession session)
/// Optional session limits. Pass null to clear the session limits.
/// The to monitor for cancellation requests. The default is .
/// Indicates whether the session options patch was applied successfully.
- public async Task UpdateAsync(string? model = null, ModelCapabilitiesOverride? modelCapabilitiesOverrides = null, string? reasoningEffort = null, OptionsUpdateReasoningSummary? reasoningSummary = null, Verbosity? verbosity = null, string? clientName = null, string? lspClientName = null, string? integrationId = null, IDictionary? featureFlags = null, bool? isExperimentalMode = null, ProviderConfig? provider = null, CapiSessionOptions? capi = null, string? workingDirectory = null, IList? availableTools = null, IList? excludedTools = null, IList? includedBuiltinAgents = null, IList? excludedBuiltinAgents = null, OptionsUpdateToolFilterPrecedence? toolFilterPrecedence = null, bool? enableScriptSafety = null, string? shellInitProfile = null, IList? shellProcessFlags = null, SandboxConfig? sandboxConfig = null, bool? logInteractiveShells = null, OptionsUpdateEnvValueMode? envValueMode = null, bool? allowAllMcpServerInstructions = null, IList? skillDirectories = null, IList? disabledSkills = null, bool? enableOnDemandInstructionDiscovery = null, long? maxInlineBinaryBytes = null, IList? installedPlugins = null, bool? customAgentsLocalOnly = null, bool? suppressCustomAgentPrompt = null, bool? skipCustomInstructions = null, IList? disabledInstructionSources = null, bool? coauthorEnabled = null, string? trajectoryFile = null, bool? enableStreaming = null, string? copilotUrl = null, bool? askUserDisabled = null, bool? continueOnAutoMode = null, bool? runningInInteractiveMode = null, bool? enableReasoningSummaries = null, string? agentContext = null, string? eventsLogDirectory = null, IList? additionalContentExclusionPolicies = null, bool? manageScheduleEnabled = null, IList? sessionCapabilities = null, bool? skipEmbeddingRetrieval = null, string? organizationCustomInstructions = null, bool? enableFileHooks = null, bool? enableHostGitOperations = null, bool? enableSessionStore = null, bool? enableSkills = null, OptionsUpdateContextTier? contextTier = null, SessionLimitsConfig? sessionLimits = null, CancellationToken cancellationToken = default)
+ public async Task UpdateAsync(string? model = null, ModelCapabilitiesOverride? modelCapabilitiesOverrides = null, string? reasoningEffort = null, OptionsUpdateReasoningSummary? reasoningSummary = null, Verbosity? verbosity = null, string? clientName = null, string? lspClientName = null, string? integrationId = null, IDictionary? featureFlags = null, bool? isExperimentalMode = null, ProviderConfig? provider = null, CapiSessionOptions? capi = null, string? workingDirectory = null, IList? availableTools = null, IList? excludedTools = null, IList? includedBuiltinAgents = null, IList? excludedBuiltinAgents = null, OptionsUpdateToolFilterPrecedence? toolFilterPrecedence = null, bool? enableScriptSafety = null, ShellOptions? shell = null, string? shellInitProfile = null, IList? shellProcessFlags = null, SandboxConfig? sandboxConfig = null, bool? logInteractiveShells = null, OptionsUpdateEnvValueMode? envValueMode = null, bool? allowAllMcpServerInstructions = null, IList? skillDirectories = null, IList? disabledSkills = null, bool? enableOnDemandInstructionDiscovery = null, long? maxInlineBinaryBytes = null, IList? installedPlugins = null, bool? customAgentsLocalOnly = null, bool? suppressCustomAgentPrompt = null, bool? skipCustomInstructions = null, IList? disabledInstructionSources = null, bool? coauthorEnabled = null, string? trajectoryFile = null, bool? enableStreaming = null, string? copilotUrl = null, bool? askUserDisabled = null, bool? continueOnAutoMode = null, bool? runningInInteractiveMode = null, bool? enableReasoningSummaries = null, string? agentContext = null, string? eventsLogDirectory = null, bool? eventsLogIncludesSubagents = null, IList? additionalContentExclusionPolicies = null, bool? manageScheduleEnabled = null, IList? sessionCapabilities = null, bool? skipEmbeddingRetrieval = null, string? organizationCustomInstructions = null, bool? enableFileHooks = null, bool? enableHostGitOperations = null, bool? enableSessionStore = null, bool? enableSkills = null, OptionsUpdateContextTier? contextTier = null, SessionLimitsConfig? sessionLimits = null, CancellationToken cancellationToken = default)
{
_session.ThrowIfDisposed();
- var request = new SessionUpdateOptionsParams { SessionId = _session.SessionId, Model = model, ModelCapabilitiesOverrides = modelCapabilitiesOverrides, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, Verbosity = verbosity, ClientName = clientName, LspClientName = lspClientName, IntegrationId = integrationId, FeatureFlags = featureFlags, IsExperimentalMode = isExperimentalMode, Provider = provider, Capi = capi, WorkingDirectory = workingDirectory, AvailableTools = availableTools, ExcludedTools = excludedTools, IncludedBuiltinAgents = includedBuiltinAgents, ExcludedBuiltinAgents = excludedBuiltinAgents, ToolFilterPrecedence = toolFilterPrecedence, EnableScriptSafety = enableScriptSafety, ShellInitProfile = shellInitProfile, ShellProcessFlags = shellProcessFlags, SandboxConfig = sandboxConfig, LogInteractiveShells = logInteractiveShells, EnvValueMode = envValueMode, AllowAllMcpServerInstructions = allowAllMcpServerInstructions, SkillDirectories = skillDirectories, DisabledSkills = disabledSkills, EnableOnDemandInstructionDiscovery = enableOnDemandInstructionDiscovery, MaxInlineBinaryBytes = maxInlineBinaryBytes, InstalledPlugins = installedPlugins, CustomAgentsLocalOnly = customAgentsLocalOnly, SuppressCustomAgentPrompt = suppressCustomAgentPrompt, SkipCustomInstructions = skipCustomInstructions, DisabledInstructionSources = disabledInstructionSources, CoauthorEnabled = coauthorEnabled, TrajectoryFile = trajectoryFile, EnableStreaming = enableStreaming, CopilotUrl = copilotUrl, AskUserDisabled = askUserDisabled, ContinueOnAutoMode = continueOnAutoMode, RunningInInteractiveMode = runningInInteractiveMode, EnableReasoningSummaries = enableReasoningSummaries, AgentContext = agentContext, EventsLogDirectory = eventsLogDirectory, AdditionalContentExclusionPolicies = additionalContentExclusionPolicies, ManageScheduleEnabled = manageScheduleEnabled, SessionCapabilities = sessionCapabilities, SkipEmbeddingRetrieval = skipEmbeddingRetrieval, OrganizationCustomInstructions = organizationCustomInstructions, EnableFileHooks = enableFileHooks, EnableHostGitOperations = enableHostGitOperations, EnableSessionStore = enableSessionStore, EnableSkills = enableSkills, ContextTier = contextTier, SessionLimits = sessionLimits };
+ var request = new SessionUpdateOptionsParams { SessionId = _session.SessionId, Model = model, ModelCapabilitiesOverrides = modelCapabilitiesOverrides, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, Verbosity = verbosity, ClientName = clientName, LspClientName = lspClientName, IntegrationId = integrationId, FeatureFlags = featureFlags, IsExperimentalMode = isExperimentalMode, Provider = provider, Capi = capi, WorkingDirectory = workingDirectory, AvailableTools = availableTools, ExcludedTools = excludedTools, IncludedBuiltinAgents = includedBuiltinAgents, ExcludedBuiltinAgents = excludedBuiltinAgents, ToolFilterPrecedence = toolFilterPrecedence, EnableScriptSafety = enableScriptSafety, Shell = shell, ShellInitProfile = shellInitProfile, ShellProcessFlags = shellProcessFlags, SandboxConfig = sandboxConfig, LogInteractiveShells = logInteractiveShells, EnvValueMode = envValueMode, AllowAllMcpServerInstructions = allowAllMcpServerInstructions, SkillDirectories = skillDirectories, DisabledSkills = disabledSkills, EnableOnDemandInstructionDiscovery = enableOnDemandInstructionDiscovery, MaxInlineBinaryBytes = maxInlineBinaryBytes, InstalledPlugins = installedPlugins, CustomAgentsLocalOnly = customAgentsLocalOnly, SuppressCustomAgentPrompt = suppressCustomAgentPrompt, SkipCustomInstructions = skipCustomInstructions, DisabledInstructionSources = disabledInstructionSources, CoauthorEnabled = coauthorEnabled, TrajectoryFile = trajectoryFile, EnableStreaming = enableStreaming, CopilotUrl = copilotUrl, AskUserDisabled = askUserDisabled, ContinueOnAutoMode = continueOnAutoMode, RunningInInteractiveMode = runningInInteractiveMode, EnableReasoningSummaries = enableReasoningSummaries, AgentContext = agentContext, EventsLogDirectory = eventsLogDirectory, EventsLogIncludesSubagents = eventsLogIncludesSubagents, AdditionalContentExclusionPolicies = additionalContentExclusionPolicies, ManageScheduleEnabled = manageScheduleEnabled, SessionCapabilities = sessionCapabilities, SkipEmbeddingRetrieval = skipEmbeddingRetrieval, OrganizationCustomInstructions = organizationCustomInstructions, EnableFileHooks = enableFileHooks, EnableHostGitOperations = enableHostGitOperations, EnableSessionStore = enableSessionStore, EnableSkills = enableSkills, ContextTier = contextTier, SessionLimits = sessionLimits };
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.options.update", [request], cancellationToken);
}
}
@@ -23411,13 +25862,14 @@ public async Task SetRequiredAsync(bool required,
}
/// Clears session-scoped tool permission approvals.
+ /// Whether location-scoped approvals are cleared too. Defaults to `true`.
/// The to monitor for cancellation requests. The default is .
/// Indicates whether the operation succeeded.
- public async Task ResetSessionApprovalsAsync(CancellationToken cancellationToken = default)
+ public async Task ResetSessionApprovalsAsync(bool? includeLocation = null, CancellationToken cancellationToken = default)
{
_session.ThrowIfDisposed();
- var request = new PermissionsResetSessionApprovalsRequest { SessionId = _session.SessionId };
+ var request = new PermissionsResetSessionApprovalsRequest { SessionId = _session.SessionId, IncludeLocation = includeLocation };
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.resetSessionApprovals", [request], cancellationToken);
}
@@ -23806,6 +26258,31 @@ internal async Task EvaluatePredicateAsy
}
}
+/// Provides session-scoped ContentExclusion APIs.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ContentExclusionApi
+{
+ private readonly CopilotSession _session;
+
+ internal ContentExclusionApi(CopilotSession session)
+ {
+ _session = session;
+ }
+
+ /// Checks local file system absolute paths within the session working directory against its content-exclusion policy. Results preserve input order. Unsupported paths/filesystems and unavailable policy evaluation return available false, and callers must treat every requested path as excluded.
+ /// Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates.
+ /// The to monitor for cancellation requests. The default is .
+ /// Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable.
+ public async Task CheckPathsAsync(IList paths, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(paths);
+ _session.ThrowIfDisposed();
+
+ var request = new ContentExclusionCheckPathsRequest { SessionId = _session.SessionId, Paths = paths };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.contentExclusion.checkPaths", [request], cancellationToken);
+ }
+}
+
/// Provides session-scoped Shell APIs.
[Experimental(Diagnostics.Experimental)]
public sealed class ShellApi
@@ -23817,7 +26294,7 @@ internal ShellApi(CopilotSession session)
_session = session;
}
- /// Starts a shell command and streams output through session notifications.
+ /// Starts a shell command and streams output through session notifications. The command runs as the leader of its own process group (POSIX) or in a dedicated job object (Windows), so a forced termination — via "shell.kill", the request timeout, or session disposal — signals that whole group/job rather than only the direct child. Two gaps are worth planning for: a command that exits on its own does not trigger that teardown, and on POSIX a descendant that moves itself into a new session or process group (for example via "setsid") leaves the signalled group, so either can leave a background process running.
/// Shell command to execute.
/// Working directory (defaults to session working directory).
/// Timeout in milliseconds (default: 30000).
@@ -23832,7 +26309,7 @@ public async Task ExecAsync(string command, string? cwd = null,
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.shell.exec", [request], cancellationToken);
}
- /// Sends a signal to a shell process previously started via "shell.exec".
+ /// Sends a signal to a shell process previously started via "shell.exec". The signal targets the command's whole process group (POSIX) or job object (Windows), so descendants still in that group are signalled too, not just the direct child. On POSIX a descendant that moved itself into a new session or process group (for example via "setsid") is no longer in the signalled group and survives.
/// Process identifier returned by shell.exec.
/// Signal to send (default: SIGTERM).
/// The to monitor for cancellation requests. The default is .
@@ -23911,6 +26388,44 @@ public async Task TruncateAsync(string eventId, Cancellat
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.truncate", [request], cancellationToken);
}
+ /// Lists the user turns that the session can rewind to. Never rejects for a busy session: rewind reads need the session's file-change captures to be settled, so a session that still holds active work answers with `unavailableReason: "session-busy"` and no points, which the caller can retry.
+ /// The to monitor for cancellation requests. The default is .
+ /// Rewind points and file-change-tracking availability for the session.
+ public async Task ListRewindPointsAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionHistoryListRewindPointsRequest { SessionId = _session.SessionId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.listRewindPoints", [request], cancellationToken);
+ }
+
+ /// Previews the files that a conversation-and-files rewind would restore.
+ /// ID of the user.message event that begins the discarded suffix.
+ /// The to monitor for cancellation requests. The default is .
+ /// Files and aggregate changes for a prospective rewind.
+ public async Task PreviewRewindAsync(string eventId, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(eventId);
+ _session.ThrowIfDisposed();
+
+ var request = new HistoryPreviewRewindRequest { SessionId = _session.SessionId, EventId = eventId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.previewRewind", [request], cancellationToken);
+ }
+
+ /// Rewinds the session conversation, optionally restoring files changed by the discarded turns. Not crash-atomic: file restore and conversation truncation are separate stores, applied in that order, so a process crash between them can leave the workspace rewound while the conversation still contains the discarded turns. There is no recovery journal; re-running the same rewind is the recovery path for a crash before truncation lands, since file restore is idempotent (already-restored files are reported as skipped) and truncation is re-derived from the still-retained boundary event. After truncation lands that boundary no longer exists, so the same request is rejected; the only stage that can still be outstanding is snapshot pruning, whose failure leaves orphan snapshots the capture store tolerates. The reverse inconsistency cannot occur, because truncation is never applied before file restore succeeds.
+ /// ID of the user.message event that begins the discarded suffix.
+ /// Whether to rewind only conversation history or also restore captured files.
+ /// The to monitor for cancellation requests. The default is .
+ /// Structured outcome of a rewind request.
+ public async Task RewindAsync(string eventId, HistoryRewindMode mode, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(eventId);
+ _session.ThrowIfDisposed();
+
+ var request = new HistoryRewindRequest { SessionId = _session.SessionId, EventId = eventId, Mode = mode };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.rewind", [request], cancellationToken);
+ }
+
/// Cancels any in-progress background compaction on a local session.
/// The to monitor for cancellation requests. The default is .
/// Indicates whether an in-progress background compaction was cancelled.
@@ -23967,6 +26482,64 @@ public async Task PendingItemsAsync(CancellationToken c
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.pendingItems", [request], cancellationToken);
}
+ /// Returns the internal native queue snapshot for in-process session orchestration.
+ /// The to monitor for cancellation requests. The default is .
+ /// Internal snapshot of native queue state for local session orchestration.
+ internal async Task SnapshotAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionQueueSnapshotRequest { SessionId = _session.SessionId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.snapshot", [request], cancellationToken);
+ }
+
+ /// Reports whether the local session has native queued work pending.
+ /// The to monitor for cancellation requests. The default is .
+ /// Whether the native queue has pending work.
+ internal async Task HasPendingAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionQueueHasPendingRequest { SessionId = _session.SessionId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.hasPending", [request], cancellationToken);
+ }
+
+ /// Begins a native deferred-idle drain when background work has quiesced.
+ /// Whether the host still has active background work.
+ /// The to monitor for cancellation requests. The default is .
+ /// Whether a deferred-idle drain should run.
+ internal async Task BeginDeferredIdleDrainAsync(bool activeBackgroundWork, CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new QueueBeginDeferredIdleDrainRequest { SessionId = _session.SessionId, ActiveBackgroundWork = activeBackgroundWork };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.beginDeferredIdleDrain", [request], cancellationToken);
+ }
+
+ /// Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle.
+ /// Whether the host still has active background work.
+ /// Whether native queued work remains.
+ /// The to monitor for cancellation requests. The default is .
+ /// Action selected by the native deferred-idle drain.
+ internal async Task FinishDeferredIdleDrainAsync(bool activeBackgroundWork, bool hasPending, CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new QueueFinishDeferredIdleDrainRequest { SessionId = _session.SessionId, ActiveBackgroundWork = activeBackgroundWork, HasPending = hasPending };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.finishDeferredIdleDrain", [request], cancellationToken);
+ }
+
+ /// Marks session.idle as deferred by native background work state.
+ /// Whether the deferred idle was caused by an aborted foreground turn.
+ /// The to monitor for cancellation requests. The default is .
+ internal async Task DeferSessionIdleAsync(bool aborted, CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new QueueDeferSessionIdleRequest { SessionId = _session.SessionId, Aborted = aborted };
+ await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.deferSessionIdle", [request], cancellationToken);
+ }
+
/// Removes the most recently queued user-facing item (LIFO).
/// The to monitor for cancellation requests. The default is .
/// Indicates whether a user-facing pending item was removed.
@@ -23987,6 +26560,40 @@ public async Task ClearAsync(CancellationToken cancellationToken = default)
var request = new SessionQueueClearRequest { SessionId = _session.SessionId };
await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.clear", [request], cancellationToken);
}
+
+ /// Consumes queued native system notifications matching an internal filter.
+ /// Opaque runtime-owned filter object.
+ /// The to monitor for cancellation requests. The default is .
+ /// Indicates whether a user-facing pending item was removed.
+ internal async Task ConsumeSystemNotificationsAsync(object filter, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(filter);
+ _session.ThrowIfDisposed();
+
+ var request = new QueueConsumeSystemNotificationsRequest { SessionId = _session.SessionId, Filter = CopilotClient.ToJsonElementForWire(filter)!.Value };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.consumeSystemNotifications", [request], cancellationToken);
+ }
+
+ /// Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn.
+ /// The to monitor for cancellation requests. The default is .
+ /// Result of enqueueing the resume-pending wake item.
+ internal async Task EnqueueResumePendingAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionQueueEnqueueResumePendingRequest { SessionId = _session.SessionId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.enqueueResumePending", [request], cancellationToken);
+ }
+
+ /// Drains the native local-session work queue for in-process session orchestration.
+ /// The to monitor for cancellation requests. The default is .
+ internal async Task ProcessAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionQueueProcessRequest { SessionId = _session.SessionId };
+ await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.process", [request], cancellationToken);
+ }
}
/// Provides session-scoped EventLog APIs.
@@ -24180,6 +26787,105 @@ public async Task ListAsync(CancellationToken cancellationToken =
return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.list", [request], cancellationToken);
}
+ /// Hydrates the native schedule registry from persisted session events.
+ /// The to monitor for cancellation requests. The default is .
+ internal async Task HydrateAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionScheduleHydrateRequest { SessionId = _session.SessionId };
+ await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.hydrate", [request], cancellationToken);
+ }
+
+ /// Reports whether the session has an active self-paced scheduled prompt.
+ /// The to monitor for cancellation requests. The default is .
+ /// Whether the session currently has an active self-paced schedule.
+ internal async Task HasSelfPacedAsync(CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new SessionScheduleHasSelfPacedRequest { SessionId = _session.SessionId };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.hasSelfPaced", [request], cancellationToken);
+ }
+
+ /// Registers a relative-interval scheduled prompt.
+ /// Human-readable interval such as `30s`, `5m`, or `2h`.
+ /// Prompt text to enqueue when the schedule fires.
+ /// Whether the schedule should re-arm after each tick. Defaults to true.
+ /// Optional display-only prompt label.
+ /// The to monitor for cancellation requests. The default is .
+ /// Result of registering or re-arming a scheduled prompt.
+ internal async Task AddAsync(string interval, string prompt, bool? recurring = null, string? displayPrompt = null, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(interval);
+ ArgumentNullException.ThrowIfNull(prompt);
+ _session.ThrowIfDisposed();
+
+ var request = new ScheduleAddRequest { SessionId = _session.SessionId, Interval = interval, Prompt = prompt, Recurring = recurring, DisplayPrompt = displayPrompt };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.add", [request], cancellationToken);
+ }
+
+ /// Registers a recurring cron scheduled prompt.
+ /// 5-field cron expression.
+ /// Prompt text to enqueue when the schedule fires.
+ /// Whether the schedule should re-arm after each tick. Defaults to true.
+ /// Optional display-only prompt label.
+ /// IANA timezone for evaluating the cron expression.
+ /// The to monitor for cancellation requests. The default is .
+ /// Result of registering or re-arming a scheduled prompt.
+ internal async Task AddCronAsync(string cron, string prompt, bool? recurring = null, string? displayPrompt = null, string? tz = null, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(cron);
+ ArgumentNullException.ThrowIfNull(prompt);
+ _session.ThrowIfDisposed();
+
+ var request = new ScheduleAddCronRequest { SessionId = _session.SessionId, Cron = cron, Prompt = prompt, Recurring = recurring, DisplayPrompt = displayPrompt, Tz = tz };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.addCron", [request], cancellationToken);
+ }
+
+ /// Registers an absolute-time scheduled prompt.
+ /// Epoch milliseconds when the prompt should fire.
+ /// Prompt text to enqueue when the schedule fires.
+ /// Whether the schedule should re-arm after each tick. Defaults to false.
+ /// Optional display-only prompt label.
+ /// The to monitor for cancellation requests. The default is .
+ /// Result of registering or re-arming a scheduled prompt.
+ internal async Task AddAtAsync(long at, string prompt, bool? recurring = null, string? displayPrompt = null, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(prompt);
+ _session.ThrowIfDisposed();
+
+ var request = new ScheduleAddAtRequest { SessionId = _session.SessionId, At = at, Prompt = prompt, Recurring = recurring, DisplayPrompt = displayPrompt };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.addAt", [request], cancellationToken);
+ }
+
+ /// Registers a self-paced scheduled prompt.
+ /// Prompt text to enqueue when the schedule fires.
+ /// Optional display-only prompt label.
+ /// The to monitor for cancellation requests. The default is .
+ /// Result of registering or re-arming a scheduled prompt.
+ internal async Task AddSelfPacedAsync(string prompt, string? displayPrompt = null, CancellationToken cancellationToken = default)
+ {
+ ArgumentNullException.ThrowIfNull(prompt);
+ _session.ThrowIfDisposed();
+
+ var request = new ScheduleAddSelfPacedRequest { SessionId = _session.SessionId, Prompt = prompt, DisplayPrompt = displayPrompt };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.addSelfPaced", [request], cancellationToken);
+ }
+
+ /// Re-arms an active self-paced scheduled prompt.
+ /// Id of the self-paced scheduled prompt.
+ /// Epoch milliseconds when the prompt should next fire.
+ /// The to monitor for cancellation requests. The default is .
+ /// Result of registering or re-arming a scheduled prompt.
+ internal async Task RearmSelfPacedAsync(long id, long at, CancellationToken cancellationToken = default)
+ {
+ _session.ThrowIfDisposed();
+
+ var request = new ScheduleRearmSelfPacedRequest { SessionId = _session.SessionId, Id = id, At = at };
+ return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.rearmSelfPaced", [request], cancellationToken);
+ }
+
/// Removes a scheduled prompt by id.
/// Id of the scheduled prompt to remove.
/// The to monitor for cancellation requests. The default is .
@@ -24274,11 +26980,16 @@ public interface ISessionFsHandler
/// The to monitor for cancellation requests. The default is .
/// Describes a filesystem error.
Task RenameAsync(SessionFsRenameRequest request, CancellationToken cancellationToken = default);
- /// Executes a SQLite query against the per-session database.
- /// SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database.
+ /// Executes a SQLite query against the per-session database. Providers apply busy handling for every call.
+ /// SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. The provider applies its SQLite busy timeout for every call.
/// The to monitor for cancellation requests. The default is .
/// Query results including rows, columns, and rows affected, or a filesystem error if execution failed.
Task SqliteQueryAsync(SessionFsSqliteQueryRequest request, CancellationToken cancellationToken = default);
+ /// Executes SQLite statements atomically on the provider-owned connection.
+ /// Statements to execute atomically. Providers apply busy handling for every call.
+ /// The to monitor for cancellation requests. The default is .
+ /// Per-statement results, or a classified transaction error.
+ Task SqliteTransactionAsync(SessionFsSqliteTransactionRequest request, CancellationToken cancellationToken = default);
/// Checks whether the per-session SQLite database already exists, without creating it.
/// Identifies the target session.
/// The to monitor for cancellation requests. The default is .
@@ -24416,6 +27127,12 @@ public static void RegisterClientSessionApiHandlers(JsonRpc rpc, Func>)(async (request, cancellationToken) =>
+ {
+ var handler = getHandlers(request.SessionId).SessionFs;
+ if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}");
+ return await handler.SqliteTransactionAsync(request, cancellationToken);
+ }), singleObjectParam: true);
rpc.SetLocalRpcMethod("sessionFs.sqliteExists", (Func>)(async (request, cancellationToken) =>
{
var handler = getHandlers(request.SessionId).SessionFs;
@@ -24577,6 +27294,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(GitHub.Copilot.AttachmentSelectionDetails), TypeInfoPropertyName = "SessionEventsAttachmentSelectionDetails")]
[JsonSerializable(typeof(GitHub.Copilot.AttachmentSelectionDetailsEnd), TypeInfoPropertyName = "SessionEventsAttachmentSelectionDetailsEnd")]
[JsonSerializable(typeof(GitHub.Copilot.AttachmentSelectionDetailsStart), TypeInfoPropertyName = "SessionEventsAttachmentSelectionDetailsStart")]
+[JsonSerializable(typeof(GitHub.Copilot.AutoApprovalJudgeFailureReason), TypeInfoPropertyName = "SessionEventsAutoApprovalJudgeFailureReason")]
[JsonSerializable(typeof(GitHub.Copilot.AutoApprovalRecommendation), TypeInfoPropertyName = "SessionEventsAutoApprovalRecommendation")]
[JsonSerializable(typeof(GitHub.Copilot.AutoModeResolvedReasoningBucket), TypeInfoPropertyName = "SessionEventsAutoModeResolvedReasoningBucket")]
[JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchCompletedData), TypeInfoPropertyName = "SessionEventsAutoModeSwitchCompletedData")]
@@ -24638,6 +27356,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(GitHub.Copilot.ExternalToolCompletedEvent), TypeInfoPropertyName = "SessionEventsExternalToolCompletedEvent")]
[JsonSerializable(typeof(GitHub.Copilot.ExternalToolRequestedData), TypeInfoPropertyName = "SessionEventsExternalToolRequestedData")]
[JsonSerializable(typeof(GitHub.Copilot.ExternalToolRequestedEvent), TypeInfoPropertyName = "SessionEventsExternalToolRequestedEvent")]
+[JsonSerializable(typeof(GitHub.Copilot.FactoryRunUpdatedData), TypeInfoPropertyName = "SessionEventsFactoryRunUpdatedData")]
+[JsonSerializable(typeof(GitHub.Copilot.FactoryRunUpdatedEvent), TypeInfoPropertyName = "SessionEventsFactoryRunUpdatedEvent")]
[JsonSerializable(typeof(GitHub.Copilot.GitHubRepoRef), TypeInfoPropertyName = "SessionEventsGitHubRepoRef")]
[JsonSerializable(typeof(GitHub.Copilot.HandoffRepository), TypeInfoPropertyName = "SessionEventsHandoffRepository")]
[JsonSerializable(typeof(GitHub.Copilot.HandoffSourceType), TypeInfoPropertyName = "SessionEventsHandoffSourceType")]
@@ -24738,6 +27458,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(GitHub.Copilot.SamplingCompletedEvent), TypeInfoPropertyName = "SessionEventsSamplingCompletedEvent")]
[JsonSerializable(typeof(GitHub.Copilot.SamplingRequestedData), TypeInfoPropertyName = "SessionEventsSamplingRequestedData")]
[JsonSerializable(typeof(GitHub.Copilot.SamplingRequestedEvent), TypeInfoPropertyName = "SessionEventsSamplingRequestedEvent")]
+[JsonSerializable(typeof(GitHub.Copilot.ScheduleOrigin), TypeInfoPropertyName = "SessionEventsScheduleOrigin")]
[JsonSerializable(typeof(GitHub.Copilot.SessionEvent), TypeInfoPropertyName = "SessionEventsSessionEvent")]
[JsonSerializable(typeof(GitHub.Copilot.SessionLimitsConfig), TypeInfoPropertyName = "SessionEventsSessionLimitsConfig")]
[JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedCompletedData), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedCompletedData")]
@@ -24874,6 +27595,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(AllowAllPermissionSetResult))]
[JsonSerializable(typeof(AllowAllPermissionState))]
[JsonSerializable(typeof(AuthInfo))]
+[JsonSerializable(typeof(BuiltInModelCatalog))]
+[JsonSerializable(typeof(BuiltInModelCatalogEntry))]
[JsonSerializable(typeof(CancelUserRequestedShellCommandResult))]
[JsonSerializable(typeof(CanvasAction))]
[JsonSerializable(typeof(CanvasActionInvokeRequest))]
@@ -24907,6 +27630,9 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(ConnectResult))]
[JsonSerializable(typeof(ConnectedRemoteSessionMetadata))]
[JsonSerializable(typeof(ConnectedRemoteSessionMetadataRepository))]
+[JsonSerializable(typeof(ContentExclusionCheckPathsRequest))]
+[JsonSerializable(typeof(ContentExclusionCheckPathsResult))]
+[JsonSerializable(typeof(ContentExclusionPathCheck))]
[JsonSerializable(typeof(ContextHeaviestMessage))]
[JsonSerializable(typeof(CopilotUserResponse))]
[JsonSerializable(typeof(CopilotUserResponseEndpoints))]
@@ -24943,19 +27669,34 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(FactoryAgentOptions))]
[JsonSerializable(typeof(FactoryAgentRequest))]
[JsonSerializable(typeof(FactoryAgentResult))]
+[JsonSerializable(typeof(FactoryAgentSummary))]
[JsonSerializable(typeof(FactoryCancelRequest))]
+[JsonSerializable(typeof(FactoryCurrentPhase))]
+[JsonSerializable(typeof(FactoryDeclaredLimits))]
[JsonSerializable(typeof(FactoryExecuteRequest))]
[JsonSerializable(typeof(FactoryExecuteResult))]
+[JsonSerializable(typeof(FactoryGetRunProgressRequest))]
[JsonSerializable(typeof(FactoryGetRunRequest))]
[JsonSerializable(typeof(FactoryJournalGetRequest))]
[JsonSerializable(typeof(FactoryJournalGetResult))]
[JsonSerializable(typeof(FactoryJournalPutRequest))]
+[JsonSerializable(typeof(FactoryListRunsRequest))]
+[JsonSerializable(typeof(FactoryListRunsResult))]
[JsonSerializable(typeof(FactoryLogLine))]
[JsonSerializable(typeof(FactoryLogRequest))]
+[JsonSerializable(typeof(FactoryPhaseObservation))]
+[JsonSerializable(typeof(FactoryProgressLine))]
+[JsonSerializable(typeof(FactoryProgressPage))]
+[JsonSerializable(typeof(FactoryResumeRequest))]
+[JsonSerializable(typeof(FactoryResumeResult))]
+[JsonSerializable(typeof(FactoryRunConsumed))]
+[JsonSerializable(typeof(FactoryRunDetail))]
[JsonSerializable(typeof(FactoryRunFailure))]
[JsonSerializable(typeof(FactoryRunLimits))]
[JsonSerializable(typeof(FactoryRunRequest))]
[JsonSerializable(typeof(FactoryRunResult))]
+[JsonSerializable(typeof(FactoryRunSummary))]
+[JsonSerializable(typeof(FactoryRunTerminal))]
[JsonSerializable(typeof(FleetStartRequest))]
[JsonSerializable(typeof(FleetStartResult))]
[JsonSerializable(typeof(FolderTrustAddParams))]
@@ -24972,6 +27713,14 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(HistoryCompactRequest))]
[JsonSerializable(typeof(HistoryCompactRequestWithSession))]
[JsonSerializable(typeof(HistoryCompactResult))]
+[JsonSerializable(typeof(HistoryListRewindPointsResult))]
+[JsonSerializable(typeof(HistoryPreviewRewindRequest))]
+[JsonSerializable(typeof(HistoryPreviewRewindResult))]
+[JsonSerializable(typeof(HistoryRewindFilePreview))]
+[JsonSerializable(typeof(HistoryRewindPoint))]
+[JsonSerializable(typeof(HistoryRewindRequest))]
+[JsonSerializable(typeof(HistoryRewindResult))]
+[JsonSerializable(typeof(HistorySkippedFileRestore))]
[JsonSerializable(typeof(HistorySummarizeForHandoffResult))]
[JsonSerializable(typeof(HistoryTruncateRequest))]
[JsonSerializable(typeof(HistoryTruncateResult))]
@@ -24985,6 +27734,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(InstructionsDiscoverRequest))]
[JsonSerializable(typeof(InstructionsGetDiscoveryPathsRequest))]
[JsonSerializable(typeof(InstructionsGetSourcesResult))]
+[JsonSerializable(typeof(InterruptMainTurnRequest))]
+[JsonSerializable(typeof(InterruptMainTurnResult))]
[JsonSerializable(typeof(LlmInferenceHttpRequestChunkRequest))]
[JsonSerializable(typeof(LlmInferenceHttpRequestChunkResult))]
[JsonSerializable(typeof(LlmInferenceHttpRequestStartRequest))]
@@ -25053,6 +27804,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(McpOauthLoginRequest))]
[JsonSerializable(typeof(McpOauthLoginResult))]
[JsonSerializable(typeof(McpOauthPendingRequestResponse))]
+[JsonSerializable(typeof(McpOauthRespondRequest))]
+[JsonSerializable(typeof(McpOauthRespondResult))]
[JsonSerializable(typeof(McpRegisterExternalClientRequest))]
[JsonSerializable(typeof(McpReloadWithConfigRequest))]
[JsonSerializable(typeof(McpRemoveGitHubResult))]
@@ -25224,9 +27977,18 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(PushAttachmentSelectionDetailsEnd))]
[JsonSerializable(typeof(PushAttachmentSelectionDetailsStart))]
[JsonSerializable(typeof(PushGitHubRepoRef))]
+[JsonSerializable(typeof(QueueBeginDeferredIdleDrainRequest))]
+[JsonSerializable(typeof(QueueBeginDeferredIdleDrainResult))]
+[JsonSerializable(typeof(QueueConsumeSystemNotificationsRequest))]
+[JsonSerializable(typeof(QueueDeferSessionIdleRequest))]
+[JsonSerializable(typeof(QueueEnqueueResumePendingResult))]
+[JsonSerializable(typeof(QueueFinishDeferredIdleDrainRequest))]
+[JsonSerializable(typeof(QueueFinishDeferredIdleDrainResult))]
+[JsonSerializable(typeof(QueueHasPendingResult))]
[JsonSerializable(typeof(QueuePendingItems))]
[JsonSerializable(typeof(QueuePendingItemsResult))]
[JsonSerializable(typeof(QueueRemoveMostRecentResult))]
+[JsonSerializable(typeof(QueueSnapshotResult))]
[JsonSerializable(typeof(QueuedCommandResult))]
[JsonSerializable(typeof(RegisterEventInterestParams))]
[JsonSerializable(typeof(RegisterEventInterestResult))]
@@ -25254,8 +28016,15 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(SandboxConfigUserPolicyFilesystem))]
[JsonSerializable(typeof(SandboxConfigUserPolicyNetwork))]
[JsonSerializable(typeof(SandboxConfigUserPolicySeatbelt))]
+[JsonSerializable(typeof(ScheduleAddAtRequest))]
+[JsonSerializable(typeof(ScheduleAddCronRequest))]
+[JsonSerializable(typeof(ScheduleAddRequest))]
+[JsonSerializable(typeof(ScheduleAddResult))]
+[JsonSerializable(typeof(ScheduleAddSelfPacedRequest))]
[JsonSerializable(typeof(ScheduleEntry))]
+[JsonSerializable(typeof(ScheduleHasSelfPacedResult))]
[JsonSerializable(typeof(ScheduleList))]
+[JsonSerializable(typeof(ScheduleRearmSelfPacedRequest))]
[JsonSerializable(typeof(ScheduleStopRequest))]
[JsonSerializable(typeof(ScheduleStopResult))]
[JsonSerializable(typeof(SecretsAddFilterValuesRequest))]
@@ -25266,6 +28035,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(SendMessagesResult))]
[JsonSerializable(typeof(SendRequest))]
[JsonSerializable(typeof(SendResult))]
+[JsonSerializable(typeof(SendSystemNotificationRequest))]
[JsonSerializable(typeof(ServerAgentList))]
[JsonSerializable(typeof(ServerInstructionSourceList))]
[JsonSerializable(typeof(ServerSkill))]
@@ -25277,6 +28047,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(SessionAgentReloadRequest))]
[JsonSerializable(typeof(SessionAuthStatus))]
[JsonSerializable(typeof(SessionBulkDeleteResult))]
+[JsonSerializable(typeof(SessionCancelAllBackgroundAgentsRequest))]
[JsonSerializable(typeof(SessionCanvasListOpenRequest))]
[JsonSerializable(typeof(SessionCanvasListRequest))]
[JsonSerializable(typeof(SessionCompletionItem))]
@@ -25307,12 +28078,17 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(SessionFsSqliteExistsResult))]
[JsonSerializable(typeof(SessionFsSqliteQueryRequest))]
[JsonSerializable(typeof(SessionFsSqliteQueryResult))]
+[JsonSerializable(typeof(SessionFsSqliteTransactionError))]
+[JsonSerializable(typeof(SessionFsSqliteTransactionRequest))]
+[JsonSerializable(typeof(SessionFsSqliteTransactionResult))]
+[JsonSerializable(typeof(SessionFsSqliteTransactionStatement))]
[JsonSerializable(typeof(SessionFsStatRequest))]
[JsonSerializable(typeof(SessionFsStatResult))]
[JsonSerializable(typeof(SessionFsWriteFileRequest))]
[JsonSerializable(typeof(SessionGitHubAuthGetStatusRequest))]
[JsonSerializable(typeof(SessionHistoryAbortManualCompactionRequest))]
[JsonSerializable(typeof(SessionHistoryCancelBackgroundCompactionRequest))]
+[JsonSerializable(typeof(SessionHistoryListRewindPointsRequest))]
[JsonSerializable(typeof(SessionHistorySummarizeForHandoffRequest))]
[JsonSerializable(typeof(SessionInstalledPlugin))]
[JsonSerializable(typeof(SessionInstructionsGetSourcesRequest))]
@@ -25343,9 +28119,15 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(SessionPluginsListRequest))]
[JsonSerializable(typeof(SessionPruneResult))]
[JsonSerializable(typeof(SessionQueueClearRequest))]
+[JsonSerializable(typeof(SessionQueueEnqueueResumePendingRequest))]
+[JsonSerializable(typeof(SessionQueueHasPendingRequest))]
[JsonSerializable(typeof(SessionQueuePendingItemsRequest))]
+[JsonSerializable(typeof(SessionQueueProcessRequest))]
[JsonSerializable(typeof(SessionQueueRemoveMostRecentRequest))]
+[JsonSerializable(typeof(SessionQueueSnapshotRequest))]
[JsonSerializable(typeof(SessionRemoteDisableRequest))]
+[JsonSerializable(typeof(SessionScheduleHasSelfPacedRequest))]
+[JsonSerializable(typeof(SessionScheduleHydrateRequest))]
[JsonSerializable(typeof(SessionScheduleListRequest))]
[JsonSerializable(typeof(SessionSetCredentialsParams))]
[JsonSerializable(typeof(SessionSetCredentialsResult))]
@@ -25380,14 +28162,18 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(SessionUsageGetMetricsRequest))]
[JsonSerializable(typeof(SessionVisibilityGetRequest))]
[JsonSerializable(typeof(SessionWorkingDirectoryContext))]
+[JsonSerializable(typeof(SessionWorkspacesAutopilotObjectiveExistsRequest))]
+[JsonSerializable(typeof(SessionWorkspacesDeleteAutopilotObjectiveRequest))]
[JsonSerializable(typeof(SessionWorkspacesGetWorkspaceRequest))]
[JsonSerializable(typeof(SessionWorkspacesListCheckpointsRequest))]
[JsonSerializable(typeof(SessionWorkspacesListFilesRequest))]
+[JsonSerializable(typeof(SessionWorkspacesReadAutopilotObjectiveRequest))]
[JsonSerializable(typeof(SessionsBulkDeleteRequest))]
[JsonSerializable(typeof(SessionsCheckInUseRequest))]
[JsonSerializable(typeof(SessionsCheckInUseResult))]
[JsonSerializable(typeof(SessionsCloseRequest))]
[JsonSerializable(typeof(SessionsCloseResult))]
+[JsonSerializable(typeof(SessionsDeleteRequest))]
[JsonSerializable(typeof(SessionsEnrichMetadataRequest))]
[JsonSerializable(typeof(SessionsFindByPrefixRequest))]
[JsonSerializable(typeof(SessionsFindByPrefixResult))]
@@ -25401,8 +28187,12 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(SessionsGetEventFilePathResult))]
[JsonSerializable(typeof(SessionsGetLastForContextRequest))]
[JsonSerializable(typeof(SessionsGetLastForContextResult))]
+[JsonSerializable(typeof(SessionsGetMetadataRequest))]
+[JsonSerializable(typeof(SessionsGetMetadataResult))]
[JsonSerializable(typeof(SessionsGetPersistedRemoteSteerableRequest))]
[JsonSerializable(typeof(SessionsGetPersistedRemoteSteerableResult))]
+[JsonSerializable(typeof(SessionsListNonEmptySessionIdsRequest))]
+[JsonSerializable(typeof(SessionsListNonEmptySessionIdsResult))]
[JsonSerializable(typeof(SessionsListRequest))]
[JsonSerializable(typeof(SessionsLoadDeferredRepoHooksRequest))]
[JsonSerializable(typeof(SessionsOpenProgress))]
@@ -25424,8 +28214,10 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(ShellExecRequest))]
[JsonSerializable(typeof(ShellExecResult))]
[JsonSerializable(typeof(ShellExecuteUserRequestedRequest))]
+[JsonSerializable(typeof(ShellInitScript))]
[JsonSerializable(typeof(ShellKillRequest))]
[JsonSerializable(typeof(ShellKillResult))]
+[JsonSerializable(typeof(ShellOptions))]
[JsonSerializable(typeof(ShutdownRequest))]
[JsonSerializable(typeof(Skill))]
[JsonSerializable(typeof(SkillDiscoveryPath))]
@@ -25511,13 +28303,21 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(VisibilitySetResult))]
[JsonSerializable(typeof(WorkspaceDiffFileChange))]
[JsonSerializable(typeof(WorkspaceDiffResult))]
+[JsonSerializable(typeof(WorkspacesAddSummaryRequest))]
+[JsonSerializable(typeof(WorkspacesAddSummaryResult))]
+[JsonSerializable(typeof(WorkspacesAddSummaryResultSummary))]
+[JsonSerializable(typeof(WorkspacesAddSummaryResultWorkspace))]
+[JsonSerializable(typeof(WorkspacesAutopilotObjectiveExistsResult))]
[JsonSerializable(typeof(WorkspacesCheckpoints))]
[JsonSerializable(typeof(WorkspacesCreateFileRequest))]
+[JsonSerializable(typeof(WorkspacesDeleteAutopilotObjectiveResult))]
[JsonSerializable(typeof(WorkspacesDiffRequest))]
+[JsonSerializable(typeof(WorkspacesEnsureRequest))]
[JsonSerializable(typeof(WorkspacesGetWorkspaceResult))]
[JsonSerializable(typeof(WorkspacesGetWorkspaceResultWorkspace))]
[JsonSerializable(typeof(WorkspacesListCheckpointsResult))]
[JsonSerializable(typeof(WorkspacesListFilesResult))]
+[JsonSerializable(typeof(WorkspacesReadAutopilotObjectiveResult))]
[JsonSerializable(typeof(WorkspacesReadCheckpointRequest))]
[JsonSerializable(typeof(WorkspacesReadCheckpointResult))]
[JsonSerializable(typeof(WorkspacesReadFileRequest))]
@@ -25525,4 +28325,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH
[JsonSerializable(typeof(WorkspacesSaveLargePasteRequest))]
[JsonSerializable(typeof(WorkspacesSaveLargePasteResult))]
[JsonSerializable(typeof(WorkspacesSaveLargePasteResultSaved))]
+[JsonSerializable(typeof(WorkspacesTruncateSummariesRequest))]
+[JsonSerializable(typeof(WorkspacesUpdateMetadataRequest))]
+[JsonSerializable(typeof(WorkspacesWriteAutopilotObjectiveRequest))]
+[JsonSerializable(typeof(WorkspacesWriteAutopilotObjectiveResult))]
internal partial class RpcJsonContext : JsonSerializerContext;
\ No newline at end of file
diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs
index a8c70df7cc..5e7e2158d0 100644
--- a/dotnet/src/Generated/SessionEvents.cs
+++ b/dotnet/src/Generated/SessionEvents.cs
@@ -52,6 +52,7 @@ namespace GitHub.Copilot;
[JsonDerivedType(typeof(ExitPlanModeRequestedEvent), "exit_plan_mode.requested")]
[JsonDerivedType(typeof(ExternalToolCompletedEvent), "external_tool.completed")]
[JsonDerivedType(typeof(ExternalToolRequestedEvent), "external_tool.requested")]
+[JsonDerivedType(typeof(FactoryRunUpdatedEvent), "factory.run_updated")]
[JsonDerivedType(typeof(HookEndEvent), "hook.end")]
[JsonDerivedType(typeof(HookProgressEvent), "hook.progress")]
[JsonDerivedType(typeof(HookStartEvent), "hook.start")]
@@ -1444,6 +1445,20 @@ public sealed partial class SessionBackgroundTasksChangedEvent : SessionEvent
public required SessionBackgroundTasksChangedData Data { get; set; }
}
+/// Ephemeral invalidation signal for a changed factory run.
+/// Represents the factory.run_updated event.
+[Experimental(Diagnostics.Experimental)]
+public sealed partial class FactoryRunUpdatedEvent : SessionEvent
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "factory.run_updated";
+
+ /// The factory.run_updated event payload.
+ [JsonPropertyName("data")]
+ public required FactoryRunUpdatedData Data { get; set; }
+}
+
/// Payload of `session.skills_loaded` listing resolved skill metadata.
/// Represents the session.skills_loaded event.
public sealed partial class SessionSkillsLoadedEvent : SessionEvent
@@ -1750,7 +1765,7 @@ public sealed partial class SessionResumeData
[JsonPropertyName("contextTier")]
public ContextTier? ContextTier { get; set; }
- /// When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume.
+ /// When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false or omitted, pending work is normally marked as interrupted unless the resume passively joined live work owned by another client; sessionWasActive distinguishes that case.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("continuePendingWork")]
public bool? ContinuePendingWork { get; set; }
@@ -1793,7 +1808,7 @@ public sealed partial class SessionResumeData
[JsonPropertyName("sessionLimits")]
public SessionLimitsConfig? SessionLimits { get; set; }
- /// True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log.
+ /// True when this resume passively joined a session that already had live work running in the runtime - an agent turn, a native queue run, a queued resume continuation, or an in-flight send (for example, an extension joining a session another client was actively driving). False (or omitted) when the session had no live work or when the resume explicitly abandoned pending work, including cold resumes and suspended sessions that remain resident in memory.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("sessionWasActive")]
public bool? SessionWasActive { get; set; }
@@ -1904,6 +1919,11 @@ public sealed partial class SessionScheduleCreatedData
[JsonPropertyName("intervalMs")]
public TimeSpan? Interval { get; set; }
+ /// Who created the schedule (`user` or `model`). Persisted so a resumed session keeps gating non-user schedules from firing skills that opted out of model invocation. Absent on entries created before this field existed; a missing origin fails closed (treated the same as a non-user origin), so such a schedule may not resolve a `disable-model-invocation` skill.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("origin")]
+ public ScheduleOrigin? Origin { get; set; }
+
/// Prompt text that gets enqueued on every tick.
[JsonPropertyName("prompt")]
public required string Prompt { get; set; }
@@ -2557,7 +2577,7 @@ public sealed partial class UserMessageData
[JsonPropertyName("parentAgentTaskId")]
public string? ParentAgentTaskId { get; set; }
- /// Origin of this message, used for timeline filtering (e.g., "skill-pdf" for skill-injected messages that should be hidden from the user).
+ /// Origin of this message, used for timeline filtering and attribution (e.g., `skill-pdf` for hidden skill injection or `agent-<agent-id>` for an inter-agent prompt).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("source")]
public string? Source { get; set; }
@@ -2648,6 +2668,11 @@ public sealed partial class AssistantReasoningData
/// Unique identifier for this reasoning block.
[JsonPropertyName("reasoningId")]
public required string ReasoningId { get; set; }
+
+ /// Gets or sets the rte value.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("rte")]
+ public bool? Rte { get; set; }
}
/// Streaming reasoning delta for incremental extended thinking updates.
@@ -2773,6 +2798,11 @@ public sealed partial class AssistantMessageData
[JsonPropertyName("requestId")]
public string? RequestId { get; set; }
+ /// Gets or sets the rte value.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("rte")]
+ public bool? Rte { get; set; }
+
/// Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("serverTools")]
@@ -2915,6 +2945,11 @@ public sealed partial class AssistantUsageData
[JsonPropertyName("inputTokens")]
public long? InputTokens { get; set; }
+ /// Coarse classification of the interaction that produced this call, mirroring the session's per-request agent context (e.g. `conversation-agent`, `conversation-subagent`, `conversation-sampling`, `conversation-background`, `conversation-compaction`, `conversation-user`). Non-billing; lets consumers attribute a model call to a call class (e.g. sub-agent/sidekick) independently of the billing initiator. Absent when the runtime did not classify the request.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("interactionType")]
+ public string? InteractionType { get; set; }
+
/// Average inter-token latency in milliseconds. Only available for streaming requests.
[JsonConverter(typeof(MillisecondsTimeSpanConverter))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -2960,6 +2995,11 @@ public sealed partial class AssistantUsageData
[JsonPropertyName("reasoningTokens")]
public long? ReasoningTokens { get; set; }
+ /// Gets or sets the rte value.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("rte")]
+ public bool? Rte { get; set; }
+
/// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("serviceRequestId")]
@@ -3067,6 +3107,11 @@ public sealed partial class ModelCallFailureData
[JsonPropertyName("requestFingerprint")]
public ModelCallFailureRequestFingerprint? RequestFingerprint { get; set; }
+ /// Gets or sets the rte value.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("rte")]
+ public bool? Rte { get; set; }
+
/// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("serviceRequestId")]
@@ -3095,6 +3140,12 @@ public sealed partial class ModelCallStartData
[JsonPropertyName("model")]
public string? Model { get; set; }
+ /// Previous response or interaction identifier included in the model request, when present.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonInclude]
+ [JsonPropertyName("previousResponseId")]
+ internal string? PreviousResponseId { get; set; }
+
/// Identifier of the assistant turn that initiated the model call.
[JsonPropertyName("turnId")]
public required string TurnId { get; set; }
@@ -3162,6 +3213,11 @@ public sealed partial class ToolExecutionStartData
[JsonPropertyName("parentToolCallId")]
public string? ParentToolCallId { get; set; }
+ /// Gets or sets the rte value.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("rte")]
+ public bool? Rte { get; set; }
+
/// Shell-tool path hints derived from the command at start time for shell tools (bash/powershell/local_shell). Produced by the same shell-aware extractor as PermissionRequestShell.possiblePaths, so it is present even when the command is auto-approved and no permission request fires. Absent for non-shell tools.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("shellToolInfo")]
@@ -3253,6 +3309,11 @@ public sealed partial class ToolExecutionCompleteData
[JsonPropertyName("result")]
public ToolExecutionCompleteResult? Result { get; set; }
+ /// Gets or sets the rte value.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("rte")]
+ public bool? Rte { get; set; }
+
/// Whether this tool execution ran inside a sandbox container.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("sandboxed")]
@@ -3567,6 +3628,11 @@ public sealed partial class SystemMessageData
[JsonPropertyName("content")]
public required string Content { get; set; }
+ /// Logical interaction identifier for the model run receiving this prompt.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("interactionId")]
+ public string? InteractionId { get; set; }
+
/// Metadata about the prompt template and its construction.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("metadata")]
@@ -4193,6 +4259,19 @@ public sealed partial class SessionBackgroundTasksChangedData
{
}
+/// Ephemeral invalidation signal for a changed factory run.
+[Experimental(Diagnostics.Experimental)]
+public sealed partial class FactoryRunUpdatedData
+{
+ /// Monotonic revision now available for the run.
+ [JsonPropertyName("revision")]
+ public required long Revision { get; set; }
+
+ /// Gets or sets the runId value.
+ [JsonPropertyName("runId")]
+ public required string RunId { get; set; }
+}
+
/// Payload of `session.skills_loaded` listing resolved skill metadata.
public sealed partial class SessionSkillsLoadedData
{
@@ -7083,6 +7162,16 @@ public partial class PermissionRequest
[Experimental(Diagnostics.Experimental)]
public sealed partial class PermissionAutoApproval
{
+ /// Classified cause of an `error` recommendation. Absent for every other recommendation.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("failureReason")]
+ public AutoApprovalJudgeFailureReason? FailureReason { get; set; }
+
+ /// Model id that produced the recommendation, when the judge was consulted and reported one. Absent for `excluded` (the judge was not consulted) and for failures that occurred before a model was selected.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
+
/// Human-readable reason for the judge's recommendation, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reason")]
@@ -8412,6 +8501,67 @@ public override void Write(Utf8JsonWriter writer, Verbosity value, JsonSerialize
}
}
+/// Who created the schedule: `user` (an explicit user action such as `/every` or `/after`) or `model` (the agent via the `manage_schedule` tool). Gates whether a scheduled skill that opted out of model invocation may fire: only user-created schedules may.
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct ScheduleOrigin : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public ScheduleOrigin(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// The schedule was created by an explicit user action, such as `/every` or `/after`.
+ public static ScheduleOrigin User { get; } = new("user");
+
+ /// The schedule was created by the agent via the `manage_schedule` tool.
+ public static ScheduleOrigin Model { get; } = new("model");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(ScheduleOrigin left, ScheduleOrigin right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(ScheduleOrigin left, ScheduleOrigin right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is ScheduleOrigin other && Equals(other);
+
+ ///
+ public bool Equals(ScheduleOrigin 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 ScheduleOrigin Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, ScheduleOrigin value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ScheduleOrigin));
+ }
+ }
+}
+
/// The type of operation performed on the autopilot objective state file.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
@@ -10414,6 +10564,77 @@ public override void Write(Utf8JsonWriter writer, PermissionRequestMemoryDirecti
}
}
+/// Why the auto-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs.
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct AutoApprovalJudgeFailureReason : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public AutoApprovalJudgeFailureReason(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// The judge model call exceeded its deadline.
+ public static AutoApprovalJudgeFailureReason Timeout { get; } = new("timeout");
+
+ /// The judge model call was cancelled before it returned.
+ public static AutoApprovalJudgeFailureReason Abort { get; } = new("abort");
+
+ /// The judge model call completed but returned no content.
+ public static AutoApprovalJudgeFailureReason EmptyResponse { get; } = new("empty_response");
+
+ /// The judge model call failed (for example a transport, authentication, or rate-limit error).
+ public static AutoApprovalJudgeFailureReason ModelError { get; } = new("model_error");
+
+ /// The judge model replied, but the reply carried no ALLOW/DENY verdict.
+ public static AutoApprovalJudgeFailureReason ParseError { get; } = new("parse_error");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(AutoApprovalJudgeFailureReason left, AutoApprovalJudgeFailureReason right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(AutoApprovalJudgeFailureReason left, AutoApprovalJudgeFailureReason right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is AutoApprovalJudgeFailureReason other && Equals(other);
+
+ ///
+ public bool Equals(AutoApprovalJudgeFailureReason 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 AutoApprovalJudgeFailureReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, AutoApprovalJudgeFailureReason value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AutoApprovalJudgeFailureReason));
+ }
+ }
+}
+
/// Outcome of the auto-approval safety judge for a permission request. Present only when auto mode is enabled; its absence means the judge did not evaluate the request (auto mode was off).
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
@@ -11908,6 +12129,8 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu
[JsonSerializable(typeof(ExternalToolCompletedEvent))]
[JsonSerializable(typeof(ExternalToolRequestedData))]
[JsonSerializable(typeof(ExternalToolRequestedEvent))]
+[JsonSerializable(typeof(FactoryRunUpdatedData))]
+[JsonSerializable(typeof(FactoryRunUpdatedEvent))]
[JsonSerializable(typeof(GitHubRepoRef))]
[JsonSerializable(typeof(HandoffRepository))]
[JsonSerializable(typeof(HeaderEntry))]
diff --git a/dotnet/src/SessionFsProvider.cs b/dotnet/src/SessionFsProvider.cs
index fbb8df507d..d4e99567ca 100644
--- a/dotnet/src/SessionFsProvider.cs
+++ b/dotnet/src/SessionFsProvider.cs
@@ -3,6 +3,7 @@
*--------------------------------------------------------------------------------------------*/
using GitHub.Copilot.Rpc;
+using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
namespace GitHub.Copilot;
@@ -27,6 +28,23 @@ public sealed class SessionFsSqliteResult
public long? LastInsertRowid { get; set; }
}
+///
+/// One statement in an atomic SQLite transaction passed to
+/// .
+///
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionFsSqliteStatement
+{
+ /// How to execute: "exec", "query", or "run".
+ public SessionFsSqliteQueryType QueryType { get; set; }
+
+ /// SQL statement to execute.
+ public string Query { get; set; } = string.Empty;
+
+ /// Optional named bind parameters.
+ public IDictionary? Params { get; set; }
+}
+
///
/// Optional interface for subclasses that support
/// per-session SQLite databases. Implement this interface on your provider to enable
@@ -48,6 +66,20 @@ public interface ISessionFsSqliteProvider
IDictionary? bindParams,
CancellationToken cancellationToken);
+ ///
+ /// Executes atomically against the per-session database.
+ ///
+ /// Statements to execute in order, inside a single transaction.
+ /// Cancellation token.
+ /// One result per statement, in the same order as .
+ ///
+ /// Thrown to tell the runtime how the failure should be classified. Any other exception
+ /// is reported as .
+ ///
+ Task> TransactionAsync(
+ IList statements,
+ CancellationToken cancellationToken);
+
///
/// Checks whether the per-session SQLite database already exists, without creating it.
///
@@ -55,6 +87,32 @@ public interface ISessionFsSqliteProvider
Task ExistsAsync(CancellationToken cancellationToken);
}
+///
+/// Thrown by an to classify a failed SQLite transaction.
+/// guarantees the transaction
+/// rolled back and is safe to retry;
+/// must never be retried.
+///
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionFsSqliteTransactionException : Exception
+{
+ /// Initializes a new instance of the class.
+ /// Human-readable failure description.
+ /// How the runtime should classify the failure.
+ /// Optional underlying exception.
+ public SessionFsSqliteTransactionException(
+ string message,
+ SessionFsSqliteTransactionErrorClass errorClass,
+ Exception? innerException = null)
+ : base(message, innerException)
+ {
+ ErrorClass = errorClass;
+ }
+
+ /// Gets the failure classification reported to the runtime.
+ public SessionFsSqliteTransactionErrorClass ErrorClass { get; }
+}
+
///
/// Base class for session filesystem providers. Subclasses override the
/// virtual methods and use normal C# patterns (return values, throw exceptions).
@@ -309,6 +367,64 @@ async Task ISessionFsHandler.SqliteQueryAsync(Sessio
}
}
+ async Task ISessionFsHandler.SqliteTransactionAsync(SessionFsSqliteTransactionRequest request, CancellationToken cancellationToken)
+ {
+ if (this is not ISessionFsSqliteProvider sqliteProvider)
+ {
+ return new SessionFsSqliteTransactionResult
+ {
+ Error = new SessionFsSqliteTransactionError
+ {
+ ErrorClass = SessionFsSqliteTransactionErrorClass.Fatal,
+ Message = "SQLite is not supported by this provider.",
+ },
+ };
+ }
+
+ IList results;
+ try
+ {
+ var statements = request.Statements.Select(statement => new SessionFsSqliteStatement
+ {
+ QueryType = statement.QueryType,
+ Query = statement.Query,
+ Params = statement.Params?.ToDictionary(kvp => kvp.Key, kvp => JsonElementToValue(kvp.Value)),
+ }).ToList();
+ results = await sqliteProvider.TransactionAsync(statements, cancellationToken).ConfigureAwait(false);
+ }
+ catch (SessionFsSqliteTransactionException ex)
+ {
+ return new SessionFsSqliteTransactionResult
+ {
+ Error = new SessionFsSqliteTransactionError { ErrorClass = ex.ErrorClass, Message = ex.Message },
+ };
+ }
+ catch (Exception ex)
+ {
+ return new SessionFsSqliteTransactionResult
+ {
+ Error = new SessionFsSqliteTransactionError
+ {
+ ErrorClass = SessionFsSqliteTransactionErrorClass.Fatal,
+ Message = ex.Message,
+ },
+ };
+ }
+
+ return new SessionFsSqliteTransactionResult
+ {
+ Results = results.Select(result => new SessionFsSqliteQueryResult
+ {
+ Rows = result.Rows?.Select(row => (IDictionary)row.ToDictionary(
+ kvp => kvp.Key,
+ kvp => CopilotClient.ToJsonElementForWire(kvp.Value)!.Value)).ToList() ?? [],
+ Columns = result.Columns ?? [],
+ RowsAffected = result.RowsAffected,
+ LastInsertRowid = result.LastInsertRowid,
+ }).ToList(),
+ };
+ }
+
async Task ISessionFsHandler.SqliteExistsAsync(SessionFsSqliteExistsRequest request, CancellationToken cancellationToken)
{
if (this is not ISessionFsSqliteProvider sqliteProvider)
diff --git a/dotnet/test/E2E/InMemorySessionFsSqliteHandler.cs b/dotnet/test/E2E/InMemorySessionFsSqliteHandler.cs
index 4e573ff5ca..8a6e81cd60 100644
--- a/dotnet/test/E2E/InMemorySessionFsSqliteHandler.cs
+++ b/dotnet/test/E2E/InMemorySessionFsSqliteHandler.cs
@@ -45,28 +45,68 @@ private SqliteConnection GetOrCreateDb()
string query,
IDictionary? bindParams,
CancellationToken cancellationToken)
+ {
+ return Task.FromResult(RunStatement(GetOrCreateDb(), null, queryType, query, bindParams));
+ }
+
+ public Task> TransactionAsync(
+ IList statements,
+ CancellationToken cancellationToken)
+ {
+ var db = GetOrCreateDb();
+ using var transaction = db.BeginTransaction();
+ try
+ {
+ IList results = statements
+ .Select(statement => RunStatement(db, transaction, statement.QueryType, statement.Query, statement.Params)
+ ?? new SessionFsSqliteResult())
+ .ToList();
+ transaction.Commit();
+ return Task.FromResult(results);
+ }
+ catch (SqliteException ex)
+ {
+ transaction.Rollback();
+ var errorClass = ex.SqliteErrorCode is 5 or 6
+ ? SessionFsSqliteTransactionErrorClass.BusyOrLocked
+ : SessionFsSqliteTransactionErrorClass.Fatal;
+ throw new SessionFsSqliteTransactionException(ex.Message, errorClass, ex);
+ }
+ catch (Exception ex)
+ {
+ transaction.Rollback();
+ throw new SessionFsSqliteTransactionException(ex.Message, SessionFsSqliteTransactionErrorClass.Fatal, ex);
+ }
+ }
+
+ private SessionFsSqliteResult? RunStatement(
+ SqliteConnection db,
+ SqliteTransaction? transaction,
+ SessionFsSqliteQueryType queryType,
+ string query,
+ IDictionary? bindParams)
{
sqliteCalls.Add(new SqliteCall(sessionId, queryType.Value, query));
var trimmed = query.Trim();
if (trimmed.Length == 0)
{
- return Task.FromResult(null);
+ return null;
}
- var db = GetOrCreateDb();
-
if (queryType == SessionFsSqliteQueryType.Exec)
{
using var cmd = db.CreateCommand();
+ cmd.Transaction = transaction;
cmd.CommandText = trimmed;
cmd.ExecuteNonQuery();
- return Task.FromResult(null);
+ return null;
}
if (queryType == SessionFsSqliteQueryType.Query)
{
using var cmd = db.CreateCommand();
+ cmd.Transaction = transaction;
cmd.CommandText = trimmed;
AddParams(cmd, bindParams);
@@ -88,33 +128,35 @@ private SqliteConnection GetOrCreateDb()
rows.Add(row);
}
- return Task.FromResult(new SessionFsSqliteResult
+ return new SessionFsSqliteResult
{
Columns = columns,
Rows = rows,
RowsAffected = 0,
- });
+ };
}
if (queryType == SessionFsSqliteQueryType.Run)
{
using var cmd = db.CreateCommand();
+ cmd.Transaction = transaction;
cmd.CommandText = trimmed;
AddParams(cmd, bindParams);
var rowsAffected = cmd.ExecuteNonQuery();
using var rowidCmd = db.CreateCommand();
+ rowidCmd.Transaction = transaction;
rowidCmd.CommandText = "SELECT last_insert_rowid()";
var lastRowid = rowidCmd.ExecuteScalar();
- return Task.FromResult(new SessionFsSqliteResult
+ return new SessionFsSqliteResult
{
Columns = [],
Rows = [],
RowsAffected = rowsAffected,
LastInsertRowid = lastRowid is long l ? l : null,
- });
+ };
}
throw new ArgumentException($"Unknown queryType: {queryType}");
diff --git a/dotnet/test/E2E/RpcShellAndFleetE2ETests.cs b/dotnet/test/E2E/RpcShellAndFleetE2ETests.cs
index a51fc7daea..13daff67f9 100644
--- a/dotnet/test/E2E/RpcShellAndFleetE2ETests.cs
+++ b/dotnet/test/E2E/RpcShellAndFleetE2ETests.cs
@@ -41,6 +41,8 @@ public async Task Should_Kill_Shell_Process()
var killResult = await session.Rpc.Shell.KillAsync(execResult.ProcessId);
Assert.True(killResult.Killed);
+
+ await session.DisposeAsync();
}
[Fact]
diff --git a/dotnet/test/E2E/SessionFsE2ETests.cs b/dotnet/test/E2E/SessionFsE2ETests.cs
index cf91e3ddc8..b2f93addda 100644
--- a/dotnet/test/E2E/SessionFsE2ETests.cs
+++ b/dotnet/test/E2E/SessionFsE2ETests.cs
@@ -616,6 +616,9 @@ protected override Task RenameAsync(string src, string dest, CancellationToken c
Task ISessionFsSqliteProvider.QueryAsync(SessionFsSqliteQueryType queryType, string query, IDictionary? bindParams, CancellationToken cancellationToken) =>
Task.FromException(exception);
+ Task> ISessionFsSqliteProvider.TransactionAsync(IList statements, CancellationToken cancellationToken) =>
+ Task.FromException>(exception);
+
Task ISessionFsSqliteProvider.ExistsAsync(CancellationToken cancellationToken) =>
Task.FromException(exception);
}
diff --git a/go/internal/e2e/rpc_session_state_e2e_test.go b/go/internal/e2e/rpc_session_state_e2e_test.go
index 00c2e9ef63..4046ab97fe 100644
--- a/go/internal/e2e/rpc_session_state_e2e_test.go
+++ b/go/internal/e2e/rpc_session_state_e2e_test.go
@@ -1083,7 +1083,7 @@ func TestRPCSessionStateE2E(t *testing.T) {
t.Errorf("Expected SetApproveAll(true) to succeed, got %+v", approve)
}
- reset, err := session.RPC.Permissions.ResetSessionApprovals(t.Context())
+ reset, err := session.RPC.Permissions.ResetSessionApprovals(t.Context(), &rpc.PermissionsResetSessionApprovalsRequest{})
if err != nil {
t.Fatalf("Failed to call ResetSessionApprovals: %v", err)
}
diff --git a/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go b/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go
index d7ffd725d7..3a1b7c3620 100644
--- a/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go
+++ b/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go
@@ -81,6 +81,10 @@ func TestRPCShellAndFleetE2E(t *testing.T) {
if !kill.Killed {
t.Errorf("Expected shell.kill to report Killed=true, got %+v", kill)
}
+
+ if err := session.Disconnect(); err != nil {
+ t.Fatalf("Failed to disconnect session: %v", err)
+ }
})
t.Run("should start fleet and complete custom tool task", func(t *testing.T) {
diff --git a/go/internal/e2e/session_fs_sqlite_e2e_test.go b/go/internal/e2e/session_fs_sqlite_e2e_test.go
index fa3b49e488..20cd777834 100644
--- a/go/internal/e2e/session_fs_sqlite_e2e_test.go
+++ b/go/internal/e2e/session_fs_sqlite_e2e_test.go
@@ -198,6 +198,26 @@ func (p *inMemorySqliteProvider) Rename(src string, dest string) error {
func (p *inMemorySqliteProvider) SqliteQuery(queryType rpc.SessionFSSqliteQueryType, query string, params map[string]any) (*copilot.SessionFSSqliteQueryResult, error) {
p.mu.Lock()
defer p.mu.Unlock()
+ return p.runQueryLocked(queryType, query), nil
+}
+
+func (p *inMemorySqliteProvider) SqliteTransaction(statements []rpc.SessionFSSqliteTransactionStatement) ([]copilot.SessionFSSqliteQueryResult, error) {
+ p.mu.Lock()
+ defer p.mu.Unlock()
+ results := make([]copilot.SessionFSSqliteQueryResult, 0, len(statements))
+ for _, statement := range statements {
+ results = append(results, *p.runQueryLocked(statement.QueryType, statement.Query))
+ }
+ return results, nil
+}
+
+// runQueryLocked returns canned results based on query type. The agent doesn't
+// know or care whether a real SQLite database is behind this — it just receives
+// SQL tool results. These stubs return plausible responses so the agent can
+// proceed normally without pulling in a real SQLite dependency.
+//
+// Callers must hold p.mu.
+func (p *inMemorySqliteProvider) runQueryLocked(queryType rpc.SessionFSSqliteQueryType, query string) *copilot.SessionFSSqliteQueryResult {
p.hadQuery = true
*p.sqliteCalls = append(*p.sqliteCalls, sqliteCall{
SessionID: p.sessionID,
@@ -205,14 +225,10 @@ func (p *inMemorySqliteProvider) SqliteQuery(queryType rpc.SessionFSSqliteQueryT
Query: query,
})
- // Return canned results based on query type. The agent doesn't know or care
- // whether a real SQLite database is behind this — it just receives SQL tool
- // results. These stubs return plausible responses so the agent can proceed
- // normally without pulling in a real SQLite dependency.
upper := strings.ToUpper(strings.TrimSpace(query))
switch queryType {
case rpc.SessionFSSqliteQueryTypeExec:
- return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil
+ return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}
case rpc.SessionFSSqliteQueryTypeRun:
lastID := int64(1)
return &copilot.SessionFSSqliteQueryResult{
@@ -220,17 +236,34 @@ func (p *inMemorySqliteProvider) SqliteQuery(queryType rpc.SessionFSSqliteQueryT
Rows: []map[string]any{},
RowsAffected: 1,
LastInsertRowid: &lastID,
- }, nil
+ }
case rpc.SessionFSSqliteQueryTypeQuery:
- if strings.Contains(upper, "SELECT") {
+ // Only the "items" table the test asks the agent to create is modelled
+ // here. The runtime also reads its own bookkeeping tables (for example
+ // inbox_entries) through this provider and deserializes those rows into
+ // typed structs, so returning the canned item row for every SELECT would
+ // make the runtime reject rows it cannot parse.
+ if strings.Contains(upper, "SELECT") && readsTable(upper, "ITEMS") {
return &copilot.SessionFSSqliteQueryResult{
Columns: []string{"id", "name"},
Rows: []map[string]any{{"id": "a1", "name": "Widget"}},
- }, nil
+ }
+ }
+ return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}
+ }
+ return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}
+}
+
+// readsTable reports whether an upper-cased SQL statement selects from the given
+// table, tolerating the quoting styles the agent may emit.
+func readsTable(upperQuery string, table string) bool {
+ names := []string{table, `"` + table + `"`, "`" + table + "`", "[" + table + "]", "MAIN." + table}
+ for _, name := range names {
+ if strings.Contains(upperQuery, "FROM "+name) {
+ return true
}
- return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil
}
- return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil
+ return false
}
func (p *inMemorySqliteProvider) SqliteExists() (bool, error) {
diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go
index 634efbca23..85d26fcbad 100644
--- a/go/rpc/zrpc.go
+++ b/go/rpc/zrpc.go
@@ -999,6 +999,25 @@ func (UserAuthInfo) Type() AuthInfoType {
return AuthInfoTypeUser
}
+// The running runtime's complete catalog of well-known built-in model IDs, including
+// supported models and additional IDs with built-in metadata.
+// Experimental: BuiltInModelCatalog is part of an experimental API and may change or be
+// removed.
+type BuiltInModelCatalog struct {
+ // Built-in model entries.
+ Models []BuiltInModelCatalogEntry `json:"models"`
+}
+
+// A well-known model in the runtime's built-in catalog.
+// Experimental: BuiltInModelCatalogEntry is part of an experimental API and may change or
+// be removed.
+type BuiltInModelCatalogEntry struct {
+ // Well-known runtime model ID suitable for `ProviderConfig.modelId` or
+ // `ProviderModelConfig.modelId`. This is not necessarily the provider-facing deployment or
+ // model name and does not indicate CAPI entitlement or provider availability.
+ ID string `json:"id"`
+}
+
// Cancellation result for a user-requested shell command.
// Experimental: CancelUserRequestedShellCommandResult is part of an experimental API and
// may change or be removed.
@@ -1363,11 +1382,14 @@ type ConnectRemoteSessionParams struct {
type ConnectRequest struct {
// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the
// runtime forwards every internal telemetry event it emits — across all sessions, plus
- // sessionless events — to this connection over the `gitHubTelemetry.event` notification, in
- // addition to the runtime's normal GitHub/CTS emission (dual-write). Intended for
- // first-party hosts that re-emit the events into their own telemetry stores. Both
- // unrestricted and restricted events are forwarded, each tagged with a `restricted`
- // discriminator; a backstop drops restricted events when restricted telemetry is disabled.
+ // sessionless events — to this connection over the `gitHubTelemetry.event` notification.
+ // Regular events are also written to the runtime's normal GitHub/CTS path (dual-write);
+ // host-only compatibility events are forward-only and intentionally skip that path.
+ // Intended for first-party hosts that re-emit the events into their own telemetry stores.
+ // Both unrestricted and restricted events are forwarded, each tagged with a `restricted`
+ // discriminator; a backstop drops restricted events when restricted telemetry is disabled —
+ // using the process-global gate for ordinary events and an explicit session-scoped decision
+ // for host-only events.
EnableGitHubTelemetryForwarding *bool `json:"enableGitHubTelemetryForwarding,omitempty"`
// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN
Token *string `json:"token,omitempty"`
@@ -1385,6 +1407,38 @@ type ConnectResult struct {
Version string `json:"version"`
}
+// Local file system absolute paths within the session working directory to check against
+// its content-exclusion policy.
+// Experimental: ContentExclusionCheckPathsRequest is part of an experimental API and may
+// change or be removed.
+type ContentExclusionCheckPathsRequest struct {
+ // Local file system absolute paths within the session working directory to check. Results
+ // are returned in the same order, including duplicates.
+ Paths []string `json:"paths"`
+}
+
+// Batch content-exclusion result. Callers must fail closed when policy evaluation is
+// unavailable.
+// Experimental: ContentExclusionCheckPathsResult is part of an experimental API and may
+// change or be removed.
+type ContentExclusionCheckPathsResult struct {
+ // Whether the session's policy service was available for the complete batch. When false,
+ // checks is empty and callers must treat every requested path as excluded.
+ Available bool `json:"available"`
+ // Per-path decisions in request order. Empty when available is false.
+ Checks []ContentExclusionPathCheck `json:"checks"`
+}
+
+// Content-exclusion decision for one requested path.
+// Experimental: ContentExclusionPathCheck is part of an experimental API and may change or
+// be removed.
+type ContentExclusionPathCheck struct {
+ // Whether the session's complete content-exclusion policy excludes the path.
+ Excluded bool `json:"excluded"`
+ // The path supplied by the caller.
+ Path string `json:"path"`
+}
+
// A single large message currently in context.
// Experimental: ContextHeaviestMessage is part of an experimental API and may change or be
// removed.
@@ -2246,6 +2300,8 @@ type FactoryAgentOptions struct {
// Experimental: FactoryAgentRequest is part of an experimental API and may change or be
// removed.
type FactoryAgentRequest struct {
+ // Opaque token identifying the current factory execution attempt.
+ ExecutionToken string `json:"executionToken"`
// Factory run identifier that owns the subagent.
FactoryRunID string `json:"factoryRunId"`
// Subagent execution options.
@@ -2262,6 +2318,25 @@ type FactoryAgentResult struct {
Result any `json:"result,omitempty"`
}
+// Prompt-safe durable identity and live status for a direct factory agent.
+// Experimental: FactoryAgentSummary is part of an experimental API and may change or be
+// removed.
+type FactoryAgentSummary struct {
+ ActiveMs int64 `json:"activeMs"`
+ Activity *string `json:"activity,omitempty"`
+ AgentID string `json:"agentId"`
+ AgentType string `json:"agentType"`
+ CompletedAt *int64 `json:"completedAt,omitempty"`
+ Label string `json:"label"`
+ PhaseID *string `json:"phaseId"`
+ RequestedModel *string `json:"requestedModel,omitempty"`
+ ResolvedModel *string `json:"resolvedModel,omitempty"`
+ RunID string `json:"runId"`
+ StartedAt *int64 `json:"startedAt,omitempty"`
+ Status string `json:"status"`
+ ToolCallID string `json:"toolCallId"`
+}
+
// Parameters for cancelling a factory run.
// Experimental: FactoryCancelRequest is part of an experimental API and may change or be
// removed.
@@ -2270,12 +2345,32 @@ type FactoryCancelRequest struct {
RunID string `json:"runId"`
}
+// Current factory phase identity.
+// Experimental: FactoryCurrentPhase is part of an experimental API and may change or be
+// removed.
+type FactoryCurrentPhase struct {
+ ID string `json:"id"`
+ Ordinal *int64 `json:"ordinal"`
+}
+
+// Declared or approved factory resource ceilings.
+// Experimental: FactoryDeclaredLimits is part of an experimental API and may change or be
+// removed.
+type FactoryDeclaredLimits struct {
+ MaxAiCredits *float64 `json:"maxAiCredits,omitempty"`
+ MaxConcurrentSubagents *int64 `json:"maxConcurrentSubagents,omitempty"`
+ MaxTotalSubagents *int64 `json:"maxTotalSubagents,omitempty"`
+ TimeoutSeconds *float64 `json:"timeoutSeconds,omitempty"`
+}
+
// Parameters sent to the owning extension to execute a factory closure.
// Experimental: FactoryExecuteRequest is part of an experimental API and may change or be
// removed.
type FactoryExecuteRequest struct {
// Factory input value.
Args any `json:"args"`
+ // Opaque token identifying this factory execution attempt.
+ ExecutionToken string `json:"executionToken"`
// Registered factory name.
Name string `json:"name"`
// Factory run identifier.
@@ -2289,7 +2384,23 @@ type FactoryExecuteRequest struct {
// removed.
type FactoryExecuteResult struct {
// Factory result value.
- Result any `json:"result"`
+ Result any `json:"result,omitempty"`
+}
+
+// Parameters for paging factory progress.
+// Experimental: FactoryGetRunProgressRequest is part of an experimental API and may change
+// or be removed.
+type FactoryGetRunProgressRequest struct {
+ // Exclusive forward cursor.
+ AfterSeq *int64 `json:"afterSeq,omitempty"`
+ // Exclusive backward cursor.
+ BeforeSeq *int64 `json:"beforeSeq,omitempty"`
+ // Maximum records to return. Defaults to 200 and is capped at 500.
+ Limit *int32 `json:"limit,omitempty"`
+ // Optional phase identifier used to scope records and cursors.
+ PhaseID *string `json:"phaseId,omitempty"`
+ // Factory run identifier.
+ RunID string `json:"runId"`
}
// Parameters for retrieving a factory run.
@@ -2304,6 +2415,8 @@ type FactoryGetRunRequest struct {
// Experimental: FactoryJournalGetRequest is part of an experimental API and may change or
// be removed.
type FactoryJournalGetRequest struct {
+ // Opaque token identifying the current factory execution attempt.
+ ExecutionToken string `json:"executionToken"`
// Namespaced journal key.
Key string `json:"key"`
// Factory run identifier.
@@ -2324,6 +2437,8 @@ type FactoryJournalGetResult struct {
// Experimental: FactoryJournalPutRequest is part of an experimental API and may change or
// be removed.
type FactoryJournalPutRequest struct {
+ // Opaque token identifying the current factory execution attempt.
+ ExecutionToken string `json:"executionToken"`
// Namespaced journal key.
Key string `json:"key"`
// JSON result to memoize.
@@ -2332,6 +2447,19 @@ type FactoryJournalPutRequest struct {
RunID string `json:"runId"`
}
+// Empty parameters for listing factory runs.
+// Experimental: FactoryListRunsRequest is part of an experimental API and may change or be
+// removed.
+type FactoryListRunsRequest struct {
+}
+
+// Factory runs in durable creation order.
+// Experimental: FactoryListRunsResult is part of an experimental API and may change or be
+// removed.
+type FactoryListRunsResult struct {
+ Runs []FactoryRunSummary `json:"runs"`
+}
+
// One ordered factory progress line.
// Experimental: FactoryLogLine is part of an experimental API and may change or be removed.
type FactoryLogLine struct {
@@ -2347,12 +2475,121 @@ type FactoryLogLine struct {
// Experimental: FactoryLogRequest is part of an experimental API and may change or be
// removed.
type FactoryLogRequest struct {
+ // Opaque token identifying the current factory execution attempt.
+ ExecutionToken string `json:"executionToken"`
// Ordered progress lines to append.
Lines []FactoryLogLine `json:"lines"`
// Factory run identifier.
RunID string `json:"runId"`
}
+// Durable lifecycle and timing for one factory phase.
+// Experimental: FactoryPhaseObservation is part of an experimental API and may change or be
+// removed.
+type FactoryPhaseObservation struct {
+ AccumulatedActiveMs int64 `json:"accumulatedActiveMs"`
+ CompletedAt *int64 `json:"completedAt,omitempty"`
+ CurrentActiveMs int64 `json:"currentActiveMs"`
+ Detail *string `json:"detail,omitempty"`
+ EntryCount int64 `json:"entryCount"`
+ ID string `json:"id"`
+ LastEnteredRunAttempt int64 `json:"lastEnteredRunAttempt"`
+ LiveAgentCount int64 `json:"liveAgentCount"`
+ Ordinal *int64 `json:"ordinal"`
+ StartedAt *int64 `json:"startedAt,omitempty"`
+ Status FactoryPhaseStatus `json:"status"`
+ Title string `json:"title"`
+ TotalAgentCount int64 `json:"totalAgentCount"`
+}
+
+// One durable factory progress record.
+// Experimental: FactoryProgressLine is part of an experimental API and may change or be
+// removed.
+type FactoryProgressLine struct {
+ // Resume attempt that emitted this record.
+ Attempt int64 `json:"attempt"`
+ // Progress record kind.
+ Kind FactoryLogLineKind `json:"kind"`
+ // Phase active when the record was emitted, or null before any phase.
+ PhaseID *string `json:"phaseId"`
+ // Epoch milliseconds when the record was persisted.
+ RecordedAt int64 `json:"recordedAt"`
+ // Global monotonic sequence number within the run.
+ Seq int64 `json:"seq"`
+ // Prompt-safe progress text.
+ Text string `json:"text"`
+}
+
+// A bidirectional page of factory progress.
+// Experimental: FactoryProgressPage is part of an experimental API and may change or be
+// removed.
+type FactoryProgressPage struct {
+ HasMoreNewer bool `json:"hasMoreNewer"`
+ HasMoreOlder bool `json:"hasMoreOlder"`
+ NewestSeq *int64 `json:"newestSeq"`
+ OldestSeq *int64 `json:"oldestSeq"`
+ Records []FactoryProgressLine `json:"records"`
+ // Run revision reflected by this page.
+ Revision int64 `json:"revision"`
+}
+
+// Parameters for resuming a factory run from its persisted identity.
+// Experimental: FactoryResumeRequest is part of an experimental API and may change or be
+// removed.
+type FactoryResumeRequest struct {
+ // Optional per-invocation resource ceiling overrides.
+ Limits *FactoryRunLimits `json:"limits,omitempty"`
+ // Factory run identifier.
+ RunID string `json:"runId"`
+}
+
+// Resolved persisted factory identity and resumed run envelope.
+// Experimental: FactoryResumeResult is part of an experimental API and may change or be
+// removed.
+type FactoryResumeResult struct {
+ // Persisted factory name resolved for the resumed run.
+ FactoryName string `json:"factoryName"`
+ // Terminal resumed run envelope.
+ Run FactoryRunResult `json:"run"`
+}
+
+// Durable factory resource consumption.
+// Experimental: FactoryRunConsumed is part of an experimental API and may change or be
+// removed.
+type FactoryRunConsumed struct {
+ ActiveMs int64 `json:"activeMs"`
+ NanoAiu int64 `json:"nanoAiu"`
+ Subagents int64 `json:"subagents"`
+}
+
+// Full factory run observability detail.
+// Experimental: FactoryRunDetail is part of an experimental API and may change or be
+// removed.
+type FactoryRunDetail struct {
+ ActiveSegmentStartedAt *int64 `json:"activeSegmentStartedAt"`
+ Agents []FactoryAgentSummary `json:"agents"`
+ Approved *FactoryDeclaredLimits `json:"approved"`
+ CompletedAt *int64 `json:"completedAt"`
+ Consumed FactoryRunConsumed `json:"consumed"`
+ CreatedAt int64 `json:"createdAt"`
+ CurrentPhase *FactoryCurrentPhase `json:"currentPhase"`
+ DeclaredLimits FactoryDeclaredLimits `json:"declaredLimits"`
+ DeclaredPhaseCount int64 `json:"declaredPhaseCount"`
+ Description string `json:"description"`
+ FactoryName string `json:"factoryName"`
+ LiveAgentCount int64 `json:"liveAgentCount"`
+ ObservedAt int64 `json:"observedAt"`
+ Phases []FactoryPhaseObservation `json:"phases"`
+ Progress FactoryProgressPage `json:"progress"`
+ Revision int64 `json:"revision"`
+ RunID string `json:"runId"`
+ StartedAt *int64 `json:"startedAt"`
+ Status FactoryRunStatus `json:"status"`
+ Terminal *FactoryRunTerminal `json:"terminal"`
+ TotalSpawnedAgentCount int64 `json:"totalSpawnedAgentCount"`
+ UpdatedAt int64 `json:"updatedAt"`
+}
+
// Machine-readable factory run failure.
// Experimental: FactoryRunFailure is part of an experimental API and may change or be
// removed.
@@ -2371,6 +2608,20 @@ func (r RawFactoryRunFailureData) Type() FactoryRunFailureType {
return r.Discriminator
}
+type FactoryRunFailureFactoryDurableFailure struct {
+ // Stable failure code.
+ Code string `json:"code"`
+ // Execution-critical durable operation that failed.
+ Operation FactoryDurableOperation `json:"operation"`
+ // Factory run identifier.
+ RunID string `json:"runId"`
+}
+
+func (FactoryRunFailureFactoryDurableFailure) factoryRunFailure() {}
+func (FactoryRunFailureFactoryDurableFailure) Type() FactoryRunFailureType {
+ return FactoryRunFailureTypeFactoryDurableFailure
+}
+
type FactoryRunFailureFactoryLimitReached struct {
// Resource ceiling that stopped the run.
Kind FactoryRunFailureKind `json:"kind"`
@@ -2401,12 +2652,17 @@ func (FactoryRunFailureFactoryResumeDeclined) Type() FactoryRunFailureType {
// Experimental: FactoryRunLimits is part of an experimental API and may change or be
// removed.
type FactoryRunLimits struct {
+ // Maximum AI credits consumed by factory subagents and their descendants. The post-paid
+ // ceiling is soft: parallel turns can settle beyond it before the run stops.
+ MaxAiCredits *float64 `json:"maxAiCredits,omitempty"`
// Maximum number of factory subagents that may run concurrently.
MaxConcurrentSubagents *int64 `json:"maxConcurrentSubagents,omitempty"`
// Maximum total number of factory subagents that may be admitted.
MaxTotalSubagents *int64 `json:"maxTotalSubagents,omitempty"`
- // Factory active-run timeout in milliseconds.
- Timeout *float64 `json:"timeout,omitempty"`
+ // Maximum accumulated active-execution time in seconds. Active execution includes the
+ // entire extension body, subprocess waits, queued-agent waits, and sleeps; time between
+ // resumed attempts is not counted.
+ TimeoutSeconds *float64 `json:"timeoutSeconds,omitempty"`
}
// Parameters for invoking a registered factory.
@@ -2441,6 +2697,41 @@ type FactoryRunResult struct {
Status FactoryRunStatus `json:"status"`
}
+// Durable factory run summary with read-time live overlays.
+// Experimental: FactoryRunSummary is part of an experimental API and may change or be
+// removed.
+type FactoryRunSummary struct {
+ ActiveSegmentStartedAt *int64 `json:"activeSegmentStartedAt"`
+ Approved *FactoryDeclaredLimits `json:"approved"`
+ CompletedAt *int64 `json:"completedAt"`
+ Consumed FactoryRunConsumed `json:"consumed"`
+ CreatedAt int64 `json:"createdAt"`
+ CurrentPhase *FactoryCurrentPhase `json:"currentPhase"`
+ DeclaredLimits FactoryDeclaredLimits `json:"declaredLimits"`
+ DeclaredPhaseCount int64 `json:"declaredPhaseCount"`
+ Description string `json:"description"`
+ FactoryName string `json:"factoryName"`
+ LiveAgentCount int64 `json:"liveAgentCount"`
+ ObservedAt int64 `json:"observedAt"`
+ Revision int64 `json:"revision"`
+ RunID string `json:"runId"`
+ StartedAt *int64 `json:"startedAt"`
+ Status FactoryRunStatus `json:"status"`
+ Terminal *FactoryRunTerminal `json:"terminal"`
+ TotalSpawnedAgentCount int64 `json:"totalSpawnedAgentCount"`
+ UpdatedAt int64 `json:"updatedAt"`
+}
+
+// Prompt-safe terminal factory outcome.
+// Experimental: FactoryRunTerminal is part of an experimental API and may change or be
+// removed.
+type FactoryRunTerminal struct {
+ Error *string `json:"error,omitempty"`
+ Failure FactoryRunFailure `json:"failure,omitempty"`
+ Reason *string `json:"reason,omitempty"`
+ ResultPreview *string `json:"resultPreview,omitempty"`
+}
+
// Content filtering mode to apply to all tools, or a map of tool name to content filtering
// mode.
// Experimental: FilterMapping is part of an experimental API and may change or be removed.
@@ -2665,6 +2956,141 @@ type HistoryCompactResult struct {
TokensRemoved int64 `json:"tokensRemoved"`
}
+// Rewind points and file-change-tracking availability for the session.
+// Experimental: HistoryListRewindPointsResult is part of an experimental API and may change
+// or be removed.
+type HistoryListRewindPointsResult struct {
+ // Whether this session captured file changes from its first turn.
+ FileChangeTrackingEnabled bool `json:"fileChangeTrackingEnabled"`
+ // Root user turns in chronological order. Empty when `unavailableReason` is set.
+ Points []HistoryRewindPoint `json:"points"`
+ // Why the listed points could not be produced, when applicable; the points list is empty
+ // whenever it is set. `unsupported-remote-session` is permanent for the session and comes
+ // with `fileChangeTrackingEnabled: false`. `session-busy` is transient and only ever
+ // reported by a session that *is* tracking (`fileChangeTrackingEnabled: true`), because the
+ // file-change captures cannot be read while work that may still mutate them is in flight;
+ // the same request succeeds once the session settles, so a client that wants points should
+ // retry rather than treat it as a failure. It is never `file-change-tracking-disabled`: an
+ // untracked local session still lists conversation-only points and reports that through
+ // `fileChangeTrackingEnabled: false`.
+ UnavailableReason *HistoryRewindUnavailableReason `json:"unavailableReason,omitempty"`
+}
+
+// Event boundary to preview for conversation-and-files rewind.
+// Experimental: HistoryPreviewRewindRequest is part of an experimental API and may change
+// or be removed.
+type HistoryPreviewRewindRequest struct {
+ // ID of the user.message event that begins the discarded suffix.
+ EventID string `json:"eventId"`
+}
+
+// Files and aggregate changes for a prospective rewind.
+// Experimental: HistoryPreviewRewindResult is part of an experimental API and may change or
+// be removed.
+type HistoryPreviewRewindResult struct {
+ // Whether file restore is available for this session. This is authoritative: switch on it
+ // and read `reason` only when it is false.
+ Available bool `json:"available"`
+ // Number of unique files in the preview.
+ FileCount int64 `json:"fileCount"`
+ // Files ordered by path.
+ Files []HistoryRewindFilePreview `json:"files"`
+ // Why file restore is unavailable, when applicable. Populated only when `available` is
+ // false and never set when `available` is true.
+ Reason *HistoryRewindUnavailableReason `json:"reason,omitempty"`
+}
+
+// A file that a conversation-and-files rewind would restore.
+// Experimental: HistoryRewindFilePreview is part of an experimental API and may change or
+// be removed.
+type HistoryRewindFilePreview struct {
+ // Aggregate change made across the discarded turns.
+ ChangeType HistoryRewindChangeType `json:"changeType"`
+ // Lines added across the discarded turns.
+ LinesAdded int64 `json:"linesAdded"`
+ // Lines removed across the discarded turns.
+ LinesRemoved int64 `json:"linesRemoved"`
+ // Absolute path of the captured file.
+ Path string `json:"path"`
+}
+
+// A root user turn that the session can rewind to.
+// Experimental: HistoryRewindPoint is part of an experimental API and may change or be
+// removed.
+type HistoryRewindPoint struct {
+ // Whether at least one file in this turn or a later turn can be restored.
+ CanRestoreFiles bool `json:"canRestoreFiles"`
+ // ID of the user.message event that begins the discarded suffix.
+ EventID string `json:"eventId"`
+ // Number of unique files in this turn and all later turns that have captured changes.
+ FileCount int64 `json:"fileCount"`
+ // Whether this turn was an automatically injected autopilot continuation.
+ IsAutopilotContinuation bool `json:"isAutopilotContinuation"`
+ // Lines added by this turn's captured file changes.
+ LinesAdded int64 `json:"linesAdded"`
+ // Lines removed by this turn's captured file changes.
+ LinesRemoved int64 `json:"linesRemoved"`
+ // ISO timestamp of the user turn.
+ Timestamp string `json:"timestamp"`
+ // Whether this turn itself captured any file changes.
+ TurnChangedFiles bool `json:"turnChangedFiles"`
+ // User-visible message text for the turn.
+ UserMessage string `json:"userMessage"`
+}
+
+// Boundary and mode for rewinding session history.
+// Experimental: HistoryRewindRequest is part of an experimental API and may change or be
+// removed.
+type HistoryRewindRequest struct {
+ // ID of the user.message event that begins the discarded suffix.
+ EventID string `json:"eventId"`
+ // Whether to rewind only conversation history or also restore captured files.
+ Mode HistoryRewindMode `json:"mode"`
+}
+
+// Structured outcome of a rewind request.
+// Experimental: HistoryRewindResult is part of an experimental API and may change or be
+// removed.
+type HistoryRewindResult struct {
+ // Failure detail. Set only for the failure and partial-failure outcomes
+ // (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`,
+ // `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the
+ // unavailable outcomes (`session-busy`, `file-change-tracking-disabled`,
+ // `unsupported-remote-session`).
+ Error *string `json:"error,omitempty"`
+ // Number of persisted events removed by conversation truncation. Present only when
+ // truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and
+ // `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`,
+ // `file-change-tracking-disabled`, `unsupported-remote-session`) and for
+ // `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`.
+ EventsRemoved *int64 `json:"eventsRemoved,omitempty"`
+ // Overall rewind outcome. This discriminates the result: it governs which of the remaining
+ // fields are populated, so consumers must switch on it before reading `eventsRemoved`,
+ // `restoredFiles`, `skippedFiles`, or `error`. See each field for the outcomes that
+ // populate it.
+ Outcome HistoryRewindOutcome `json:"outcome"`
+ // Absolute paths restored to their captured preimages. Always empty for conversation-only
+ // rewinds and for the unavailable outcomes (`session-busy`,
+ // `file-change-tracking-disabled`, `unsupported-remote-session`); only
+ // conversation-and-files outcomes that reached the file-restore stage populate it.
+ RestoredFiles []string `json:"restoredFiles"`
+ // Captured files intentionally left unchanged. Always empty for conversation-only rewinds
+ // and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`,
+ // `unsupported-remote-session`); only conversation-and-files outcomes that reached the
+ // file-restore stage populate it.
+ SkippedFiles []HistorySkippedFileRestore `json:"skippedFiles"`
+}
+
+// A captured file that rewind intentionally left unchanged.
+// Experimental: HistorySkippedFileRestore is part of an experimental API and may change or
+// be removed.
+type HistorySkippedFileRestore struct {
+ // Absolute path of the skipped file.
+ Path string `json:"path"`
+ // Reason the file was not restored.
+ Reason HistoryFileRestoreSkipReason `json:"reason"`
+}
+
// Markdown summary of the conversation context (empty when not available).
// Experimental: HistorySummarizeForHandoffResult is part of an experimental API and may
// change or be removed.
@@ -2686,6 +3112,12 @@ type HistoryTruncateRequest struct {
// Experimental: HistoryTruncateResult is part of an experimental API and may change or be
// removed.
type HistoryTruncateResult struct {
+ // Failure detail when checkpointCleanupFailed is true.
+ CheckpointCleanupError *string `json:"checkpointCleanupError,omitempty"`
+ // True when conversation truncation succeeded but post-truncation workspace checkpoint
+ // cleanup failed. History is already truncated; callers may still prune snapshots but
+ // should report a checkpoint-cleanup rather than a truncation failure.
+ CheckpointCleanupFailed *bool `json:"checkpointCleanupFailed,omitempty"`
// Number of events that were removed
EventsRemoved int64 `json:"eventsRemoved"`
}
@@ -2759,14 +3191,16 @@ type InstalledPluginSource struct {
String *string
}
-// Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref,
-// and optional subpath.
+// Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref or
+// full commit SHA, and optional subpath.
// Experimental: InstalledPluginSourceGitHub is part of an experimental API and may change
// or be removed.
type InstalledPluginSourceGitHub struct {
Path *string `json:"path,omitempty"`
Ref *string `json:"ref,omitempty"`
Repo string `json:"repo"`
+ // Optional full 40-character hexadecimal commit SHA.
+ Sha *string `json:"sha,omitempty"`
// Constant value. Always "github".
Source InstalledPluginSourceGitHubSource `json:"source"`
}
@@ -2780,13 +3214,15 @@ type InstalledPluginSourceLocal struct {
Source InstalledPluginSourceLocalSource `json:"source"`
}
-// Source descriptor for a direct URL plugin install, with URL, optional ref, and optional
-// subpath.
+// Source descriptor for a direct URL plugin install, with URL, optional ref or full commit
+// SHA, and optional subpath.
// Experimental: InstalledPluginSourceURL is part of an experimental API and may change or
// be removed.
type InstalledPluginSourceURL struct {
Path *string `json:"path,omitempty"`
Ref *string `json:"ref,omitempty"`
+ // Optional full 40-character hexadecimal commit SHA.
+ Sha *string `json:"sha,omitempty"`
// Constant value. Always "url".
Source InstalledPluginSourceURLSource `json:"source"`
URL string `json:"url"`
@@ -2883,6 +3319,25 @@ type InstructionSource struct {
Type InstructionSourceType `json:"type"`
}
+// Parameters for interrupting the main agent turn.
+// Experimental: InterruptMainTurnRequest is part of an experimental API and may change or
+// be removed.
+type InterruptMainTurnRequest struct {
+ // When true, the user's queued prompts are preserved and run as the next turn once the
+ // interrupted turn unwinds; when false (the default), the queue is cleared like a plain
+ // abort.
+ FlushQueued *bool `json:"flushQueued,omitempty"`
+}
+
+// Result of interrupting the main agent turn.
+// Experimental: InterruptMainTurnResult is part of an experimental API and may change or be
+// removed.
+type InterruptMainTurnResult struct {
+ // Whether an in-flight main agent turn was interrupted. False when the main loop was not
+ // processing.
+ Interrupted bool `json:"interrupted"`
+}
+
// 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
@@ -3805,6 +4260,23 @@ func (MCPOauthPendingRequestResponseToken) Kind() MCPOauthPendingRequestResponse
return MCPOauthPendingRequestResponseKindToken
}
+// Pending MCP OAuth request id to respond to.
+// Experimental: MCPOauthRespondRequest is part of an experimental API and may change or be
+// removed.
+type MCPOauthRespondRequest struct {
+ // OAuth request identifier from the mcp.oauth_required event
+ RequestID string `json:"requestId"`
+}
+
+// Indicates whether the pending MCP OAuth response was accepted.
+// Experimental: MCPOauthRespondResult is part of an experimental API and may change or be
+// removed.
+type MCPOauthRespondResult struct {
+ // Whether the response was accepted. False if the request was unknown, timed out, or
+ // already resolved.
+ Success bool `json:"success"`
+}
+
// Registration parameters for an external MCP client.
// Experimental: MCPRegisterExternalClientRequest is part of an experimental API and may
// change or be removed.
@@ -4095,6 +4567,9 @@ type MCPServerConfigHTTP struct {
// Controls if tools provided by this server can be loaded on demand via tool search (auto)
// or always included in the initial tool list (never)
DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"`
+ // Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery
+ // is unaffected.
+ DisableToolCache *bool `json:"disableToolCache,omitempty"`
// Content filtering mode to apply to all tools, or a map of tool name to content filtering
// mode.
FilterMapping FilterMapping `json:"filterMapping,omitempty"`
@@ -4138,6 +4613,9 @@ type MCPServerConfigStdio struct {
// Controls if tools provided by this server can be loaded on demand via tool search (auto)
// or always included in the initial tool list (never)
DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"`
+ // Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery
+ // is unaffected.
+ DisableToolCache *bool `json:"disableToolCache,omitempty"`
// Environment variables to pass to the Stdio MCP server process.
Env map[string]string `json:"env,omitzero"`
// Content filtering mode to apply to all tools, or a map of tool name to content filtering
@@ -4203,12 +4681,14 @@ type MCPSetEnvValueModeResult struct {
Mode MCPSetEnvValueModeDetails `json:"mode"`
}
-// Server name and configuration for an individual MCP server start.
+// Server name and optional configuration for an individual MCP server start. Omit `config`
+// for a config-free start-by-name of an already-configured server.
// Experimental: MCPStartServerRequest is part of an experimental API and may change or be
// removed.
type MCPStartServerRequest struct {
- // MCP server configuration (stdio process or remote HTTP/SSE)
- Config MCPServerConfig `json:"config"`
+ // MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server
+ // with its already-registered configuration (config-free start-by-name).
+ Config MCPServerConfig `json:"config,omitempty"`
// Name of the MCP server to start
ServerName string `json:"serverName"`
}
@@ -5877,10 +6357,12 @@ type PermissionsPathsUpdatePrimaryResult struct {
type PermissionsPendingRequestsRequest struct {
}
-// No parameters; clears all session-scoped tool permission approvals.
+// Clears session-scoped tool permission approvals, and optionally the location-scoped ones.
// Experimental: PermissionsResetSessionApprovalsRequest is part of an experimental API and
// may change or be removed.
type PermissionsResetSessionApprovalsRequest struct {
+ // Whether location-scoped approvals are cleared too. Defaults to `true`.
+ IncludeLocation *bool `json:"includeLocation,omitempty"`
}
// Indicates whether the operation succeeded.
@@ -6812,6 +7294,30 @@ type PushGitHubRepoRef struct {
Owner string `json:"owner"`
}
+// Inputs for starting a deferred-idle drain.
+// Experimental: QueueBeginDeferredIdleDrainRequest is part of an experimental API and may
+// change or be removed.
+type QueueBeginDeferredIdleDrainRequest struct {
+ // Whether the host still has active background work.
+ ActiveBackgroundWork bool `json:"activeBackgroundWork"`
+}
+
+// Whether a deferred-idle drain should run.
+// Experimental: QueueBeginDeferredIdleDrainResult is part of an experimental API and may
+// change or be removed.
+type QueueBeginDeferredIdleDrainResult struct {
+ // True when the host should run finishDeferredIdleDrain asynchronously.
+ ShouldDrain bool `json:"shouldDrain"`
+}
+
+// Internal filter for consuming queued system notifications.
+// Experimental: QueueConsumeSystemNotificationsRequest is part of an experimental API and
+// may change or be removed.
+type QueueConsumeSystemNotificationsRequest struct {
+ // Opaque runtime-owned filter object.
+ Filter any `json:"filter"`
+}
+
// Result of the queued command execution.
// Experimental: QueuedCommandResult is part of an experimental API and may change or be
// removed.
@@ -6847,6 +7353,50 @@ func (QueuedCommandNotHandled) Handled() bool {
return false
}
+// Inputs for marking session.idle deferred in native state.
+// Experimental: QueueDeferSessionIdleRequest is part of an experimental API and may change
+// or be removed.
+type QueueDeferSessionIdleRequest struct {
+ // Whether the deferred idle was caused by an aborted foreground turn.
+ Aborted bool `json:"aborted"`
+}
+
+// Result of enqueueing the resume-pending wake item.
+// Experimental: QueueEnqueueResumePendingResult is part of an experimental API and may
+// change or be removed.
+type QueueEnqueueResumePendingResult struct {
+ // True when a wake item was newly queued.
+ Queued bool `json:"queued"`
+}
+
+// Inputs for completing a deferred-idle drain.
+// Experimental: QueueFinishDeferredIdleDrainRequest is part of an experimental API and may
+// change or be removed.
+type QueueFinishDeferredIdleDrainRequest struct {
+ // Whether the host still has active background work.
+ ActiveBackgroundWork bool `json:"activeBackgroundWork"`
+ // Whether native queued work remains.
+ HasPending bool `json:"hasPending"`
+}
+
+// Action selected by the native deferred-idle drain.
+// Experimental: QueueFinishDeferredIdleDrainResult is part of an experimental API and may
+// change or be removed.
+type QueueFinishDeferredIdleDrainResult struct {
+ // Whether the deferred idle was caused by an aborted foreground turn.
+ Aborted bool `json:"aborted"`
+ // One of none, processQueue, or emitSessionIdle.
+ Action string `json:"action"`
+}
+
+// Whether the native queue has pending work.
+// Experimental: QueueHasPendingResult is part of an experimental API and may change or be
+// removed.
+type QueueHasPendingResult struct {
+ // True when queued or immediate native work is pending.
+ HasPending bool `json:"hasPending"`
+}
+
// User-facing pending queue entry, with kind and display text for a queued message, slash
// command, or model change.
// Experimental: QueuePendingItems is part of an experimental API and may change or be
@@ -6879,6 +7429,20 @@ type QueueRemoveMostRecentResult struct {
Removed bool `json:"removed"`
}
+// Internal snapshot of native queue state for local session orchestration.
+// Experimental: QueueSnapshotResult is part of an experimental API and may change or be
+// removed.
+type QueueSnapshotResult struct {
+ // Insertion orders for queued items, aligned with `items`.
+ ItemOrders []int64 `json:"itemOrders,omitzero"`
+ // User-facing pending items in FIFO order.
+ Items []QueuePendingItems `json:"items"`
+ // Insertion orders for immediate steering messages, aligned with `steeringMessages`.
+ SteeringMessageOrders []int64 `json:"steeringMessageOrders,omitzero"`
+ // Immediate steering messages waiting for an active turn.
+ SteeringMessages []string `json:"steeringMessages"`
+}
+
// Event type to register consumer interest for, used by runtime gating logic.
// Experimental: RegisterEventInterestParams is part of an experimental API and may change
// or be removed.
@@ -7265,6 +7829,70 @@ type SandboxConfigUserPolicySeatbelt struct {
KeychainAccess *bool `json:"keychainAccess,omitempty"`
}
+// Register an absolute-time scheduled prompt.
+// Experimental: ScheduleAddAtRequest is part of an experimental API and may change or be
+// removed.
+type ScheduleAddAtRequest struct {
+ // Epoch milliseconds when the prompt should fire.
+ At int64 `json:"at"`
+ // Optional display-only prompt label.
+ DisplayPrompt *string `json:"displayPrompt,omitempty"`
+ // Prompt text to enqueue when the schedule fires.
+ Prompt string `json:"prompt"`
+ // Whether the schedule should re-arm after each tick. Defaults to false.
+ Recurring *bool `json:"recurring,omitempty"`
+}
+
+// Register a cron scheduled prompt.
+// Experimental: ScheduleAddCronRequest is part of an experimental API and may change or be
+// removed.
+type ScheduleAddCronRequest struct {
+ // 5-field cron expression.
+ Cron string `json:"cron"`
+ // Optional display-only prompt label.
+ DisplayPrompt *string `json:"displayPrompt,omitempty"`
+ // Prompt text to enqueue when the schedule fires.
+ Prompt string `json:"prompt"`
+ // Whether the schedule should re-arm after each tick. Defaults to true.
+ Recurring *bool `json:"recurring,omitempty"`
+ // IANA timezone for evaluating the cron expression.
+ Tz *string `json:"tz,omitempty"`
+}
+
+// Register a relative-interval scheduled prompt.
+// Experimental: ScheduleAddRequest is part of an experimental API and may change or be
+// removed.
+type ScheduleAddRequest struct {
+ // Optional display-only prompt label.
+ DisplayPrompt *string `json:"displayPrompt,omitempty"`
+ // Human-readable interval such as `30s`, `5m`, or `2h`.
+ Interval string `json:"interval"`
+ // Prompt text to enqueue when the schedule fires.
+ Prompt string `json:"prompt"`
+ // Whether the schedule should re-arm after each tick. Defaults to true.
+ Recurring *bool `json:"recurring,omitempty"`
+}
+
+// Result of registering or re-arming a scheduled prompt.
+// Experimental: ScheduleAddResult is part of an experimental API and may change or be
+// removed.
+type ScheduleAddResult struct {
+ // The registered or updated schedule entry.
+ Entry *ScheduleEntry `json:"entry,omitempty"`
+ // User-facing validation error, when registration failed.
+ Error *string `json:"error,omitempty"`
+}
+
+// Register a self-paced scheduled prompt.
+// Experimental: ScheduleAddSelfPacedRequest is part of an experimental API and may change
+// or be removed.
+type ScheduleAddSelfPacedRequest struct {
+ // Optional display-only prompt label.
+ DisplayPrompt *string `json:"displayPrompt,omitempty"`
+ // Prompt text to enqueue when the schedule fires.
+ Prompt string `json:"prompt"`
+}
+
// Scheduled prompt entry with ID, timing (`intervalMs`, `cron`, or `at`), prompt text,
// recurrence, and next run time.
// Experimental: ScheduleEntry is part of an experimental API and may change or be removed.
@@ -7294,6 +7922,14 @@ type ScheduleEntry struct {
Tz *string `json:"tz,omitempty"`
}
+// Whether the session currently has an active self-paced schedule.
+// Experimental: ScheduleHasSelfPacedResult is part of an experimental API and may change or
+// be removed.
+type ScheduleHasSelfPacedResult struct {
+ // True when at least one active schedule is self-paced.
+ HasSelfPaced bool `json:"hasSelfPaced"`
+}
+
// Snapshot of the currently active recurring prompts for this session.
// Experimental: ScheduleList is part of an experimental API and may change or be removed.
type ScheduleList struct {
@@ -7301,6 +7937,16 @@ type ScheduleList struct {
Entries []ScheduleEntry `json:"entries"`
}
+// Re-arm a self-paced scheduled prompt.
+// Experimental: ScheduleRearmSelfPacedRequest is part of an experimental API and may change
+// or be removed.
+type ScheduleRearmSelfPacedRequest struct {
+ // Epoch milliseconds when the prompt should next fire.
+ At int64 `json:"at"`
+ // Id of the self-paced scheduled prompt.
+ ID int64 `json:"id"`
+}
+
// Identifier of the scheduled prompt to remove.
// Experimental: ScheduleStopRequest is part of an experimental API and may change or be
// removed.
@@ -7365,10 +8011,9 @@ type SendMessageItem 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"`
- // Optional provenance tag copied to the resulting user.message event. Must match one of
- // three forms: the literal `system`, `command-` for messages originating from a
- // command (e.g. slash command, Mission Control command), or `schedule-` for
- // messages originating from a scheduled job.
+ // 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.
// Internal: Source is part of the SDK's internal API surface and is not intended for
// external use.
Source *string `json:"source,omitempty"`
@@ -7442,10 +8087,9 @@ 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"`
- // Optional provenance tag copied to the resulting user.message event. Must match one of
- // three forms: the literal `system`, `command-` for messages originating from a
- // command (e.g. slash command, Mission Control command), or `schedule-` for
- // messages originating from a scheduled job.
+ // 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-