diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs
index d09976bc8..8f7a2305c 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; }
@@ -2484,6 +2484,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 +2715,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 +2804,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 +3500,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 +3553,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 +3601,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 +3648,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 +4196,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.
@@ -4119,116 +4221,636 @@ public partial class FactoryRunFailureFactoryLimitReached : FactoryRunFailure
[JsonPropertyName("runId")]
public required string RunId { get; set; }
- /// Approved effective ceiling that was reached.
- [JsonPropertyName("value")]
- public required double Value { get; set; }
+ /// Approved effective ceiling that was reached.
+ [JsonPropertyName("value")]
+ public required double Value { get; set; }
+}
+
+/// The factory_resume_declined variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class FactoryRunFailureFactoryResumeDeclined : FactoryRunFailure
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "factory_resume_declined";
+
+ /// Human-readable reason the resume did not proceed.
+ [JsonPropertyName("reason")]
+ public required string Reason { get; set; }
+
+ /// Factory run identifier whose changed limits were declined.
+ [JsonPropertyName("runId")]
+ 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
+{
+ /// Error message for an errored run.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+
+ /// Machine-readable failure details for an errored run.
+ [JsonPropertyName("failure")]
+ public FactoryRunFailure? Failure { get; set; }
+
+ /// Reason for a halted or cancelled run.
+ [JsonPropertyName("reason")]
+ public string? Reason { get; set; }
+
+ /// Completed factory result.
+ [JsonPropertyName("result")]
+ public JsonElement? Result { get; set; }
+
+ /// Factory run identifier.
+ [JsonPropertyName("runId")]
+ public string RunId { get; set; } = string.Empty;
+
+ /// Partial journal and progress snapshot for a halted, cancelled, or errored run.
+ [JsonPropertyName("snapshot")]
+ public JsonElement? Snapshot { get; set; }
+
+ /// Current or terminal factory run status.
+ [JsonPropertyName("status")]
+ public FactoryRunStatus Status { get; set; }
+}
+
+/// Wire-only per-invocation factory resource ceiling overrides.
+[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; }
+
+ /// Maximum total number of factory subagents that may be admitted.
+ [JsonPropertyName("maxTotalSubagents")]
+ public long? MaxTotalSubagents { 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.
+[Experimental(Diagnostics.Experimental)]
+public sealed class RunOptions
+{
+ /// Per-invocation resource ceiling overrides.
+ [JsonPropertyName("limits")]
+ public FactoryRunLimits? Limits { get; set; }
+
+ /// Run identifier whose journal and progress should seed this resumed run.
+ [JsonPropertyName("resumeFromRunId")]
+ public string? ResumeFromRunId { get; set; }
+}
+
+/// Parameters for invoking a registered factory.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class FactoryRunRequest
+{
+ /// Factory input value.
+ [JsonPropertyName("args")]
+ public JsonElement Args { get; set; }
+
+ /// Registered factory name.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Factory invocation options.
+ [JsonPropertyName("options")]
+ public RunOptions? Options { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Resolved persisted factory identity and resumed run envelope.
+[Experimental(Diagnostics.Experimental)]
+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;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Parameters for retrieving a factory run.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class FactoryGetRunRequest
+{
+ /// Factory run identifier.
+ [JsonPropertyName("runId")]
+ public string RunId { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Declared or approved factory resource ceilings.
+[Experimental(Diagnostics.Experimental)]
+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; }
+}
+
+/// Durable factory resource consumption.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryRunConsumed
+{
+ /// Gets or sets the activeMs value.
+ [JsonPropertyName("activeMs")]
+ public long ActiveMs { get; set; }
+
+ /// Gets or sets the nanoAiu value.
+ [JsonPropertyName("nanoAiu")]
+ public long NanoAiu { get; set; }
+
+ /// Gets or sets the subagents value.
+ [JsonPropertyName("subagents")]
+ public long Subagents { get; set; }
+}
+
+/// Current factory phase identity.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryCurrentPhase
+{
+ /// Gets or sets the id value.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Gets or sets the ordinal value.
+ [JsonPropertyName("ordinal")]
+ public long? Ordinal { get; set; }
+}
+
+/// Prompt-safe terminal factory outcome.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryRunTerminal
+{
+ /// 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; }
+}
+
+/// Durable factory run summary with read-time live overlays.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FactoryRunSummary
+{
+ /// Gets or sets the activeSegmentStartedAt value.
+ [JsonPropertyName("activeSegmentStartedAt")]
+ public long? ActiveSegmentStartedAt { get; 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 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;
}
-/// The factory_resume_declined variant of .
+/// A bidirectional page of factory progress.
[Experimental(Diagnostics.Experimental)]
-public partial class FactoryRunFailureFactoryResumeDeclined : FactoryRunFailure
+public sealed class FactoryProgressPage
{
- ///
- [JsonIgnore]
- public override string Type => "factory_resume_declined";
+ /// Gets or sets the hasMoreNewer value.
+ [JsonPropertyName("hasMoreNewer")]
+ public bool HasMoreNewer { get; set; }
- /// Human-readable reason the resume did not proceed.
- [JsonPropertyName("reason")]
- public required string Reason { get; set; }
+ /// Gets or sets the hasMoreOlder value.
+ [JsonPropertyName("hasMoreOlder")]
+ public bool HasMoreOlder { get; set; }
- /// Factory run identifier whose changed limits were declined.
- [JsonPropertyName("runId")]
- public required string RunId { 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; }
}
-/// Complete current or terminal factory run envelope.
+/// Full factory run observability detail.
[Experimental(Diagnostics.Experimental)]
-public sealed class FactoryRunResult
+public sealed class FactoryRunDetail
{
- /// Error message for an errored run.
- [JsonPropertyName("error")]
- public string? Error { get; set; }
+ /// Gets or sets the activeSegmentStartedAt value.
+ [JsonPropertyName("activeSegmentStartedAt")]
+ public long? ActiveSegmentStartedAt { get; set; }
- /// Machine-readable failure details for an errored run.
- [JsonPropertyName("failure")]
- public FactoryRunFailure? Failure { get; set; }
+ /// Gets or sets the agents value.
+ [JsonPropertyName("agents")]
+ public IList Agents { get => field ??= []; set; }
- /// Reason for a halted or cancelled run.
- [JsonPropertyName("reason")]
- public string? Reason { get; set; }
+ /// Gets or sets the approved value.
+ [JsonPropertyName("approved")]
+ public FactoryDeclaredLimits? Approved { get; set; }
- /// Completed factory result.
- [JsonPropertyName("result")]
- public JsonElement? Result { get; set; }
+ /// Gets or sets the completedAt value.
+ [JsonPropertyName("completedAt")]
+ public long? CompletedAt { get; set; }
- /// Factory run identifier.
+ /// 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;
- /// Partial journal and progress snapshot for a halted, cancelled, or errored run.
- [JsonPropertyName("snapshot")]
- public JsonElement? Snapshot { get; set; }
+ /// Gets or sets the startedAt value.
+ [JsonPropertyName("startedAt")]
+ public long? StartedAt { get; set; }
- /// Current or terminal factory run status.
+ /// Gets or sets the status value.
[JsonPropertyName("status")]
public FactoryRunStatus Status { get; set; }
-}
-
-/// Wire-only per-invocation factory resource ceiling overrides.
-[Experimental(Diagnostics.Experimental)]
-public sealed class FactoryRunLimits
-{
- /// Maximum number of factory subagents that may run concurrently.
- [JsonPropertyName("maxConcurrentSubagents")]
- public long? MaxConcurrentSubagents { get; set; }
-
- /// Maximum total number of factory subagents that may be admitted.
- [JsonPropertyName("maxTotalSubagents")]
- public long? MaxTotalSubagents { get; set; }
- /// Factory active-run timeout in milliseconds.
- [JsonPropertyName("timeout")]
- public double? Timeout { get; set; }
-}
+ /// Gets or sets the terminal value.
+ [JsonPropertyName("terminal")]
+ public FactoryRunTerminal? Terminal { get; set; }
-/// Options controlling factory invocation.
-[Experimental(Diagnostics.Experimental)]
-public sealed class RunOptions
-{
- /// Per-invocation resource ceiling overrides.
- [JsonPropertyName("limits")]
- public FactoryRunLimits? Limits { get; set; }
+ /// Gets or sets the totalSpawnedAgentCount value.
+ [JsonPropertyName("totalSpawnedAgentCount")]
+ public long TotalSpawnedAgentCount { get; set; }
- /// Run identifier whose journal and progress should seed this resumed run.
- [JsonPropertyName("resumeFromRunId")]
- public string? ResumeFromRunId { get; set; }
+ /// Gets or sets the updatedAt value.
+ [JsonPropertyName("updatedAt")]
+ public long UpdatedAt { get; set; }
}
-/// Parameters for invoking a registered factory.
+/// Parameters for paging factory progress.
[Experimental(Diagnostics.Experimental)]
-internal sealed class FactoryRunRequest
+internal sealed class FactoryGetRunProgressRequest
{
- /// Factory input value.
- [JsonPropertyName("args")]
- public JsonElement Args { get; set; }
+ /// Exclusive forward cursor.
+ [JsonPropertyName("afterSeq")]
+ public long? AfterSeq { get; set; }
- /// Registered factory name.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Exclusive backward cursor.
+ [JsonPropertyName("beforeSeq")]
+ public long? BeforeSeq { get; set; }
- /// Factory invocation options.
- [JsonPropertyName("options")]
- public RunOptions? Options { get; set; }
+ /// Maximum records to return. Defaults to 200 and is capped at 500.
+ [JsonPropertyName("limit")]
+ public int? Limit { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Optional phase identifier used to scope records and cursors.
+ [JsonPropertyName("phaseId")]
+ public string? PhaseId { get; set; }
-/// Parameters for retrieving a factory run.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class FactoryGetRunRequest
-{
/// Factory run identifier.
[JsonPropertyName("runId")]
public string RunId { get; set; } = string.Empty;
@@ -4278,6 +4900,10 @@ public sealed class FactoryLogLine
[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; }
@@ -4321,6 +4947,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 +4985,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 +5006,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;
@@ -4895,6 +5533,36 @@ internal sealed class SessionWorkspacesGetWorkspaceRequest
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
@@ -5009,6 +5677,135 @@ internal sealed class WorkspacesReadCheckpointRequest
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 WorkspacesAddSummaryResult
+{
+ /// Gets or sets the summary value.
+ [JsonPropertyName("summary")]
+ public WorkspacesAddSummaryResultSummary? Summary { get; set; }
+
+ /// Gets or sets the workspace value.
+ [JsonPropertyName("workspace")]
+ public WorkspacesAddSummaryResultWorkspace? Workspace { get; set; }
+}
+
+/// Compaction summary checkpoint to persist.
+[Experimental(Diagnostics.Experimental)]
+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;
+
+ /// Summary title shown in checkpoint listings.
+ [JsonPropertyName("title")]
+ public string Title { get; set; } = string.Empty;
+}
+
+/// Rollback point for local workspace summaries.
+[Experimental(Diagnostics.Experimental)]
+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;
+}
+
+/// Autopilot objective file content, or null when missing.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesReadAutopilotObjectiveResult
+{
+ /// Autopilot objective file content, or null when missing.
+ [JsonPropertyName("content")]
+ public string? Content { get; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionWorkspacesReadAutopilotObjectiveRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Result of writing the autopilot objective file.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesWriteAutopilotObjectiveResult
+{
+ /// 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;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Result of deleting the autopilot objective file.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesDeleteAutopilotObjectiveResult
+{
+ /// True when a file was deleted.
+ [JsonPropertyName("deleted")]
+ public bool Deleted { get; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionWorkspacesDeleteAutopilotObjectiveRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Whether the autopilot objective file exists.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesAutopilotObjectiveExistsResult
+{
+ /// True when the objective file exists.
+ [JsonPropertyName("exists")]
+ public bool Exists { get; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionWorkspacesAutopilotObjectiveExistsRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
/// RPC data type for WorkspacesSaveLargePasteResultSaved operations.
public sealed class WorkspacesSaveLargePasteResultSaved
{
@@ -6583,6 +7380,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 +8565,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
@@ -7847,6 +8710,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 +8802,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 +10194,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; }
@@ -11762,6 +12641,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 +12781,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 +13275,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 +13478,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 +13489,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;
@@ -12619,30 +13808,86 @@ public sealed class SessionFsSqliteQueryResult
[JsonPropertyName("rows")]
public IList> Rows { get => field ??= []; set; }
- /// Number of rows affected (for INSERT/UPDATE/DELETE).
- [JsonPropertyName("rowsAffected")]
- public long RowsAffected { get; 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;
+}
+
+/// 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 +16823,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 +16866,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 +17028,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))]
@@ -17658,6 +19062,132 @@ public override void Write(Utf8JsonWriter writer, SessionCapability value, JsonS
}
+/// 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;
+
+ /// Source the script in the built-in Bash shell on macOS and Linux.
+ public static ShellInitScriptShell Bash { get; } = new("bash");
+
+ /// 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 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 ShellInitScriptShell other && Equals(other);
+
+ ///
+ public bool Equals(ShellInitScriptShell 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 ShellInitScriptShell Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, ShellInitScriptShell value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ShellInitScriptShell));
+ }
+ }
+}
+
+
/// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
@@ -19527,52 +21057,118 @@ public override SessionFsReaddirWithTypesEntryType Read(ref Utf8JsonReader reade
///
public override void Write(Utf8JsonWriter writer, SessionFsReaddirWithTypesEntryType value, JsonSerializerOptions options)
{
- GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsReaddirWithTypesEntryType));
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsReaddirWithTypesEntryType));
+ }
+ }
+}
+
+
+/// How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected).
+[Experimental(Diagnostics.Experimental)]
+[JsonConverter(typeof(Converter))]
+[DebuggerDisplay("{Value,nq}")]
+public readonly struct SessionFsSqliteQueryType : IEquatable
+{
+ private readonly string? _value;
+
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
+ [JsonConstructor]
+ public SessionFsSqliteQueryType(string value)
+ {
+ ArgumentException.ThrowIfNullOrWhiteSpace(value);
+ _value = value;
+ }
+
+ /// Gets the value associated with this .
+ public string Value => _value ?? string.Empty;
+
+ /// Execute DDL or multi-statement SQL without returning rows.
+ public static SessionFsSqliteQueryType Exec { get; } = new("exec");
+
+ /// Execute a SELECT-style query and return rows.
+ public static SessionFsSqliteQueryType Query { get; } = new("query");
+
+ /// Execute INSERT, UPDATE, or DELETE SQL and return affected-row metadata.
+ public static SessionFsSqliteQueryType Run { get; } = new("run");
+
+ /// Returns a value indicating whether two instances are equivalent.
+ public static bool operator ==(SessionFsSqliteQueryType left, SessionFsSqliteQueryType right) => left.Equals(right);
+
+ /// Returns a value indicating whether two instances are not equivalent.
+ public static bool operator !=(SessionFsSqliteQueryType left, SessionFsSqliteQueryType right) => !(left == right);
+
+ ///
+ public override bool Equals(object? obj) => obj is SessionFsSqliteQueryType other && Equals(other);
+
+ ///
+ public bool Equals(SessionFsSqliteQueryType 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 SessionFsSqliteQueryType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
+ }
+
+ ///
+ public override void Write(Utf8JsonWriter writer, SessionFsSqliteQueryType value, JsonSerializerOptions options)
+ {
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsSqliteQueryType));
}
}
}
-/// How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected).
+/// SQLite transaction failure classification.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
-public readonly struct SessionFsSqliteQueryType : IEquatable
+public readonly struct SessionFsSqliteTransactionErrorClass : IEquatable
{
private readonly string? _value;
- /// Initializes a new instance of the struct.
- /// The value to associate with this .
+ /// Initializes a new instance of the struct.
+ /// The value to associate with this .
[JsonConstructor]
- public SessionFsSqliteQueryType(string value)
+ public SessionFsSqliteTransactionErrorClass(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
- /// Gets the value associated with this .
+ /// Gets the value associated with this .
public string Value => _value ?? string.Empty;
- /// Execute DDL or multi-statement SQL without returning rows.
- public static SessionFsSqliteQueryType Exec { get; } = new("exec");
+ /// SQLite reported BUSY or LOCKED before commit; the transaction was rolled back and may be retried.
+ public static SessionFsSqliteTransactionErrorClass BusyOrLocked { get; } = new("busyOrLocked");
- /// Execute a SELECT-style query and return rows.
- public static SessionFsSqliteQueryType Query { get; } = new("query");
+ /// The statement, database, or provider failed definitively and must not be retried automatically.
+ public static SessionFsSqliteTransactionErrorClass Fatal { get; } = new("fatal");
- /// Execute INSERT, UPDATE, or DELETE SQL and return affected-row metadata.
- public static SessionFsSqliteQueryType Run { get; } = new("run");
+ /// 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 ==(SessionFsSqliteQueryType left, SessionFsSqliteQueryType right) => left.Equals(right);
+ /// 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 !=(SessionFsSqliteQueryType left, SessionFsSqliteQueryType right) => !(left == 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 SessionFsSqliteQueryType other && Equals(other);
+ public override bool Equals(object? obj) => obj is SessionFsSqliteTransactionErrorClass other && Equals(other);
///
- public bool Equals(SessionFsSqliteQueryType other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase);
+ public bool Equals(SessionFsSqliteTransactionErrorClass other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase);
///
public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value);
@@ -19580,20 +21176,20 @@ public SessionFsSqliteQueryType(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 SessionFsSqliteQueryType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ public override SessionFsSqliteTransactionErrorClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
- public override void Write(Utf8JsonWriter writer, SessionFsSqliteQueryType value, JsonSerializerOptions options)
+ public override void Write(Utf8JsonWriter writer, SessionFsSqliteTransactionErrorClass value, JsonSerializerOptions options)
{
- GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsSqliteQueryType));
+ GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsSqliteTransactionErrorClass));
}
}
}
@@ -19685,7 +21281,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)]
@@ -20569,6 +22165,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 +22289,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.
@@ -21129,7 +22759,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 +22798,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 +22826,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 +23070,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 +23097,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 +23153,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 +23207,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 +23479,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 +23565,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 .
@@ -22521,6 +24352,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,8 +24647,9 @@ 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).
@@ -22828,6 +24673,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 +24687,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);
}
}
@@ -23967,6 +25813,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 +25891,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 +26118,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 +26311,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 +26458,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;
@@ -24638,6 +26686,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 +26788,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")]
@@ -24943,19 +26994,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))]
@@ -24985,6 +27051,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 +27121,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 +27294,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 +27333,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 +27352,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 +27364,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,6 +27395,10 @@ 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))]
@@ -25343,9 +27435,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 +27478,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 +27503,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 +27530,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 +27619,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 +27641,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 a8c70df7c..6cdb895cc 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
@@ -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")]
@@ -3162,6 +3207,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 +3303,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 +3622,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 +4253,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
{
@@ -8412,6 +8485,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}")]
@@ -11908,6 +12042,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 fbb8df507..89c75dc09 100644
--- a/dotnet/src/SessionFsProvider.cs
+++ b/dotnet/src/SessionFsProvider.cs
@@ -309,6 +309,24 @@ async Task ISessionFsHandler.SqliteQueryAsync(Sessio
}
}
+ Task ISessionFsHandler.SqliteTransactionAsync(SessionFsSqliteTransactionRequest request, CancellationToken cancellationToken)
+ {
+ // This SDK's provider interface exposes no atomic-transaction hook, so
+ // the batch is refused outright rather than applied non-atomically.
+ var message = this is ISessionFsSqliteProvider
+ ? "Atomic SQLite transactions are not supported by this SessionFs provider"
+ : "SQLite is not supported by this SessionFs provider";
+
+ return Task.FromResult(new SessionFsSqliteTransactionResult
+ {
+ Error = new SessionFsSqliteTransactionError
+ {
+ ErrorClass = SessionFsSqliteTransactionErrorClass.Fatal,
+ Message = message,
+ },
+ });
+ }
+
async Task ISessionFsHandler.SqliteExistsAsync(SessionFsSqliteExistsRequest request, CancellationToken cancellationToken)
{
if (this is not ISessionFsSqliteProvider sqliteProvider)
diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go
index 634efbca2..6f8e8927a 100644
--- a/go/rpc/zrpc.go
+++ b/go/rpc/zrpc.go
@@ -1363,11 +1363,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"`
@@ -2246,6 +2249,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 +2267,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 +2294,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 +2333,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 +2364,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 +2386,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 +2396,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 +2424,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 +2557,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 +2601,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 +2646,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.
@@ -2759,14 +2999,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 +3022,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 +3127,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 +4068,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.
@@ -6812,6 +7092,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 +7151,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 +7227,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 +7627,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 +7720,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 +7735,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 +7809,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 +7885,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-` 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"`
@@ -7466,6 +7908,18 @@ type SendResult struct {
MessageID string `json:"messageId"`
}
+// Internal request for sending a system notification.
+// Experimental: SendSystemNotificationRequest is part of an experimental API and may change
+// or be removed.
+type SendSystemNotificationRequest struct {
+ // Optional structured notification kind.
+ Kind any `json:"kind,omitempty"`
+ // Notification text to deliver to the model.
+ Message string `json:"message"`
+ // Internal delivery options, including passive policy.
+ Options any `json:"options,omitempty"`
+}
+
// Agents discovered across user, project, plugin, and remote sources.
// Experimental: ServerAgentList is part of an experimental API and may change or be removed.
type ServerAgentList struct {
@@ -7556,6 +8010,11 @@ type SessionBulkDeleteResult struct {
FreedBytes map[string]int64 `json:"freedBytes"`
}
+// The number of running background agents (task-registry agents) that were cancelled.
+// Experimental: SessionCancelAllBackgroundAgentsResult is part of an experimental API and
+// may change or be removed.
+type SessionCancelAllBackgroundAgentsResult int64
+
// Experimental: SessionCanvasCloseResult is part of an experimental API and may change or
// be removed.
type SessionCanvasCloseResult struct {
@@ -7905,7 +8364,7 @@ type SessionFSSqliteExistsResult struct {
}
// SQL query, query type, and optional bind parameters for executing a SQLite query against
-// the per-session database.
+// the per-session database. The provider applies its SQLite busy timeout for every call.
// Experimental: SessionFSSqliteQueryRequest is part of an experimental API and may change
// or be removed.
type SessionFSSqliteQueryRequest struct {
@@ -7937,6 +8396,44 @@ type SessionFSSqliteQueryResult struct {
RowsAffected int64 `json:"rowsAffected"`
}
+// Classified SQLite transaction failure. busyOrLocked guarantees rollback;
+// postCommitAmbiguous must never be retried.
+// Experimental: SessionFSSqliteTransactionError is part of an experimental API and may
+// change or be removed.
+type SessionFSSqliteTransactionError struct {
+ ErrorClass SessionFSSqliteTransactionErrorClass `json:"errorClass"`
+ Message string `json:"message"`
+}
+
+// Statements to execute atomically. Providers apply busy handling for every call.
+// Experimental: SessionFSSqliteTransactionRequest is part of an experimental API and may
+// change or be removed.
+type SessionFSSqliteTransactionRequest struct {
+ // Target session identifier
+ SessionID string `json:"sessionId"`
+ Statements []SessionFSSqliteTransactionStatement `json:"statements"`
+}
+
+// Per-statement results, or a classified transaction error.
+// Experimental: SessionFSSqliteTransactionResult is part of an experimental API and may
+// change or be removed.
+type SessionFSSqliteTransactionResult struct {
+ Error *SessionFSSqliteTransactionError `json:"error,omitempty"`
+ Results []SessionFSSqliteQueryResult `json:"results"`
+}
+
+// One statement in an atomic SQLite transaction.
+// Experimental: SessionFSSqliteTransactionStatement is part of an experimental API and may
+// change or be removed.
+type SessionFSSqliteTransactionStatement struct {
+ // Optional named bind parameters.
+ Params map[string]any `json:"params,omitzero"`
+ // SQL statement to execute.
+ Query string `json:"query"`
+ // How to execute the statement.
+ QueryType SessionFSSqliteQueryType `json:"queryType"`
+}
+
// Path whose metadata should be returned from the client-provided session filesystem.
// Experimental: SessionFSStatRequest is part of an experimental API and may change or be
// removed.
@@ -8010,14 +8507,16 @@ type SessionInstalledPluginSource 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: SessionInstalledPluginSourceGitHub is part of an experimental API and may
// change or be removed.
type SessionInstalledPluginSourceGitHub 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 SessionInstalledPluginSourceGitHubSource `json:"source"`
}
@@ -8031,13 +8530,15 @@ type SessionInstalledPluginSourceLocal struct {
Source SessionInstalledPluginSourceLocalSource `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: SessionInstalledPluginSourceURL is part of an experimental API and may
// change or be removed.
type SessionInstalledPluginSourceURL 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 SessionInstalledPluginSourceURLSource `json:"source"`
URL string `json:"url"`
@@ -8332,6 +8833,8 @@ type SessionOpenOptions struct {
EnvValueMode *SessionOpenOptionsEnvValueMode `json:"envValueMode,omitempty"`
// Override directory for session event logs.
EventsLogDirectory *string `json:"eventsLogDirectory,omitempty"`
+ // Whether subagent callback events should be forwarded into the session event log sink.
+ EventsLogIncludesSubagents *bool `json:"eventsLogIncludesSubagents,omitempty"`
// 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.
@@ -8402,9 +8905,12 @@ type SessionOpenOptions struct {
SessionID *string `json:"sessionId,omitempty"`
// Initial session limits.
SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"`
- // Shell init profile.
+ // Per-session settings for built-in shell tools.
+ Shell *ShellOptions `json:"shell,omitempty"`
+ // Use shell.initProfile instead. Shell init profile.
+ // Deprecated: ShellInitProfile is deprecated.
ShellInitProfile *string `json:"shellInitProfile,omitempty"`
- // Per-shell process flags.
+ // PowerShell process flags applied to built-in and user-requested shell commands.
ShellProcessFlags []string `json:"shellProcessFlags,omitzero"`
// Additional directories to search for skills.
SkillDirectories []string `json:"skillDirectories,omitzero"`
@@ -8676,6 +9182,16 @@ type SessionPruneResult struct {
type SessionQueueClearResult struct {
}
+// Experimental: SessionQueueDeferSessionIdleResult is part of an experimental API and may
+// change or be removed.
+type SessionQueueDeferSessionIdleResult struct {
+}
+
+// Experimental: SessionQueueProcessResult is part of an experimental API and may change or
+// be removed.
+type SessionQueueProcessResult struct {
+}
+
// Experimental: SessionRemoteDisableResult is part of an experimental API and may change or
// be removed.
type SessionRemoteDisableResult struct {
@@ -8706,6 +9222,11 @@ type SessionsCheckInUseResult struct {
InUse []string `json:"inUse"`
}
+// Experimental: SessionScheduleHydrateResult is part of an experimental API and may change
+// or be removed.
+type SessionScheduleHydrateResult struct {
+}
+
// Session ID to close.
// Experimental: SessionsCloseRequest is part of an experimental API and may change or be
// removed.
@@ -8727,6 +9248,26 @@ type SessionsCloseResult struct {
type SessionsConfigureSessionExtensionsResult struct {
}
+// Session ID to delete from disk.
+// Experimental: SessionsDeleteRequest is part of an experimental API and may change or be
+// removed.
+type SessionsDeleteRequest struct {
+ // Session ID to delete
+ SessionID string `json:"sessionId"`
+ // Internal resolved session directory path to delete
+ SessionPath *string `json:"sessionPath,omitempty"`
+}
+
+// Experimental: SessionsDeleteResult is part of an experimental API and may change or be
+// removed.
+type SessionsDeleteResult struct {
+}
+
+// Experimental: SessionSendSystemNotificationResult is part of an experimental API and may
+// change or be removed.
+type SessionSendSystemNotificationResult struct {
+}
+
// Session metadata records to enrich with summary and context information.
// Experimental: SessionsEnrichMetadataRequest is part of an experimental API and may change
// or be removed.
@@ -8976,6 +9517,22 @@ type SessionsGetLastForContextResult struct {
SessionID *string `json:"sessionId,omitempty"`
}
+// Session ID whose persisted metadata should be read.
+// Experimental: SessionsGetMetadataRequest is part of an experimental API and may change or
+// be removed.
+type SessionsGetMetadataRequest struct {
+ // Session ID to inspect
+ SessionID string `json:"sessionId"`
+}
+
+// Persisted local session metadata when the session exists.
+// Experimental: SessionsGetMetadataResult is part of an experimental API and may change or
+// be removed.
+type SessionsGetMetadataResult struct {
+ // Local session metadata, omitted when the session does not exist.
+ Session *LocalSessionMetadataValue `json:"session,omitempty"`
+}
+
// Session ID to look up the persisted remote-steerable flag for.
// Experimental: SessionsGetPersistedRemoteSteerableRequest is part of an experimental API
// and may change or be removed.
@@ -9021,6 +9578,22 @@ type SessionSkillsEnableResult struct {
type SessionSkillsEnsureLoadedResult struct {
}
+// Limit for non-empty local session IDs.
+// Experimental: SessionsListNonEmptySessionIDsRequest is part of an experimental API and
+// may change or be removed.
+type SessionsListNonEmptySessionIDsRequest struct {
+ // Maximum number of session IDs to return.
+ Limit *int64 `json:"limit,omitempty"`
+}
+
+// Recent local session IDs that contain user-visible history.
+// Experimental: SessionsListNonEmptySessionIDsResult is part of an experimental API and may
+// change or be removed.
+type SessionsListNonEmptySessionIDsResult struct {
+ // Session IDs ordered newest-first.
+ SessionIDs []string `json:"sessionIds"`
+}
+
// Optional source filter, metadata-load limit, and context filter applied to the returned
// sessions.
// Experimental: SessionsListRequest is part of an experimental API and may change or be
@@ -9278,6 +9851,8 @@ type SessionUpdateOptionsParams struct {
// Override directory for the session-events log. When unset, the runtime's default events
// log directory is used.
EventsLogDirectory *string `json:"eventsLogDirectory,omitempty"`
+ // Whether subagent callback events should be forwarded into the session event log sink.
+ EventsLogIncludesSubagents *bool `json:"eventsLogIncludesSubagents,omitempty"`
// 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.
@@ -9332,9 +9907,12 @@ type SessionUpdateOptionsParams struct {
SessionCapabilities []SessionCapability `json:"sessionCapabilities,omitzero"`
// Optional session limits. Pass null to clear the session limits.
SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"`
- // Shell init profile (`None` or `NonInteractive`).
+ // Per-session settings for built-in shell tools.
+ Shell *ShellOptions `json:"shell,omitempty"`
+ // Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`).
+ // Deprecated: ShellInitProfile is deprecated.
ShellInitProfile *string `json:"shellInitProfile,omitempty"`
- // Per-shell process flags (e.g., `pwsh` arguments).
+ // PowerShell process flags applied to built-in and user-requested shell commands.
ShellProcessFlags []string `json:"shellProcessFlags,omitzero"`
// Additional directories to search for skills.
SkillDirectories []string `json:"skillDirectories,omitzero"`
@@ -9434,6 +10012,16 @@ type ShellExecuteUserRequestedRequest struct {
RequestID string `json:"requestId"`
}
+// A host-provided script sourced before each built-in shell command when its shell target
+// matches the active shell.
+// Experimental: ShellInitScript is part of an experimental API and may change or be removed.
+type ShellInitScript struct {
+ // Path to the script to source.
+ Path string `json:"path"`
+ // Built-in shell that may source this script.
+ Shell ShellInitScriptShell `json:"shell"`
+}
+
// Identifier of a process previously returned by "shell.exec" and the signal to send.
// Experimental: ShellKillRequest is part of an experimental API and may change or be
// removed.
@@ -9452,6 +10040,34 @@ type ShellKillResult struct {
Killed bool `json:"killed"`
}
+// Per-session settings for built-in shell tools.
+// Experimental: ShellOptions is part of an experimental API and may change or be removed.
+type ShellOptions struct {
+ // Controls automatic non-interactive profile loading where supported. Explicit initScripts
+ // are unaffected.
+ InitProfile *ShellInitProfile `json:"initProfile,omitempty"`
+ // 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.
+ InitScripts []ShellInitScript `json:"initScripts,omitzero"`
+ // 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`.
+ ProcessFlags []string `json:"processFlags,omitzero"`
+}
+
// Parameters for shutting down the session
// Experimental: ShutdownRequest is part of an experimental API and may change or be removed.
type ShutdownRequest struct {
@@ -10497,6 +11113,11 @@ type UIExitPlanModeResponse struct {
Approved bool `json:"approved"`
// Whether subsequent edits should be auto-approved without confirmation.
AutoApproveEdits *bool `json:"autoApproveEdits,omitempty"`
+ // 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.
+ DeferImplementation *bool `json:"deferImplementation,omitempty"`
// Feedback from the user when they declined the plan or requested changes.
Feedback *string `json:"feedback,omitempty"`
// The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true,
@@ -11015,6 +11636,32 @@ type WorkspaceDiffResult struct {
RequestedMode WorkspaceDiffMode `json:"requestedMode"`
}
+// Compaction summary checkpoint to persist.
+// Experimental: WorkspacesAddSummaryRequest is part of an experimental API and may change
+// or be removed.
+type WorkspacesAddSummaryRequest struct {
+ // Markdown summary content to persist.
+ Content string `json:"content"`
+ // Summary title shown in checkpoint listings.
+ Title string `json:"title"`
+}
+
+// Persisted summary metadata and refreshed workspace metadata.
+// Experimental: WorkspacesAddSummaryResult is part of an experimental API and may change or
+// be removed.
+type WorkspacesAddSummaryResult struct {
+ Summary any `json:"summary,omitempty"`
+ Workspace any `json:"workspace,omitempty"`
+}
+
+// Whether the autopilot objective file exists.
+// Experimental: WorkspacesAutopilotObjectiveExistsResult is part of an experimental API and
+// may change or be removed.
+type WorkspacesAutopilotObjectiveExistsResult struct {
+ // True when the objective file exists.
+ Exists bool `json:"exists"`
+}
+
// Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint
// filename.
// Experimental: WorkspacesCheckpoints is part of an experimental API and may change or be
@@ -11038,6 +11685,14 @@ type WorkspacesCreateFileRequest struct {
Path string `json:"path"`
}
+// Result of deleting the autopilot objective file.
+// Experimental: WorkspacesDeleteAutopilotObjectiveResult is part of an experimental API and
+// may change or be removed.
+type WorkspacesDeleteAutopilotObjectiveResult struct {
+ // True when a file was deleted.
+ Deleted bool `json:"deleted"`
+}
+
// Parameters for computing a workspace diff.
// Experimental: WorkspacesDiffRequest is part of an experimental API and may change or be
// removed.
@@ -11048,6 +11703,14 @@ type WorkspacesDiffRequest struct {
Mode WorkspaceDiffMode `json:"mode"`
}
+// Optional session context used when creating a local workspace.
+// Experimental: WorkspacesEnsureRequest is part of an experimental API and may change or be
+// removed.
+type WorkspacesEnsureRequest struct {
+ // Opaque workspace context supplied by the session host.
+ Context any `json:"context,omitempty"`
+}
+
// Current workspace metadata for the session, including its absolute filesystem path when
// available.
// Experimental: WorkspacesGetWorkspaceResult is part of an experimental API and may change
@@ -11097,6 +11760,14 @@ type WorkspacesListFilesResult struct {
Files []string `json:"files"`
}
+// Autopilot objective file content, or null when missing.
+// Experimental: WorkspacesReadAutopilotObjectiveResult is part of an experimental API and
+// may change or be removed.
+type WorkspacesReadAutopilotObjectiveResult struct {
+ // Autopilot objective file content, or null when missing.
+ Content *string `json:"content"`
+}
+
// Checkpoint number to read.
// Experimental: WorkspacesReadCheckpointRequest is part of an experimental API and may
// change or be removed.
@@ -11155,6 +11826,14 @@ type WorkspacesSaveLargePasteResultSaved struct {
SizeBytes int64 `json:"sizeBytes"`
}
+// Rollback point for local workspace summaries.
+// Experimental: WorkspacesTruncateSummariesRequest is part of an experimental API and may
+// change or be removed.
+type WorkspacesTruncateSummariesRequest struct {
+ // Number of newest summaries to keep.
+ KeepCount int64 `json:"keepCount"`
+}
+
// Public-facing projection of workspace metadata for SDK / TUI consumers
// Experimental: WorkspaceSummary is part of an experimental API and may change or be
// removed.
@@ -11181,6 +11860,32 @@ type WorkspaceSummary struct {
UserNamed *bool `json:"user_named,omitempty"`
}
+// Workspace metadata fields to update.
+// Experimental: WorkspacesUpdateMetadataRequest is part of an experimental API and may
+// change or be removed.
+type WorkspacesUpdateMetadataRequest struct {
+ // Opaque workspace context supplied by the session host.
+ Context any `json:"context,omitempty"`
+ // Optional workspace display name override.
+ Name *string `json:"name,omitempty"`
+}
+
+// Autopilot objective file content to persist.
+// Experimental: WorkspacesWriteAutopilotObjectiveRequest is part of an experimental API and
+// may change or be removed.
+type WorkspacesWriteAutopilotObjectiveRequest struct {
+ // Autopilot objective file content.
+ Content string `json:"content"`
+}
+
+// Result of writing the autopilot objective file.
+// Experimental: WorkspacesWriteAutopilotObjectiveResult is part of an experimental API and
+// may change or be removed.
+type WorkspacesWriteAutopilotObjectiveResult struct {
+ // Filesystem operation performed.
+ Operation string `json:"operation"`
+}
+
// Finite reason code describing why the current turn was aborted
// Experimental: AbortReason is part of an experimental API and may change or be removed.
type AbortReason string
@@ -11654,6 +12359,34 @@ const (
ExternalToolTextResultForLlmContentTypeText ExternalToolTextResultForLlmContentType = "text"
)
+// Execution-critical factory storage operation.
+// Experimental: FactoryDurableOperation is part of an experimental API and may change or be
+// removed.
+type FactoryDurableOperation string
+
+const (
+ // Persisting active execution time.
+ FactoryDurableOperationAddElapsed FactoryDurableOperation = "addElapsed"
+ // Persisting an idempotent model-usage charge.
+ FactoryDurableOperationChargeCredit FactoryDurableOperation = "chargeCredit"
+ // Creating the durable run and declared phases.
+ FactoryDurableOperationCreateRun FactoryDurableOperation = "createRun"
+ // Persisting the terminal run envelope.
+ FactoryDurableOperationFinishRun FactoryDurableOperation = "finishRun"
+ // Reading a journal entry without treating storage failure as a cache miss.
+ FactoryDurableOperationJournalGet FactoryDurableOperation = "journalGet"
+ // Persisting a journal entry before reporting success.
+ FactoryDurableOperationJournalPut FactoryDurableOperation = "journalPut"
+ // Persisting the transition to running.
+ FactoryDurableOperationMarkRunStarted FactoryDurableOperation = "markRunStarted"
+ // Reading the authoritative AI-credit total.
+ FactoryDurableOperationReconcileCreditTotal FactoryDurableOperation = "reconcileCreditTotal"
+ // Rolling back an uncommitted subagent admission.
+ FactoryDurableOperationReleaseAgent FactoryDurableOperation = "releaseAgent"
+ // Persisting subagent admission accounting.
+ FactoryDurableOperationReserveAgent FactoryDurableOperation = "reserveAgent"
+)
+
// Kind of factory progress line.
// Experimental: FactoryLogLineKind is part of an experimental API and may change or be
// removed.
@@ -11666,22 +12399,43 @@ const (
FactoryLogLineKindPhase FactoryLogLineKind = "phase"
)
+// Derived lifecycle state of a factory phase.
+// Experimental: FactoryPhaseStatus is part of an experimental API and may change or be
+// removed.
+type FactoryPhaseStatus string
+
+const (
+ // The phase is currently entered and accumulating active time.
+ FactoryPhaseStatusActive FactoryPhaseStatus = "active"
+ // The phase was entered and has since been closed.
+ FactoryPhaseStatusCompleted FactoryPhaseStatus = "completed"
+ // The phase has not been entered yet.
+ FactoryPhaseStatusPending FactoryPhaseStatus = "pending"
+ // The phase was never entered because a later phase was entered or the run reached a
+ // terminal state.
+ FactoryPhaseStatusSkipped FactoryPhaseStatus = "skipped"
+)
+
// Cumulative resource ceiling that stopped a factory run.
// Experimental: FactoryRunFailureKind is part of an experimental API and may change or be
// removed.
type FactoryRunFailureKind string
const (
+ // The run's settled subagent model usage exceeded the approved AI-credit ceiling, or no
+ // headroom remained for another subagent.
+ FactoryRunFailureKindMaxAiCredits FactoryRunFailureKind = "maxAiCredits"
// The run admitted the approved maximum total number of subagents.
FactoryRunFailureKindMaxTotalSubagents FactoryRunFailureKind = "maxTotalSubagents"
- // The run reached the approved timeout deadline.
- FactoryRunFailureKindTimeout FactoryRunFailureKind = "timeout"
+ // The run reached the approved accumulated active-execution time in seconds.
+ FactoryRunFailureKindTimeoutSeconds FactoryRunFailureKind = "timeoutSeconds"
)
// Type discriminator for FactoryRunFailure.
type FactoryRunFailureType string
const (
+ FactoryRunFailureTypeFactoryDurableFailure FactoryRunFailureType = "factory_durable_failure"
FactoryRunFailureTypeFactoryLimitReached FactoryRunFailureType = "factory_limit_reached"
FactoryRunFailureTypeFactoryResumeDeclined FactoryRunFailureType = "factory_resume_declined"
)
@@ -12714,6 +13468,23 @@ const (
SessionFSSqliteQueryTypeRun SessionFSSqliteQueryType = "run"
)
+// SQLite transaction failure classification.
+// Experimental: SessionFSSqliteTransactionErrorClass is part of an experimental API and may
+// change or be removed.
+type SessionFSSqliteTransactionErrorClass string
+
+const (
+ // SQLite reported BUSY or LOCKED before commit; the transaction was rolled back and may be
+ // retried.
+ SessionFSSqliteTransactionErrorClassBusyOrLocked SessionFSSqliteTransactionErrorClass = "busyOrLocked"
+ // The statement, database, or provider failed definitively and must not be retried
+ // automatically.
+ SessionFSSqliteTransactionErrorClassFatal SessionFSSqliteTransactionErrorClass = "fatal"
+ // The transport failed after the provider may have committed; retrying could duplicate
+ // effects.
+ SessionFSSqliteTransactionErrorClassPostCommitAmbiguous SessionFSSqliteTransactionErrorClass = "postCommitAmbiguous"
+)
+
// Constant value. Always "github".
type SessionInstalledPluginSourceGitHubSource string
@@ -12962,6 +13733,32 @@ const (
SessionWorkingDirectoryContextHostTypeGitHub SessionWorkingDirectoryContextHostType = "github"
)
+// Controls automatic non-interactive profile loading where supported. Explicit initScripts
+// are unaffected.
+// Experimental: ShellInitProfile is part of an experimental API and may change or be
+// removed.
+type ShellInitProfile string
+
+const (
+ // Disable automatic non-interactive profile loading. Explicit initScripts still run.
+ ShellInitProfileNone ShellInitProfile = "none"
+ // Allow automatic non-interactive profile loading when supported. Explicit initScripts
+ // still run.
+ ShellInitProfileNonInteractive ShellInitProfile = "non-interactive"
+)
+
+// Supported built-in shells for initialization scripts.
+// Experimental: ShellInitScriptShell is part of an experimental API and may change or be
+// removed.
+type ShellInitScriptShell string
+
+const (
+ // Source the script in the built-in Bash shell on macOS and Linux.
+ ShellInitScriptShellBash ShellInitScriptShell = "bash"
+ // Source the script in the built-in PowerShell shell on Windows.
+ ShellInitScriptShellPowershell ShellInitScriptShell = "powershell"
+)
+
// Signal to send (default: SIGTERM)
// Experimental: ShellKillSignal is part of an experimental API and may change or be removed.
type ShellKillSignal string
@@ -14849,11 +15646,31 @@ func (a *InternalServerSessionsAPI) ConfigureSessionExtensions(ctx context.Conte
return &result, nil
}
-// GetBoardEntryCount gets the dynamic-context board entry count associated with a session,
-// when available. Internal: this exists solely so CLI telemetry events (`rem_spawn_gate`,
-// `rem_consolidation_complete`) can pair START / END board counts around the detached
-// rem-agent spawn. "Dynamic context board" is a runtime-internal concept that is not part
-// of the public SDK contract; the long-term plan is to relocate the telemetry emission into
+// Deletes one local session from disk after running the same lifecycle hooks as the session
+// manager.
+//
+// RPC method: sessions.delete.
+//
+// Parameters: Session ID to delete from disk.
+// Internal: Delete is part of the SDK's internal handshake/plumbing; external callers
+// should not use it.
+func (a *InternalServerSessionsAPI) Delete(ctx context.Context, params *SessionsDeleteRequest) (*SessionsDeleteResult, error) {
+ raw, err := a.client.Request(ctx, "sessions.delete", params)
+ if err != nil {
+ return nil, err
+ }
+ var result SessionsDeleteResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// GetBoardEntryCount gets the dynamic-context board entry count associated with a session,
+// when available. Internal: this exists solely so CLI telemetry events (`rem_spawn_gate`,
+// `rem_consolidation_complete`) can pair START / END board counts around the detached
+// rem-agent spawn. "Dynamic context board" is a runtime-internal concept that is not part
+// of the public SDK contract; the long-term plan is to relocate the telemetry emission into
// the runtime so this method can be deleted entirely.
//
// RPC method: sessions.getBoardEntryCount.
@@ -14900,6 +15717,27 @@ func (a *InternalServerSessionsAPI) GetEventFilePath(ctx context.Context, params
return &result, nil
}
+// GetMetadata reads lightweight persisted metadata for one local session without opening it.
+//
+// RPC method: sessions.getMetadata.
+//
+// Parameters: Session ID whose persisted metadata should be read.
+//
+// Returns: Persisted local session metadata when the session exists.
+// Internal: GetMetadata is part of the SDK's internal handshake/plumbing; external callers
+// should not use it.
+func (a *InternalServerSessionsAPI) GetMetadata(ctx context.Context, params *SessionsGetMetadataRequest) (*SessionsGetMetadataResult, error) {
+ raw, err := a.client.Request(ctx, "sessions.getMetadata", params)
+ if err != nil {
+ return nil, err
+ }
+ var result SessionsGetMetadataResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// GetPersistedRemoteSteerable returns a session's persisted remote-steerable flag, if any
// has been recorded. Internal: this is CLI-specific book-keeping used by `--continue` /
// `--resume` to inherit the prior session's remote-steerable preference. SDK consumers that
@@ -14926,6 +15764,28 @@ func (a *InternalServerSessionsAPI) GetPersistedRemoteSteerable(ctx context.Cont
return &result, nil
}
+// ListNonEmptySessionIds lists recent local session IDs that contain user-visible history,
+// omitting housekeeping-only sessions.
+//
+// RPC method: sessions.listNonEmptySessionIds.
+//
+// Parameters: Limit for non-empty local session IDs.
+//
+// Returns: Recent local session IDs that contain user-visible history.
+// Internal: ListNonEmptySessionIds is part of the SDK's internal handshake/plumbing;
+// external callers should not use it.
+func (a *InternalServerSessionsAPI) ListNonEmptySessionIds(ctx context.Context, params *SessionsListNonEmptySessionIDsRequest) (*SessionsListNonEmptySessionIDsResult, error) {
+ raw, err := a.client.Request(ctx, "sessions.listNonEmptySessionIds", params)
+ if err != nil {
+ return nil, err
+ }
+ var result SessionsListNonEmptySessionIDsResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// RegisterExtensionToolsOnSession registers extension-provided tools on the given session,
// gated by an optional `enabled` callback. Returns an opaque unsubscribe function the
// caller must invoke to deregister the tools when the extension is torn down. Marked
@@ -15703,6 +16563,7 @@ type FactoryAPI sessionAPI
func (a *FactoryAPI) Agent(ctx context.Context, params *FactoryAgentRequest) (*FactoryAgentResult, error) {
req := map[string]any{"sessionId": a.sessionID}
if params != nil {
+ req["executionToken"] = params.ExecutionToken
req["factoryRunId"] = params.FactoryRunID
req["opts"] = params.Opts
req["prompt"] = params.Prompt
@@ -15764,6 +16625,82 @@ func (a *FactoryAPI) GetRun(ctx context.Context, params *FactoryGetRunRequest) (
return &result, nil
}
+// GetRunDetail gets durable and live observability detail for one factory run.
+//
+// RPC method: session.factory.getRunDetail.
+//
+// Parameters: Parameters for retrieving a factory run.
+//
+// Returns: Full factory run observability detail.
+func (a *FactoryAPI) GetRunDetail(ctx context.Context, params *FactoryGetRunRequest) (*FactoryRunDetail, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["runId"] = params.RunID
+ }
+ raw, err := a.client.Request(ctx, "session.factory.getRunDetail", req)
+ if err != nil {
+ return nil, err
+ }
+ var result FactoryRunDetail
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// GetRunProgress pages durable progress for one factory run.
+//
+// RPC method: session.factory.getRunProgress.
+//
+// Parameters: Parameters for paging factory progress.
+//
+// Returns: A bidirectional page of factory progress.
+func (a *FactoryAPI) GetRunProgress(ctx context.Context, params *FactoryGetRunProgressRequest) (*FactoryProgressPage, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ if params.AfterSeq != nil {
+ req["afterSeq"] = *params.AfterSeq
+ }
+ if params.BeforeSeq != nil {
+ req["beforeSeq"] = *params.BeforeSeq
+ }
+ if params.Limit != nil {
+ req["limit"] = *params.Limit
+ }
+ if params.PhaseID != nil {
+ req["phaseId"] = *params.PhaseID
+ }
+ req["runId"] = params.RunID
+ }
+ raw, err := a.client.Request(ctx, "session.factory.getRunProgress", req)
+ if err != nil {
+ return nil, err
+ }
+ var result FactoryProgressPage
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// ListRuns lists durable factory runs for this session in creation order.
+//
+// RPC method: session.factory.listRuns.
+//
+// Returns: Factory runs in durable creation order.
+func (a *FactoryAPI) ListRuns(ctx context.Context) (*FactoryListRunsResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ raw, err := a.client.Request(ctx, "session.factory.listRuns", req)
+ if err != nil {
+ return nil, err
+ }
+ var result FactoryListRunsResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// Log records a batch of ordered factory progress lines.
//
// RPC method: session.factory.log.
@@ -15774,6 +16711,7 @@ func (a *FactoryAPI) GetRun(ctx context.Context, params *FactoryGetRunRequest) (
func (a *FactoryAPI) Log(ctx context.Context, params *FactoryLogRequest) (*FactoryAckResult, error) {
req := map[string]any{"sessionId": a.sessionID}
if params != nil {
+ req["executionToken"] = params.ExecutionToken
req["lines"] = params.Lines
req["runId"] = params.RunID
}
@@ -15788,6 +16726,32 @@ func (a *FactoryAPI) Log(ctx context.Context, params *FactoryLogRequest) (*Facto
return &result, nil
}
+// Resumes a factory run using its persisted name, arguments, journal, and accounting.
+//
+// RPC method: session.factory.resume.
+//
+// Parameters: Parameters for resuming a factory run from its persisted identity.
+//
+// Returns: Resolved persisted factory identity and resumed run envelope.
+func (a *FactoryAPI) Resume(ctx context.Context, params *FactoryResumeRequest) (*FactoryResumeResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ if params.Limits != nil {
+ req["limits"] = *params.Limits
+ }
+ req["runId"] = params.RunID
+ }
+ raw, err := a.client.Request(ctx, "session.factory.resume", req)
+ if err != nil {
+ return nil, err
+ }
+ var result FactoryResumeResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// Runs a registered factory by name at the top level.
//
// RPC method: session.factory.run.
@@ -15828,6 +16792,7 @@ type FactoryJournalAPI sessionAPI
func (a *FactoryJournalAPI) Get(ctx context.Context, params *FactoryJournalGetRequest) (*FactoryJournalGetResult, error) {
req := map[string]any{"sessionId": a.sessionID}
if params != nil {
+ req["executionToken"] = params.ExecutionToken
req["key"] = params.Key
req["runId"] = params.RunID
}
@@ -15852,6 +16817,7 @@ func (a *FactoryJournalAPI) Get(ctx context.Context, params *FactoryJournalGetRe
func (a *FactoryJournalAPI) Put(ctx context.Context, params *FactoryJournalPutRequest) (*FactoryAckResult, error) {
req := map[string]any{"sessionId": a.sessionID}
if params != nil {
+ req["executionToken"] = params.ExecutionToken
req["key"] = params.Key
req["resultJson"] = params.ResultJSON
req["runId"] = params.RunID
@@ -16683,6 +17649,29 @@ func (a *MCPOauthAPI) Login(ctx context.Context, params *MCPOauthLoginRequest) (
return &result, nil
}
+// Responds to a pending MCP OAuth authorization request by its request id.
+//
+// RPC method: session.mcp.oauth.respond.
+//
+// Parameters: Pending MCP OAuth request id to respond to.
+//
+// Returns: Indicates whether the pending MCP OAuth response was accepted.
+func (a *MCPOauthAPI) Respond(ctx context.Context, params *MCPOauthRespondRequest) (*MCPOauthRespondResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["requestId"] = params.RequestID
+ }
+ raw, err := a.client.Request(ctx, "session.mcp.oauth.respond", req)
+ if err != nil {
+ return nil, err
+ }
+ var result MCPOauthRespondResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// Experimental: Oauth returns experimental APIs that may change or be removed.
func (s *MCPAPI) Oauth() *MCPOauthAPI {
return (*MCPOauthAPI)(s)
@@ -17326,6 +18315,9 @@ func (a *OptionsAPI) Update(ctx context.Context, params *SessionUpdateOptionsPar
if params.EventsLogDirectory != nil {
req["eventsLogDirectory"] = *params.EventsLogDirectory
}
+ if params.EventsLogIncludesSubagents != nil {
+ req["eventsLogIncludesSubagents"] = *params.EventsLogIncludesSubagents
+ }
if params.ExcludedBuiltinAgents != nil {
req["excludedBuiltinAgents"] = params.ExcludedBuiltinAgents
}
@@ -17389,6 +18381,9 @@ func (a *OptionsAPI) Update(ctx context.Context, params *SessionUpdateOptionsPar
if params.SessionLimits != nil {
req["sessionLimits"] = *params.SessionLimits
}
+ if params.Shell != nil {
+ req["shell"] = *params.Shell
+ }
if params.ShellInitProfile != nil {
req["shellInitProfile"] = *params.ShellInitProfile
}
@@ -19366,6 +20361,49 @@ func (a *VisibilityAPI) Set(ctx context.Context, params *VisibilitySetRequest) (
// Experimental: WorkspacesAPI contains experimental APIs that may change or be removed.
type WorkspacesAPI sessionAPI
+// AddSummary adds a compaction summary checkpoint to the local session workspace.
+//
+// RPC method: session.workspaces.addSummary.
+//
+// Parameters: Compaction summary checkpoint to persist.
+//
+// Returns: Persisted summary metadata and refreshed workspace metadata.
+func (a *WorkspacesAPI) AddSummary(ctx context.Context, params *WorkspacesAddSummaryRequest) (*WorkspacesAddSummaryResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["content"] = params.Content
+ req["title"] = params.Title
+ }
+ raw, err := a.client.Request(ctx, "session.workspaces.addSummary", req)
+ if err != nil {
+ return nil, err
+ }
+ var result WorkspacesAddSummaryResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// AutopilotObjectiveExists checks whether the local session workspace has an autopilot
+// objective state file.
+//
+// RPC method: session.workspaces.autopilotObjectiveExists.
+//
+// Returns: Whether the autopilot objective file exists.
+func (a *WorkspacesAPI) AutopilotObjectiveExists(ctx context.Context) (*WorkspacesAutopilotObjectiveExistsResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ raw, err := a.client.Request(ctx, "session.workspaces.autopilotObjectiveExists", req)
+ if err != nil {
+ return nil, err
+ }
+ var result WorkspacesAutopilotObjectiveExistsResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// CreateFile creates or overwrites a file in the session workspace files directory.
//
// RPC method: session.workspaces.createFile.
@@ -19388,6 +20426,25 @@ func (a *WorkspacesAPI) CreateFile(ctx context.Context, params *WorkspacesCreate
return &result, nil
}
+// DeleteAutopilotObjective deletes the autopilot objective state file from the local
+// session workspace.
+//
+// RPC method: session.workspaces.deleteAutopilotObjective.
+//
+// Returns: Result of deleting the autopilot objective file.
+func (a *WorkspacesAPI) DeleteAutopilotObjective(ctx context.Context) (*WorkspacesDeleteAutopilotObjectiveResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ raw, err := a.client.Request(ctx, "session.workspaces.deleteAutopilotObjective", req)
+ if err != nil {
+ return nil, err
+ }
+ var result WorkspacesDeleteAutopilotObjectiveResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// Diff computes a diff for the session workspace.
//
// RPC method: session.workspaces.diff.
@@ -19414,6 +20471,32 @@ func (a *WorkspacesAPI) Diff(ctx context.Context, params *WorkspacesDiffRequest)
return &result, nil
}
+// Ensures a local session workspace exists and returns it.
+//
+// RPC method: session.workspaces.ensure.
+//
+// Parameters: Optional session context used when creating a local workspace.
+//
+// Returns: Current workspace metadata for the session, including its absolute filesystem
+// path when available.
+func (a *WorkspacesAPI) Ensure(ctx context.Context, params *WorkspacesEnsureRequest) (*WorkspacesGetWorkspaceResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ if params.Context != nil {
+ req["context"] = params.Context
+ }
+ }
+ raw, err := a.client.Request(ctx, "session.workspaces.ensure", req)
+ if err != nil {
+ return nil, err
+ }
+ var result WorkspacesGetWorkspaceResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// GetWorkspace gets current workspace metadata for the session.
//
// RPC method: session.workspaces.getWorkspace.
@@ -19470,6 +20553,25 @@ func (a *WorkspacesAPI) ListFiles(ctx context.Context) (*WorkspacesListFilesResu
return &result, nil
}
+// ReadAutopilotObjective reads the autopilot objective state file from the local session
+// workspace.
+//
+// RPC method: session.workspaces.readAutopilotObjective.
+//
+// Returns: Autopilot objective file content, or null when missing.
+func (a *WorkspacesAPI) ReadAutopilotObjective(ctx context.Context) (*WorkspacesReadAutopilotObjectiveResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ raw, err := a.client.Request(ctx, "session.workspaces.readAutopilotObjective", req)
+ if err != nil {
+ return nil, err
+ }
+ var result WorkspacesReadAutopilotObjectiveResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// ReadCheckpoint reads the content of a workspace checkpoint by number.
//
// RPC method: session.workspaces.readCheckpoint.
@@ -19540,6 +20642,84 @@ func (a *WorkspacesAPI) SaveLargePaste(ctx context.Context, params *WorkspacesSa
return &result, nil
}
+// TruncateSummaries truncates local workspace compaction summaries after a rollback.
+//
+// RPC method: session.workspaces.truncateSummaries.
+//
+// Parameters: Rollback point for local workspace summaries.
+//
+// Returns: Current workspace metadata for the session, including its absolute filesystem
+// path when available.
+func (a *WorkspacesAPI) TruncateSummaries(ctx context.Context, params *WorkspacesTruncateSummariesRequest) (*WorkspacesGetWorkspaceResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["keepCount"] = params.KeepCount
+ }
+ raw, err := a.client.Request(ctx, "session.workspaces.truncateSummaries", req)
+ if err != nil {
+ return nil, err
+ }
+ var result WorkspacesGetWorkspaceResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// UpdateMetadata updates workspace metadata for a local session and returns the refreshed
+// workspace.
+//
+// RPC method: session.workspaces.updateMetadata.
+//
+// Parameters: Workspace metadata fields to update.
+//
+// Returns: Current workspace metadata for the session, including its absolute filesystem
+// path when available.
+func (a *WorkspacesAPI) UpdateMetadata(ctx context.Context, params *WorkspacesUpdateMetadataRequest) (*WorkspacesGetWorkspaceResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ if params.Context != nil {
+ req["context"] = params.Context
+ }
+ if params.Name != nil {
+ req["name"] = *params.Name
+ }
+ }
+ raw, err := a.client.Request(ctx, "session.workspaces.updateMetadata", req)
+ if err != nil {
+ return nil, err
+ }
+ var result WorkspacesGetWorkspaceResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// WriteAutopilotObjective writes the autopilot objective state file in the local session
+// workspace.
+//
+// RPC method: session.workspaces.writeAutopilotObjective.
+//
+// Parameters: Autopilot objective file content to persist.
+//
+// Returns: Result of writing the autopilot objective file.
+func (a *WorkspacesAPI) WriteAutopilotObjective(ctx context.Context, params *WorkspacesWriteAutopilotObjectiveRequest) (*WorkspacesWriteAutopilotObjectiveResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["content"] = params.Content
+ }
+ raw, err := a.client.Request(ctx, "session.workspaces.writeAutopilotObjective", req)
+ if err != nil {
+ return nil, err
+ }
+ var result WorkspacesWriteAutopilotObjectiveResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// SessionRPC provides typed session-scoped RPC methods.
type SessionRPC struct {
// Reuse a single struct instead of allocating one for each service on the heap.
@@ -19609,6 +20789,58 @@ func (a *SessionRPC) Abort(ctx context.Context, params *AbortRequest) (*AbortRes
return &result, nil
}
+// CancelAllBackgroundAgents cancels every running background agent (task-registry subagents
+// plus sidekick agents) without interrupting the main agent loop. Promoted attached shells
+// are left running.
+//
+// RPC method: session.cancelAllBackgroundAgents.
+//
+// Returns: The number of running background agents (task-registry agents) that were
+// cancelled.
+// Experimental: CancelAllBackgroundAgents is an experimental API and may change or be
+// removed in future versions.
+func (a *SessionRPC) CancelAllBackgroundAgents(ctx context.Context) (*SessionCancelAllBackgroundAgentsResult, error) {
+ req := map[string]any{"sessionId": a.common.sessionID}
+ raw, err := a.common.client.Request(ctx, "session.cancelAllBackgroundAgents", req)
+ if err != nil {
+ return nil, err
+ }
+ var result SessionCancelAllBackgroundAgentsResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// InterruptMainTurn 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.
+//
+// RPC method: session.interruptMainTurn.
+//
+// Parameters: Parameters for interrupting the main agent turn.
+//
+// Returns: Result of interrupting the main agent turn.
+// Experimental: InterruptMainTurn is an experimental API and may change or be removed in
+// future versions.
+func (a *SessionRPC) InterruptMainTurn(ctx context.Context, params *InterruptMainTurnRequest) (*InterruptMainTurnResult, error) {
+ req := map[string]any{"sessionId": a.common.sessionID}
+ if params != nil {
+ if params.FlushQueued != nil {
+ req["flushQueued"] = *params.FlushQueued
+ }
+ }
+ raw, err := a.common.client.Request(ctx, "session.interruptMainTurn", req)
+ if err != nil {
+ return nil, err
+ }
+ var result InterruptMainTurnResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// Log emits a user-visible session log event.
//
// RPC method: session.log.
@@ -19969,6 +21201,385 @@ func (a *InternalMCPAPI) UnregisterExternalClient(ctx context.Context, params *M
return &result, nil
}
+// Experimental: InternalQueueAPI contains experimental APIs that may change or be removed.
+type InternalQueueAPI internalSessionAPI
+
+// BeginDeferredIdleDrain begins a native deferred-idle drain when background work has
+// quiesced.
+//
+// RPC method: session.queue.beginDeferredIdleDrain.
+//
+// Parameters: Inputs for starting a deferred-idle drain.
+//
+// Returns: Whether a deferred-idle drain should run.
+// Internal: BeginDeferredIdleDrain is part of the SDK's internal handshake/plumbing;
+// external callers should not use it.
+func (a *InternalQueueAPI) BeginDeferredIdleDrain(ctx context.Context, params *QueueBeginDeferredIdleDrainRequest) (*QueueBeginDeferredIdleDrainResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["activeBackgroundWork"] = params.ActiveBackgroundWork
+ }
+ raw, err := a.client.Request(ctx, "session.queue.beginDeferredIdleDrain", req)
+ if err != nil {
+ return nil, err
+ }
+ var result QueueBeginDeferredIdleDrainResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// ConsumeSystemNotifications consumes queued native system notifications matching an
+// internal filter.
+//
+// RPC method: session.queue.consumeSystemNotifications.
+//
+// Parameters: Internal filter for consuming queued system notifications.
+//
+// Returns: Indicates whether a user-facing pending item was removed.
+// Internal: ConsumeSystemNotifications is part of the SDK's internal handshake/plumbing;
+// external callers should not use it.
+func (a *InternalQueueAPI) ConsumeSystemNotifications(ctx context.Context, params *QueueConsumeSystemNotificationsRequest) (*QueueRemoveMostRecentResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["filter"] = params.Filter
+ }
+ raw, err := a.client.Request(ctx, "session.queue.consumeSystemNotifications", req)
+ if err != nil {
+ return nil, err
+ }
+ var result QueueRemoveMostRecentResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// DeferSessionIdle marks session.idle as deferred by native background work state.
+//
+// RPC method: session.queue.deferSessionIdle.
+//
+// Parameters: Inputs for marking session.idle deferred in native state.
+// Internal: DeferSessionIdle is part of the SDK's internal handshake/plumbing; external
+// callers should not use it.
+func (a *InternalQueueAPI) DeferSessionIdle(ctx context.Context, params *QueueDeferSessionIdleRequest) (*SessionQueueDeferSessionIdleResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["aborted"] = params.Aborted
+ }
+ raw, err := a.client.Request(ctx, "session.queue.deferSessionIdle", req)
+ if err != nil {
+ return nil, err
+ }
+ var result SessionQueueDeferSessionIdleResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// EnqueueResumePending enqueues the internal resume-pending wake item when orphan handling
+// needs a follow-up turn.
+//
+// RPC method: session.queue.enqueueResumePending.
+//
+// Returns: Result of enqueueing the resume-pending wake item.
+// Internal: EnqueueResumePending is part of the SDK's internal handshake/plumbing; external
+// callers should not use it.
+func (a *InternalQueueAPI) EnqueueResumePending(ctx context.Context) (*QueueEnqueueResumePendingResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ raw, err := a.client.Request(ctx, "session.queue.enqueueResumePending", req)
+ if err != nil {
+ return nil, err
+ }
+ var result QueueEnqueueResumePendingResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// FinishDeferredIdleDrain finishes a native deferred-idle drain and reports whether to
+// drain queue work or emit idle.
+//
+// RPC method: session.queue.finishDeferredIdleDrain.
+//
+// Parameters: Inputs for completing a deferred-idle drain.
+//
+// Returns: Action selected by the native deferred-idle drain.
+// Internal: FinishDeferredIdleDrain is part of the SDK's internal handshake/plumbing;
+// external callers should not use it.
+func (a *InternalQueueAPI) FinishDeferredIdleDrain(ctx context.Context, params *QueueFinishDeferredIdleDrainRequest) (*QueueFinishDeferredIdleDrainResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["activeBackgroundWork"] = params.ActiveBackgroundWork
+ req["hasPending"] = params.HasPending
+ }
+ raw, err := a.client.Request(ctx, "session.queue.finishDeferredIdleDrain", req)
+ if err != nil {
+ return nil, err
+ }
+ var result QueueFinishDeferredIdleDrainResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// HasPending reports whether the local session has native queued work pending.
+//
+// RPC method: session.queue.hasPending.
+//
+// Returns: Whether the native queue has pending work.
+// Internal: HasPending is part of the SDK's internal handshake/plumbing; external callers
+// should not use it.
+func (a *InternalQueueAPI) HasPending(ctx context.Context) (*QueueHasPendingResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ raw, err := a.client.Request(ctx, "session.queue.hasPending", req)
+ if err != nil {
+ return nil, err
+ }
+ var result QueueHasPendingResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// Process drains the native local-session work queue for in-process session orchestration.
+//
+// RPC method: session.queue.process.
+// Internal: Process is part of the SDK's internal handshake/plumbing; external callers
+// should not use it.
+func (a *InternalQueueAPI) Process(ctx context.Context) (*SessionQueueProcessResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ raw, err := a.client.Request(ctx, "session.queue.process", req)
+ if err != nil {
+ return nil, err
+ }
+ var result SessionQueueProcessResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// Snapshot returns the internal native queue snapshot for in-process session orchestration.
+//
+// RPC method: session.queue.snapshot.
+//
+// Returns: Internal snapshot of native queue state for local session orchestration.
+// Internal: Snapshot is part of the SDK's internal handshake/plumbing; external callers
+// should not use it.
+func (a *InternalQueueAPI) Snapshot(ctx context.Context) (*QueueSnapshotResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ raw, err := a.client.Request(ctx, "session.queue.snapshot", req)
+ if err != nil {
+ return nil, err
+ }
+ var result QueueSnapshotResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// Experimental: InternalScheduleAPI contains experimental APIs that may change or be
+// removed.
+type InternalScheduleAPI internalSessionAPI
+
+// Add registers a relative-interval scheduled prompt.
+//
+// RPC method: session.schedule.add.
+//
+// Parameters: Register a relative-interval scheduled prompt.
+//
+// Returns: Result of registering or re-arming a scheduled prompt.
+// Internal: Add is part of the SDK's internal handshake/plumbing; external callers should
+// not use it.
+func (a *InternalScheduleAPI) Add(ctx context.Context, params *ScheduleAddRequest) (*ScheduleAddResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ if params.DisplayPrompt != nil {
+ req["displayPrompt"] = *params.DisplayPrompt
+ }
+ req["interval"] = params.Interval
+ req["prompt"] = params.Prompt
+ if params.Recurring != nil {
+ req["recurring"] = *params.Recurring
+ }
+ }
+ raw, err := a.client.Request(ctx, "session.schedule.add", req)
+ if err != nil {
+ return nil, err
+ }
+ var result ScheduleAddResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// AddAt registers an absolute-time scheduled prompt.
+//
+// RPC method: session.schedule.addAt.
+//
+// Parameters: Register an absolute-time scheduled prompt.
+//
+// Returns: Result of registering or re-arming a scheduled prompt.
+// Internal: AddAt is part of the SDK's internal handshake/plumbing; external callers should
+// not use it.
+func (a *InternalScheduleAPI) AddAt(ctx context.Context, params *ScheduleAddAtRequest) (*ScheduleAddResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["at"] = params.At
+ if params.DisplayPrompt != nil {
+ req["displayPrompt"] = *params.DisplayPrompt
+ }
+ req["prompt"] = params.Prompt
+ if params.Recurring != nil {
+ req["recurring"] = *params.Recurring
+ }
+ }
+ raw, err := a.client.Request(ctx, "session.schedule.addAt", req)
+ if err != nil {
+ return nil, err
+ }
+ var result ScheduleAddResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// AddCron registers a recurring cron scheduled prompt.
+//
+// RPC method: session.schedule.addCron.
+//
+// Parameters: Register a cron scheduled prompt.
+//
+// Returns: Result of registering or re-arming a scheduled prompt.
+// Internal: AddCron is part of the SDK's internal handshake/plumbing; external callers
+// should not use it.
+func (a *InternalScheduleAPI) AddCron(ctx context.Context, params *ScheduleAddCronRequest) (*ScheduleAddResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["cron"] = params.Cron
+ if params.DisplayPrompt != nil {
+ req["displayPrompt"] = *params.DisplayPrompt
+ }
+ req["prompt"] = params.Prompt
+ if params.Recurring != nil {
+ req["recurring"] = *params.Recurring
+ }
+ if params.Tz != nil {
+ req["tz"] = *params.Tz
+ }
+ }
+ raw, err := a.client.Request(ctx, "session.schedule.addCron", req)
+ if err != nil {
+ return nil, err
+ }
+ var result ScheduleAddResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// AddSelfPaced registers a self-paced scheduled prompt.
+//
+// RPC method: session.schedule.addSelfPaced.
+//
+// Parameters: Register a self-paced scheduled prompt.
+//
+// Returns: Result of registering or re-arming a scheduled prompt.
+// Internal: AddSelfPaced is part of the SDK's internal handshake/plumbing; external callers
+// should not use it.
+func (a *InternalScheduleAPI) AddSelfPaced(ctx context.Context, params *ScheduleAddSelfPacedRequest) (*ScheduleAddResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ if params.DisplayPrompt != nil {
+ req["displayPrompt"] = *params.DisplayPrompt
+ }
+ req["prompt"] = params.Prompt
+ }
+ raw, err := a.client.Request(ctx, "session.schedule.addSelfPaced", req)
+ if err != nil {
+ return nil, err
+ }
+ var result ScheduleAddResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// HasSelfPaced reports whether the session has an active self-paced scheduled prompt.
+//
+// RPC method: session.schedule.hasSelfPaced.
+//
+// Returns: Whether the session currently has an active self-paced schedule.
+// Internal: HasSelfPaced is part of the SDK's internal handshake/plumbing; external callers
+// should not use it.
+func (a *InternalScheduleAPI) HasSelfPaced(ctx context.Context) (*ScheduleHasSelfPacedResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ raw, err := a.client.Request(ctx, "session.schedule.hasSelfPaced", req)
+ if err != nil {
+ return nil, err
+ }
+ var result ScheduleHasSelfPacedResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// Hydrates the native schedule registry from persisted session events.
+//
+// RPC method: session.schedule.hydrate.
+// Internal: Hydrate is part of the SDK's internal handshake/plumbing; external callers
+// should not use it.
+func (a *InternalScheduleAPI) Hydrate(ctx context.Context) (*SessionScheduleHydrateResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ raw, err := a.client.Request(ctx, "session.schedule.hydrate", req)
+ if err != nil {
+ return nil, err
+ }
+ var result SessionScheduleHydrateResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
+// RearmSelfPaced re-arms an active self-paced scheduled prompt.
+//
+// RPC method: session.schedule.rearmSelfPaced.
+//
+// Parameters: Re-arm a self-paced scheduled prompt.
+//
+// Returns: Result of registering or re-arming a scheduled prompt.
+// Internal: RearmSelfPaced is part of the SDK's internal handshake/plumbing; external
+// callers should not use it.
+func (a *InternalScheduleAPI) RearmSelfPaced(ctx context.Context, params *ScheduleRearmSelfPacedRequest) (*ScheduleAddResult, error) {
+ req := map[string]any{"sessionId": a.sessionID}
+ if params != nil {
+ req["at"] = params.At
+ req["id"] = params.ID
+ }
+ raw, err := a.client.Request(ctx, "session.schedule.rearmSelfPaced", req)
+ if err != nil {
+ return nil, err
+ }
+ var result ScheduleAddResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
// Experimental: InternalSettingsAPI contains experimental APIs that may change or be
// removed.
type InternalSettingsAPI internalSessionAPI
@@ -20036,13 +21647,49 @@ type InternalSessionRPC struct {
common internalSessionAPI
MCP *InternalMCPAPI
+ Queue *InternalQueueAPI
+ Schedule *InternalScheduleAPI
Settings *InternalSettingsAPI
}
+// SendSystemNotification queues or sends an internal system notification to the session
+// according to its passive policy.
+//
+// RPC method: session.sendSystemNotification.
+//
+// Parameters: Internal request for sending a system notification.
+// Experimental: SendSystemNotification is an experimental API and may change or be removed
+// in future versions.
+// Internal: SendSystemNotification is part of the SDK's internal handshake/plumbing;
+// external callers should not use it.
+func (a *InternalSessionRPC) SendSystemNotification(ctx context.Context, params *SendSystemNotificationRequest) (*SessionSendSystemNotificationResult, error) {
+ req := map[string]any{"sessionId": a.common.sessionID}
+ if params != nil {
+ if params.Kind != nil {
+ req["kind"] = params.Kind
+ }
+ req["message"] = params.Message
+ if params.Options != nil {
+ req["options"] = params.Options
+ }
+ }
+ raw, err := a.common.client.Request(ctx, "session.sendSystemNotification", req)
+ if err != nil {
+ return nil, err
+ }
+ var result SessionSendSystemNotificationResult
+ if err := json.Unmarshal(raw, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
+}
+
func NewInternalSessionRPC(client *jsonrpc2.Client, sessionID string) *InternalSessionRPC {
r := &InternalSessionRPC{}
r.common = internalSessionAPI{client: client, sessionID: sessionID}
r.MCP = (*InternalMCPAPI)(&r.common)
+ r.Queue = (*InternalQueueAPI)(&r.common)
+ r.Schedule = (*InternalScheduleAPI)(&r.common)
r.Settings = (*InternalSettingsAPI)(&r.common)
return r
}
@@ -20202,16 +21849,27 @@ type SessionFSHandler interface {
//
// Returns: Indicates whether the per-session SQLite database already exists.
SqliteExists(request *SessionFSSqliteExistsRequest) (*SessionFSSqliteExistsResult, error)
- // SqliteQuery executes a SQLite query against the per-session database.
+ // SqliteQuery executes a SQLite query against the per-session database. Providers apply
+ // busy handling for every call.
//
// RPC method: sessionFs.sqliteQuery.
//
// Parameters: SQL query, query type, and optional bind parameters for executing a SQLite
- // query against the per-session database.
+ // query against the per-session database. The provider applies its SQLite busy timeout for
+ // every call.
//
// Returns: Query results including rows, columns, and rows affected, or a filesystem error
// if execution failed.
SqliteQuery(request *SessionFSSqliteQueryRequest) (*SessionFSSqliteQueryResult, error)
+ // SqliteTransaction executes SQLite statements atomically on the provider-owned connection.
+ //
+ // RPC method: sessionFs.sqliteTransaction.
+ //
+ // Parameters: Statements to execute atomically. Providers apply busy handling for every
+ // call.
+ //
+ // Returns: Per-statement results, or a classified transaction error.
+ SqliteTransaction(request *SessionFSSqliteTransactionRequest) (*SessionFSSqliteTransactionResult, error)
// Stat gets metadata for a path in the client-provided session filesystem.
//
// RPC method: sessionFs.stat.
@@ -20559,6 +22217,25 @@ func RegisterClientSessionAPIHandlers(client *jsonrpc2.Client, getHandlers func(
}
return raw, nil
})
+ client.SetRequestHandler("sessionFs.sqliteTransaction", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) {
+ var request SessionFSSqliteTransactionRequest
+ if err := json.Unmarshal(params, &request); err != nil {
+ return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)}
+ }
+ handlers := getHandlers(request.SessionID)
+ if handlers == nil || handlers.SessionFS == nil {
+ return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)}
+ }
+ result, err := handlers.SessionFS.SqliteTransaction(&request)
+ if err != nil {
+ return nil, clientSessionHandlerError(err)
+ }
+ raw, err := json.Marshal(result)
+ if err != nil {
+ return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("Failed to marshal response: %v", err)}
+ }
+ return raw, nil
+ })
client.SetRequestHandler("sessionFs.stat", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) {
var request SessionFSStatRequest
if err := json.Unmarshal(params, &request); err != nil {
diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go
index 82f6e1077..6bae31865 100644
--- a/go/rpc/zrpc_encoding.go
+++ b/go/rpc/zrpc_encoding.go
@@ -1075,6 +1075,12 @@ func unmarshalFactoryRunFailure(data []byte) (FactoryRunFailure, error) {
}
switch raw.Type {
+ case FactoryRunFailureTypeFactoryDurableFailure:
+ var d FactoryRunFailureFactoryDurableFailure
+ if err := json.Unmarshal(data, &d); err != nil {
+ return nil, err
+ }
+ return &d, nil
case FactoryRunFailureTypeFactoryLimitReached:
var d FactoryRunFailureFactoryLimitReached
if err := json.Unmarshal(data, &d); err != nil {
@@ -1103,6 +1109,17 @@ func (r RawFactoryRunFailureData) MarshalJSON() ([]byte, error) {
})
}
+func (r FactoryRunFailureFactoryDurableFailure) MarshalJSON() ([]byte, error) {
+ type alias FactoryRunFailureFactoryDurableFailure
+ return json.Marshal(struct {
+ Type FactoryRunFailureType `json:"type"`
+ alias
+ }{
+ Type: r.Type(),
+ alias: alias(r),
+ })
+}
+
func (r FactoryRunFailureFactoryLimitReached) MarshalJSON() ([]byte, error) {
type alias FactoryRunFailureFactoryLimitReached
return json.Marshal(struct {
@@ -1125,6 +1142,30 @@ func (r FactoryRunFailureFactoryResumeDeclined) MarshalJSON() ([]byte, error) {
})
}
+func (r *FactoryRunTerminal) UnmarshalJSON(data []byte) error {
+ type rawFactoryRunTerminal struct {
+ Error *string `json:"error,omitempty"`
+ Failure json.RawMessage `json:"failure,omitempty"`
+ Reason *string `json:"reason,omitempty"`
+ ResultPreview *string `json:"resultPreview,omitempty"`
+ }
+ var raw rawFactoryRunTerminal
+ if err := json.Unmarshal(data, &raw); err != nil {
+ return err
+ }
+ r.Error = raw.Error
+ if raw.Failure != nil {
+ value, err := unmarshalFactoryRunFailure(raw.Failure)
+ if err != nil {
+ return err
+ }
+ r.Failure = value
+ }
+ r.Reason = raw.Reason
+ r.ResultPreview = raw.ResultPreview
+ return nil
+}
+
func (r *FactoryRunResult) UnmarshalJSON(data []byte) error {
type rawFactoryRunResult struct {
Error *string `json:"error,omitempty"`
@@ -3499,6 +3540,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error {
EnableStreaming *bool `json:"enableStreaming,omitempty"`
EnvValueMode *SessionOpenOptionsEnvValueMode `json:"envValueMode,omitempty"`
EventsLogDirectory *string `json:"eventsLogDirectory,omitempty"`
+ EventsLogIncludesSubagents *bool `json:"eventsLogIncludesSubagents,omitempty"`
ExcludedBuiltinAgents []string `json:"excludedBuiltinAgents,omitzero"`
ExcludedTools []string `json:"excludedTools,omitzero"`
ExpAssignments any `json:"expAssignments,omitempty"`
@@ -3527,6 +3569,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error {
SessionCapabilities []SessionCapability `json:"sessionCapabilities,omitzero"`
SessionID *string `json:"sessionId,omitempty"`
SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"`
+ Shell *ShellOptions `json:"shell,omitempty"`
ShellInitProfile *string `json:"shellInitProfile,omitempty"`
ShellProcessFlags []string `json:"shellProcessFlags,omitzero"`
SkillDirectories []string `json:"skillDirectories,omitzero"`
@@ -3571,6 +3614,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error {
r.EnableStreaming = raw.EnableStreaming
r.EnvValueMode = raw.EnvValueMode
r.EventsLogDirectory = raw.EventsLogDirectory
+ r.EventsLogIncludesSubagents = raw.EventsLogIncludesSubagents
r.ExcludedBuiltinAgents = raw.ExcludedBuiltinAgents
r.ExcludedTools = raw.ExcludedTools
r.ExpAssignments = raw.ExpAssignments
@@ -3599,6 +3643,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error {
r.SessionCapabilities = raw.SessionCapabilities
r.SessionID = raw.SessionID
r.SessionLimits = raw.SessionLimits
+ r.Shell = raw.Shell
r.ShellInitProfile = raw.ShellInitProfile
r.ShellProcessFlags = raw.ShellProcessFlags
r.SkillDirectories = raw.SkillDirectories
diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go
index fe99126cf..3e19e874a 100644
--- a/go/rpc/zsession_encoding.go
+++ b/go/rpc/zsession_encoding.go
@@ -203,6 +203,12 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error {
return err
}
e.Data = &d
+ case SessionEventTypeFactoryRunUpdated:
+ var d FactoryRunUpdatedData
+ if err := json.Unmarshal(raw.Data, &d); err != nil {
+ return err
+ }
+ e.Data = &d
case SessionEventTypeHookEnd:
var d HookEndData
if err := json.Unmarshal(raw.Data, &d); err != nil {
diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go
index 44f49948f..382dada6c 100644
--- a/go/rpc/zsession_events.go
+++ b/go/rpc/zsession_events.go
@@ -81,24 +81,27 @@ const (
SessionEventTypeExitPlanModeRequested SessionEventType = "exit_plan_mode.requested"
SessionEventTypeExternalToolCompleted SessionEventType = "external_tool.completed"
SessionEventTypeExternalToolRequested SessionEventType = "external_tool.requested"
- SessionEventTypeHookEnd SessionEventType = "hook.end"
- SessionEventTypeHookProgress SessionEventType = "hook.progress"
- SessionEventTypeHookStart SessionEventType = "hook.start"
- SessionEventTypeMCPAppToolCallComplete SessionEventType = "mcp_app.tool_call_complete"
- SessionEventTypeMCPHeadersRefreshCompleted SessionEventType = "mcp.headers_refresh_completed"
- SessionEventTypeMCPHeadersRefreshRequired SessionEventType = "mcp.headers_refresh_required"
- SessionEventTypeMCPOauthCompleted SessionEventType = "mcp.oauth_completed"
- SessionEventTypeMCPOauthRequired SessionEventType = "mcp.oauth_required"
- SessionEventTypeMCPPromptsListChanged SessionEventType = "mcp.prompts.list_changed"
- SessionEventTypeMCPResourcesListChanged SessionEventType = "mcp.resources.list_changed"
- SessionEventTypeMCPToolsListChanged SessionEventType = "mcp.tools.list_changed"
- SessionEventTypeModelCallFailure SessionEventType = "model.call_failure"
- SessionEventTypeModelCallStart SessionEventType = "model.call_start"
- SessionEventTypePendingMessagesModified SessionEventType = "pending_messages.modified"
- SessionEventTypePermissionCompleted SessionEventType = "permission.completed"
- SessionEventTypePermissionRequested SessionEventType = "permission.requested"
- SessionEventTypeSamplingCompleted SessionEventType = "sampling.completed"
- SessionEventTypeSamplingRequested SessionEventType = "sampling.requested"
+ // Experimental: SessionEventTypeFactoryRunUpdated identifies an experimental event that may
+ // change or be removed.
+ SessionEventTypeFactoryRunUpdated SessionEventType = "factory.run_updated"
+ SessionEventTypeHookEnd SessionEventType = "hook.end"
+ SessionEventTypeHookProgress SessionEventType = "hook.progress"
+ SessionEventTypeHookStart SessionEventType = "hook.start"
+ SessionEventTypeMCPAppToolCallComplete SessionEventType = "mcp_app.tool_call_complete"
+ SessionEventTypeMCPHeadersRefreshCompleted SessionEventType = "mcp.headers_refresh_completed"
+ SessionEventTypeMCPHeadersRefreshRequired SessionEventType = "mcp.headers_refresh_required"
+ SessionEventTypeMCPOauthCompleted SessionEventType = "mcp.oauth_completed"
+ SessionEventTypeMCPOauthRequired SessionEventType = "mcp.oauth_required"
+ SessionEventTypeMCPPromptsListChanged SessionEventType = "mcp.prompts.list_changed"
+ SessionEventTypeMCPResourcesListChanged SessionEventType = "mcp.resources.list_changed"
+ SessionEventTypeMCPToolsListChanged SessionEventType = "mcp.tools.list_changed"
+ SessionEventTypeModelCallFailure SessionEventType = "model.call_failure"
+ SessionEventTypeModelCallStart SessionEventType = "model.call_start"
+ SessionEventTypePendingMessagesModified SessionEventType = "pending_messages.modified"
+ SessionEventTypePermissionCompleted SessionEventType = "permission.completed"
+ SessionEventTypePermissionRequested SessionEventType = "permission.requested"
+ SessionEventTypeSamplingCompleted SessionEventType = "sampling.completed"
+ SessionEventTypeSamplingRequested SessionEventType = "sampling.requested"
// Experimental: SessionEventTypeSessionAutoModeResolved identifies an experimental event
// that may change or be removed.
SessionEventTypeSessionAutoModeResolved SessionEventType = "session.auto_mode_resolved"
@@ -214,6 +217,7 @@ type AssistantReasoningData struct {
Content string `json:"content"`
// Unique identifier for this reasoning block
ReasoningID string `json:"reasoningId"`
+ Rte *bool `json:"rte,omitempty"`
}
func (*AssistantReasoningData) sessionEventData() {}
@@ -253,6 +257,7 @@ type AssistantMessageData struct {
ReasoningWireField *string `json:"reasoningWireField,omitempty"`
// GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
RequestID *string `json:"requestId,omitempty"`
+ Rte *bool `json:"rte,omitempty"`
// Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping
ServerTools *AssistantMessageServerTools `json:"serverTools,omitempty"`
// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
@@ -622,6 +627,17 @@ func (*SessionManagedSettingsResolvedData) Type() SessionEventType {
return SessionEventTypeSessionManagedSettingsResolved
}
+// Ephemeral invalidation signal for a changed factory run.
+// Experimental: FactoryRunUpdatedData is part of an experimental API and may change or be removed.
+type FactoryRunUpdatedData struct {
+ // Monotonic revision now available for the run.
+ Revision int64 `json:"revision"`
+ RunID string `json:"runId"`
+}
+
+func (*FactoryRunUpdatedData) sessionEventData() {}
+func (*FactoryRunUpdatedData) Type() SessionEventType { return SessionEventTypeFactoryRunUpdated }
+
// Ephemeral progress update from a running hook process
type HookProgressData struct {
// Human-readable progress message from the hook process
@@ -733,6 +749,7 @@ type ModelCallFailureData struct {
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
// Content-free structural summary of the failing request. Contains only counts and shape flags (no prompt content), so it is safe for unrestricted telemetry. Populated only for client-error (4xx) failures.
RequestFingerprint *ModelCallFailureRequestFingerprint `json:"requestFingerprint,omitempty"`
+ Rte *bool `json:"rte,omitempty"`
// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
ServiceRequestID *string `json:"serviceRequestId,omitempty"`
// Where the failed model call originated
@@ -818,6 +835,8 @@ type AssistantUsageData struct {
Initiator *string `json:"initiator,omitempty"`
// Number of input tokens consumed
InputTokens *int64 `json:"inputTokens,omitempty"`
+ // 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.
+ InteractionType *string `json:"interactionType,omitempty"`
// Average inter-token latency in milliseconds. Only available for streaming requests
InterTokenLatencyMs *float64 `json:"interTokenLatencyMs,omitempty"`
// Model identifier used for this API call
@@ -836,6 +855,7 @@ type AssistantUsageData struct {
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
// Number of output tokens used for reasoning (e.g., chain-of-thought)
ReasoningTokens *int64 `json:"reasoningTokens,omitempty"`
+ Rte *bool `json:"rte,omitempty"`
// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
ServiceRequestID *string `json:"serviceRequestId,omitempty"`
// Time to first token in milliseconds. Only available for streaming requests
@@ -1213,7 +1233,7 @@ type UserMessageData struct {
NativeDocumentPathFallbackPaths []string `json:"nativeDocumentPathFallbackPaths,omitzero"`
// Parent agent task ID for background telemetry correlated to this user turn
ParentAgentTaskID *string `json:"parentAgentTaskId,omitempty"`
- // 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-` for an inter-agent prompt)
Source *string `json:"source,omitempty"`
// Normalized document MIME types that were sent natively instead of through tagged_files XML
SupportedNativeDocumentMIMETypes []string `json:"supportedNativeDocumentMimeTypes,omitzero"`
@@ -1438,6 +1458,8 @@ type SessionScheduleCreatedData struct {
ID int64 `json:"id"`
// Interval between ticks in milliseconds (relative-interval schedules)
IntervalMs *int64 `json:"intervalMs,omitempty"`
+ // 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.
+ Origin *ScheduleOrigin `json:"origin,omitempty"`
// Prompt text that gets enqueued on every tick
Prompt string `json:"prompt"`
// Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`)
@@ -1861,6 +1883,8 @@ func (*SystemNotificationData) Type() SessionEventType { return SessionEventType
type SystemMessageData struct {
// The system or developer prompt text sent as model input
Content string `json:"content"`
+ // Logical interaction identifier for the model run receiving this prompt
+ InteractionID *string `json:"interactionId,omitempty"`
// Metadata about the prompt template and its construction
Metadata *SystemMessageMetadata `json:"metadata,omitempty"`
// Optional name identifier for the message source
@@ -1901,6 +1925,7 @@ type ToolExecutionCompleteData struct {
ParentToolCallID *string `json:"parentToolCallId,omitempty"`
// Tool execution result on success
Result *ToolExecutionCompleteResult `json:"result,omitempty"`
+ Rte *bool `json:"rte,omitempty"`
// Whether this tool execution ran inside a sandbox container
Sandboxed *bool `json:"sandboxed,omitempty"`
// Whether the tool execution completed successfully
@@ -1948,6 +1973,7 @@ type ToolExecutionStartData struct {
// Tool call ID of the parent tool invocation when this event originates from a sub-agent
// Deprecated: ParentToolCallID is deprecated.
ParentToolCallID *string `json:"parentToolCallId,omitempty"`
+ Rte *bool `json:"rte,omitempty"`
// 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.
ShellToolInfo *ToolExecutionStartShellToolInfo `json:"shellToolInfo,omitempty"`
// Unique identifier for this tool call
@@ -4278,6 +4304,16 @@ const (
PlanChangedOperationUpdate PlanChangedOperation = "update"
)
+// Who created the schedule: `user` (an explicit user action such as `/every` or `/after`) or `model` (the agent via the `manage_schedule` tool). Gates whether a scheduled skill that opted out of model invocation may fire: only user-created schedules may.
+type ScheduleOrigin string
+
+const (
+ // The schedule was created by the agent via the `manage_schedule` tool.
+ ScheduleOriginModel ScheduleOrigin = "model"
+ // The schedule was created by an explicit user action, such as `/every` or `/after`.
+ ScheduleOriginUser ScheduleOrigin = "user"
+)
+
// User action selected for an exhausted session limit.
type SessionLimitsExhaustedResponseAction string
diff --git a/go/session_fs_provider.go b/go/session_fs_provider.go
index d2227d629..d52044ca4 100644
--- a/go/session_fs_provider.go
+++ b/go/session_fs_provider.go
@@ -230,6 +230,22 @@ func (a *sessionFSAdapter) SqliteQuery(request *rpc.SessionFSSqliteQueryRequest)
}, nil
}
+func (a *sessionFSAdapter) SqliteTransaction(request *rpc.SessionFSSqliteTransactionRequest) (*rpc.SessionFSSqliteTransactionResult, error) {
+ // This SDK's provider interface exposes no atomic-transaction hook, so the
+ // batch is refused outright rather than applied non-atomically.
+ msg := "SQLite is not supported by this session filesystem provider"
+ if _, ok := a.provider.(SessionFSSqliteProvider); ok {
+ msg = "Atomic SQLite transactions are not supported by this session filesystem provider"
+ }
+ return &rpc.SessionFSSqliteTransactionResult{
+ Results: []rpc.SessionFSSqliteQueryResult{},
+ Error: &rpc.SessionFSSqliteTransactionError{
+ ErrorClass: rpc.SessionFSSqliteTransactionErrorClassFatal,
+ Message: msg,
+ },
+ }, nil
+}
+
func (a *sessionFSAdapter) SqliteExists(request *rpc.SessionFSSqliteExistsRequest) (*rpc.SessionFSSqliteExistsResult, error) {
sp, ok := a.provider.(SessionFSSqliteProvider)
if !ok {
diff --git a/go/zsession_events.go b/go/zsession_events.go
index 1d35a0a51..b6f0365af 100644
--- a/go/zsession_events.go
+++ b/go/zsession_events.go
@@ -103,6 +103,7 @@ type (
ExtensionsLoadedExtensionStatus = rpc.ExtensionsLoadedExtensionStatus
ExternalToolCompletedData = rpc.ExternalToolCompletedData
ExternalToolRequestedData = rpc.ExternalToolRequestedData
+ FactoryRunUpdatedData = rpc.FactoryRunUpdatedData
GitHubRepoRef = rpc.GitHubRepoRef
HandoffRepository = rpc.HandoffRepository
HandoffSourceType = rpc.HandoffSourceType
@@ -212,6 +213,7 @@ type (
ReasoningSummary = rpc.ReasoningSummary
SamplingCompletedData = rpc.SamplingCompletedData
SamplingRequestedData = rpc.SamplingRequestedData
+ ScheduleOrigin = rpc.ScheduleOrigin
SessionAutoModeResolvedData = rpc.SessionAutoModeResolvedData
SessionAutopilotObjectiveChangedData = rpc.SessionAutopilotObjectiveChangedData
SessionBackgroundTasksChangedData = rpc.SessionBackgroundTasksChangedData
@@ -534,6 +536,8 @@ const (
ReasoningSummaryConcise = rpc.ReasoningSummaryConcise
ReasoningSummaryDetailed = rpc.ReasoningSummaryDetailed
ReasoningSummaryNone = rpc.ReasoningSummaryNone
+ ScheduleOriginModel = rpc.ScheduleOriginModel
+ ScheduleOriginUser = rpc.ScheduleOriginUser
SessionEventTypeAbort = rpc.SessionEventTypeAbort
SessionEventTypeAssistantIdle = rpc.SessionEventTypeAssistantIdle
SessionEventTypeAssistantIntent = rpc.SessionEventTypeAssistantIntent
@@ -562,6 +566,7 @@ const (
SessionEventTypeExitPlanModeRequested = rpc.SessionEventTypeExitPlanModeRequested
SessionEventTypeExternalToolCompleted = rpc.SessionEventTypeExternalToolCompleted
SessionEventTypeExternalToolRequested = rpc.SessionEventTypeExternalToolRequested
+ SessionEventTypeFactoryRunUpdated = rpc.SessionEventTypeFactoryRunUpdated
SessionEventTypeHookEnd = rpc.SessionEventTypeHookEnd
SessionEventTypeHookProgress = rpc.SessionEventTypeHookProgress
SessionEventTypeHookStart = rpc.SessionEventTypeHookStart
diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json
index 45837520b..163e5bfa8 100644
--- a/nodejs/package-lock.json
+++ b/nodejs/package-lock.json
@@ -9,7 +9,7 @@
"version": "0.0.0-dev",
"license": "MIT",
"dependencies": {
- "@github/copilot": "^1.0.73",
+ "@github/copilot": "^1.0.75",
"koffi": "^3.1.0",
"vscode-jsonrpc": "^8.2.1",
"zod": "^4.3.6"
@@ -700,9 +700,9 @@
}
},
"node_modules/@github/copilot": {
- "version": "1.0.73",
- "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.73.tgz",
- "integrity": "sha512-8I2Ejg2CX/PQA3c2H8W1zuqhniCeR1q1/bD8CrV53/ZLw8GF7DAV0xQpwa8ELYvFgjXb6AADojafCKwdbVef+A==",
+ "version": "1.0.75",
+ "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.75.tgz",
+ "integrity": "sha512-rn7ZQmhydCZ9XRdG6V78QEhXIdYlChlUvOVAtyJ6KHJGt2O9/71si7PCt84amfmg0N7IXBT2UGRYF4GQDQBt+g==",
"license": "SEE LICENSE IN LICENSE.md",
"dependencies": {
"detect-libc": "^2.1.2"
@@ -711,20 +711,20 @@
"copilot": "npm-loader.js"
},
"optionalDependencies": {
- "@github/copilot-darwin-arm64": "1.0.73",
- "@github/copilot-darwin-x64": "1.0.73",
- "@github/copilot-linux-arm64": "1.0.73",
- "@github/copilot-linux-x64": "1.0.73",
- "@github/copilot-linuxmusl-arm64": "1.0.73",
- "@github/copilot-linuxmusl-x64": "1.0.73",
- "@github/copilot-win32-arm64": "1.0.73",
- "@github/copilot-win32-x64": "1.0.73"
+ "@github/copilot-darwin-arm64": "1.0.75",
+ "@github/copilot-darwin-x64": "1.0.75",
+ "@github/copilot-linux-arm64": "1.0.75",
+ "@github/copilot-linux-x64": "1.0.75",
+ "@github/copilot-linuxmusl-arm64": "1.0.75",
+ "@github/copilot-linuxmusl-x64": "1.0.75",
+ "@github/copilot-win32-arm64": "1.0.75",
+ "@github/copilot-win32-x64": "1.0.75"
}
},
"node_modules/@github/copilot-darwin-arm64": {
- "version": "1.0.73",
- "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.73.tgz",
- "integrity": "sha512-5jv7t2sw35/zI0cPze38hG6239NT5/q/Emjx6gLibYkolDqMDJjpm17Ps7tc8oafUEOiMQMb+ar7+qi6rSiGJA==",
+ "version": "1.0.75",
+ "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.75.tgz",
+ "integrity": "sha512-avt2ganQwtycGkqz9z8JpARoEz2Fzi02O+WitbB8I8iF3jfvEGpQ8k3z9oSCPAAO0rIMBeSl05xEUUV5RJwfRA==",
"cpu": [
"arm64"
],
@@ -738,9 +738,9 @@
}
},
"node_modules/@github/copilot-darwin-x64": {
- "version": "1.0.73",
- "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.73.tgz",
- "integrity": "sha512-l794k6Ahb11AG2FQT/P4TEWxWblzM1h8aQQCzG8jBWp8dfwjhyYjJ+d+0CWQzM3Fc1ddNUZRjKXCUsfvFjiZhQ==",
+ "version": "1.0.75",
+ "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.75.tgz",
+ "integrity": "sha512-eyM5cz83d9h05m6cnnG7tIHR4lSHHXUnxXeQm4rU3nGB1uwHWOa1TH9B4uAaW3zKQgkCkNgm+IlcPJ7geM0KBg==",
"cpu": [
"x64"
],
@@ -754,9 +754,9 @@
}
},
"node_modules/@github/copilot-linux-arm64": {
- "version": "1.0.73",
- "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.73.tgz",
- "integrity": "sha512-Zu0W5nupJjNeem0brqU/pG+VY0IWr6EWr/FsC90g5SEDiaM4VhVNVWcz8t0E3DQCSYetV6IBaNMtjs/3uIIiDQ==",
+ "version": "1.0.75",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.75.tgz",
+ "integrity": "sha512-PuGjPCy+z7DrD0rkcXQRBzoA8lVxD1WC6UeZxkZaIb9asueE798eqHHMV169zYiA3gsiSegIKu5J/aUeWwhpuQ==",
"cpu": [
"arm64"
],
@@ -770,9 +770,9 @@
}
},
"node_modules/@github/copilot-linux-x64": {
- "version": "1.0.73",
- "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.73.tgz",
- "integrity": "sha512-k33XIr6/PVp+K+5F/zv3No4PPaNImvHz73mcbIw63oxh5iiacXjgr0WqbBIS5s/rkhOWjNPIkbof/TTPZ7mQjA==",
+ "version": "1.0.75",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.75.tgz",
+ "integrity": "sha512-aGDtUrNyj/ubqLfXOomL4XYZR//1Cs4tDGe7r/464e3Nw4WlNxWPjBbNyOCcUPUMbPHXck6TyxjEvBwwlKCK5w==",
"cpu": [
"x64"
],
@@ -786,9 +786,9 @@
}
},
"node_modules/@github/copilot-linuxmusl-arm64": {
- "version": "1.0.73",
- "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.73.tgz",
- "integrity": "sha512-HJWzhfD3oaiIgfRAHkNWzp17fELtshqM9HVN5n+lFEmSO2EETCEh0P1lhJc4m+FYfXSJnL0raAqVuyaNMuPoPw==",
+ "version": "1.0.75",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.75.tgz",
+ "integrity": "sha512-4cbjjR/laL+4a0VjMkzjIsprRUxiAHAefWVTppFitKiqNxfgyRuOhfSUPUA5TVxPwfyYXknsxeYSNRL8zu9YDA==",
"cpu": [
"arm64"
],
@@ -802,9 +802,9 @@
}
},
"node_modules/@github/copilot-linuxmusl-x64": {
- "version": "1.0.73",
- "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.73.tgz",
- "integrity": "sha512-/BpOXSb16wHEu8I1SaKiLszQ4Kvu4+Z4uCn7W0bv4xI4fPZwTEG0u3zgaI2W9Ao3+aBl0XRpPmpWzE9ziYEq+w==",
+ "version": "1.0.75",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.75.tgz",
+ "integrity": "sha512-I4oFPNOULMGxWghGCG/VkiT0a62UiL4XGKSlp6X0rVD9xyoYyiLGlsBmTumrooPbzEvgKICYWIz8PCZjrZTyhA==",
"cpu": [
"x64"
],
@@ -818,9 +818,9 @@
}
},
"node_modules/@github/copilot-win32-arm64": {
- "version": "1.0.73",
- "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.73.tgz",
- "integrity": "sha512-DbPeXiYzQjpOy9oboaBvuCzjRwfcL987c3bG09cK1crdCDrKfkTJ7NXpcp1KWRPIRFO1FQm1qToNE89J+L3uvg==",
+ "version": "1.0.75",
+ "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.75.tgz",
+ "integrity": "sha512-wlLDuor+Qm1H43VwZNi03QI4H9FSyZoQzE/YHpGhUay7sKA+4cDJF8ZZNGrtYkyPskfH5HCdNygUn7EEt6lRyQ==",
"cpu": [
"arm64"
],
@@ -834,9 +834,9 @@
}
},
"node_modules/@github/copilot-win32-x64": {
- "version": "1.0.73",
- "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.73.tgz",
- "integrity": "sha512-8D3E1l5i+N5Eq8HIOQpx+Zbcb3MXdFxszksM2gqq175Z1S7Zna67oY4GoR3psxlbIpSyHKiLEBWYiaps6ayHWw==",
+ "version": "1.0.75",
+ "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.75.tgz",
+ "integrity": "sha512-TKISaaILkgcOi7ThaTnln1XoasbUIx+HKSb+pf678RvGucIfLohQyLceuq+rTykoynX54KQ0pf9TEUbMVkUNAA==",
"cpu": [
"x64"
],
diff --git a/nodejs/package.json b/nodejs/package.json
index aadba0ece..dd14425eb 100644
--- a/nodejs/package.json
+++ b/nodejs/package.json
@@ -56,7 +56,7 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
- "@github/copilot": "^1.0.73",
+ "@github/copilot": "^1.0.75",
"koffi": "^3.1.0",
"vscode-jsonrpc": "^8.2.1",
"zod": "^4.3.6"
diff --git a/nodejs/src/client.ts b/nodejs/src/client.ts
index 61f4a9941..c6ee4be52 100644
--- a/nodejs/src/client.ts
+++ b/nodejs/src/client.ts
@@ -35,6 +35,7 @@ import {
} from "./generated/rpc.js";
import type {
GitHubTelemetryNotification,
+ JsonValue,
OpenCanvasInstance,
SessionUpdateOptionsParams,
} from "./generated/rpc.js";
@@ -2981,7 +2982,7 @@ export class CopilotClient {
sessionId: string;
hookType: string;
input: unknown;
- }): Promise<{ output?: unknown }> {
+ }): Promise<{ output?: JsonValue }> {
if (
!params ||
typeof params.sessionId !== "string" ||
@@ -2996,7 +2997,7 @@ export class CopilotClient {
}
const output = await session._handleHooksInvoke(params.hookType, params.input);
- return { output };
+ return output === undefined ? {} : { output: JSON.parse(JSON.stringify(output)) };
}
private async handleSystemMessageTransform(params: {
diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts
index cf009115e..36a4aeb8e 100644
--- a/nodejs/src/generated/rpc.ts
+++ b/nodejs/src/generated/rpc.ts
@@ -7,6 +7,8 @@ import type { MessageConnection } from "vscode-jsonrpc/node.js";
import type { AbortReason, Attachment, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpServerSource, McpServerStatus, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, UserToolSessionApproval, Verbosity } from "./session-events.js";
+export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
+
/**
* Initial authentication info for the session.
*
@@ -238,6 +240,12 @@ export type AuthInfoType =
| "token"
/** Authentication from a Copilot API token. */
| "copilot-api-token";
+
+/** @experimental */
+export type CanvasJsonSchema = JsonValue;
+
+/** @experimental */
+export type CanvasActionInvokeResult = JsonValue;
/**
* Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command
*
@@ -510,17 +518,53 @@ export type ExternalToolTextResultForLlmContentResourceDetails =
| EmbeddedTextResourceContents
| EmbeddedBlobResourceContents;
/**
- * Kind of factory progress line.
+ * Execution-critical factory storage operation.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryDurableOperation".
+ */
+/** @experimental */
+export type FactoryDurableOperation =
+ /** Creating the durable run and declared phases. */
+ | "createRun"
+ /** Persisting the transition to running. */
+ | "markRunStarted"
+ /** Persisting the terminal run envelope. */
+ | "finishRun"
+ /** Persisting subagent admission accounting. */
+ | "reserveAgent"
+ /** Rolling back an uncommitted subagent admission. */
+ | "releaseAgent"
+ /** Persisting an idempotent model-usage charge. */
+ | "chargeCredit"
+ /** Persisting active execution time. */
+ | "addElapsed"
+ /** Reading the authoritative AI-credit total. */
+ | "reconcileCreditTotal"
+ /** Reading a journal entry without treating storage failure as a cache miss. */
+ | "journalGet"
+ /** Persisting a journal entry before reporting success. */
+ | "journalPut";
+/**
+ * Current or terminal state of a factory run.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
- * via the `definition` "FactoryLogLineKind".
+ * via the `definition` "FactoryRunStatus".
*/
/** @experimental */
-export type FactoryLogLineKind =
- /** A narrator log line. */
- | "log"
- /** A named factory phase marker. */
- | "phase";
+export type FactoryRunStatus =
+ /** The run was minted and is awaiting approval. */
+ | "pending"
+ /** The run is executing. */
+ | "running"
+ /** The run completed successfully. */
+ | "completed"
+ /** The run was interrupted while resource budget remained. */
+ | "halted"
+ /** The run was cancelled before completion. */
+ | "cancelled"
+ /** The factory body failed or reached a cumulative resource ceiling. */
+ | "error";
/**
* Machine-readable factory run failure.
*
@@ -551,6 +595,18 @@ export type FactoryRunFailure =
*/
reason: string;
type: "factory_resume_declined";
+ }
+ | {
+ /**
+ * Stable failure code.
+ */
+ code: string;
+ operation: FactoryDurableOperation;
+ /**
+ * Factory run identifier.
+ */
+ runId: string;
+ type: "factory_durable_failure";
};
/**
* Cumulative resource ceiling that stopped a factory run.
@@ -562,28 +618,38 @@ export type FactoryRunFailure =
export type FactoryRunFailureKind =
/** The run admitted the approved maximum total number of subagents. */
| "maxTotalSubagents"
- /** The run reached the approved timeout deadline. */
- | "timeout";
+ /** The run reached the approved accumulated active-execution time in seconds. */
+ | "timeoutSeconds"
+ /** The run's settled subagent model usage exceeded the approved AI-credit ceiling, or no headroom remained for another subagent. */
+ | "maxAiCredits";
/**
- * Current or terminal state of a factory run.
+ * Kind of factory progress line.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
- * via the `definition` "FactoryRunStatus".
+ * via the `definition` "FactoryLogLineKind".
*/
/** @experimental */
-export type FactoryRunStatus =
- /** The run was minted and is awaiting approval. */
+export type FactoryLogLineKind =
+ /** A narrator log line. */
+ | "log"
+ /** A named factory phase marker. */
+ | "phase";
+/**
+ * Derived lifecycle state of a factory phase.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryPhaseStatus".
+ */
+/** @experimental */
+export type FactoryPhaseStatus =
+ /** The phase has not been entered yet. */
| "pending"
- /** The run is executing. */
- | "running"
- /** The run completed successfully. */
+ /** The phase is currently entered and accumulating active time. */
+ | "active"
+ /** The phase was entered and has since been closed. */
| "completed"
- /** The run was interrupted while resource budget remained. */
- | "halted"
- /** The run was cancelled before completion. */
- | "cancelled"
- /** The factory body failed or reached a cumulative resource ceiling. */
- | "error";
+ /** The phase was never entered because a later phase was entered or the run reached a terminal state. */
+ | "skipped";
/**
* Content filtering mode to apply to all tools, or a map of tool name to content filtering mode.
*
@@ -1670,6 +1736,20 @@ export type SessionFsSqliteQueryType =
| "query"
/** Execute INSERT, UPDATE, or DELETE SQL and return affected-row metadata. */
| "run";
+/**
+ * SQLite transaction failure classification.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionFsSqliteTransactionErrorClass".
+ */
+/** @experimental */
+export type SessionFsSqliteTransactionErrorClass =
+ /** SQLite reported BUSY or LOCKED before commit; the transaction was rolled back and may be retried. */
+ | "busyOrLocked"
+ /** The statement, database, or provider failed definitively and must not be retried automatically. */
+ | "fatal"
+ /** The transport failed after the provider may have committed; retrying could duplicate effects. */
+ | "postCommitAmbiguous";
/**
* Source descriptor for direct repo installs (when marketplace is empty)
*
@@ -1762,6 +1842,30 @@ export type SessionOpenOptionsReasoningSummary =
| "concise"
/** Request a detailed summary of model reasoning. */
| "detailed";
+/**
+ * Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ShellInitProfile".
+ */
+/** @experimental */
+export type ShellInitProfile =
+ /** Disable automatic non-interactive profile loading. Explicit initScripts still run. */
+ | "none"
+ /** Allow automatic non-interactive profile loading when supported. Explicit initScripts still run. */
+ | "non-interactive";
+/**
+ * Supported built-in shells for initialization scripts.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ShellInitScriptShell".
+ */
+/** @experimental */
+export type ShellInitScriptShell =
+ /** Source the script in the built-in Bash shell on macOS and Linux. */
+ | "bash"
+ /** Source the script in the built-in PowerShell shell on Windows. */
+ | "powershell";
/**
* How MCP server environment values are interpreted.
*
@@ -2240,6 +2344,14 @@ export type WorkspacesWorkspaceDetailsHostType =
*/
/** @experimental */
export type AccountGetAllUsersResult = AccountAllUsers[];
+/**
+ * The number of running background agents (task-registry agents) that were cancelled.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionCancelAllBackgroundAgentsResult".
+ */
+/** @experimental */
+export type SessionCancelAllBackgroundAgentsResult = number;
/**
* Parameters for aborting the current turn
@@ -3035,7 +3147,7 @@ export interface AgentInfo {
* @experimental
*/
mcpServers?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* Skill names preloaded into this agent's context. Omitted means none.
@@ -3392,16 +3504,6 @@ export interface CanvasAction {
description?: string;
inputSchema?: CanvasJsonSchema;
}
-/**
- * JSON Schema for canvas open input
- *
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
- * via the `definition` "CanvasJsonSchema".
- */
-/** @experimental */
-export interface CanvasJsonSchema {
- [k: string]: unknown | undefined;
-}
/**
* Canvas action invocation parameters.
*
@@ -3418,22 +3520,7 @@ export interface CanvasActionInvokeRequest {
* Action name to invoke
*/
actionName: string;
- /**
- * Action input
- */
- input?: {
- [k: string]: unknown | undefined;
- };
-}
-/**
- * Provider-supplied action result.
- *
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
- * via the `definition` "CanvasActionInvokeResult".
- */
-/** @experimental */
-export interface CanvasActionInvokeResult {
- [k: string]: unknown | undefined;
+ input?: JsonValue;
}
/**
* Canvas close parameters.
@@ -3575,12 +3662,7 @@ export interface OpenCanvasInstance {
* URL for web-rendered canvases
*/
url?: string;
- /**
- * Input supplied when the instance was opened
- */
- input?: {
- [k: string]: unknown | undefined;
- };
+ input?: JsonValue;
}
/**
* Canvas open parameters.
@@ -3602,12 +3684,7 @@ export interface CanvasOpenRequest {
* Caller-supplied stable instance identifier
*/
instanceId: string;
- /**
- * Canvas open input
- */
- input?: {
- [k: string]: unknown | undefined;
- };
+ input?: JsonValue;
}
/**
* Canvas close parameters sent to the provider.
@@ -3677,12 +3754,7 @@ export interface CanvasProviderInvokeActionRequest {
* Action name to invoke
*/
actionName: string;
- /**
- * Action input
- */
- input?: {
- [k: string]: unknown | undefined;
- };
+ input?: JsonValue;
host?: CanvasHostContext;
session?: CanvasSessionContext;
}
@@ -3710,12 +3782,7 @@ export interface CanvasProviderOpenRequest {
* Stable caller-supplied canvas instance identifier
*/
instanceId: string;
- /**
- * Canvas open input
- */
- input?: {
- [k: string]: unknown | undefined;
- };
+ input?: JsonValue;
host?: CanvasHostContext;
session?: CanvasSessionContext;
}
@@ -4054,16 +4121,7 @@ export interface ConfigureSessionExtensionsParams {
* Session to attach the extension controller delegate to.
*/
sessionId: string;
- /**
- * In-process ExtensionController delegate (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. The post-SDK extension surface exposes list/enable/disable/reload via dedicated RPCs served by the runtime.
- *
- * @internal
- *
- * @internal
- */
- controller?: {
- [k: string]: unknown | undefined;
- };
+ controller?: JsonValue;
}
/**
* Metadata for a connected remote session.
@@ -4160,7 +4218,7 @@ export interface ConnectRequest {
*/
token?: string;
/**
- * 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.
*/
enableGitHubTelemetryForwarding?: boolean;
}
@@ -4261,7 +4319,7 @@ export interface CurrentToolMetadata {
* JSON Schema for tool input
*/
input_schema?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* Whether the tool is loaded on demand via tool search
@@ -4597,12 +4655,7 @@ export interface ExtensionContextPushInput {
* Human-readable composer pill label
*/
title: string;
- /**
- * Caller-supplied JSON payload (required, may be null but not undefined)
- */
- payload: {
- [k: string]: unknown | undefined;
- };
+ payload: JsonValue;
}
/**
* Extensions discovered for the session, with their current status.
@@ -4671,7 +4724,7 @@ export interface ExternalToolTextResultForLlm {
* Optional tool-specific telemetry
*/
toolTelemetry?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* Base64-encoded binary results returned to the model
@@ -4711,7 +4764,7 @@ export interface ExternalToolTextResultForLlmBinaryResultsForLlm {
* Optional metadata from the producing tool.
*/
metadata?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
}
/**
@@ -4945,12 +4998,7 @@ export interface FactoryAgentOptions {
* Optional label distinguishing otherwise identical memoized agent calls.
*/
label?: string;
- /**
- * Optional JSON Schema for structured agent output.
- */
- schema?: {
- [k: string]: unknown | undefined;
- };
+ schema?: JsonValue;
/**
* Optional model identifier for the subagent.
*/
@@ -4968,6 +5016,10 @@ export interface FactoryAgentRequest {
* Factory run identifier that owns the subagent.
*/
factoryRunId: string;
+ /**
+ * Opaque token identifying the current factory execution attempt.
+ */
+ executionToken: string;
/**
* Prompt to send to the subagent.
*/
@@ -4982,12 +5034,29 @@ export interface FactoryAgentRequest {
*/
/** @experimental */
export interface FactoryAgentResult {
- /**
- * Agent result, omitted when the agent produced no result.
- */
- result?: {
- [k: string]: unknown | undefined;
- };
+ result?: JsonValue;
+}
+/**
+ * Prompt-safe durable identity and live status for a direct factory agent.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryAgentSummary".
+ */
+/** @experimental */
+export interface FactoryAgentSummary {
+ agentId: string;
+ toolCallId: string;
+ runId: string;
+ phaseId: string | null;
+ label: string;
+ agentType: string;
+ status: string;
+ requestedModel?: string;
+ resolvedModel?: string;
+ startedAt?: number;
+ completedAt?: number;
+ activeMs: number;
+ activity?: string;
}
/**
* Parameters for cancelling a factory run.
@@ -5002,6 +5071,30 @@ export interface FactoryCancelRequest {
*/
runId: string;
}
+/**
+ * Current factory phase identity.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryCurrentPhase".
+ */
+/** @experimental */
+export interface FactoryCurrentPhase {
+ id: string;
+ ordinal: number | null;
+}
+/**
+ * Declared or approved factory resource ceilings.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryDeclaredLimits".
+ */
+/** @experimental */
+export interface FactoryDeclaredLimits {
+ maxConcurrentSubagents?: number;
+ maxTotalSubagents?: number;
+ timeoutSeconds?: number;
+ maxAiCredits?: number;
+}
/**
* Parameters sent to the owning extension to execute a factory closure.
*
@@ -5023,11 +5116,10 @@ export interface FactoryExecuteRequest {
*/
runId: string;
/**
- * Factory input value.
+ * Opaque token identifying this factory execution attempt.
*/
- args: {
- [k: string]: unknown | undefined;
- };
+ executionToken: string;
+ args: JsonValue;
}
/**
* Result returned by an extension factory closure.
@@ -5037,12 +5129,36 @@ export interface FactoryExecuteRequest {
*/
/** @experimental */
export interface FactoryExecuteResult {
+ result?: JsonValue;
+}
+/**
+ * Parameters for paging factory progress.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryGetRunProgressRequest".
+ */
+/** @experimental */
+export interface FactoryGetRunProgressRequest {
/**
- * Factory result value.
+ * Factory run identifier.
*/
- result: {
- [k: string]: unknown | undefined;
- };
+ runId: string;
+ /**
+ * Optional phase identifier used to scope records and cursors.
+ */
+ phaseId?: string;
+ /**
+ * Exclusive forward cursor.
+ */
+ afterSeq?: number;
+ /**
+ * Exclusive backward cursor.
+ */
+ beforeSeq?: number;
+ /**
+ * Maximum records to return. Defaults to 200 and is capped at 500.
+ */
+ limit?: number;
}
/**
* Parameters for retrieving a factory run.
@@ -5069,6 +5185,10 @@ export interface FactoryJournalGetRequest {
* Factory run identifier.
*/
runId: string;
+ /**
+ * Opaque token identifying the current factory execution attempt.
+ */
+ executionToken: string;
/**
* Namespaced journal key.
*/
@@ -5086,12 +5206,7 @@ export interface FactoryJournalGetResult {
* Whether the journal contained the requested key.
*/
hit: boolean;
- /**
- * Cached JSON result. The hit field distinguishes a cached JSON null from a miss.
- */
- resultJson?: {
- [k: string]: unknown | undefined;
- };
+ resultJson?: JsonValue;
}
/**
* Parameters for storing a factory journal entry.
@@ -5106,15 +5221,85 @@ export interface FactoryJournalPutRequest {
*/
runId: string;
/**
- * Namespaced journal key.
+ * Opaque token identifying the current factory execution attempt.
*/
- key: string;
+ executionToken: string;
/**
- * JSON result to memoize.
+ * Namespaced journal key.
*/
- resultJson: {
- [k: string]: unknown | undefined;
- };
+ key: string;
+ resultJson: JsonValue;
+}
+/**
+ * Empty parameters for listing factory runs.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryListRunsRequest".
+ */
+/** @experimental */
+export interface FactoryListRunsRequest {}
+/**
+ * Factory runs in durable creation order.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryListRunsResult".
+ */
+/** @experimental */
+export interface FactoryListRunsResult {
+ runs: FactoryRunSummary[];
+}
+/**
+ * Durable factory run summary with read-time live overlays.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryRunSummary".
+ */
+/** @experimental */
+export interface FactoryRunSummary {
+ runId: string;
+ factoryName: string;
+ description: string;
+ status: FactoryRunStatus;
+ revision: number;
+ createdAt: number;
+ startedAt: number | null;
+ updatedAt: number;
+ completedAt: number | null;
+ currentPhase: FactoryCurrentPhase | null;
+ declaredPhaseCount: number;
+ liveAgentCount: number;
+ totalSpawnedAgentCount: number;
+ consumed: FactoryRunConsumed;
+ declaredLimits: FactoryDeclaredLimits;
+ approved: FactoryDeclaredLimits | null;
+ observedAt: number;
+ activeSegmentStartedAt: number | null;
+ terminal: FactoryRunTerminal | null;
+}
+/**
+ * Durable factory resource consumption.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryRunConsumed".
+ */
+/** @experimental */
+export interface FactoryRunConsumed {
+ activeMs: number;
+ subagents: number;
+ nanoAiu: number;
+}
+/**
+ * Prompt-safe terminal factory outcome.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryRunTerminal".
+ */
+/** @experimental */
+export interface FactoryRunTerminal {
+ reason?: string;
+ failure?: FactoryRunFailure;
+ error?: string;
+ resultPreview?: string;
}
/**
* One ordered factory progress line.
@@ -5146,65 +5331,137 @@ export interface FactoryLogRequest {
* Factory run identifier.
*/
runId: string;
+ /**
+ * Opaque token identifying the current factory execution attempt.
+ */
+ executionToken: string;
/**
* Ordered progress lines to append.
*/
lines: FactoryLogLine[];
}
/**
- * Wire-only per-invocation factory resource ceiling overrides.
+ * Durable lifecycle and timing for one factory phase.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
- * via the `definition` "FactoryRunLimits".
+ * via the `definition` "FactoryPhaseObservation".
*/
/** @experimental */
-export interface FactoryRunLimits {
+export interface FactoryPhaseObservation {
+ id: string;
+ ordinal: number | null;
+ title: string;
+ detail?: string;
+ status: FactoryPhaseStatus;
+ lastEnteredRunAttempt: number;
+ entryCount: number;
+ startedAt?: number;
+ completedAt?: number;
+ accumulatedActiveMs: number;
+ currentActiveMs: number;
+ totalAgentCount: number;
+ liveAgentCount: number;
+}
+/**
+ * One durable factory progress record.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryProgressLine".
+ */
+/** @experimental */
+export interface FactoryProgressLine {
/**
- * Maximum number of factory subagents that may run concurrently.
+ * Global monotonic sequence number within the run.
*/
- maxConcurrentSubagents?: number;
+ seq: number;
/**
- * Maximum total number of factory subagents that may be admitted.
+ * Resume attempt that emitted this record.
*/
- maxTotalSubagents?: number;
+ attempt: number;
/**
- * Factory active-run timeout in milliseconds.
+ * Phase active when the record was emitted, or null before any phase.
*/
- timeout?: number;
+ phaseId: string | null;
+ /**
+ * Epoch milliseconds when the record was persisted.
+ */
+ recordedAt: number;
+ kind: FactoryLogLineKind;
+ /**
+ * Prompt-safe progress text.
+ */
+ text: string;
}
/**
- * Parameters for invoking a registered factory.
+ * A bidirectional page of factory progress.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
- * via the `definition` "FactoryRunRequest".
+ * via the `definition` "FactoryProgressPage".
*/
/** @experimental */
-export interface FactoryRunRequest {
- /**
- * Registered factory name.
- */
- name: string;
+export interface FactoryProgressPage {
+ records: FactoryProgressLine[];
+ oldestSeq: number | null;
+ newestSeq: number | null;
+ hasMoreOlder: boolean;
+ hasMoreNewer: boolean;
/**
- * Factory input value.
+ * Run revision reflected by this page.
*/
- args: {
- [k: string]: unknown | undefined;
- };
- options?: RunOptions;
+ revision: number;
}
/**
- * Options controlling factory invocation.
+ * Parameters for resuming a factory run from its persisted identity.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
- * via the `definition` "RunOptions".
+ * via the `definition` "FactoryResumeRequest".
*/
/** @experimental */
-export interface RunOptions {
+export interface FactoryResumeRequest {
+ /**
+ * Factory run identifier.
+ */
+ runId: string;
limits?: FactoryRunLimits;
+}
+/**
+ * Wire-only per-invocation factory resource ceiling overrides.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryRunLimits".
+ */
+/** @experimental */
+export interface FactoryRunLimits {
/**
- * Run identifier whose journal and progress should seed this resumed run.
+ * Maximum number of factory subagents that may run concurrently.
*/
- resumeFromRunId?: string;
+ maxConcurrentSubagents?: number;
+ /**
+ * Maximum total number of factory subagents that may be admitted.
+ */
+ maxTotalSubagents?: number;
+ /**
+ * Maximum accumulated active-execution time in seconds. Active execution includes the entire extension body, subprocess waits, queued-agent waits, and sleeps; time between resumed attempts is not counted.
+ */
+ timeoutSeconds?: number;
+ /**
+ * Maximum AI credits consumed by factory subagents and their descendants. The post-paid ceiling is soft: parallel turns can settle beyond it before the run stops.
+ */
+ maxAiCredits?: number;
+}
+/**
+ * Resolved persisted factory identity and resumed run envelope.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryResumeResult".
+ */
+/** @experimental */
+export interface FactoryResumeResult {
+ /**
+ * Persisted factory name resolved for the resumed run.
+ */
+ factoryName: string;
+ run: FactoryRunResult;
}
/**
* Complete current or terminal factory run envelope.
@@ -5219,12 +5476,7 @@ export interface FactoryRunResult {
*/
runId: string;
status: FactoryRunStatus;
- /**
- * Completed factory result.
- */
- result?: {
- [k: string]: unknown | undefined;
- };
+ result?: JsonValue;
/**
* Error message for an errored run.
*/
@@ -5234,12 +5486,67 @@ export interface FactoryRunResult {
* Reason for a halted or cancelled run.
*/
reason?: string;
+ snapshot?: JsonValue;
+}
+/**
+ * Full factory run observability detail.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryRunDetail".
+ */
+/** @experimental */
+export interface FactoryRunDetail {
+ runId: string;
+ factoryName: string;
+ description: string;
+ status: FactoryRunStatus;
+ revision: number;
+ createdAt: number;
+ startedAt: number | null;
+ updatedAt: number;
+ completedAt: number | null;
+ currentPhase: FactoryCurrentPhase | null;
+ declaredPhaseCount: number;
+ liveAgentCount: number;
+ totalSpawnedAgentCount: number;
+ consumed: FactoryRunConsumed;
+ declaredLimits: FactoryDeclaredLimits;
+ approved: FactoryDeclaredLimits | null;
+ observedAt: number;
+ activeSegmentStartedAt: number | null;
+ terminal: FactoryRunTerminal | null;
+ phases: FactoryPhaseObservation[];
+ agents: FactoryAgentSummary[];
+ progress: FactoryProgressPage;
+}
+/**
+ * Parameters for invoking a registered factory.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "FactoryRunRequest".
+ */
+/** @experimental */
+export interface FactoryRunRequest {
/**
- * Partial journal and progress snapshot for a halted, cancelled, or errored run.
+ * Registered factory name.
*/
- snapshot?: {
- [k: string]: unknown | undefined;
- };
+ name: string;
+ args: JsonValue;
+ options?: RunOptions;
+}
+/**
+ * Options controlling factory invocation.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "RunOptions".
+ */
+/** @experimental */
+export interface RunOptions {
+ limits?: FactoryRunLimits;
+ /**
+ * Run identifier whose journal and progress should seed this resumed run.
+ */
+ resumeFromRunId?: string;
}
/**
* Optional user prompt to combine with the fleet orchestration instructions.
@@ -5604,7 +5911,7 @@ export interface HistoryTruncateResult {
export interface HookInvokeRequest {
sessionId: string;
hookType: HookType;
- input: unknown;
+ input: JsonValue;
}
/**
* Optional output returned by an SDK callback hook.
@@ -5615,7 +5922,7 @@ export interface HookInvokeRequest {
/** @experimental */
/** @internal */
export interface HookInvokeResponse {
- output?: unknown;
+ output?: JsonValue;
}
/**
* Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source.
@@ -5652,7 +5959,7 @@ export interface InstalledPlugin {
source?: InstalledPluginSource;
}
/**
- * 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.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "InstalledPluginSourceGitHub".
@@ -5665,10 +5972,14 @@ export interface InstalledPluginSourceGitHub {
source: "github";
repo: string;
ref?: string;
+ /**
+ * Optional full 40-character hexadecimal commit SHA.
+ */
+ sha?: string;
path?: string;
}
/**
- * 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.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "InstalledPluginSourceUrl".
@@ -5681,6 +5992,10 @@ export interface InstalledPluginSourceUrl {
source: "url";
url: string;
ref?: string;
+ /**
+ * Optional full 40-character hexadecimal commit SHA.
+ */
+ sha?: string;
path?: string;
}
/**
@@ -5852,6 +6167,32 @@ export interface InstructionSource {
*/
projectPath?: string;
}
+/**
+ * Parameters for interrupting the main agent turn.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "InterruptMainTurnRequest".
+ */
+/** @experimental */
+export interface 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.
+ */
+ flushQueued?: boolean;
+}
+/**
+ * Result of interrupting the main agent turn.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "InterruptMainTurnResult".
+ */
+/** @experimental */
+export interface InterruptMainTurnResult {
+ /**
+ * Whether an in-flight main agent turn was interrupted. False when the main loop was not processing.
+ */
+ interrupted: boolean;
+}
/**
* HTTP headers as a map from lowercased header name to a list of values. Multi-valued headers (e.g. Set-Cookie) preserve all values.
*
@@ -6363,7 +6704,7 @@ export interface McpAppsCallToolRequest {
* Tool arguments
*/
arguments?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing.
@@ -6508,7 +6849,7 @@ export interface McpAppsListToolsResult {
* App-callable tools from the server
*/
tools: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
}[];
}
/**
@@ -6569,7 +6910,7 @@ export interface McpAppsResourceContent {
* Resource-level metadata (CSP, permissions, etc.)
*/
_meta?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
}
/**
@@ -6829,14 +7170,7 @@ export interface McpConfigUpdateRequest {
/** @experimental */
/** @internal */
export interface McpConfigureGitHubRequest {
- /**
- * Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire).
- *
- * @internal
- */
- authInfo: {
- [k: string]: unknown | undefined;
- };
+ authInfo: JsonValue;
}
/**
* Result of configuring GitHub MCP.
@@ -6919,12 +7253,7 @@ export interface McpExecuteSamplingParams {
* Name of the MCP server that initiated the sampling request
*/
serverName: string;
- /**
- * The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle).
- */
- mcpRequestId: {
- [k: string]: unknown | undefined;
- };
+ mcpRequestId: JsonValue;
request: McpExecuteSamplingRequest;
}
/**
@@ -7235,6 +7564,32 @@ export interface McpOauthLoginResult {
*/
authorizationUrl?: string;
}
+/**
+ * Pending MCP OAuth request id to respond to.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "McpOauthRespondRequest".
+ */
+/** @experimental */
+export interface McpOauthRespondRequest {
+ /**
+ * OAuth request identifier from the mcp.oauth_required event
+ */
+ requestId: string;
+}
+/**
+ * Indicates whether the pending MCP OAuth response was accepted.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "McpOauthRespondResult".
+ */
+/** @experimental */
+export interface McpOauthRespondResult {
+ /**
+ * Whether the response was accepted. False if the request was unknown, timed out, or already resolved.
+ */
+ success: boolean;
+}
/**
* Registration parameters for an external MCP client.
*
@@ -7248,30 +7603,9 @@ export interface McpRegisterExternalClientRequest {
* Logical server name for the external client
*/
serverName: string;
- /**
- * In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary.
- *
- * @internal
- */
- client: {
- [k: string]: unknown | undefined;
- };
- /**
- * In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary.
- *
- * @internal
- */
- transport: {
- [k: string]: unknown | undefined;
- };
- /**
- * In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions.
- *
- * @internal
- */
- config: {
- [k: string]: unknown | undefined;
- };
+ client: JsonValue;
+ transport: JsonValue;
+ config: JsonValue;
}
/**
* Opaque MCP reload configuration.
@@ -7282,14 +7616,7 @@ export interface McpRegisterExternalClientRequest {
/** @experimental */
/** @internal */
export interface McpReloadWithConfigRequest {
- /**
- * Opaque runtime MCP reload configuration. Marked internal: an in-process runtime shape (reloadMcpServers throws over the wire).
- *
- * @internal
- */
- config: {
- [k: string]: unknown | undefined;
- };
+ config: JsonValue;
}
/**
* Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove).
@@ -7345,13 +7672,13 @@ export interface McpResource {
* Resource-level metadata
*/
_meta?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* Server-provided non-standard descriptor fields preserved from the MCP response
*/
additionalProperties?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
}
/**
@@ -7382,7 +7709,7 @@ export interface McpResourceIcon {
* Server-provided non-standard icon fields preserved from the MCP response
*/
additionalProperties?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
}
/**
@@ -7409,7 +7736,7 @@ export interface McpResourceAnnotations {
* Server-provided non-standard annotation fields preserved from the MCP response
*/
additionalProperties?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
}
/**
@@ -7440,7 +7767,7 @@ export interface McpResourceContent {
* Resource-level metadata (CSP, permissions, etc.)
*/
_meta?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
}
/**
@@ -7548,13 +7875,13 @@ export interface McpResourceTemplate {
* Resource-template-level metadata
*/
_meta?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* Server-provided non-standard descriptor fields preserved from the MCP response
*/
additionalProperties?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
}
/**
@@ -8526,7 +8853,7 @@ export interface NameSetRequest {
/** @experimental */
export interface OptionsUpdateAdditionalContentExclusionPolicy {
rules: OptionsUpdateAdditionalContentExclusionPolicyRule[];
- last_updated_at: unknown;
+ last_updated_at: JsonValue;
scope: OptionsUpdateAdditionalContentExclusionPolicyScope;
}
/**
@@ -9536,7 +9863,7 @@ export interface PermissionRulesSet {
/** @experimental */
export interface PermissionsConfigureAdditionalContentExclusionPolicy {
rules: PermissionsConfigureAdditionalContentExclusionPolicyRule[];
- last_updated_at: unknown;
+ last_updated_at: JsonValue;
scope: PermissionsConfigureAdditionalContentExclusionPolicyScope;
}
/**
@@ -10371,7 +10698,7 @@ export interface ProviderAddResult {
/**
* Synthesized selectable model entries for the newly added BYOK models, each under its provider-qualified selection id (`provider/id`). Empty when only providers were added.
*/
- models: unknown[];
+ models: JsonValue[];
}
/**
* Custom model-provider configuration (BYOK).
@@ -10982,6 +11309,115 @@ export interface PushAttachmentBlob {
*/
displayName?: string;
}
+/**
+ * Inputs for starting a deferred-idle drain.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "QueueBeginDeferredIdleDrainRequest".
+ */
+/** @experimental */
+export interface QueueBeginDeferredIdleDrainRequest {
+ /**
+ * Whether the host still has active background work.
+ */
+ activeBackgroundWork: boolean;
+}
+/**
+ * Whether a deferred-idle drain should run.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "QueueBeginDeferredIdleDrainResult".
+ */
+/** @experimental */
+export interface QueueBeginDeferredIdleDrainResult {
+ /**
+ * True when the host should run finishDeferredIdleDrain asynchronously.
+ */
+ shouldDrain: boolean;
+}
+/**
+ * Internal filter for consuming queued system notifications.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "QueueConsumeSystemNotificationsRequest".
+ */
+/** @experimental */
+export interface QueueConsumeSystemNotificationsRequest {
+ filter: JsonValue;
+}
+/**
+ * Inputs for marking session.idle deferred in native state.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "QueueDeferSessionIdleRequest".
+ */
+/** @experimental */
+export interface QueueDeferSessionIdleRequest {
+ /**
+ * Whether the deferred idle was caused by an aborted foreground turn.
+ */
+ aborted: boolean;
+}
+/**
+ * Result of enqueueing the resume-pending wake item.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "QueueEnqueueResumePendingResult".
+ */
+/** @experimental */
+export interface QueueEnqueueResumePendingResult {
+ /**
+ * True when a wake item was newly queued.
+ */
+ queued: boolean;
+}
+/**
+ * Inputs for completing a deferred-idle drain.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "QueueFinishDeferredIdleDrainRequest".
+ */
+/** @experimental */
+export interface QueueFinishDeferredIdleDrainRequest {
+ /**
+ * Whether the host still has active background work.
+ */
+ activeBackgroundWork: boolean;
+ /**
+ * Whether native queued work remains.
+ */
+ hasPending: boolean;
+}
+/**
+ * Action selected by the native deferred-idle drain.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "QueueFinishDeferredIdleDrainResult".
+ */
+/** @experimental */
+export interface QueueFinishDeferredIdleDrainResult {
+ /**
+ * One of none, processQueue, or emitSessionIdle.
+ */
+ action: string;
+ /**
+ * Whether the deferred idle was caused by an aborted foreground turn.
+ */
+ aborted: boolean;
+}
+/**
+ * Whether the native queue has pending work.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "QueueHasPendingResult".
+ */
+/** @experimental */
+export interface QueueHasPendingResult {
+ /**
+ * True when queued or immediate native work is pending.
+ */
+ hasPending: boolean;
+}
/**
* User-facing pending queue entry, with kind and display text for a queued message, slash command, or model change.
*
@@ -11026,6 +11462,31 @@ export interface QueueRemoveMostRecentResult {
*/
removed: boolean;
}
+/**
+ * Internal snapshot of native queue state for local session orchestration.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "QueueSnapshotResult".
+ */
+/** @experimental */
+export interface QueueSnapshotResult {
+ /**
+ * User-facing pending items in FIFO order.
+ */
+ items: QueuePendingItems[];
+ /**
+ * Immediate steering messages waiting for an active turn.
+ */
+ steeringMessages: string[];
+ /**
+ * Insertion orders for queued items, aligned with `items`.
+ */
+ itemOrders?: number[];
+ /**
+ * Insertion orders for immediate steering messages, aligned with `steeringMessages`.
+ */
+ steeringMessageOrders?: number[];
+}
/**
* Event type to register consumer interest for, used by runtime gating logic.
*
@@ -11065,16 +11526,7 @@ export interface RegisterExtensionToolsParams {
* Session to register extension tools on.
*/
sessionId: string;
- /**
- * In-process ExtensionLoader handle (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. When the CLI migrates to a process-separated SDK, extension discovery/launch moves entirely into the runtime — the CLI passes pure config (search paths, disabled ids) via SessionOptions instead.
- *
- * @internal
- *
- * @internal
- */
- loader: {
- [k: string]: unknown | undefined;
- };
+ loader: JsonValue;
options?: SessionsRegisterExtensionToolsOnSessionOptions;
}
/**
@@ -11085,14 +11537,7 @@ export interface RegisterExtensionToolsParams {
*/
/** @experimental */
export interface SessionsRegisterExtensionToolsOnSessionOptions {
- /**
- * In-process `() => boolean` gating callback (CLI-only optimization). Marked internal: replaced by runtime-side enable/disable RPCs in the SDK migration.
- *
- * @internal
- */
- enabled?: {
- [k: string]: unknown | undefined;
- };
+ enabled?: JsonValue;
}
/**
* Handle for releasing the extension tool registration.
@@ -11103,16 +11548,7 @@ export interface SessionsRegisterExtensionToolsOnSessionOptions {
/** @experimental */
/** @internal */
export interface RegisterExtensionToolsResult {
- /**
- * In-process unsubscribe function (CLI-only optimization). Marked internal: replaced by an explicit `extensions.unregister` RPC in the SDK migration.
- *
- * @internal
- *
- * @internal
- */
- unsubscribe: {
- [k: string]: unknown | undefined;
- };
+ unsubscribe: JsonValue;
}
/**
* Opaque handle previously returned by `registerInterest` to release.
@@ -11228,14 +11664,7 @@ export interface RemoteControlStatusActive {
* Whether the MC session may steer this session.
*/
isSteerable: boolean;
- /**
- * In-process prompt-manager handle (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. When the CLI migrates to a process-separated SDK, the same bidirectional prompt-routing handshake is expressed via dedicated remote-control RPCs (register/resolve) rather than a shared in-process object.
- *
- * @internal
- */
- promptManager?: {
- [k: string]: unknown | undefined;
- };
+ promptManager?: JsonValue;
/**
* True while a read-only/session-sync export is deferred, awaiting the first `user.message` before its MC session exists. Marked internal: this field is excluded from the public SDK surface and is populated only on the CLI in-process path.
*
@@ -11579,6 +12008,99 @@ export interface SandboxConfigUserPolicyExperimentalSeatbelt {
*/
keychainAccess?: boolean;
}
+/**
+ * Register an absolute-time scheduled prompt.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ScheduleAddAtRequest".
+ */
+/** @experimental */
+export interface ScheduleAddAtRequest {
+ /**
+ * Epoch milliseconds when the prompt should fire.
+ */
+ at: number;
+ /**
+ * Prompt text to enqueue when the schedule fires.
+ */
+ prompt: string;
+ /**
+ * Whether the schedule should re-arm after each tick. Defaults to false.
+ */
+ recurring?: boolean;
+ /**
+ * Optional display-only prompt label.
+ */
+ displayPrompt?: string;
+}
+/**
+ * Register a cron scheduled prompt.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ScheduleAddCronRequest".
+ */
+/** @experimental */
+export interface ScheduleAddCronRequest {
+ /**
+ * 5-field cron expression.
+ */
+ cron: string;
+ /**
+ * Prompt text to enqueue when the schedule fires.
+ */
+ prompt: string;
+ /**
+ * Whether the schedule should re-arm after each tick. Defaults to true.
+ */
+ recurring?: boolean;
+ /**
+ * Optional display-only prompt label.
+ */
+ displayPrompt?: string;
+ /**
+ * IANA timezone for evaluating the cron expression.
+ */
+ tz?: string;
+}
+/**
+ * Register a relative-interval scheduled prompt.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ScheduleAddRequest".
+ */
+/** @experimental */
+export interface ScheduleAddRequest {
+ /**
+ * Human-readable interval such as `30s`, `5m`, or `2h`.
+ */
+ interval: string;
+ /**
+ * Prompt text to enqueue when the schedule fires.
+ */
+ prompt: string;
+ /**
+ * Whether the schedule should re-arm after each tick. Defaults to true.
+ */
+ recurring?: boolean;
+ /**
+ * Optional display-only prompt label.
+ */
+ displayPrompt?: string;
+}
+/**
+ * Result of registering or re-arming a scheduled prompt.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ScheduleAddResult".
+ */
+/** @experimental */
+export interface ScheduleAddResult {
+ entry?: ScheduleEntry;
+ /**
+ * User-facing validation error, when registration failed.
+ */
+ error?: string;
+}
/**
* Scheduled prompt entry with ID, timing (`intervalMs`, `cron`, or `at`), prompt text, recurrence, and next run time.
*
@@ -11628,6 +12150,36 @@ export interface ScheduleEntry {
*/
nextRunAt: string;
}
+/**
+ * Register a self-paced scheduled prompt.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ScheduleAddSelfPacedRequest".
+ */
+/** @experimental */
+export interface ScheduleAddSelfPacedRequest {
+ /**
+ * Prompt text to enqueue when the schedule fires.
+ */
+ prompt: string;
+ /**
+ * Optional display-only prompt label.
+ */
+ displayPrompt?: string;
+}
+/**
+ * Whether the session currently has an active self-paced schedule.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ScheduleHasSelfPacedResult".
+ */
+/** @experimental */
+export interface ScheduleHasSelfPacedResult {
+ /**
+ * True when at least one active schedule is self-paced.
+ */
+ hasSelfPaced: boolean;
+}
/**
* Snapshot of the currently active recurring prompts for this session.
*
@@ -11641,6 +12193,23 @@ export interface ScheduleList {
*/
entries: ScheduleEntry[];
}
+/**
+ * Re-arm a self-paced scheduled prompt.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ScheduleRearmSelfPacedRequest".
+ */
+/** @experimental */
+export interface ScheduleRearmSelfPacedRequest {
+ /**
+ * Id of the self-paced scheduled prompt.
+ */
+ id: number;
+ /**
+ * Epoch milliseconds when the prompt should next fire.
+ */
+ at: number;
+}
/**
* Identifier of the scheduled prompt to remove.
*
@@ -11738,7 +12307,7 @@ export interface SendMessageItem {
*/
requiredTool?: string;
/**
- * 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
*/
@@ -11828,7 +12397,7 @@ export interface SendRequest {
*/
requiredTool?: string;
/**
- * 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
*/
@@ -11866,6 +12435,21 @@ export interface SendResult {
*/
messageId: string;
}
+/**
+ * Internal request for sending a system notification.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SendSystemNotificationRequest".
+ */
+/** @experimental */
+export interface SendSystemNotificationRequest {
+ /**
+ * Notification text to deliver to the model.
+ */
+ message: string;
+ kind?: JsonValue;
+ options?: JsonValue;
+}
/**
* Agents discovered across user, project, plugin, and remote sources.
*
@@ -12328,7 +12912,7 @@ export interface SessionFsSqliteExistsResult {
exists: boolean;
}
/**
- * SQL query, query type, and optional bind parameters for executing 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. The provider applies its SQLite busy timeout for every call.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionFsSqliteQueryRequest".
@@ -12348,7 +12932,7 @@ export interface SessionFsSqliteQueryRequest {
* Optional named bind parameters
*/
params?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
}
/**
@@ -12363,7 +12947,7 @@ export interface SessionFsSqliteQueryResult {
* For SELECT: array of row objects. For others: empty array.
*/
rows: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
}[];
/**
* Column names from the result set
@@ -12379,6 +12963,62 @@ export interface SessionFsSqliteQueryResult {
lastInsertRowid?: number;
error?: SessionFsError;
}
+/**
+ * Classified SQLite transaction failure. busyOrLocked guarantees rollback; postCommitAmbiguous must never be retried.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionFsSqliteTransactionError".
+ */
+/** @experimental */
+export interface SessionFsSqliteTransactionError {
+ errorClass: SessionFsSqliteTransactionErrorClass;
+ message: string;
+}
+/**
+ * Statements to execute atomically. Providers apply busy handling for every call.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionFsSqliteTransactionRequest".
+ */
+/** @experimental */
+export interface SessionFsSqliteTransactionRequest {
+ /**
+ * Target session identifier
+ */
+ sessionId: string;
+ statements: SessionFsSqliteTransactionStatement[];
+}
+/**
+ * One statement in an atomic SQLite transaction.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionFsSqliteTransactionStatement".
+ */
+/** @experimental */
+export interface SessionFsSqliteTransactionStatement {
+ /**
+ * SQL statement to execute.
+ */
+ query: string;
+ queryType: SessionFsSqliteQueryType;
+ /**
+ * Optional named bind parameters.
+ */
+ params?: {
+ [k: string]: JsonValue | undefined;
+ };
+}
+/**
+ * Per-statement results, or a classified transaction error.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionFsSqliteTransactionResult".
+ */
+/** @experimental */
+export interface SessionFsSqliteTransactionResult {
+ results: SessionFsSqliteQueryResult[];
+ error?: SessionFsSqliteTransactionError;
+}
/**
* Path whose metadata should be returned from the client-provided session filesystem.
*
@@ -12486,7 +13126,7 @@ export interface SessionInstalledPlugin {
source?: SessionInstalledPluginSource;
}
/**
- * 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.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionInstalledPluginSourceGitHub".
@@ -12499,10 +13139,14 @@ export interface SessionInstalledPluginSourceGitHub {
source: "github";
repo: string;
ref?: string;
+ /**
+ * Optional full 40-character hexadecimal commit SHA.
+ */
+ sha?: string;
path?: string;
}
/**
- * 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.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionInstalledPluginSourceUrl".
@@ -12515,6 +13159,10 @@ export interface SessionInstalledPluginSourceUrl {
source: "url";
url: string;
ref?: string;
+ /**
+ * Optional full 40-character hexadecimal commit SHA.
+ */
+ sha?: string;
path?: string;
}
/**
@@ -12660,7 +13308,7 @@ export interface SessionModelList {
/**
* Available models, ordered with the most preferred default first. Includes both Copilot (CAPI) models and any registry BYOK models; a BYOK model appears under its provider-qualified selection id (`provider/id`).
*/
- list: unknown[];
+ list: JsonValue[];
/**
* Cost categories for the full CAPI catalog, including picker-disabled models that Auto may select. Metadata only; entries absent from `list` are not manually selectable.
*/
@@ -12669,7 +13317,7 @@ export interface SessionModelList {
* Per-quota snapshots returned alongside the model list, keyed by quota type.
*/
quotaSnapshots?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
}
/**
@@ -12725,14 +13373,7 @@ export interface SessionOpenOptions {
* Stable integration identifier for analytics.
*/
integrationId?: string;
- /**
- * ExP assignment ('flight') data injected by an SDK integrator, in the same JSON shape the Copilot CLI fetches from the experimentation service (CopilotExpAssignmentResponse). When supplied this is fed into the FeatureFlagService exactly like CLI-fetched assignments and ExP-backed flags wait for it. When absent the session does not block on ExP.
- *
- * @internal
- */
- expAssignments?: {
- [k: string]: unknown | undefined;
- };
+ expAssignments?: JsonValue;
/**
* Opt-in: self-fetch and enforce enterprise managed settings at session bootstrap.
*/
@@ -12807,12 +13448,14 @@ export interface SessionOpenOptions {
* Whether shell-script safety heuristics are enabled.
*/
enableScriptSafety?: boolean;
+ shell?: ShellOptions;
/**
- * Shell init profile.
+ * @deprecated
+ * Use shell.initProfile instead. Shell init profile.
*/
shellInitProfile?: string;
/**
- * Per-shell process flags.
+ * PowerShell process flags applied to built-in and user-requested shell commands.
*/
shellProcessFlags?: string[];
sandboxConfig?: SandboxConfig;
@@ -12901,6 +13544,10 @@ export interface SessionOpenOptions {
* Override directory for session event logs.
*/
eventsLogDirectory?: string;
+ /**
+ * Whether subagent callback events should be forwarded into the session event log sink.
+ */
+ eventsLogIncludesSubagents?: boolean;
/**
* Override Copilot configuration directory.
*/
@@ -12917,6 +13564,48 @@ export interface SessionOpenOptions {
*/
sessionCapabilities?: SessionCapability[];
}
+/**
+ * Per-session settings for built-in shell tools.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ShellOptions".
+ */
+/** @experimental */
+export interface ShellOptions {
+ initProfile?: ShellInitProfile;
+ /**
+ * 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.
+ */
+ initScripts?: ShellInitScript[];
+ /**
+ * 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`.
+ */
+ processFlags?: string[];
+}
+/**
+ * A host-provided script sourced before each built-in shell command when its shell target matches the active shell.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "ShellInitScript".
+ */
+/** @experimental */
+export interface ShellInitScript {
+ /**
+ * Path to the script to source.
+ */
+ path: string;
+ shell: ShellInitScriptShell;
+}
/**
* Content-exclusion policy supplied to `sessions.open` options, with rules, last-updated data, and scope.
*
@@ -12926,7 +13615,7 @@ export interface SessionOpenOptions {
/** @experimental */
export interface SessionOpenOptionsAdditionalContentExclusionPolicy {
rules: SessionOpenOptionsAdditionalContentExclusionPolicyRule[];
- last_updated_at: unknown;
+ last_updated_at: JsonValue;
scope: SessionOpenOptionsAdditionalContentExclusionPolicyScope;
}
/**
@@ -13070,14 +13759,7 @@ export interface SessionsOpenCloud {
*/
owner?: string;
options?: SessionOpenOptions;
- /**
- * In-process callback invoked when the cloud task is created (before connection). Marked internal because a function reference cannot cross the JSON-RPC boundary. Disappears in the SDK migration: the field is purely cosmetic (it flips a single CLI phase label from 'creating' to 'connecting') and the wire-clean version just drops the intermediate phase.
- *
- * @internal
- */
- onTaskCreated?: {
- [k: string]: unknown | undefined;
- };
+ onTaskCreated?: JsonValue;
}
/**
* Parameters for fetching a remote session and handing it off to a new local session.
@@ -13094,22 +13776,8 @@ export interface SessionsOpenHandoff {
metadata: RemoteSessionMetadataValue;
options?: SessionOpenOptions;
taskType?: SessionsOpenHandoffTaskType;
- /**
- * In-process progress callback `(update) => void` invoked for each handoff step. Marked internal because a function reference cannot cross the JSON-RPC boundary. The host-side `handoffSession` is already declared as `AsyncGenerator`; the schema layer flattens it because it does not yet support streaming methods. The wire-clean replacement is to expose the AsyncGenerator directly (or use vscode-jsonrpc `$/progress` notifications) once the schema/transport layer supports it.
- *
- * @internal
- */
- onProgress?: {
- [k: string]: unknown | undefined;
- };
- /**
- * In-process confirmation callback `(request) => boolean | Promise` invoked when the handoff needs the caller to confirm a non-fatal blocker (e.g. a repository mismatch between the current working directory and the remote session). Returning `true` proceeds with the handoff; returning `false` (or omitting the callback) aborts it. Marked internal because a function reference cannot cross the JSON-RPC boundary, for the same reasons as `onProgress`.
- *
- * @internal
- */
- onConfirm?: {
- [k: string]: unknown | undefined;
- };
+ onProgress?: JsonValue;
+ onConfirm?: JsonValue;
}
/**
* Result of opening a session.
@@ -13124,16 +13792,7 @@ export interface SessionOpenResult {
* Opened session ID. Omitted when status is `not_found`.
*/
sessionId?: string;
- /**
- * In-process SessionClientApi handle for the opened session, returned to CLI callers as a transitional shortcut. Marked internal so the public SDK surface does not expose it; SDK consumers should construct per-session clients from `sessionId` instead.
- *
- * @internal
- *
- * @internal
- */
- sessionApi?: {
- [k: string]: unknown | undefined;
- };
+ sessionApi?: JsonValue;
/**
* Startup prompts queued by user-level hook configs at session creation. Only populated when status is `created`; resumed sessions return an empty array.
*/
@@ -13252,6 +13911,23 @@ export interface SessionsCloseRequest {
*/
/** @experimental */
export interface SessionsCloseResult {}
+/**
+ * Session ID to delete from disk.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionsDeleteRequest".
+ */
+/** @experimental */
+export interface SessionsDeleteRequest {
+ /**
+ * Session ID to delete
+ */
+ sessionId: string;
+ /**
+ * Internal resolved session directory path to delete
+ */
+ sessionPath?: string | null;
+}
/**
* Session metadata records to enrich with summary and context information.
*
@@ -13585,6 +14261,29 @@ export interface SessionsGetLastForContextResult {
*/
sessionId?: string;
}
+/**
+ * Session ID whose persisted metadata should be read.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionsGetMetadataRequest".
+ */
+/** @experimental */
+export interface SessionsGetMetadataRequest {
+ /**
+ * Session ID to inspect
+ */
+ sessionId: string;
+}
+/**
+ * Persisted local session metadata when the session exists.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionsGetMetadataResult".
+ */
+/** @experimental */
+export interface SessionsGetMetadataResult {
+ session?: LocalSessionMetadataValue;
+}
/**
* Session ID to look up the persisted remote-steerable flag for.
*
@@ -13626,6 +14325,32 @@ export interface SessionSizes {
[k: string]: number | undefined;
};
}
+/**
+ * Limit for non-empty local session IDs.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionsListNonEmptySessionIdsRequest".
+ */
+/** @experimental */
+export interface SessionsListNonEmptySessionIdsRequest {
+ /**
+ * Maximum number of session IDs to return.
+ */
+ limit?: number;
+}
+/**
+ * Recent local session IDs that contain user-visible history.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "SessionsListNonEmptySessionIdsResult".
+ */
+/** @experimental */
+export interface SessionsListNonEmptySessionIdsResult {
+ /**
+ * Session IDs ordered newest-first.
+ */
+ sessionIds: string[];
+}
/**
* Optional source filter, metadata-load limit, and context filter applied to the returned sessions.
*
@@ -13912,12 +14637,14 @@ export interface SessionUpdateOptionsParams {
* Whether shell-script safety heuristics are enabled.
*/
enableScriptSafety?: boolean;
+ shell?: ShellOptions;
/**
- * Shell init profile (`None` or `NonInteractive`).
+ * @deprecated
+ * Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`).
*/
shellInitProfile?: string;
/**
- * Per-shell process flags (e.g., `pwsh` arguments).
+ * PowerShell process flags applied to built-in and user-requested shell commands.
*/
shellProcessFlags?: string[];
sandboxConfig?: SandboxConfig;
@@ -14006,6 +14733,10 @@ export interface SessionUpdateOptionsParams {
* Override directory for the session-events log. When unset, the runtime's default events log directory is used.
*/
eventsLogDirectory?: string;
+ /**
+ * Whether subagent callback events should be forwarded into the session event log sink.
+ */
+ eventsLogIncludesSubagents?: boolean;
/**
* Additional content-exclusion policies to merge into the session's policy set.
*
@@ -15000,7 +15731,7 @@ export interface Tool {
* JSON Schema for the tool's input parameters
*/
parameters?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* Optional instructions for how to use this tool effectively
@@ -15428,22 +16159,8 @@ export interface UIEphemeralQueryRequest {
* Question to answer from the current conversation context.
*/
question: string;
- /**
- * In-process streaming callback `(text) => void` invoked with each token as the model emits it. Marked internal: excluded from the public SDK surface. In a process-separated SDK this is replaced by a streaming RPC that yields chunks and a final answer.
- *
- * @internal
- */
- onChunk?: {
- [k: string]: unknown | undefined;
- };
- /**
- * In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Marked internal: excluded from the public SDK surface. Replaced by an explicit cancellation token + cancel RPC in the SDK migration.
- *
- * @internal
- */
- abortSignal?: {
- [k: string]: unknown | undefined;
- };
+ onChunk?: JsonValue;
+ abortSignal?: JsonValue;
}
/**
* Transient answer generated from current conversation context.
@@ -15479,6 +16196,10 @@ export interface UIExitPlanModeResponse {
* Feedback from the user when they declined the plan or requested changes.
*/
feedback?: string;
+ /**
+ * 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.
+ */
+ deferImplementation?: boolean;
}
/**
* Request ID of a pending `auto_mode_switch.requested` event and the user's response.
@@ -15887,18 +16608,8 @@ export interface UserRequestedShellCommandResult {
*/
/** @experimental */
export interface UserSettingMetadata {
- /**
- * The effective value: the user's value if set, otherwise the default.
- */
- value: {
- [k: string]: unknown | undefined;
- };
- /**
- * The centrally-known default for this setting (null when no default is registered).
- */
- default: {
- [k: string]: unknown | undefined;
- };
+ value: JsonValue;
+ default: JsonValue;
/**
* True when the user has not set an explicit value for this setting (i.e. it is left at its default). Reflects whether the user has overridden the key, not whether the effective value happens to equal the default — a key explicitly set to a value identical to the default still reports false.
*/
@@ -15927,12 +16638,7 @@ export interface UserSettingsGetResult {
*/
/** @experimental */
export interface UserSettingsSetRequest {
- /**
- * Partial user settings to write, as a free-form object keyed by setting name
- */
- settings: {
- [k: string]: unknown | undefined;
- };
+ settings: JsonValue;
}
/**
* Outcome of writing user settings.
@@ -16042,6 +16748,48 @@ export interface WorkspaceDiffResult {
*/
isFallback: boolean;
}
+/**
+ * Compaction summary checkpoint to persist.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "WorkspacesAddSummaryRequest".
+ */
+/** @experimental */
+export interface WorkspacesAddSummaryRequest {
+ /**
+ * Summary title shown in checkpoint listings.
+ */
+ title: string;
+ /**
+ * Markdown summary content to persist.
+ */
+ content: string;
+}
+/**
+ * Persisted summary metadata and refreshed workspace metadata.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "WorkspacesAddSummaryResult".
+ */
+/** @experimental */
+export interface WorkspacesAddSummaryResult {
+ summary?: {};
+ workspace?: {};
+ [k: string]: unknown | undefined;
+}
+/**
+ * Whether the autopilot objective file exists.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "WorkspacesAutopilotObjectiveExistsResult".
+ */
+/** @experimental */
+export interface WorkspacesAutopilotObjectiveExistsResult {
+ /**
+ * True when the objective file exists.
+ */
+ exists: boolean;
+}
/**
* Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename.
*
@@ -16080,6 +16828,19 @@ export interface WorkspacesCreateFileRequest {
*/
content: string;
}
+/**
+ * Result of deleting the autopilot objective file.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "WorkspacesDeleteAutopilotObjectiveResult".
+ */
+/** @experimental */
+export interface WorkspacesDeleteAutopilotObjectiveResult {
+ /**
+ * True when a file was deleted.
+ */
+ deleted: boolean;
+}
/**
* Parameters for computing a workspace diff.
*
@@ -16094,6 +16855,16 @@ export interface WorkspacesDiffRequest {
*/
ignoreWhitespace?: boolean;
}
+/**
+ * Optional session context used when creating a local workspace.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "WorkspacesEnsureRequest".
+ */
+/** @experimental */
+export interface WorkspacesEnsureRequest {
+ context?: JsonValue;
+}
/**
* Current workspace metadata for the session, including its absolute filesystem path when available.
*
@@ -16155,6 +16926,19 @@ export interface WorkspacesListFilesResult {
*/
files: string[];
}
+/**
+ * Autopilot objective file content, or null when missing.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "WorkspacesReadAutopilotObjectiveResult".
+ */
+/** @experimental */
+export interface WorkspacesReadAutopilotObjectiveResult {
+ /**
+ * Autopilot objective file content, or null when missing.
+ */
+ content: string | null;
+}
/**
* Checkpoint number to read.
*
@@ -16246,6 +17030,59 @@ export interface WorkspacesSaveLargePasteResult {
sizeBytes: number;
} | null;
}
+/**
+ * Rollback point for local workspace summaries.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "WorkspacesTruncateSummariesRequest".
+ */
+/** @experimental */
+export interface WorkspacesTruncateSummariesRequest {
+ /**
+ * Number of newest summaries to keep.
+ */
+ keepCount: number;
+}
+/**
+ * Workspace metadata fields to update.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "WorkspacesUpdateMetadataRequest".
+ */
+/** @experimental */
+export interface WorkspacesUpdateMetadataRequest {
+ context?: JsonValue;
+ /**
+ * Optional workspace display name override.
+ */
+ name?: string;
+}
+/**
+ * Autopilot objective file content to persist.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "WorkspacesWriteAutopilotObjectiveRequest".
+ */
+/** @experimental */
+export interface WorkspacesWriteAutopilotObjectiveRequest {
+ /**
+ * Autopilot objective file content.
+ */
+ content: string;
+}
+/**
+ * Result of writing the autopilot objective file.
+ *
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
+ * via the `definition` "WorkspacesWriteAutopilotObjectiveResult".
+ */
+/** @experimental */
+export interface WorkspacesWriteAutopilotObjectiveResult {
+ /**
+ * Filesystem operation performed.
+ */
+ operation: string;
+}
/**
* Standard MCP CallToolResult
*
@@ -16254,7 +17091,7 @@ export interface WorkspacesSaveLargePasteResult {
*/
/** @experimental */
export interface SessionMcpAppsCallToolResult {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
}
/**
* Identifies the target session.
@@ -16927,6 +17764,24 @@ export function createInternalServerRpc(connection: MessageConnection) {
connection.sendRequest("connect", params),
/** @experimental */
sessions: {
+ /**
+ * Reads lightweight persisted metadata for one local session without opening it.
+ *
+ * @param params Session ID whose persisted metadata should be read.
+ *
+ * @returns Persisted local session metadata when the session exists.
+ */
+ getMetadata: async (params: SessionsGetMetadataRequest): Promise =>
+ connection.sendRequest("sessions.getMetadata", params),
+ /**
+ * Lists recent local session IDs that contain user-visible history, omitting housekeeping-only sessions.
+ *
+ * @param params Limit for non-empty local session IDs.
+ *
+ * @returns Recent local session IDs that contain user-visible history.
+ */
+ listNonEmptySessionIds: async (params: SessionsListNonEmptySessionIdsRequest): Promise =>
+ connection.sendRequest("sessions.listNonEmptySessionIds", params),
/**
* Computes the absolute path to a session's persisted events.jsonl file. Internal: filesystem paths are only meaningful in-process (CLI and runtime share a filesystem). Currently used by the CLI's contribution-graph feature to read historical events directly. Remote SDK consumers must not depend on this; a proper event-query API would replace it if the contribution graph ever needed to work over the wire.
*
@@ -16945,6 +17800,13 @@ export function createInternalServerRpc(connection: MessageConnection) {
*/
getPersistedRemoteSteerable: async (params: SessionsGetPersistedRemoteSteerableRequest): Promise =>
connection.sendRequest("sessions.getPersistedRemoteSteerable", params),
+ /**
+ * Deletes one local session from disk after running the same lifecycle hooks as the session manager.
+ *
+ * @param params Session ID to delete from disk.
+ */
+ delete: async (params: SessionsDeleteRequest): Promise =>
+ connection.sendRequest("sessions.delete", params),
/**
* Gets the dynamic-context board entry count associated with a session, when available. Internal: this exists solely so CLI telemetry events (`rem_spawn_gate`, `rem_consolidation_complete`) can pair START / END board counts around the detached rem-agent spawn. "Dynamic context board" is a runtime-internal concept that is not part of the public SDK contract; the long-term plan is to relocate the telemetry emission into the runtime so this method can be deleted entirely.
*
@@ -17017,6 +17879,26 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin
*/
abort: async (params: AbortRequest): Promise =>
connection.sendRequest("session.abort", { sessionId, ...params }),
+ /**
+ * 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.
+ *
+ * @param params Parameters for interrupting the main agent turn.
+ *
+ * @returns Result of interrupting the main agent turn.
+ *
+ * @experimental
+ */
+ interruptMainTurn: async (params: InterruptMainTurnRequest): Promise =>
+ connection.sendRequest("session.interruptMainTurn", { sessionId, ...params }),
+ /**
+ * Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running.
+ *
+ * @returns The number of running background agents (task-registry agents) that were cancelled.
+ *
+ * @experimental
+ */
+ cancelAllBackgroundAgents: async (): Promise =>
+ connection.sendRequest("session.cancelAllBackgroundAgents", { sessionId }),
/**
* 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.
*
@@ -17113,6 +17995,15 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin
*/
run: async (params: FactoryRunRequest): Promise =>
connection.sendRequest("session.factory.run", { sessionId, ...params }),
+ /**
+ * Resumes a factory run using its persisted name, arguments, journal, and accounting.
+ *
+ * @param params Parameters for resuming a factory run from its persisted identity.
+ *
+ * @returns Resolved persisted factory identity and resumed run envelope.
+ */
+ resume: async (params: FactoryResumeRequest): Promise =>
+ connection.sendRequest("session.factory.resume", { sessionId, ...params }),
/**
* Gets the current or settled envelope for a factory run.
*
@@ -17122,6 +18013,31 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin
*/
getRun: async (params: FactoryGetRunRequest): Promise =>
connection.sendRequest("session.factory.getRun", { sessionId, ...params }),
+ /**
+ * Lists durable factory runs for this session in creation order.
+ *
+ * @returns Factory runs in durable creation order.
+ */
+ listRuns: async (): Promise =>
+ connection.sendRequest("session.factory.listRuns", { sessionId }),
+ /**
+ * Gets durable and live observability detail for one factory run.
+ *
+ * @param params Parameters for retrieving a factory run.
+ *
+ * @returns Full factory run observability detail.
+ */
+ getRunDetail: async (params: FactoryGetRunRequest): Promise =>
+ connection.sendRequest("session.factory.getRunDetail", { sessionId, ...params }),
+ /**
+ * Pages durable progress for one factory run.
+ *
+ * @param params Parameters for paging factory progress.
+ *
+ * @returns A bidirectional page of factory progress.
+ */
+ getRunProgress: async (params: FactoryGetRunProgressRequest): Promise =>
+ connection.sendRequest("session.factory.getRunProgress", { sessionId, ...params }),
/**
* Requests cancellation of a factory run and returns its run envelope.
*
@@ -17296,6 +18212,24 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin
*/
getWorkspace: async (): Promise =>
connection.sendRequest("session.workspaces.getWorkspace", { sessionId }),
+ /**
+ * Updates workspace metadata for a local session and returns the refreshed workspace.
+ *
+ * @param params Workspace metadata fields to update.
+ *
+ * @returns Current workspace metadata for the session, including its absolute filesystem path when available.
+ */
+ updateMetadata: async (params: WorkspacesUpdateMetadataRequest): Promise =>
+ connection.sendRequest("session.workspaces.updateMetadata", { sessionId, ...params }),
+ /**
+ * Ensures a local session workspace exists and returns it.
+ *
+ * @param params Optional session context used when creating a local workspace.
+ *
+ * @returns Current workspace metadata for the session, including its absolute filesystem path when available.
+ */
+ ensure: async (params: WorkspacesEnsureRequest): Promise =>
+ connection.sendRequest("session.workspaces.ensure", { sessionId, ...params }),
/**
* Lists files stored in the session workspace files directory.
*
@@ -17335,6 +18269,54 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin
*/
readCheckpoint: async (params: WorkspacesReadCheckpointRequest): Promise =>
connection.sendRequest("session.workspaces.readCheckpoint", { sessionId, ...params }),
+ /**
+ * Adds a compaction summary checkpoint to the local session workspace.
+ *
+ * @param params Compaction summary checkpoint to persist.
+ *
+ * @returns Persisted summary metadata and refreshed workspace metadata.
+ */
+ addSummary: async (params: WorkspacesAddSummaryRequest): Promise =>
+ connection.sendRequest("session.workspaces.addSummary", { sessionId, ...params }),
+ /**
+ * Truncates local workspace compaction summaries after a rollback.
+ *
+ * @param params Rollback point for local workspace summaries.
+ *
+ * @returns Current workspace metadata for the session, including its absolute filesystem path when available.
+ */
+ truncateSummaries: async (params: WorkspacesTruncateSummariesRequest): Promise =>
+ connection.sendRequest("session.workspaces.truncateSummaries", { sessionId, ...params }),
+ /**
+ * Reads the autopilot objective state file from the local session workspace.
+ *
+ * @returns Autopilot objective file content, or null when missing.
+ */
+ readAutopilotObjective: async (): Promise =>
+ connection.sendRequest("session.workspaces.readAutopilotObjective", { sessionId }),
+ /**
+ * Writes the autopilot objective state file in the local session workspace.
+ *
+ * @param params Autopilot objective file content to persist.
+ *
+ * @returns Result of writing the autopilot objective file.
+ */
+ writeAutopilotObjective: async (params: WorkspacesWriteAutopilotObjectiveRequest): Promise =>
+ connection.sendRequest("session.workspaces.writeAutopilotObjective", { sessionId, ...params }),
+ /**
+ * Deletes the autopilot objective state file from the local session workspace.
+ *
+ * @returns Result of deleting the autopilot objective file.
+ */
+ deleteAutopilotObjective: async (): Promise =>
+ connection.sendRequest("session.workspaces.deleteAutopilotObjective", { sessionId }),
+ /**
+ * Checks whether the local session workspace has an autopilot objective state file.
+ *
+ * @returns Whether the autopilot objective file exists.
+ */
+ autopilotObjectiveExists: async (): Promise =>
+ connection.sendRequest("session.workspaces.autopilotObjectiveExists", { sessionId }),
/**
* Saves pasted content as a UTF-8 file in the session workspace.
*
@@ -17689,6 +18671,15 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin
*/
login: async (params: McpOauthLoginRequest): Promise =>
connection.sendRequest("session.mcp.oauth.login", { sessionId, ...params }),
+ /**
+ * Responds to a pending MCP OAuth authorization request by its request id.
+ *
+ * @param params Pending MCP OAuth request id to respond to.
+ *
+ * @returns Indicates whether the pending MCP OAuth response was accepted.
+ */
+ respond: async (params: McpOauthRespondRequest): Promise =>
+ connection.sendRequest("session.mcp.oauth.respond", { sessionId, ...params }),
},
/** @experimental */
headers: {
@@ -18589,6 +19580,15 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin
*/
export function createInternalSessionRpc(connection: MessageConnection, sessionId: string) {
return {
+ /**
+ * Queues or sends an internal system notification to the session according to its passive policy.
+ *
+ * @param params Internal request for sending a system notification.
+ *
+ * @experimental
+ */
+ sendSystemNotification: async (params: SendSystemNotificationRequest): Promise =>
+ connection.sendRequest("session.sendSystemNotification", { sessionId, ...params }),
/** @experimental */
mcp: {
/**
@@ -18643,6 +19643,129 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI
evaluatePredicate: async (params: SessionSettingsEvaluatePredicateRequest): Promise =>
connection.sendRequest("session.settings.evaluatePredicate", { sessionId, ...params }),
},
+ /** @experimental */
+ queue: {
+ /**
+ * Returns the internal native queue snapshot for in-process session orchestration.
+ *
+ * @returns Internal snapshot of native queue state for local session orchestration.
+ */
+ snapshot: async (): Promise =>
+ connection.sendRequest("session.queue.snapshot", { sessionId }),
+ /**
+ * Reports whether the local session has native queued work pending.
+ *
+ * @returns Whether the native queue has pending work.
+ */
+ hasPending: async (): Promise =>
+ connection.sendRequest("session.queue.hasPending", { sessionId }),
+ /**
+ * Begins a native deferred-idle drain when background work has quiesced.
+ *
+ * @param params Inputs for starting a deferred-idle drain.
+ *
+ * @returns Whether a deferred-idle drain should run.
+ */
+ beginDeferredIdleDrain: async (params: QueueBeginDeferredIdleDrainRequest): Promise =>
+ connection.sendRequest("session.queue.beginDeferredIdleDrain", { sessionId, ...params }),
+ /**
+ * Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle.
+ *
+ * @param params Inputs for completing a deferred-idle drain.
+ *
+ * @returns Action selected by the native deferred-idle drain.
+ */
+ finishDeferredIdleDrain: async (params: QueueFinishDeferredIdleDrainRequest): Promise =>
+ connection.sendRequest("session.queue.finishDeferredIdleDrain", { sessionId, ...params }),
+ /**
+ * Marks session.idle as deferred by native background work state.
+ *
+ * @param params Inputs for marking session.idle deferred in native state.
+ */
+ deferSessionIdle: async (params: QueueDeferSessionIdleRequest): Promise =>
+ connection.sendRequest("session.queue.deferSessionIdle", { sessionId, ...params }),
+ /**
+ * Consumes queued native system notifications matching an internal filter.
+ *
+ * @param params Internal filter for consuming queued system notifications.
+ *
+ * @returns Indicates whether a user-facing pending item was removed.
+ */
+ consumeSystemNotifications: async (params: QueueConsumeSystemNotificationsRequest): Promise =>
+ connection.sendRequest("session.queue.consumeSystemNotifications", { sessionId, ...params }),
+ /**
+ * Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn.
+ *
+ * @returns Result of enqueueing the resume-pending wake item.
+ */
+ enqueueResumePending: async (): Promise =>
+ connection.sendRequest("session.queue.enqueueResumePending", { sessionId }),
+ /**
+ * Drains the native local-session work queue for in-process session orchestration.
+ */
+ process: async (): Promise =>
+ connection.sendRequest("session.queue.process", { sessionId }),
+ },
+ /** @experimental */
+ schedule: {
+ /**
+ * Hydrates the native schedule registry from persisted session events.
+ */
+ hydrate: async (): Promise =>
+ connection.sendRequest("session.schedule.hydrate", { sessionId }),
+ /**
+ * Reports whether the session has an active self-paced scheduled prompt.
+ *
+ * @returns Whether the session currently has an active self-paced schedule.
+ */
+ hasSelfPaced: async (): Promise =>
+ connection.sendRequest("session.schedule.hasSelfPaced", { sessionId }),
+ /**
+ * Registers a relative-interval scheduled prompt.
+ *
+ * @param params Register a relative-interval scheduled prompt.
+ *
+ * @returns Result of registering or re-arming a scheduled prompt.
+ */
+ add: async (params: ScheduleAddRequest): Promise =>
+ connection.sendRequest("session.schedule.add", { sessionId, ...params }),
+ /**
+ * Registers a recurring cron scheduled prompt.
+ *
+ * @param params Register a cron scheduled prompt.
+ *
+ * @returns Result of registering or re-arming a scheduled prompt.
+ */
+ addCron: async (params: ScheduleAddCronRequest): Promise =>
+ connection.sendRequest("session.schedule.addCron", { sessionId, ...params }),
+ /**
+ * Registers an absolute-time scheduled prompt.
+ *
+ * @param params Register an absolute-time scheduled prompt.
+ *
+ * @returns Result of registering or re-arming a scheduled prompt.
+ */
+ addAt: async (params: ScheduleAddAtRequest): Promise =>
+ connection.sendRequest("session.schedule.addAt", { sessionId, ...params }),
+ /**
+ * Registers a self-paced scheduled prompt.
+ *
+ * @param params Register a self-paced scheduled prompt.
+ *
+ * @returns Result of registering or re-arming a scheduled prompt.
+ */
+ addSelfPaced: async (params: ScheduleAddSelfPacedRequest): Promise =>
+ connection.sendRequest("session.schedule.addSelfPaced", { sessionId, ...params }),
+ /**
+ * Re-arms an active self-paced scheduled prompt.
+ *
+ * @param params Re-arm a self-paced scheduled prompt.
+ *
+ * @returns Result of registering or re-arming a scheduled prompt.
+ */
+ rearmSelfPaced: async (params: ScheduleRearmSelfPacedRequest): Promise =>
+ connection.sendRequest("session.schedule.rearmSelfPaced", { sessionId, ...params }),
+ },
};
}
@@ -18764,13 +19887,21 @@ export interface SessionFsHandler {
*/
rename(params: SessionFsRenameRequest): Promise;
/**
- * Executes a SQLite query against the per-session database.
+ * Executes a SQLite query against the per-session database. Providers apply busy handling for every call.
*
- * @param params SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database.
+ * @param params 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.
*
* @returns Query results including rows, columns, and rows affected, or a filesystem error if execution failed.
*/
sqliteQuery(params: SessionFsSqliteQueryRequest): Promise;
+ /**
+ * Executes SQLite statements atomically on the provider-owned connection.
+ *
+ * @param params Statements to execute atomically. Providers apply busy handling for every call.
+ *
+ * @returns Per-statement results, or a classified transaction error.
+ */
+ sqliteTransaction(params: SessionFsSqliteTransactionRequest): Promise;
/**
* Checks whether the per-session SQLite database already exists, without creating it.
*
@@ -18896,6 +20027,11 @@ export function registerClientSessionApiHandlers(
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
return handler.sqliteQuery(params);
});
+ connection.onRequest("sessionFs.sqliteTransaction", async (params: SessionFsSqliteTransactionRequest) => {
+ const handler = getHandlers(params.sessionId).sessionFs;
+ if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
+ return handler.sqliteTransaction(params);
+ });
connection.onRequest("sessionFs.sqliteExists", async (params: SessionFsSqliteExistsRequest) => {
const handler = getHandlers(params.sessionId).sessionFs;
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts
index b9c9612b8..2975a47ec 100644
--- a/nodejs/src/generated/session-events.ts
+++ b/nodejs/src/generated/session-events.ts
@@ -1,3 +1,5 @@
+export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
+
/**
* AUTO-GENERATED FILE - DO NOT EDIT
* Generated from: session-events.schema.json
@@ -104,6 +106,7 @@ export type SessionEvent =
| ExitPlanModeCompletedEvent
| ToolsUpdatedEvent
| BackgroundTasksChangedEvent
+ | FactoryRunUpdatedEvent
| SkillsLoadedEvent
| CustomAgentsUpdatedEvent
| McpServersLoadedEvent
@@ -156,6 +159,14 @@ export type Verbosity =
| "medium"
/** A more detailed response was requested. */
| "high";
+/**
+ * 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.
+ */
+export type ScheduleOrigin =
+ /** The schedule was created by an explicit user action, such as `/every` or `/after`. */
+ | "user"
+ /** The schedule was created by the agent via the `manage_schedule` tool. */
+ | "model";
/**
* The type of operation performed on the autopilot objective state file
*/
@@ -595,6 +606,7 @@ export type ElicitationCompletedAction =
| "decline"
/** The user dismissed the request. */
| "cancel";
+export type ElicitationCompletedContent = JsonValue | undefined;
/**
* Reason the runtime is requesting host-provided MCP OAuth credentials
*/
@@ -635,6 +647,7 @@ export type McpHeadersRefreshCompletedOutcome =
| "none"
/** No response arrived within the bounded window. */
| "timeout";
+export type CustomNotificationPayload = JsonValue;
/**
* The user's auto-mode-switch choice
*/
@@ -1242,6 +1255,7 @@ export interface ScheduleCreatedData {
* Interval between ticks in milliseconds (relative-interval schedules)
*/
intervalMs?: number;
+ origin?: ScheduleOrigin;
/**
* Prompt text that gets enqueued on every tick
*/
@@ -2656,7 +2670,7 @@ export interface UserMessageData {
*/
parentAgentTaskId?: string;
/**
- * 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-` for an inter-agent prompt)
*/
source?: string;
/**
@@ -3093,12 +3107,7 @@ export interface AttachmentExtensionContext {
* Open canvas instance identifier when the push was bound to a canvas instance
*/
instanceId?: string;
- /**
- * Caller-supplied JSON payload
- */
- payload?: {
- [k: string]: unknown | undefined;
- };
+ payload?: JsonValue;
/**
* Human-readable composer pill label
*/
@@ -3365,6 +3374,7 @@ export interface AssistantReasoningData {
* Unique identifier for this reasoning block
*/
reasoningId: string;
+ rte?: boolean;
}
/**
* Session event "assistant.reasoning_delta". Streaming reasoning delta for incremental extended thinking updates
@@ -3593,6 +3603,7 @@ export interface AssistantMessageData {
* GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
*/
requestId?: string;
+ rte?: boolean;
serverTools?: AssistantMessageServerTools;
/**
* Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
@@ -3672,12 +3683,7 @@ export interface CitationReference {
*/
citedText?: string;
location?: CitationLocation;
- /**
- * Provider-native citation correlation data (e.g. Anthropic search_result_index / document_index), passed through opaquely for debugging and forward compatibility.
- */
- providerMetadata?: {
- [k: string]: unknown | undefined;
- };
+ providerMetadata?: JsonValue;
/**
* Identifier of the CitationSource this reference points to (CitationSource.id).
*/
@@ -3746,20 +3752,15 @@ export interface AssistantMessageServerTools {
functionCallNamespaces?: {
[k: string]: string | undefined;
};
- items?: unknown[];
+ items?: JsonValue[];
provider: string;
- rawContentBlocks?: unknown[];
+ rawContentBlocks?: JsonValue[];
}
/**
* A tool invocation request from the assistant
*/
export interface AssistantMessageToolRequest {
- /**
- * Arguments to pass to the tool, format depends on the tool
- */
- arguments?: {
- [k: string]: unknown | undefined;
- };
+ arguments?: JsonValue;
/**
* Resolved intention summary describing what this specific call does
*/
@@ -4037,6 +4038,10 @@ export interface AssistantUsageData {
* Number of input tokens consumed
*/
inputTokens?: number;
+ /**
+ * 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.
+ */
+ interactionType?: string;
/**
* Average inter-token latency in milliseconds. Only available for streaming requests
*/
@@ -4074,6 +4079,7 @@ export interface AssistantUsageData {
* Number of output tokens used for reasoning (e.g., chain-of-thought)
*/
reasoningTokens?: number;
+ rte?: boolean;
/**
* Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
*/
@@ -4289,6 +4295,7 @@ export interface ModelCallFailureData {
*/
reasoningEffort?: string;
requestFingerprint?: ModelCallFailureRequestFingerprint;
+ rte?: boolean;
/**
* Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
*/
@@ -4447,12 +4454,7 @@ export interface ToolUserRequestedEvent {
* User-initiated tool invocation request with tool name and arguments
*/
export interface ToolUserRequestedData {
- /**
- * Arguments for the tool invocation
- */
- arguments?: {
- [k: string]: unknown | undefined;
- };
+ arguments?: JsonValue;
/**
* Unique identifier for this tool call
*/
@@ -4496,12 +4498,7 @@ export interface ToolExecutionStartEvent {
* Tool execution startup details including MCP server information when applicable
*/
export interface ToolExecutionStartData {
- /**
- * Arguments passed to the tool
- */
- arguments?: {
- [k: string]: unknown | undefined;
- };
+ arguments?: JsonValue;
/**
* When true, the tool output should be displayed expanded (verbatim) in the CLI timeline
*/
@@ -4523,6 +4520,7 @@ export interface ToolExecutionStartData {
* Tool call ID of the parent tool invocation when this event originates from a sub-agent
*/
parentToolCallId?: string;
+ rte?: boolean;
shellToolInfo?: ToolExecutionStartShellToolInfo;
/**
* Unique identifier for this tool call
@@ -4713,14 +4711,7 @@ export interface ToolExecutionCompleteData {
* Whether this tool call was explicitly requested by the user rather than the assistant
*/
isUserRequested?: boolean;
- /**
- * FIDES IFC label projected from tool ingress metadata (MCP `CallToolResult._meta` or synthesized built-in ingress labels). Persisted as `{ ifc: ... }` so the label survives session resume, including model-visible failure results. Experimental.
- *
- * @experimental
- */
- mcpMeta?: {
- [k: string]: unknown | undefined;
- };
+ mcpMeta?: JsonValue;
/**
* Model identifier that generated this tool call
*/
@@ -4731,6 +4722,7 @@ export interface ToolExecutionCompleteData {
*/
parentToolCallId?: string;
result?: ToolExecutionCompleteResult;
+ rte?: boolean;
/**
* Whether this tool execution ran inside a sandbox container
*/
@@ -4748,7 +4740,7 @@ export interface ToolExecutionCompleteData {
* Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts)
*/
toolTelemetry?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event
@@ -4796,20 +4788,8 @@ export interface ToolExecutionCompleteResult {
* Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent.
*/
detailedContent?: string;
- /**
- * FIDES IFC label projected from tool ingress metadata (MCP `CallToolResult._meta` or synthesized built-in ingress labels) — persisted as `{ ifc: ... }` (only the `ifc` key, not the whole `_meta`). Persisted so the FIDES IFC label survives session resume: the engine rehydrates accumulated taint by replaying these on load. Populated for ingress sources when FIDES IFC is on. Experimental.
- *
- * @experimental
- */
- mcpMeta?: {
- [k: string]: unknown | undefined;
- };
- /**
- * Structured content (arbitrary JSON) returned verbatim by the MCP tool
- */
- structuredContent?: {
- [k: string]: unknown | undefined;
- };
+ mcpMeta?: JsonValue;
+ structuredContent?: JsonValue;
uiResource?: ToolExecutionCompleteUIResource;
}
/**
@@ -4828,7 +4808,7 @@ export interface PersistedBinaryImage {
* Optional metadata from the producing tool.
*/
metadata?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* MIME type of the binary data
@@ -4853,7 +4833,7 @@ export interface OmittedBinaryResult {
* Optional metadata from the producing tool.
*/
metadata?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* MIME type of the omitted binary data
@@ -4883,7 +4863,7 @@ export interface BinaryAssetReference {
* Optional metadata from the producing tool.
*/
metadata?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* MIME type of the referenced binary data
@@ -5641,12 +5621,7 @@ export interface HookStartData {
* Type of hook being invoked (e.g., "preToolUse", "postToolUse", "sessionStart")
*/
hookType: string;
- /**
- * Input data passed to the hook
- */
- input?: {
- [k: string]: unknown | undefined;
- };
+ input?: JsonValue;
}
/**
* Session event "hook.end". Hook invocation completion details including output, success status, and error information
@@ -5691,12 +5666,7 @@ export interface HookEndData {
* Type of hook that was invoked (e.g., "preToolUse", "postToolUse", "sessionStart")
*/
hookType: string;
- /**
- * Output data produced by the hook
- */
- output?: {
- [k: string]: unknown | undefined;
- };
+ output?: JsonValue;
/**
* Whether the hook completed successfully
*/
@@ -5817,7 +5787,7 @@ export interface BinaryAssetData {
* Optional metadata from the producing tool.
*/
metadata?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* MIME type of the binary asset
@@ -5863,6 +5833,10 @@ export interface SystemMessageData {
* The system or developer prompt text sent as model input
*/
content: string;
+ /**
+ * Logical interaction identifier for the model run receiving this prompt
+ */
+ interactionId?: string;
metadata?: SystemMessageMetadata;
/**
* Optional name identifier for the message source
@@ -5882,7 +5856,7 @@ export interface SystemMessageMetadata {
* Template variables used when constructing the prompt
*/
variables?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
}
/**
@@ -6254,12 +6228,7 @@ export interface PermissionRequestRead {
* MCP tool invocation permission request
*/
export interface PermissionRequestMcp {
- /**
- * Arguments to pass to the MCP tool
- */
- args?: {
- [k: string]: unknown | undefined;
- };
+ args?: JsonValue;
/**
* Permission kind discriminator
*/
@@ -6349,12 +6318,7 @@ export interface PermissionRequestMemory {
* Custom tool invocation permission request
*/
export interface PermissionRequestCustomTool {
- /**
- * Arguments to pass to the custom tool
- */
- args?: {
- [k: string]: unknown | undefined;
- };
+ args?: JsonValue;
/**
* Permission kind discriminator
*/
@@ -6384,12 +6348,7 @@ export interface PermissionRequestHook {
* Permission kind discriminator
*/
kind: "hook";
- /**
- * Arguments of the tool call being gated
- */
- toolArgs?: {
- [k: string]: unknown | undefined;
- };
+ toolArgs?: JsonValue;
/**
* Tool call ID that triggered this permission request
*/
@@ -6561,12 +6520,7 @@ export interface PermissionPromptRequestRead {
* MCP tool invocation permission prompt
*/
export interface PermissionPromptRequestMcp {
- /**
- * Arguments to pass to the MCP tool
- */
- args?: {
- [k: string]: unknown | undefined;
- };
+ args?: JsonValue;
/**
* Auto-approval judge information for this request; present only when auto mode is enabled.
*
@@ -6670,12 +6624,7 @@ export interface PermissionPromptRequestMemory {
* Custom tool invocation permission prompt
*/
export interface PermissionPromptRequestCustomTool {
- /**
- * Arguments to pass to the custom tool
- */
- args?: {
- [k: string]: unknown | undefined;
- };
+ args?: JsonValue;
/**
* Auto-approval judge information for this request; present only when auto mode is enabled.
*
@@ -6741,12 +6690,7 @@ export interface PermissionPromptRequestHook {
* Prompt kind discriminator
*/
kind: "hook";
- /**
- * Arguments of the tool call being gated
- */
- toolArgs?: {
- [k: string]: unknown | undefined;
- };
+ toolArgs?: JsonValue;
/**
* Tool call ID that triggered this permission request
*/
@@ -7249,7 +7193,7 @@ export interface ElicitationRequestedSchema {
* Form field definitions, keyed by field name
*/
properties: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* List of required field names
@@ -7306,12 +7250,6 @@ export interface ElicitationCompletedData {
*/
requestId: string;
}
-/**
- * Opaque JSON value submitted for one field in accepted `elicitation.completed` form content.
- */
-export interface ElicitationCompletedContent {
- [k: string]: unknown | undefined;
-}
/**
* Session event "sampling.requested". Sampling request from an MCP server; contains the server name and a requestId for correlation
*/
@@ -7346,12 +7284,7 @@ export interface SamplingRequestedEvent {
* Sampling request from an MCP server; contains the server name and a requestId for correlation
*/
export interface SamplingRequestedData {
- /**
- * The JSON-RPC request ID from the MCP protocol
- */
- mcpRequestId: {
- [k: string]: unknown | undefined;
- };
+ mcpRequestId: JsonValue;
/**
* Unique identifier for this sampling request; used to respond via session.respondToSampling()
*/
@@ -7700,12 +7633,6 @@ export interface CustomNotificationData {
*/
version?: number;
}
-/**
- * Source-defined JSON payload for the custom notification
- */
-export interface CustomNotificationPayload {
- [k: string]: unknown | undefined;
-}
/**
* Optional source-defined string identifiers describing the payload subject
*/
@@ -7746,12 +7673,7 @@ export interface ExternalToolRequestedEvent {
* External tool invocation request for client-side tool execution
*/
export interface ExternalToolRequestedData {
- /**
- * Arguments to pass to the external tool
- */
- arguments?: {
- [k: string]: unknown | undefined;
- };
+ arguments?: JsonValue;
/**
* Unique identifier for this request; used to respond via session.respondToExternalTool()
*/
@@ -8257,12 +8179,7 @@ export interface ManagedSettingsResolvedData {
* Whether the server (account/org) managed-settings layer was present
*/
serverManaged: boolean;
- /**
- * The effective (resolved) managed settings values, so clients can render exactly what is enforced. Absent when no managed policy is in force.
- */
- settings?: {
- [k: string]: unknown | undefined;
- };
+ settings?: JsonValue;
source: ManagedSettingsResolvedSource;
}
/**
@@ -8598,6 +8515,48 @@ export interface BackgroundTasksChangedEvent {
* Empty payload for `session.background_tasks_changed`, indicating background task state changed.
*/
export interface BackgroundTasksChangedData {}
+/**
+ * Session event "factory.run_updated". Ephemeral invalidation signal for a changed factory run.
+ */
+/** @experimental */
+export interface FactoryRunUpdatedEvent {
+ /**
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
+ */
+ agentId?: string;
+ data: FactoryRunUpdatedData;
+ /**
+ * Always true for events that are transient and not persisted to the session event log on disk.
+ */
+ ephemeral: true;
+ /**
+ * Unique event identifier (UUID v4), generated when the event is emitted
+ */
+ id: string;
+ /**
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
+ */
+ parentId: string | null;
+ /**
+ * ISO 8601 timestamp when the event was created
+ */
+ timestamp: string;
+ /**
+ * Type discriminator. Always "factory.run_updated".
+ */
+ type: "factory.run_updated";
+}
+/**
+ * Ephemeral invalidation signal for a changed factory run.
+ */
+/** @experimental */
+export interface FactoryRunUpdatedData {
+ /**
+ * Monotonic revision now available for the run.
+ */
+ revision: number;
+ runId: string;
+}
/**
* Session event "session.skills_loaded". Payload of `session.skills_loaded` listing resolved skill metadata.
*/
@@ -9063,12 +9022,7 @@ export interface CanvasOpenedData {
* Host-local PNG path for the canvas icon, when supplied
*/
icon?: string;
- /**
- * Input supplied when the instance was opened
- */
- input?: {
- [k: string]: unknown | undefined;
- };
+ input?: JsonValue;
/**
* Stable caller-supplied canvas instance identifier
*/
@@ -9160,12 +9114,7 @@ export interface CanvasRegistryChangedCanvas {
* Host-local PNG path for the canvas icon, when supplied
*/
icon?: string;
- /**
- * JSON Schema for canvas open input
- */
- inputSchema?: {
- [k: string]: unknown | undefined;
- };
+ inputSchema?: JsonValue;
}
/**
* A single action within a canvas declaration, with its name, optional description, and optional input schema.
@@ -9176,12 +9125,7 @@ export interface CanvasRegistryChangedCanvasAction {
* Action description
*/
description?: string;
- /**
- * JSON Schema for action input
- */
- inputSchema?: {
- [k: string]: unknown | undefined;
- };
+ inputSchema?: JsonValue;
/**
* Action name
*/
@@ -9329,12 +9273,7 @@ export interface CanvasRecordedData {
* Owning provider identifier
*/
extensionId: string;
- /**
- * Input supplied when the instance was opened
- */
- input?: {
- [k: string]: unknown | undefined;
- };
+ input?: JsonValue;
/**
* Stable caller-supplied canvas instance identifier
*/
@@ -9470,7 +9409,7 @@ export interface McpAppToolCallCompleteData {
* Arguments passed to the tool by the app view, if any
*/
arguments?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* Wall-clock duration of the underlying tools/call in milliseconds
@@ -9481,7 +9420,7 @@ export interface McpAppToolCallCompleteData {
* Standard MCP CallToolResult returned by the server. Present whether or not the call set isError.
*/
result?: {
- [k: string]: unknown | undefined;
+ [k: string]: JsonValue | undefined;
};
/**
* Name of the MCP server hosting the tool
diff --git a/nodejs/src/sessionFsProvider.ts b/nodejs/src/sessionFsProvider.ts
index 0bc198750..adec69a6d 100644
--- a/nodejs/src/sessionFsProvider.ts
+++ b/nodejs/src/sessionFsProvider.ts
@@ -9,6 +9,7 @@ import type {
SessionFsReaddirWithTypesEntry,
SessionFsSqliteQueryResult as GeneratedSqliteQueryResult,
SessionFsSqliteQueryType,
+ SessionFsSqliteTransactionStatement,
} from "./generated/rpc.js";
export type { SessionFsSqliteQueryType };
@@ -45,6 +46,19 @@ export interface SessionFsSqliteProvider {
params?: Record
): Promise;
+ /**
+ * Execute statements atomically on the provider-owned connection.
+ *
+ * Apply SQLite busy handling for every call and roll back before throwing.
+ *
+ * Optional: a provider that predates this capability, or cannot offer
+ * atomicity, may omit it. Callers then receive a classified `fatal`
+ * transaction error rather than a partially applied batch.
+ */
+ transaction?(
+ statements: SessionFsSqliteTransactionStatement[]
+ ): Promise;
+
/**
* Check whether the per-session database already exists, without creating it.
*/
@@ -219,6 +233,35 @@ export function createSessionFsAdapter(provider: SessionFsProvider): SessionFsHa
);
return result ?? { rows: [], columns: [], rowsAffected: 0 };
},
+ sqliteTransaction: async ({ statements }) => {
+ if (!provider.sqlite?.transaction) {
+ return {
+ results: [],
+ error: {
+ errorClass: "fatal",
+ message: provider.sqlite
+ ? "Atomic SQLite transactions are not supported by this provider"
+ : "SQLite is not supported by this provider",
+ },
+ };
+ }
+ try {
+ const normalized = statements.map((statement) => ({
+ ...statement,
+ params: normalizeSqliteParams(statement.params),
+ }));
+ return { results: await provider.sqlite.transaction(normalized) };
+ } catch (err) {
+ const errorClass = sqliteTransactionErrorClass(err);
+ return {
+ results: [],
+ error: {
+ errorClass,
+ message: err instanceof Error ? err.message : String(err),
+ },
+ };
+ }
+ },
sqliteExists: async () => {
if (!provider.sqlite) {
throw new Error("SQLite is not supported by this provider");
@@ -228,6 +271,31 @@ export function createSessionFsAdapter(provider: SessionFsProvider): SessionFsHa
};
}
+function sqliteTransactionErrorClass(
+ err: unknown
+): "busyOrLocked" | "fatal" | "postCommitAmbiguous" {
+ if (typeof err !== "object" || err === null) {
+ return "fatal";
+ }
+ const classified = "errorClass" in err ? err.errorClass : undefined;
+ if (
+ classified === "busyOrLocked" ||
+ classified === "fatal" ||
+ classified === "postCommitAmbiguous"
+ ) {
+ return classified;
+ }
+ const code = "code" in err ? err.code : undefined;
+ const errcode = "errcode" in err ? err.errcode : undefined;
+ return code === "SQLITE_BUSY" ||
+ code === "SQLITE_LOCKED" ||
+ code === "EBUSY" ||
+ errcode === 5 ||
+ errcode === 6
+ ? "busyOrLocked"
+ : "fatal";
+}
+
function toSessionFsError(err: unknown): SessionFsError {
const e = err as NodeJS.ErrnoException;
const code = e.code === "ENOENT" ? "ENOENT" : "UNKNOWN";
diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts
index 5f89ca3be..6cd0cdd39 100644
--- a/nodejs/src/types.ts
+++ b/nodejs/src/types.ts
@@ -18,6 +18,7 @@ import type {
import type { CopilotSession } from "./session.js";
import type {
GitHubTelemetryNotification,
+ JsonValue,
ModelBillingTokenPrices,
OpenCanvasInstance,
RemoteSessionMode,
@@ -443,7 +444,7 @@ export type ToolBinaryResult = {
description?: string;
};
-export type ToolTelemetry = Record | undefined>;
+export type ToolTelemetry = Record;
export type ToolResultObject = {
textResultForLlm: string;
diff --git a/nodejs/test/e2e/rpc_session_state.e2e.test.ts b/nodejs/test/e2e/rpc_session_state.e2e.test.ts
index 5164f9923..9a2fe9ff2 100644
--- a/nodejs/test/e2e/rpc_session_state.e2e.test.ts
+++ b/nodejs/test/e2e/rpc_session_state.e2e.test.ts
@@ -414,22 +414,22 @@ describe("Session-scoped RPC", async () => {
}
);
- await expect(
- session.rpc.lsp.initialize({
- workingDirectory: optionsDirectory,
- gitRoot: initialDirectory,
- force: true,
- })
- ).resolves.toBeNull();
+ // `lsp.initialize` is declared `Promise`, so its resolved value
+ // is not part of the contract — only that the call resolves.
+ await session.rpc.lsp.initialize({
+ workingDirectory: optionsDirectory,
+ gitRoot: initialDirectory,
+ force: true,
+ });
- await expect(
- session.rpc.telemetry.setFeatureOverrides({
- features: {
- rpc_session_state_feature: featureName,
- rpc_session_state_value: "enabled",
- },
- })
- ).resolves.toBeNull();
+ // `telemetry.setFeatureOverrides` is declared `Promise`, so its
+ // resolved value is not part of the contract — only that it resolves.
+ await session.rpc.telemetry.setFeatureOverrides({
+ features: {
+ rpc_session_state_feature: featureName,
+ rpc_session_state_value: "enabled",
+ },
+ });
await expect(session.rpc.tools.initializeAndValidate()).resolves.toBeDefined();
expect(
diff --git a/nodejs/test/session-event-types.test.ts b/nodejs/test/session-event-types.test.ts
index 37b49f8a4..63f64b8d9 100644
--- a/nodejs/test/session-event-types.test.ts
+++ b/nodejs/test/session-event-types.test.ts
@@ -97,7 +97,7 @@ describe("Session event type exports (#1156)", () => {
expect(data.toolName).toBe("shell");
expect(data.toolCallId).toBe("call-1");
- expect(data.arguments?.command).toBe("ls");
+ expect(data.arguments).toEqual({ command: "ls" });
expect(data.mcpServerName).toBe("filesystem");
expect(data.mcpToolName).toBe("list_dir");
expect(data.turnId).toBe("turn-1");
diff --git a/nodejs/test/typescript-codegen.test.ts b/nodejs/test/typescript-codegen.test.ts
index 248b60968..974542809 100644
--- a/nodejs/test/typescript-codegen.test.ts
+++ b/nodejs/test/typescript-codegen.test.ts
@@ -2,7 +2,10 @@ import type { JSONSchema7 } from "json-schema";
import { compile } from "json-schema-to-typescript";
import { describe, expect, it } from "vitest";
-import { normalizeSchemaForTypeScript } from "../../scripts/codegen/typescript.ts";
+import {
+ normalizeSchemaForTypeScript,
+ TYPESCRIPT_JSON_VALUE_DECLARATION,
+} from "../../scripts/codegen/typescript.ts";
describe("typescript schema codegen", () => {
it("emits JSDoc comments for described enum values", async () => {
@@ -43,4 +46,37 @@ describe("typescript schema codegen", () => {
);
expect(code).toContain('inlineMode: /** Use a direct value. */ "direct" | "indirect";');
});
+
+ it("maps opaque JSON fields to the recursive JsonValue type", async () => {
+ const schema: JSONSchema7 = {
+ title: "OpaqueContainer",
+ type: "object",
+ additionalProperties: false,
+ properties: {
+ payload: {
+ "x-opaque-json": true,
+ },
+ },
+ required: ["payload"],
+ };
+
+ const normalized = normalizeSchemaForTypeScript(schema);
+ expect(normalized.properties?.payload).toEqual({
+ tsType: "JsonValue",
+ });
+
+ const code = await compile(normalized, "OpaqueContainer", {
+ bannerComment: "",
+ style: { semi: true, singleQuote: false },
+ additionalProperties: false,
+ });
+
+ expect(`${TYPESCRIPT_JSON_VALUE_DECLARATION}\n\n${code.trim()}`).toBe(
+ `export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
+
+export interface OpaqueContainer {
+ payload: JsonValue;
+}`
+ );
+ });
});
diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py
index 713e78cca..4b6f4f0ba 100644
--- a/python/copilot/generated/rpc.py
+++ b/python/copilot/generated/rpc.py
@@ -1244,11 +1244,14 @@ class _ConnectRequest:
enable_git_hub_telemetry_forwarding: bool | None = None
"""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.
"""
token: str | None = None
"""Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN"""
@@ -2177,6 +2180,65 @@ def to_dict(self) -> dict:
result["result"] = self.result
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class FactoryAgentSummary:
+ """Prompt-safe durable identity and live status for a direct factory agent."""
+
+ active_ms: int
+ agent_id: str
+ agent_type: str
+ label: str
+ run_id: str
+ status: str
+ tool_call_id: str
+ activity: str | None = None
+ completed_at: int | None = None
+ phase_id: str | None = None
+ requested_model: str | None = None
+ resolved_model: str | None = None
+ started_at: int | None = None
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'FactoryAgentSummary':
+ assert isinstance(obj, dict)
+ active_ms = from_int(obj.get("activeMs"))
+ agent_id = from_str(obj.get("agentId"))
+ agent_type = from_str(obj.get("agentType"))
+ label = from_str(obj.get("label"))
+ run_id = from_str(obj.get("runId"))
+ status = from_str(obj.get("status"))
+ tool_call_id = from_str(obj.get("toolCallId"))
+ activity = from_union([from_str, from_none], obj.get("activity"))
+ completed_at = from_union([from_int, from_none], obj.get("completedAt"))
+ phase_id = from_union([from_none, from_str], obj.get("phaseId"))
+ requested_model = from_union([from_str, from_none], obj.get("requestedModel"))
+ resolved_model = from_union([from_str, from_none], obj.get("resolvedModel"))
+ started_at = from_union([from_int, from_none], obj.get("startedAt"))
+ return FactoryAgentSummary(active_ms, agent_id, agent_type, label, run_id, status, tool_call_id, activity, completed_at, phase_id, requested_model, resolved_model, started_at)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["activeMs"] = from_int(self.active_ms)
+ result["agentId"] = from_str(self.agent_id)
+ result["agentType"] = from_str(self.agent_type)
+ result["label"] = from_str(self.label)
+ result["runId"] = from_str(self.run_id)
+ result["status"] = from_str(self.status)
+ result["toolCallId"] = from_str(self.tool_call_id)
+ if self.activity is not None:
+ result["activity"] = from_union([from_str, from_none], self.activity)
+ if self.completed_at is not None:
+ result["completedAt"] = from_union([from_int, from_none], self.completed_at)
+ result["phaseId"] = from_union([from_none, from_str], self.phase_id)
+ if self.requested_model is not None:
+ result["requestedModel"] = from_union([from_str, from_none], self.requested_model)
+ if self.resolved_model is not None:
+ result["resolvedModel"] = from_union([from_str, from_none], self.resolved_model)
+ if self.started_at is not None:
+ result["startedAt"] = from_union([from_int, from_none], self.started_at)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class FactoryCancelRequest:
@@ -2196,6 +2258,75 @@ def to_dict(self) -> dict:
result["runId"] = from_str(self.run_id)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class FactoryCurrentPhase:
+ """Current factory phase identity."""
+
+ id: str
+ ordinal: int | None = None
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'FactoryCurrentPhase':
+ assert isinstance(obj, dict)
+ id = from_str(obj.get("id"))
+ ordinal = from_union([from_none, from_int], obj.get("ordinal"))
+ return FactoryCurrentPhase(id, ordinal)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["id"] = from_str(self.id)
+ result["ordinal"] = from_union([from_none, from_int], self.ordinal)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class FactoryDeclaredLimits:
+ """Declared or approved factory resource ceilings."""
+
+ max_ai_credits: float | None = None
+ max_concurrent_subagents: int | None = None
+ max_total_subagents: int | None = None
+ timeout_seconds: float | None = None
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'FactoryDeclaredLimits':
+ assert isinstance(obj, dict)
+ max_ai_credits = from_union([from_float, from_none], obj.get("maxAiCredits"))
+ max_concurrent_subagents = from_union([from_int, from_none], obj.get("maxConcurrentSubagents"))
+ max_total_subagents = from_union([from_int, from_none], obj.get("maxTotalSubagents"))
+ timeout_seconds = from_union([from_float, from_none], obj.get("timeoutSeconds"))
+ return FactoryDeclaredLimits(max_ai_credits, max_concurrent_subagents, max_total_subagents, timeout_seconds)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ if self.max_ai_credits is not None:
+ result["maxAiCredits"] = from_union([to_float, from_none], self.max_ai_credits)
+ if self.max_concurrent_subagents is not None:
+ result["maxConcurrentSubagents"] = from_union([from_int, from_none], self.max_concurrent_subagents)
+ if self.max_total_subagents is not None:
+ result["maxTotalSubagents"] = from_union([from_int, from_none], self.max_total_subagents)
+ if self.timeout_seconds is not None:
+ result["timeoutSeconds"] = from_union([to_float, from_none], self.timeout_seconds)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+class FactoryDurableOperation(Enum):
+ """Execution-critical factory storage operation.
+
+ Execution-critical durable operation that failed.
+ """
+ ADD_ELAPSED = "addElapsed"
+ CHARGE_CREDIT = "chargeCredit"
+ CREATE_RUN = "createRun"
+ FINISH_RUN = "finishRun"
+ JOURNAL_GET = "journalGet"
+ JOURNAL_PUT = "journalPut"
+ MARK_RUN_STARTED = "markRunStarted"
+ RECONCILE_CREDIT_TOTAL = "reconcileCreditTotal"
+ RELEASE_AGENT = "releaseAgent"
+ RESERVE_AGENT = "reserveAgent"
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class FactoryExecuteRequest:
@@ -2204,6 +2335,9 @@ class FactoryExecuteRequest:
args: Any
"""Factory input value."""
+ execution_token: str
+ """Opaque token identifying this factory execution attempt."""
+
name: str
"""Registered factory name."""
@@ -2217,14 +2351,16 @@ class FactoryExecuteRequest:
def from_dict(obj: Any) -> 'FactoryExecuteRequest':
assert isinstance(obj, dict)
args = obj.get("args")
+ execution_token = from_str(obj.get("executionToken"))
name = from_str(obj.get("name"))
run_id = from_str(obj.get("runId"))
session_id = from_str(obj.get("sessionId"))
- return FactoryExecuteRequest(args, name, run_id, session_id)
+ return FactoryExecuteRequest(args, execution_token, name, run_id, session_id)
def to_dict(self) -> dict:
result: dict = {}
result["args"] = self.args
+ result["executionToken"] = from_str(self.execution_token)
result["name"] = from_str(self.name)
result["runId"] = from_str(self.run_id)
result["sessionId"] = from_str(self.session_id)
@@ -2235,7 +2371,7 @@ def to_dict(self) -> dict:
class FactoryExecuteResult:
"""Result returned by an extension factory closure."""
- result: Any
+ result: Any = None
"""Factory result value."""
@staticmethod
@@ -2246,7 +2382,51 @@ def from_dict(obj: Any) -> 'FactoryExecuteResult':
def to_dict(self) -> dict:
result: dict = {}
- result["result"] = self.result
+ if self.result is not None:
+ result["result"] = self.result
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class FactoryGetRunProgressRequest:
+ """Parameters for paging factory progress."""
+
+ run_id: str
+ """Factory run identifier."""
+
+ after_seq: int | None = None
+ """Exclusive forward cursor."""
+
+ before_seq: int | None = None
+ """Exclusive backward cursor."""
+
+ limit: int | None = None
+ """Maximum records to return. Defaults to 200 and is capped at 500."""
+
+ phase_id: str | None = None
+ """Optional phase identifier used to scope records and cursors."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'FactoryGetRunProgressRequest':
+ assert isinstance(obj, dict)
+ run_id = from_str(obj.get("runId"))
+ after_seq = from_union([from_int, from_none], obj.get("afterSeq"))
+ before_seq = from_union([from_int, from_none], obj.get("beforeSeq"))
+ limit = from_union([from_int, from_none], obj.get("limit"))
+ phase_id = from_union([from_str, from_none], obj.get("phaseId"))
+ return FactoryGetRunProgressRequest(run_id, after_seq, before_seq, limit, phase_id)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["runId"] = from_str(self.run_id)
+ if self.after_seq is not None:
+ result["afterSeq"] = from_union([from_int, from_none], self.after_seq)
+ if self.before_seq is not None:
+ result["beforeSeq"] = from_union([from_int, from_none], self.before_seq)
+ if self.limit is not None:
+ result["limit"] = from_union([from_int, from_none], self.limit)
+ if self.phase_id is not None:
+ result["phaseId"] = from_union([from_str, from_none], self.phase_id)
return result
# Experimental: this type is part of an experimental API and may change or be removed.
@@ -2273,6 +2453,9 @@ def to_dict(self) -> dict:
class FactoryJournalGetRequest:
"""Parameters for reading a factory journal entry."""
+ execution_token: str
+ """Opaque token identifying the current factory execution attempt."""
+
key: str
"""Namespaced journal key."""
@@ -2282,12 +2465,14 @@ class FactoryJournalGetRequest:
@staticmethod
def from_dict(obj: Any) -> 'FactoryJournalGetRequest':
assert isinstance(obj, dict)
+ execution_token = from_str(obj.get("executionToken"))
key = from_str(obj.get("key"))
run_id = from_str(obj.get("runId"))
- return FactoryJournalGetRequest(key, run_id)
+ return FactoryJournalGetRequest(execution_token, key, run_id)
def to_dict(self) -> dict:
result: dict = {}
+ result["executionToken"] = from_str(self.execution_token)
result["key"] = from_str(self.key)
result["runId"] = from_str(self.run_id)
return result
@@ -2322,6 +2507,9 @@ def to_dict(self) -> dict:
class FactoryJournalPutRequest:
"""Parameters for storing a factory journal entry."""
+ execution_token: str
+ """Opaque token identifying the current factory execution attempt."""
+
key: str
"""Namespaced journal key."""
@@ -2334,26 +2522,69 @@ class FactoryJournalPutRequest:
@staticmethod
def from_dict(obj: Any) -> 'FactoryJournalPutRequest':
assert isinstance(obj, dict)
+ execution_token = from_str(obj.get("executionToken"))
key = from_str(obj.get("key"))
result_json = obj.get("resultJson")
run_id = from_str(obj.get("runId"))
- return FactoryJournalPutRequest(key, result_json, run_id)
+ return FactoryJournalPutRequest(execution_token, key, result_json, run_id)
def to_dict(self) -> dict:
result: dict = {}
+ result["executionToken"] = from_str(self.execution_token)
result["key"] = from_str(self.key)
result["resultJson"] = self.result_json
result["runId"] = from_str(self.run_id)
return result
# Experimental: this type is part of an experimental API and may change or be removed.
-class FactoryLogLineKind(Enum):
- """Progress line kind.
+@dataclass
+class FactoryListRunsRequest:
+ """Empty parameters for listing factory runs."""
+ @staticmethod
+ def from_dict(obj: Any) -> 'FactoryListRunsRequest':
+ assert isinstance(obj, dict)
+ return FactoryListRunsRequest()
- Kind of factory progress line.
+ def to_dict(self) -> dict:
+ result: dict = {}
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class FactoryRunConsumed:
+ """Durable factory resource consumption."""
+
+ active_ms: int
+ nano_aiu: int
+ subagents: int
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'FactoryRunConsumed':
+ assert isinstance(obj, dict)
+ active_ms = from_int(obj.get("activeMs"))
+ nano_aiu = from_int(obj.get("nanoAiu"))
+ subagents = from_int(obj.get("subagents"))
+ return FactoryRunConsumed(active_ms, nano_aiu, subagents)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["activeMs"] = from_int(self.active_ms)
+ result["nanoAiu"] = from_int(self.nano_aiu)
+ result["subagents"] = from_int(self.subagents)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+class FactoryRunStatus(Enum):
+ """Current or terminal state of a factory run.
+
+ Current or terminal factory run status.
"""
- LOG = "log"
- PHASE = "phase"
+ CANCELLED = "cancelled"
+ COMPLETED = "completed"
+ ERROR = "error"
+ HALTED = "halted"
+ PENDING = "pending"
+ RUNNING = "running"
# Experimental: this type is part of an experimental API and may change or be removed.
class FactoryRunFailureKind(Enum):
@@ -2361,60 +2592,81 @@ class FactoryRunFailureKind(Enum):
Cumulative resource ceiling that stopped a factory run.
"""
+ MAX_AI_CREDITS = "maxAiCredits"
MAX_TOTAL_SUBAGENTS = "maxTotalSubagents"
- TIMEOUT = "timeout"
+ TIMEOUT_SECONDS = "timeoutSeconds"
class FactoryRunFailureType(Enum):
+ FACTORY_DURABLE_FAILURE = "factory_durable_failure"
FACTORY_LIMIT_REACHED = "factory_limit_reached"
FACTORY_RESUME_DECLINED = "factory_resume_declined"
+# Experimental: this type is part of an experimental API and may change or be removed.
+class FactoryLogLineKind(Enum):
+ """Progress line kind.
+
+ Kind of factory progress line.
+
+ Progress record kind.
+ """
+ LOG = "log"
+ PHASE = "phase"
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+class FactoryPhaseStatus(Enum):
+ """Derived lifecycle state of a factory phase."""
+
+ ACTIVE = "active"
+ COMPLETED = "completed"
+ PENDING = "pending"
+ SKIPPED = "skipped"
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class FactoryRunLimits:
- """Wire-only per-invocation factory resource ceiling overrides.
+ """Optional per-invocation resource ceiling overrides.
+
+ Wire-only per-invocation factory resource ceiling overrides.
Per-invocation resource ceiling overrides.
"""
+ max_ai_credits: float | None = None
+ """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.
+ """
max_concurrent_subagents: int | None = None
"""Maximum number of factory subagents that may run concurrently."""
max_total_subagents: int | None = None
"""Maximum total number of factory subagents that may be admitted."""
- timeout: float | None = None
- """Factory active-run timeout in milliseconds."""
+ timeout_seconds: float | None = None
+ """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.
+ """
@staticmethod
def from_dict(obj: Any) -> 'FactoryRunLimits':
assert isinstance(obj, dict)
+ max_ai_credits = from_union([from_float, from_none], obj.get("maxAiCredits"))
max_concurrent_subagents = from_union([from_int, from_none], obj.get("maxConcurrentSubagents"))
max_total_subagents = from_union([from_int, from_none], obj.get("maxTotalSubagents"))
- timeout = from_union([from_float, from_none], obj.get("timeout"))
- return FactoryRunLimits(max_concurrent_subagents, max_total_subagents, timeout)
+ timeout_seconds = from_union([from_float, from_none], obj.get("timeoutSeconds"))
+ return FactoryRunLimits(max_ai_credits, max_concurrent_subagents, max_total_subagents, timeout_seconds)
def to_dict(self) -> dict:
result: dict = {}
+ if self.max_ai_credits is not None:
+ result["maxAiCredits"] = from_union([to_float, from_none], self.max_ai_credits)
if self.max_concurrent_subagents is not None:
result["maxConcurrentSubagents"] = from_union([from_int, from_none], self.max_concurrent_subagents)
if self.max_total_subagents is not None:
result["maxTotalSubagents"] = from_union([from_int, from_none], self.max_total_subagents)
- if self.timeout is not None:
- result["timeout"] = from_union([to_float, from_none], self.timeout)
+ if self.timeout_seconds is not None:
+ result["timeoutSeconds"] = from_union([to_float, from_none], self.timeout_seconds)
return result
-# Experimental: this type is part of an experimental API and may change or be removed.
-class FactoryRunStatus(Enum):
- """Current or terminal factory run status.
-
- Current or terminal state of a factory run.
- """
- CANCELLED = "cancelled"
- COMPLETED = "completed"
- ERROR = "error"
- HALTED = "halted"
- PENDING = "pending"
- RUNNING = "running"
-
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class FleetStartRequest:
@@ -2912,6 +3164,50 @@ def to_dict(self) -> dict:
result["projectPaths"] = from_union([lambda x: from_list(from_str, x), from_none], self.project_paths)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class InterruptMainTurnRequest:
+ """Parameters for interrupting the main agent turn."""
+
+ flush_queued: bool | None = None
+ """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.
+ """
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'InterruptMainTurnRequest':
+ assert isinstance(obj, dict)
+ flush_queued = from_union([from_bool, from_none], obj.get("flushQueued"))
+ return InterruptMainTurnRequest(flush_queued)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ if self.flush_queued is not None:
+ result["flushQueued"] = from_union([from_bool, from_none], self.flush_queued)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class InterruptMainTurnResult:
+ """Result of interrupting the main agent turn."""
+
+ interrupted: bool
+ """Whether an in-flight main agent turn was interrupted. False when the main loop was not
+ processing.
+ """
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'InterruptMainTurnResult':
+ assert isinstance(obj, dict)
+ interrupted = from_bool(obj.get("interrupted"))
+ return InterruptMainTurnResult(interrupted)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["interrupted"] = from_bool(self.interrupted)
+ return result
+
@dataclass
class LlmInferenceHTTPRequestChunkRequest:
"""A request body chunk or cancellation signal."""
@@ -4026,6 +4322,46 @@ def to_dict(self) -> dict:
result["authorizationUrl"] = from_union([from_str, from_none], self.authorization_url)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class MCPOauthRespondRequest:
+ """Pending MCP OAuth request id to respond to."""
+
+ request_id: str
+ """OAuth request identifier from the mcp.oauth_required event"""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'MCPOauthRespondRequest':
+ assert isinstance(obj, dict)
+ request_id = from_str(obj.get("requestId"))
+ return MCPOauthRespondRequest(request_id)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["requestId"] = from_str(self.request_id)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class MCPOauthRespondResult:
+ """Indicates whether the pending MCP OAuth response was accepted."""
+
+ success: bool
+ """Whether the response was accepted. False if the request was unknown, timed out, or
+ already resolved.
+ """
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'MCPOauthRespondResult':
+ assert isinstance(obj, dict)
+ success = from_bool(obj.get("success"))
+ return MCPOauthRespondResult(success)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["success"] = from_bool(self.success)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
# Internal: this type is an internal SDK API and is not part of the public surface.
@dataclass
@@ -6494,6 +6830,168 @@ class PushAttachmentGitHubURLType(Enum):
class PushAttachmentSelectionType(Enum):
SELECTION = "selection"
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class QueueBeginDeferredIdleDrainRequest:
+ """Inputs for starting a deferred-idle drain."""
+
+ active_background_work: bool
+ """Whether the host still has active background work."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'QueueBeginDeferredIdleDrainRequest':
+ assert isinstance(obj, dict)
+ active_background_work = from_bool(obj.get("activeBackgroundWork"))
+ return QueueBeginDeferredIdleDrainRequest(active_background_work)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["activeBackgroundWork"] = from_bool(self.active_background_work)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class QueueBeginDeferredIdleDrainResult:
+ """Whether a deferred-idle drain should run."""
+
+ should_drain: bool
+ """True when the host should run finishDeferredIdleDrain asynchronously."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'QueueBeginDeferredIdleDrainResult':
+ assert isinstance(obj, dict)
+ should_drain = from_bool(obj.get("shouldDrain"))
+ return QueueBeginDeferredIdleDrainResult(should_drain)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["shouldDrain"] = from_bool(self.should_drain)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class QueueConsumeSystemNotificationsRequest:
+ """Internal filter for consuming queued system notifications."""
+
+ filter: Any
+ """Opaque runtime-owned filter object."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'QueueConsumeSystemNotificationsRequest':
+ assert isinstance(obj, dict)
+ filter = obj.get("filter")
+ return QueueConsumeSystemNotificationsRequest(filter)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["filter"] = self.filter
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class QueueDeferSessionIdleRequest:
+ """Inputs for marking session.idle deferred in native state."""
+
+ aborted: bool
+ """Whether the deferred idle was caused by an aborted foreground turn."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'QueueDeferSessionIdleRequest':
+ assert isinstance(obj, dict)
+ aborted = from_bool(obj.get("aborted"))
+ return QueueDeferSessionIdleRequest(aborted)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["aborted"] = from_bool(self.aborted)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class QueueEnqueueResumePendingResult:
+ """Result of enqueueing the resume-pending wake item."""
+
+ queued: bool
+ """True when a wake item was newly queued."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'QueueEnqueueResumePendingResult':
+ assert isinstance(obj, dict)
+ queued = from_bool(obj.get("queued"))
+ return QueueEnqueueResumePendingResult(queued)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["queued"] = from_bool(self.queued)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class QueueFinishDeferredIdleDrainRequest:
+ """Inputs for completing a deferred-idle drain."""
+
+ active_background_work: bool
+ """Whether the host still has active background work."""
+
+ has_pending: bool
+ """Whether native queued work remains."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'QueueFinishDeferredIdleDrainRequest':
+ assert isinstance(obj, dict)
+ active_background_work = from_bool(obj.get("activeBackgroundWork"))
+ has_pending = from_bool(obj.get("hasPending"))
+ return QueueFinishDeferredIdleDrainRequest(active_background_work, has_pending)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["activeBackgroundWork"] = from_bool(self.active_background_work)
+ result["hasPending"] = from_bool(self.has_pending)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class QueueFinishDeferredIdleDrainResult:
+ """Action selected by the native deferred-idle drain."""
+
+ aborted: bool
+ """Whether the deferred idle was caused by an aborted foreground turn."""
+
+ action: str
+ """One of none, processQueue, or emitSessionIdle."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'QueueFinishDeferredIdleDrainResult':
+ assert isinstance(obj, dict)
+ aborted = from_bool(obj.get("aborted"))
+ action = from_str(obj.get("action"))
+ return QueueFinishDeferredIdleDrainResult(aborted, action)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["aborted"] = from_bool(self.aborted)
+ result["action"] = from_str(self.action)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class QueueHasPendingResult:
+ """Whether the native queue has pending work."""
+
+ has_pending: bool
+ """True when queued or immediate native work is pending."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'QueueHasPendingResult':
+ assert isinstance(obj, dict)
+ has_pending = from_bool(obj.get("hasPending"))
+ return QueueHasPendingResult(has_pending)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["hasPending"] = from_bool(self.has_pending)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
class QueuePendingItemsKind(Enum):
"""Whether this item is a queued user message or a queued slash command / model change"""
@@ -7020,10 +7518,126 @@ def to_dict(self) -> dict:
result["keychainAccess"] = from_union([from_bool, from_none], self.keychain_access)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class ScheduleAddAtRequest:
+ """Register an absolute-time scheduled prompt."""
+
+ at: int
+ """Epoch milliseconds when the prompt should fire."""
+
+ prompt: str
+ """Prompt text to enqueue when the schedule fires."""
+
+ display_prompt: str | None = None
+ """Optional display-only prompt label."""
+
+ recurring: bool | None = None
+ """Whether the schedule should re-arm after each tick. Defaults to false."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'ScheduleAddAtRequest':
+ assert isinstance(obj, dict)
+ at = from_int(obj.get("at"))
+ prompt = from_str(obj.get("prompt"))
+ display_prompt = from_union([from_str, from_none], obj.get("displayPrompt"))
+ recurring = from_union([from_bool, from_none], obj.get("recurring"))
+ return ScheduleAddAtRequest(at, prompt, display_prompt, recurring)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["at"] = from_int(self.at)
+ result["prompt"] = from_str(self.prompt)
+ if self.display_prompt is not None:
+ result["displayPrompt"] = from_union([from_str, from_none], self.display_prompt)
+ if self.recurring is not None:
+ result["recurring"] = from_union([from_bool, from_none], self.recurring)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class ScheduleAddCronRequest:
+ """Register a cron scheduled prompt."""
+
+ cron: str
+ """5-field cron expression."""
+
+ prompt: str
+ """Prompt text to enqueue when the schedule fires."""
+
+ display_prompt: str | None = None
+ """Optional display-only prompt label."""
+
+ recurring: bool | None = None
+ """Whether the schedule should re-arm after each tick. Defaults to true."""
+
+ tz: str | None = None
+ """IANA timezone for evaluating the cron expression."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'ScheduleAddCronRequest':
+ assert isinstance(obj, dict)
+ cron = from_str(obj.get("cron"))
+ prompt = from_str(obj.get("prompt"))
+ display_prompt = from_union([from_str, from_none], obj.get("displayPrompt"))
+ recurring = from_union([from_bool, from_none], obj.get("recurring"))
+ tz = from_union([from_str, from_none], obj.get("tz"))
+ return ScheduleAddCronRequest(cron, prompt, display_prompt, recurring, tz)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["cron"] = from_str(self.cron)
+ result["prompt"] = from_str(self.prompt)
+ if self.display_prompt is not None:
+ result["displayPrompt"] = from_union([from_str, from_none], self.display_prompt)
+ if self.recurring is not None:
+ result["recurring"] = from_union([from_bool, from_none], self.recurring)
+ if self.tz is not None:
+ result["tz"] = from_union([from_str, from_none], self.tz)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class ScheduleAddRequest:
+ """Register a relative-interval scheduled prompt."""
+
+ interval: str
+ """Human-readable interval such as `30s`, `5m`, or `2h`."""
+
+ prompt: str
+ """Prompt text to enqueue when the schedule fires."""
+
+ display_prompt: str | None = None
+ """Optional display-only prompt label."""
+
+ recurring: bool | None = None
+ """Whether the schedule should re-arm after each tick. Defaults to true."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'ScheduleAddRequest':
+ assert isinstance(obj, dict)
+ interval = from_str(obj.get("interval"))
+ prompt = from_str(obj.get("prompt"))
+ display_prompt = from_union([from_str, from_none], obj.get("displayPrompt"))
+ recurring = from_union([from_bool, from_none], obj.get("recurring"))
+ return ScheduleAddRequest(interval, prompt, display_prompt, recurring)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["interval"] = from_str(self.interval)
+ result["prompt"] = from_str(self.prompt)
+ if self.display_prompt is not None:
+ result["displayPrompt"] = from_union([from_str, from_none], self.display_prompt)
+ if self.recurring is not None:
+ result["recurring"] = from_union([from_bool, from_none], self.recurring)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class ScheduleEntry:
- """Scheduled prompt entry with ID, timing (`intervalMs`, `cron`, or `at`), prompt text,
+ """The registered or updated schedule entry.
+
+ Scheduled prompt entry with ID, timing (`intervalMs`, `cron`, or `at`), prompt text,
recurrence, and next run time.
The removed entry, or omitted if no entry matched.
@@ -7096,6 +7710,74 @@ def to_dict(self) -> dict:
result["tz"] = from_union([from_str, from_none], self.tz)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class ScheduleAddSelfPacedRequest:
+ """Register a self-paced scheduled prompt."""
+
+ prompt: str
+ """Prompt text to enqueue when the schedule fires."""
+
+ display_prompt: str | None = None
+ """Optional display-only prompt label."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'ScheduleAddSelfPacedRequest':
+ assert isinstance(obj, dict)
+ prompt = from_str(obj.get("prompt"))
+ display_prompt = from_union([from_str, from_none], obj.get("displayPrompt"))
+ return ScheduleAddSelfPacedRequest(prompt, display_prompt)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["prompt"] = from_str(self.prompt)
+ if self.display_prompt is not None:
+ result["displayPrompt"] = from_union([from_str, from_none], self.display_prompt)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class ScheduleHasSelfPacedResult:
+ """Whether the session currently has an active self-paced schedule."""
+
+ has_self_paced: bool
+ """True when at least one active schedule is self-paced."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'ScheduleHasSelfPacedResult':
+ assert isinstance(obj, dict)
+ has_self_paced = from_bool(obj.get("hasSelfPaced"))
+ return ScheduleHasSelfPacedResult(has_self_paced)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["hasSelfPaced"] = from_bool(self.has_self_paced)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class ScheduleRearmSelfPacedRequest:
+ """Re-arm a self-paced scheduled prompt."""
+
+ at: int
+ """Epoch milliseconds when the prompt should next fire."""
+
+ id: int
+ """Id of the self-paced scheduled prompt."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'ScheduleRearmSelfPacedRequest':
+ assert isinstance(obj, dict)
+ at = from_int(obj.get("at"))
+ id = from_int(obj.get("id"))
+ return ScheduleRearmSelfPacedRequest(at, id)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["at"] = from_int(self.at)
+ result["id"] = from_int(self.id)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class ScheduleStopRequest:
@@ -7222,10 +7904,9 @@ class SendMessageItem:
"""
# Internal: this field is an internal SDK API and is not part of the public surface.
source: str | None = None
- """Optional provenance tag copied to the resulting user.message event. Must 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.
"""
@staticmethod
@@ -7305,6 +7986,37 @@ def to_dict(self) -> dict:
result["messageId"] = from_str(self.message_id)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class SendSystemNotificationRequest:
+ """Internal request for sending a system notification."""
+
+ message: str
+ """Notification text to deliver to the model."""
+
+ kind: Any = None
+ """Optional structured notification kind."""
+
+ options: Any = None
+ """Internal delivery options, including passive policy."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'SendSystemNotificationRequest':
+ assert isinstance(obj, dict)
+ message = from_str(obj.get("message"))
+ kind = obj.get("kind")
+ options = obj.get("options")
+ return SendSystemNotificationRequest(message, kind, options)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["message"] = from_str(self.message)
+ if self.kind is not None:
+ result["kind"] = self.kind
+ if self.options is not None:
+ result["options"] = self.options
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class ServerSkill:
@@ -7779,11 +8491,21 @@ def to_dict(self) -> dict:
class SessionFSSqliteQueryType(Enum):
"""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.
"""
EXEC = "exec"
QUERY = "query"
RUN = "run"
+# Experimental: this type is part of an experimental API and may change or be removed.
+class SessionFSSqliteTransactionErrorClass(Enum):
+ """SQLite transaction failure classification."""
+
+ BUSY_OR_LOCKED = "busyOrLocked"
+ FATAL = "fatal"
+ POST_COMMIT_AMBIGUOUS = "postCommitAmbiguous"
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class SessionFSStatRequest:
@@ -7948,6 +8670,23 @@ def to_dict(self) -> dict:
result["type"] = from_str(self.type)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+class ShellInitProfile(Enum):
+ """Controls automatic non-interactive profile loading where supported. Explicit initScripts
+ are unaffected.
+ """
+ NONE = "none"
+ NON_INTERACTIVE = "non-interactive"
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+class ShellInitScriptShell(Enum):
+ """Built-in shell that may source this script.
+
+ Supported built-in shells for initialization scripts.
+ """
+ BASH = "bash"
+ POWERSHELL = "powershell"
+
class SessionOpenParamsKind(Enum):
ATTACH = "attach"
CLOUD = "cloud"
@@ -8507,6 +9246,31 @@ def to_dict(self) -> dict:
result: dict = {}
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class SessionsDeleteRequest:
+ """Session ID to delete from disk."""
+
+ session_id: str
+ """Session ID to delete"""
+
+ session_path: str | None = None
+ """Internal resolved session directory path to delete"""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'SessionsDeleteRequest':
+ assert isinstance(obj, dict)
+ session_id = from_str(obj.get("sessionId"))
+ session_path = from_union([from_none, from_str], obj.get("sessionPath"))
+ return SessionsDeleteRequest(session_id, session_path)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["sessionId"] = from_str(self.session_id)
+ if self.session_path is not None:
+ result["sessionPath"] = from_union([from_none, from_str], self.session_path)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class SessionsFindByPrefixRequest:
@@ -8743,6 +9507,25 @@ def to_dict(self) -> dict:
result["sessionId"] = from_union([from_str, from_none], self.session_id)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class SessionsGetMetadataRequest:
+ """Session ID whose persisted metadata should be read."""
+
+ session_id: str
+ """Session ID to inspect"""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'SessionsGetMetadataRequest':
+ assert isinstance(obj, dict)
+ session_id = from_str(obj.get("sessionId"))
+ return SessionsGetMetadataRequest(session_id)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["sessionId"] = from_str(self.session_id)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class SessionsGetPersistedRemoteSteerableRequest:
@@ -8785,6 +9568,45 @@ def to_dict(self) -> dict:
result["remoteSteerable"] = from_union([from_bool, from_none], self.remote_steerable)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class SessionsListNonEmptySessionIDSRequest:
+ """Limit for non-empty local session IDs."""
+
+ limit: int | None = None
+ """Maximum number of session IDs to return."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'SessionsListNonEmptySessionIDSRequest':
+ assert isinstance(obj, dict)
+ limit = from_union([from_int, from_none], obj.get("limit"))
+ return SessionsListNonEmptySessionIDSRequest(limit)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ if self.limit is not None:
+ result["limit"] = from_union([from_int, from_none], self.limit)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class SessionsListNonEmptySessionIDSResult:
+ """Recent local session IDs that contain user-visible history."""
+
+ session_ids: list[str]
+ """Session IDs ordered newest-first."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'SessionsListNonEmptySessionIDSResult':
+ assert isinstance(obj, dict)
+ session_ids = from_list(from_str, obj.get("sessionIds"))
+ return SessionsListNonEmptySessionIDSResult(session_ids)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["sessionIds"] = from_list(from_str, self.session_ids)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class SessionsLoadDeferredRepoHooksRequest:
@@ -10530,6 +11352,72 @@ class WorkspaceDiffMode(Enum):
SESSION = "session"
UNSTAGED = "unstaged"
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class WorkspacesAddSummaryRequest:
+ """Compaction summary checkpoint to persist."""
+
+ content: str
+ """Markdown summary content to persist."""
+
+ title: str
+ """Summary title shown in checkpoint listings."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'WorkspacesAddSummaryRequest':
+ assert isinstance(obj, dict)
+ content = from_str(obj.get("content"))
+ title = from_str(obj.get("title"))
+ return WorkspacesAddSummaryRequest(content, title)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["content"] = from_str(self.content)
+ result["title"] = from_str(self.title)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class WorkspacesAddSummaryResult:
+ """Persisted summary metadata and refreshed workspace metadata."""
+
+ summary: dict[str, Any] | None = None
+ workspace: dict[str, Any] | None = None
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'WorkspacesAddSummaryResult':
+ assert isinstance(obj, dict)
+ summary = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("summary"))
+ workspace = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("workspace"))
+ return WorkspacesAddSummaryResult(summary, workspace)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ if self.summary is not None:
+ result["summary"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.summary)
+ if self.workspace is not None:
+ result["workspace"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.workspace)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class WorkspacesAutopilotObjectiveExistsResult:
+ """Whether the autopilot objective file exists."""
+
+ exists: bool
+ """True when the objective file exists."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'WorkspacesAutopilotObjectiveExistsResult':
+ assert isinstance(obj, dict)
+ exists = from_bool(obj.get("exists"))
+ return WorkspacesAutopilotObjectiveExistsResult(exists)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["exists"] = from_bool(self.exists)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class WorkspacesCreateFileRequest:
@@ -10554,6 +11442,45 @@ def to_dict(self) -> dict:
result["path"] = from_str(self.path)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class WorkspacesDeleteAutopilotObjectiveResult:
+ """Result of deleting the autopilot objective file."""
+
+ deleted: bool
+ """True when a file was deleted."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'WorkspacesDeleteAutopilotObjectiveResult':
+ assert isinstance(obj, dict)
+ deleted = from_bool(obj.get("deleted"))
+ return WorkspacesDeleteAutopilotObjectiveResult(deleted)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["deleted"] = from_bool(self.deleted)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class WorkspacesEnsureRequest:
+ """Optional session context used when creating a local workspace."""
+
+ context: Any = None
+ """Opaque workspace context supplied by the session host."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'WorkspacesEnsureRequest':
+ assert isinstance(obj, dict)
+ context = obj.get("context")
+ return WorkspacesEnsureRequest(context)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ if self.context is not None:
+ result["context"] = self.context
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class WorkspacesListFilesResult:
@@ -10573,6 +11500,25 @@ def to_dict(self) -> dict:
result["files"] = from_list(from_str, self.files)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class WorkspacesReadAutopilotObjectiveResult:
+ """Autopilot objective file content, or null when missing."""
+
+ content: str | None = None
+ """Autopilot objective file content, or null when missing."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'WorkspacesReadAutopilotObjectiveResult':
+ assert isinstance(obj, dict)
+ content = from_union([from_none, from_str], obj.get("content"))
+ return WorkspacesReadAutopilotObjectiveResult(content)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["content"] = from_union([from_none, from_str], self.content)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class WorkspacesReadCheckpointRequest:
@@ -10694,6 +11640,63 @@ def to_dict(self) -> dict:
result["sizeBytes"] = from_int(self.size_bytes)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class WorkspacesTruncateSummariesRequest:
+ """Rollback point for local workspace summaries."""
+
+ keep_count: int
+ """Number of newest summaries to keep."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'WorkspacesTruncateSummariesRequest':
+ assert isinstance(obj, dict)
+ keep_count = from_int(obj.get("keepCount"))
+ return WorkspacesTruncateSummariesRequest(keep_count)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["keepCount"] = from_int(self.keep_count)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class WorkspacesWriteAutopilotObjectiveRequest:
+ """Autopilot objective file content to persist."""
+
+ content: str
+ """Autopilot objective file content."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'WorkspacesWriteAutopilotObjectiveRequest':
+ assert isinstance(obj, dict)
+ content = from_str(obj.get("content"))
+ return WorkspacesWriteAutopilotObjectiveRequest(content)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["content"] = from_str(self.content)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class WorkspacesWriteAutopilotObjectiveResult:
+ """Result of writing the autopilot objective file."""
+
+ operation: str
+ """Filesystem operation performed."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'WorkspacesWriteAutopilotObjectiveResult':
+ assert isinstance(obj, dict)
+ operation = from_str(obj.get("operation"))
+ return WorkspacesWriteAutopilotObjectiveResult(operation)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["operation"] = from_str(self.operation)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class SessionAuthStatus:
@@ -11953,28 +12956,89 @@ def to_dict(self) -> dict:
class FactoryAgentRequest:
"""Parameters for one factory-scoped subagent call."""
- factory_run_id: str
- """Factory run identifier that owns the subagent."""
+ execution_token: str
+ """Opaque token identifying the current factory execution attempt."""
+
+ factory_run_id: str
+ """Factory run identifier that owns the subagent."""
+
+ opts: FactoryAgentOptions
+ """Subagent execution options."""
+
+ prompt: str
+ """Prompt to send to the subagent."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'FactoryAgentRequest':
+ assert isinstance(obj, dict)
+ execution_token = from_str(obj.get("executionToken"))
+ factory_run_id = from_str(obj.get("factoryRunId"))
+ opts = FactoryAgentOptions.from_dict(obj.get("opts"))
+ prompt = from_str(obj.get("prompt"))
+ return FactoryAgentRequest(execution_token, factory_run_id, opts, prompt)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["executionToken"] = from_str(self.execution_token)
+ result["factoryRunId"] = from_str(self.factory_run_id)
+ result["opts"] = to_class(FactoryAgentOptions, self.opts)
+ result["prompt"] = from_str(self.prompt)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class FactoryRunFailure:
+ """Machine-readable factory run failure.
+
+ Machine-readable failure details for an errored run.
+ """
+ run_id: str
+ """Factory run identifier.
+
+ Factory run identifier whose changed limits were declined.
+ """
+ type: FactoryRunFailureType
+ kind: FactoryRunFailureKind | None = None
+ """Resource ceiling that stopped the run."""
+
+ value: float | None = None
+ """Approved effective ceiling that was reached."""
- opts: FactoryAgentOptions
- """Subagent execution options."""
+ reason: str | None = None
+ """Human-readable reason the resume did not proceed."""
- prompt: str
- """Prompt to send to the subagent."""
+ code: str | None = None
+ """Stable failure code."""
+
+ operation: FactoryDurableOperation | None = None
+ """Execution-critical durable operation that failed."""
@staticmethod
- def from_dict(obj: Any) -> 'FactoryAgentRequest':
+ def from_dict(obj: Any) -> 'FactoryRunFailure':
assert isinstance(obj, dict)
- factory_run_id = from_str(obj.get("factoryRunId"))
- opts = FactoryAgentOptions.from_dict(obj.get("opts"))
- prompt = from_str(obj.get("prompt"))
- return FactoryAgentRequest(factory_run_id, opts, prompt)
+ run_id = from_str(obj.get("runId"))
+ type = FactoryRunFailureType(obj.get("type"))
+ kind = from_union([FactoryRunFailureKind, from_none], obj.get("kind"))
+ value = from_union([from_float, from_none], obj.get("value"))
+ reason = from_union([from_str, from_none], obj.get("reason"))
+ code = from_union([from_str, from_none], obj.get("code"))
+ operation = from_union([FactoryDurableOperation, from_none], obj.get("operation"))
+ return FactoryRunFailure(run_id, type, kind, value, reason, code, operation)
def to_dict(self) -> dict:
result: dict = {}
- result["factoryRunId"] = from_str(self.factory_run_id)
- result["opts"] = to_class(FactoryAgentOptions, self.opts)
- result["prompt"] = from_str(self.prompt)
+ result["runId"] = from_str(self.run_id)
+ result["type"] = to_enum(FactoryRunFailureType, self.type)
+ if self.kind is not None:
+ result["kind"] = from_union([lambda x: to_enum(FactoryRunFailureKind, x), from_none], self.kind)
+ if self.value is not None:
+ result["value"] = from_union([to_float, from_none], self.value)
+ if self.reason is not None:
+ result["reason"] = from_union([from_str, from_none], self.reason)
+ if self.code is not None:
+ result["code"] = from_union([from_str, from_none], self.code)
+ if self.operation is not None:
+ result["operation"] = from_union([lambda x: to_enum(FactoryDurableOperation, x), from_none], self.operation)
return result
# Experimental: this type is part of an experimental API and may change or be removed.
@@ -12008,46 +13072,128 @@ def to_dict(self) -> dict:
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
-class FactoryRunFailure:
- """Machine-readable factory run failure.
+class FactoryProgressLine:
+ """One durable factory progress record."""
- Machine-readable failure details for an errored run.
- """
- run_id: str
- """Factory run identifier.
+ attempt: int
+ """Resume attempt that emitted this record."""
- Factory run identifier whose changed limits were declined.
- """
- type: FactoryRunFailureType
- kind: FactoryRunFailureKind | None = None
- """Resource ceiling that stopped the run."""
+ kind: FactoryLogLineKind
+ """Progress record kind."""
- value: float | None = None
- """Approved effective ceiling that was reached."""
+ recorded_at: int
+ """Epoch milliseconds when the record was persisted."""
- reason: str | None = None
- """Human-readable reason the resume did not proceed."""
+ seq: int
+ """Global monotonic sequence number within the run."""
+
+ text: str
+ """Prompt-safe progress text."""
+
+ phase_id: str | None = None
+ """Phase active when the record was emitted, or null before any phase."""
@staticmethod
- def from_dict(obj: Any) -> 'FactoryRunFailure':
+ def from_dict(obj: Any) -> 'FactoryProgressLine':
+ assert isinstance(obj, dict)
+ attempt = from_int(obj.get("attempt"))
+ kind = FactoryLogLineKind(obj.get("kind"))
+ recorded_at = from_int(obj.get("recordedAt"))
+ seq = from_int(obj.get("seq"))
+ text = from_str(obj.get("text"))
+ phase_id = from_union([from_none, from_str], obj.get("phaseId"))
+ return FactoryProgressLine(attempt, kind, recorded_at, seq, text, phase_id)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["attempt"] = from_int(self.attempt)
+ result["kind"] = to_enum(FactoryLogLineKind, self.kind)
+ result["recordedAt"] = from_int(self.recorded_at)
+ result["seq"] = from_int(self.seq)
+ result["text"] = from_str(self.text)
+ result["phaseId"] = from_union([from_none, from_str], self.phase_id)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class FactoryPhaseObservation:
+ """Durable lifecycle and timing for one factory phase."""
+
+ accumulated_active_ms: int
+ current_active_ms: int
+ entry_count: int
+ id: str
+ last_entered_run_attempt: int
+ live_agent_count: int
+ status: FactoryPhaseStatus
+ title: str
+ total_agent_count: int
+ completed_at: int | None = None
+ detail: str | None = None
+ ordinal: int | None = None
+ started_at: int | None = None
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'FactoryPhaseObservation':
+ assert isinstance(obj, dict)
+ accumulated_active_ms = from_int(obj.get("accumulatedActiveMs"))
+ current_active_ms = from_int(obj.get("currentActiveMs"))
+ entry_count = from_int(obj.get("entryCount"))
+ id = from_str(obj.get("id"))
+ last_entered_run_attempt = from_int(obj.get("lastEnteredRunAttempt"))
+ live_agent_count = from_int(obj.get("liveAgentCount"))
+ status = FactoryPhaseStatus(obj.get("status"))
+ title = from_str(obj.get("title"))
+ total_agent_count = from_int(obj.get("totalAgentCount"))
+ completed_at = from_union([from_int, from_none], obj.get("completedAt"))
+ detail = from_union([from_str, from_none], obj.get("detail"))
+ ordinal = from_union([from_none, from_int], obj.get("ordinal"))
+ started_at = from_union([from_int, from_none], obj.get("startedAt"))
+ return FactoryPhaseObservation(accumulated_active_ms, current_active_ms, entry_count, id, last_entered_run_attempt, live_agent_count, status, title, total_agent_count, completed_at, detail, ordinal, started_at)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ result["accumulatedActiveMs"] = from_int(self.accumulated_active_ms)
+ result["currentActiveMs"] = from_int(self.current_active_ms)
+ result["entryCount"] = from_int(self.entry_count)
+ result["id"] = from_str(self.id)
+ result["lastEnteredRunAttempt"] = from_int(self.last_entered_run_attempt)
+ result["liveAgentCount"] = from_int(self.live_agent_count)
+ result["status"] = to_enum(FactoryPhaseStatus, self.status)
+ result["title"] = from_str(self.title)
+ result["totalAgentCount"] = from_int(self.total_agent_count)
+ if self.completed_at is not None:
+ result["completedAt"] = from_union([from_int, from_none], self.completed_at)
+ if self.detail is not None:
+ result["detail"] = from_union([from_str, from_none], self.detail)
+ result["ordinal"] = from_union([from_none, from_int], self.ordinal)
+ if self.started_at is not None:
+ result["startedAt"] = from_union([from_int, from_none], self.started_at)
+ return result
+
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class FactoryResumeRequest:
+ """Parameters for resuming a factory run from its persisted identity."""
+
+ run_id: str
+ """Factory run identifier."""
+
+ limits: FactoryRunLimits | None = None
+ """Optional per-invocation resource ceiling overrides."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'FactoryResumeRequest':
assert isinstance(obj, dict)
run_id = from_str(obj.get("runId"))
- type = FactoryRunFailureType(obj.get("type"))
- kind = from_union([FactoryRunFailureKind, from_none], obj.get("kind"))
- value = from_union([from_float, from_none], obj.get("value"))
- reason = from_union([from_str, from_none], obj.get("reason"))
- return FactoryRunFailure(run_id, type, kind, value, reason)
+ limits = from_union([FactoryRunLimits.from_dict, from_none], obj.get("limits"))
+ return FactoryResumeRequest(run_id, limits)
def to_dict(self) -> dict:
result: dict = {}
result["runId"] = from_str(self.run_id)
- result["type"] = to_enum(FactoryRunFailureType, self.type)
- if self.kind is not None:
- result["kind"] = from_union([lambda x: to_enum(FactoryRunFailureKind, x), from_none], self.kind)
- if self.value is not None:
- result["value"] = from_union([to_float, from_none], self.value)
- if self.reason is not None:
- result["reason"] = from_union([from_str, from_none], self.reason)
+ if self.limits is not None:
+ result["limits"] = from_union([lambda x: to_class(FactoryRunLimits, x), from_none], self.limits)
return result
# Experimental: this type is part of an experimental API and may change or be removed.
@@ -12149,11 +13295,11 @@ def to_dict(self) -> dict:
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class InstalledPluginSource:
- """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.
- 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.
Source descriptor for a direct local plugin install, with a local filesystem path.
"""
@@ -12167,6 +13313,9 @@ class InstalledPluginSource:
path: str | None = None
ref: str | None = None
repo: str | None = None
+ sha: str | None = None
+ """Optional full 40-character hexadecimal commit SHA."""
+
url: str | None = None
@staticmethod
@@ -12176,8 +13325,9 @@ def from_dict(obj: Any) -> 'InstalledPluginSource':
path = from_union([from_str, from_none], obj.get("path"))
ref = from_union([from_str, from_none], obj.get("ref"))
repo = from_union([from_str, from_none], obj.get("repo"))
+ sha = from_union([from_str, from_none], obj.get("sha"))
url = from_union([from_str, from_none], obj.get("url"))
- return InstalledPluginSource(source, path, ref, repo, url)
+ return InstalledPluginSource(source, path, ref, repo, sha, url)
def to_dict(self) -> dict:
result: dict = {}
@@ -12188,6 +13338,8 @@ def to_dict(self) -> dict:
result["ref"] = from_union([from_str, from_none], self.ref)
if self.repo is not None:
result["repo"] = from_union([from_str, from_none], self.repo)
+ if self.sha is not None:
+ result["sha"] = from_union([from_str, from_none], self.sha)
if self.url is not None:
result["url"] = from_union([from_str, from_none], self.url)
return result
@@ -12195,11 +13347,11 @@ def to_dict(self) -> dict:
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class SessionInstalledPluginSource:
- """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.
- 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.
Source descriptor for a direct local plugin install, with a local filesystem path.
"""
@@ -12213,6 +13365,9 @@ class SessionInstalledPluginSource:
path: str | None = None
ref: str | None = None
repo: str | None = None
+ sha: str | None = None
+ """Optional full 40-character hexadecimal commit SHA."""
+
url: str | None = None
@staticmethod
@@ -12222,8 +13377,9 @@ def from_dict(obj: Any) -> 'SessionInstalledPluginSource':
path = from_union([from_str, from_none], obj.get("path"))
ref = from_union([from_str, from_none], obj.get("ref"))
repo = from_union([from_str, from_none], obj.get("repo"))
+ sha = from_union([from_str, from_none], obj.get("sha"))
url = from_union([from_str, from_none], obj.get("url"))
- return SessionInstalledPluginSource(source, path, ref, repo, url)
+ return SessionInstalledPluginSource(source, path, ref, repo, sha, url)
def to_dict(self) -> dict:
result: dict = {}
@@ -12234,6 +13390,8 @@ def to_dict(self) -> dict:
result["ref"] = from_union([from_str, from_none], self.ref)
if self.repo is not None:
result["repo"] = from_union([from_str, from_none], self.repo)
+ if self.sha is not None:
+ result["sha"] = from_union([from_str, from_none], self.sha)
if self.url is not None:
result["url"] = from_union([from_str, from_none], self.url)
return result
@@ -12241,8 +13399,8 @@ def to_dict(self) -> dict:
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class InstalledPluginSourceGitHub:
- """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.
"""
repo: str
source: FluffySource
@@ -12250,6 +13408,8 @@ class InstalledPluginSourceGitHub:
path: str | None = None
ref: str | None = None
+ sha: str | None = None
+ """Optional full 40-character hexadecimal commit SHA."""
@staticmethod
def from_dict(obj: Any) -> 'InstalledPluginSourceGitHub':
@@ -12258,7 +13418,8 @@ def from_dict(obj: Any) -> 'InstalledPluginSourceGitHub':
source = FluffySource(obj.get("source"))
path = from_union([from_str, from_none], obj.get("path"))
ref = from_union([from_str, from_none], obj.get("ref"))
- return InstalledPluginSourceGitHub(repo, source, path, ref)
+ sha = from_union([from_str, from_none], obj.get("sha"))
+ return InstalledPluginSourceGitHub(repo, source, path, ref, sha)
def to_dict(self) -> dict:
result: dict = {}
@@ -12268,13 +13429,15 @@ def to_dict(self) -> dict:
result["path"] = from_union([from_str, from_none], self.path)
if self.ref is not None:
result["ref"] = from_union([from_str, from_none], self.ref)
+ if self.sha is not None:
+ result["sha"] = from_union([from_str, from_none], self.sha)
return result
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class SessionInstalledPluginSourceGitHub:
- """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.
"""
repo: str
source: FluffySource
@@ -12282,6 +13445,8 @@ class SessionInstalledPluginSourceGitHub:
path: str | None = None
ref: str | None = None
+ sha: str | None = None
+ """Optional full 40-character hexadecimal commit SHA."""
@staticmethod
def from_dict(obj: Any) -> 'SessionInstalledPluginSourceGitHub':
@@ -12290,7 +13455,8 @@ def from_dict(obj: Any) -> 'SessionInstalledPluginSourceGitHub':
source = FluffySource(obj.get("source"))
path = from_union([from_str, from_none], obj.get("path"))
ref = from_union([from_str, from_none], obj.get("ref"))
- return SessionInstalledPluginSourceGitHub(repo, source, path, ref)
+ sha = from_union([from_str, from_none], obj.get("sha"))
+ return SessionInstalledPluginSourceGitHub(repo, source, path, ref, sha)
def to_dict(self) -> dict:
result: dict = {}
@@ -12300,6 +13466,8 @@ def to_dict(self) -> dict:
result["path"] = from_union([from_str, from_none], self.path)
if self.ref is not None:
result["ref"] = from_union([from_str, from_none], self.ref)
+ if self.sha is not None:
+ result["sha"] = from_union([from_str, from_none], self.sha)
return result
# Experimental: this type is part of an experimental API and may change or be removed.
@@ -12349,8 +13517,8 @@ def to_dict(self) -> dict:
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class InstalledPluginSourceURL:
- """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.
"""
source: StickySource
"""Constant value. Always "url"."""
@@ -12358,6 +13526,8 @@ class InstalledPluginSourceURL:
url: str
path: str | None = None
ref: str | None = None
+ sha: str | None = None
+ """Optional full 40-character hexadecimal commit SHA."""
@staticmethod
def from_dict(obj: Any) -> 'InstalledPluginSourceURL':
@@ -12366,7 +13536,8 @@ def from_dict(obj: Any) -> 'InstalledPluginSourceURL':
url = from_str(obj.get("url"))
path = from_union([from_str, from_none], obj.get("path"))
ref = from_union([from_str, from_none], obj.get("ref"))
- return InstalledPluginSourceURL(source, url, path, ref)
+ sha = from_union([from_str, from_none], obj.get("sha"))
+ return InstalledPluginSourceURL(source, url, path, ref, sha)
def to_dict(self) -> dict:
result: dict = {}
@@ -12376,13 +13547,15 @@ def to_dict(self) -> dict:
result["path"] = from_union([from_str, from_none], self.path)
if self.ref is not None:
result["ref"] = from_union([from_str, from_none], self.ref)
+ if self.sha is not None:
+ result["sha"] = from_union([from_str, from_none], self.sha)
return result
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class SessionInstalledPluginSourceURL:
- """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.
"""
source: StickySource
"""Constant value. Always "url"."""
@@ -12390,6 +13563,8 @@ class SessionInstalledPluginSourceURL:
url: str
path: str | None = None
ref: str | None = None
+ sha: str | None = None
+ """Optional full 40-character hexadecimal commit SHA."""
@staticmethod
def from_dict(obj: Any) -> 'SessionInstalledPluginSourceURL':
@@ -12398,7 +13573,8 @@ def from_dict(obj: Any) -> 'SessionInstalledPluginSourceURL':
url = from_str(obj.get("url"))
path = from_union([from_str, from_none], obj.get("path"))
ref = from_union([from_str, from_none], obj.get("ref"))
- return SessionInstalledPluginSourceURL(source, url, path, ref)
+ sha = from_union([from_str, from_none], obj.get("sha"))
+ return SessionInstalledPluginSourceURL(source, url, path, ref, sha)
def to_dict(self) -> dict:
result: dict = {}
@@ -12408,6 +13584,8 @@ def to_dict(self) -> dict:
result["path"] = from_union([from_str, from_none], self.path)
if self.ref is not None:
result["ref"] = from_union([from_str, from_none], self.ref)
+ if self.sha is not None:
+ result["sha"] = from_union([from_str, from_none], self.sha)
return result
# Experimental: this type is part of an experimental API and may change or be removed.
@@ -16534,6 +17712,32 @@ def to_dict(self) -> dict:
result["seatbelt"] = from_union([lambda x: to_class(SandboxConfigUserPolicyExperimentalSeatbelt, x), from_none], self.seatbelt)
return result
+# Experimental: this type is part of an experimental API and may change or be removed.
+@dataclass
+class ScheduleAddResult:
+ """Result of registering or re-arming a scheduled prompt."""
+
+ entry: ScheduleEntry | None = None
+ """The registered or updated schedule entry."""
+
+ error: str | None = None
+ """User-facing validation error, when registration failed."""
+
+ @staticmethod
+ def from_dict(obj: Any) -> 'ScheduleAddResult':
+ assert isinstance(obj, dict)
+ entry = from_union([ScheduleEntry.from_dict, from_none], obj.get("entry"))
+ error = from_union([from_str, from_none], obj.get("error"))
+ return ScheduleAddResult(entry, error)
+
+ def to_dict(self) -> dict:
+ result: dict = {}
+ if self.entry is not None:
+ result["entry"] = from_union([lambda x: to_class(ScheduleEntry, x), from_none], self.entry)
+ if self.error is not None:
+ result["error"] = from_union([from_str, from_none], self.error)
+ return result
+
# Experimental: this type is part of an experimental API and may change or be removed.
@dataclass
class ScheduleList:
@@ -16685,10 +17889,9 @@ class SendRequest:
"""
# Internal: this field is an internal SDK API and is not part of the public surface.
source: str | None = None
- """Optional provenance tag copied to the resulting user.message event. Must 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-