From ca24d1ae71afde23ee68131260782978b07710c4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 22:12:57 +0000 Subject: [PATCH 1/7] Update @github/copilot to 1.0.76-0 - Updated nodejs and test harness dependencies - Re-ran code generators - Formatted generated code --- dotnet/src/Generated/Rpc.cs | 3270 +++++++++++++-- dotnet/src/Generated/SessionEvents.cs | 229 +- go/rpc/zrpc.go | 2337 ++++++++++- go/rpc/zrpc_encoding.go | 75 +- go/rpc/zsession_encoding.go | 6 + go/rpc/zsession_events.go | 102 +- go/zsession_events.go | 11 + java/pom.xml | 2 +- java/scripts/codegen/package-lock.json | 72 +- java/scripts/codegen/package.json | 2 +- .../generated/AssistantMessageEvent.java | 1 + .../generated/AssistantReasoningEvent.java | 3 +- .../generated/AssistantUsageEvent.java | 3 + .../generated/FactoryRunUpdatedEvent.java | 42 + .../generated/ModelCallFailureEvent.java | 1 + .../generated/ModelCallStartEvent.java | 4 +- .../copilot/generated/ScheduleOrigin.java | 35 + .../copilot/generated/SessionEvent.java | 2 + .../copilot/generated/SessionResumeEvent.java | 4 +- .../SessionScheduleCreatedEvent.java | 4 +- .../copilot/generated/SystemMessageEvent.java | 2 + .../generated/ToolExecutionCompleteEvent.java | 1 + .../generated/ToolExecutionStartEvent.java | 1 + .../copilot/generated/UserMessageEvent.java | 2 +- .../rpc/BuiltInModelCatalogEntry.java | 27 + .../copilot/generated/rpc/ConnectParams.java | 2 +- .../rpc/ContentExclusionPathCheck.java | 29 + .../generated/rpc/FactoryAgentSummary.java | 38 + .../generated/rpc/FactoryCurrentPhase.java | 27 + .../generated/rpc/FactoryDeclaredLimits.java | 29 + .../generated/rpc/FactoryExecuteParams.java | 2 + .../rpc/FactoryPhaseObservation.java | 38 + .../generated/rpc/FactoryPhaseStatus.java | 39 + .../generated/rpc/FactoryProgressLine.java | 37 + .../generated/rpc/FactoryProgressPage.java | 33 + .../generated/rpc/FactoryRunConsumed.java | 28 + .../generated/rpc/FactoryRunLimits.java | 6 +- .../generated/rpc/FactoryRunResult.java | 39 + .../generated/rpc/FactoryRunSummary.java | 44 + .../generated/rpc/FactoryRunTerminal.java | 29 + .../rpc/HistoryFileRestoreSkipReason.java | 35 + .../rpc/HistoryRewindChangeType.java | 37 + .../rpc/HistoryRewindFilePreview.java | 33 + .../generated/rpc/HistoryRewindMode.java | 35 + .../generated/rpc/HistoryRewindOutcome.java | 49 + .../generated/rpc/HistoryRewindPoint.java | 43 + .../rpc/HistoryRewindUnavailableReason.java | 37 + .../rpc/HistorySkippedFileRestore.java | 29 + .../rpc/ModelsGetBuiltInCatalogResult.java | 31 + .../generated/rpc/SendMessageItem.java | 2 +- .../generated/rpc/ServerModelsApi.java | 11 + .../generated/rpc/ServerSessionsApi.java | 33 + ...essionCancelAllBackgroundAgentsParams.java | 30 + .../rpc/SessionContentExclusionApi.java | 49 + ...ssionContentExclusionCheckPathsParams.java | 33 + ...ssionContentExclusionCheckPathsResult.java | 33 + .../rpc/SessionFactoryAgentParams.java | 2 + .../generated/rpc/SessionFactoryApi.java | 59 + .../rpc/SessionFactoryGetRunDetailParams.java | 32 + .../rpc/SessionFactoryGetRunDetailResult.java | 51 + .../SessionFactoryGetRunProgressParams.java | 40 + .../SessionFactoryGetRunProgressResult.java | 36 + .../rpc/SessionFactoryJournalGetParams.java | 2 + .../rpc/SessionFactoryJournalPutParams.java | 2 + .../rpc/SessionFactoryListRunsParams.java | 30 + .../rpc/SessionFactoryListRunsResult.java | 30 + .../rpc/SessionFactoryLogParams.java | 2 + .../rpc/SessionFactoryResumeParams.java | 34 + .../rpc/SessionFactoryResumeResult.java | 32 + .../rpc/SessionFsSqliteQueryParams.java | 2 +- .../rpc/SessionFsSqliteQueryResult.java | 3 - .../rpc/SessionFsSqliteTransactionError.java | 27 + .../SessionFsSqliteTransactionErrorClass.java | 37 + .../rpc/SessionFsSqliteTransactionParams.java | 32 + .../rpc/SessionFsSqliteTransactionResult.java | 31 + .../SessionFsSqliteTransactionStatement.java | 32 + .../generated/rpc/SessionHistoryApi.java | 43 + .../SessionHistoryListRewindPointsParams.java | 30 + .../SessionHistoryListRewindPointsResult.java | 35 + .../SessionHistoryPreviewRewindParams.java | 32 + .../SessionHistoryPreviewRewindResult.java | 37 + .../rpc/SessionHistoryRewindParams.java | 34 + .../rpc/SessionHistoryRewindResult.java | 39 + .../rpc/SessionHistoryTruncateResult.java | 6 +- .../rpc/SessionInterruptMainTurnParams.java | 32 + .../rpc/SessionInterruptMainTurnResult.java | 30 + .../copilot/generated/rpc/SessionMcpApi.java | 2 +- .../generated/rpc/SessionMcpOauthApi.java | 16 + .../rpc/SessionMcpOauthRespondParams.java | 32 + .../rpc/SessionMcpOauthRespondResult.java | 30 + .../rpc/SessionMcpStartServerParams.java | 4 +- .../rpc/SessionOptionsUpdateParams.java | 10 +- .../generated/rpc/SessionPermissionsApi.java | 11 +- ...ermissionsResetSessionApprovalsParams.java | 6 +- .../generated/rpc/SessionQueueApi.java | 110 + ...sionQueueBeginDeferredIdleDrainParams.java | 32 + ...sionQueueBeginDeferredIdleDrainResult.java | 30 + ...QueueConsumeSystemNotificationsParams.java | 32 + ...QueueConsumeSystemNotificationsResult.java | 30 + .../SessionQueueDeferSessionIdleParams.java | 32 + ...essionQueueEnqueueResumePendingParams.java | 30 + ...essionQueueEnqueueResumePendingResult.java | 30 + ...ionQueueFinishDeferredIdleDrainParams.java | 34 + ...ionQueueFinishDeferredIdleDrainResult.java | 32 + .../rpc/SessionQueueHasPendingParams.java | 30 + .../rpc/SessionQueueHasPendingResult.java | 30 + .../rpc/SessionQueueProcessParams.java | 30 + .../rpc/SessionQueueSnapshotParams.java | 30 + .../rpc/SessionQueueSnapshotResult.java | 37 + .../copilot/generated/rpc/SessionRpc.java | 46 + .../rpc/SessionScheduleAddAtParams.java | 38 + .../rpc/SessionScheduleAddAtResult.java | 32 + .../rpc/SessionScheduleAddCronParams.java | 40 + .../rpc/SessionScheduleAddCronResult.java | 32 + .../rpc/SessionScheduleAddParams.java | 38 + .../rpc/SessionScheduleAddResult.java | 32 + .../SessionScheduleAddSelfPacedParams.java | 34 + .../SessionScheduleAddSelfPacedResult.java | 32 + .../generated/rpc/SessionScheduleApi.java | 102 + .../SessionScheduleHasSelfPacedParams.java | 30 + .../SessionScheduleHasSelfPacedResult.java | 30 + .../rpc/SessionScheduleHydrateParams.java | 30 + .../SessionScheduleRearmSelfPacedParams.java | 34 + .../SessionScheduleRearmSelfPacedResult.java | 32 + .../generated/rpc/SessionSendParams.java | 2 +- .../SessionSendSystemNotificationParams.java | 36 + .../SessionWorkspacesAddSummaryParams.java | 34 + .../SessionWorkspacesAddSummaryResult.java | 31 + .../generated/rpc/SessionWorkspacesApi.java | 113 + ...kspacesAutopilotObjectiveExistsParams.java | 30 + ...kspacesAutopilotObjectiveExistsResult.java | 30 + ...kspacesDeleteAutopilotObjectiveParams.java | 30 + ...kspacesDeleteAutopilotObjectiveResult.java | 30 + .../rpc/SessionWorkspacesDiffResult.java | 6 +- .../rpc/SessionWorkspacesEnsureParams.java | 32 + .../rpc/SessionWorkspacesEnsureResult.java | 57 + ...orkspacesReadAutopilotObjectiveParams.java | 30 + ...orkspacesReadAutopilotObjectiveResult.java | 30 + ...sionWorkspacesTruncateSummariesParams.java | 32 + ...sionWorkspacesTruncateSummariesResult.java | 57 + ...SessionWorkspacesUpdateMetadataParams.java | 34 + ...SessionWorkspacesUpdateMetadataResult.java | 57 + ...rkspacesWriteAutopilotObjectiveParams.java | 32 + ...rkspacesWriteAutopilotObjectiveResult.java | 30 + .../generated/rpc/SessionsDeleteParams.java | 32 + .../rpc/SessionsGetMetadataParams.java | 30 + .../rpc/SessionsGetMetadataResult.java | 30 + .../SessionsListNonEmptySessionIdsParams.java | 30 + .../SessionsListNonEmptySessionIdsResult.java | 31 + .../generated/rpc/ShellInitProfile.java | 35 + .../generated/rpc/ShellInitScript.java | 29 + .../generated/rpc/ShellInitScriptShell.java | 35 + .../copilot/generated/rpc/ShellOptions.java | 42 + .../generated/rpc/UIExitPlanModeResponse.java | 4 +- .../rpc/WorkspaceDiffFileChange.java | 2 +- nodejs/package-lock.json | 72 +- nodejs/package.json | 2 +- nodejs/samples/package-lock.json | 2 +- nodejs/src/generated/rpc.ts | 1968 ++++++++- nodejs/src/generated/session-events.ts | 98 +- python/copilot/generated/rpc.py | 3338 ++++++++++++++- python/copilot/generated/session_events.py | 116 +- rust/src/generated/api_types.rs | 3565 ++++++++++++++--- rust/src/generated/rpc.rs | 1425 ++++++- rust/src/generated/session_events.rs | 117 +- test/harness/package-lock.json | 72 +- test/harness/package.json | 2 +- 167 files changed, 19674 insertions(+), 1390 deletions(-) create mode 100644 java/src/generated/java/com/github/copilot/generated/FactoryRunUpdatedEvent.java create mode 100644 java/src/generated/java/com/github/copilot/generated/ScheduleOrigin.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/BuiltInModelCatalogEntry.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ContentExclusionPathCheck.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentSummary.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryCurrentPhase.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryDeclaredLimits.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseObservation.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseStatus.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressLine.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressPage.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunConsumed.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/HistoryFileRestoreSkipReason.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindChangeType.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindFilePreview.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindMode.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindOutcome.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindPoint.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindUnavailableReason.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/HistorySkippedFileRestore.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ModelsGetBuiltInCatalogResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionCancelAllBackgroundAgentsParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionApi.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionCheckPathsParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionCheckPathsResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryListRunsParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryListRunsResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryResumeParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryResumeResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionError.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionErrorClass.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionStatement.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryListRewindPointsParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryListRewindPointsResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryPreviewRewindParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryPreviewRewindResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryRewindParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryRewindResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionInterruptMainTurnParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionInterruptMainTurnResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthRespondParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthRespondResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueBeginDeferredIdleDrainParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueBeginDeferredIdleDrainResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueConsumeSystemNotificationsParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueConsumeSystemNotificationsResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueDeferSessionIdleParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueEnqueueResumePendingParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueEnqueueResumePendingResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueFinishDeferredIdleDrainParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueFinishDeferredIdleDrainResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueHasPendingParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueHasPendingResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueProcessParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSnapshotParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSnapshotResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddAtParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddAtResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddCronParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddCronResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddSelfPacedParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddSelfPacedResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHasSelfPacedParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHasSelfPacedResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHydrateParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleRearmSelfPacedParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleRearmSelfPacedResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionSendSystemNotificationParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAddSummaryParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAddSummaryResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAutopilotObjectiveExistsParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAutopilotObjectiveExistsResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDeleteAutopilotObjectiveParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDeleteAutopilotObjectiveResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesWriteAutopilotObjectiveParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesWriteAutopilotObjectiveResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionsDeleteParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionsGetMetadataParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionsGetMetadataResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionsListNonEmptySessionIdsParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionsListNonEmptySessionIdsResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ShellInitProfile.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ShellInitScript.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ShellInitScriptShell.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ShellOptions.java diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index d09976bc80..cd6d8c9b7d 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -65,7 +65,7 @@ internal sealed class ConnectResult [Experimental(Diagnostics.Experimental)] internal sealed class ConnectRequest { - /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification, in addition to the runtime's normal GitHub/CTS emission (dual-write). Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled. + /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events. [JsonPropertyName("enableGitHubTelemetryForwarding")] public bool? EnableGitHubTelemetryForwarding { get; set; } @@ -346,6 +346,24 @@ internal sealed class ModelsListRequest public string? GitHubToken { get; set; } } +/// A well-known model in the runtime's built-in catalog. +[Experimental(Diagnostics.Experimental)] +public sealed class BuiltInModelCatalogEntry +{ + /// Well-known runtime model ID suitable for `ProviderConfig.modelId` or `ProviderModelConfig.modelId`. This is not necessarily the provider-facing deployment or model name and does not indicate CAPI entitlement or provider availability. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; +} + +/// The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. +[Experimental(Diagnostics.Experimental)] +public sealed class BuiltInModelCatalog +{ + /// Built-in model entries. + [JsonPropertyName("models")] + public IList Models { get => field ??= []; set; } +} + /// Built-in tool metadata with identifier, optional namespaced name, description, input-parameter schema, and usage instructions. [Experimental(Diagnostics.Experimental)] public sealed class Tool @@ -2484,6 +2502,87 @@ internal sealed class SessionsListRequest public bool? ThrowOnError { get; set; } } +/// Persisted local session metadata, including identifiers, timestamps, summary/name, client, context, detached state, and task ID. +[Experimental(Diagnostics.Experimental)] +public sealed class LocalSessionMetadataValue +{ + /// Runtime client name that created/last resumed this session. + [JsonPropertyName("clientName")] + public string? ClientName { get; set; } + + /// Pre-resolved working-directory context for session startup. + [JsonPropertyName("context")] + public SessionContext? Context { get; set; } + + /// True for detached maintenance sessions that should be hidden from normal resume lists. + [JsonPropertyName("isDetached")] + public bool? IsDetached { get; set; } + + /// Always false for local sessions. + [JsonPropertyName("isRemote")] + public bool IsRemote { get; set; } + + /// GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control. + [JsonPropertyName("mcTaskId")] + public string? McTaskId { get; set; } + + /// Last-modified time of the session's persisted state, as ISO 8601. + [JsonPropertyName("modifiedTime")] + public string ModifiedTime { get; set; } = string.Empty; + + /// Optional human-friendly name set via /rename. + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// Stable session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// Session creation time as an ISO 8601 timestamp. + [JsonPropertyName("startTime")] + public string StartTime { get; set; } = string.Empty; + + /// Short summary of the session, when one has been derived. + [JsonPropertyName("summary")] + public string? Summary { get; set; } +} + +/// Persisted local session metadata when the session exists. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionsGetMetadataResult +{ + /// Local session metadata, omitted when the session does not exist. + [JsonPropertyName("session")] + public LocalSessionMetadataValue? Session { get; set; } +} + +/// Session ID whose persisted metadata should be read. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionsGetMetadataRequest +{ + /// Session ID to inspect. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Recent local session IDs that contain user-visible history. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionsListNonEmptySessionIdsResult +{ + /// Session IDs ordered newest-first. + [JsonPropertyName("sessionIds")] + public IList SessionIds { get => field ??= []; set; } +} + +/// Limit for non-empty local session IDs. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionsListNonEmptySessionIdsRequest +{ + /// Maximum number of session IDs to return. + [JsonPropertyName("limit")] + public long? Limit { get; set; } +} + /// ID of the local session bound to the given GitHub task, or omitted when none. [Experimental(Diagnostics.Experimental)] public sealed class SessionsFindByTaskIDResult @@ -2634,6 +2733,19 @@ internal sealed class SessionsBulkDeleteRequest public IList SessionIds { get => field ??= []; set; } } +/// Session ID to delete from disk. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionsDeleteRequest +{ + /// Session ID to delete. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// Internal resolved session directory path to delete. + [JsonPropertyName("sessionPath")] + public string? SessionPath { get; set; } +} + /// Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag. [Experimental(Diagnostics.Experimental)] public sealed class SessionPruneResult @@ -2710,51 +2822,6 @@ internal sealed class SessionsReleaseLockRequest public string SessionId { get; set; } = string.Empty; } -/// Persisted local session metadata, including identifiers, timestamps, summary/name, client, context, detached state, and task ID. -[Experimental(Diagnostics.Experimental)] -public sealed class LocalSessionMetadataValue -{ - /// Runtime client name that created/last resumed this session. - [JsonPropertyName("clientName")] - public string? ClientName { get; set; } - - /// Pre-resolved working-directory context for session startup. - [JsonPropertyName("context")] - public SessionContext? Context { get; set; } - - /// True for detached maintenance sessions that should be hidden from normal resume lists. - [JsonPropertyName("isDetached")] - public bool? IsDetached { get; set; } - - /// Always false for local sessions. - [JsonPropertyName("isRemote")] - public bool IsRemote { get; set; } - - /// GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control. - [JsonPropertyName("mcTaskId")] - public string? McTaskId { get; set; } - - /// Last-modified time of the session's persisted state, as ISO 8601. - [JsonPropertyName("modifiedTime")] - public string ModifiedTime { get; set; } = string.Empty; - - /// Optional human-friendly name set via /rename. - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// Stable session identifier. - [JsonPropertyName("sessionId")] - public string SessionId { get; set; } = string.Empty; - - /// Session creation time as an ISO 8601 timestamp. - [JsonPropertyName("startTime")] - public string StartTime { get; set; } = string.Empty; - - /// Short summary of the session, when one has been derived. - [JsonPropertyName("summary")] - public string? Summary { get; set; } -} - /// The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted. [Experimental(Diagnostics.Experimental)] public sealed class SessionEnrichMetadataResult @@ -3451,8 +3518,8 @@ internal sealed class SendRequest [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; - /// Optional provenance tag copied to the resulting user.message event. Must match one of three forms: the literal `system`, `command-<command-id>` for messages originating from a command (e.g. slash command, Mission Control command), or `schedule-<numeric-id>` for messages originating from a scheduled job. - [RegularExpression("^(system|command-.*|schedule-\\d+)$")] + /// Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-<command-id>` for command-originated messages, `schedule-<numeric-id>` for scheduled prompts, or `agent-<agent-id>` for prompts sent by another agent. + [RegularExpression("^(user|system|command-.*|schedule-\\d+|agent-.+)$")] [JsonInclude] [JsonPropertyName("source")] internal string? Source { get; set; } @@ -3504,8 +3571,8 @@ public sealed class SendMessageItem [JsonPropertyName("requiredTool")] public string? RequiredTool { get; set; } - /// Optional provenance tag copied to the resulting user.message event. Must match one of three forms: the literal `system`, `command-<command-id>` for messages originating from a command (e.g. slash command, Mission Control command), or `schedule-<numeric-id>` for messages originating from a scheduled job. - [RegularExpression("^(system|command-.*|schedule-\\d+)$")] + /// Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-<command-id>` for command-originated messages, `schedule-<numeric-id>` for scheduled prompts, or `agent-<agent-id>` for prompts sent by another agent. + [RegularExpression("^(user|system|command-.*|schedule-\\d+|agent-.+)$")] [JsonInclude] [JsonPropertyName("source")] internal string? Source { get; set; } @@ -3552,6 +3619,27 @@ internal sealed class SendMessagesRequest public bool? Wait { get; set; } } +/// Internal request for sending a system notification. +[Experimental(Diagnostics.Experimental)] +internal sealed class SendSystemNotificationRequest +{ + /// Optional structured notification kind. + [JsonPropertyName("kind")] + public JsonElement? Kind { get; set; } + + /// Notification text to deliver to the model. + [JsonPropertyName("message")] + public string Message { get; set; } = string.Empty; + + /// Internal delivery options, including passive policy. + [JsonPropertyName("options")] + public JsonElement? Options { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Result of aborting the current turn. [Experimental(Diagnostics.Experimental)] public sealed class AbortResult @@ -3578,6 +3666,37 @@ internal sealed class AbortRequest public string SessionId { get; set; } = string.Empty; } +/// Result of interrupting the main agent turn. +[Experimental(Diagnostics.Experimental)] +public sealed class InterruptMainTurnResult +{ + /// Whether an in-flight main agent turn was interrupted. False when the main loop was not processing. + [JsonPropertyName("interrupted")] + public bool Interrupted { get; set; } +} + +/// Parameters for interrupting the main agent turn. +[Experimental(Diagnostics.Experimental)] +internal sealed class InterruptMainTurnRequest +{ + /// When true, the user's queued prompts are preserved and run as the next turn once the interrupted turn unwinds; when false (the default), the queue is cleared like a plain abort. + [JsonPropertyName("flushQueued")] + public bool? FlushQueued { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionCancelAllBackgroundAgentsRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Parameters for shutting down the session. [Experimental(Diagnostics.Experimental)] internal sealed class ShutdownRequest @@ -4095,6 +4214,7 @@ internal sealed class CanvasActionInvokeRequest UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(FactoryRunFailureFactoryLimitReached), "factory_limit_reached")] [JsonDerivedType(typeof(FactoryRunFailureFactoryResumeDeclined), "factory_resume_declined")] +[JsonDerivedType(typeof(FactoryRunFailureFactoryDurableFailure), "factory_durable_failure")] public partial class FactoryRunFailure { /// The type discriminator. @@ -4141,6 +4261,27 @@ public partial class FactoryRunFailureFactoryResumeDeclined : FactoryRunFailure public required string RunId { get; set; } } +/// The factory_durable_failure variant of . +[Experimental(Diagnostics.Experimental)] +public partial class FactoryRunFailureFactoryDurableFailure : FactoryRunFailure +{ + /// + [JsonIgnore] + public override string Type => "factory_durable_failure"; + + /// Stable failure code. + [JsonPropertyName("code")] + public required string Code { get; set; } + + /// Execution-critical durable operation that failed. + [JsonPropertyName("operation")] + public required FactoryDurableOperation Operation { get; set; } + + /// Factory run identifier. + [JsonPropertyName("runId")] + public required string RunId { get; set; } +} + /// Complete current or terminal factory run envelope. [Experimental(Diagnostics.Experimental)] public sealed class FactoryRunResult @@ -4178,6 +4319,10 @@ public sealed class FactoryRunResult [Experimental(Diagnostics.Experimental)] public sealed class FactoryRunLimits { + /// Maximum AI credits consumed by factory subagents and their descendants. The post-paid ceiling is soft: parallel turns can settle beyond it before the run stops. + [JsonPropertyName("maxAiCredits")] + public double? MaxAiCredits { get; set; } + /// Maximum number of factory subagents that may run concurrently. [JsonPropertyName("maxConcurrentSubagents")] public long? MaxConcurrentSubagents { get; set; } @@ -4186,9 +4331,9 @@ public sealed class FactoryRunLimits [JsonPropertyName("maxTotalSubagents")] public long? MaxTotalSubagents { get; set; } - /// Factory active-run timeout in milliseconds. - [JsonPropertyName("timeout")] - public double? Timeout { get; set; } + /// Maximum accumulated active-execution time in seconds. Active execution includes the entire extension body, subprocess waits, queued-agent waits, and sleeps; time between resumed attempts is not counted. + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { get; set; } } /// Options controlling factory invocation. @@ -4225,10 +4370,27 @@ internal sealed class FactoryRunRequest public string SessionId { get; set; } = string.Empty; } -/// Parameters for retrieving a factory run. +/// Resolved persisted factory identity and resumed run envelope. [Experimental(Diagnostics.Experimental)] -internal sealed class FactoryGetRunRequest +public sealed class FactoryResumeResult +{ + /// Persisted factory name resolved for the resumed run. + [JsonPropertyName("factoryName")] + public string FactoryName { get; set; } = string.Empty; + + /// Terminal resumed run envelope. + [JsonPropertyName("run")] + public FactoryRunResult Run { get => field ??= new(); set; } +} + +/// Parameters for resuming a factory run from its persisted identity. +[Experimental(Diagnostics.Experimental)] +internal sealed class FactoryResumeRequest { + /// Optional per-invocation resource ceiling overrides. + [JsonPropertyName("limits")] + public FactoryRunLimits? Limits { get; set; } + /// Factory run identifier. [JsonPropertyName("runId")] public string RunId { get; set; } = string.Empty; @@ -4238,9 +4400,9 @@ internal sealed class FactoryGetRunRequest public string SessionId { get; set; } = string.Empty; } -/// Parameters for cancelling a factory run. +/// Parameters for retrieving a factory run. [Experimental(Diagnostics.Experimental)] -internal sealed class FactoryCancelRequest +internal sealed class FactoryGetRunRequest { /// Factory run identifier. [JsonPropertyName("runId")] @@ -4251,64 +4413,546 @@ internal sealed class FactoryCancelRequest public string SessionId { get; set; } = string.Empty; } -/// Acknowledgement that a factory request was accepted. +/// Declared or approved factory resource ceilings. [Experimental(Diagnostics.Experimental)] -public sealed class FactoryAckResult +public sealed class FactoryDeclaredLimits { + /// Gets or sets the maxAiCredits value. + [JsonPropertyName("maxAiCredits")] + public double? MaxAiCredits { get; set; } + + /// Gets or sets the maxConcurrentSubagents value. + [JsonPropertyName("maxConcurrentSubagents")] + public long? MaxConcurrentSubagents { get; set; } + + /// Gets or sets the maxTotalSubagents value. + [JsonPropertyName("maxTotalSubagents")] + public long? MaxTotalSubagents { get; set; } + + /// Gets or sets the timeoutSeconds value. + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { get; set; } } -/// One ordered factory progress line. +/// Durable factory resource consumption. [Experimental(Diagnostics.Experimental)] -public sealed class FactoryLogLine +public sealed class FactoryRunConsumed { - /// Progress line kind. - [JsonPropertyName("kind")] - public FactoryLogLineKind Kind { get; set; } + /// Gets or sets the activeMs value. + [JsonPropertyName("activeMs")] + public long ActiveMs { get; set; } - /// Monotonic sequence number within the factory run. - [JsonPropertyName("seq")] - public long Seq { get; set; } + /// Gets or sets the nanoAiu value. + [JsonPropertyName("nanoAiu")] + public long NanoAiu { get; set; } - /// Progress text. - [JsonPropertyName("text")] - public string Text { get; set; } = string.Empty; + /// Gets or sets the subagents value. + [JsonPropertyName("subagents")] + public long Subagents { get; set; } } -/// Parameters for recording factory progress. +/// Current factory phase identity. [Experimental(Diagnostics.Experimental)] -internal sealed class FactoryLogRequest +public sealed class FactoryCurrentPhase { - /// Ordered progress lines to append. - [JsonPropertyName("lines")] - public IList Lines { get => field ??= []; set; } - - /// Factory run identifier. - [JsonPropertyName("runId")] - public string RunId { get; set; } = string.Empty; + /// Gets or sets the id value. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; - /// Target session identifier. - [JsonPropertyName("sessionId")] - public string SessionId { get; set; } = string.Empty; + /// Gets or sets the ordinal value. + [JsonPropertyName("ordinal")] + public long? Ordinal { get; set; } } -/// Result of one factory-scoped subagent call. +/// Prompt-safe terminal factory outcome. [Experimental(Diagnostics.Experimental)] -public sealed class FactoryAgentResult +public sealed class FactoryRunTerminal { - /// Agent result, omitted when the agent produced no result. - [JsonPropertyName("result")] - public JsonElement? Result { get; set; } + /// Gets or sets the error value. + [JsonPropertyName("error")] + public string? Error { get; set; } + + /// Gets or sets the failure value. + [JsonPropertyName("failure")] + public FactoryRunFailure? Failure { get; set; } + + /// Gets or sets the reason value. + [JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// Gets or sets the resultPreview value. + [JsonPropertyName("resultPreview")] + public string? ResultPreview { get; set; } } -/// Options for one factory-scoped subagent call. +/// Durable factory run summary with read-time live overlays. [Experimental(Diagnostics.Experimental)] -public sealed class FactoryAgentOptions +public sealed class FactoryRunSummary { - /// Optional label distinguishing otherwise identical memoized agent calls. - [JsonPropertyName("label")] - public string? Label { get; set; } + /// Gets or sets the activeSegmentStartedAt value. + [JsonPropertyName("activeSegmentStartedAt")] + public long? ActiveSegmentStartedAt { get; set; } - /// Optional model identifier for the subagent. + /// Gets or sets the approved value. + [JsonPropertyName("approved")] + public FactoryDeclaredLimits? Approved { get; set; } + + /// Gets or sets the completedAt value. + [JsonPropertyName("completedAt")] + public long? CompletedAt { get; set; } + + /// Gets or sets the consumed value. + [JsonPropertyName("consumed")] + public FactoryRunConsumed Consumed { get => field ??= new(); set; } + + /// Gets or sets the createdAt value. + [JsonPropertyName("createdAt")] + public long CreatedAt { get; set; } + + /// Gets or sets the currentPhase value. + [JsonPropertyName("currentPhase")] + public FactoryCurrentPhase? CurrentPhase { get; set; } + + /// Gets or sets the declaredLimits value. + [JsonPropertyName("declaredLimits")] + public FactoryDeclaredLimits DeclaredLimits { get => field ??= new(); set; } + + /// Gets or sets the declaredPhaseCount value. + [JsonPropertyName("declaredPhaseCount")] + public long DeclaredPhaseCount { get; set; } + + /// Gets or sets the description value. + [JsonPropertyName("description")] + public string Description { get; set; } = string.Empty; + + /// Gets or sets the factoryName value. + [JsonPropertyName("factoryName")] + public string FactoryName { get; set; } = string.Empty; + + /// Gets or sets the liveAgentCount value. + [JsonPropertyName("liveAgentCount")] + public long LiveAgentCount { get; set; } + + /// Gets or sets the observedAt value. + [JsonPropertyName("observedAt")] + public long ObservedAt { get; set; } + + /// Gets or sets the revision value. + [JsonPropertyName("revision")] + public long Revision { get; set; } + + /// Gets or sets the runId value. + [JsonPropertyName("runId")] + public string RunId { get; set; } = string.Empty; + + /// Gets or sets the startedAt value. + [JsonPropertyName("startedAt")] + public long? StartedAt { get; set; } + + /// Gets or sets the status value. + [JsonPropertyName("status")] + public FactoryRunStatus Status { get; set; } + + /// Gets or sets the terminal value. + [JsonPropertyName("terminal")] + public FactoryRunTerminal? Terminal { get; set; } + + /// Gets or sets the totalSpawnedAgentCount value. + [JsonPropertyName("totalSpawnedAgentCount")] + public long TotalSpawnedAgentCount { get; set; } + + /// Gets or sets the updatedAt value. + [JsonPropertyName("updatedAt")] + public long UpdatedAt { get; set; } +} + +/// Factory runs in durable creation order. +[Experimental(Diagnostics.Experimental)] +public sealed class FactoryListRunsResult +{ + /// Gets or sets the runs value. + [JsonPropertyName("runs")] + public IList Runs { get => field ??= []; set; } +} + +/// Empty parameters for listing factory runs. +[Experimental(Diagnostics.Experimental)] +internal sealed class FactoryListRunsRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Prompt-safe durable identity and live status for a direct factory agent. +[Experimental(Diagnostics.Experimental)] +public sealed class FactoryAgentSummary +{ + /// Gets or sets the activeMs value. + [JsonPropertyName("activeMs")] + public long ActiveMs { get; set; } + + /// Gets or sets the activity value. + [JsonPropertyName("activity")] + public string? Activity { get; set; } + + /// Gets or sets the agentId value. + [JsonPropertyName("agentId")] + public string AgentId { get; set; } = string.Empty; + + /// Gets or sets the agentType value. + [JsonPropertyName("agentType")] + public string AgentType { get; set; } = string.Empty; + + /// Gets or sets the completedAt value. + [JsonPropertyName("completedAt")] + public long? CompletedAt { get; set; } + + /// Gets or sets the label value. + [JsonPropertyName("label")] + public string Label { get; set; } = string.Empty; + + /// Gets or sets the phaseId value. + [JsonPropertyName("phaseId")] + public string? PhaseId { get; set; } + + /// Gets or sets the requestedModel value. + [JsonPropertyName("requestedModel")] + public string? RequestedModel { get; set; } + + /// Gets or sets the resolvedModel value. + [JsonPropertyName("resolvedModel")] + public string? ResolvedModel { get; set; } + + /// Gets or sets the runId value. + [JsonPropertyName("runId")] + public string RunId { get; set; } = string.Empty; + + /// Gets or sets the startedAt value. + [JsonPropertyName("startedAt")] + public long? StartedAt { get; set; } + + /// Gets or sets the status value. + [JsonPropertyName("status")] + public string Status { get; set; } = string.Empty; + + /// Gets or sets the toolCallId value. + [JsonPropertyName("toolCallId")] + public string ToolCallId { get; set; } = string.Empty; +} + +/// Durable lifecycle and timing for one factory phase. +[Experimental(Diagnostics.Experimental)] +public sealed class FactoryPhaseObservation +{ + /// Gets or sets the accumulatedActiveMs value. + [JsonPropertyName("accumulatedActiveMs")] + public long AccumulatedActiveMs { get; set; } + + /// Gets or sets the completedAt value. + [JsonPropertyName("completedAt")] + public long? CompletedAt { get; set; } + + /// Gets or sets the currentActiveMs value. + [JsonPropertyName("currentActiveMs")] + public long CurrentActiveMs { get; set; } + + /// Gets or sets the detail value. + [JsonPropertyName("detail")] + public string? Detail { get; set; } + + /// Gets or sets the entryCount value. + [JsonPropertyName("entryCount")] + public long EntryCount { get; set; } + + /// Gets or sets the id value. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; + + /// Gets or sets the lastEnteredRunAttempt value. + [JsonPropertyName("lastEnteredRunAttempt")] + public long LastEnteredRunAttempt { get; set; } + + /// Gets or sets the liveAgentCount value. + [JsonPropertyName("liveAgentCount")] + public long LiveAgentCount { get; set; } + + /// Gets or sets the ordinal value. + [JsonPropertyName("ordinal")] + public long? Ordinal { get; set; } + + /// Gets or sets the startedAt value. + [JsonPropertyName("startedAt")] + public long? StartedAt { get; set; } + + /// Gets or sets the status value. + [JsonPropertyName("status")] + public FactoryPhaseStatus Status { get; set; } + + /// Gets or sets the title value. + [JsonPropertyName("title")] + public string Title { get; set; } = string.Empty; + + /// Gets or sets the totalAgentCount value. + [JsonPropertyName("totalAgentCount")] + public long TotalAgentCount { get; set; } +} + +/// One durable factory progress record. +[Experimental(Diagnostics.Experimental)] +public sealed class FactoryProgressLine +{ + /// Resume attempt that emitted this record. + [JsonPropertyName("attempt")] + public long Attempt { get; set; } + + /// Progress record kind. + [JsonPropertyName("kind")] + public FactoryLogLineKind Kind { get; set; } + + /// Phase active when the record was emitted, or null before any phase. + [JsonPropertyName("phaseId")] + public string? PhaseId { get; set; } + + /// Epoch milliseconds when the record was persisted. + [JsonPropertyName("recordedAt")] + public long RecordedAt { get; set; } + + /// Global monotonic sequence number within the run. + [JsonPropertyName("seq")] + public long Seq { get; set; } + + /// Prompt-safe progress text. + [JsonPropertyName("text")] + public string Text { get; set; } = string.Empty; +} + +/// A bidirectional page of factory progress. +[Experimental(Diagnostics.Experimental)] +public sealed class FactoryProgressPage +{ + /// Gets or sets the hasMoreNewer value. + [JsonPropertyName("hasMoreNewer")] + public bool HasMoreNewer { get; set; } + + /// Gets or sets the hasMoreOlder value. + [JsonPropertyName("hasMoreOlder")] + public bool HasMoreOlder { get; set; } + + /// Gets or sets the newestSeq value. + [JsonPropertyName("newestSeq")] + public long? NewestSeq { get; set; } + + /// Gets or sets the oldestSeq value. + [JsonPropertyName("oldestSeq")] + public long? OldestSeq { get; set; } + + /// Gets or sets the records value. + [JsonPropertyName("records")] + public IList Records { get => field ??= []; set; } + + /// Run revision reflected by this page. + [JsonPropertyName("revision")] + public long Revision { get; set; } +} + +/// Full factory run observability detail. +[Experimental(Diagnostics.Experimental)] +public sealed class FactoryRunDetail +{ + /// Gets or sets the activeSegmentStartedAt value. + [JsonPropertyName("activeSegmentStartedAt")] + public long? ActiveSegmentStartedAt { get; set; } + + /// Gets or sets the agents value. + [JsonPropertyName("agents")] + public IList Agents { get => field ??= []; set; } + + /// Gets or sets the approved value. + [JsonPropertyName("approved")] + public FactoryDeclaredLimits? Approved { get; set; } + + /// Gets or sets the completedAt value. + [JsonPropertyName("completedAt")] + public long? CompletedAt { get; set; } + + /// Gets or sets the consumed value. + [JsonPropertyName("consumed")] + public FactoryRunConsumed Consumed { get => field ??= new(); set; } + + /// Gets or sets the createdAt value. + [JsonPropertyName("createdAt")] + public long CreatedAt { get; set; } + + /// Gets or sets the currentPhase value. + [JsonPropertyName("currentPhase")] + public FactoryCurrentPhase? CurrentPhase { get; set; } + + /// Gets or sets the declaredLimits value. + [JsonPropertyName("declaredLimits")] + public FactoryDeclaredLimits DeclaredLimits { get => field ??= new(); set; } + + /// Gets or sets the declaredPhaseCount value. + [JsonPropertyName("declaredPhaseCount")] + public long DeclaredPhaseCount { get; set; } + + /// Gets or sets the description value. + [JsonPropertyName("description")] + public string Description { get; set; } = string.Empty; + + /// Gets or sets the factoryName value. + [JsonPropertyName("factoryName")] + public string FactoryName { get; set; } = string.Empty; + + /// Gets or sets the liveAgentCount value. + [JsonPropertyName("liveAgentCount")] + public long LiveAgentCount { get; set; } + + /// Gets or sets the observedAt value. + [JsonPropertyName("observedAt")] + public long ObservedAt { get; set; } + + /// Gets or sets the phases value. + [JsonPropertyName("phases")] + public IList Phases { get => field ??= []; set; } + + /// Gets or sets the progress value. + [JsonPropertyName("progress")] + public FactoryProgressPage Progress { get => field ??= new(); set; } + + /// Gets or sets the revision value. + [JsonPropertyName("revision")] + public long Revision { get; set; } + + /// Gets or sets the runId value. + [JsonPropertyName("runId")] + public string RunId { get; set; } = string.Empty; + + /// Gets or sets the startedAt value. + [JsonPropertyName("startedAt")] + public long? StartedAt { get; set; } + + /// Gets or sets the status value. + [JsonPropertyName("status")] + public FactoryRunStatus Status { get; set; } + + /// Gets or sets the terminal value. + [JsonPropertyName("terminal")] + public FactoryRunTerminal? Terminal { get; set; } + + /// Gets or sets the totalSpawnedAgentCount value. + [JsonPropertyName("totalSpawnedAgentCount")] + public long TotalSpawnedAgentCount { get; set; } + + /// Gets or sets the updatedAt value. + [JsonPropertyName("updatedAt")] + public long UpdatedAt { get; set; } +} + +/// Parameters for paging factory progress. +[Experimental(Diagnostics.Experimental)] +internal sealed class FactoryGetRunProgressRequest +{ + /// Exclusive forward cursor. + [JsonPropertyName("afterSeq")] + public long? AfterSeq { get; set; } + + /// Exclusive backward cursor. + [JsonPropertyName("beforeSeq")] + public long? BeforeSeq { get; set; } + + /// Maximum records to return. Defaults to 200 and is capped at 500. + [JsonPropertyName("limit")] + public int? Limit { get; set; } + + /// Optional phase identifier used to scope records and cursors. + [JsonPropertyName("phaseId")] + public string? PhaseId { get; set; } + + /// Factory run identifier. + [JsonPropertyName("runId")] + public string RunId { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Parameters for cancelling a factory run. +[Experimental(Diagnostics.Experimental)] +internal sealed class FactoryCancelRequest +{ + /// Factory run identifier. + [JsonPropertyName("runId")] + public string RunId { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Acknowledgement that a factory request was accepted. +[Experimental(Diagnostics.Experimental)] +public sealed class FactoryAckResult +{ +} + +/// One ordered factory progress line. +[Experimental(Diagnostics.Experimental)] +public sealed class FactoryLogLine +{ + /// Progress line kind. + [JsonPropertyName("kind")] + public FactoryLogLineKind Kind { get; set; } + + /// Monotonic sequence number within the factory run. + [JsonPropertyName("seq")] + public long Seq { get; set; } + + /// Progress text. + [JsonPropertyName("text")] + public string Text { get; set; } = string.Empty; +} + +/// Parameters for recording factory progress. +[Experimental(Diagnostics.Experimental)] +internal sealed class FactoryLogRequest +{ + /// Opaque token identifying the current factory execution attempt. + [JsonPropertyName("executionToken")] + public string ExecutionToken { get; set; } = string.Empty; + + /// Ordered progress lines to append. + [JsonPropertyName("lines")] + public IList Lines { get => field ??= []; set; } + + /// Factory run identifier. + [JsonPropertyName("runId")] + public string RunId { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Result of one factory-scoped subagent call. +[Experimental(Diagnostics.Experimental)] +public sealed class FactoryAgentResult +{ + /// Agent result, omitted when the agent produced no result. + [JsonPropertyName("result")] + public JsonElement? Result { get; set; } +} + +/// Options for one factory-scoped subagent call. +[Experimental(Diagnostics.Experimental)] +public sealed class FactoryAgentOptions +{ + /// Optional label distinguishing otherwise identical memoized agent calls. + [JsonPropertyName("label")] + public string? Label { get; set; } + + /// Optional model identifier for the subagent. [JsonPropertyName("model")] public string? Model { get; set; } @@ -4321,6 +4965,10 @@ public sealed class FactoryAgentOptions [Experimental(Diagnostics.Experimental)] internal sealed class FactoryAgentRequest { + /// Opaque token identifying the current factory execution attempt. + [JsonPropertyName("executionToken")] + public string ExecutionToken { get; set; } = string.Empty; + /// Factory run identifier that owns the subagent. [JsonPropertyName("factoryRunId")] public string FactoryRunId { get; set; } = string.Empty; @@ -4355,6 +5003,10 @@ public sealed class FactoryJournalGetResult [Experimental(Diagnostics.Experimental)] internal sealed class FactoryJournalGetRequest { + /// Opaque token identifying the current factory execution attempt. + [JsonPropertyName("executionToken")] + public string ExecutionToken { get; set; } = string.Empty; + /// Namespaced journal key. [JsonPropertyName("key")] public string Key { get; set; } = string.Empty; @@ -4372,6 +5024,10 @@ internal sealed class FactoryJournalGetRequest [Experimental(Diagnostics.Experimental)] internal sealed class FactoryJournalPutRequest { + /// Opaque token identifying the current factory execution attempt. + [JsonPropertyName("executionToken")] + public string ExecutionToken { get; set; } = string.Empty; + /// Namespaced journal key. [JsonPropertyName("key")] public string Key { get; set; } = string.Empty; @@ -4873,137 +5529,296 @@ public sealed class WorkspacesGetWorkspaceResultWorkspace public bool? UserNamed { get; set; } } -/// Current workspace metadata for the session, including its absolute filesystem path when available. +/// Current workspace metadata for the session, including its absolute filesystem path when available. +[Experimental(Diagnostics.Experimental)] +public sealed class WorkspacesGetWorkspaceResult +{ + /// Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// Current workspace metadata, or null if not available. + [JsonPropertyName("workspace")] + public WorkspacesGetWorkspaceResultWorkspace? Workspace { get; set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionWorkspacesGetWorkspaceRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Workspace metadata fields to update. +[Experimental(Diagnostics.Experimental)] +internal sealed class WorkspacesUpdateMetadataRequest +{ + /// Opaque workspace context supplied by the session host. + [JsonPropertyName("context")] + public JsonElement? Context { get; set; } + + /// Optional workspace display name override. + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Optional session context used when creating a local workspace. +[Experimental(Diagnostics.Experimental)] +internal sealed class WorkspacesEnsureRequest +{ + /// Opaque workspace context supplied by the session host. + [JsonPropertyName("context")] + public JsonElement? Context { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Relative paths of files stored in the session workspace files directory. +[Experimental(Diagnostics.Experimental)] +public sealed class WorkspacesListFilesResult +{ + /// Relative file paths in the workspace files directory. + [JsonPropertyName("files")] + public IList Files { get => field ??= []; set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionWorkspacesListFilesRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Contents of the requested workspace file as a UTF-8 string. +[Experimental(Diagnostics.Experimental)] +public sealed class WorkspacesReadFileResult +{ + /// File content as a UTF-8 string. + [JsonPropertyName("content")] + public string Content { get; set; } = string.Empty; +} + +/// Relative path of the workspace file to read. +[Experimental(Diagnostics.Experimental)] +internal sealed class WorkspacesReadFileRequest +{ + /// Relative path within the workspace files directory. + [JsonPropertyName("path")] + public string Path { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Relative path and UTF-8 content for the workspace file to create or overwrite. +[Experimental(Diagnostics.Experimental)] +internal sealed class WorkspacesCreateFileRequest +{ + /// File content to write as a UTF-8 string. + [JsonPropertyName("content")] + public string Content { get; set; } = string.Empty; + + /// Relative path within the workspace files directory. + [JsonPropertyName("path")] + public string Path { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename. +[Experimental(Diagnostics.Experimental)] +public sealed class WorkspacesCheckpoints +{ + /// Filename of the checkpoint within the workspace checkpoints directory. + [JsonPropertyName("filename")] + public string Filename { get; set; } = string.Empty; + + /// Checkpoint number assigned by the workspace manager. + [JsonPropertyName("number")] + public long Number { get; set; } + + /// Human-readable checkpoint title. + [JsonPropertyName("title")] + public string Title { get; set; } = string.Empty; +} + +/// Workspace checkpoints in chronological order; empty when the workspace is not enabled. +[Experimental(Diagnostics.Experimental)] +public sealed class WorkspacesListCheckpointsResult +{ + /// Workspace checkpoints in chronological order. Empty when workspace is not enabled. + [JsonPropertyName("checkpoints")] + public IList Checkpoints { get => field ??= []; set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionWorkspacesListCheckpointsRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. +[Experimental(Diagnostics.Experimental)] +public sealed class WorkspacesReadCheckpointResult +{ + /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. + [JsonPropertyName("content")] + public string? Content { get; set; } +} + +/// Checkpoint number to read. +[Experimental(Diagnostics.Experimental)] +internal sealed class WorkspacesReadCheckpointRequest +{ + /// Checkpoint number to read. + [JsonPropertyName("number")] + public long Number { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// RPC data type for WorkspacesAddSummaryResultSummary operations. +public sealed class WorkspacesAddSummaryResultSummary +{ +} + +/// RPC data type for WorkspacesAddSummaryResultWorkspace operations. +public sealed class WorkspacesAddSummaryResultWorkspace +{ +} + +/// Persisted summary metadata and refreshed workspace metadata. [Experimental(Diagnostics.Experimental)] -public sealed class WorkspacesGetWorkspaceResult +public sealed class WorkspacesAddSummaryResult { - /// Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). - [JsonPropertyName("path")] - public string? Path { get; set; } + /// Gets or sets the summary value. + [JsonPropertyName("summary")] + public WorkspacesAddSummaryResultSummary? Summary { get; set; } - /// Current workspace metadata, or null if not available. + /// Gets or sets the workspace value. [JsonPropertyName("workspace")] - public WorkspacesGetWorkspaceResultWorkspace? Workspace { get; set; } + public WorkspacesAddSummaryResultWorkspace? Workspace { get; set; } } -/// Identifies the target session. +/// Compaction summary checkpoint to persist. [Experimental(Diagnostics.Experimental)] -internal sealed class SessionWorkspacesGetWorkspaceRequest +internal sealed class WorkspacesAddSummaryRequest { + /// Markdown summary content to persist. + [JsonPropertyName("content")] + public string Content { get; set; } = string.Empty; + /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; -} -/// Relative paths of files stored in the session workspace files directory. -[Experimental(Diagnostics.Experimental)] -public sealed class WorkspacesListFilesResult -{ - /// Relative file paths in the workspace files directory. - [JsonPropertyName("files")] - public IList Files { get => field ??= []; set; } + /// Summary title shown in checkpoint listings. + [JsonPropertyName("title")] + public string Title { get; set; } = string.Empty; } -/// Identifies the target session. +/// Rollback point for local workspace summaries. [Experimental(Diagnostics.Experimental)] -internal sealed class SessionWorkspacesListFilesRequest +internal sealed class WorkspacesTruncateSummariesRequest { + /// Number of newest summaries to keep. + [JsonPropertyName("keepCount")] + public long KeepCount { get; set; } + /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } -/// Contents of the requested workspace file as a UTF-8 string. +/// Autopilot objective file content, or null when missing. [Experimental(Diagnostics.Experimental)] -public sealed class WorkspacesReadFileResult +public sealed class WorkspacesReadAutopilotObjectiveResult { - /// File content as a UTF-8 string. + /// Autopilot objective file content, or null when missing. [JsonPropertyName("content")] - public string Content { get; set; } = string.Empty; + public string? Content { get; set; } } -/// Relative path of the workspace file to read. +/// Identifies the target session. [Experimental(Diagnostics.Experimental)] -internal sealed class WorkspacesReadFileRequest +internal sealed class SessionWorkspacesReadAutopilotObjectiveRequest { - /// Relative path within the workspace files directory. - [JsonPropertyName("path")] - public string Path { get; set; } = string.Empty; - /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } -/// Relative path and UTF-8 content for the workspace file to create or overwrite. +/// Result of writing the autopilot objective file. [Experimental(Diagnostics.Experimental)] -internal sealed class WorkspacesCreateFileRequest +public sealed class WorkspacesWriteAutopilotObjectiveResult { - /// File content to write as a UTF-8 string. + /// Filesystem operation performed. + [JsonPropertyName("operation")] + public string Operation { get; set; } = string.Empty; +} + +/// Autopilot objective file content to persist. +[Experimental(Diagnostics.Experimental)] +internal sealed class WorkspacesWriteAutopilotObjectiveRequest +{ + /// Autopilot objective file content. [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; - /// Relative path within the workspace files directory. - [JsonPropertyName("path")] - public string Path { get; set; } = string.Empty; - /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } -/// Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename. -[Experimental(Diagnostics.Experimental)] -public sealed class WorkspacesCheckpoints -{ - /// Filename of the checkpoint within the workspace checkpoints directory. - [JsonPropertyName("filename")] - public string Filename { get; set; } = string.Empty; - - /// Checkpoint number assigned by the workspace manager. - [JsonPropertyName("number")] - public long Number { get; set; } - - /// Human-readable checkpoint title. - [JsonPropertyName("title")] - public string Title { get; set; } = string.Empty; -} - -/// Workspace checkpoints in chronological order; empty when the workspace is not enabled. +/// Result of deleting the autopilot objective file. [Experimental(Diagnostics.Experimental)] -public sealed class WorkspacesListCheckpointsResult +public sealed class WorkspacesDeleteAutopilotObjectiveResult { - /// Workspace checkpoints in chronological order. Empty when workspace is not enabled. - [JsonPropertyName("checkpoints")] - public IList Checkpoints { get => field ??= []; set; } + /// True when a file was deleted. + [JsonPropertyName("deleted")] + public bool Deleted { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] -internal sealed class SessionWorkspacesListCheckpointsRequest +internal sealed class SessionWorkspacesDeleteAutopilotObjectiveRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } -/// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. +/// Whether the autopilot objective file exists. [Experimental(Diagnostics.Experimental)] -public sealed class WorkspacesReadCheckpointResult +public sealed class WorkspacesAutopilotObjectiveExistsResult { - /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. - [JsonPropertyName("content")] - public string? Content { get; set; } + /// True when the objective file exists. + [JsonPropertyName("exists")] + public bool Exists { get; set; } } -/// Checkpoint number to read. +/// Identifies the target session. [Experimental(Diagnostics.Experimental)] -internal sealed class WorkspacesReadCheckpointRequest +internal sealed class SessionWorkspacesAutopilotObjectiveExistsRequest { - /// Checkpoint number to read. - [JsonPropertyName("number")] - public long Number { get; set; } - /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; @@ -5067,7 +5882,7 @@ public sealed class WorkspaceDiffFileChange [JsonPropertyName("oldPath")] public string? OldPath { get; set; } - /// Path to the changed file, relative to the workspace root. + /// Path to the changed file, relative to the workspace root when the file lives under it. A file changed outside the workspace root keeps a `../`-relative path, or an absolute path when no relative path exists (for example a different Windows drive). [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; } @@ -5084,7 +5899,7 @@ public sealed class WorkspaceDiffResult [JsonPropertyName("changes")] public IList Changes { get => field ??= []; set; } - /// Whether a requested branch diff fell back to unstaged changes because branch diff failed. + /// Whether the requested diff fell back to unstaged changes, either because branch diff failed or session diff was unavailable. [JsonPropertyName("isFallback")] public bool IsFallback { get; set; } @@ -5095,6 +5910,10 @@ public sealed class WorkspaceDiffResult /// Diff mode requested by the client. [JsonPropertyName("requestedMode")] public WorkspaceDiffMode RequestedMode { get; set; } + + /// Why the session diff could not be produced, when applicable. Set only when `session` mode was requested and `isFallback` is true, so a client can tell the permanent `file-change-tracking-disabled` apart from the transient `session-busy`, which the same request answers once the session settles. Never set for `unstaged` or `branch` mode, and never `unsupported-remote-session`: a remote session's captures live on its own host, so a `session`-mode diff is rejected for one rather than answered with a controller-side fallback. + [JsonPropertyName("unavailableReason")] + public HistoryRewindUnavailableReason? UnavailableReason { get; set; } } /// Parameters for computing a workspace diff. @@ -6344,13 +7163,13 @@ internal sealed class McpConfigureGitHubRequest public string SessionId { get; set; } = string.Empty; } -/// Server name and configuration for an individual MCP server start. +/// Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server. [Experimental(Diagnostics.Experimental)] internal sealed class McpStartServerRequest { - /// MCP server configuration (stdio process or remote HTTP/SSE). + /// MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server with its already-registered configuration (config-free start-by-name). [JsonPropertyName("config")] - public JsonElement Config { get; set; } + public JsonElement? Config { get; set; } /// Name of the MCP server to start. [JsonPropertyName("serverName")] @@ -6583,6 +7402,28 @@ internal sealed class McpOauthLoginRequest public string SessionId { get; set; } = string.Empty; } +/// Indicates whether the pending MCP OAuth response was accepted. +[Experimental(Diagnostics.Experimental)] +public sealed class McpOauthRespondResult +{ + /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved. + [JsonPropertyName("success")] + public bool Success { get; set; } +} + +/// Pending MCP OAuth request id to respond to. +[Experimental(Diagnostics.Experimental)] +internal sealed class McpOauthRespondRequest +{ + /// OAuth request identifier from the mcp.oauth_required event. + [JsonPropertyName("requestId")] + public string RequestId { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Indicates whether the pending MCP headers refresh response was accepted. [Experimental(Diagnostics.Experimental)] public sealed class McpHeadersHandlePendingHeadersRefreshRequestResult @@ -7746,6 +8587,50 @@ public sealed class SandboxConfig public SandboxConfigUserPolicy? UserPolicy { get; set; } } +/// A host-provided script sourced before each built-in shell command when its shell target matches the active shell. +[Experimental(Diagnostics.Experimental)] +public sealed class ShellInitScript +{ + /// Path to the script to source. + [JsonPropertyName("path")] + public string Path { get; set; } = string.Empty; + + /// Built-in shell that may source this script. + [JsonPropertyName("shell")] + public ShellInitScriptShell Shell { get; set; } +} + +/// Per-session settings for built-in shell tools. +[Experimental(Diagnostics.Experimental)] +public sealed class ShellOptions +{ + /// Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected. + [JsonPropertyName("initProfile")] + public ShellInitProfile? InitProfile { get; set; } + + /// + /// Ordered host-provided script paths sourced before each built-in shell command when the + /// entry's shell target matches the active shell. Use these for rc files, environment setup scripts, + /// or other custom scripts. A script that returns a nonzero status is reported, and later scripts + /// and the user command continue while the shell remains running. Because scripts are sourced into + /// the command shell, `exit`, `exec`, failures under `set -e`, or other shell-terminating behavior + /// can prevent continuation. Script standard output is preserved; Bash script stderr is discarded, + /// PowerShell exception messages are replaced, and runtime-generated failure notices omit + /// configured script paths. When sandboxing is enabled, each script must already be readable under + /// the active sandbox filesystem policy. Pass an empty array to clear the list. + /// + [JsonPropertyName("initScripts")] + public IList? InitScripts { get; set; } + + /// + /// Flags passed to the active built-in shell process on startup, replacing its default flags. + /// When omitted, the built-in Bash shell uses `--norc --noprofile`, + /// and the built-in PowerShell shell uses `-NoProfile -NoLogo`. + /// + [JsonPropertyName("processFlags")] + public IList? ProcessFlags { get; set; } +} + /// Patch of mutable session options to apply to the running session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionUpdateOptionsParams @@ -7815,7 +8700,7 @@ internal sealed class SessionUpdateOptionsParams [JsonPropertyName("enableHostGitOperations")] public bool? EnableHostGitOperations { get; set; } - /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag. + /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`. [JsonPropertyName("enableOnDemandInstructionDiscovery")] public bool? EnableOnDemandInstructionDiscovery { get; set; } @@ -7847,6 +8732,10 @@ internal sealed class SessionUpdateOptionsParams [JsonPropertyName("eventsLogDirectory")] public string? EventsLogDirectory { get; set; } + /// Whether subagent callback events should be forwarded into the session event log sink. + [JsonPropertyName("eventsLogIncludesSubagents")] + public bool? EventsLogIncludesSubagents { get; set; } + /// Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. [JsonPropertyName("excludedBuiltinAgents")] public IList? ExcludedBuiltinAgents { get; set; } @@ -7935,11 +8824,19 @@ internal sealed class SessionUpdateOptionsParams [JsonPropertyName("sessionLimits")] public SessionLimitsConfig? SessionLimits { get; set; } - /// Shell init profile (`None` or `NonInteractive`). + /// Per-session settings for built-in shell tools. + [JsonPropertyName("shell")] + public ShellOptions? Shell { get; set; } + + /// Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`). + [EditorBrowsable(EditorBrowsableState.Never)] +#if NET5_0_OR_GREATER + [Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")] +#endif [JsonPropertyName("shellInitProfile")] public string? ShellInitProfile { get; set; } - /// Per-shell process flags (e.g., `pwsh` arguments). + /// PowerShell process flags applied to built-in and user-requested shell commands. [JsonPropertyName("shellProcessFlags")] public IList? ShellProcessFlags { get; set; } @@ -9319,6 +10216,10 @@ public sealed class UIExitPlanModeResponse [JsonPropertyName("autoApproveEdits")] public bool? AutoApproveEdits { get; set; } + /// When true, the agent is instructed to end its turn without starting implementation so the client can restore the session model and auto-submit a fresh implementation turn on it. Set only when a distinct plan configuration (a different model, reasoning effort, or context tier) actually ran the planning turn. + [JsonPropertyName("deferImplementation")] + public bool? DeferImplementation { get; set; } + /// Feedback from the user when they declined the plan or requested changes. [JsonPropertyName("feedback")] public string? Feedback { get; set; } @@ -10276,10 +11177,14 @@ public sealed class PermissionsResetSessionApprovalsResult public bool Success { get; set; } } -/// No parameters; clears all session-scoped tool permission approvals. +/// Clears session-scoped tool permission approvals, and optionally the location-scoped ones. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionsResetSessionApprovalsRequest { + /// Whether location-scoped approvals are cleared too. Defaults to `true`. + [JsonPropertyName("includeLocation")] + public bool? IncludeLocation { get; set; } + /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; @@ -11450,6 +12355,45 @@ internal sealed class SessionSettingsEvaluatePredicateRequest public string? ToolName { get; set; } } +/// Content-exclusion decision for one requested path. +[Experimental(Diagnostics.Experimental)] +public sealed class ContentExclusionPathCheck +{ + /// Whether the session's complete content-exclusion policy excludes the path. + [JsonPropertyName("excluded")] + public bool Excluded { get; set; } + + /// The path supplied by the caller. + [JsonPropertyName("path")] + public string Path { get; set; } = string.Empty; +} + +/// Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable. +[Experimental(Diagnostics.Experimental)] +public sealed class ContentExclusionCheckPathsResult +{ + /// Whether the session's policy service was available for the complete batch. When false, checks is empty and callers must treat every requested path as excluded. + [JsonPropertyName("available")] + public bool Available { get; set; } + + /// Per-path decisions in request order. Empty when available is false. + [JsonPropertyName("checks")] + public IList Checks { get => field ??= []; set; } +} + +/// Local file system absolute paths within the session working directory to check against its content-exclusion policy. +[Experimental(Diagnostics.Experimental)] +internal sealed class ContentExclusionCheckPathsRequest +{ + /// Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates. + [JsonPropertyName("paths")] + public IList Paths { get => field ??= []; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Identifier of the spawned process, used to correlate streamed output and exit notifications. [Experimental(Diagnostics.Experimental)] public sealed class ShellExecResult @@ -11653,21 +12597,206 @@ internal sealed class HistoryCompactRequestWithSession /// Number of events that were removed by the truncation. [Experimental(Diagnostics.Experimental)] -public sealed class HistoryTruncateResult +public sealed class HistoryTruncateResult +{ + /// Failure detail when checkpointCleanupFailed is true. + [JsonPropertyName("checkpointCleanupError")] + public string? CheckpointCleanupError { get; set; } + + /// True when conversation truncation succeeded but post-truncation workspace checkpoint cleanup failed. History is already truncated; callers may still prune snapshots but should report a checkpoint-cleanup rather than a truncation failure. + [JsonPropertyName("checkpointCleanupFailed")] + public bool? CheckpointCleanupFailed { get; set; } + + /// Number of events that were removed. + [JsonPropertyName("eventsRemoved")] + public long EventsRemoved { get; set; } +} + +/// Identifier of the event to truncate to; this event and all later events are removed. +[Experimental(Diagnostics.Experimental)] +internal sealed class HistoryTruncateRequest +{ + /// Event ID to truncate to. This event and all events after it are removed from the session. + [JsonPropertyName("eventId")] + public string EventId { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// A root user turn that the session can rewind to. +[Experimental(Diagnostics.Experimental)] +public sealed class HistoryRewindPoint +{ + /// Whether at least one file in this turn or a later turn can be restored. + [JsonPropertyName("canRestoreFiles")] + public bool CanRestoreFiles { get; set; } + + /// ID of the user.message event that begins the discarded suffix. + [JsonPropertyName("eventId")] + public string EventId { get; set; } = string.Empty; + + /// Number of unique files in this turn and all later turns that have captured changes. + [JsonPropertyName("fileCount")] + public long FileCount { get; set; } + + /// Whether this turn was an automatically injected autopilot continuation. + [JsonPropertyName("isAutopilotContinuation")] + public bool IsAutopilotContinuation { get; set; } + + /// Lines added by this turn's captured file changes. + [JsonPropertyName("linesAdded")] + public long LinesAdded { get; set; } + + /// Lines removed by this turn's captured file changes. + [JsonPropertyName("linesRemoved")] + public long LinesRemoved { get; set; } + + /// ISO timestamp of the user turn. + [JsonPropertyName("timestamp")] + public string Timestamp { get; set; } = string.Empty; + + /// Whether this turn itself captured any file changes. + [JsonPropertyName("turnChangedFiles")] + public bool TurnChangedFiles { get; set; } + + /// User-visible message text for the turn. + [JsonPropertyName("userMessage")] + public string UserMessage { get; set; } = string.Empty; +} + +/// Rewind points and file-change-tracking availability for the session. +[Experimental(Diagnostics.Experimental)] +public sealed class HistoryListRewindPointsResult +{ + /// Whether this session captured file changes from its first turn. + [JsonPropertyName("fileChangeTrackingEnabled")] + public bool FileChangeTrackingEnabled { get; set; } + + /// Root user turns in chronological order. Empty when `unavailableReason` is set. + [JsonPropertyName("points")] + public IList Points { get => field ??= []; set; } + + /// Why the listed points could not be produced, when applicable; the points list is empty whenever it is set. `unsupported-remote-session` is permanent for the session and comes with `fileChangeTrackingEnabled: false`. `session-busy` is transient and only ever reported by a session that *is* tracking (`fileChangeTrackingEnabled: true`), because the file-change captures cannot be read while work that may still mutate them is in flight; the same request succeeds once the session settles, so a client that wants points should retry rather than treat it as a failure. It is never `file-change-tracking-disabled`: an untracked local session still lists conversation-only points and reports that through `fileChangeTrackingEnabled: false`. + [JsonPropertyName("unavailableReason")] + public HistoryRewindUnavailableReason? UnavailableReason { get; set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionHistoryListRewindPointsRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// A file that a conversation-and-files rewind would restore. +[Experimental(Diagnostics.Experimental)] +public sealed class HistoryRewindFilePreview +{ + /// Aggregate change made across the discarded turns. + [JsonPropertyName("changeType")] + public HistoryRewindChangeType ChangeType { get; set; } + + /// Lines added across the discarded turns. + [JsonPropertyName("linesAdded")] + public long LinesAdded { get; set; } + + /// Lines removed across the discarded turns. + [JsonPropertyName("linesRemoved")] + public long LinesRemoved { get; set; } + + /// Absolute path of the captured file. + [JsonPropertyName("path")] + public string Path { get; set; } = string.Empty; +} + +/// Files and aggregate changes for a prospective rewind. +[Experimental(Diagnostics.Experimental)] +public sealed class HistoryPreviewRewindResult +{ + /// Whether file restore is available for this session. This is authoritative: switch on it and read `reason` only when it is false. + [JsonPropertyName("available")] + public bool Available { get; set; } + + /// Number of unique files in the preview. + [JsonPropertyName("fileCount")] + public long FileCount { get; set; } + + /// Files ordered by path. + [JsonPropertyName("files")] + public IList Files { get => field ??= []; set; } + + /// Why file restore is unavailable, when applicable. Populated only when `available` is false and never set when `available` is true. + [JsonPropertyName("reason")] + public HistoryRewindUnavailableReason? Reason { get; set; } +} + +/// Event boundary to preview for conversation-and-files rewind. +[Experimental(Diagnostics.Experimental)] +internal sealed class HistoryPreviewRewindRequest +{ + /// ID of the user.message event that begins the discarded suffix. + [JsonPropertyName("eventId")] + public string EventId { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// A captured file that rewind intentionally left unchanged. +[Experimental(Diagnostics.Experimental)] +public sealed class HistorySkippedFileRestore +{ + /// Absolute path of the skipped file. + [JsonPropertyName("path")] + public string Path { get; set; } = string.Empty; + + /// Reason the file was not restored. + [JsonPropertyName("reason")] + public HistoryFileRestoreSkipReason Reason { get; set; } +} + +/// Structured outcome of a rewind request. +[Experimental(Diagnostics.Experimental)] +public sealed class HistoryRewindResult { - /// Number of events that were removed. + /// Failure detail. Set only for the failure and partial-failure outcomes (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`). + [JsonPropertyName("error")] + public string? Error { get; set; } + + /// Number of persisted events removed by conversation truncation. Present only when truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`) and for `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`. [JsonPropertyName("eventsRemoved")] - public long EventsRemoved { get; set; } + public long? EventsRemoved { get; set; } + + /// Overall rewind outcome. This discriminates the result: it governs which of the remaining fields are populated, so consumers must switch on it before reading `eventsRemoved`, `restoredFiles`, `skippedFiles`, or `error`. See each field for the outcomes that populate it. + [JsonPropertyName("outcome")] + public HistoryRewindOutcome Outcome { get; set; } + + /// Absolute paths restored to their captured preimages. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. + [JsonPropertyName("restoredFiles")] + public IList RestoredFiles { get => field ??= []; set; } + + /// Captured files intentionally left unchanged. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. + [JsonPropertyName("skippedFiles")] + public IList SkippedFiles { get => field ??= []; set; } } -/// Identifier of the event to truncate to; this event and all later events are removed. +/// Boundary and mode for rewinding session history. [Experimental(Diagnostics.Experimental)] -internal sealed class HistoryTruncateRequest +internal sealed class HistoryRewindRequest { - /// Event ID to truncate to. This event and all events after it are removed from the session. + /// ID of the user.message event that begins the discarded suffix. [JsonPropertyName("eventId")] public string EventId { get; set; } = string.Empty; + /// Whether to rewind only conversation history or also restore captured files. + [JsonPropertyName("mode")] + public HistoryRewindMode Mode { get; set; } + /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; @@ -11762,6 +12891,119 @@ internal sealed class SessionQueuePendingItemsRequest public string SessionId { get; set; } = string.Empty; } +/// Internal snapshot of native queue state for local session orchestration. +[Experimental(Diagnostics.Experimental)] +internal sealed class QueueSnapshotResult +{ + /// Insertion orders for queued items, aligned with `items`. + [JsonPropertyName("itemOrders")] + public IList? ItemOrders { get; set; } + + /// User-facing pending items in FIFO order. + [JsonPropertyName("items")] + public IList Items { get => field ??= []; set; } + + /// Insertion orders for immediate steering messages, aligned with `steeringMessages`. + [JsonPropertyName("steeringMessageOrders")] + public IList? SteeringMessageOrders { get; set; } + + /// Immediate steering messages waiting for an active turn. + [JsonPropertyName("steeringMessages")] + public IList SteeringMessages { get => field ??= []; set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionQueueSnapshotRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Whether the native queue has pending work. +[Experimental(Diagnostics.Experimental)] +internal sealed class QueueHasPendingResult +{ + /// True when queued or immediate native work is pending. + [JsonPropertyName("hasPending")] + public bool HasPending { get; set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionQueueHasPendingRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Whether a deferred-idle drain should run. +[Experimental(Diagnostics.Experimental)] +internal sealed class QueueBeginDeferredIdleDrainResult +{ + /// True when the host should run finishDeferredIdleDrain asynchronously. + [JsonPropertyName("shouldDrain")] + public bool ShouldDrain { get; set; } +} + +/// Inputs for starting a deferred-idle drain. +[Experimental(Diagnostics.Experimental)] +internal sealed class QueueBeginDeferredIdleDrainRequest +{ + /// Whether the host still has active background work. + [JsonPropertyName("activeBackgroundWork")] + public bool ActiveBackgroundWork { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Action selected by the native deferred-idle drain. +[Experimental(Diagnostics.Experimental)] +internal sealed class QueueFinishDeferredIdleDrainResult +{ + /// Whether the deferred idle was caused by an aborted foreground turn. + [JsonPropertyName("aborted")] + public bool Aborted { get; set; } + + /// One of none, processQueue, or emitSessionIdle. + [JsonPropertyName("action")] + public string Action { get; set; } = string.Empty; +} + +/// Inputs for completing a deferred-idle drain. +[Experimental(Diagnostics.Experimental)] +internal sealed class QueueFinishDeferredIdleDrainRequest +{ + /// Whether the host still has active background work. + [JsonPropertyName("activeBackgroundWork")] + public bool ActiveBackgroundWork { get; set; } + + /// Whether native queued work remains. + [JsonPropertyName("hasPending")] + public bool HasPending { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Inputs for marking session.idle deferred in native state. +[Experimental(Diagnostics.Experimental)] +internal sealed class QueueDeferSessionIdleRequest +{ + /// Whether the deferred idle was caused by an aborted foreground turn. + [JsonPropertyName("aborted")] + public bool Aborted { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Indicates whether a user-facing pending item was removed. [Experimental(Diagnostics.Experimental)] public sealed class QueueRemoveMostRecentResult @@ -11789,6 +13031,46 @@ internal sealed class SessionQueueClearRequest public string SessionId { get; set; } = string.Empty; } +/// Internal filter for consuming queued system notifications. +[Experimental(Diagnostics.Experimental)] +internal sealed class QueueConsumeSystemNotificationsRequest +{ + /// Opaque runtime-owned filter object. + [JsonPropertyName("filter")] + public JsonElement Filter { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Result of enqueueing the resume-pending wake item. +[Experimental(Diagnostics.Experimental)] +internal sealed class QueueEnqueueResumePendingResult +{ + /// True when a wake item was newly queued. + [JsonPropertyName("queued")] + public bool Queued { get; set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionQueueEnqueueResumePendingRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionQueueProcessRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Batch of session events returned by a read, with cursor and continuation metadata. [Experimental(Diagnostics.Experimental)] public sealed class EventsReadResult @@ -12243,6 +13525,159 @@ internal sealed class SessionScheduleListRequest public string SessionId { get; set; } = string.Empty; } +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionScheduleHydrateRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Whether the session currently has an active self-paced schedule. +[Experimental(Diagnostics.Experimental)] +internal sealed class ScheduleHasSelfPacedResult +{ + /// True when at least one active schedule is self-paced. + [JsonPropertyName("hasSelfPaced")] + public bool HasSelfPaced { get; set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionScheduleHasSelfPacedRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Result of registering or re-arming a scheduled prompt. +[Experimental(Diagnostics.Experimental)] +internal sealed class ScheduleAddResult +{ + /// The registered or updated schedule entry. + [JsonPropertyName("entry")] + public ScheduleEntry? Entry { get; set; } + + /// User-facing validation error, when registration failed. + [JsonPropertyName("error")] + public string? Error { get; set; } +} + +/// Register a relative-interval scheduled prompt. +[Experimental(Diagnostics.Experimental)] +internal sealed class ScheduleAddRequest +{ + /// Optional display-only prompt label. + [JsonPropertyName("displayPrompt")] + public string? DisplayPrompt { get; set; } + + /// Human-readable interval such as `30s`, `5m`, or `2h`. + [JsonPropertyName("interval")] + public string Interval { get; set; } = string.Empty; + + /// Prompt text to enqueue when the schedule fires. + [JsonPropertyName("prompt")] + public string Prompt { get; set; } = string.Empty; + + /// Whether the schedule should re-arm after each tick. Defaults to true. + [JsonPropertyName("recurring")] + public bool? Recurring { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Register a cron scheduled prompt. +[Experimental(Diagnostics.Experimental)] +internal sealed class ScheduleAddCronRequest +{ + /// 5-field cron expression. + [JsonPropertyName("cron")] + public string Cron { get; set; } = string.Empty; + + /// Optional display-only prompt label. + [JsonPropertyName("displayPrompt")] + public string? DisplayPrompt { get; set; } + + /// Prompt text to enqueue when the schedule fires. + [JsonPropertyName("prompt")] + public string Prompt { get; set; } = string.Empty; + + /// Whether the schedule should re-arm after each tick. Defaults to true. + [JsonPropertyName("recurring")] + public bool? Recurring { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// IANA timezone for evaluating the cron expression. + [JsonPropertyName("tz")] + public string? Tz { get; set; } +} + +/// Register an absolute-time scheduled prompt. +[Experimental(Diagnostics.Experimental)] +internal sealed class ScheduleAddAtRequest +{ + /// Epoch milliseconds when the prompt should fire. + [JsonPropertyName("at")] + public long At { get; set; } + + /// Optional display-only prompt label. + [JsonPropertyName("displayPrompt")] + public string? DisplayPrompt { get; set; } + + /// Prompt text to enqueue when the schedule fires. + [JsonPropertyName("prompt")] + public string Prompt { get; set; } = string.Empty; + + /// Whether the schedule should re-arm after each tick. Defaults to false. + [JsonPropertyName("recurring")] + public bool? Recurring { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Register a self-paced scheduled prompt. +[Experimental(Diagnostics.Experimental)] +internal sealed class ScheduleAddSelfPacedRequest +{ + /// Optional display-only prompt label. + [JsonPropertyName("displayPrompt")] + public string? DisplayPrompt { get; set; } + + /// Prompt text to enqueue when the schedule fires. + [JsonPropertyName("prompt")] + public string Prompt { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Re-arm a self-paced scheduled prompt. +[Experimental(Diagnostics.Experimental)] +internal sealed class ScheduleRearmSelfPacedRequest +{ + /// Epoch milliseconds when the prompt should next fire. + [JsonPropertyName("at")] + public long At { get; set; } + + /// Id of the self-paced scheduled prompt. + [JsonPropertyName("id")] + public long Id { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Remove a scheduled prompt by id. The result entry is omitted if the id was unknown. [Experimental(Diagnostics.Experimental)] public sealed class ScheduleStopResult @@ -12293,7 +13728,7 @@ public sealed class FactoryExecuteResult { /// Factory result value. [JsonPropertyName("result")] - public JsonElement Result { get; set; } + public JsonElement? Result { get; set; } } /// Parameters sent to the owning extension to execute a factory closure. @@ -12304,6 +13739,10 @@ public sealed class FactoryExecuteRequest [JsonPropertyName("args")] public JsonElement Args { get; set; } + /// Opaque token identifying this factory execution attempt. + [JsonPropertyName("executionToken")] + public string ExecutionToken { get; set; } = string.Empty; + /// Registered factory name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; @@ -12615,34 +14054,90 @@ public sealed class SessionFsSqliteQueryResult [JsonPropertyName("lastInsertRowid")] public long? LastInsertRowid { get; set; } - /// For SELECT: array of row objects. For others: empty array. - [JsonPropertyName("rows")] - public IList> Rows { get => field ??= []; set; } + /// For SELECT: array of row objects. For others: empty array. + [JsonPropertyName("rows")] + public IList> Rows { get => field ??= []; set; } + + /// Number of rows affected (for INSERT/UPDATE/DELETE). + [JsonPropertyName("rowsAffected")] + public long RowsAffected { get; set; } +} + +/// SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. The provider applies its SQLite busy timeout for every call. +[Experimental(Diagnostics.Experimental)] +public sealed class SessionFsSqliteQueryRequest +{ + /// Optional named bind parameters. + [JsonPropertyName("params")] + public IDictionary? Params { get; set; } + + /// SQL query to execute. + [JsonPropertyName("query")] + public string Query { get; set; } = string.Empty; + + /// How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected). + [JsonPropertyName("queryType")] + public SessionFsSqliteQueryType QueryType { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Classified SQLite transaction failure. busyOrLocked guarantees rollback; postCommitAmbiguous must never be retried. +[Experimental(Diagnostics.Experimental)] +public sealed class SessionFsSqliteTransactionError +{ + /// Gets or sets the errorClass value. + [JsonPropertyName("errorClass")] + public SessionFsSqliteTransactionErrorClass ErrorClass { get; set; } + + /// Gets or sets the message value. + [JsonPropertyName("message")] + public string Message { get; set; } = string.Empty; +} - /// Number of rows affected (for INSERT/UPDATE/DELETE). - [JsonPropertyName("rowsAffected")] - public long RowsAffected { get; set; } +/// Per-statement results, or a classified transaction error. +[Experimental(Diagnostics.Experimental)] +public sealed class SessionFsSqliteTransactionResult +{ + /// Gets or sets the error value. + [JsonPropertyName("error")] + public SessionFsSqliteTransactionError? Error { get; set; } + + /// Gets or sets the results value. + [JsonPropertyName("results")] + public IList Results { get => field ??= []; set; } } -/// SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. +/// One statement in an atomic SQLite transaction. [Experimental(Diagnostics.Experimental)] -public sealed class SessionFsSqliteQueryRequest +public sealed class SessionFsSqliteTransactionStatement { /// Optional named bind parameters. [JsonPropertyName("params")] public IDictionary? Params { get; set; } - /// SQL query to execute. + /// SQL statement to execute. [JsonPropertyName("query")] public string Query { get; set; } = string.Empty; - /// How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected). + /// How to execute the statement. [JsonPropertyName("queryType")] public SessionFsSqliteQueryType QueryType { get; set; } +} +/// Statements to execute atomically. Providers apply busy handling for every call. +[Experimental(Diagnostics.Experimental)] +public sealed class SessionFsSqliteTransactionRequest +{ /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; + + /// Gets or sets the statements value. + [JsonPropertyName("statements")] + public IList Statements { get => field ??= []; set; } } /// Indicates whether the per-session SQLite database already exists. @@ -15578,8 +17073,11 @@ public FactoryRunFailureKind(string value) /// The run admitted the approved maximum total number of subagents. public static FactoryRunFailureKind MaxTotalSubagents { get; } = new("maxTotalSubagents"); - /// The run reached the approved timeout deadline. - public static FactoryRunFailureKind Timeout { get; } = new("timeout"); + /// The run reached the approved accumulated active-execution time in seconds. + public static FactoryRunFailureKind TimeoutSeconds { get; } = new("timeoutSeconds"); + + /// The run's settled subagent model usage exceeded the approved AI-credit ceiling, or no headroom remained for another subagent. + public static FactoryRunFailureKind MaxAiCredits { get; } = new("maxAiCredits"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(FactoryRunFailureKind left, FactoryRunFailureKind right) => left.Equals(right); @@ -15618,6 +17116,93 @@ public override void Write(Utf8JsonWriter writer, FactoryRunFailureKind value, J } +/// Execution-critical factory storage operation. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FactoryDurableOperation : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FactoryDurableOperation(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Creating the durable run and declared phases. + public static FactoryDurableOperation CreateRun { get; } = new("createRun"); + + /// Persisting the transition to running. + public static FactoryDurableOperation MarkRunStarted { get; } = new("markRunStarted"); + + /// Persisting the terminal run envelope. + public static FactoryDurableOperation FinishRun { get; } = new("finishRun"); + + /// Persisting subagent admission accounting. + public static FactoryDurableOperation ReserveAgent { get; } = new("reserveAgent"); + + /// Rolling back an uncommitted subagent admission. + public static FactoryDurableOperation ReleaseAgent { get; } = new("releaseAgent"); + + /// Persisting an idempotent model-usage charge. + public static FactoryDurableOperation ChargeCredit { get; } = new("chargeCredit"); + + /// Persisting active execution time. + public static FactoryDurableOperation AddElapsed { get; } = new("addElapsed"); + + /// Reading the authoritative AI-credit total. + public static FactoryDurableOperation ReconcileCreditTotal { get; } = new("reconcileCreditTotal"); + + /// Reading a journal entry without treating storage failure as a cache miss. + public static FactoryDurableOperation JournalGet { get; } = new("journalGet"); + + /// Persisting a journal entry before reporting success. + public static FactoryDurableOperation JournalPut { get; } = new("journalPut"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FactoryDurableOperation left, FactoryDurableOperation right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FactoryDurableOperation left, FactoryDurableOperation right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FactoryDurableOperation other && Equals(other); + + /// + public bool Equals(FactoryDurableOperation other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override FactoryDurableOperation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FactoryDurableOperation value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FactoryDurableOperation)); + } + } +} + + /// Current or terminal state of a factory run. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -15693,6 +17278,75 @@ public override void Write(Utf8JsonWriter writer, FactoryRunStatus value, JsonSe } +/// Derived lifecycle state of a factory phase. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FactoryPhaseStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FactoryPhaseStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The phase has not been entered yet. + public static FactoryPhaseStatus Pending { get; } = new("pending"); + + /// The phase is currently entered and accumulating active time. + public static FactoryPhaseStatus Active { get; } = new("active"); + + /// The phase was entered and has since been closed. + public static FactoryPhaseStatus Completed { get; } = new("completed"); + + /// The phase was never entered because a later phase was entered or the run reached a terminal state. + public static FactoryPhaseStatus Skipped { get; } = new("skipped"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FactoryPhaseStatus left, FactoryPhaseStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FactoryPhaseStatus left, FactoryPhaseStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FactoryPhaseStatus other && Equals(other); + + /// + public bool Equals(FactoryPhaseStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override FactoryPhaseStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FactoryPhaseStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FactoryPhaseStatus)); + } + } +} + + /// Kind of factory progress line. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -15954,6 +17608,72 @@ public override void Write(Utf8JsonWriter writer, WorkspaceDiffMode value, JsonS } +/// Reason a rewind read (rewind points, file-restore preview, or session diff) could not be answered from the session's file-change captures. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HistoryRewindUnavailableReason : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HistoryRewindUnavailableReason(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The session did not opt into file-change tracking before its first turn. + public static HistoryRewindUnavailableReason FileChangeTrackingDisabled { get; } = new("file-change-tracking-disabled"); + + /// The session still has work that may mutate files or history. Transient: the same request succeeds once the session settles, so callers should retry rather than treat it as a failure. + public static HistoryRewindUnavailableReason SessionBusy { get; } = new("session-busy"); + + /// Remote-backed rewind routing is not supported. + public static HistoryRewindUnavailableReason UnsupportedRemoteSession { get; } = new("unsupported-remote-session"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HistoryRewindUnavailableReason left, HistoryRewindUnavailableReason right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HistoryRewindUnavailableReason left, HistoryRewindUnavailableReason right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HistoryRewindUnavailableReason other && Equals(other); + + /// + public bool Equals(HistoryRewindUnavailableReason other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override HistoryRewindUnavailableReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HistoryRewindUnavailableReason value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HistoryRewindUnavailableReason)); + } + } +} + + /// Whether task execution is synchronously awaited or managed in the background. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -17615,23 +19335,149 @@ public SessionCapability(string value) /// Cross-session history tools and session-store SQL prompt/tool metadata. public static SessionCapability SessionStore { get; } = new("session-store"); - /// MCP Apps UI passthrough. - public static SessionCapability McpApps { get; } = new("mcp-apps"); + /// MCP Apps UI passthrough. + public static SessionCapability McpApps { get; } = new("mcp-apps"); + + /// Host-provided canvas rendering support. + public static SessionCapability CanvasRenderer { get; } = new("canvas-renderer"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(SessionCapability left, SessionCapability right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(SessionCapability left, SessionCapability right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is SessionCapability other && Equals(other); + + /// + public bool Equals(SessionCapability other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override SessionCapability Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, SessionCapability value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionCapability)); + } + } +} + + +/// Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ShellInitProfile : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ShellInitProfile(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Disable automatic non-interactive profile loading. Explicit initScripts still run. + public static ShellInitProfile None { get; } = new("none"); + + /// Allow automatic non-interactive profile loading when supported. Explicit initScripts still run. + public static ShellInitProfile NonInteractive { get; } = new("non-interactive"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ShellInitProfile left, ShellInitProfile right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ShellInitProfile left, ShellInitProfile right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is ShellInitProfile other && Equals(other); + + /// + public bool Equals(ShellInitProfile other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override ShellInitProfile Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, ShellInitProfile value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ShellInitProfile)); + } + } +} + + +/// Supported built-in shells for initialization scripts. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ShellInitScriptShell : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ShellInitScriptShell(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; - /// Host-provided canvas rendering support. - public static SessionCapability CanvasRenderer { get; } = new("canvas-renderer"); + /// Source the script in the built-in Bash shell on macOS and Linux. + public static ShellInitScriptShell Bash { get; } = new("bash"); - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(SessionCapability left, SessionCapability right) => left.Equals(right); + /// Source the script in the built-in PowerShell shell on Windows. + public static ShellInitScriptShell Powershell { get; } = new("powershell"); - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(SessionCapability left, SessionCapability right) => !(left == right); + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ShellInitScriptShell left, ShellInitScriptShell right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ShellInitScriptShell left, ShellInitScriptShell right) => !(left == right); /// - public override bool Equals(object? obj) => obj is SessionCapability other && Equals(other); + public override bool Equals(object? obj) => obj is ShellInitScriptShell other && Equals(other); /// - public bool Equals(SessionCapability other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + public bool Equals(ShellInitScriptShell other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); @@ -17639,20 +19485,20 @@ public SessionCapability(string value) /// public override string ToString() => Value; - /// Provides a for serializing instances. + /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class Converter : JsonConverter + public sealed class Converter : JsonConverter { /// - public override SessionCapability Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override ShellInitScriptShell Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// - public override void Write(Utf8JsonWriter writer, SessionCapability value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, ShellInitScriptShell value, JsonSerializerOptions options) { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionCapability)); + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ShellInitScriptShell)); } } } @@ -19089,6 +20935,282 @@ public override void Write(Utf8JsonWriter writer, ShellKillSignal value, JsonSer } +/// Aggregate file change represented by a rewind preview. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HistoryRewindChangeType : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HistoryRewindChangeType(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The discarded turns created the file. + public static HistoryRewindChangeType Created { get; } = new("created"); + + /// The discarded turns deleted the file. + public static HistoryRewindChangeType Deleted { get; } = new("deleted"); + + /// The discarded turns modified the file. + public static HistoryRewindChangeType Modified { get; } = new("modified"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HistoryRewindChangeType left, HistoryRewindChangeType right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HistoryRewindChangeType left, HistoryRewindChangeType right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HistoryRewindChangeType other && Equals(other); + + /// + public bool Equals(HistoryRewindChangeType other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override HistoryRewindChangeType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HistoryRewindChangeType value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HistoryRewindChangeType)); + } + } +} + + +/// Outcome of a rewind request. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HistoryRewindOutcome : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HistoryRewindOutcome(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The requested rewind completed; reachable in either mode. + public static HistoryRewindOutcome Success { get; } = new("success"); + + /// The session still has work that may mutate files or history; reachable in either mode. + public static HistoryRewindOutcome SessionBusy { get; } = new("session-busy"); + + /// A conversation-and-files rewind was requested for a session that did not enable capture; conversation-only rewinds never produce this. + public static HistoryRewindOutcome FileChangeTrackingDisabled { get; } = new("file-change-tracking-disabled"); + + /// Remote-backed rewind routing is not supported; reachable in either mode. + public static HistoryRewindOutcome UnsupportedRemoteSession { get; } = new("unsupported-remote-session"); + + /// File restore failed and all applied file changes were rolled back; only conversation-and-files rewinds produce this. + public static HistoryRewindOutcome FilesRolledBack { get; } = new("files-rolled-back"); + + /// File restore failed and its rollback could not fully restore the pre-rewind state; only conversation-and-files rewinds produce this. + public static HistoryRewindOutcome RollbackIncomplete { get; } = new("rollback-incomplete"); + + /// Conversation truncation failed. In conversation-and-files mode any files that were restored are left in place because conversation history cannot be un-truncated; in conversation-only mode no files are restored. Consult restoredFiles for what, if anything, was applied. + public static HistoryRewindOutcome TruncationFailed { get; } = new("truncation-failed"); + + /// The conversation was rewound (and, in conversation-and-files mode, captured files were restored), but persisted checkpoints could not be cleaned up; reachable in either mode. + public static HistoryRewindOutcome CheckpointCleanupFailed { get; } = new("checkpoint-cleanup-failed"); + + /// Files and conversation were rewound, but obsolete file snapshots could not be removed; only conversation-and-files rewinds produce this. + public static HistoryRewindOutcome SnapshotPruneFailed { get; } = new("snapshot-prune-failed"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HistoryRewindOutcome left, HistoryRewindOutcome right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HistoryRewindOutcome left, HistoryRewindOutcome right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HistoryRewindOutcome other && Equals(other); + + /// + public bool Equals(HistoryRewindOutcome other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override HistoryRewindOutcome Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HistoryRewindOutcome value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HistoryRewindOutcome)); + } + } +} + + +/// Reason a captured file was not restored. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HistoryFileRestoreSkipReason : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HistoryFileRestoreSkipReason(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The file changed after Copilot's last captured write. + public static HistoryFileRestoreSkipReason UserModified { get; } = new("user-modified"); + + /// A faithful preimage was not captured. + public static HistoryFileRestoreSkipReason SkippedCapture { get; } = new("skipped-capture"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HistoryFileRestoreSkipReason left, HistoryFileRestoreSkipReason right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HistoryFileRestoreSkipReason left, HistoryFileRestoreSkipReason right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HistoryFileRestoreSkipReason other && Equals(other); + + /// + public bool Equals(HistoryFileRestoreSkipReason other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override HistoryFileRestoreSkipReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HistoryFileRestoreSkipReason value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HistoryFileRestoreSkipReason)); + } + } +} + + +/// Scope of a rewind operation. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HistoryRewindMode : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HistoryRewindMode(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Discard conversation events while leaving files unchanged. + public static HistoryRewindMode Conversation { get; } = new("conversation"); + + /// Discard conversation events and restore captured files changed by those turns. + public static HistoryRewindMode ConversationAndFiles { get; } = new("conversation-and-files"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HistoryRewindMode left, HistoryRewindMode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HistoryRewindMode left, HistoryRewindMode right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HistoryRewindMode other && Equals(other); + + /// + public bool Equals(HistoryRewindMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override HistoryRewindMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HistoryRewindMode value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HistoryRewindMode)); + } + } +} + + /// Whether this item is a queued user message or a queued slash command / model change. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -19599,6 +21721,72 @@ public override void Write(Utf8JsonWriter writer, SessionFsSqliteQueryType value } +/// SQLite transaction failure classification. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct SessionFsSqliteTransactionErrorClass : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public SessionFsSqliteTransactionErrorClass(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// SQLite reported BUSY or LOCKED before commit; the transaction was rolled back and may be retried. + public static SessionFsSqliteTransactionErrorClass BusyOrLocked { get; } = new("busyOrLocked"); + + /// The statement, database, or provider failed definitively and must not be retried automatically. + public static SessionFsSqliteTransactionErrorClass Fatal { get; } = new("fatal"); + + /// The transport failed after the provider may have committed; retrying could duplicate effects. + public static SessionFsSqliteTransactionErrorClass PostCommitAmbiguous { get; } = new("postCommitAmbiguous"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(SessionFsSqliteTransactionErrorClass left, SessionFsSqliteTransactionErrorClass right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(SessionFsSqliteTransactionErrorClass left, SessionFsSqliteTransactionErrorClass right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is SessionFsSqliteTransactionErrorClass other && Equals(other); + + /// + public bool Equals(SessionFsSqliteTransactionErrorClass other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override SessionFsSqliteTransactionErrorClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, SessionFsSqliteTransactionErrorClass value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsSqliteTransactionErrorClass)); + } + } +} + + /// Transport the runtime would otherwise use for this request. `http` (the default when absent) covers plain HTTP and SSE responses; `websocket` indicates a full-duplex message channel where each body chunk maps to one WebSocket message and the `binary` flag distinguishes text from binary frames. The SDK consumer uses this to decide whether to service the request with an HTTP client or a WebSocket client. It is the one piece of request metadata the consumer cannot reliably infer from the URL or headers alone. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -19685,7 +21873,7 @@ public async Task PingAsync(string? message = null, CancellationToke /// Performs the SDK server connection handshake and validates the optional connection token. Marked internal because this is JSON-RPC transport plumbing invoked automatically by an SDK client's own `connect()` wrapper, not a user-facing method. Stays internal as long as the SDK client owns the handshake; would only become public if the SDK ever exposed the raw schema surface to consumers without a connection wrapper. /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN. - /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification, in addition to the runtime's normal GitHub/CTS emission (dual-write). Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled. + /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events. /// The to monitor for cancellation requests. The default is . /// Handshake result reporting the server's protocol version and package version on success. [Experimental(Diagnostics.Experimental)] @@ -19812,6 +22000,14 @@ public async Task ListAsync(string? gitHubToken = null, CancellationT var request = new ModelsListRequest { GitHubToken = gitHubToken }; return await CopilotClient.InvokeRpcAsync(_rpc, "models.list", [request], cancellationToken); } + + /// Returns the running runtime's complete catalog of well-known built-in model IDs without authentication or network access. + /// The to monitor for cancellation requests. The default is . + /// The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. + public async Task GetBuiltInCatalogAsync(CancellationToken cancellationToken = default) + { + return await CopilotClient.InvokeRpcAsync(_rpc, "models.getBuiltInCatalog", [], cancellationToken); + } } /// Provides server-scoped Tools APIs. @@ -20569,6 +22765,28 @@ public async Task ListAsync(SessionSource? source = null, long? met return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.list", [request], cancellationToken); } + /// Reads lightweight persisted metadata for one local session without opening it. + /// Session ID to inspect. + /// The to monitor for cancellation requests. The default is . + /// Persisted local session metadata when the session exists. + internal async Task GetMetadataAsync(string sessionId, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(sessionId); + + var request = new SessionsGetMetadataRequest { SessionId = sessionId }; + return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.getMetadata", [request], cancellationToken); + } + + /// Lists recent local session IDs that contain user-visible history, omitting housekeeping-only sessions. + /// Maximum number of session IDs to return. + /// The to monitor for cancellation requests. The default is . + /// Recent local session IDs that contain user-visible history. + internal async Task ListNonEmptySessionIdsAsync(long? limit = null, CancellationToken cancellationToken = default) + { + var request = new SessionsListNonEmptySessionIdsRequest { Limit = limit }; + return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.listNonEmptySessionIds", [request], cancellationToken); + } + /// Finds the local session bound to a GitHub task ID, if any. /// GitHub task ID to look up. /// The to monitor for cancellation requests. The default is . @@ -20671,6 +22889,18 @@ public async Task BulkDeleteAsync(IList session return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.bulkDelete", [request], cancellationToken); } + /// Deletes one local session from disk after running the same lifecycle hooks as the session manager. + /// Session ID to delete. + /// Internal resolved session directory path to delete. + /// The to monitor for cancellation requests. The default is . + internal async Task DeleteAsync(string sessionId, string? sessionPath = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(sessionId); + + var request = new SessionsDeleteRequest { SessionId = sessionId, SessionPath = sessionPath }; + await CopilotClient.InvokeRpcAsync(_rpc, "sessions.delete", [request], cancellationToken); + } + /// Deletes sessions older than the given threshold, with optional dry-run and exclusion list. /// Delete sessions whose modifiedTime is at least this many days old. /// When true, only report what would be deleted without performing any deletion. @@ -21062,6 +23292,12 @@ internal SessionRpc(CopilotSession session) Interlocked.CompareExchange(ref field, new(_session), null) ?? field; + /// ContentExclusion APIs. + public ContentExclusionApi ContentExclusion => + field ?? + Interlocked.CompareExchange(ref field, new(_session), null) ?? + field; + /// Shell APIs. public ShellApi Shell => field ?? @@ -21129,7 +23365,7 @@ public async Task SuspendAsync(CancellationToken cancellationToken = default) /// If true, adds the message to the front of the queue instead of the end. /// If false, this message will not trigger a Premium Request Unit charge. User messages default to billable. /// If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange. - /// Optional provenance tag copied to the resulting user.message event. Must match one of three forms: the literal `system`, `command-<command-id>` for messages originating from a command (e.g. slash command, Mission Control command), or `schedule-<numeric-id>` for messages originating from a scheduled job. + /// Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-<command-id>` for command-originated messages, `schedule-<numeric-id>` for scheduled prompts, or `agent-<agent-id>` for prompts sent by another agent. /// The UI mode the agent was in when this message was sent. Defaults to the session's current mode. /// Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. /// W3C Trace Context traceparent header for distributed tracing of this agent turn. @@ -21168,6 +23404,21 @@ public async Task SendMessagesAsync(IList m return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.sendMessages", [request], cancellationToken); } + /// Queues or sends an internal system notification to the session according to its passive policy. + /// Notification text to deliver to the model. + /// Optional structured notification kind. + /// Internal delivery options, including passive policy. + /// The to monitor for cancellation requests. The default is . + [Experimental(Diagnostics.Experimental)] + internal async Task SendSystemNotificationAsync(string message, object? kind = null, object? options = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(message); + _session.ThrowIfDisposed(); + + var request = new SendSystemNotificationRequest { SessionId = _session.SessionId, Message = message, Kind = CopilotClient.ToJsonElementForWire(kind), Options = CopilotClient.ToJsonElementForWire(options) }; + await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.sendSystemNotification", [request], cancellationToken); + } + /// Aborts the current agent turn. /// Finite reason code describing why the current turn was aborted. /// The to monitor for cancellation requests. The default is . @@ -21181,6 +23432,31 @@ public async Task AbortAsync(AbortReason? reason = null, Cancellati return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.abort", [request], cancellationToken); } + /// Interrupts the current main agent turn while leaving running background work (subagents, sidekicks, and promoted attached shells) alive. No-op when the main loop is not processing. + /// When true, the user's queued prompts are preserved and run as the next turn once the interrupted turn unwinds; when false (the default), the queue is cleared like a plain abort. + /// The to monitor for cancellation requests. The default is . + /// Result of interrupting the main agent turn. + [Experimental(Diagnostics.Experimental)] + public async Task InterruptMainTurnAsync(bool? flushQueued = null, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new InterruptMainTurnRequest { SessionId = _session.SessionId, FlushQueued = flushQueued }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.interruptMainTurn", [request], cancellationToken); + } + + /// Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running. + /// The to monitor for cancellation requests. The default is . + /// The number of running background agents (task-registry agents) that were cancelled. + [Experimental(Diagnostics.Experimental)] + public async Task CancelAllBackgroundAgentsAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionCancelAllBackgroundAgentsRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.cancelAllBackgroundAgents", [request], cancellationToken); + } + /// Shuts down the session and persists its final state. Awaits any deferred sessionEnd hooks before resolving so user-supplied hook scripts complete before the runtime tears down. /// Why the session is being shut down. Defaults to "routine" when omitted. /// Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'. @@ -21400,6 +23676,20 @@ public async Task RunAsync(string name, object args, RunOption return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.run", [request], cancellationToken); } + /// Resumes a factory run using its persisted name, arguments, journal, and accounting. + /// Factory run identifier. + /// Optional per-invocation resource ceiling overrides. + /// The to monitor for cancellation requests. The default is . + /// Resolved persisted factory identity and resumed run envelope. + public async Task ResumeAsync(string runId, FactoryRunLimits? limits = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(runId); + _session.ThrowIfDisposed(); + + var request = new FactoryResumeRequest { SessionId = _session.SessionId, RunId = runId, Limits = limits }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.resume", [request], cancellationToken); + } + /// Gets the current or settled envelope for a factory run. /// Factory run identifier. /// The to monitor for cancellation requests. The default is . @@ -21413,6 +23703,47 @@ public async Task GetRunAsync(string runId, CancellationToken return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.getRun", [request], cancellationToken); } + /// Lists durable factory runs for this session in creation order. + /// The to monitor for cancellation requests. The default is . + /// Factory runs in durable creation order. + public async Task ListRunsAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new FactoryListRunsRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.listRuns", [request], cancellationToken); + } + + /// Gets durable and live observability detail for one factory run. + /// Factory run identifier. + /// The to monitor for cancellation requests. The default is . + /// Full factory run observability detail. + public async Task GetRunDetailAsync(string runId, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(runId); + _session.ThrowIfDisposed(); + + var request = new FactoryGetRunRequest { SessionId = _session.SessionId, RunId = runId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.getRunDetail", [request], cancellationToken); + } + + /// Pages durable progress for one factory run. + /// Factory run identifier. + /// Optional phase identifier used to scope records and cursors. + /// Exclusive forward cursor. + /// Exclusive backward cursor. + /// Maximum records to return. Defaults to 200 and is capped at 500. + /// The to monitor for cancellation requests. The default is . + /// A bidirectional page of factory progress. + public async Task GetRunProgressAsync(string runId, string? phaseId = null, long? afterSeq = null, long? beforeSeq = null, int? limit = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(runId); + _session.ThrowIfDisposed(); + + var request = new FactoryGetRunProgressRequest { SessionId = _session.SessionId, RunId = runId, PhaseId = phaseId, AfterSeq = afterSeq, BeforeSeq = beforeSeq, Limit = limit }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.getRunProgress", [request], cancellationToken); + } + /// Requests cancellation of a factory run and returns its run envelope. /// Factory run identifier. /// The to monitor for cancellation requests. The default is . @@ -21428,33 +23759,37 @@ public async Task CancelAsync(string runId, CancellationToken /// Records a batch of ordered factory progress lines. /// Factory run identifier. + /// Opaque token identifying the current factory execution attempt. /// Ordered progress lines to append. /// The to monitor for cancellation requests. The default is . /// Acknowledgement that a factory request was accepted. - public async Task LogAsync(string runId, IList lines, CancellationToken cancellationToken = default) + public async Task LogAsync(string runId, string executionToken, IList lines, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(runId); + ArgumentNullException.ThrowIfNull(executionToken); ArgumentNullException.ThrowIfNull(lines); _session.ThrowIfDisposed(); - var request = new FactoryLogRequest { SessionId = _session.SessionId, RunId = runId, Lines = lines }; + var request = new FactoryLogRequest { SessionId = _session.SessionId, RunId = runId, ExecutionToken = executionToken, Lines = lines }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.log", [request], cancellationToken); } /// Runs one factory-scoped subagent and returns its result. /// Factory run identifier that owns the subagent. + /// Opaque token identifying the current factory execution attempt. /// Prompt to send to the subagent. /// Subagent execution options. /// The to monitor for cancellation requests. The default is . /// Result of one factory-scoped subagent call. - public async Task AgentAsync(string factoryRunId, string prompt, FactoryAgentOptions opts, CancellationToken cancellationToken = default) + public async Task AgentAsync(string factoryRunId, string executionToken, string prompt, FactoryAgentOptions opts, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(factoryRunId); + ArgumentNullException.ThrowIfNull(executionToken); ArgumentNullException.ThrowIfNull(prompt); ArgumentNullException.ThrowIfNull(opts); _session.ThrowIfDisposed(); - var request = new FactoryAgentRequest { SessionId = _session.SessionId, FactoryRunId = factoryRunId, Prompt = prompt, Opts = opts }; + var request = new FactoryAgentRequest { SessionId = _session.SessionId, FactoryRunId = factoryRunId, ExecutionToken = executionToken, Prompt = prompt, Opts = opts }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.agent", [request], cancellationToken); } @@ -21478,33 +23813,37 @@ internal FactoryJournalApi(CopilotSession session) /// Reads a memoized factory journal entry. /// Factory run identifier. + /// Opaque token identifying the current factory execution attempt. /// Namespaced journal key. /// The to monitor for cancellation requests. The default is . /// Result of reading a factory journal entry. - public async Task GetAsync(string runId, string key, CancellationToken cancellationToken = default) + public async Task GetAsync(string runId, string executionToken, string key, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(runId); + ArgumentNullException.ThrowIfNull(executionToken); ArgumentNullException.ThrowIfNull(key); _session.ThrowIfDisposed(); - var request = new FactoryJournalGetRequest { SessionId = _session.SessionId, RunId = runId, Key = key }; + var request = new FactoryJournalGetRequest { SessionId = _session.SessionId, RunId = runId, ExecutionToken = executionToken, Key = key }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.journal.get", [request], cancellationToken); } /// Stores a memoized factory journal entry. /// Factory run identifier. + /// Opaque token identifying the current factory execution attempt. /// Namespaced journal key. /// JSON result to memoize. /// The to monitor for cancellation requests. The default is . /// Acknowledgement that a factory request was accepted. - public async Task PutAsync(string runId, string key, object resultJson, CancellationToken cancellationToken = default) + public async Task PutAsync(string runId, string executionToken, string key, object resultJson, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(runId); + ArgumentNullException.ThrowIfNull(executionToken); ArgumentNullException.ThrowIfNull(key); ArgumentNullException.ThrowIfNull(resultJson); _session.ThrowIfDisposed(); - var request = new FactoryJournalPutRequest { SessionId = _session.SessionId, RunId = runId, Key = key, ResultJson = CopilotClient.ToJsonElementForWire(resultJson)!.Value }; + var request = new FactoryJournalPutRequest { SessionId = _session.SessionId, RunId = runId, ExecutionToken = executionToken, Key = key, ResultJson = CopilotClient.ToJsonElementForWire(resultJson)!.Value }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.factory.journal.put", [request], cancellationToken); } } @@ -21746,6 +24085,31 @@ public async Task GetWorkspaceAsync(CancellationTo return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.getWorkspace", [request], cancellationToken); } + /// Updates workspace metadata for a local session and returns the refreshed workspace. + /// Opaque workspace context supplied by the session host. + /// Optional workspace display name override. + /// The to monitor for cancellation requests. The default is . + /// Current workspace metadata for the session, including its absolute filesystem path when available. + public async Task UpdateMetadataAsync(object? context = null, string? name = null, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new WorkspacesUpdateMetadataRequest { SessionId = _session.SessionId, Context = CopilotClient.ToJsonElementForWire(context), Name = name }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.updateMetadata", [request], cancellationToken); + } + + /// Ensures a local session workspace exists and returns it. + /// Opaque workspace context supplied by the session host. + /// The to monitor for cancellation requests. The default is . + /// Current workspace metadata for the session, including its absolute filesystem path when available. + public async Task EnsureAsync(object? context = null, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new WorkspacesEnsureRequest { SessionId = _session.SessionId, Context = CopilotClient.ToJsonElementForWire(context) }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.ensure", [request], cancellationToken); + } + /// Lists files stored in the session workspace files directory. /// The to monitor for cancellation requests. The default is . /// Relative paths of files stored in the session workspace files directory. @@ -21807,6 +24171,79 @@ public async Task ReadCheckpointAsync(long numbe return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.readCheckpoint", [request], cancellationToken); } + /// Adds a compaction summary checkpoint to the local session workspace. + /// Summary title shown in checkpoint listings. + /// Markdown summary content to persist. + /// The to monitor for cancellation requests. The default is . + /// Persisted summary metadata and refreshed workspace metadata. + public async Task AddSummaryAsync(string title, string content, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(title); + ArgumentNullException.ThrowIfNull(content); + _session.ThrowIfDisposed(); + + var request = new WorkspacesAddSummaryRequest { SessionId = _session.SessionId, Title = title, Content = content }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.addSummary", [request], cancellationToken); + } + + /// Truncates local workspace compaction summaries after a rollback. + /// Number of newest summaries to keep. + /// The to monitor for cancellation requests. The default is . + /// Current workspace metadata for the session, including its absolute filesystem path when available. + public async Task TruncateSummariesAsync(long keepCount, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new WorkspacesTruncateSummariesRequest { SessionId = _session.SessionId, KeepCount = keepCount }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.truncateSummaries", [request], cancellationToken); + } + + /// Reads the autopilot objective state file from the local session workspace. + /// The to monitor for cancellation requests. The default is . + /// Autopilot objective file content, or null when missing. + public async Task ReadAutopilotObjectiveAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionWorkspacesReadAutopilotObjectiveRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.readAutopilotObjective", [request], cancellationToken); + } + + /// Writes the autopilot objective state file in the local session workspace. + /// Autopilot objective file content. + /// The to monitor for cancellation requests. The default is . + /// Result of writing the autopilot objective file. + public async Task WriteAutopilotObjectiveAsync(string content, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(content); + _session.ThrowIfDisposed(); + + var request = new WorkspacesWriteAutopilotObjectiveRequest { SessionId = _session.SessionId, Content = content }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.writeAutopilotObjective", [request], cancellationToken); + } + + /// Deletes the autopilot objective state file from the local session workspace. + /// The to monitor for cancellation requests. The default is . + /// Result of deleting the autopilot objective file. + public async Task DeleteAutopilotObjectiveAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionWorkspacesDeleteAutopilotObjectiveRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.deleteAutopilotObjective", [request], cancellationToken); + } + + /// Checks whether the local session workspace has an autopilot objective state file. + /// The to monitor for cancellation requests. The default is . + /// Whether the autopilot objective file exists. + public async Task AutopilotObjectiveExistsAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionWorkspacesAutopilotObjectiveExistsRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.autopilotObjectiveExists", [request], cancellationToken); + } + /// Saves pasted content as a UTF-8 file in the session workspace. /// Pasted content to save as a UTF-8 file. /// The to monitor for cancellation requests. The default is . @@ -21820,7 +24257,7 @@ public async Task SaveLargePasteAsync(string con return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.saveLargePaste", [request], cancellationToken); } - /// Computes a diff for the session workspace. + /// Computes a diff for the session workspace. Never rejects for a busy session: a `session`-mode diff that cannot read the session's file-change captures falls back to an unstaged git diff with `isFallback: true` and reports why in `unavailableReason`. /// Diff mode requested by the client. /// When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false. /// The to monitor for cancellation requests. The default is . @@ -22369,17 +24806,16 @@ internal async Task ConfigureGitHubAsync(object authIn return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.configureGitHub", [request], cancellationToken); } - /// Starts an individual MCP server on the live session from a caller-supplied config. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server. + /// Starts an individual MCP server on the live session. Omit `config` for a config-free start-by-name of an already-configured server (reuses the server's already-registered configuration); supply `config` to start from a caller-supplied configuration. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server. /// Name of the MCP server to start. - /// MCP server configuration (stdio process or remote HTTP/SSE). + /// MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server with its already-registered configuration (config-free start-by-name). /// The to monitor for cancellation requests. The default is . - public async Task StartServerAsync(string serverName, object config, CancellationToken cancellationToken = default) + public async Task StartServerAsync(string serverName, object? config = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); - ArgumentNullException.ThrowIfNull(config); _session.ThrowIfDisposed(); - var request = new McpStartServerRequest { SessionId = _session.SessionId, ServerName = serverName, Config = CopilotClient.ToJsonElementForWire(config)!.Value }; + var request = new McpStartServerRequest { SessionId = _session.SessionId, ServerName = serverName, Config = CopilotClient.ToJsonElementForWire(config) }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.startServer", [request], cancellationToken); } @@ -22521,6 +24957,19 @@ public async Task LoginAsync(string serverName, bool? force var request = new McpOauthLoginRequest { SessionId = _session.SessionId, ServerName = serverName, ForceReauth = forceReauth, ClientName = clientName, CallbackSuccessMessage = callbackSuccessMessage, ClientId = clientId, ClientSecret = clientSecret, PublicClient = publicClient, GrantType = grantType }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.oauth.login", [request], cancellationToken); } + + /// Responds to a pending MCP OAuth authorization request by its request id. + /// OAuth request identifier from the mcp.oauth_required event. + /// The to monitor for cancellation requests. The default is . + /// Indicates whether the pending MCP OAuth response was accepted. + public async Task RespondAsync(string requestId, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(requestId); + _session.ThrowIfDisposed(); + + var request = new McpOauthRespondRequest { SessionId = _session.SessionId, RequestId = requestId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.oauth.respond", [request], cancellationToken); + } } /// Provides session-scoped McpHeaders APIs. @@ -22803,15 +25252,16 @@ internal OptionsApi(CopilotSession session) /// Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. /// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set. /// Whether shell-script safety heuristics are enabled. - /// Shell init profile (`None` or `NonInteractive`). - /// Per-shell process flags (e.g., `pwsh` arguments). + /// Per-session settings for built-in shell tools. + /// Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`). + /// PowerShell process flags applied to built-in and user-requested shell commands. /// Resolved sandbox configuration. /// Whether interactive shell sessions are logged. /// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). /// Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers. /// Additional directories to search for skills. /// Skill IDs that should be excluded from this session. - /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag. + /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`. /// Maximum decoded byte size of a single model-facing binary tool result (e.g. an image) persisted inline in session events and re-presented to the model on later turns / resume. Larger results are persisted as a metadata-only marker and shown to the model as a short text note. Defaults to 10 MB. /// Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes. /// Whether to default custom agents to local-only execution. @@ -22828,6 +25278,7 @@ internal OptionsApi(CopilotSession session) /// Whether to surface reasoning-summary events from the model. /// Runtime context discriminator (e.g., `cli`, `actions`). /// Override directory for the session-events log. When unset, the runtime's default events log directory is used. + /// Whether subagent callback events should be forwarded into the session event log sink. /// Additional content-exclusion policies to merge into the session's policy set. /// Whether to expose the `manage_schedule` tool to the agent. The runtime always owns the per-session schedule registry; this flag only controls tool exposure (typically gated to staff users). /// Replaces the session's capability set with the given list. Use to enable or disable capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the field to leave the existing capability set unchanged. @@ -22841,11 +25292,11 @@ internal OptionsApi(CopilotSession session) /// Optional session limits. Pass null to clear the session limits. /// The to monitor for cancellation requests. The default is . /// Indicates whether the session options patch was applied successfully. - public async Task UpdateAsync(string? model = null, ModelCapabilitiesOverride? modelCapabilitiesOverrides = null, string? reasoningEffort = null, OptionsUpdateReasoningSummary? reasoningSummary = null, Verbosity? verbosity = null, string? clientName = null, string? lspClientName = null, string? integrationId = null, IDictionary? featureFlags = null, bool? isExperimentalMode = null, ProviderConfig? provider = null, CapiSessionOptions? capi = null, string? workingDirectory = null, IList? availableTools = null, IList? excludedTools = null, IList? includedBuiltinAgents = null, IList? excludedBuiltinAgents = null, OptionsUpdateToolFilterPrecedence? toolFilterPrecedence = null, bool? enableScriptSafety = null, string? shellInitProfile = null, IList? shellProcessFlags = null, SandboxConfig? sandboxConfig = null, bool? logInteractiveShells = null, OptionsUpdateEnvValueMode? envValueMode = null, bool? allowAllMcpServerInstructions = null, IList? skillDirectories = null, IList? disabledSkills = null, bool? enableOnDemandInstructionDiscovery = null, long? maxInlineBinaryBytes = null, IList? installedPlugins = null, bool? customAgentsLocalOnly = null, bool? suppressCustomAgentPrompt = null, bool? skipCustomInstructions = null, IList? disabledInstructionSources = null, bool? coauthorEnabled = null, string? trajectoryFile = null, bool? enableStreaming = null, string? copilotUrl = null, bool? askUserDisabled = null, bool? continueOnAutoMode = null, bool? runningInInteractiveMode = null, bool? enableReasoningSummaries = null, string? agentContext = null, string? eventsLogDirectory = null, IList? additionalContentExclusionPolicies = null, bool? manageScheduleEnabled = null, IList? sessionCapabilities = null, bool? skipEmbeddingRetrieval = null, string? organizationCustomInstructions = null, bool? enableFileHooks = null, bool? enableHostGitOperations = null, bool? enableSessionStore = null, bool? enableSkills = null, OptionsUpdateContextTier? contextTier = null, SessionLimitsConfig? sessionLimits = null, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string? model = null, ModelCapabilitiesOverride? modelCapabilitiesOverrides = null, string? reasoningEffort = null, OptionsUpdateReasoningSummary? reasoningSummary = null, Verbosity? verbosity = null, string? clientName = null, string? lspClientName = null, string? integrationId = null, IDictionary? featureFlags = null, bool? isExperimentalMode = null, ProviderConfig? provider = null, CapiSessionOptions? capi = null, string? workingDirectory = null, IList? availableTools = null, IList? excludedTools = null, IList? includedBuiltinAgents = null, IList? excludedBuiltinAgents = null, OptionsUpdateToolFilterPrecedence? toolFilterPrecedence = null, bool? enableScriptSafety = null, ShellOptions? shell = null, string? shellInitProfile = null, IList? shellProcessFlags = null, SandboxConfig? sandboxConfig = null, bool? logInteractiveShells = null, OptionsUpdateEnvValueMode? envValueMode = null, bool? allowAllMcpServerInstructions = null, IList? skillDirectories = null, IList? disabledSkills = null, bool? enableOnDemandInstructionDiscovery = null, long? maxInlineBinaryBytes = null, IList? installedPlugins = null, bool? customAgentsLocalOnly = null, bool? suppressCustomAgentPrompt = null, bool? skipCustomInstructions = null, IList? disabledInstructionSources = null, bool? coauthorEnabled = null, string? trajectoryFile = null, bool? enableStreaming = null, string? copilotUrl = null, bool? askUserDisabled = null, bool? continueOnAutoMode = null, bool? runningInInteractiveMode = null, bool? enableReasoningSummaries = null, string? agentContext = null, string? eventsLogDirectory = null, bool? eventsLogIncludesSubagents = null, IList? additionalContentExclusionPolicies = null, bool? manageScheduleEnabled = null, IList? sessionCapabilities = null, bool? skipEmbeddingRetrieval = null, string? organizationCustomInstructions = null, bool? enableFileHooks = null, bool? enableHostGitOperations = null, bool? enableSessionStore = null, bool? enableSkills = null, OptionsUpdateContextTier? contextTier = null, SessionLimitsConfig? sessionLimits = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); - var request = new SessionUpdateOptionsParams { SessionId = _session.SessionId, Model = model, ModelCapabilitiesOverrides = modelCapabilitiesOverrides, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, Verbosity = verbosity, ClientName = clientName, LspClientName = lspClientName, IntegrationId = integrationId, FeatureFlags = featureFlags, IsExperimentalMode = isExperimentalMode, Provider = provider, Capi = capi, WorkingDirectory = workingDirectory, AvailableTools = availableTools, ExcludedTools = excludedTools, IncludedBuiltinAgents = includedBuiltinAgents, ExcludedBuiltinAgents = excludedBuiltinAgents, ToolFilterPrecedence = toolFilterPrecedence, EnableScriptSafety = enableScriptSafety, ShellInitProfile = shellInitProfile, ShellProcessFlags = shellProcessFlags, SandboxConfig = sandboxConfig, LogInteractiveShells = logInteractiveShells, EnvValueMode = envValueMode, AllowAllMcpServerInstructions = allowAllMcpServerInstructions, SkillDirectories = skillDirectories, DisabledSkills = disabledSkills, EnableOnDemandInstructionDiscovery = enableOnDemandInstructionDiscovery, MaxInlineBinaryBytes = maxInlineBinaryBytes, InstalledPlugins = installedPlugins, CustomAgentsLocalOnly = customAgentsLocalOnly, SuppressCustomAgentPrompt = suppressCustomAgentPrompt, SkipCustomInstructions = skipCustomInstructions, DisabledInstructionSources = disabledInstructionSources, CoauthorEnabled = coauthorEnabled, TrajectoryFile = trajectoryFile, EnableStreaming = enableStreaming, CopilotUrl = copilotUrl, AskUserDisabled = askUserDisabled, ContinueOnAutoMode = continueOnAutoMode, RunningInInteractiveMode = runningInInteractiveMode, EnableReasoningSummaries = enableReasoningSummaries, AgentContext = agentContext, EventsLogDirectory = eventsLogDirectory, AdditionalContentExclusionPolicies = additionalContentExclusionPolicies, ManageScheduleEnabled = manageScheduleEnabled, SessionCapabilities = sessionCapabilities, SkipEmbeddingRetrieval = skipEmbeddingRetrieval, OrganizationCustomInstructions = organizationCustomInstructions, EnableFileHooks = enableFileHooks, EnableHostGitOperations = enableHostGitOperations, EnableSessionStore = enableSessionStore, EnableSkills = enableSkills, ContextTier = contextTier, SessionLimits = sessionLimits }; + var request = new SessionUpdateOptionsParams { SessionId = _session.SessionId, Model = model, ModelCapabilitiesOverrides = modelCapabilitiesOverrides, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, Verbosity = verbosity, ClientName = clientName, LspClientName = lspClientName, IntegrationId = integrationId, FeatureFlags = featureFlags, IsExperimentalMode = isExperimentalMode, Provider = provider, Capi = capi, WorkingDirectory = workingDirectory, AvailableTools = availableTools, ExcludedTools = excludedTools, IncludedBuiltinAgents = includedBuiltinAgents, ExcludedBuiltinAgents = excludedBuiltinAgents, ToolFilterPrecedence = toolFilterPrecedence, EnableScriptSafety = enableScriptSafety, Shell = shell, ShellInitProfile = shellInitProfile, ShellProcessFlags = shellProcessFlags, SandboxConfig = sandboxConfig, LogInteractiveShells = logInteractiveShells, EnvValueMode = envValueMode, AllowAllMcpServerInstructions = allowAllMcpServerInstructions, SkillDirectories = skillDirectories, DisabledSkills = disabledSkills, EnableOnDemandInstructionDiscovery = enableOnDemandInstructionDiscovery, MaxInlineBinaryBytes = maxInlineBinaryBytes, InstalledPlugins = installedPlugins, CustomAgentsLocalOnly = customAgentsLocalOnly, SuppressCustomAgentPrompt = suppressCustomAgentPrompt, SkipCustomInstructions = skipCustomInstructions, DisabledInstructionSources = disabledInstructionSources, CoauthorEnabled = coauthorEnabled, TrajectoryFile = trajectoryFile, EnableStreaming = enableStreaming, CopilotUrl = copilotUrl, AskUserDisabled = askUserDisabled, ContinueOnAutoMode = continueOnAutoMode, RunningInInteractiveMode = runningInInteractiveMode, EnableReasoningSummaries = enableReasoningSummaries, AgentContext = agentContext, EventsLogDirectory = eventsLogDirectory, EventsLogIncludesSubagents = eventsLogIncludesSubagents, AdditionalContentExclusionPolicies = additionalContentExclusionPolicies, ManageScheduleEnabled = manageScheduleEnabled, SessionCapabilities = sessionCapabilities, SkipEmbeddingRetrieval = skipEmbeddingRetrieval, OrganizationCustomInstructions = organizationCustomInstructions, EnableFileHooks = enableFileHooks, EnableHostGitOperations = enableHostGitOperations, EnableSessionStore = enableSessionStore, EnableSkills = enableSkills, ContextTier = contextTier, SessionLimits = sessionLimits }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.options.update", [request], cancellationToken); } } @@ -23411,13 +25862,14 @@ public async Task SetRequiredAsync(bool required, } /// Clears session-scoped tool permission approvals. + /// Whether location-scoped approvals are cleared too. Defaults to `true`. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. - public async Task ResetSessionApprovalsAsync(CancellationToken cancellationToken = default) + public async Task ResetSessionApprovalsAsync(bool? includeLocation = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); - var request = new PermissionsResetSessionApprovalsRequest { SessionId = _session.SessionId }; + var request = new PermissionsResetSessionApprovalsRequest { SessionId = _session.SessionId, IncludeLocation = includeLocation }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.resetSessionApprovals", [request], cancellationToken); } @@ -23806,6 +26258,31 @@ internal async Task EvaluatePredicateAsy } } +/// Provides session-scoped ContentExclusion APIs. +[Experimental(Diagnostics.Experimental)] +public sealed class ContentExclusionApi +{ + private readonly CopilotSession _session; + + internal ContentExclusionApi(CopilotSession session) + { + _session = session; + } + + /// Checks local file system absolute paths within the session working directory against its content-exclusion policy. Results preserve input order. Unsupported paths/filesystems and unavailable policy evaluation return available false, and callers must treat every requested path as excluded. + /// Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates. + /// The to monitor for cancellation requests. The default is . + /// Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable. + public async Task CheckPathsAsync(IList paths, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(paths); + _session.ThrowIfDisposed(); + + var request = new ContentExclusionCheckPathsRequest { SessionId = _session.SessionId, Paths = paths }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.contentExclusion.checkPaths", [request], cancellationToken); + } +} + /// Provides session-scoped Shell APIs. [Experimental(Diagnostics.Experimental)] public sealed class ShellApi @@ -23817,7 +26294,7 @@ internal ShellApi(CopilotSession session) _session = session; } - /// Starts a shell command and streams output through session notifications. + /// Starts a shell command and streams output through session notifications. The command runs as the leader of its own process group (POSIX) or in a dedicated job object (Windows), so a forced termination — via "shell.kill", the request timeout, or session disposal — signals that whole group/job rather than only the direct child. Two gaps are worth planning for: a command that exits on its own does not trigger that teardown, and on POSIX a descendant that moves itself into a new session or process group (for example via "setsid") leaves the signalled group, so either can leave a background process running. /// Shell command to execute. /// Working directory (defaults to session working directory). /// Timeout in milliseconds (default: 30000). @@ -23832,7 +26309,7 @@ public async Task ExecAsync(string command, string? cwd = null, return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.shell.exec", [request], cancellationToken); } - /// Sends a signal to a shell process previously started via "shell.exec". + /// Sends a signal to a shell process previously started via "shell.exec". The signal targets the command's whole process group (POSIX) or job object (Windows), so descendants still in that group are signalled too, not just the direct child. On POSIX a descendant that moved itself into a new session or process group (for example via "setsid") is no longer in the signalled group and survives. /// Process identifier returned by shell.exec. /// Signal to send (default: SIGTERM). /// The to monitor for cancellation requests. The default is . @@ -23911,6 +26388,44 @@ public async Task TruncateAsync(string eventId, Cancellat return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.truncate", [request], cancellationToken); } + /// Lists the user turns that the session can rewind to. Never rejects for a busy session: rewind reads need the session's file-change captures to be settled, so a session that still holds active work answers with `unavailableReason: "session-busy"` and no points, which the caller can retry. + /// The to monitor for cancellation requests. The default is . + /// Rewind points and file-change-tracking availability for the session. + public async Task ListRewindPointsAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionHistoryListRewindPointsRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.listRewindPoints", [request], cancellationToken); + } + + /// Previews the files that a conversation-and-files rewind would restore. + /// ID of the user.message event that begins the discarded suffix. + /// The to monitor for cancellation requests. The default is . + /// Files and aggregate changes for a prospective rewind. + public async Task PreviewRewindAsync(string eventId, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(eventId); + _session.ThrowIfDisposed(); + + var request = new HistoryPreviewRewindRequest { SessionId = _session.SessionId, EventId = eventId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.previewRewind", [request], cancellationToken); + } + + /// Rewinds the session conversation, optionally restoring files changed by the discarded turns. Not crash-atomic: file restore and conversation truncation are separate stores, applied in that order, so a process crash between them can leave the workspace rewound while the conversation still contains the discarded turns. There is no recovery journal; re-running the same rewind is the recovery path for a crash before truncation lands, since file restore is idempotent (already-restored files are reported as skipped) and truncation is re-derived from the still-retained boundary event. After truncation lands that boundary no longer exists, so the same request is rejected; the only stage that can still be outstanding is snapshot pruning, whose failure leaves orphan snapshots the capture store tolerates. The reverse inconsistency cannot occur, because truncation is never applied before file restore succeeds. + /// ID of the user.message event that begins the discarded suffix. + /// Whether to rewind only conversation history or also restore captured files. + /// The to monitor for cancellation requests. The default is . + /// Structured outcome of a rewind request. + public async Task RewindAsync(string eventId, HistoryRewindMode mode, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(eventId); + _session.ThrowIfDisposed(); + + var request = new HistoryRewindRequest { SessionId = _session.SessionId, EventId = eventId, Mode = mode }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.rewind", [request], cancellationToken); + } + /// Cancels any in-progress background compaction on a local session. /// The to monitor for cancellation requests. The default is . /// Indicates whether an in-progress background compaction was cancelled. @@ -23967,6 +26482,64 @@ public async Task PendingItemsAsync(CancellationToken c return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.pendingItems", [request], cancellationToken); } + /// Returns the internal native queue snapshot for in-process session orchestration. + /// The to monitor for cancellation requests. The default is . + /// Internal snapshot of native queue state for local session orchestration. + internal async Task SnapshotAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionQueueSnapshotRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.snapshot", [request], cancellationToken); + } + + /// Reports whether the local session has native queued work pending. + /// The to monitor for cancellation requests. The default is . + /// Whether the native queue has pending work. + internal async Task HasPendingAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionQueueHasPendingRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.hasPending", [request], cancellationToken); + } + + /// Begins a native deferred-idle drain when background work has quiesced. + /// Whether the host still has active background work. + /// The to monitor for cancellation requests. The default is . + /// Whether a deferred-idle drain should run. + internal async Task BeginDeferredIdleDrainAsync(bool activeBackgroundWork, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new QueueBeginDeferredIdleDrainRequest { SessionId = _session.SessionId, ActiveBackgroundWork = activeBackgroundWork }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.beginDeferredIdleDrain", [request], cancellationToken); + } + + /// Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle. + /// Whether the host still has active background work. + /// Whether native queued work remains. + /// The to monitor for cancellation requests. The default is . + /// Action selected by the native deferred-idle drain. + internal async Task FinishDeferredIdleDrainAsync(bool activeBackgroundWork, bool hasPending, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new QueueFinishDeferredIdleDrainRequest { SessionId = _session.SessionId, ActiveBackgroundWork = activeBackgroundWork, HasPending = hasPending }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.finishDeferredIdleDrain", [request], cancellationToken); + } + + /// Marks session.idle as deferred by native background work state. + /// Whether the deferred idle was caused by an aborted foreground turn. + /// The to monitor for cancellation requests. The default is . + internal async Task DeferSessionIdleAsync(bool aborted, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new QueueDeferSessionIdleRequest { SessionId = _session.SessionId, Aborted = aborted }; + await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.deferSessionIdle", [request], cancellationToken); + } + /// Removes the most recently queued user-facing item (LIFO). /// The to monitor for cancellation requests. The default is . /// Indicates whether a user-facing pending item was removed. @@ -23987,6 +26560,40 @@ public async Task ClearAsync(CancellationToken cancellationToken = default) var request = new SessionQueueClearRequest { SessionId = _session.SessionId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.clear", [request], cancellationToken); } + + /// Consumes queued native system notifications matching an internal filter. + /// Opaque runtime-owned filter object. + /// The to monitor for cancellation requests. The default is . + /// Indicates whether a user-facing pending item was removed. + internal async Task ConsumeSystemNotificationsAsync(object filter, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(filter); + _session.ThrowIfDisposed(); + + var request = new QueueConsumeSystemNotificationsRequest { SessionId = _session.SessionId, Filter = CopilotClient.ToJsonElementForWire(filter)!.Value }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.consumeSystemNotifications", [request], cancellationToken); + } + + /// Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn. + /// The to monitor for cancellation requests. The default is . + /// Result of enqueueing the resume-pending wake item. + internal async Task EnqueueResumePendingAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionQueueEnqueueResumePendingRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.enqueueResumePending", [request], cancellationToken); + } + + /// Drains the native local-session work queue for in-process session orchestration. + /// The to monitor for cancellation requests. The default is . + internal async Task ProcessAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionQueueProcessRequest { SessionId = _session.SessionId }; + await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.process", [request], cancellationToken); + } } /// Provides session-scoped EventLog APIs. @@ -24180,6 +26787,105 @@ public async Task ListAsync(CancellationToken cancellationToken = return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.list", [request], cancellationToken); } + /// Hydrates the native schedule registry from persisted session events. + /// The to monitor for cancellation requests. The default is . + internal async Task HydrateAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionScheduleHydrateRequest { SessionId = _session.SessionId }; + await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.hydrate", [request], cancellationToken); + } + + /// Reports whether the session has an active self-paced scheduled prompt. + /// The to monitor for cancellation requests. The default is . + /// Whether the session currently has an active self-paced schedule. + internal async Task HasSelfPacedAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionScheduleHasSelfPacedRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.hasSelfPaced", [request], cancellationToken); + } + + /// Registers a relative-interval scheduled prompt. + /// Human-readable interval such as `30s`, `5m`, or `2h`. + /// Prompt text to enqueue when the schedule fires. + /// Whether the schedule should re-arm after each tick. Defaults to true. + /// Optional display-only prompt label. + /// The to monitor for cancellation requests. The default is . + /// Result of registering or re-arming a scheduled prompt. + internal async Task AddAsync(string interval, string prompt, bool? recurring = null, string? displayPrompt = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(interval); + ArgumentNullException.ThrowIfNull(prompt); + _session.ThrowIfDisposed(); + + var request = new ScheduleAddRequest { SessionId = _session.SessionId, Interval = interval, Prompt = prompt, Recurring = recurring, DisplayPrompt = displayPrompt }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.add", [request], cancellationToken); + } + + /// Registers a recurring cron scheduled prompt. + /// 5-field cron expression. + /// Prompt text to enqueue when the schedule fires. + /// Whether the schedule should re-arm after each tick. Defaults to true. + /// Optional display-only prompt label. + /// IANA timezone for evaluating the cron expression. + /// The to monitor for cancellation requests. The default is . + /// Result of registering or re-arming a scheduled prompt. + internal async Task AddCronAsync(string cron, string prompt, bool? recurring = null, string? displayPrompt = null, string? tz = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(cron); + ArgumentNullException.ThrowIfNull(prompt); + _session.ThrowIfDisposed(); + + var request = new ScheduleAddCronRequest { SessionId = _session.SessionId, Cron = cron, Prompt = prompt, Recurring = recurring, DisplayPrompt = displayPrompt, Tz = tz }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.addCron", [request], cancellationToken); + } + + /// Registers an absolute-time scheduled prompt. + /// Epoch milliseconds when the prompt should fire. + /// Prompt text to enqueue when the schedule fires. + /// Whether the schedule should re-arm after each tick. Defaults to false. + /// Optional display-only prompt label. + /// The to monitor for cancellation requests. The default is . + /// Result of registering or re-arming a scheduled prompt. + internal async Task AddAtAsync(long at, string prompt, bool? recurring = null, string? displayPrompt = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(prompt); + _session.ThrowIfDisposed(); + + var request = new ScheduleAddAtRequest { SessionId = _session.SessionId, At = at, Prompt = prompt, Recurring = recurring, DisplayPrompt = displayPrompt }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.addAt", [request], cancellationToken); + } + + /// Registers a self-paced scheduled prompt. + /// Prompt text to enqueue when the schedule fires. + /// Optional display-only prompt label. + /// The to monitor for cancellation requests. The default is . + /// Result of registering or re-arming a scheduled prompt. + internal async Task AddSelfPacedAsync(string prompt, string? displayPrompt = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(prompt); + _session.ThrowIfDisposed(); + + var request = new ScheduleAddSelfPacedRequest { SessionId = _session.SessionId, Prompt = prompt, DisplayPrompt = displayPrompt }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.addSelfPaced", [request], cancellationToken); + } + + /// Re-arms an active self-paced scheduled prompt. + /// Id of the self-paced scheduled prompt. + /// Epoch milliseconds when the prompt should next fire. + /// The to monitor for cancellation requests. The default is . + /// Result of registering or re-arming a scheduled prompt. + internal async Task RearmSelfPacedAsync(long id, long at, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new ScheduleRearmSelfPacedRequest { SessionId = _session.SessionId, Id = id, At = at }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.rearmSelfPaced", [request], cancellationToken); + } + /// Removes a scheduled prompt by id. /// Id of the scheduled prompt to remove. /// The to monitor for cancellation requests. The default is . @@ -24274,11 +26980,16 @@ public interface ISessionFsHandler /// The to monitor for cancellation requests. The default is . /// Describes a filesystem error. Task RenameAsync(SessionFsRenameRequest request, CancellationToken cancellationToken = default); - /// Executes a SQLite query against the per-session database. - /// SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. + /// Executes a SQLite query against the per-session database. Providers apply busy handling for every call. + /// SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. The provider applies its SQLite busy timeout for every call. /// The to monitor for cancellation requests. The default is . /// Query results including rows, columns, and rows affected, or a filesystem error if execution failed. Task SqliteQueryAsync(SessionFsSqliteQueryRequest request, CancellationToken cancellationToken = default); + /// Executes SQLite statements atomically on the provider-owned connection. + /// Statements to execute atomically. Providers apply busy handling for every call. + /// The to monitor for cancellation requests. The default is . + /// Per-statement results, or a classified transaction error. + Task SqliteTransactionAsync(SessionFsSqliteTransactionRequest request, CancellationToken cancellationToken = default); /// Checks whether the per-session SQLite database already exists, without creating it. /// Identifies the target session. /// The to monitor for cancellation requests. The default is . @@ -24416,6 +27127,12 @@ public static void RegisterClientSessionApiHandlers(JsonRpc rpc, Func>)(async (request, cancellationToken) => + { + var handler = getHandlers(request.SessionId).SessionFs; + if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); + return await handler.SqliteTransactionAsync(request, cancellationToken); + }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.sqliteExists", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; @@ -24577,6 +27294,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.AttachmentSelectionDetails), TypeInfoPropertyName = "SessionEventsAttachmentSelectionDetails")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentSelectionDetailsEnd), TypeInfoPropertyName = "SessionEventsAttachmentSelectionDetailsEnd")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentSelectionDetailsStart), TypeInfoPropertyName = "SessionEventsAttachmentSelectionDetailsStart")] +[JsonSerializable(typeof(GitHub.Copilot.AutoApprovalJudgeFailureReason), TypeInfoPropertyName = "SessionEventsAutoApprovalJudgeFailureReason")] [JsonSerializable(typeof(GitHub.Copilot.AutoApprovalRecommendation), TypeInfoPropertyName = "SessionEventsAutoApprovalRecommendation")] [JsonSerializable(typeof(GitHub.Copilot.AutoModeResolvedReasoningBucket), TypeInfoPropertyName = "SessionEventsAutoModeResolvedReasoningBucket")] [JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchCompletedData), TypeInfoPropertyName = "SessionEventsAutoModeSwitchCompletedData")] @@ -24638,6 +27356,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.ExternalToolCompletedEvent), TypeInfoPropertyName = "SessionEventsExternalToolCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.ExternalToolRequestedData), TypeInfoPropertyName = "SessionEventsExternalToolRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.ExternalToolRequestedEvent), TypeInfoPropertyName = "SessionEventsExternalToolRequestedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.FactoryRunUpdatedData), TypeInfoPropertyName = "SessionEventsFactoryRunUpdatedData")] +[JsonSerializable(typeof(GitHub.Copilot.FactoryRunUpdatedEvent), TypeInfoPropertyName = "SessionEventsFactoryRunUpdatedEvent")] [JsonSerializable(typeof(GitHub.Copilot.GitHubRepoRef), TypeInfoPropertyName = "SessionEventsGitHubRepoRef")] [JsonSerializable(typeof(GitHub.Copilot.HandoffRepository), TypeInfoPropertyName = "SessionEventsHandoffRepository")] [JsonSerializable(typeof(GitHub.Copilot.HandoffSourceType), TypeInfoPropertyName = "SessionEventsHandoffSourceType")] @@ -24738,6 +27458,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.SamplingCompletedEvent), TypeInfoPropertyName = "SessionEventsSamplingCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SamplingRequestedData), TypeInfoPropertyName = "SessionEventsSamplingRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.SamplingRequestedEvent), TypeInfoPropertyName = "SessionEventsSamplingRequestedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.ScheduleOrigin), TypeInfoPropertyName = "SessionEventsScheduleOrigin")] [JsonSerializable(typeof(GitHub.Copilot.SessionEvent), TypeInfoPropertyName = "SessionEventsSessionEvent")] [JsonSerializable(typeof(GitHub.Copilot.SessionLimitsConfig), TypeInfoPropertyName = "SessionEventsSessionLimitsConfig")] [JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedCompletedData), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedCompletedData")] @@ -24874,6 +27595,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(AllowAllPermissionSetResult))] [JsonSerializable(typeof(AllowAllPermissionState))] [JsonSerializable(typeof(AuthInfo))] +[JsonSerializable(typeof(BuiltInModelCatalog))] +[JsonSerializable(typeof(BuiltInModelCatalogEntry))] [JsonSerializable(typeof(CancelUserRequestedShellCommandResult))] [JsonSerializable(typeof(CanvasAction))] [JsonSerializable(typeof(CanvasActionInvokeRequest))] @@ -24907,6 +27630,9 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(ConnectResult))] [JsonSerializable(typeof(ConnectedRemoteSessionMetadata))] [JsonSerializable(typeof(ConnectedRemoteSessionMetadataRepository))] +[JsonSerializable(typeof(ContentExclusionCheckPathsRequest))] +[JsonSerializable(typeof(ContentExclusionCheckPathsResult))] +[JsonSerializable(typeof(ContentExclusionPathCheck))] [JsonSerializable(typeof(ContextHeaviestMessage))] [JsonSerializable(typeof(CopilotUserResponse))] [JsonSerializable(typeof(CopilotUserResponseEndpoints))] @@ -24943,19 +27669,34 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(FactoryAgentOptions))] [JsonSerializable(typeof(FactoryAgentRequest))] [JsonSerializable(typeof(FactoryAgentResult))] +[JsonSerializable(typeof(FactoryAgentSummary))] [JsonSerializable(typeof(FactoryCancelRequest))] +[JsonSerializable(typeof(FactoryCurrentPhase))] +[JsonSerializable(typeof(FactoryDeclaredLimits))] [JsonSerializable(typeof(FactoryExecuteRequest))] [JsonSerializable(typeof(FactoryExecuteResult))] +[JsonSerializable(typeof(FactoryGetRunProgressRequest))] [JsonSerializable(typeof(FactoryGetRunRequest))] [JsonSerializable(typeof(FactoryJournalGetRequest))] [JsonSerializable(typeof(FactoryJournalGetResult))] [JsonSerializable(typeof(FactoryJournalPutRequest))] +[JsonSerializable(typeof(FactoryListRunsRequest))] +[JsonSerializable(typeof(FactoryListRunsResult))] [JsonSerializable(typeof(FactoryLogLine))] [JsonSerializable(typeof(FactoryLogRequest))] +[JsonSerializable(typeof(FactoryPhaseObservation))] +[JsonSerializable(typeof(FactoryProgressLine))] +[JsonSerializable(typeof(FactoryProgressPage))] +[JsonSerializable(typeof(FactoryResumeRequest))] +[JsonSerializable(typeof(FactoryResumeResult))] +[JsonSerializable(typeof(FactoryRunConsumed))] +[JsonSerializable(typeof(FactoryRunDetail))] [JsonSerializable(typeof(FactoryRunFailure))] [JsonSerializable(typeof(FactoryRunLimits))] [JsonSerializable(typeof(FactoryRunRequest))] [JsonSerializable(typeof(FactoryRunResult))] +[JsonSerializable(typeof(FactoryRunSummary))] +[JsonSerializable(typeof(FactoryRunTerminal))] [JsonSerializable(typeof(FleetStartRequest))] [JsonSerializable(typeof(FleetStartResult))] [JsonSerializable(typeof(FolderTrustAddParams))] @@ -24972,6 +27713,14 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(HistoryCompactRequest))] [JsonSerializable(typeof(HistoryCompactRequestWithSession))] [JsonSerializable(typeof(HistoryCompactResult))] +[JsonSerializable(typeof(HistoryListRewindPointsResult))] +[JsonSerializable(typeof(HistoryPreviewRewindRequest))] +[JsonSerializable(typeof(HistoryPreviewRewindResult))] +[JsonSerializable(typeof(HistoryRewindFilePreview))] +[JsonSerializable(typeof(HistoryRewindPoint))] +[JsonSerializable(typeof(HistoryRewindRequest))] +[JsonSerializable(typeof(HistoryRewindResult))] +[JsonSerializable(typeof(HistorySkippedFileRestore))] [JsonSerializable(typeof(HistorySummarizeForHandoffResult))] [JsonSerializable(typeof(HistoryTruncateRequest))] [JsonSerializable(typeof(HistoryTruncateResult))] @@ -24985,6 +27734,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(InstructionsDiscoverRequest))] [JsonSerializable(typeof(InstructionsGetDiscoveryPathsRequest))] [JsonSerializable(typeof(InstructionsGetSourcesResult))] +[JsonSerializable(typeof(InterruptMainTurnRequest))] +[JsonSerializable(typeof(InterruptMainTurnResult))] [JsonSerializable(typeof(LlmInferenceHttpRequestChunkRequest))] [JsonSerializable(typeof(LlmInferenceHttpRequestChunkResult))] [JsonSerializable(typeof(LlmInferenceHttpRequestStartRequest))] @@ -25053,6 +27804,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(McpOauthLoginRequest))] [JsonSerializable(typeof(McpOauthLoginResult))] [JsonSerializable(typeof(McpOauthPendingRequestResponse))] +[JsonSerializable(typeof(McpOauthRespondRequest))] +[JsonSerializable(typeof(McpOauthRespondResult))] [JsonSerializable(typeof(McpRegisterExternalClientRequest))] [JsonSerializable(typeof(McpReloadWithConfigRequest))] [JsonSerializable(typeof(McpRemoveGitHubResult))] @@ -25224,9 +27977,18 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(PushAttachmentSelectionDetailsEnd))] [JsonSerializable(typeof(PushAttachmentSelectionDetailsStart))] [JsonSerializable(typeof(PushGitHubRepoRef))] +[JsonSerializable(typeof(QueueBeginDeferredIdleDrainRequest))] +[JsonSerializable(typeof(QueueBeginDeferredIdleDrainResult))] +[JsonSerializable(typeof(QueueConsumeSystemNotificationsRequest))] +[JsonSerializable(typeof(QueueDeferSessionIdleRequest))] +[JsonSerializable(typeof(QueueEnqueueResumePendingResult))] +[JsonSerializable(typeof(QueueFinishDeferredIdleDrainRequest))] +[JsonSerializable(typeof(QueueFinishDeferredIdleDrainResult))] +[JsonSerializable(typeof(QueueHasPendingResult))] [JsonSerializable(typeof(QueuePendingItems))] [JsonSerializable(typeof(QueuePendingItemsResult))] [JsonSerializable(typeof(QueueRemoveMostRecentResult))] +[JsonSerializable(typeof(QueueSnapshotResult))] [JsonSerializable(typeof(QueuedCommandResult))] [JsonSerializable(typeof(RegisterEventInterestParams))] [JsonSerializable(typeof(RegisterEventInterestResult))] @@ -25254,8 +28016,15 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SandboxConfigUserPolicyFilesystem))] [JsonSerializable(typeof(SandboxConfigUserPolicyNetwork))] [JsonSerializable(typeof(SandboxConfigUserPolicySeatbelt))] +[JsonSerializable(typeof(ScheduleAddAtRequest))] +[JsonSerializable(typeof(ScheduleAddCronRequest))] +[JsonSerializable(typeof(ScheduleAddRequest))] +[JsonSerializable(typeof(ScheduleAddResult))] +[JsonSerializable(typeof(ScheduleAddSelfPacedRequest))] [JsonSerializable(typeof(ScheduleEntry))] +[JsonSerializable(typeof(ScheduleHasSelfPacedResult))] [JsonSerializable(typeof(ScheduleList))] +[JsonSerializable(typeof(ScheduleRearmSelfPacedRequest))] [JsonSerializable(typeof(ScheduleStopRequest))] [JsonSerializable(typeof(ScheduleStopResult))] [JsonSerializable(typeof(SecretsAddFilterValuesRequest))] @@ -25266,6 +28035,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SendMessagesResult))] [JsonSerializable(typeof(SendRequest))] [JsonSerializable(typeof(SendResult))] +[JsonSerializable(typeof(SendSystemNotificationRequest))] [JsonSerializable(typeof(ServerAgentList))] [JsonSerializable(typeof(ServerInstructionSourceList))] [JsonSerializable(typeof(ServerSkill))] @@ -25277,6 +28047,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionAgentReloadRequest))] [JsonSerializable(typeof(SessionAuthStatus))] [JsonSerializable(typeof(SessionBulkDeleteResult))] +[JsonSerializable(typeof(SessionCancelAllBackgroundAgentsRequest))] [JsonSerializable(typeof(SessionCanvasListOpenRequest))] [JsonSerializable(typeof(SessionCanvasListRequest))] [JsonSerializable(typeof(SessionCompletionItem))] @@ -25307,12 +28078,17 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionFsSqliteExistsResult))] [JsonSerializable(typeof(SessionFsSqliteQueryRequest))] [JsonSerializable(typeof(SessionFsSqliteQueryResult))] +[JsonSerializable(typeof(SessionFsSqliteTransactionError))] +[JsonSerializable(typeof(SessionFsSqliteTransactionRequest))] +[JsonSerializable(typeof(SessionFsSqliteTransactionResult))] +[JsonSerializable(typeof(SessionFsSqliteTransactionStatement))] [JsonSerializable(typeof(SessionFsStatRequest))] [JsonSerializable(typeof(SessionFsStatResult))] [JsonSerializable(typeof(SessionFsWriteFileRequest))] [JsonSerializable(typeof(SessionGitHubAuthGetStatusRequest))] [JsonSerializable(typeof(SessionHistoryAbortManualCompactionRequest))] [JsonSerializable(typeof(SessionHistoryCancelBackgroundCompactionRequest))] +[JsonSerializable(typeof(SessionHistoryListRewindPointsRequest))] [JsonSerializable(typeof(SessionHistorySummarizeForHandoffRequest))] [JsonSerializable(typeof(SessionInstalledPlugin))] [JsonSerializable(typeof(SessionInstructionsGetSourcesRequest))] @@ -25343,9 +28119,15 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionPluginsListRequest))] [JsonSerializable(typeof(SessionPruneResult))] [JsonSerializable(typeof(SessionQueueClearRequest))] +[JsonSerializable(typeof(SessionQueueEnqueueResumePendingRequest))] +[JsonSerializable(typeof(SessionQueueHasPendingRequest))] [JsonSerializable(typeof(SessionQueuePendingItemsRequest))] +[JsonSerializable(typeof(SessionQueueProcessRequest))] [JsonSerializable(typeof(SessionQueueRemoveMostRecentRequest))] +[JsonSerializable(typeof(SessionQueueSnapshotRequest))] [JsonSerializable(typeof(SessionRemoteDisableRequest))] +[JsonSerializable(typeof(SessionScheduleHasSelfPacedRequest))] +[JsonSerializable(typeof(SessionScheduleHydrateRequest))] [JsonSerializable(typeof(SessionScheduleListRequest))] [JsonSerializable(typeof(SessionSetCredentialsParams))] [JsonSerializable(typeof(SessionSetCredentialsResult))] @@ -25380,14 +28162,18 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionUsageGetMetricsRequest))] [JsonSerializable(typeof(SessionVisibilityGetRequest))] [JsonSerializable(typeof(SessionWorkingDirectoryContext))] +[JsonSerializable(typeof(SessionWorkspacesAutopilotObjectiveExistsRequest))] +[JsonSerializable(typeof(SessionWorkspacesDeleteAutopilotObjectiveRequest))] [JsonSerializable(typeof(SessionWorkspacesGetWorkspaceRequest))] [JsonSerializable(typeof(SessionWorkspacesListCheckpointsRequest))] [JsonSerializable(typeof(SessionWorkspacesListFilesRequest))] +[JsonSerializable(typeof(SessionWorkspacesReadAutopilotObjectiveRequest))] [JsonSerializable(typeof(SessionsBulkDeleteRequest))] [JsonSerializable(typeof(SessionsCheckInUseRequest))] [JsonSerializable(typeof(SessionsCheckInUseResult))] [JsonSerializable(typeof(SessionsCloseRequest))] [JsonSerializable(typeof(SessionsCloseResult))] +[JsonSerializable(typeof(SessionsDeleteRequest))] [JsonSerializable(typeof(SessionsEnrichMetadataRequest))] [JsonSerializable(typeof(SessionsFindByPrefixRequest))] [JsonSerializable(typeof(SessionsFindByPrefixResult))] @@ -25401,8 +28187,12 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SessionsGetEventFilePathResult))] [JsonSerializable(typeof(SessionsGetLastForContextRequest))] [JsonSerializable(typeof(SessionsGetLastForContextResult))] +[JsonSerializable(typeof(SessionsGetMetadataRequest))] +[JsonSerializable(typeof(SessionsGetMetadataResult))] [JsonSerializable(typeof(SessionsGetPersistedRemoteSteerableRequest))] [JsonSerializable(typeof(SessionsGetPersistedRemoteSteerableResult))] +[JsonSerializable(typeof(SessionsListNonEmptySessionIdsRequest))] +[JsonSerializable(typeof(SessionsListNonEmptySessionIdsResult))] [JsonSerializable(typeof(SessionsListRequest))] [JsonSerializable(typeof(SessionsLoadDeferredRepoHooksRequest))] [JsonSerializable(typeof(SessionsOpenProgress))] @@ -25424,8 +28214,10 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(ShellExecRequest))] [JsonSerializable(typeof(ShellExecResult))] [JsonSerializable(typeof(ShellExecuteUserRequestedRequest))] +[JsonSerializable(typeof(ShellInitScript))] [JsonSerializable(typeof(ShellKillRequest))] [JsonSerializable(typeof(ShellKillResult))] +[JsonSerializable(typeof(ShellOptions))] [JsonSerializable(typeof(ShutdownRequest))] [JsonSerializable(typeof(Skill))] [JsonSerializable(typeof(SkillDiscoveryPath))] @@ -25511,13 +28303,21 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(VisibilitySetResult))] [JsonSerializable(typeof(WorkspaceDiffFileChange))] [JsonSerializable(typeof(WorkspaceDiffResult))] +[JsonSerializable(typeof(WorkspacesAddSummaryRequest))] +[JsonSerializable(typeof(WorkspacesAddSummaryResult))] +[JsonSerializable(typeof(WorkspacesAddSummaryResultSummary))] +[JsonSerializable(typeof(WorkspacesAddSummaryResultWorkspace))] +[JsonSerializable(typeof(WorkspacesAutopilotObjectiveExistsResult))] [JsonSerializable(typeof(WorkspacesCheckpoints))] [JsonSerializable(typeof(WorkspacesCreateFileRequest))] +[JsonSerializable(typeof(WorkspacesDeleteAutopilotObjectiveResult))] [JsonSerializable(typeof(WorkspacesDiffRequest))] +[JsonSerializable(typeof(WorkspacesEnsureRequest))] [JsonSerializable(typeof(WorkspacesGetWorkspaceResult))] [JsonSerializable(typeof(WorkspacesGetWorkspaceResultWorkspace))] [JsonSerializable(typeof(WorkspacesListCheckpointsResult))] [JsonSerializable(typeof(WorkspacesListFilesResult))] +[JsonSerializable(typeof(WorkspacesReadAutopilotObjectiveResult))] [JsonSerializable(typeof(WorkspacesReadCheckpointRequest))] [JsonSerializable(typeof(WorkspacesReadCheckpointResult))] [JsonSerializable(typeof(WorkspacesReadFileRequest))] @@ -25525,4 +28325,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(WorkspacesSaveLargePasteRequest))] [JsonSerializable(typeof(WorkspacesSaveLargePasteResult))] [JsonSerializable(typeof(WorkspacesSaveLargePasteResultSaved))] +[JsonSerializable(typeof(WorkspacesTruncateSummariesRequest))] +[JsonSerializable(typeof(WorkspacesUpdateMetadataRequest))] +[JsonSerializable(typeof(WorkspacesWriteAutopilotObjectiveRequest))] +[JsonSerializable(typeof(WorkspacesWriteAutopilotObjectiveResult))] internal partial class RpcJsonContext : JsonSerializerContext; \ No newline at end of file diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index a8c70df7cc..5e7e2158d0 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -52,6 +52,7 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(ExitPlanModeRequestedEvent), "exit_plan_mode.requested")] [JsonDerivedType(typeof(ExternalToolCompletedEvent), "external_tool.completed")] [JsonDerivedType(typeof(ExternalToolRequestedEvent), "external_tool.requested")] +[JsonDerivedType(typeof(FactoryRunUpdatedEvent), "factory.run_updated")] [JsonDerivedType(typeof(HookEndEvent), "hook.end")] [JsonDerivedType(typeof(HookProgressEvent), "hook.progress")] [JsonDerivedType(typeof(HookStartEvent), "hook.start")] @@ -1444,6 +1445,20 @@ public sealed partial class SessionBackgroundTasksChangedEvent : SessionEvent public required SessionBackgroundTasksChangedData Data { get; set; } } +/// Ephemeral invalidation signal for a changed factory run. +/// Represents the factory.run_updated event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class FactoryRunUpdatedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "factory.run_updated"; + + /// The factory.run_updated event payload. + [JsonPropertyName("data")] + public required FactoryRunUpdatedData Data { get; set; } +} + /// Payload of `session.skills_loaded` listing resolved skill metadata. /// Represents the session.skills_loaded event. public sealed partial class SessionSkillsLoadedEvent : SessionEvent @@ -1750,7 +1765,7 @@ public sealed partial class SessionResumeData [JsonPropertyName("contextTier")] public ContextTier? ContextTier { get; set; } - /// When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume. + /// When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false or omitted, pending work is normally marked as interrupted unless the resume passively joined live work owned by another client; sessionWasActive distinguishes that case. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("continuePendingWork")] public bool? ContinuePendingWork { get; set; } @@ -1793,7 +1808,7 @@ public sealed partial class SessionResumeData [JsonPropertyName("sessionLimits")] public SessionLimitsConfig? SessionLimits { get; set; } - /// True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. + /// True when this resume passively joined a session that already had live work running in the runtime - an agent turn, a native queue run, a queued resume continuation, or an in-flight send (for example, an extension joining a session another client was actively driving). False (or omitted) when the session had no live work or when the resume explicitly abandoned pending work, including cold resumes and suspended sessions that remain resident in memory. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("sessionWasActive")] public bool? SessionWasActive { get; set; } @@ -1904,6 +1919,11 @@ public sealed partial class SessionScheduleCreatedData [JsonPropertyName("intervalMs")] public TimeSpan? Interval { get; set; } + /// Who created the schedule (`user` or `model`). Persisted so a resumed session keeps gating non-user schedules from firing skills that opted out of model invocation. Absent on entries created before this field existed; a missing origin fails closed (treated the same as a non-user origin), so such a schedule may not resolve a `disable-model-invocation` skill. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("origin")] + public ScheduleOrigin? Origin { get; set; } + /// Prompt text that gets enqueued on every tick. [JsonPropertyName("prompt")] public required string Prompt { get; set; } @@ -2557,7 +2577,7 @@ public sealed partial class UserMessageData [JsonPropertyName("parentAgentTaskId")] public string? ParentAgentTaskId { get; set; } - /// Origin of this message, used for timeline filtering (e.g., "skill-pdf" for skill-injected messages that should be hidden from the user). + /// Origin of this message, used for timeline filtering and attribution (e.g., `skill-pdf` for hidden skill injection or `agent-<agent-id>` for an inter-agent prompt). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("source")] public string? Source { get; set; } @@ -2648,6 +2668,11 @@ public sealed partial class AssistantReasoningData /// Unique identifier for this reasoning block. [JsonPropertyName("reasoningId")] public required string ReasoningId { get; set; } + + /// Gets or sets the rte value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("rte")] + public bool? Rte { get; set; } } /// Streaming reasoning delta for incremental extended thinking updates. @@ -2773,6 +2798,11 @@ public sealed partial class AssistantMessageData [JsonPropertyName("requestId")] public string? RequestId { get; set; } + /// Gets or sets the rte value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("rte")] + public bool? Rte { get; set; } + /// Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("serverTools")] @@ -2915,6 +2945,11 @@ public sealed partial class AssistantUsageData [JsonPropertyName("inputTokens")] public long? InputTokens { get; set; } + /// Coarse classification of the interaction that produced this call, mirroring the session's per-request agent context (e.g. `conversation-agent`, `conversation-subagent`, `conversation-sampling`, `conversation-background`, `conversation-compaction`, `conversation-user`). Non-billing; lets consumers attribute a model call to a call class (e.g. sub-agent/sidekick) independently of the billing initiator. Absent when the runtime did not classify the request. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("interactionType")] + public string? InteractionType { get; set; } + /// Average inter-token latency in milliseconds. Only available for streaming requests. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -2960,6 +2995,11 @@ public sealed partial class AssistantUsageData [JsonPropertyName("reasoningTokens")] public long? ReasoningTokens { get; set; } + /// Gets or sets the rte value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("rte")] + public bool? Rte { get; set; } + /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("serviceRequestId")] @@ -3067,6 +3107,11 @@ public sealed partial class ModelCallFailureData [JsonPropertyName("requestFingerprint")] public ModelCallFailureRequestFingerprint? RequestFingerprint { get; set; } + /// Gets or sets the rte value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("rte")] + public bool? Rte { get; set; } + /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("serviceRequestId")] @@ -3095,6 +3140,12 @@ public sealed partial class ModelCallStartData [JsonPropertyName("model")] public string? Model { get; set; } + /// Previous response or interaction identifier included in the model request, when present. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("previousResponseId")] + internal string? PreviousResponseId { get; set; } + /// Identifier of the assistant turn that initiated the model call. [JsonPropertyName("turnId")] public required string TurnId { get; set; } @@ -3162,6 +3213,11 @@ public sealed partial class ToolExecutionStartData [JsonPropertyName("parentToolCallId")] public string? ParentToolCallId { get; set; } + /// Gets or sets the rte value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("rte")] + public bool? Rte { get; set; } + /// Shell-tool path hints derived from the command at start time for shell tools (bash/powershell/local_shell). Produced by the same shell-aware extractor as PermissionRequestShell.possiblePaths, so it is present even when the command is auto-approved and no permission request fires. Absent for non-shell tools. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("shellToolInfo")] @@ -3253,6 +3309,11 @@ public sealed partial class ToolExecutionCompleteData [JsonPropertyName("result")] public ToolExecutionCompleteResult? Result { get; set; } + /// Gets or sets the rte value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("rte")] + public bool? Rte { get; set; } + /// Whether this tool execution ran inside a sandbox container. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("sandboxed")] @@ -3567,6 +3628,11 @@ public sealed partial class SystemMessageData [JsonPropertyName("content")] public required string Content { get; set; } + /// Logical interaction identifier for the model run receiving this prompt. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("interactionId")] + public string? InteractionId { get; set; } + /// Metadata about the prompt template and its construction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("metadata")] @@ -4193,6 +4259,19 @@ public sealed partial class SessionBackgroundTasksChangedData { } +/// Ephemeral invalidation signal for a changed factory run. +[Experimental(Diagnostics.Experimental)] +public sealed partial class FactoryRunUpdatedData +{ + /// Monotonic revision now available for the run. + [JsonPropertyName("revision")] + public required long Revision { get; set; } + + /// Gets or sets the runId value. + [JsonPropertyName("runId")] + public required string RunId { get; set; } +} + /// Payload of `session.skills_loaded` listing resolved skill metadata. public sealed partial class SessionSkillsLoadedData { @@ -7083,6 +7162,16 @@ public partial class PermissionRequest [Experimental(Diagnostics.Experimental)] public sealed partial class PermissionAutoApproval { + /// Classified cause of an `error` recommendation. Absent for every other recommendation. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("failureReason")] + public AutoApprovalJudgeFailureReason? FailureReason { get; set; } + + /// Model id that produced the recommendation, when the judge was consulted and reported one. Absent for `excluded` (the judge was not consulted) and for failures that occurred before a model was selected. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("model")] + public string? Model { get; set; } + /// Human-readable reason for the judge's recommendation, when available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reason")] @@ -8412,6 +8501,67 @@ public override void Write(Utf8JsonWriter writer, Verbosity value, JsonSerialize } } +/// Who created the schedule: `user` (an explicit user action such as `/every` or `/after`) or `model` (the agent via the `manage_schedule` tool). Gates whether a scheduled skill that opted out of model invocation may fire: only user-created schedules may. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ScheduleOrigin : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ScheduleOrigin(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The schedule was created by an explicit user action, such as `/every` or `/after`. + public static ScheduleOrigin User { get; } = new("user"); + + /// The schedule was created by the agent via the `manage_schedule` tool. + public static ScheduleOrigin Model { get; } = new("model"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ScheduleOrigin left, ScheduleOrigin right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ScheduleOrigin left, ScheduleOrigin right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is ScheduleOrigin other && Equals(other); + + /// + public bool Equals(ScheduleOrigin other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override ScheduleOrigin Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, ScheduleOrigin value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ScheduleOrigin)); + } + } +} + /// The type of operation performed on the autopilot objective state file. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -10414,6 +10564,77 @@ public override void Write(Utf8JsonWriter writer, PermissionRequestMemoryDirecti } } +/// Why the auto-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct AutoApprovalJudgeFailureReason : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public AutoApprovalJudgeFailureReason(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The judge model call exceeded its deadline. + public static AutoApprovalJudgeFailureReason Timeout { get; } = new("timeout"); + + /// The judge model call was cancelled before it returned. + public static AutoApprovalJudgeFailureReason Abort { get; } = new("abort"); + + /// The judge model call completed but returned no content. + public static AutoApprovalJudgeFailureReason EmptyResponse { get; } = new("empty_response"); + + /// The judge model call failed (for example a transport, authentication, or rate-limit error). + public static AutoApprovalJudgeFailureReason ModelError { get; } = new("model_error"); + + /// The judge model replied, but the reply carried no ALLOW/DENY verdict. + public static AutoApprovalJudgeFailureReason ParseError { get; } = new("parse_error"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(AutoApprovalJudgeFailureReason left, AutoApprovalJudgeFailureReason right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(AutoApprovalJudgeFailureReason left, AutoApprovalJudgeFailureReason right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is AutoApprovalJudgeFailureReason other && Equals(other); + + /// + public bool Equals(AutoApprovalJudgeFailureReason other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override AutoApprovalJudgeFailureReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, AutoApprovalJudgeFailureReason value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AutoApprovalJudgeFailureReason)); + } + } +} + /// Outcome of the auto-approval safety judge for a permission request. Present only when auto mode is enabled; its absence means the judge did not evaluate the request (auto mode was off). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -11908,6 +12129,8 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(ExternalToolCompletedEvent))] [JsonSerializable(typeof(ExternalToolRequestedData))] [JsonSerializable(typeof(ExternalToolRequestedEvent))] +[JsonSerializable(typeof(FactoryRunUpdatedData))] +[JsonSerializable(typeof(FactoryRunUpdatedEvent))] [JsonSerializable(typeof(GitHubRepoRef))] [JsonSerializable(typeof(HandoffRepository))] [JsonSerializable(typeof(HeaderEntry))] diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 634efbca23..85d26fcbad 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -999,6 +999,25 @@ func (UserAuthInfo) Type() AuthInfoType { return AuthInfoTypeUser } +// The running runtime's complete catalog of well-known built-in model IDs, including +// supported models and additional IDs with built-in metadata. +// Experimental: BuiltInModelCatalog is part of an experimental API and may change or be +// removed. +type BuiltInModelCatalog struct { + // Built-in model entries. + Models []BuiltInModelCatalogEntry `json:"models"` +} + +// A well-known model in the runtime's built-in catalog. +// Experimental: BuiltInModelCatalogEntry is part of an experimental API and may change or +// be removed. +type BuiltInModelCatalogEntry struct { + // Well-known runtime model ID suitable for `ProviderConfig.modelId` or + // `ProviderModelConfig.modelId`. This is not necessarily the provider-facing deployment or + // model name and does not indicate CAPI entitlement or provider availability. + ID string `json:"id"` +} + // Cancellation result for a user-requested shell command. // Experimental: CancelUserRequestedShellCommandResult is part of an experimental API and // may change or be removed. @@ -1363,11 +1382,14 @@ type ConnectRemoteSessionParams struct { type ConnectRequest struct { // Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the // runtime forwards every internal telemetry event it emits — across all sessions, plus - // sessionless events — to this connection over the `gitHubTelemetry.event` notification, in - // addition to the runtime's normal GitHub/CTS emission (dual-write). Intended for - // first-party hosts that re-emit the events into their own telemetry stores. Both - // unrestricted and restricted events are forwarded, each tagged with a `restricted` - // discriminator; a backstop drops restricted events when restricted telemetry is disabled. + // sessionless events — to this connection over the `gitHubTelemetry.event` notification. + // Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); + // host-only compatibility events are forward-only and intentionally skip that path. + // Intended for first-party hosts that re-emit the events into their own telemetry stores. + // Both unrestricted and restricted events are forwarded, each tagged with a `restricted` + // discriminator; a backstop drops restricted events when restricted telemetry is disabled — + // using the process-global gate for ordinary events and an explicit session-scoped decision + // for host-only events. EnableGitHubTelemetryForwarding *bool `json:"enableGitHubTelemetryForwarding,omitempty"` // Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN Token *string `json:"token,omitempty"` @@ -1385,6 +1407,38 @@ type ConnectResult struct { Version string `json:"version"` } +// Local file system absolute paths within the session working directory to check against +// its content-exclusion policy. +// Experimental: ContentExclusionCheckPathsRequest is part of an experimental API and may +// change or be removed. +type ContentExclusionCheckPathsRequest struct { + // Local file system absolute paths within the session working directory to check. Results + // are returned in the same order, including duplicates. + Paths []string `json:"paths"` +} + +// Batch content-exclusion result. Callers must fail closed when policy evaluation is +// unavailable. +// Experimental: ContentExclusionCheckPathsResult is part of an experimental API and may +// change or be removed. +type ContentExclusionCheckPathsResult struct { + // Whether the session's policy service was available for the complete batch. When false, + // checks is empty and callers must treat every requested path as excluded. + Available bool `json:"available"` + // Per-path decisions in request order. Empty when available is false. + Checks []ContentExclusionPathCheck `json:"checks"` +} + +// Content-exclusion decision for one requested path. +// Experimental: ContentExclusionPathCheck is part of an experimental API and may change or +// be removed. +type ContentExclusionPathCheck struct { + // Whether the session's complete content-exclusion policy excludes the path. + Excluded bool `json:"excluded"` + // The path supplied by the caller. + Path string `json:"path"` +} + // A single large message currently in context. // Experimental: ContextHeaviestMessage is part of an experimental API and may change or be // removed. @@ -2246,6 +2300,8 @@ type FactoryAgentOptions struct { // Experimental: FactoryAgentRequest is part of an experimental API and may change or be // removed. type FactoryAgentRequest struct { + // Opaque token identifying the current factory execution attempt. + ExecutionToken string `json:"executionToken"` // Factory run identifier that owns the subagent. FactoryRunID string `json:"factoryRunId"` // Subagent execution options. @@ -2262,6 +2318,25 @@ type FactoryAgentResult struct { Result any `json:"result,omitempty"` } +// Prompt-safe durable identity and live status for a direct factory agent. +// Experimental: FactoryAgentSummary is part of an experimental API and may change or be +// removed. +type FactoryAgentSummary struct { + ActiveMs int64 `json:"activeMs"` + Activity *string `json:"activity,omitempty"` + AgentID string `json:"agentId"` + AgentType string `json:"agentType"` + CompletedAt *int64 `json:"completedAt,omitempty"` + Label string `json:"label"` + PhaseID *string `json:"phaseId"` + RequestedModel *string `json:"requestedModel,omitempty"` + ResolvedModel *string `json:"resolvedModel,omitempty"` + RunID string `json:"runId"` + StartedAt *int64 `json:"startedAt,omitempty"` + Status string `json:"status"` + ToolCallID string `json:"toolCallId"` +} + // Parameters for cancelling a factory run. // Experimental: FactoryCancelRequest is part of an experimental API and may change or be // removed. @@ -2270,12 +2345,32 @@ type FactoryCancelRequest struct { RunID string `json:"runId"` } +// Current factory phase identity. +// Experimental: FactoryCurrentPhase is part of an experimental API and may change or be +// removed. +type FactoryCurrentPhase struct { + ID string `json:"id"` + Ordinal *int64 `json:"ordinal"` +} + +// Declared or approved factory resource ceilings. +// Experimental: FactoryDeclaredLimits is part of an experimental API and may change or be +// removed. +type FactoryDeclaredLimits struct { + MaxAiCredits *float64 `json:"maxAiCredits,omitempty"` + MaxConcurrentSubagents *int64 `json:"maxConcurrentSubagents,omitempty"` + MaxTotalSubagents *int64 `json:"maxTotalSubagents,omitempty"` + TimeoutSeconds *float64 `json:"timeoutSeconds,omitempty"` +} + // Parameters sent to the owning extension to execute a factory closure. // Experimental: FactoryExecuteRequest is part of an experimental API and may change or be // removed. type FactoryExecuteRequest struct { // Factory input value. Args any `json:"args"` + // Opaque token identifying this factory execution attempt. + ExecutionToken string `json:"executionToken"` // Registered factory name. Name string `json:"name"` // Factory run identifier. @@ -2289,7 +2384,23 @@ type FactoryExecuteRequest struct { // removed. type FactoryExecuteResult struct { // Factory result value. - Result any `json:"result"` + Result any `json:"result,omitempty"` +} + +// Parameters for paging factory progress. +// Experimental: FactoryGetRunProgressRequest is part of an experimental API and may change +// or be removed. +type FactoryGetRunProgressRequest struct { + // Exclusive forward cursor. + AfterSeq *int64 `json:"afterSeq,omitempty"` + // Exclusive backward cursor. + BeforeSeq *int64 `json:"beforeSeq,omitempty"` + // Maximum records to return. Defaults to 200 and is capped at 500. + Limit *int32 `json:"limit,omitempty"` + // Optional phase identifier used to scope records and cursors. + PhaseID *string `json:"phaseId,omitempty"` + // Factory run identifier. + RunID string `json:"runId"` } // Parameters for retrieving a factory run. @@ -2304,6 +2415,8 @@ type FactoryGetRunRequest struct { // Experimental: FactoryJournalGetRequest is part of an experimental API and may change or // be removed. type FactoryJournalGetRequest struct { + // Opaque token identifying the current factory execution attempt. + ExecutionToken string `json:"executionToken"` // Namespaced journal key. Key string `json:"key"` // Factory run identifier. @@ -2324,6 +2437,8 @@ type FactoryJournalGetResult struct { // Experimental: FactoryJournalPutRequest is part of an experimental API and may change or // be removed. type FactoryJournalPutRequest struct { + // Opaque token identifying the current factory execution attempt. + ExecutionToken string `json:"executionToken"` // Namespaced journal key. Key string `json:"key"` // JSON result to memoize. @@ -2332,6 +2447,19 @@ type FactoryJournalPutRequest struct { RunID string `json:"runId"` } +// Empty parameters for listing factory runs. +// Experimental: FactoryListRunsRequest is part of an experimental API and may change or be +// removed. +type FactoryListRunsRequest struct { +} + +// Factory runs in durable creation order. +// Experimental: FactoryListRunsResult is part of an experimental API and may change or be +// removed. +type FactoryListRunsResult struct { + Runs []FactoryRunSummary `json:"runs"` +} + // One ordered factory progress line. // Experimental: FactoryLogLine is part of an experimental API and may change or be removed. type FactoryLogLine struct { @@ -2347,12 +2475,121 @@ type FactoryLogLine struct { // Experimental: FactoryLogRequest is part of an experimental API and may change or be // removed. type FactoryLogRequest struct { + // Opaque token identifying the current factory execution attempt. + ExecutionToken string `json:"executionToken"` // Ordered progress lines to append. Lines []FactoryLogLine `json:"lines"` // Factory run identifier. RunID string `json:"runId"` } +// Durable lifecycle and timing for one factory phase. +// Experimental: FactoryPhaseObservation is part of an experimental API and may change or be +// removed. +type FactoryPhaseObservation struct { + AccumulatedActiveMs int64 `json:"accumulatedActiveMs"` + CompletedAt *int64 `json:"completedAt,omitempty"` + CurrentActiveMs int64 `json:"currentActiveMs"` + Detail *string `json:"detail,omitempty"` + EntryCount int64 `json:"entryCount"` + ID string `json:"id"` + LastEnteredRunAttempt int64 `json:"lastEnteredRunAttempt"` + LiveAgentCount int64 `json:"liveAgentCount"` + Ordinal *int64 `json:"ordinal"` + StartedAt *int64 `json:"startedAt,omitempty"` + Status FactoryPhaseStatus `json:"status"` + Title string `json:"title"` + TotalAgentCount int64 `json:"totalAgentCount"` +} + +// One durable factory progress record. +// Experimental: FactoryProgressLine is part of an experimental API and may change or be +// removed. +type FactoryProgressLine struct { + // Resume attempt that emitted this record. + Attempt int64 `json:"attempt"` + // Progress record kind. + Kind FactoryLogLineKind `json:"kind"` + // Phase active when the record was emitted, or null before any phase. + PhaseID *string `json:"phaseId"` + // Epoch milliseconds when the record was persisted. + RecordedAt int64 `json:"recordedAt"` + // Global monotonic sequence number within the run. + Seq int64 `json:"seq"` + // Prompt-safe progress text. + Text string `json:"text"` +} + +// A bidirectional page of factory progress. +// Experimental: FactoryProgressPage is part of an experimental API and may change or be +// removed. +type FactoryProgressPage struct { + HasMoreNewer bool `json:"hasMoreNewer"` + HasMoreOlder bool `json:"hasMoreOlder"` + NewestSeq *int64 `json:"newestSeq"` + OldestSeq *int64 `json:"oldestSeq"` + Records []FactoryProgressLine `json:"records"` + // Run revision reflected by this page. + Revision int64 `json:"revision"` +} + +// Parameters for resuming a factory run from its persisted identity. +// Experimental: FactoryResumeRequest is part of an experimental API and may change or be +// removed. +type FactoryResumeRequest struct { + // Optional per-invocation resource ceiling overrides. + Limits *FactoryRunLimits `json:"limits,omitempty"` + // Factory run identifier. + RunID string `json:"runId"` +} + +// Resolved persisted factory identity and resumed run envelope. +// Experimental: FactoryResumeResult is part of an experimental API and may change or be +// removed. +type FactoryResumeResult struct { + // Persisted factory name resolved for the resumed run. + FactoryName string `json:"factoryName"` + // Terminal resumed run envelope. + Run FactoryRunResult `json:"run"` +} + +// Durable factory resource consumption. +// Experimental: FactoryRunConsumed is part of an experimental API and may change or be +// removed. +type FactoryRunConsumed struct { + ActiveMs int64 `json:"activeMs"` + NanoAiu int64 `json:"nanoAiu"` + Subagents int64 `json:"subagents"` +} + +// Full factory run observability detail. +// Experimental: FactoryRunDetail is part of an experimental API and may change or be +// removed. +type FactoryRunDetail struct { + ActiveSegmentStartedAt *int64 `json:"activeSegmentStartedAt"` + Agents []FactoryAgentSummary `json:"agents"` + Approved *FactoryDeclaredLimits `json:"approved"` + CompletedAt *int64 `json:"completedAt"` + Consumed FactoryRunConsumed `json:"consumed"` + CreatedAt int64 `json:"createdAt"` + CurrentPhase *FactoryCurrentPhase `json:"currentPhase"` + DeclaredLimits FactoryDeclaredLimits `json:"declaredLimits"` + DeclaredPhaseCount int64 `json:"declaredPhaseCount"` + Description string `json:"description"` + FactoryName string `json:"factoryName"` + LiveAgentCount int64 `json:"liveAgentCount"` + ObservedAt int64 `json:"observedAt"` + Phases []FactoryPhaseObservation `json:"phases"` + Progress FactoryProgressPage `json:"progress"` + Revision int64 `json:"revision"` + RunID string `json:"runId"` + StartedAt *int64 `json:"startedAt"` + Status FactoryRunStatus `json:"status"` + Terminal *FactoryRunTerminal `json:"terminal"` + TotalSpawnedAgentCount int64 `json:"totalSpawnedAgentCount"` + UpdatedAt int64 `json:"updatedAt"` +} + // Machine-readable factory run failure. // Experimental: FactoryRunFailure is part of an experimental API and may change or be // removed. @@ -2371,6 +2608,20 @@ func (r RawFactoryRunFailureData) Type() FactoryRunFailureType { return r.Discriminator } +type FactoryRunFailureFactoryDurableFailure struct { + // Stable failure code. + Code string `json:"code"` + // Execution-critical durable operation that failed. + Operation FactoryDurableOperation `json:"operation"` + // Factory run identifier. + RunID string `json:"runId"` +} + +func (FactoryRunFailureFactoryDurableFailure) factoryRunFailure() {} +func (FactoryRunFailureFactoryDurableFailure) Type() FactoryRunFailureType { + return FactoryRunFailureTypeFactoryDurableFailure +} + type FactoryRunFailureFactoryLimitReached struct { // Resource ceiling that stopped the run. Kind FactoryRunFailureKind `json:"kind"` @@ -2401,12 +2652,17 @@ func (FactoryRunFailureFactoryResumeDeclined) Type() FactoryRunFailureType { // Experimental: FactoryRunLimits is part of an experimental API and may change or be // removed. type FactoryRunLimits struct { + // Maximum AI credits consumed by factory subagents and their descendants. The post-paid + // ceiling is soft: parallel turns can settle beyond it before the run stops. + MaxAiCredits *float64 `json:"maxAiCredits,omitempty"` // Maximum number of factory subagents that may run concurrently. MaxConcurrentSubagents *int64 `json:"maxConcurrentSubagents,omitempty"` // Maximum total number of factory subagents that may be admitted. MaxTotalSubagents *int64 `json:"maxTotalSubagents,omitempty"` - // Factory active-run timeout in milliseconds. - Timeout *float64 `json:"timeout,omitempty"` + // Maximum accumulated active-execution time in seconds. Active execution includes the + // entire extension body, subprocess waits, queued-agent waits, and sleeps; time between + // resumed attempts is not counted. + TimeoutSeconds *float64 `json:"timeoutSeconds,omitempty"` } // Parameters for invoking a registered factory. @@ -2441,6 +2697,41 @@ type FactoryRunResult struct { Status FactoryRunStatus `json:"status"` } +// Durable factory run summary with read-time live overlays. +// Experimental: FactoryRunSummary is part of an experimental API and may change or be +// removed. +type FactoryRunSummary struct { + ActiveSegmentStartedAt *int64 `json:"activeSegmentStartedAt"` + Approved *FactoryDeclaredLimits `json:"approved"` + CompletedAt *int64 `json:"completedAt"` + Consumed FactoryRunConsumed `json:"consumed"` + CreatedAt int64 `json:"createdAt"` + CurrentPhase *FactoryCurrentPhase `json:"currentPhase"` + DeclaredLimits FactoryDeclaredLimits `json:"declaredLimits"` + DeclaredPhaseCount int64 `json:"declaredPhaseCount"` + Description string `json:"description"` + FactoryName string `json:"factoryName"` + LiveAgentCount int64 `json:"liveAgentCount"` + ObservedAt int64 `json:"observedAt"` + Revision int64 `json:"revision"` + RunID string `json:"runId"` + StartedAt *int64 `json:"startedAt"` + Status FactoryRunStatus `json:"status"` + Terminal *FactoryRunTerminal `json:"terminal"` + TotalSpawnedAgentCount int64 `json:"totalSpawnedAgentCount"` + UpdatedAt int64 `json:"updatedAt"` +} + +// Prompt-safe terminal factory outcome. +// Experimental: FactoryRunTerminal is part of an experimental API and may change or be +// removed. +type FactoryRunTerminal struct { + Error *string `json:"error,omitempty"` + Failure FactoryRunFailure `json:"failure,omitempty"` + Reason *string `json:"reason,omitempty"` + ResultPreview *string `json:"resultPreview,omitempty"` +} + // Content filtering mode to apply to all tools, or a map of tool name to content filtering // mode. // Experimental: FilterMapping is part of an experimental API and may change or be removed. @@ -2665,6 +2956,141 @@ type HistoryCompactResult struct { TokensRemoved int64 `json:"tokensRemoved"` } +// Rewind points and file-change-tracking availability for the session. +// Experimental: HistoryListRewindPointsResult is part of an experimental API and may change +// or be removed. +type HistoryListRewindPointsResult struct { + // Whether this session captured file changes from its first turn. + FileChangeTrackingEnabled bool `json:"fileChangeTrackingEnabled"` + // Root user turns in chronological order. Empty when `unavailableReason` is set. + Points []HistoryRewindPoint `json:"points"` + // Why the listed points could not be produced, when applicable; the points list is empty + // whenever it is set. `unsupported-remote-session` is permanent for the session and comes + // with `fileChangeTrackingEnabled: false`. `session-busy` is transient and only ever + // reported by a session that *is* tracking (`fileChangeTrackingEnabled: true`), because the + // file-change captures cannot be read while work that may still mutate them is in flight; + // the same request succeeds once the session settles, so a client that wants points should + // retry rather than treat it as a failure. It is never `file-change-tracking-disabled`: an + // untracked local session still lists conversation-only points and reports that through + // `fileChangeTrackingEnabled: false`. + UnavailableReason *HistoryRewindUnavailableReason `json:"unavailableReason,omitempty"` +} + +// Event boundary to preview for conversation-and-files rewind. +// Experimental: HistoryPreviewRewindRequest is part of an experimental API and may change +// or be removed. +type HistoryPreviewRewindRequest struct { + // ID of the user.message event that begins the discarded suffix. + EventID string `json:"eventId"` +} + +// Files and aggregate changes for a prospective rewind. +// Experimental: HistoryPreviewRewindResult is part of an experimental API and may change or +// be removed. +type HistoryPreviewRewindResult struct { + // Whether file restore is available for this session. This is authoritative: switch on it + // and read `reason` only when it is false. + Available bool `json:"available"` + // Number of unique files in the preview. + FileCount int64 `json:"fileCount"` + // Files ordered by path. + Files []HistoryRewindFilePreview `json:"files"` + // Why file restore is unavailable, when applicable. Populated only when `available` is + // false and never set when `available` is true. + Reason *HistoryRewindUnavailableReason `json:"reason,omitempty"` +} + +// A file that a conversation-and-files rewind would restore. +// Experimental: HistoryRewindFilePreview is part of an experimental API and may change or +// be removed. +type HistoryRewindFilePreview struct { + // Aggregate change made across the discarded turns. + ChangeType HistoryRewindChangeType `json:"changeType"` + // Lines added across the discarded turns. + LinesAdded int64 `json:"linesAdded"` + // Lines removed across the discarded turns. + LinesRemoved int64 `json:"linesRemoved"` + // Absolute path of the captured file. + Path string `json:"path"` +} + +// A root user turn that the session can rewind to. +// Experimental: HistoryRewindPoint is part of an experimental API and may change or be +// removed. +type HistoryRewindPoint struct { + // Whether at least one file in this turn or a later turn can be restored. + CanRestoreFiles bool `json:"canRestoreFiles"` + // ID of the user.message event that begins the discarded suffix. + EventID string `json:"eventId"` + // Number of unique files in this turn and all later turns that have captured changes. + FileCount int64 `json:"fileCount"` + // Whether this turn was an automatically injected autopilot continuation. + IsAutopilotContinuation bool `json:"isAutopilotContinuation"` + // Lines added by this turn's captured file changes. + LinesAdded int64 `json:"linesAdded"` + // Lines removed by this turn's captured file changes. + LinesRemoved int64 `json:"linesRemoved"` + // ISO timestamp of the user turn. + Timestamp string `json:"timestamp"` + // Whether this turn itself captured any file changes. + TurnChangedFiles bool `json:"turnChangedFiles"` + // User-visible message text for the turn. + UserMessage string `json:"userMessage"` +} + +// Boundary and mode for rewinding session history. +// Experimental: HistoryRewindRequest is part of an experimental API and may change or be +// removed. +type HistoryRewindRequest struct { + // ID of the user.message event that begins the discarded suffix. + EventID string `json:"eventId"` + // Whether to rewind only conversation history or also restore captured files. + Mode HistoryRewindMode `json:"mode"` +} + +// Structured outcome of a rewind request. +// Experimental: HistoryRewindResult is part of an experimental API and may change or be +// removed. +type HistoryRewindResult struct { + // Failure detail. Set only for the failure and partial-failure outcomes + // (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, + // `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the + // unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, + // `unsupported-remote-session`). + Error *string `json:"error,omitempty"` + // Number of persisted events removed by conversation truncation. Present only when + // truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and + // `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, + // `file-change-tracking-disabled`, `unsupported-remote-session`) and for + // `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`. + EventsRemoved *int64 `json:"eventsRemoved,omitempty"` + // Overall rewind outcome. This discriminates the result: it governs which of the remaining + // fields are populated, so consumers must switch on it before reading `eventsRemoved`, + // `restoredFiles`, `skippedFiles`, or `error`. See each field for the outcomes that + // populate it. + Outcome HistoryRewindOutcome `json:"outcome"` + // Absolute paths restored to their captured preimages. Always empty for conversation-only + // rewinds and for the unavailable outcomes (`session-busy`, + // `file-change-tracking-disabled`, `unsupported-remote-session`); only + // conversation-and-files outcomes that reached the file-restore stage populate it. + RestoredFiles []string `json:"restoredFiles"` + // Captured files intentionally left unchanged. Always empty for conversation-only rewinds + // and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, + // `unsupported-remote-session`); only conversation-and-files outcomes that reached the + // file-restore stage populate it. + SkippedFiles []HistorySkippedFileRestore `json:"skippedFiles"` +} + +// A captured file that rewind intentionally left unchanged. +// Experimental: HistorySkippedFileRestore is part of an experimental API and may change or +// be removed. +type HistorySkippedFileRestore struct { + // Absolute path of the skipped file. + Path string `json:"path"` + // Reason the file was not restored. + Reason HistoryFileRestoreSkipReason `json:"reason"` +} + // Markdown summary of the conversation context (empty when not available). // Experimental: HistorySummarizeForHandoffResult is part of an experimental API and may // change or be removed. @@ -2686,6 +3112,12 @@ type HistoryTruncateRequest struct { // Experimental: HistoryTruncateResult is part of an experimental API and may change or be // removed. type HistoryTruncateResult struct { + // Failure detail when checkpointCleanupFailed is true. + CheckpointCleanupError *string `json:"checkpointCleanupError,omitempty"` + // True when conversation truncation succeeded but post-truncation workspace checkpoint + // cleanup failed. History is already truncated; callers may still prune snapshots but + // should report a checkpoint-cleanup rather than a truncation failure. + CheckpointCleanupFailed *bool `json:"checkpointCleanupFailed,omitempty"` // Number of events that were removed EventsRemoved int64 `json:"eventsRemoved"` } @@ -2759,14 +3191,16 @@ type InstalledPluginSource struct { String *string } -// Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref, -// and optional subpath. +// Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref or +// full commit SHA, and optional subpath. // Experimental: InstalledPluginSourceGitHub is part of an experimental API and may change // or be removed. type InstalledPluginSourceGitHub struct { Path *string `json:"path,omitempty"` Ref *string `json:"ref,omitempty"` Repo string `json:"repo"` + // Optional full 40-character hexadecimal commit SHA. + Sha *string `json:"sha,omitempty"` // Constant value. Always "github". Source InstalledPluginSourceGitHubSource `json:"source"` } @@ -2780,13 +3214,15 @@ type InstalledPluginSourceLocal struct { Source InstalledPluginSourceLocalSource `json:"source"` } -// Source descriptor for a direct URL plugin install, with URL, optional ref, and optional -// subpath. +// Source descriptor for a direct URL plugin install, with URL, optional ref or full commit +// SHA, and optional subpath. // Experimental: InstalledPluginSourceURL is part of an experimental API and may change or // be removed. type InstalledPluginSourceURL struct { Path *string `json:"path,omitempty"` Ref *string `json:"ref,omitempty"` + // Optional full 40-character hexadecimal commit SHA. + Sha *string `json:"sha,omitempty"` // Constant value. Always "url". Source InstalledPluginSourceURLSource `json:"source"` URL string `json:"url"` @@ -2883,6 +3319,25 @@ type InstructionSource struct { Type InstructionSourceType `json:"type"` } +// Parameters for interrupting the main agent turn. +// Experimental: InterruptMainTurnRequest is part of an experimental API and may change or +// be removed. +type InterruptMainTurnRequest struct { + // When true, the user's queued prompts are preserved and run as the next turn once the + // interrupted turn unwinds; when false (the default), the queue is cleared like a plain + // abort. + FlushQueued *bool `json:"flushQueued,omitempty"` +} + +// Result of interrupting the main agent turn. +// Experimental: InterruptMainTurnResult is part of an experimental API and may change or be +// removed. +type InterruptMainTurnResult struct { + // Whether an in-flight main agent turn was interrupted. False when the main loop was not + // processing. + Interrupted bool `json:"interrupted"` +} + // HTTP headers as a map from lowercased header name to a list of values. Multi-valued // headers (e.g. Set-Cookie) preserve all values. // Experimental: LlmInferenceHeaders is part of an experimental API and may change or be @@ -3805,6 +4260,23 @@ func (MCPOauthPendingRequestResponseToken) Kind() MCPOauthPendingRequestResponse return MCPOauthPendingRequestResponseKindToken } +// Pending MCP OAuth request id to respond to. +// Experimental: MCPOauthRespondRequest is part of an experimental API and may change or be +// removed. +type MCPOauthRespondRequest struct { + // OAuth request identifier from the mcp.oauth_required event + RequestID string `json:"requestId"` +} + +// Indicates whether the pending MCP OAuth response was accepted. +// Experimental: MCPOauthRespondResult is part of an experimental API and may change or be +// removed. +type MCPOauthRespondResult struct { + // Whether the response was accepted. False if the request was unknown, timed out, or + // already resolved. + Success bool `json:"success"` +} + // Registration parameters for an external MCP client. // Experimental: MCPRegisterExternalClientRequest is part of an experimental API and may // change or be removed. @@ -4095,6 +4567,9 @@ type MCPServerConfigHTTP struct { // Controls if tools provided by this server can be loaded on demand via tool search (auto) // or always included in the initial tool list (never) DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` + // Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery + // is unaffected. + DisableToolCache *bool `json:"disableToolCache,omitempty"` // Content filtering mode to apply to all tools, or a map of tool name to content filtering // mode. FilterMapping FilterMapping `json:"filterMapping,omitempty"` @@ -4138,6 +4613,9 @@ type MCPServerConfigStdio struct { // Controls if tools provided by this server can be loaded on demand via tool search (auto) // or always included in the initial tool list (never) DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` + // Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery + // is unaffected. + DisableToolCache *bool `json:"disableToolCache,omitempty"` // Environment variables to pass to the Stdio MCP server process. Env map[string]string `json:"env,omitzero"` // Content filtering mode to apply to all tools, or a map of tool name to content filtering @@ -4203,12 +4681,14 @@ type MCPSetEnvValueModeResult struct { Mode MCPSetEnvValueModeDetails `json:"mode"` } -// Server name and configuration for an individual MCP server start. +// Server name and optional configuration for an individual MCP server start. Omit `config` +// for a config-free start-by-name of an already-configured server. // Experimental: MCPStartServerRequest is part of an experimental API and may change or be // removed. type MCPStartServerRequest struct { - // MCP server configuration (stdio process or remote HTTP/SSE) - Config MCPServerConfig `json:"config"` + // MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server + // with its already-registered configuration (config-free start-by-name). + Config MCPServerConfig `json:"config,omitempty"` // Name of the MCP server to start ServerName string `json:"serverName"` } @@ -5877,10 +6357,12 @@ type PermissionsPathsUpdatePrimaryResult struct { type PermissionsPendingRequestsRequest struct { } -// No parameters; clears all session-scoped tool permission approvals. +// Clears session-scoped tool permission approvals, and optionally the location-scoped ones. // Experimental: PermissionsResetSessionApprovalsRequest is part of an experimental API and // may change or be removed. type PermissionsResetSessionApprovalsRequest struct { + // Whether location-scoped approvals are cleared too. Defaults to `true`. + IncludeLocation *bool `json:"includeLocation,omitempty"` } // Indicates whether the operation succeeded. @@ -6812,6 +7294,30 @@ type PushGitHubRepoRef struct { Owner string `json:"owner"` } +// Inputs for starting a deferred-idle drain. +// Experimental: QueueBeginDeferredIdleDrainRequest is part of an experimental API and may +// change or be removed. +type QueueBeginDeferredIdleDrainRequest struct { + // Whether the host still has active background work. + ActiveBackgroundWork bool `json:"activeBackgroundWork"` +} + +// Whether a deferred-idle drain should run. +// Experimental: QueueBeginDeferredIdleDrainResult is part of an experimental API and may +// change or be removed. +type QueueBeginDeferredIdleDrainResult struct { + // True when the host should run finishDeferredIdleDrain asynchronously. + ShouldDrain bool `json:"shouldDrain"` +} + +// Internal filter for consuming queued system notifications. +// Experimental: QueueConsumeSystemNotificationsRequest is part of an experimental API and +// may change or be removed. +type QueueConsumeSystemNotificationsRequest struct { + // Opaque runtime-owned filter object. + Filter any `json:"filter"` +} + // Result of the queued command execution. // Experimental: QueuedCommandResult is part of an experimental API and may change or be // removed. @@ -6847,6 +7353,50 @@ func (QueuedCommandNotHandled) Handled() bool { return false } +// Inputs for marking session.idle deferred in native state. +// Experimental: QueueDeferSessionIdleRequest is part of an experimental API and may change +// or be removed. +type QueueDeferSessionIdleRequest struct { + // Whether the deferred idle was caused by an aborted foreground turn. + Aborted bool `json:"aborted"` +} + +// Result of enqueueing the resume-pending wake item. +// Experimental: QueueEnqueueResumePendingResult is part of an experimental API and may +// change or be removed. +type QueueEnqueueResumePendingResult struct { + // True when a wake item was newly queued. + Queued bool `json:"queued"` +} + +// Inputs for completing a deferred-idle drain. +// Experimental: QueueFinishDeferredIdleDrainRequest is part of an experimental API and may +// change or be removed. +type QueueFinishDeferredIdleDrainRequest struct { + // Whether the host still has active background work. + ActiveBackgroundWork bool `json:"activeBackgroundWork"` + // Whether native queued work remains. + HasPending bool `json:"hasPending"` +} + +// Action selected by the native deferred-idle drain. +// Experimental: QueueFinishDeferredIdleDrainResult is part of an experimental API and may +// change or be removed. +type QueueFinishDeferredIdleDrainResult struct { + // Whether the deferred idle was caused by an aborted foreground turn. + Aborted bool `json:"aborted"` + // One of none, processQueue, or emitSessionIdle. + Action string `json:"action"` +} + +// Whether the native queue has pending work. +// Experimental: QueueHasPendingResult is part of an experimental API and may change or be +// removed. +type QueueHasPendingResult struct { + // True when queued or immediate native work is pending. + HasPending bool `json:"hasPending"` +} + // User-facing pending queue entry, with kind and display text for a queued message, slash // command, or model change. // Experimental: QueuePendingItems is part of an experimental API and may change or be @@ -6879,6 +7429,20 @@ type QueueRemoveMostRecentResult struct { Removed bool `json:"removed"` } +// Internal snapshot of native queue state for local session orchestration. +// Experimental: QueueSnapshotResult is part of an experimental API and may change or be +// removed. +type QueueSnapshotResult struct { + // Insertion orders for queued items, aligned with `items`. + ItemOrders []int64 `json:"itemOrders,omitzero"` + // User-facing pending items in FIFO order. + Items []QueuePendingItems `json:"items"` + // Insertion orders for immediate steering messages, aligned with `steeringMessages`. + SteeringMessageOrders []int64 `json:"steeringMessageOrders,omitzero"` + // Immediate steering messages waiting for an active turn. + SteeringMessages []string `json:"steeringMessages"` +} + // Event type to register consumer interest for, used by runtime gating logic. // Experimental: RegisterEventInterestParams is part of an experimental API and may change // or be removed. @@ -7265,6 +7829,70 @@ type SandboxConfigUserPolicySeatbelt struct { KeychainAccess *bool `json:"keychainAccess,omitempty"` } +// Register an absolute-time scheduled prompt. +// Experimental: ScheduleAddAtRequest is part of an experimental API and may change or be +// removed. +type ScheduleAddAtRequest struct { + // Epoch milliseconds when the prompt should fire. + At int64 `json:"at"` + // Optional display-only prompt label. + DisplayPrompt *string `json:"displayPrompt,omitempty"` + // Prompt text to enqueue when the schedule fires. + Prompt string `json:"prompt"` + // Whether the schedule should re-arm after each tick. Defaults to false. + Recurring *bool `json:"recurring,omitempty"` +} + +// Register a cron scheduled prompt. +// Experimental: ScheduleAddCronRequest is part of an experimental API and may change or be +// removed. +type ScheduleAddCronRequest struct { + // 5-field cron expression. + Cron string `json:"cron"` + // Optional display-only prompt label. + DisplayPrompt *string `json:"displayPrompt,omitempty"` + // Prompt text to enqueue when the schedule fires. + Prompt string `json:"prompt"` + // Whether the schedule should re-arm after each tick. Defaults to true. + Recurring *bool `json:"recurring,omitempty"` + // IANA timezone for evaluating the cron expression. + Tz *string `json:"tz,omitempty"` +} + +// Register a relative-interval scheduled prompt. +// Experimental: ScheduleAddRequest is part of an experimental API and may change or be +// removed. +type ScheduleAddRequest struct { + // Optional display-only prompt label. + DisplayPrompt *string `json:"displayPrompt,omitempty"` + // Human-readable interval such as `30s`, `5m`, or `2h`. + Interval string `json:"interval"` + // Prompt text to enqueue when the schedule fires. + Prompt string `json:"prompt"` + // Whether the schedule should re-arm after each tick. Defaults to true. + Recurring *bool `json:"recurring,omitempty"` +} + +// Result of registering or re-arming a scheduled prompt. +// Experimental: ScheduleAddResult is part of an experimental API and may change or be +// removed. +type ScheduleAddResult struct { + // The registered or updated schedule entry. + Entry *ScheduleEntry `json:"entry,omitempty"` + // User-facing validation error, when registration failed. + Error *string `json:"error,omitempty"` +} + +// Register a self-paced scheduled prompt. +// Experimental: ScheduleAddSelfPacedRequest is part of an experimental API and may change +// or be removed. +type ScheduleAddSelfPacedRequest struct { + // Optional display-only prompt label. + DisplayPrompt *string `json:"displayPrompt,omitempty"` + // Prompt text to enqueue when the schedule fires. + Prompt string `json:"prompt"` +} + // Scheduled prompt entry with ID, timing (`intervalMs`, `cron`, or `at`), prompt text, // recurrence, and next run time. // Experimental: ScheduleEntry is part of an experimental API and may change or be removed. @@ -7294,6 +7922,14 @@ type ScheduleEntry struct { Tz *string `json:"tz,omitempty"` } +// Whether the session currently has an active self-paced schedule. +// Experimental: ScheduleHasSelfPacedResult is part of an experimental API and may change or +// be removed. +type ScheduleHasSelfPacedResult struct { + // True when at least one active schedule is self-paced. + HasSelfPaced bool `json:"hasSelfPaced"` +} + // Snapshot of the currently active recurring prompts for this session. // Experimental: ScheduleList is part of an experimental API and may change or be removed. type ScheduleList struct { @@ -7301,6 +7937,16 @@ type ScheduleList struct { Entries []ScheduleEntry `json:"entries"` } +// Re-arm a self-paced scheduled prompt. +// Experimental: ScheduleRearmSelfPacedRequest is part of an experimental API and may change +// or be removed. +type ScheduleRearmSelfPacedRequest struct { + // Epoch milliseconds when the prompt should next fire. + At int64 `json:"at"` + // Id of the self-paced scheduled prompt. + ID int64 `json:"id"` +} + // Identifier of the scheduled prompt to remove. // Experimental: ScheduleStopRequest is part of an experimental API and may change or be // removed. @@ -7365,10 +8011,9 @@ type SendMessageItem struct { // If set, the request will fail if the named tool is not available when this message is // among the user messages at the start of the current exchange RequiredTool *string `json:"requiredTool,omitempty"` - // Optional provenance tag copied to the resulting user.message event. Must match one of - // three forms: the literal `system`, `command-` for messages originating from a - // command (e.g. slash command, Mission Control command), or `schedule-` for - // messages originating from a scheduled job. + // Optional provenance tag copied to the resulting user.message event. Must be `user`, + // `system`, `command-` for command-originated messages, `schedule-` + // for scheduled prompts, or `agent-` for prompts sent by another agent. // Internal: Source is part of the SDK's internal API surface and is not intended for // external use. Source *string `json:"source,omitempty"` @@ -7442,10 +8087,9 @@ type SendRequest struct { // If set, the request will fail if the named tool is not available when this message is // among the user messages at the start of the current exchange RequiredTool *string `json:"requiredTool,omitempty"` - // Optional provenance tag copied to the resulting user.message event. Must match one of - // three forms: the literal `system`, `command-` for messages originating from a - // command (e.g. slash command, Mission Control command), or `schedule-` for - // messages originating from a scheduled job. + // Optional provenance tag copied to the resulting user.message event. Must be `user`, + // `system`, `command-` for command-originated messages, `schedule-` + // for scheduled prompts, or `agent-` 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 +8110,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 +8212,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 +8566,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 +8598,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 +8709,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 +8732,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"` @@ -8320,6 +9023,27 @@ type SessionOpenOptions struct { // surface is experimental. // Experimental: EnableCitations is part of an experimental API and may change or be removed. EnableCitations *bool `json:"enableCitations,omitempty"` + // Opt in to capturing file changes for session rewind and session diff. Capture cannot + // reconstruct changes made before it was enabled. On create it starts capture from the + // first turn. It is also honored on resume: for a session that already has tracked prior + // turns, tracking continues automatically even if this is omitted; passing it on resume + // additionally enables tracking for an eligible session that has no prior root turn yet. + // Resuming a session whose prior root turns were never tracked has no restorable baseline, + // so tracking stays disabled for it and rewind reports file change tracking as unavailable; + // the resume itself still succeeds, so sessions that predate tracking remain loadable. The + // opt-in is only rejected when the session can never track (a subagent session, or one + // without local session storage). It is intentionally absent from the mutable options + // update because enabling it after edits have occurred would create an incomplete, + // misleading baseline. Subagents share the parent session's capture store and are not + // tracked as separate rewind points: a file a subagent writes is attributed to whichever + // root user turn was open when the capture was staged, just before the tool body ran. A + // turn cannot open while a staged capture is still in flight, so a subagent tool that + // staged under the spawning turn stays attributed to it however late the write lands, while + // a capture it stages after the user's next message belongs to that later turn. Attribution + // decides which turn's rewind point counts and file preview include that write; it does not + // narrow which rewinds revert it, because a rewind restores every capture from the selected + // turn onward, so the earlier spawning turn reverts it as well. + EnableFileChangeTracking *bool `json:"enableFileChangeTracking,omitempty"` // Opt-in: self-fetch and enforce enterprise managed settings at session bootstrap. EnableManagedSettings *bool `json:"enableManagedSettings,omitempty"` // Whether on-demand custom instruction discovery is enabled. @@ -8332,6 +9056,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 +9128,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 +9405,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 +9445,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 +9471,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 +9740,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 +9801,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 @@ -9259,7 +10055,7 @@ type SessionUpdateOptionsParams struct { EnableHostGitOperations *bool `json:"enableHostGitOperations,omitempty"` // Whether to discover custom instructions on demand after successful file views (AGENTS.md // / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with - // `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag. + // `skipCustomInstructions`. EnableOnDemandInstructionDiscovery *bool `json:"enableOnDemandInstructionDiscovery,omitempty"` // Whether to surface reasoning-summary events from the model. EnableReasoningSummaries *bool `json:"enableReasoningSummaries,omitempty"` @@ -9278,6 +10074,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 +10130,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 +10235,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 +10263,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 +11336,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, @@ -10995,7 +11839,9 @@ type WorkspaceDiffFileChange struct { IsTruncated *bool `json:"isTruncated,omitempty"` // Original file path for renamed files. OldPath *string `json:"oldPath,omitempty"` - // Path to the changed file, relative to the workspace root. + // Path to the changed file, relative to the workspace root when the file lives under it. A + // file changed outside the workspace root keeps a `../`-relative path, or an absolute path + // when no relative path exists (for example a different Windows drive). Path string `json:"path"` } @@ -11007,12 +11853,47 @@ type WorkspaceDiffResult struct { BaseBranch *string `json:"baseBranch,omitempty"` // Changed files and their unified diffs. Changes []WorkspaceDiffFileChange `json:"changes"` - // Whether a requested branch diff fell back to unstaged changes because branch diff failed. + // Whether the requested diff fell back to unstaged changes, either because branch diff + // failed or session diff was unavailable. IsFallback bool `json:"isFallback"` // Effective mode used for the returned changes. Mode WorkspaceDiffMode `json:"mode"` // Diff mode requested by the client. RequestedMode WorkspaceDiffMode `json:"requestedMode"` + // Why the session diff could not be produced, when applicable. Set only when `session` mode + // was requested and `isFallback` is true, so a client can tell the permanent + // `file-change-tracking-disabled` apart from the transient `session-busy`, which the same + // request answers once the session settles. Never set for `unstaged` or `branch` mode, and + // never `unsupported-remote-session`: a remote session's captures live on its own host, so + // a `session`-mode diff is rejected for one rather than answered with a controller-side + // fallback. + UnavailableReason *HistoryRewindUnavailableReason `json:"unavailableReason,omitempty"` +} + +// 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 @@ -11038,6 +11919,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 +11937,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,7 +11994,15 @@ type WorkspacesListFilesResult struct { Files []string `json:"files"` } -// Checkpoint number to read. +// 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. type WorkspacesReadCheckpointRequest struct { @@ -11155,6 +12060,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 +12094,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 +12593,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 +12633,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" ) @@ -11706,6 +12694,95 @@ const ( FactoryRunStatusRunning FactoryRunStatus = "running" ) +// Reason a captured file was not restored. +// Experimental: HistoryFileRestoreSkipReason is part of an experimental API and may change +// or be removed. +type HistoryFileRestoreSkipReason string + +const ( + // A faithful preimage was not captured. + HistoryFileRestoreSkipReasonSkippedCapture HistoryFileRestoreSkipReason = "skipped-capture" + // The file changed after Copilot's last captured write. + HistoryFileRestoreSkipReasonUserModified HistoryFileRestoreSkipReason = "user-modified" +) + +// Aggregate file change represented by a rewind preview. +// Experimental: HistoryRewindChangeType is part of an experimental API and may change or be +// removed. +type HistoryRewindChangeType string + +const ( + // The discarded turns created the file. + HistoryRewindChangeTypeCreated HistoryRewindChangeType = "created" + // The discarded turns deleted the file. + HistoryRewindChangeTypeDeleted HistoryRewindChangeType = "deleted" + // The discarded turns modified the file. + HistoryRewindChangeTypeModified HistoryRewindChangeType = "modified" +) + +// Scope of a rewind operation. +// Experimental: HistoryRewindMode is part of an experimental API and may change or be +// removed. +type HistoryRewindMode string + +const ( + // Discard conversation events while leaving files unchanged. + HistoryRewindModeConversation HistoryRewindMode = "conversation" + // Discard conversation events and restore captured files changed by those turns. + HistoryRewindModeConversationAndFiles HistoryRewindMode = "conversation-and-files" +) + +// Outcome of a rewind request. +// Experimental: HistoryRewindOutcome is part of an experimental API and may change or be +// removed. +type HistoryRewindOutcome string + +const ( + // The conversation was rewound (and, in conversation-and-files mode, captured files were + // restored), but persisted checkpoints could not be cleaned up; reachable in either mode. + HistoryRewindOutcomeCheckpointCleanupFailed HistoryRewindOutcome = "checkpoint-cleanup-failed" + // A conversation-and-files rewind was requested for a session that did not enable capture; + // conversation-only rewinds never produce this. + HistoryRewindOutcomeFileChangeTrackingDisabled HistoryRewindOutcome = "file-change-tracking-disabled" + // File restore failed and all applied file changes were rolled back; only + // conversation-and-files rewinds produce this. + HistoryRewindOutcomeFilesRolledBack HistoryRewindOutcome = "files-rolled-back" + // File restore failed and its rollback could not fully restore the pre-rewind state; only + // conversation-and-files rewinds produce this. + HistoryRewindOutcomeRollbackIncomplete HistoryRewindOutcome = "rollback-incomplete" + // The session still has work that may mutate files or history; reachable in either mode. + HistoryRewindOutcomeSessionBusy HistoryRewindOutcome = "session-busy" + // Files and conversation were rewound, but obsolete file snapshots could not be removed; + // only conversation-and-files rewinds produce this. + HistoryRewindOutcomeSnapshotPruneFailed HistoryRewindOutcome = "snapshot-prune-failed" + // The requested rewind completed; reachable in either mode. + HistoryRewindOutcomeSuccess HistoryRewindOutcome = "success" + // Conversation truncation failed. In conversation-and-files mode any files that were + // restored are left in place because conversation history cannot be un-truncated; in + // conversation-only mode no files are restored. Consult restoredFiles for what, if + // anything, was applied. + HistoryRewindOutcomeTruncationFailed HistoryRewindOutcome = "truncation-failed" + // Remote-backed rewind routing is not supported; reachable in either mode. + HistoryRewindOutcomeUnsupportedRemoteSession HistoryRewindOutcome = "unsupported-remote-session" +) + +// Reason a rewind read (rewind points, file-restore preview, or session diff) could not be +// answered from the session's file-change captures. +// Experimental: HistoryRewindUnavailableReason is part of an experimental API and may +// change or be removed. +type HistoryRewindUnavailableReason string + +const ( + // The session did not opt into file-change tracking before its first turn. + HistoryRewindUnavailableReasonFileChangeTrackingDisabled HistoryRewindUnavailableReason = "file-change-tracking-disabled" + // The session still has work that may mutate files or history. Transient: the same request + // succeeds once the session settles, so callers should retry rather than treat it as a + // failure. + HistoryRewindUnavailableReasonSessionBusy HistoryRewindUnavailableReason = "session-busy" + // Remote-backed rewind routing is not supported. + HistoryRewindUnavailableReasonUnsupportedRemoteSession HistoryRewindUnavailableReason = "unsupported-remote-session" +) + // Authentication host. HMAC auth always targets the public GitHub host. type HMACAuthInfoHost string @@ -12714,6 +13791,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 +14056,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 @@ -13783,6 +14903,25 @@ func (s *ServerMCPAPI) Config() *ServerMCPConfigAPI { // Experimental: ServerModelsAPI contains experimental APIs that may change or be removed. type ServerModelsAPI serverAPI +// GetBuiltInCatalog returns the running runtime's complete catalog of well-known built-in +// model IDs without authentication or network access. +// +// RPC method: models.getBuiltInCatalog. +// +// Returns: The running runtime's complete catalog of well-known built-in model IDs, +// including supported models and additional IDs with built-in metadata. +func (a *ServerModelsAPI) GetBuiltInCatalog(ctx context.Context) (*BuiltInModelCatalog, error) { + raw, err := a.client.Request(ctx, "models.getBuiltInCatalog", nil) + if err != nil { + return nil, err + } + var result BuiltInModelCatalog + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Lists Copilot models available to the authenticated user. // // RPC method: models.list. @@ -14849,6 +15988,26 @@ func (a *InternalServerSessionsAPI) ConfigureSessionExtensions(ctx context.Conte return &result, nil } +// 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 @@ -14900,6 +16059,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 +16106,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 @@ -15441,6 +16643,38 @@ func (a *CompletionsAPI) Request(ctx context.Context, params *CompletionsRequest return &result, nil } +// Experimental: ContentExclusionAPI contains experimental APIs that may change or be +// removed. +type ContentExclusionAPI sessionAPI + +// CheckPaths checks local file system absolute paths within the session working directory +// against its content-exclusion policy. Results preserve input order. Unsupported +// paths/filesystems and unavailable policy evaluation return available false, and callers +// must treat every requested path as excluded. +// +// RPC method: session.contentExclusion.checkPaths. +// +// Parameters: Local file system absolute paths within the session working directory to +// check against its content-exclusion policy. +// +// Returns: Batch content-exclusion result. Callers must fail closed when policy evaluation +// is unavailable. +func (a *ContentExclusionAPI) CheckPaths(ctx context.Context, params *ContentExclusionCheckPathsRequest) (*ContentExclusionCheckPathsResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["paths"] = params.Paths + } + raw, err := a.client.Request(ctx, "session.contentExclusion.checkPaths", req) + if err != nil { + return nil, err + } + var result ContentExclusionCheckPathsResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Experimental: DebugAPI contains experimental APIs that may change or be removed. type DebugAPI sessionAPI @@ -15703,6 +16937,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 +16999,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 +17085,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 +17100,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 +17166,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 +17191,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 @@ -16018,6 +17358,84 @@ func (a *HistoryAPI) Compact(ctx context.Context, params ...*HistoryCompactReque return &result, nil } +// ListRewindPoints lists the user turns that the session can rewind to. Never rejects for a +// busy session: rewind reads need the session's file-change captures to be settled, so a +// session that still holds active work answers with `unavailableReason: "session-busy"` and +// no points, which the caller can retry. +// +// RPC method: session.history.listRewindPoints. +// +// Returns: Rewind points and file-change-tracking availability for the session. +func (a *HistoryAPI) ListRewindPoints(ctx context.Context) (*HistoryListRewindPointsResult, error) { + req := map[string]any{"sessionId": a.sessionID} + raw, err := a.client.Request(ctx, "session.history.listRewindPoints", req) + if err != nil { + return nil, err + } + var result HistoryListRewindPointsResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// PreviewRewind previews the files that a conversation-and-files rewind would restore. +// +// RPC method: session.history.previewRewind. +// +// Parameters: Event boundary to preview for conversation-and-files rewind. +// +// Returns: Files and aggregate changes for a prospective rewind. +func (a *HistoryAPI) PreviewRewind(ctx context.Context, params *HistoryPreviewRewindRequest) (*HistoryPreviewRewindResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["eventId"] = params.EventID + } + raw, err := a.client.Request(ctx, "session.history.previewRewind", req) + if err != nil { + return nil, err + } + var result HistoryPreviewRewindResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// Rewinds the session conversation, optionally restoring files changed by the discarded +// turns. Not crash-atomic: file restore and conversation truncation are separate stores, +// applied in that order, so a process crash between them can leave the workspace rewound +// while the conversation still contains the discarded turns. There is no recovery journal; +// re-running the same rewind is the recovery path for a crash before truncation lands, +// since file restore is idempotent (already-restored files are reported as skipped) and +// truncation is re-derived from the still-retained boundary event. After truncation lands +// that boundary no longer exists, so the same request is rejected; the only stage that can +// still be outstanding is snapshot pruning, whose failure leaves orphan snapshots the +// capture store tolerates. The reverse inconsistency cannot occur, because truncation is +// never applied before file restore succeeds. +// +// RPC method: session.history.rewind. +// +// Parameters: Boundary and mode for rewinding session history. +// +// Returns: Structured outcome of a rewind request. +func (a *HistoryAPI) Rewind(ctx context.Context, params *HistoryRewindRequest) (*HistoryRewindResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["eventId"] = params.EventID + req["mode"] = params.Mode + } + raw, err := a.client.Request(ctx, "session.history.rewind", req) + if err != nil { + return nil, err + } + var result HistoryRewindResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // SummarizeForHandoff produces a markdown summary of the session's conversation context for // hand-off scenarios. // @@ -16372,20 +17790,25 @@ func (a *MCPAPI) SetEnvValueMode(ctx context.Context, params *MCPSetEnvValueMode return &result, nil } -// StartServer starts an individual MCP server on the live session from a caller-supplied -// config. Session-scoped and ephemeral: the server is added to this session's running set -// only and is reaped when the session ends. Does NOT modify persistent user configuration -// (`mcp.config.*`), so it does not affect future sessions. The server surfaces through -// `session.mcp.list` and the `session.mcp_servers_loaded` / +// StartServer starts an individual MCP server on the live session. Omit `config` for a +// config-free start-by-name of an already-configured server (reuses the server's +// already-registered configuration); supply `config` to start from a caller-supplied +// configuration. Session-scoped and ephemeral: the server is added to this session's +// running set only and is reaped when the session ends. Does NOT modify persistent user +// configuration (`mcp.config.*`), so it does not affect future sessions. The server +// surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / // `session.mcp_server_status_changed` events like any other server. // // RPC method: session.mcp.startServer. // -// Parameters: Server name and configuration for an individual MCP server start. +// Parameters: Server name and optional configuration for an individual MCP server start. +// Omit `config` for a config-free start-by-name of an already-configured server. func (a *MCPAPI) StartServer(ctx context.Context, params *MCPStartServerRequest) (*SessionMCPStartServerResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { - req["config"] = params.Config + if params.Config != nil { + req["config"] = params.Config + } req["serverName"] = params.ServerName } raw, err := a.client.Request(ctx, "session.mcp.startServer", req) @@ -16683,9 +18106,32 @@ func (a *MCPOauthAPI) Login(ctx context.Context, params *MCPOauthLoginRequest) ( return &result, nil } -// Experimental: Oauth returns experimental APIs that may change or be removed. -func (s *MCPAPI) Oauth() *MCPOauthAPI { - return (*MCPOauthAPI)(s) +// 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) } // Experimental: MCPResourcesAPI contains experimental APIs that may change or be removed. @@ -17326,6 +18772,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 +18838,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 } @@ -17601,9 +19053,17 @@ func (a *PermissionsAPI) PendingRequests(ctx context.Context) (*PendingPermissio // // RPC method: session.permissions.resetSessionApprovals. // +// Parameters: Clears session-scoped tool permission approvals, and optionally the +// location-scoped ones. +// // Returns: Indicates whether the operation succeeded. -func (a *PermissionsAPI) ResetSessionApprovals(ctx context.Context) (*PermissionsResetSessionApprovalsResult, error) { +func (a *PermissionsAPI) ResetSessionApprovals(ctx context.Context, params *PermissionsResetSessionApprovalsRequest) (*PermissionsResetSessionApprovalsResult, error) { req := map[string]any{"sessionId": a.sessionID} + if params != nil { + if params.IncludeLocation != nil { + req["includeLocation"] = *params.IncludeLocation + } + } raw, err := a.client.Request(ctx, "session.permissions.resetSessionApprovals", req) if err != nil { return nil, err @@ -18428,7 +19888,14 @@ func (a *ShellAPI) CancelUserRequested(ctx context.Context, params *ShellCancelU return &result, nil } -// Exec starts a shell command and streams output through session notifications. +// Exec starts a shell command and streams output through session notifications. The command +// runs as the leader of its own process group (POSIX) or in a dedicated job object +// (Windows), so a forced termination — via "shell.kill", the request timeout, or session +// disposal — signals that whole group/job rather than only the direct child. Two gaps are +// worth planning for: a command that exits on its own does not trigger that teardown, and +// on POSIX a descendant that moves itself into a new session or process group (for example +// via "setsid") leaves the signalled group, so either can leave a background process +// running. // // RPC method: session.shell.exec. // @@ -18483,7 +19950,11 @@ func (a *ShellAPI) ExecuteUserRequested(ctx context.Context, params *ShellExecut return &result, nil } -// Kill sends a signal to a shell process previously started via "shell.exec". +// Kill sends a signal to a shell process previously started via "shell.exec". The signal +// targets the command's whole process group (POSIX) or job object (Windows), so descendants +// still in that group are signalled too, not just the direct child. On POSIX a descendant +// that moved itself into a new session or process group (for example via "setsid") is no +// longer in the signalled group and survives. // // RPC method: session.shell.kill. // @@ -19366,6 +20837,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,7 +20902,28 @@ func (a *WorkspacesAPI) CreateFile(ctx context.Context, params *WorkspacesCreate return &result, nil } -// Diff computes a diff for the session workspace. +// 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. Never rejects for a busy session: a +// `session`-mode diff that cannot read the session's file-change captures falls back to an +// unstaged git diff with `isFallback: true` and reports why in `unavailableReason`. // // RPC method: session.workspaces.diff. // @@ -19414,6 +20949,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 +21031,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,46 +21120,125 @@ 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. common sessionAPI - Agent *AgentAPI - Canvas *CanvasAPI - Commands *CommandsAPI - Completions *CompletionsAPI - Debug *DebugAPI - EventLog *EventLogAPI - Extensions *ExtensionsAPI - Factory *FactoryAPI - Fleet *FleetAPI - GitHubAuth *GitHubAuthAPI - History *HistoryAPI - Instructions *InstructionsAPI - Lsp *LspAPI - MCP *MCPAPI - Metadata *MetadataAPI - Mode *ModeAPI - Model *ModelAPI - Name *NameAPI - Options *OptionsAPI - Permissions *PermissionsAPI - Plan *PlanAPI - Plugins *PluginsAPI - Provider *ProviderAPI - Queue *QueueAPI - Remote *RemoteAPI - Schedule *ScheduleAPI - Shell *ShellAPI - Skills *SkillsAPI - Tasks *TasksAPI - Telemetry *TelemetryAPI - Tools *ToolsAPI - UI *UIAPI - Usage *UsageAPI - Visibility *VisibilityAPI - Workspaces *WorkspacesAPI + Agent *AgentAPI + Canvas *CanvasAPI + Commands *CommandsAPI + Completions *CompletionsAPI + ContentExclusion *ContentExclusionAPI + Debug *DebugAPI + EventLog *EventLogAPI + Extensions *ExtensionsAPI + Factory *FactoryAPI + Fleet *FleetAPI + GitHubAuth *GitHubAuthAPI + History *HistoryAPI + Instructions *InstructionsAPI + Lsp *LspAPI + MCP *MCPAPI + Metadata *MetadataAPI + Mode *ModeAPI + Model *ModelAPI + Name *NameAPI + Options *OptionsAPI + Permissions *PermissionsAPI + Plan *PlanAPI + Plugins *PluginsAPI + Provider *ProviderAPI + Queue *QueueAPI + Remote *RemoteAPI + Schedule *ScheduleAPI + Shell *ShellAPI + Skills *SkillsAPI + Tasks *TasksAPI + Telemetry *TelemetryAPI + Tools *ToolsAPI + UI *UIAPI + Usage *UsageAPI + Visibility *VisibilityAPI + Workspaces *WorkspacesAPI } // Aborts the current agent turn. @@ -19609,6 +21268,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. @@ -19816,6 +21527,7 @@ func NewSessionRPC(client *jsonrpc2.Client, sessionID string) *SessionRPC { r.Canvas = (*CanvasAPI)(&r.common) r.Commands = (*CommandsAPI)(&r.common) r.Completions = (*CompletionsAPI)(&r.common) + r.ContentExclusion = (*ContentExclusionAPI)(&r.common) r.Debug = (*DebugAPI)(&r.common) r.EventLog = (*EventLogAPI)(&r.common) r.Extensions = (*ExtensionsAPI)(&r.common) @@ -19969,6 +21681,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 +22127,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 +22329,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 +22697,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 82f6e10774..b86df61310 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"` @@ -1327,6 +1368,7 @@ func (r *MCPServerConfigHTTP) UnmarshalJSON(data []byte) error { type rawMCPServerConfigHTTP struct { Auth json.RawMessage `json:"auth,omitempty"` DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` + DisableToolCache *bool `json:"disableToolCache,omitempty"` FilterMapping json.RawMessage `json:"filterMapping,omitempty"` Headers map[string]string `json:"headers,omitzero"` IsDefaultServer *bool `json:"isDefaultServer,omitempty"` @@ -1351,6 +1393,7 @@ func (r *MCPServerConfigHTTP) UnmarshalJSON(data []byte) error { r.Auth = value } r.DeferTools = raw.DeferTools + r.DisableToolCache = raw.DisableToolCache if raw.FilterMapping != nil { value, err := unmarshalFilterMapping(raw.FilterMapping) if err != nil { @@ -1379,17 +1422,18 @@ func (r *MCPServerConfigHTTP) UnmarshalJSON(data []byte) error { func (r *MCPServerConfigStdio) UnmarshalJSON(data []byte) error { type rawMCPServerConfigStdio struct { - Args []string `json:"args,omitzero"` - Auth json.RawMessage `json:"auth,omitempty"` - Command string `json:"command"` - Cwd *string `json:"cwd,omitempty"` - DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` - Env map[string]string `json:"env,omitzero"` - FilterMapping json.RawMessage `json:"filterMapping,omitempty"` - IsDefaultServer *bool `json:"isDefaultServer,omitempty"` - Oidc json.RawMessage `json:"oidc,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - Tools []string `json:"tools,omitzero"` + Args []string `json:"args,omitzero"` + Auth json.RawMessage `json:"auth,omitempty"` + Command string `json:"command"` + Cwd *string `json:"cwd,omitempty"` + DeferTools *MCPServerConfigDeferTools `json:"deferTools,omitempty"` + DisableToolCache *bool `json:"disableToolCache,omitempty"` + Env map[string]string `json:"env,omitzero"` + FilterMapping json.RawMessage `json:"filterMapping,omitempty"` + IsDefaultServer *bool `json:"isDefaultServer,omitempty"` + Oidc json.RawMessage `json:"oidc,omitempty"` + Timeout *int64 `json:"timeout,omitempty"` + Tools []string `json:"tools,omitzero"` } var raw rawMCPServerConfigStdio if err := json.Unmarshal(data, &raw); err != nil { @@ -1406,6 +1450,7 @@ func (r *MCPServerConfigStdio) UnmarshalJSON(data []byte) error { r.Command = raw.Command r.Cwd = raw.Cwd r.DeferTools = raw.DeferTools + r.DisableToolCache = raw.DisableToolCache r.Env = raw.Env if raw.FilterMapping != nil { value, err := unmarshalFilterMapping(raw.FilterMapping) @@ -1676,7 +1721,7 @@ func (r *MCPRestartServerRequest) UnmarshalJSON(data []byte) error { func (r *MCPStartServerRequest) UnmarshalJSON(data []byte) error { type rawMCPStartServerRequest struct { - Config json.RawMessage `json:"config"` + Config json.RawMessage `json:"config,omitempty"` ServerName string `json:"serverName"` } var raw rawMCPStartServerRequest @@ -3493,12 +3538,14 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { DisabledInstructionSources []string `json:"disabledInstructionSources,omitzero"` DisabledSkills []string `json:"disabledSkills,omitzero"` EnableCitations *bool `json:"enableCitations,omitempty"` + EnableFileChangeTracking *bool `json:"enableFileChangeTracking,omitempty"` EnableManagedSettings *bool `json:"enableManagedSettings,omitempty"` EnableOnDemandInstructionDiscovery *bool `json:"enableOnDemandInstructionDiscovery,omitempty"` EnableScriptSafety *bool `json:"enableScriptSafety,omitempty"` 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 +3574,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"` @@ -3565,12 +3613,14 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { r.DisabledInstructionSources = raw.DisabledInstructionSources r.DisabledSkills = raw.DisabledSkills r.EnableCitations = raw.EnableCitations + r.EnableFileChangeTracking = raw.EnableFileChangeTracking r.EnableManagedSettings = raw.EnableManagedSettings r.EnableOnDemandInstructionDiscovery = raw.EnableOnDemandInstructionDiscovery r.EnableScriptSafety = raw.EnableScriptSafety 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 +3649,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 fe99126cf7..3e19e874ac 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 44f49948f4..f15335470d 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 @@ -926,6 +946,9 @@ func (*AssistantTurnRetryData) Type() SessionEventType { return SessionEventType type ModelCallStartData struct { // Model identifier used for this API call, when known Model *string `json:"model,omitempty"` + // Previous response or interaction identifier included in the model request, when present + // Internal: PreviousResponseID is part of the SDK's internal API surface and is not intended for external use. + PreviousResponseID *string `json:"previousResponseId,omitempty"` // Identifier of the assistant turn that initiated the model call TurnID string `json:"turnId"` } @@ -1213,7 +1236,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 +1461,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`) @@ -1580,7 +1605,7 @@ type SessionResumeData struct { Context *WorkingDirectoryContext `json:"context,omitempty"` // Context tier currently selected at resume time; null when no tier is active ContextTier *ContextTier `json:"contextTier,omitempty"` - // When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume. + // When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false or omitted, pending work is normally marked as interrupted unless the resume passively joined live work owned by another client; sessionWasActive distinguishes that case. ContinuePendingWork *bool `json:"continuePendingWork,omitempty"` // Total number of persisted events in the session at the time of resume EventCount int64 `json:"eventCount"` @@ -1598,7 +1623,7 @@ type SessionResumeData struct { SelectedModel *string `json:"selectedModel,omitempty"` // Session limits currently configured at resume time; null when no limits are active SessionLimits *SessionLimitsConfig `json:"sessionLimits,omitempty"` - // True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. + // True when this resume passively joined a session that already had live work running in the runtime - an agent turn, a native queue run, a queued resume continuation, or an in-flight send (for example, an extension joining a session another client was actively driving). False (or omitted) when the session had no live work or when the resume explicitly abandoned pending work, including cold resumes and suspended sessions that remain resident in memory. SessionWasActive *bool `json:"sessionWasActive,omitempty"` // Output verbosity level used for model calls, if applicable (e.g. "low", "medium", "high") Verbosity *Verbosity `json:"verbosity,omitempty"` @@ -1861,6 +1886,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 +1928,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 +1976,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 @@ -2566,6 +2595,10 @@ type ModelCallFailureRequestFingerprint struct { // Auto-approval judge information attached to a permission request. Present (non-null) only when the session's allow-all mode is "auto"; its absence means auto mode was off and the judge did not evaluate the request. The `recommendation` conveys the judge's disposition for this request. // Experimental: PermissionAutoApproval is part of an experimental API and may change or be removed. type PermissionAutoApproval struct { + // Classified cause of an `error` recommendation. Absent for every other recommendation. + FailureReason *AutoApprovalJudgeFailureReason `json:"failureReason,omitempty"` + // Model id that produced the recommendation, when the judge was consulted and reported one. Absent for `excluded` (the judge was not consulted) and for failures that occurred before a model was selected. + Model *string `json:"model,omitempty"` // Human-readable reason for the judge's recommendation, when available. Reason *string `json:"reason,omitempty"` // The auto-approval safety judge's outcome for this request. @@ -3808,6 +3841,23 @@ const ( AssistantUsageAPIEndpointWsResponses AssistantUsageAPIEndpoint = "ws:/responses" ) +// Why the auto-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs. +// Experimental: AutoApprovalJudgeFailureReason is part of an experimental API and may change or be removed. +type AutoApprovalJudgeFailureReason string + +const ( + // The judge model call was cancelled before it returned. + AutoApprovalJudgeFailureReasonAbort AutoApprovalJudgeFailureReason = "abort" + // The judge model call completed but returned no content. + AutoApprovalJudgeFailureReasonEmptyResponse AutoApprovalJudgeFailureReason = "empty_response" + // The judge model call failed (for example a transport, authentication, or rate-limit error). + AutoApprovalJudgeFailureReasonModelError AutoApprovalJudgeFailureReason = "model_error" + // The judge model replied, but the reply carried no ALLOW/DENY verdict. + AutoApprovalJudgeFailureReasonParseError AutoApprovalJudgeFailureReason = "parse_error" + // The judge model call exceeded its deadline. + AutoApprovalJudgeFailureReasonTimeout AutoApprovalJudgeFailureReason = "timeout" +) + // Outcome of the auto-approval safety judge for a permission request. Present only when auto mode is enabled; its absence means the judge did not evaluate the request (auto mode was off). // Experimental: AutoApprovalRecommendation is part of an experimental API and may change or be removed. type AutoApprovalRecommendation string @@ -4278,6 +4328,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/zsession_events.go b/go/zsession_events.go index 1d35a0a518..ce167306fb 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -53,6 +53,7 @@ type ( AttachmentSelectionDetailsEnd = rpc.AttachmentSelectionDetailsEnd AttachmentSelectionDetailsStart = rpc.AttachmentSelectionDetailsStart AttachmentType = rpc.AttachmentType + AutoApprovalJudgeFailureReason = rpc.AutoApprovalJudgeFailureReason AutoApprovalRecommendation = rpc.AutoApprovalRecommendation AutoModeResolvedReasoningBucket = rpc.AutoModeResolvedReasoningBucket AutoModeSwitchCompletedData = rpc.AutoModeSwitchCompletedData @@ -103,6 +104,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 +214,7 @@ type ( ReasoningSummary = rpc.ReasoningSummary SamplingCompletedData = rpc.SamplingCompletedData SamplingRequestedData = rpc.SamplingRequestedData + ScheduleOrigin = rpc.ScheduleOrigin SessionAutoModeResolvedData = rpc.SessionAutoModeResolvedData SessionAutopilotObjectiveChangedData = rpc.SessionAutopilotObjectiveChangedData SessionBackgroundTasksChangedData = rpc.SessionBackgroundTasksChangedData @@ -386,6 +389,11 @@ const ( AttachmentTypeGitHubTreeComparison = rpc.AttachmentTypeGitHubTreeComparison AttachmentTypeGitHubURL = rpc.AttachmentTypeGitHubURL AttachmentTypeSelection = rpc.AttachmentTypeSelection + AutoApprovalJudgeFailureReasonAbort = rpc.AutoApprovalJudgeFailureReasonAbort + AutoApprovalJudgeFailureReasonEmptyResponse = rpc.AutoApprovalJudgeFailureReasonEmptyResponse + AutoApprovalJudgeFailureReasonModelError = rpc.AutoApprovalJudgeFailureReasonModelError + AutoApprovalJudgeFailureReasonParseError = rpc.AutoApprovalJudgeFailureReasonParseError + AutoApprovalJudgeFailureReasonTimeout = rpc.AutoApprovalJudgeFailureReasonTimeout AutoApprovalRecommendationApprove = rpc.AutoApprovalRecommendationApprove AutoApprovalRecommendationError = rpc.AutoApprovalRecommendationError AutoApprovalRecommendationExcluded = rpc.AutoApprovalRecommendationExcluded @@ -534,6 +542,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 +572,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/java/pom.xml b/java/pom.xml index 5016a34b9d..0a3f555be2 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -88,7 +88,7 @@ DO NOT EDIT MANUALLY. Updated by the update-copilot-dependency workflow. --> - ^1.0.73 + ^1.0.76-0 diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index 107a777851..2f3797246d 100644 --- a/java/scripts/codegen/package-lock.json +++ b/java/scripts/codegen/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "copilot-sdk-java-codegen", "dependencies": { - "@github/copilot": "^1.0.73", + "@github/copilot": "^1.0.76-0", "json-schema": "^0.4.0", "tsx": "^4.23.1" } @@ -428,9 +428,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.76-0.tgz", + "integrity": "sha512-4H/UdjreF5h2rJVx8u2pbZA3mdhkeY3VXWbERNPOTb8VX0dvNrNoytBRLDznDHvoaicw44209z+3wdbG9tkYMQ==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -439,20 +439,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.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.76-0", + "@github/copilot-darwin-x64": "1.0.76-0", + "@github/copilot-linux-arm64": "1.0.76-0", + "@github/copilot-linux-x64": "1.0.76-0", + "@github/copilot-linuxmusl-arm64": "1.0.76-0", + "@github/copilot-linuxmusl-x64": "1.0.76-0", + "@github/copilot-win32-arm64": "1.0.76-0", + "@github/copilot-win32-x64": "1.0.76-0" } }, "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.76-0.tgz", + "integrity": "sha512-jn7vkFF9HeLfwvudGWJJXqZTipFNVlgSuUuwpezkNOGf4p/O4T5Df7/5OZzaXjWoZ737anUsWpANifhxmblSLg==", "cpu": [ "arm64" ], @@ -466,9 +466,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.76-0.tgz", + "integrity": "sha512-Yezh/nyit6XuaQKtCJ08xOz3Th3+dpyILsa9yIbgCvjxQFwu1RyEnweZJQXTRLV54AsW1Z98jv0V4eIghGjdRw==", "cpu": [ "x64" ], @@ -482,9 +482,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.76-0.tgz", + "integrity": "sha512-w/2JoB7Gu2Dd0RWwxEp2fTGiq+eZ6htli27IBfndpwJFTaKi61N1+T4X7PBMtke4jvrdDml0UVny1WTh+tXSzQ==", "cpu": [ "arm64" ], @@ -498,9 +498,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.76-0.tgz", + "integrity": "sha512-AOp6CxbR2yNpgjqee1AtzjkAwkoTVexMpeOBs7bm8Qgotljfkpz88FEMQx5n9mrQ8XbktOteNuoNucv+QPW/bQ==", "cpu": [ "x64" ], @@ -514,9 +514,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.76-0.tgz", + "integrity": "sha512-AQDap2izdmMbQmB8aqseSnHvm3uwRSAW1YIfVtPpRVggnKJp1tB3XkDd+/pi28yW0hQd3SLktzBJU8emTJsHOg==", "cpu": [ "arm64" ], @@ -530,9 +530,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.76-0.tgz", + "integrity": "sha512-Av8J2QkxmaiiFERGT6DZ90FSSpB+CWlek7pU4IGsbX9KGUB/xrWSxVjnM9gOyYuvG4w3O7dJBPfq+nChDqEWZA==", "cpu": [ "x64" ], @@ -546,9 +546,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.76-0.tgz", + "integrity": "sha512-hIk2y8td3cRx5dHI41gnBM3xE7Mj2GIFafr/Xc8OmN4nSXw897qzQd+nxA7IekWkyC9vYmi8eC37x4rV1Bmhkg==", "cpu": [ "arm64" ], @@ -562,9 +562,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.76-0.tgz", + "integrity": "sha512-0BwH5HcRY0vvCIYmtrGG6nKn1yS8YEhDVslGkgBWUAXXb6InzEuyVkb73gIIYLF4A9jz5d94BNXb9FuwclAPWg==", "cpu": [ "x64" ], diff --git a/java/scripts/codegen/package.json b/java/scripts/codegen/package.json index dbe8b5e6ef..98a8a5c715 100644 --- a/java/scripts/codegen/package.json +++ b/java/scripts/codegen/package.json @@ -7,7 +7,7 @@ "generate:java": "tsx java.ts" }, "dependencies": { - "@github/copilot": "^1.0.73", + "@github/copilot": "^1.0.76-0", "json-schema": "^0.4.0", "tsx": "^4.23.1" } diff --git a/java/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java b/java/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java index fdbdc0afd7..6c1a87324a 100644 --- a/java/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java @@ -63,6 +63,7 @@ public record AssistantMessageEventData( @JsonProperty("clientRequestId") String clientRequestId, /** Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */ @JsonProperty("serviceRequestId") String serviceRequestId, + @JsonProperty("rte") Boolean rte, /** Provider's completion / response identifier; shared across all chunks of a single API call. Used to group multi-chunk assistant utterances. */ @JsonProperty("apiCallId") String apiCallId, /** Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping */ diff --git a/java/src/generated/java/com/github/copilot/generated/AssistantReasoningEvent.java b/java/src/generated/java/com/github/copilot/generated/AssistantReasoningEvent.java index 9b69fedac1..52996aeeed 100644 --- a/java/src/generated/java/com/github/copilot/generated/AssistantReasoningEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/AssistantReasoningEvent.java @@ -37,7 +37,8 @@ public record AssistantReasoningEventData( /** Unique identifier for this reasoning block */ @JsonProperty("reasoningId") String reasoningId, /** The complete extended thinking text from the model */ - @JsonProperty("content") String content + @JsonProperty("content") String content, + @JsonProperty("rte") Boolean rte ) { } } diff --git a/java/src/generated/java/com/github/copilot/generated/AssistantUsageEvent.java b/java/src/generated/java/com/github/copilot/generated/AssistantUsageEvent.java index 47bfcbb4c7..a7de95bb4b 100644 --- a/java/src/generated/java/com/github/copilot/generated/AssistantUsageEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/AssistantUsageEvent.java @@ -60,12 +60,15 @@ public record AssistantUsageEventData( @JsonProperty("interTokenLatencyMs") Double interTokenLatencyMs, /** What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls */ @JsonProperty("initiator") String initiator, + /** 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. */ + @JsonProperty("interactionType") String interactionType, /** Completion ID from the model provider (e.g., chatcmpl-abc123) */ @JsonProperty("apiCallId") String apiCallId, /** GitHub request tracing ID (x-github-request-id header) for server-side log correlation */ @JsonProperty("providerCallId") String providerCallId, /** Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */ @JsonProperty("serviceRequestId") String serviceRequestId, + @JsonProperty("rte") Boolean rte, /** API endpoint used for this model call, matching CAPI supported_endpoints vocabulary */ @JsonProperty("apiEndpoint") AssistantUsageApiEndpoint apiEndpoint, /** Parent tool call ID when this usage originates from a sub-agent */ diff --git a/java/src/generated/java/com/github/copilot/generated/FactoryRunUpdatedEvent.java b/java/src/generated/java/com/github/copilot/generated/FactoryRunUpdatedEvent.java new file mode 100644 index 0000000000..e9abb1053a --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/FactoryRunUpdatedEvent.java @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "factory.run_updated". Ephemeral invalidation signal for a changed factory run. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class FactoryRunUpdatedEvent extends SessionEvent { + + @Override + public String getType() { return "factory.run_updated"; } + + @JsonProperty("data") + private FactoryRunUpdatedEventData data; + + public FactoryRunUpdatedEventData getData() { return data; } + public void setData(FactoryRunUpdatedEventData data) { this.data = data; } + + /** Data payload for {@link FactoryRunUpdatedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record FactoryRunUpdatedEventData( + @JsonProperty("runId") String runId, + /** Monotonic revision now available for the run. */ + @JsonProperty("revision") Long revision + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java b/java/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java index 25c011fe33..f6c399b4c3 100644 --- a/java/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java @@ -45,6 +45,7 @@ public record ModelCallFailureEventData( @JsonProperty("providerCallId") String providerCallId, /** Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */ @JsonProperty("serviceRequestId") String serviceRequestId, + @JsonProperty("rte") Boolean rte, /** HTTP status code from the failed request */ @JsonProperty("statusCode") Long statusCode, /** Duration of the failed API call in milliseconds */ diff --git a/java/src/generated/java/com/github/copilot/generated/ModelCallStartEvent.java b/java/src/generated/java/com/github/copilot/generated/ModelCallStartEvent.java index 6ab9fa5477..9f00e2ac2f 100644 --- a/java/src/generated/java/com/github/copilot/generated/ModelCallStartEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/ModelCallStartEvent.java @@ -37,7 +37,9 @@ public record ModelCallStartEventData( /** Identifier of the assistant turn that initiated the model call */ @JsonProperty("turnId") String turnId, /** Model identifier used for this API call, when known */ - @JsonProperty("model") String model + @JsonProperty("model") String model, + /** Previous response or interaction identifier included in the model request, when present */ + @JsonProperty("previousResponseId") String previousResponseId ) { } } diff --git a/java/src/generated/java/com/github/copilot/generated/ScheduleOrigin.java b/java/src/generated/java/com/github/copilot/generated/ScheduleOrigin.java new file mode 100644 index 0000000000..cba65eadb5 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/ScheduleOrigin.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * 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. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ScheduleOrigin { + /** The {@code user} variant. */ + USER("user"), + /** The {@code model} variant. */ + MODEL("model"); + + private final String value; + ScheduleOrigin(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ScheduleOrigin fromValue(String value) { + for (ScheduleOrigin v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ScheduleOrigin value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionEvent.java index 162572b037..adef027ada 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionEvent.java @@ -122,6 +122,7 @@ @JsonSubTypes.Type(value = ExitPlanModeCompletedEvent.class, name = "exit_plan_mode.completed"), @JsonSubTypes.Type(value = SessionToolsUpdatedEvent.class, name = "session.tools_updated"), @JsonSubTypes.Type(value = SessionBackgroundTasksChangedEvent.class, name = "session.background_tasks_changed"), + @JsonSubTypes.Type(value = FactoryRunUpdatedEvent.class, name = "factory.run_updated"), @JsonSubTypes.Type(value = SessionSkillsLoadedEvent.class, name = "session.skills_loaded"), @JsonSubTypes.Type(value = SessionCustomAgentsUpdatedEvent.class, name = "session.custom_agents_updated"), @JsonSubTypes.Type(value = SessionMcpServersLoadedEvent.class, name = "session.mcp_servers_loaded"), @@ -238,6 +239,7 @@ public abstract sealed class SessionEvent permits ExitPlanModeCompletedEvent, SessionToolsUpdatedEvent, SessionBackgroundTasksChangedEvent, + FactoryRunUpdatedEvent, SessionSkillsLoadedEvent, SessionCustomAgentsUpdatedEvent, SessionMcpServersLoadedEvent, diff --git a/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java index 6efac46f27..a3f39d7696 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java @@ -57,11 +57,11 @@ public record SessionResumeEventData( @JsonProperty("context") WorkingDirectoryContext context, /** Whether the session was already in use by another client at resume time */ @JsonProperty("alreadyInUse") Boolean alreadyInUse, - /** True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. */ + /** True when this resume passively joined a session that already had live work running in the runtime - an agent turn, a native queue run, a queued resume continuation, or an in-flight send (for example, an extension joining a session another client was actively driving). False (or omitted) when the session had no live work or when the resume explicitly abandoned pending work, including cold resumes and suspended sessions that remain resident in memory. */ @JsonProperty("sessionWasActive") Boolean sessionWasActive, /** Whether this session supports remote steering via GitHub */ @JsonProperty("remoteSteerable") Boolean remoteSteerable, - /** When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume. */ + /** When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false or omitted, pending work is normally marked as interrupted unless the resume passively joined live work owned by another client; sessionWasActive distinguishes that case. */ @JsonProperty("continuePendingWork") Boolean continuePendingWork ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java index 435a8501e8..cc0b3b165d 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java @@ -51,7 +51,9 @@ public record SessionScheduleCreatedEventData( /** True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled rather than auto-computed. */ @JsonProperty("selfPaced") Boolean selfPaced, /** Optional user-facing label shown in the timeline instead of the actual prompt (e.g. `/skill-name args` when the prompt is a skill invocation expansion) */ - @JsonProperty("displayPrompt") String displayPrompt + @JsonProperty("displayPrompt") String displayPrompt, + /** 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. */ + @JsonProperty("origin") ScheduleOrigin origin ) { } } diff --git a/java/src/generated/java/com/github/copilot/generated/SystemMessageEvent.java b/java/src/generated/java/com/github/copilot/generated/SystemMessageEvent.java index a6248a7fee..315e9e8bb6 100644 --- a/java/src/generated/java/com/github/copilot/generated/SystemMessageEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SystemMessageEvent.java @@ -36,6 +36,8 @@ public final class SystemMessageEvent extends SessionEvent { public record SystemMessageEventData( /** The system or developer prompt text sent as model input */ @JsonProperty("content") String content, + /** Logical interaction identifier for the model run receiving this prompt */ + @JsonProperty("interactionId") String interactionId, /** Message role: "system" for system prompts, "developer" for developer-injected instructions */ @JsonProperty("role") SystemMessageRole role, /** Optional name identifier for the message source */ diff --git a/java/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java b/java/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java index 99d138b1e6..a265b5305e 100644 --- a/java/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java @@ -45,6 +45,7 @@ public record ToolExecutionCompleteEventData( @JsonProperty("mcpMeta") Object mcpMeta, /** CAPI interaction ID for correlating this tool execution with upstream telemetry */ @JsonProperty("interactionId") String interactionId, + @JsonProperty("rte") Boolean rte, /** Whether this tool call was explicitly requested by the user rather than the assistant */ @JsonProperty("isUserRequested") Boolean isUserRequested, /** Tool execution result on success */ diff --git a/java/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java b/java/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java index b119a3eb0e..782e93931f 100644 --- a/java/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java @@ -44,6 +44,7 @@ public record ToolExecutionStartEventData( @JsonProperty("shellToolInfo") ToolExecutionStartShellToolInfo shellToolInfo, /** Model identifier that generated this tool call */ @JsonProperty("model") String model, + @JsonProperty("rte") Boolean rte, /** Name of the MCP server hosting this tool, when the tool is an MCP tool */ @JsonProperty("mcpServerName") String mcpServerName, /** Original tool name on the MCP server, when the tool is an MCP tool */ diff --git a/java/src/generated/java/com/github/copilot/generated/UserMessageEvent.java b/java/src/generated/java/com/github/copilot/generated/UserMessageEvent.java index 5af4842430..bc579968b3 100644 --- a/java/src/generated/java/com/github/copilot/generated/UserMessageEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/UserMessageEvent.java @@ -45,7 +45,7 @@ public record UserMessageEventData( @JsonProperty("supportedNativeDocumentMimeTypes") List supportedNativeDocumentMimeTypes, /** Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit */ @JsonProperty("nativeDocumentPathFallbackPaths") List nativeDocumentPathFallbackPaths, - /** 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) */ @JsonProperty("source") String source, /** How this message was delivered to the agentic loop relative to loop state (idle-start vs. steering/queued while busy). The timing axis; combine with `source` (origin) for the full picture. Used for telemetry attribution. */ @JsonProperty("delivery") UserMessageDelivery delivery, diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/BuiltInModelCatalogEntry.java b/java/src/generated/java/com/github/copilot/generated/rpc/BuiltInModelCatalogEntry.java new file mode 100644 index 0000000000..679278356e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/BuiltInModelCatalogEntry.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * A well-known model in the runtime's built-in catalog. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record BuiltInModelCatalogEntry( + /** Well-known runtime model ID suitable for `ProviderConfig.modelId` or `ProviderModelConfig.modelId`. This is not necessarily the provider-facing deployment or model name and does not indicate CAPI entitlement or provider availability. */ + @JsonProperty("id") String id +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java index 491dadad37..19172cb1b4 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java @@ -26,7 +26,7 @@ public record ConnectParams( /** Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN */ @JsonProperty("token") String 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. */ @JsonProperty("enableGitHubTelemetryForwarding") Boolean enableGitHubTelemetryForwarding ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ContentExclusionPathCheck.java b/java/src/generated/java/com/github/copilot/generated/rpc/ContentExclusionPathCheck.java new file mode 100644 index 0000000000..ba48326c2e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ContentExclusionPathCheck.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Content-exclusion decision for one requested path. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ContentExclusionPathCheck( + /** The path supplied by the caller. */ + @JsonProperty("path") String path, + /** Whether the session's complete content-exclusion policy excludes the path. */ + @JsonProperty("excluded") Boolean excluded +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentSummary.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentSummary.java new file mode 100644 index 0000000000..af20d8e810 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentSummary.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Prompt-safe durable identity and live status for a direct factory agent. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FactoryAgentSummary( + @JsonProperty("agentId") String agentId, + @JsonProperty("toolCallId") String toolCallId, + @JsonProperty("runId") String runId, + @JsonProperty("phaseId") String phaseId, + @JsonProperty("label") String label, + @JsonProperty("agentType") String agentType, + @JsonProperty("status") String status, + @JsonProperty("requestedModel") String requestedModel, + @JsonProperty("resolvedModel") String resolvedModel, + @JsonProperty("startedAt") Long startedAt, + @JsonProperty("completedAt") Long completedAt, + @JsonProperty("activeMs") Long activeMs, + @JsonProperty("activity") String activity +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryCurrentPhase.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryCurrentPhase.java new file mode 100644 index 0000000000..6a8de8e82c --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryCurrentPhase.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Current factory phase identity. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FactoryCurrentPhase( + @JsonProperty("id") String id, + @JsonProperty("ordinal") Long ordinal +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryDeclaredLimits.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryDeclaredLimits.java new file mode 100644 index 0000000000..21f74646fb --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryDeclaredLimits.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Declared or approved factory resource ceilings. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FactoryDeclaredLimits( + @JsonProperty("maxConcurrentSubagents") Long maxConcurrentSubagents, + @JsonProperty("maxTotalSubagents") Long maxTotalSubagents, + @JsonProperty("timeoutSeconds") Double timeoutSeconds, + @JsonProperty("maxAiCredits") Double maxAiCredits +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryExecuteParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryExecuteParams.java index e6f4538146..6834dd4b12 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryExecuteParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryExecuteParams.java @@ -30,6 +30,8 @@ public record FactoryExecuteParams( @JsonProperty("name") String name, /** Factory run identifier. */ @JsonProperty("runId") String runId, + /** Opaque token identifying this factory execution attempt. */ + @JsonProperty("executionToken") String executionToken, /** Factory input value. */ @JsonProperty("args") Object args ) { diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseObservation.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseObservation.java new file mode 100644 index 0000000000..aa04ef5ba8 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseObservation.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Durable lifecycle and timing for one factory phase. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FactoryPhaseObservation( + @JsonProperty("id") String id, + @JsonProperty("ordinal") Long ordinal, + @JsonProperty("title") String title, + @JsonProperty("detail") String detail, + @JsonProperty("status") FactoryPhaseStatus status, + @JsonProperty("lastEnteredRunAttempt") Long lastEnteredRunAttempt, + @JsonProperty("entryCount") Long entryCount, + @JsonProperty("startedAt") Long startedAt, + @JsonProperty("completedAt") Long completedAt, + @JsonProperty("accumulatedActiveMs") Long accumulatedActiveMs, + @JsonProperty("currentActiveMs") Long currentActiveMs, + @JsonProperty("totalAgentCount") Long totalAgentCount, + @JsonProperty("liveAgentCount") Long liveAgentCount +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseStatus.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseStatus.java new file mode 100644 index 0000000000..d9fea0bc36 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseStatus.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Derived lifecycle state of a factory phase. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FactoryPhaseStatus { + /** The {@code pending} variant. */ + PENDING("pending"), + /** The {@code active} variant. */ + ACTIVE("active"), + /** The {@code completed} variant. */ + COMPLETED("completed"), + /** The {@code skipped} variant. */ + SKIPPED("skipped"); + + private final String value; + FactoryPhaseStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FactoryPhaseStatus fromValue(String value) { + for (FactoryPhaseStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FactoryPhaseStatus value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressLine.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressLine.java new file mode 100644 index 0000000000..3a26b67d79 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressLine.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * One durable factory progress record. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FactoryProgressLine( + /** Global monotonic sequence number within the run. */ + @JsonProperty("seq") Long seq, + /** Resume attempt that emitted this record. */ + @JsonProperty("attempt") Long attempt, + /** Phase active when the record was emitted, or null before any phase. */ + @JsonProperty("phaseId") String phaseId, + /** Epoch milliseconds when the record was persisted. */ + @JsonProperty("recordedAt") Long recordedAt, + /** Progress record kind. */ + @JsonProperty("kind") FactoryLogLineKind kind, + /** Prompt-safe progress text. */ + @JsonProperty("text") String text +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressPage.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressPage.java new file mode 100644 index 0000000000..56732d8f47 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressPage.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * A bidirectional page of factory progress. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FactoryProgressPage( + @JsonProperty("records") List records, + @JsonProperty("oldestSeq") Long oldestSeq, + @JsonProperty("newestSeq") Long newestSeq, + @JsonProperty("hasMoreOlder") Boolean hasMoreOlder, + @JsonProperty("hasMoreNewer") Boolean hasMoreNewer, + /** Run revision reflected by this page. */ + @JsonProperty("revision") Long revision +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunConsumed.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunConsumed.java new file mode 100644 index 0000000000..62cec5f730 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunConsumed.java @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Durable factory resource consumption. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FactoryRunConsumed( + @JsonProperty("activeMs") Long activeMs, + @JsonProperty("subagents") Long subagents, + @JsonProperty("nanoAiu") Long nanoAiu +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunLimits.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunLimits.java index ede598b806..79304772a0 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunLimits.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunLimits.java @@ -25,7 +25,9 @@ public record FactoryRunLimits( @JsonProperty("maxConcurrentSubagents") Long maxConcurrentSubagents, /** Maximum total number of factory subagents that may be admitted. */ @JsonProperty("maxTotalSubagents") Long maxTotalSubagents, - /** Factory active-run timeout in milliseconds. */ - @JsonProperty("timeout") Double timeout + /** 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. */ + @JsonProperty("timeoutSeconds") Double timeoutSeconds, + /** 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. */ + @JsonProperty("maxAiCredits") Double maxAiCredits ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java new file mode 100644 index 0000000000..bb28f40887 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunResult.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Complete current or terminal factory run envelope. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FactoryRunResult( + /** Factory run identifier. */ + @JsonProperty("runId") String runId, + /** Current or terminal factory run status. */ + @JsonProperty("status") FactoryRunStatus status, + /** Completed factory result. */ + @JsonProperty("result") Object result, + /** Error message for an errored run. */ + @JsonProperty("error") String error, + /** Machine-readable failure details for an errored run. */ + @JsonProperty("failure") Object failure, + /** Reason for a halted or cancelled run. */ + @JsonProperty("reason") String reason, + /** Partial journal and progress snapshot for a halted, cancelled, or errored run. */ + @JsonProperty("snapshot") Object snapshot +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java new file mode 100644 index 0000000000..fb90885ee4 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Durable factory run summary with read-time live overlays. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FactoryRunSummary( + @JsonProperty("runId") String runId, + @JsonProperty("factoryName") String factoryName, + @JsonProperty("description") String description, + @JsonProperty("status") FactoryRunStatus status, + @JsonProperty("revision") Long revision, + @JsonProperty("createdAt") Long createdAt, + @JsonProperty("startedAt") Long startedAt, + @JsonProperty("updatedAt") Long updatedAt, + @JsonProperty("completedAt") Long completedAt, + @JsonProperty("currentPhase") FactoryCurrentPhase currentPhase, + @JsonProperty("declaredPhaseCount") Long declaredPhaseCount, + @JsonProperty("liveAgentCount") Long liveAgentCount, + @JsonProperty("totalSpawnedAgentCount") Long totalSpawnedAgentCount, + @JsonProperty("consumed") FactoryRunConsumed consumed, + @JsonProperty("declaredLimits") FactoryDeclaredLimits declaredLimits, + @JsonProperty("approved") FactoryDeclaredLimits approved, + @JsonProperty("observedAt") Long observedAt, + @JsonProperty("activeSegmentStartedAt") Long activeSegmentStartedAt, + @JsonProperty("terminal") FactoryRunTerminal terminal +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java new file mode 100644 index 0000000000..231c1b8a11 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/FactoryRunTerminal.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Prompt-safe terminal factory outcome. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FactoryRunTerminal( + @JsonProperty("reason") String reason, + @JsonProperty("failure") Object failure, + @JsonProperty("error") String error, + @JsonProperty("resultPreview") String resultPreview +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/HistoryFileRestoreSkipReason.java b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryFileRestoreSkipReason.java new file mode 100644 index 0000000000..46e943e016 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryFileRestoreSkipReason.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Reason a captured file was not restored. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HistoryFileRestoreSkipReason { + /** The {@code user-modified} variant. */ + USER_MODIFIED("user-modified"), + /** The {@code skipped-capture} variant. */ + SKIPPED_CAPTURE("skipped-capture"); + + private final String value; + HistoryFileRestoreSkipReason(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HistoryFileRestoreSkipReason fromValue(String value) { + for (HistoryFileRestoreSkipReason v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HistoryFileRestoreSkipReason value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindChangeType.java b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindChangeType.java new file mode 100644 index 0000000000..85b12b873f --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindChangeType.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Aggregate file change represented by a rewind preview. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HistoryRewindChangeType { + /** The {@code created} variant. */ + CREATED("created"), + /** The {@code deleted} variant. */ + DELETED("deleted"), + /** The {@code modified} variant. */ + MODIFIED("modified"); + + private final String value; + HistoryRewindChangeType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HistoryRewindChangeType fromValue(String value) { + for (HistoryRewindChangeType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HistoryRewindChangeType value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindFilePreview.java b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindFilePreview.java new file mode 100644 index 0000000000..7733246dd0 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindFilePreview.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * A file that a conversation-and-files rewind would restore. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record HistoryRewindFilePreview( + /** Absolute path of the captured file. */ + @JsonProperty("path") String path, + /** Aggregate change made across the discarded turns. */ + @JsonProperty("changeType") HistoryRewindChangeType changeType, + /** Lines added across the discarded turns. */ + @JsonProperty("linesAdded") Long linesAdded, + /** Lines removed across the discarded turns. */ + @JsonProperty("linesRemoved") Long linesRemoved +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindMode.java b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindMode.java new file mode 100644 index 0000000000..f72ded947a --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindMode.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Scope of a rewind operation. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HistoryRewindMode { + /** The {@code conversation} variant. */ + CONVERSATION("conversation"), + /** The {@code conversation-and-files} variant. */ + CONVERSATION_AND_FILES("conversation-and-files"); + + private final String value; + HistoryRewindMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HistoryRewindMode fromValue(String value) { + for (HistoryRewindMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HistoryRewindMode value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindOutcome.java b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindOutcome.java new file mode 100644 index 0000000000..624795ee4e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindOutcome.java @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Outcome of a rewind request. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HistoryRewindOutcome { + /** The {@code success} variant. */ + SUCCESS("success"), + /** The {@code session-busy} variant. */ + SESSION_BUSY("session-busy"), + /** The {@code file-change-tracking-disabled} variant. */ + FILE_CHANGE_TRACKING_DISABLED("file-change-tracking-disabled"), + /** The {@code unsupported-remote-session} variant. */ + UNSUPPORTED_REMOTE_SESSION("unsupported-remote-session"), + /** The {@code files-rolled-back} variant. */ + FILES_ROLLED_BACK("files-rolled-back"), + /** The {@code rollback-incomplete} variant. */ + ROLLBACK_INCOMPLETE("rollback-incomplete"), + /** The {@code truncation-failed} variant. */ + TRUNCATION_FAILED("truncation-failed"), + /** The {@code checkpoint-cleanup-failed} variant. */ + CHECKPOINT_CLEANUP_FAILED("checkpoint-cleanup-failed"), + /** The {@code snapshot-prune-failed} variant. */ + SNAPSHOT_PRUNE_FAILED("snapshot-prune-failed"); + + private final String value; + HistoryRewindOutcome(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HistoryRewindOutcome fromValue(String value) { + for (HistoryRewindOutcome v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HistoryRewindOutcome value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindPoint.java b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindPoint.java new file mode 100644 index 0000000000..84926c74e0 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindPoint.java @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * A root user turn that the session can rewind to. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record HistoryRewindPoint( + /** ID of the user.message event that begins the discarded suffix. */ + @JsonProperty("eventId") String eventId, + /** User-visible message text for the turn. */ + @JsonProperty("userMessage") String userMessage, + /** ISO timestamp of the user turn. */ + @JsonProperty("timestamp") String timestamp, + /** Whether at least one file in this turn or a later turn can be restored. */ + @JsonProperty("canRestoreFiles") Boolean canRestoreFiles, + /** Number of unique files in this turn and all later turns that have captured changes. */ + @JsonProperty("fileCount") Long fileCount, + /** Whether this turn itself captured any file changes. */ + @JsonProperty("turnChangedFiles") Boolean turnChangedFiles, + /** Lines added by this turn's captured file changes. */ + @JsonProperty("linesAdded") Long linesAdded, + /** Lines removed by this turn's captured file changes. */ + @JsonProperty("linesRemoved") Long linesRemoved, + /** Whether this turn was an automatically injected autopilot continuation. */ + @JsonProperty("isAutopilotContinuation") Boolean isAutopilotContinuation +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindUnavailableReason.java b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindUnavailableReason.java new file mode 100644 index 0000000000..ae6b029ac4 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/HistoryRewindUnavailableReason.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Reason a rewind read (rewind points, file-restore preview, or session diff) could not be answered from the session's file-change captures. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HistoryRewindUnavailableReason { + /** The {@code file-change-tracking-disabled} variant. */ + FILE_CHANGE_TRACKING_DISABLED("file-change-tracking-disabled"), + /** The {@code session-busy} variant. */ + SESSION_BUSY("session-busy"), + /** The {@code unsupported-remote-session} variant. */ + UNSUPPORTED_REMOTE_SESSION("unsupported-remote-session"); + + private final String value; + HistoryRewindUnavailableReason(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HistoryRewindUnavailableReason fromValue(String value) { + for (HistoryRewindUnavailableReason v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HistoryRewindUnavailableReason value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/HistorySkippedFileRestore.java b/java/src/generated/java/com/github/copilot/generated/rpc/HistorySkippedFileRestore.java new file mode 100644 index 0000000000..60c8c2d40c --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/HistorySkippedFileRestore.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * A captured file that rewind intentionally left unchanged. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record HistorySkippedFileRestore( + /** Absolute path of the skipped file. */ + @JsonProperty("path") String path, + /** Reason the file was not restored. */ + @JsonProperty("reason") HistoryFileRestoreSkipReason reason +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ModelsGetBuiltInCatalogResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/ModelsGetBuiltInCatalogResult.java new file mode 100644 index 0000000000..9797a2d67f --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ModelsGetBuiltInCatalogResult.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelsGetBuiltInCatalogResult( + /** Built-in model entries. */ + @JsonProperty("models") List models +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SendMessageItem.java b/java/src/generated/java/com/github/copilot/generated/rpc/SendMessageItem.java index bdb37cd9fd..4a6696c01d 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SendMessageItem.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SendMessageItem.java @@ -32,7 +32,7 @@ public record SendMessageItem( @JsonProperty("billable") Boolean 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 */ @JsonProperty("requiredTool") String requiredTool, - /** 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. */ @JsonProperty("source") String source ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ServerModelsApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/ServerModelsApi.java index 64ccc62cde..ad3d04ce9f 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ServerModelsApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ServerModelsApi.java @@ -37,4 +37,15 @@ public CompletableFuture list() { return caller.invoke("models.list", java.util.Map.of(), ModelsListResult.class); } + /** + * The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture getBuiltInCatalog() { + return caller.invoke("models.getBuiltInCatalog", java.util.Map.of(), ModelsGetBuiltInCatalogResult.class); + } + } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java index 7e3b4d90d8..1288cfb94e 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java @@ -70,6 +70,28 @@ public CompletableFuture list() { return caller.invoke("sessions.list", java.util.Map.of(), SessionsListResult.class); } + /** + * Session ID whose persisted metadata should be read. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture getMetadata(SessionsGetMetadataParams params) { + return caller.invoke("sessions.getMetadata", params, SessionsGetMetadataResult.class); + } + + /** + * Limit for non-empty local session IDs. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture listNonEmptySessionIds(SessionsListNonEmptySessionIdsParams params) { + return caller.invoke("sessions.listNonEmptySessionIds", params, SessionsListNonEmptySessionIdsResult.class); + } + /** * GitHub task ID to look up. * @@ -169,6 +191,17 @@ public CompletableFuture bulkDelete(SessionsBulkDelete return caller.invoke("sessions.bulkDelete", params, SessionsBulkDeleteResult.class); } + /** + * Session ID to delete from disk. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture delete(SessionsDeleteParams params) { + return caller.invoke("sessions.delete", params, Void.class); + } + /** * Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true). * diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCancelAllBackgroundAgentsParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCancelAllBackgroundAgentsParams.java new file mode 100644 index 0000000000..0851f331ee --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCancelAllBackgroundAgentsParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCancelAllBackgroundAgentsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionApi.java new file mode 100644 index 0000000000..eb621e6b49 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionApi.java @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.github.copilot.CopilotExperimental; +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code contentExclusion} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionContentExclusionApi { + + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + + private final RpcCaller caller; + private final String sessionId; + + /** @param caller the RPC transport function */ + SessionContentExclusionApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Local file system absolute paths within the session working directory to check against its content-exclusion policy. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture checkPaths(SessionContentExclusionCheckPathsParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.contentExclusion.checkPaths", _p, SessionContentExclusionCheckPathsResult.class); + } + +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionCheckPathsParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionCheckPathsParams.java new file mode 100644 index 0000000000..0c61f6c910 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionCheckPathsParams.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Local file system absolute paths within the session working directory to check against its content-exclusion policy. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionContentExclusionCheckPathsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates. */ + @JsonProperty("paths") List paths +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionCheckPathsResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionCheckPathsResult.java new file mode 100644 index 0000000000..956ffc44d3 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionContentExclusionCheckPathsResult.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionContentExclusionCheckPathsResult( + /** Whether the session's policy service was available for the complete batch. When false, checks is empty and callers must treat every requested path as excluded. */ + @JsonProperty("available") Boolean available, + /** Per-path decisions in request order. Empty when available is false. */ + @JsonProperty("checks") List checks +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryAgentParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryAgentParams.java index 7f31066fc4..6ab02c27eb 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryAgentParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryAgentParams.java @@ -28,6 +28,8 @@ public record SessionFactoryAgentParams( @JsonProperty("sessionId") String sessionId, /** Factory run identifier that owns the subagent. */ @JsonProperty("factoryRunId") String factoryRunId, + /** Opaque token identifying the current factory execution attempt. */ + @JsonProperty("executionToken") String executionToken, /** Prompt to send to the subagent. */ @JsonProperty("prompt") String prompt, /** Subagent execution options. */ diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java index 703a2e711e..6d15ac17c3 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryApi.java @@ -50,6 +50,22 @@ public CompletableFuture run(SessionFactoryRunParams pa return caller.invoke("session.factory.run", _p, SessionFactoryRunResult.class); } + /** + * Parameters for resuming a factory run from its persisted identity. + *

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

@@ -66,6 +82,49 @@ public CompletableFuture getRun(SessionFactoryGetRun return caller.invoke("session.factory.getRun", _p, SessionFactoryGetRunResult.class); } + /** + * Empty parameters for listing factory runs. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture listRuns() { + return caller.invoke("session.factory.listRuns", java.util.Map.of("sessionId", this.sessionId), SessionFactoryListRunsResult.class); + } + + /** + * Parameters for retrieving a factory run. + *

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

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

diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailParams.java new file mode 100644 index 0000000000..b4563d4b35 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Parameters for retrieving a factory run. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFactoryGetRunDetailParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Factory run identifier. */ + @JsonProperty("runId") String runId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java new file mode 100644 index 0000000000..5da6f4979c --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Full factory run observability detail. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFactoryGetRunDetailResult( + @JsonProperty("runId") String runId, + @JsonProperty("factoryName") String factoryName, + @JsonProperty("description") String description, + @JsonProperty("status") FactoryRunStatus status, + @JsonProperty("revision") Long revision, + @JsonProperty("createdAt") Long createdAt, + @JsonProperty("startedAt") Long startedAt, + @JsonProperty("updatedAt") Long updatedAt, + @JsonProperty("completedAt") Long completedAt, + @JsonProperty("currentPhase") FactoryCurrentPhase currentPhase, + @JsonProperty("declaredPhaseCount") Long declaredPhaseCount, + @JsonProperty("liveAgentCount") Long liveAgentCount, + @JsonProperty("totalSpawnedAgentCount") Long totalSpawnedAgentCount, + @JsonProperty("consumed") FactoryRunConsumed consumed, + @JsonProperty("declaredLimits") FactoryDeclaredLimits declaredLimits, + @JsonProperty("approved") FactoryDeclaredLimits approved, + @JsonProperty("observedAt") Long observedAt, + @JsonProperty("activeSegmentStartedAt") Long activeSegmentStartedAt, + @JsonProperty("terminal") FactoryRunTerminal terminal, + @JsonProperty("phases") List phases, + @JsonProperty("agents") List agents, + @JsonProperty("progress") FactoryProgressPage progress +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressParams.java new file mode 100644 index 0000000000..8445943cba --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressParams.java @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Parameters for paging factory progress. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFactoryGetRunProgressParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Factory run identifier. */ + @JsonProperty("runId") String runId, + /** Optional phase identifier used to scope records and cursors. */ + @JsonProperty("phaseId") String phaseId, + /** Exclusive forward cursor. */ + @JsonProperty("afterSeq") Long afterSeq, + /** Exclusive backward cursor. */ + @JsonProperty("beforeSeq") Long beforeSeq, + /** Maximum records to return. Defaults to 200 and is capped at 500. */ + @JsonProperty("limit") Long limit +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressResult.java new file mode 100644 index 0000000000..369fa07c22 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressResult.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * A bidirectional page of factory progress. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFactoryGetRunProgressResult( + @JsonProperty("records") List records, + @JsonProperty("oldestSeq") Long oldestSeq, + @JsonProperty("newestSeq") Long newestSeq, + @JsonProperty("hasMoreOlder") Boolean hasMoreOlder, + @JsonProperty("hasMoreNewer") Boolean hasMoreNewer, + /** Run revision reflected by this page. */ + @JsonProperty("revision") Long revision +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryJournalGetParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryJournalGetParams.java index a9b0acc7c1..251ca946cb 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryJournalGetParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryJournalGetParams.java @@ -28,6 +28,8 @@ public record SessionFactoryJournalGetParams( @JsonProperty("sessionId") String sessionId, /** Factory run identifier. */ @JsonProperty("runId") String runId, + /** Opaque token identifying the current factory execution attempt. */ + @JsonProperty("executionToken") String executionToken, /** Namespaced journal key. */ @JsonProperty("key") String key ) { diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryJournalPutParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryJournalPutParams.java index 84478dbb7d..06467b2657 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryJournalPutParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryJournalPutParams.java @@ -28,6 +28,8 @@ public record SessionFactoryJournalPutParams( @JsonProperty("sessionId") String sessionId, /** Factory run identifier. */ @JsonProperty("runId") String runId, + /** Opaque token identifying the current factory execution attempt. */ + @JsonProperty("executionToken") String executionToken, /** Namespaced journal key. */ @JsonProperty("key") String key, /** JSON result to memoize. */ diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryListRunsParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryListRunsParams.java new file mode 100644 index 0000000000..e3b90f07f7 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryListRunsParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Empty parameters for listing factory runs. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFactoryListRunsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryListRunsResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryListRunsResult.java new file mode 100644 index 0000000000..7d1ac45a9e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryListRunsResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Factory runs in durable creation order. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFactoryListRunsResult( + @JsonProperty("runs") List runs +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryLogParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryLogParams.java index 7618869e33..b4f52617f1 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryLogParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryLogParams.java @@ -29,6 +29,8 @@ public record SessionFactoryLogParams( @JsonProperty("sessionId") String sessionId, /** Factory run identifier. */ @JsonProperty("runId") String runId, + /** Opaque token identifying the current factory execution attempt. */ + @JsonProperty("executionToken") String executionToken, /** Ordered progress lines to append. */ @JsonProperty("lines") List lines ) { diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryResumeParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryResumeParams.java new file mode 100644 index 0000000000..9c264284fc --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryResumeParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Parameters for resuming a factory run from its persisted identity. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFactoryResumeParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Factory run identifier. */ + @JsonProperty("runId") String runId, + /** Optional per-invocation resource ceiling overrides. */ + @JsonProperty("limits") FactoryRunLimits limits +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryResumeResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryResumeResult.java new file mode 100644 index 0000000000..b4cfcae116 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryResumeResult.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Resolved persisted factory identity and resumed run envelope. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFactoryResumeResult( + /** Persisted factory name resolved for the resumed run. */ + @JsonProperty("factoryName") String factoryName, + /** Terminal resumed run envelope. */ + @JsonProperty("run") FactoryRunResult run +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryParams.java index 47e30ebca5..9258635886 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryParams.java @@ -15,7 +15,7 @@ import javax.annotation.processing.Generated; /** - * 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. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryResult.java index 53370c0984..ff14d3ec1b 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryResult.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryResult.java @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.github.copilot.CopilotExperimental; import java.util.List; import java.util.Map; import javax.annotation.processing.Generated; @@ -18,10 +17,8 @@ /** * Query results including rows, columns, and rows affected, or a filesystem error if execution failed. * - * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ -@CopilotExperimental @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionError.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionError.java new file mode 100644 index 0000000000..cbe170a298 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionError.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Classified SQLite transaction failure. busyOrLocked guarantees rollback; postCommitAmbiguous must never be retried. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSqliteTransactionError( + @JsonProperty("errorClass") SessionFsSqliteTransactionErrorClass errorClass, + @JsonProperty("message") String message +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionErrorClass.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionErrorClass.java new file mode 100644 index 0000000000..4e184a19a4 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionErrorClass.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * SQLite transaction failure classification. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SessionFsSqliteTransactionErrorClass { + /** The {@code busyOrLocked} variant. */ + BUSYORLOCKED("busyOrLocked"), + /** The {@code fatal} variant. */ + FATAL("fatal"), + /** The {@code postCommitAmbiguous} variant. */ + POSTCOMMITAMBIGUOUS("postCommitAmbiguous"); + + private final String value; + SessionFsSqliteTransactionErrorClass(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionFsSqliteTransactionErrorClass fromValue(String value) { + for (SessionFsSqliteTransactionErrorClass v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionFsSqliteTransactionErrorClass value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionParams.java new file mode 100644 index 0000000000..f834d55957 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Statements to execute atomically. Providers apply busy handling for every call. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSqliteTransactionParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + @JsonProperty("statements") List statements +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionResult.java new file mode 100644 index 0000000000..f9c799b9b2 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionResult.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Per-statement results, or a classified transaction error. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSqliteTransactionResult( + @JsonProperty("results") List results, + @JsonProperty("error") SessionFsSqliteTransactionError error +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionStatement.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionStatement.java new file mode 100644 index 0000000000..f56f268ba1 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteTransactionStatement.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * One statement in an atomic SQLite transaction. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSqliteTransactionStatement( + /** SQL statement to execute. */ + @JsonProperty("query") String query, + /** How to execute the statement. */ + @JsonProperty("queryType") SessionFsSqliteQueryType queryType, + /** Optional named bind parameters. */ + @JsonProperty("params") Map params +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryApi.java index fa2f47b38b..003d24776c 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryApi.java @@ -57,6 +57,49 @@ public CompletableFuture truncate(SessionHistoryTr return caller.invoke("session.history.truncate", _p, SessionHistoryTruncateResult.class); } + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture listRewindPoints() { + return caller.invoke("session.history.listRewindPoints", java.util.Map.of("sessionId", this.sessionId), SessionHistoryListRewindPointsResult.class); + } + + /** + * Event boundary to preview for conversation-and-files rewind. + *

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

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture rewind(SessionHistoryRewindParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.history.rewind", _p, SessionHistoryRewindResult.class); + } + /** * Identifies the target session. * diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryListRewindPointsParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryListRewindPointsParams.java new file mode 100644 index 0000000000..d780d76b38 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryListRewindPointsParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryListRewindPointsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryListRewindPointsResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryListRewindPointsResult.java new file mode 100644 index 0000000000..99dcc0fabf --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryListRewindPointsResult.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Rewind points and file-change-tracking availability for the session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryListRewindPointsResult( + /** Whether this session captured file changes from its first turn. */ + @JsonProperty("fileChangeTrackingEnabled") Boolean fileChangeTrackingEnabled, + /** Why the listed points could not be produced, when applicable; the points list is empty whenever it is set. `unsupported-remote-session` is permanent for the session and comes with `fileChangeTrackingEnabled: false`. `session-busy` is transient and only ever reported by a session that *is* tracking (`fileChangeTrackingEnabled: true`), because the file-change captures cannot be read while work that may still mutate them is in flight; the same request succeeds once the session settles, so a client that wants points should retry rather than treat it as a failure. It is never `file-change-tracking-disabled`: an untracked local session still lists conversation-only points and reports that through `fileChangeTrackingEnabled: false`. */ + @JsonProperty("unavailableReason") HistoryRewindUnavailableReason unavailableReason, + /** Root user turns in chronological order. Empty when `unavailableReason` is set. */ + @JsonProperty("points") List points +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryPreviewRewindParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryPreviewRewindParams.java new file mode 100644 index 0000000000..dd92709e2b --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryPreviewRewindParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Event boundary to preview for conversation-and-files rewind. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryPreviewRewindParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** ID of the user.message event that begins the discarded suffix. */ + @JsonProperty("eventId") String eventId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryPreviewRewindResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryPreviewRewindResult.java new file mode 100644 index 0000000000..976597c4fa --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryPreviewRewindResult.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Files and aggregate changes for a prospective rewind. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryPreviewRewindResult( + /** Whether file restore is available for this session. This is authoritative: switch on it and read `reason` only when it is false. */ + @JsonProperty("available") Boolean available, + /** Why file restore is unavailable, when applicable. Populated only when `available` is false and never set when `available` is true. */ + @JsonProperty("reason") HistoryRewindUnavailableReason reason, + /** Number of unique files in the preview. */ + @JsonProperty("fileCount") Long fileCount, + /** Files ordered by path. */ + @JsonProperty("files") List files +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryRewindParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryRewindParams.java new file mode 100644 index 0000000000..bf93f3e245 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryRewindParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Boundary and mode for rewinding session history. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryRewindParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** ID of the user.message event that begins the discarded suffix. */ + @JsonProperty("eventId") String eventId, + /** Whether to rewind only conversation history or also restore captured files. */ + @JsonProperty("mode") HistoryRewindMode mode +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryRewindResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryRewindResult.java new file mode 100644 index 0000000000..d069ca9928 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryRewindResult.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Structured outcome of a rewind request. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryRewindResult( + /** Overall rewind outcome. This discriminates the result: it governs which of the remaining fields are populated, so consumers must switch on it before reading `eventsRemoved`, `restoredFiles`, `skippedFiles`, or `error`. See each field for the outcomes that populate it. */ + @JsonProperty("outcome") HistoryRewindOutcome outcome, + /** Number of persisted events removed by conversation truncation. Present only when truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`) and for `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`. */ + @JsonProperty("eventsRemoved") Long eventsRemoved, + /** Absolute paths restored to their captured preimages. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. */ + @JsonProperty("restoredFiles") List restoredFiles, + /** Captured files intentionally left unchanged. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. */ + @JsonProperty("skippedFiles") List skippedFiles, + /** Failure detail. Set only for the failure and partial-failure outcomes (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`). */ + @JsonProperty("error") String error +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryTruncateResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryTruncateResult.java index 5b5043b609..f5ae17d622 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryTruncateResult.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryTruncateResult.java @@ -25,6 +25,10 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionHistoryTruncateResult( /** Number of events that were removed */ - @JsonProperty("eventsRemoved") Long eventsRemoved + @JsonProperty("eventsRemoved") Long eventsRemoved, + /** True when conversation truncation succeeded but post-truncation workspace checkpoint cleanup failed. History is already truncated; callers may still prune snapshots but should report a checkpoint-cleanup rather than a truncation failure. */ + @JsonProperty("checkpointCleanupFailed") Boolean checkpointCleanupFailed, + /** Failure detail when checkpointCleanupFailed is true. */ + @JsonProperty("checkpointCleanupError") String checkpointCleanupError ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionInterruptMainTurnParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionInterruptMainTurnParams.java new file mode 100644 index 0000000000..6e16ad1dd8 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionInterruptMainTurnParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Parameters for interrupting the main agent turn. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionInterruptMainTurnParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** 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. */ + @JsonProperty("flushQueued") Boolean flushQueued +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionInterruptMainTurnResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionInterruptMainTurnResult.java new file mode 100644 index 0000000000..a57804cf82 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionInterruptMainTurnResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of interrupting the main agent turn. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionInterruptMainTurnResult( + /** Whether an in-flight main agent turn was interrupted. False when the main loop was not processing. */ + @JsonProperty("interrupted") Boolean interrupted +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java index 172f6e5075..1a75b92c1b 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java @@ -205,7 +205,7 @@ public CompletableFuture configureGitHub(Sessio } /** - * Server name and configuration for an individual MCP server start. + * Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java index 7b7f7b82bd..4fb92cf145 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java @@ -62,4 +62,20 @@ public CompletableFuture login(SessionMcpOauthLoginP return caller.invoke("session.mcp.oauth.login", _p, SessionMcpOauthLoginResult.class); } + /** + * Pending MCP OAuth request id to respond to. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture respond(SessionMcpOauthRespondParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.oauth.respond", _p, SessionMcpOauthRespondResult.class); + } + } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthRespondParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthRespondParams.java new file mode 100644 index 0000000000..ca79468c15 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthRespondParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Pending MCP OAuth request id to respond to. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpOauthRespondParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** OAuth request identifier from the mcp.oauth_required event */ + @JsonProperty("requestId") String requestId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthRespondResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthRespondResult.java new file mode 100644 index 0000000000..1b1267cb57 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthRespondResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Indicates whether the pending MCP OAuth response was accepted. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpOauthRespondResult( + /** Whether the response was accepted. False if the request was unknown, timed out, or already resolved. */ + @JsonProperty("success") Boolean success +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpStartServerParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpStartServerParams.java index e4c14e30e4..9f6d5d73e4 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpStartServerParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpStartServerParams.java @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Server name and configuration for an individual MCP server start. + * Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -28,7 +28,7 @@ public record SessionMcpStartServerParams( @JsonProperty("sessionId") String sessionId, /** Name of the MCP server to start */ @JsonProperty("serverName") String serverName, - /** MCP server configuration (stdio process or remote HTTP/SSE) */ + /** MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server with its already-registered configuration (config-free start-by-name). */ @JsonProperty("config") Object config ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java index fb8c25b3da..34ab8c2721 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java @@ -66,9 +66,11 @@ public record SessionOptionsUpdateParams( @JsonProperty("toolFilterPrecedence") OptionsUpdateToolFilterPrecedence toolFilterPrecedence, /** Whether shell-script safety heuristics are enabled. */ @JsonProperty("enableScriptSafety") Boolean enableScriptSafety, - /** Shell init profile (`None` or `NonInteractive`). */ + /** Per-session settings for built-in shell tools. */ + @JsonProperty("shell") ShellOptions shell, + /** Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`). */ @JsonProperty("shellInitProfile") String shellInitProfile, - /** Per-shell process flags (e.g., `pwsh` arguments). */ + /** PowerShell process flags applied to built-in and user-requested shell commands. */ @JsonProperty("shellProcessFlags") List shellProcessFlags, /** Resolved sandbox configuration. */ @JsonProperty("sandboxConfig") SandboxConfig sandboxConfig, @@ -82,7 +84,7 @@ public record SessionOptionsUpdateParams( @JsonProperty("skillDirectories") List skillDirectories, /** Skill IDs that should be excluded from this session. */ @JsonProperty("disabledSkills") List disabledSkills, - /** Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag. */ + /** Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`. */ @JsonProperty("enableOnDemandInstructionDiscovery") Boolean enableOnDemandInstructionDiscovery, /** Maximum decoded byte size of a single model-facing binary tool result (e.g. an image) persisted inline in session events and re-presented to the model on later turns / resume. Larger results are persisted as a metadata-only marker and shown to the model as a short text note. Defaults to 10 MB. */ @JsonProperty("maxInlineBinaryBytes") Long maxInlineBinaryBytes, @@ -116,6 +118,8 @@ public record SessionOptionsUpdateParams( @JsonProperty("agentContext") String agentContext, /** Override directory for the session-events log. When unset, the runtime's default events log directory is used. */ @JsonProperty("eventsLogDirectory") String eventsLogDirectory, + /** Whether subagent callback events should be forwarded into the session event log sink. */ + @JsonProperty("eventsLogIncludesSubagents") Boolean eventsLogIncludesSubagents, /** Additional content-exclusion policies to merge into the session's policy set. */ @JsonProperty("additionalContentExclusionPolicies") List additionalContentExclusionPolicies, /** 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). */ diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsApi.java index aba3177083..25d2e36666 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsApi.java @@ -162,14 +162,19 @@ public CompletableFuture setRequired(Sessio } /** - * No parameters; clears all session-scoped tool permission approvals. + * Clears session-scoped tool permission approvals, and optionally the location-scoped ones. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ @CopilotExperimental - public CompletableFuture resetSessionApprovals() { - return caller.invoke("session.permissions.resetSessionApprovals", java.util.Map.of("sessionId", this.sessionId), SessionPermissionsResetSessionApprovalsResult.class); + public CompletableFuture resetSessionApprovals(SessionPermissionsResetSessionApprovalsParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.resetSessionApprovals", _p, SessionPermissionsResetSessionApprovalsResult.class); } /** diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java index 881c081ab0..68ef9814d6 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * No parameters; clears all session-scoped tool permission approvals. + * Clears session-scoped tool permission approvals, and optionally the location-scoped ones. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -25,6 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionPermissionsResetSessionApprovalsParams( /** Target session identifier */ - @JsonProperty("sessionId") String sessionId + @JsonProperty("sessionId") String sessionId, + /** Whether location-scoped approvals are cleared too. Defaults to `true`. */ + @JsonProperty("includeLocation") Boolean includeLocation ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueApi.java index 9b880e134f..a98b08d0a4 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueApi.java @@ -19,6 +19,8 @@ @javax.annotation.processing.Generated("copilot-sdk-codegen") public final class SessionQueueApi { + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + private final RpcCaller caller; private final String sessionId; @@ -39,6 +41,76 @@ public CompletableFuture pendingItems() { return caller.invoke("session.queue.pendingItems", java.util.Map.of("sessionId", this.sessionId), SessionQueuePendingItemsResult.class); } + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture snapshot() { + return caller.invoke("session.queue.snapshot", java.util.Map.of("sessionId", this.sessionId), SessionQueueSnapshotResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture hasPending() { + return caller.invoke("session.queue.hasPending", java.util.Map.of("sessionId", this.sessionId), SessionQueueHasPendingResult.class); + } + + /** + * Inputs for starting a deferred-idle drain. + *

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

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture finishDeferredIdleDrain(SessionQueueFinishDeferredIdleDrainParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.queue.finishDeferredIdleDrain", _p, SessionQueueFinishDeferredIdleDrainResult.class); + } + + /** + * Inputs for marking session.idle deferred in native state. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture deferSessionIdle(SessionQueueDeferSessionIdleParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.queue.deferSessionIdle", _p, Void.class); + } + /** * Identifies the target session. * @@ -61,4 +133,42 @@ public CompletableFuture clear() { return caller.invoke("session.queue.clear", java.util.Map.of("sessionId", this.sessionId), Void.class); } + /** + * Internal filter for consuming queued system notifications. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture consumeSystemNotifications(SessionQueueConsumeSystemNotificationsParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.queue.consumeSystemNotifications", _p, SessionQueueConsumeSystemNotificationsResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture enqueueResumePending() { + return caller.invoke("session.queue.enqueueResumePending", java.util.Map.of("sessionId", this.sessionId), SessionQueueEnqueueResumePendingResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture process() { + return caller.invoke("session.queue.process", java.util.Map.of("sessionId", this.sessionId), Void.class); + } + } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueBeginDeferredIdleDrainParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueBeginDeferredIdleDrainParams.java new file mode 100644 index 0000000000..4973e31075 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueBeginDeferredIdleDrainParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Inputs for starting a deferred-idle drain. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueBeginDeferredIdleDrainParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Whether the host still has active background work. */ + @JsonProperty("activeBackgroundWork") Boolean activeBackgroundWork +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueBeginDeferredIdleDrainResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueBeginDeferredIdleDrainResult.java new file mode 100644 index 0000000000..77e6decb9b --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueBeginDeferredIdleDrainResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Whether a deferred-idle drain should run. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueBeginDeferredIdleDrainResult( + /** True when the host should run finishDeferredIdleDrain asynchronously. */ + @JsonProperty("shouldDrain") Boolean shouldDrain +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueConsumeSystemNotificationsParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueConsumeSystemNotificationsParams.java new file mode 100644 index 0000000000..6449ce7666 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueConsumeSystemNotificationsParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Internal filter for consuming queued system notifications. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueConsumeSystemNotificationsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Opaque runtime-owned filter object. */ + @JsonProperty("filter") Object filter +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueConsumeSystemNotificationsResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueConsumeSystemNotificationsResult.java new file mode 100644 index 0000000000..bbc3715880 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueConsumeSystemNotificationsResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Indicates whether a user-facing pending item was removed. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueConsumeSystemNotificationsResult( + /** True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. */ + @JsonProperty("removed") Boolean removed +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueDeferSessionIdleParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueDeferSessionIdleParams.java new file mode 100644 index 0000000000..7b3dff9ef5 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueDeferSessionIdleParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Inputs for marking session.idle deferred in native state. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueDeferSessionIdleParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Whether the deferred idle was caused by an aborted foreground turn. */ + @JsonProperty("aborted") Boolean aborted +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueEnqueueResumePendingParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueEnqueueResumePendingParams.java new file mode 100644 index 0000000000..1a0ec546ae --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueEnqueueResumePendingParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueEnqueueResumePendingParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueEnqueueResumePendingResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueEnqueueResumePendingResult.java new file mode 100644 index 0000000000..324765b4a2 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueEnqueueResumePendingResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of enqueueing the resume-pending wake item. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueEnqueueResumePendingResult( + /** True when a wake item was newly queued. */ + @JsonProperty("queued") Boolean queued +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueFinishDeferredIdleDrainParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueFinishDeferredIdleDrainParams.java new file mode 100644 index 0000000000..b6b29057d8 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueFinishDeferredIdleDrainParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Inputs for completing a deferred-idle drain. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueFinishDeferredIdleDrainParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Whether the host still has active background work. */ + @JsonProperty("activeBackgroundWork") Boolean activeBackgroundWork, + /** Whether native queued work remains. */ + @JsonProperty("hasPending") Boolean hasPending +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueFinishDeferredIdleDrainResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueFinishDeferredIdleDrainResult.java new file mode 100644 index 0000000000..1e6cc52577 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueFinishDeferredIdleDrainResult.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Action selected by the native deferred-idle drain. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueFinishDeferredIdleDrainResult( + /** One of none, processQueue, or emitSessionIdle. */ + @JsonProperty("action") String action, + /** Whether the deferred idle was caused by an aborted foreground turn. */ + @JsonProperty("aborted") Boolean aborted +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueHasPendingParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueHasPendingParams.java new file mode 100644 index 0000000000..e587fec4cb --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueHasPendingParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueHasPendingParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueHasPendingResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueHasPendingResult.java new file mode 100644 index 0000000000..5373856a45 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueHasPendingResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Whether the native queue has pending work. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueHasPendingResult( + /** True when queued or immediate native work is pending. */ + @JsonProperty("hasPending") Boolean hasPending +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueProcessParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueProcessParams.java new file mode 100644 index 0000000000..8c8edfe554 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueProcessParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueProcessParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSnapshotParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSnapshotParams.java new file mode 100644 index 0000000000..dff5db8a8d --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSnapshotParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueSnapshotParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSnapshotResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSnapshotResult.java new file mode 100644 index 0000000000..7ae1076d63 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSnapshotResult.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Internal snapshot of native queue state for local session orchestration. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueSnapshotResult( + /** User-facing pending items in FIFO order. */ + @JsonProperty("items") List items, + /** Immediate steering messages waiting for an active turn. */ + @JsonProperty("steeringMessages") List steeringMessages, + /** Insertion orders for queued items, aligned with `items`. */ + @JsonProperty("itemOrders") List itemOrders, + /** Insertion orders for immediate steering messages, aligned with `steeringMessages`. */ + @JsonProperty("steeringMessageOrders") List steeringMessageOrders +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java index 3ec3464d05..b696663e93 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java @@ -85,6 +85,8 @@ public final class SessionRpc { public final SessionMetadataApi metadata; /** API methods for the {@code settings} namespace. */ public final SessionSettingsApi settings; + /** API methods for the {@code contentExclusion} namespace. */ + public final SessionContentExclusionApi contentExclusion; /** API methods for the {@code shell} namespace. */ public final SessionShellApi shell; /** API methods for the {@code history} namespace. */ @@ -139,6 +141,7 @@ public SessionRpc(RpcCaller caller, String sessionId) { this.permissions = new SessionPermissionsApi(caller, sessionId); this.metadata = new SessionMetadataApi(caller, sessionId); this.settings = new SessionSettingsApi(caller, sessionId); + this.contentExclusion = new SessionContentExclusionApi(caller, sessionId); this.shell = new SessionShellApi(caller, sessionId); this.history = new SessionHistoryApi(caller, sessionId); this.queue = new SessionQueueApi(caller, sessionId); @@ -192,6 +195,22 @@ public CompletableFuture sendMessages(SessionSendMess return caller.invoke("session.sendMessages", _p, SessionSendMessagesResult.class); } + /** + * Internal request for sending a system notification. + *

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

@@ -208,6 +227,33 @@ public CompletableFuture abort(SessionAbortParams params) { return caller.invoke("session.abort", _p, SessionAbortResult.class); } + /** + * Parameters for interrupting the main agent turn. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture interruptMainTurn(SessionInterruptMainTurnParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.interruptMainTurn", _p, SessionInterruptMainTurnResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture cancelAllBackgroundAgents() { + return caller.invoke("session.cancelAllBackgroundAgents", java.util.Map.of("sessionId", this.sessionId), Void.class); + } + /** * Parameters for shutting down the session *

diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddAtParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddAtParams.java new file mode 100644 index 0000000000..0a099bdf4a --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddAtParams.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Register an absolute-time scheduled prompt. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleAddAtParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Epoch milliseconds when the prompt should fire. */ + @JsonProperty("at") Long at, + /** Prompt text to enqueue when the schedule fires. */ + @JsonProperty("prompt") String prompt, + /** Whether the schedule should re-arm after each tick. Defaults to false. */ + @JsonProperty("recurring") Boolean recurring, + /** Optional display-only prompt label. */ + @JsonProperty("displayPrompt") String displayPrompt +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddAtResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddAtResult.java new file mode 100644 index 0000000000..7952fdc88b --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddAtResult.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of registering or re-arming a scheduled prompt. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleAddAtResult( + /** The registered or updated schedule entry. */ + @JsonProperty("entry") ScheduleEntry entry, + /** User-facing validation error, when registration failed. */ + @JsonProperty("error") String error +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddCronParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddCronParams.java new file mode 100644 index 0000000000..08a9cd33bb --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddCronParams.java @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Register a cron scheduled prompt. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleAddCronParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** 5-field cron expression. */ + @JsonProperty("cron") String cron, + /** Prompt text to enqueue when the schedule fires. */ + @JsonProperty("prompt") String prompt, + /** Whether the schedule should re-arm after each tick. Defaults to true. */ + @JsonProperty("recurring") Boolean recurring, + /** Optional display-only prompt label. */ + @JsonProperty("displayPrompt") String displayPrompt, + /** IANA timezone for evaluating the cron expression. */ + @JsonProperty("tz") String tz +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddCronResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddCronResult.java new file mode 100644 index 0000000000..193dea1b4c --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddCronResult.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of registering or re-arming a scheduled prompt. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleAddCronResult( + /** The registered or updated schedule entry. */ + @JsonProperty("entry") ScheduleEntry entry, + /** User-facing validation error, when registration failed. */ + @JsonProperty("error") String error +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddParams.java new file mode 100644 index 0000000000..31580758cb --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddParams.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Register a relative-interval scheduled prompt. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleAddParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Human-readable interval such as `30s`, `5m`, or `2h`. */ + @JsonProperty("interval") String interval, + /** Prompt text to enqueue when the schedule fires. */ + @JsonProperty("prompt") String prompt, + /** Whether the schedule should re-arm after each tick. Defaults to true. */ + @JsonProperty("recurring") Boolean recurring, + /** Optional display-only prompt label. */ + @JsonProperty("displayPrompt") String displayPrompt +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddResult.java new file mode 100644 index 0000000000..021c784c37 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddResult.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of registering or re-arming a scheduled prompt. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleAddResult( + /** The registered or updated schedule entry. */ + @JsonProperty("entry") ScheduleEntry entry, + /** User-facing validation error, when registration failed. */ + @JsonProperty("error") String error +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddSelfPacedParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddSelfPacedParams.java new file mode 100644 index 0000000000..17a89c1b2d --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddSelfPacedParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Register a self-paced scheduled prompt. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleAddSelfPacedParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Prompt text to enqueue when the schedule fires. */ + @JsonProperty("prompt") String prompt, + /** Optional display-only prompt label. */ + @JsonProperty("displayPrompt") String displayPrompt +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddSelfPacedResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddSelfPacedResult.java new file mode 100644 index 0000000000..65f8745baf --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleAddSelfPacedResult.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of registering or re-arming a scheduled prompt. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleAddSelfPacedResult( + /** The registered or updated schedule entry. */ + @JsonProperty("entry") ScheduleEntry entry, + /** User-facing validation error, when registration failed. */ + @JsonProperty("error") String error +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleApi.java index 2e42c1bc30..f983f84f71 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleApi.java @@ -41,6 +41,108 @@ public CompletableFuture list() { return caller.invoke("session.schedule.list", java.util.Map.of("sessionId", this.sessionId), SessionScheduleListResult.class); } + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture hydrate() { + return caller.invoke("session.schedule.hydrate", java.util.Map.of("sessionId", this.sessionId), Void.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture hasSelfPaced() { + return caller.invoke("session.schedule.hasSelfPaced", java.util.Map.of("sessionId", this.sessionId), SessionScheduleHasSelfPacedResult.class); + } + + /** + * Register a relative-interval scheduled prompt. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture add(SessionScheduleAddParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.schedule.add", _p, SessionScheduleAddResult.class); + } + + /** + * Register a cron scheduled prompt. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture addCron(SessionScheduleAddCronParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.schedule.addCron", _p, SessionScheduleAddCronResult.class); + } + + /** + * Register an absolute-time scheduled prompt. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture addAt(SessionScheduleAddAtParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.schedule.addAt", _p, SessionScheduleAddAtResult.class); + } + + /** + * Register a self-paced scheduled prompt. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture addSelfPaced(SessionScheduleAddSelfPacedParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.schedule.addSelfPaced", _p, SessionScheduleAddSelfPacedResult.class); + } + + /** + * Re-arm a self-paced scheduled prompt. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture rearmSelfPaced(SessionScheduleRearmSelfPacedParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.schedule.rearmSelfPaced", _p, SessionScheduleRearmSelfPacedResult.class); + } + /** * Identifier of the scheduled prompt to remove. *

diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHasSelfPacedParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHasSelfPacedParams.java new file mode 100644 index 0000000000..7eb31df7f6 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHasSelfPacedParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleHasSelfPacedParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHasSelfPacedResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHasSelfPacedResult.java new file mode 100644 index 0000000000..84c8e7a501 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHasSelfPacedResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Whether the session currently has an active self-paced schedule. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleHasSelfPacedResult( + /** True when at least one active schedule is self-paced. */ + @JsonProperty("hasSelfPaced") Boolean hasSelfPaced +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHydrateParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHydrateParams.java new file mode 100644 index 0000000000..32ec85c7d4 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleHydrateParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleHydrateParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleRearmSelfPacedParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleRearmSelfPacedParams.java new file mode 100644 index 0000000000..d1999311c2 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleRearmSelfPacedParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Re-arm a self-paced scheduled prompt. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleRearmSelfPacedParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Id of the self-paced scheduled prompt. */ + @JsonProperty("id") Long id, + /** Epoch milliseconds when the prompt should next fire. */ + @JsonProperty("at") Long at +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleRearmSelfPacedResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleRearmSelfPacedResult.java new file mode 100644 index 0000000000..0280fbaccb --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleRearmSelfPacedResult.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of registering or re-arming a scheduled prompt. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleRearmSelfPacedResult( + /** The registered or updated schedule entry. */ + @JsonProperty("entry") ScheduleEntry entry, + /** User-facing validation error, when registration failed. */ + @JsonProperty("error") String error +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java index 7762c56831..2213187c5f 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java @@ -42,7 +42,7 @@ public record SessionSendParams( @JsonProperty("billable") Boolean 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 */ @JsonProperty("requiredTool") String requiredTool, - /** 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. */ @JsonProperty("source") String source, /** The UI mode the agent was in when this message was sent. Defaults to the session's current mode. */ @JsonProperty("agentMode") SendAgentMode agentMode, diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionSendSystemNotificationParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionSendSystemNotificationParams.java new file mode 100644 index 0000000000..762fe6ef39 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionSendSystemNotificationParams.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Internal request for sending a system notification. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSendSystemNotificationParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Notification text to deliver to the model. */ + @JsonProperty("message") String message, + /** Optional structured notification kind. */ + @JsonProperty("kind") Object kind, + /** Internal delivery options, including passive policy. */ + @JsonProperty("options") Object options +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAddSummaryParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAddSummaryParams.java new file mode 100644 index 0000000000..2a1c247bf5 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAddSummaryParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Compaction summary checkpoint to persist. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesAddSummaryParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Summary title shown in checkpoint listings. */ + @JsonProperty("title") String title, + /** Markdown summary content to persist. */ + @JsonProperty("content") String content +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAddSummaryResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAddSummaryResult.java new file mode 100644 index 0000000000..a50a0b5f53 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAddSummaryResult.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * Persisted summary metadata and refreshed workspace metadata. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesAddSummaryResult( + @JsonProperty("summary") Map summary, + @JsonProperty("workspace") Map workspace +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesApi.java index 690328176b..aaacb046f0 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesApi.java @@ -41,6 +41,38 @@ public CompletableFuture getWorkspace() { return caller.invoke("session.workspaces.getWorkspace", java.util.Map.of("sessionId", this.sessionId), SessionWorkspacesGetWorkspaceResult.class); } + /** + * Workspace metadata fields to update. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture updateMetadata(SessionWorkspacesUpdateMetadataParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.workspaces.updateMetadata", _p, SessionWorkspacesUpdateMetadataResult.class); + } + + /** + * Optional session context used when creating a local workspace. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture ensure(SessionWorkspacesEnsureParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.workspaces.ensure", _p, SessionWorkspacesEnsureResult.class); + } + /** * Identifies the target session. * @@ -111,6 +143,87 @@ public CompletableFuture readCheckpoint(S return caller.invoke("session.workspaces.readCheckpoint", _p, SessionWorkspacesReadCheckpointResult.class); } + /** + * Compaction summary checkpoint to persist. + *

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

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture truncateSummaries(SessionWorkspacesTruncateSummariesParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.workspaces.truncateSummaries", _p, SessionWorkspacesTruncateSummariesResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture readAutopilotObjective() { + return caller.invoke("session.workspaces.readAutopilotObjective", java.util.Map.of("sessionId", this.sessionId), SessionWorkspacesReadAutopilotObjectiveResult.class); + } + + /** + * Autopilot objective file content to persist. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture writeAutopilotObjective(SessionWorkspacesWriteAutopilotObjectiveParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.workspaces.writeAutopilotObjective", _p, SessionWorkspacesWriteAutopilotObjectiveResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture deleteAutopilotObjective() { + return caller.invoke("session.workspaces.deleteAutopilotObjective", java.util.Map.of("sessionId", this.sessionId), SessionWorkspacesDeleteAutopilotObjectiveResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture autopilotObjectiveExists() { + return caller.invoke("session.workspaces.autopilotObjectiveExists", java.util.Map.of("sessionId", this.sessionId), SessionWorkspacesAutopilotObjectiveExistsResult.class); + } + /** * Pasted content to save as a UTF-8 file in the session workspace. *

diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAutopilotObjectiveExistsParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAutopilotObjectiveExistsParams.java new file mode 100644 index 0000000000..fc4b25c9dc --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAutopilotObjectiveExistsParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesAutopilotObjectiveExistsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAutopilotObjectiveExistsResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAutopilotObjectiveExistsResult.java new file mode 100644 index 0000000000..8fe0a849dd --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesAutopilotObjectiveExistsResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Whether the autopilot objective file exists. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesAutopilotObjectiveExistsResult( + /** True when the objective file exists. */ + @JsonProperty("exists") Boolean exists +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDeleteAutopilotObjectiveParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDeleteAutopilotObjectiveParams.java new file mode 100644 index 0000000000..81f59d7a0a --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDeleteAutopilotObjectiveParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesDeleteAutopilotObjectiveParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDeleteAutopilotObjectiveResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDeleteAutopilotObjectiveResult.java new file mode 100644 index 0000000000..3fa3f35f26 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDeleteAutopilotObjectiveResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of deleting the autopilot objective file. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesDeleteAutopilotObjectiveResult( + /** True when a file was deleted. */ + @JsonProperty("deleted") Boolean deleted +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDiffResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDiffResult.java index a3c8ce96e6..21beab3ead 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDiffResult.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDiffResult.java @@ -33,7 +33,9 @@ public record SessionWorkspacesDiffResult( @JsonProperty("changes") List changes, /** Default branch used for a branch diff, when branch mode was requested. */ @JsonProperty("baseBranch") String baseBranch, - /** Whether a requested branch diff fell back to unstaged changes because branch diff failed. */ - @JsonProperty("isFallback") Boolean isFallback + /** Whether the requested diff fell back to unstaged changes, either because branch diff failed or session diff was unavailable. */ + @JsonProperty("isFallback") Boolean isFallback, + /** Why the session diff could not be produced, when applicable. Set only when `session` mode was requested and `isFallback` is true, so a client can tell the permanent `file-change-tracking-disabled` apart from the transient `session-busy`, which the same request answers once the session settles. Never set for `unstaged` or `branch` mode, and never `unsupported-remote-session`: a remote session's captures live on its own host, so a `session`-mode diff is rejected for one rather than answered with a controller-side fallback. */ + @JsonProperty("unavailableReason") HistoryRewindUnavailableReason unavailableReason ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureParams.java new file mode 100644 index 0000000000..aaa71621ff --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Optional session context used when creating a local workspace. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesEnsureParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Opaque workspace context supplied by the session host. */ + @JsonProperty("context") Object context +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureResult.java new file mode 100644 index 0000000000..4a810fe121 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureResult.java @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * Current workspace metadata for the session, including its absolute filesystem path when available. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesEnsureResult( + /** Current workspace metadata, or null if not available */ + @JsonProperty("workspace") SessionWorkspacesEnsureResultWorkspace workspace, + /** Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). */ + @JsonProperty("path") String path +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionWorkspacesEnsureResultWorkspace( + @JsonProperty("id") String id, + @JsonProperty("cwd") String cwd, + @JsonProperty("git_root") String gitRoot, + @JsonProperty("repository") String repository, + /** Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. */ + @JsonProperty("host_type") WorkspacesWorkspaceDetailsHostType hostType, + @JsonProperty("branch") String branch, + @JsonProperty("name") String name, + @JsonProperty("client_name") String clientName, + @JsonProperty("user_named") Boolean userNamed, + @JsonProperty("summary_count") Long summaryCount, + @JsonProperty("created_at") OffsetDateTime createdAt, + @JsonProperty("updated_at") OffsetDateTime updatedAt, + @JsonProperty("remote_steerable") Boolean remoteSteerable, + @JsonProperty("mc_task_id") String mcTaskId, + @JsonProperty("mc_session_id") String mcSessionId, + @JsonProperty("mc_last_event_id") String mcLastEventId, + @JsonProperty("chronicle_sync_dismissed") Boolean chronicleSyncDismissed + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveParams.java new file mode 100644 index 0000000000..67d03a9549 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesReadAutopilotObjectiveParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveResult.java new file mode 100644 index 0000000000..7b2e157b56 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Autopilot objective file content, or null when missing. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesReadAutopilotObjectiveResult( + /** Autopilot objective file content, or null when missing. */ + @JsonProperty("content") String content +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesParams.java new file mode 100644 index 0000000000..43d392e48c --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Rollback point for local workspace summaries. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesTruncateSummariesParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Number of newest summaries to keep. */ + @JsonProperty("keepCount") Long keepCount +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesResult.java new file mode 100644 index 0000000000..caa44d0b7a --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesResult.java @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * Current workspace metadata for the session, including its absolute filesystem path when available. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesTruncateSummariesResult( + /** Current workspace metadata, or null if not available */ + @JsonProperty("workspace") SessionWorkspacesTruncateSummariesResultWorkspace workspace, + /** Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). */ + @JsonProperty("path") String path +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionWorkspacesTruncateSummariesResultWorkspace( + @JsonProperty("id") String id, + @JsonProperty("cwd") String cwd, + @JsonProperty("git_root") String gitRoot, + @JsonProperty("repository") String repository, + /** Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. */ + @JsonProperty("host_type") WorkspacesWorkspaceDetailsHostType hostType, + @JsonProperty("branch") String branch, + @JsonProperty("name") String name, + @JsonProperty("client_name") String clientName, + @JsonProperty("user_named") Boolean userNamed, + @JsonProperty("summary_count") Long summaryCount, + @JsonProperty("created_at") OffsetDateTime createdAt, + @JsonProperty("updated_at") OffsetDateTime updatedAt, + @JsonProperty("remote_steerable") Boolean remoteSteerable, + @JsonProperty("mc_task_id") String mcTaskId, + @JsonProperty("mc_session_id") String mcSessionId, + @JsonProperty("mc_last_event_id") String mcLastEventId, + @JsonProperty("chronicle_sync_dismissed") Boolean chronicleSyncDismissed + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataParams.java new file mode 100644 index 0000000000..af45fead51 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Workspace metadata fields to update. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesUpdateMetadataParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Opaque workspace context supplied by the session host. */ + @JsonProperty("context") Object context, + /** Optional workspace display name override. */ + @JsonProperty("name") String name +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataResult.java new file mode 100644 index 0000000000..84ec136616 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataResult.java @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * Current workspace metadata for the session, including its absolute filesystem path when available. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesUpdateMetadataResult( + /** Current workspace metadata, or null if not available */ + @JsonProperty("workspace") SessionWorkspacesUpdateMetadataResultWorkspace workspace, + /** Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). */ + @JsonProperty("path") String path +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionWorkspacesUpdateMetadataResultWorkspace( + @JsonProperty("id") String id, + @JsonProperty("cwd") String cwd, + @JsonProperty("git_root") String gitRoot, + @JsonProperty("repository") String repository, + /** Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. */ + @JsonProperty("host_type") WorkspacesWorkspaceDetailsHostType hostType, + @JsonProperty("branch") String branch, + @JsonProperty("name") String name, + @JsonProperty("client_name") String clientName, + @JsonProperty("user_named") Boolean userNamed, + @JsonProperty("summary_count") Long summaryCount, + @JsonProperty("created_at") OffsetDateTime createdAt, + @JsonProperty("updated_at") OffsetDateTime updatedAt, + @JsonProperty("remote_steerable") Boolean remoteSteerable, + @JsonProperty("mc_task_id") String mcTaskId, + @JsonProperty("mc_session_id") String mcSessionId, + @JsonProperty("mc_last_event_id") String mcLastEventId, + @JsonProperty("chronicle_sync_dismissed") Boolean chronicleSyncDismissed + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesWriteAutopilotObjectiveParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesWriteAutopilotObjectiveParams.java new file mode 100644 index 0000000000..fb116ed307 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesWriteAutopilotObjectiveParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Autopilot objective file content to persist. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesWriteAutopilotObjectiveParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Autopilot objective file content. */ + @JsonProperty("content") String content +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesWriteAutopilotObjectiveResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesWriteAutopilotObjectiveResult.java new file mode 100644 index 0000000000..9b69713e97 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesWriteAutopilotObjectiveResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of writing the autopilot objective file. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesWriteAutopilotObjectiveResult( + /** Filesystem operation performed. */ + @JsonProperty("operation") String operation +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionsDeleteParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionsDeleteParams.java new file mode 100644 index 0000000000..788811e348 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionsDeleteParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Session ID to delete from disk. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsDeleteParams( + /** Session ID to delete */ + @JsonProperty("sessionId") String sessionId, + /** Internal resolved session directory path to delete */ + @JsonProperty("sessionPath") String sessionPath +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionsGetMetadataParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionsGetMetadataParams.java new file mode 100644 index 0000000000..cfa2e6326e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionsGetMetadataParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Session ID whose persisted metadata should be read. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsGetMetadataParams( + /** Session ID to inspect */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionsGetMetadataResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionsGetMetadataResult.java new file mode 100644 index 0000000000..6546b00fe0 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionsGetMetadataResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Persisted local session metadata when the session exists. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsGetMetadataResult( + /** Local session metadata, omitted when the session does not exist. */ + @JsonProperty("session") LocalSessionMetadataValue session +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionsListNonEmptySessionIdsParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionsListNonEmptySessionIdsParams.java new file mode 100644 index 0000000000..4e453121bc --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionsListNonEmptySessionIdsParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Limit for non-empty local session IDs. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsListNonEmptySessionIdsParams( + /** Maximum number of session IDs to return. */ + @JsonProperty("limit") Long limit +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionsListNonEmptySessionIdsResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionsListNonEmptySessionIdsResult.java new file mode 100644 index 0000000000..51cc266e63 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionsListNonEmptySessionIdsResult.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Recent local session IDs that contain user-visible history. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsListNonEmptySessionIdsResult( + /** Session IDs ordered newest-first. */ + @JsonProperty("sessionIds") List sessionIds +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ShellInitProfile.java b/java/src/generated/java/com/github/copilot/generated/rpc/ShellInitProfile.java new file mode 100644 index 0000000000..7d27a55b5d --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ShellInitProfile.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ShellInitProfile { + /** The {@code none} variant. */ + NONE("none"), + /** The {@code non-interactive} variant. */ + NON_INTERACTIVE("non-interactive"); + + private final String value; + ShellInitProfile(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ShellInitProfile fromValue(String value) { + for (ShellInitProfile v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ShellInitProfile value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ShellInitScript.java b/java/src/generated/java/com/github/copilot/generated/rpc/ShellInitScript.java new file mode 100644 index 0000000000..31789619e8 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ShellInitScript.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * A host-provided script sourced before each built-in shell command when its shell target matches the active shell. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ShellInitScript( + /** Path to the script to source. */ + @JsonProperty("path") String path, + /** Built-in shell that may source this script. */ + @JsonProperty("shell") ShellInitScriptShell shell +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ShellInitScriptShell.java b/java/src/generated/java/com/github/copilot/generated/rpc/ShellInitScriptShell.java new file mode 100644 index 0000000000..63d7ba7dc2 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ShellInitScriptShell.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Supported built-in shells for initialization scripts. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ShellInitScriptShell { + /** The {@code bash} variant. */ + BASH("bash"), + /** The {@code powershell} variant. */ + POWERSHELL("powershell"); + + private final String value; + ShellInitScriptShell(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ShellInitScriptShell fromValue(String value) { + for (ShellInitScriptShell v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ShellInitScriptShell value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ShellOptions.java b/java/src/generated/java/com/github/copilot/generated/rpc/ShellOptions.java new file mode 100644 index 0000000000..596de0ef98 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ShellOptions.java @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Per-session settings for built-in shell tools. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ShellOptions( + /** Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected. */ + @JsonProperty("initProfile") ShellInitProfile initProfile, + /** 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. */ + @JsonProperty("initScripts") List initScripts, + /** 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`. */ + @JsonProperty("processFlags") List processFlags +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/UIExitPlanModeResponse.java b/java/src/generated/java/com/github/copilot/generated/rpc/UIExitPlanModeResponse.java index d74d1b5042..b65b28fc10 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/UIExitPlanModeResponse.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/UIExitPlanModeResponse.java @@ -28,6 +28,8 @@ public record UIExitPlanModeResponse( /** Whether subsequent edits should be auto-approved without confirmation. */ @JsonProperty("autoApproveEdits") Boolean autoApproveEdits, /** Feedback from the user when they declined the plan or requested changes. */ - @JsonProperty("feedback") String feedback + @JsonProperty("feedback") String feedback, + /** 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. */ + @JsonProperty("deferImplementation") Boolean deferImplementation ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChange.java b/java/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChange.java index f091bc2799..e63b92b569 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChange.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChange.java @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record WorkspaceDiffFileChange( - /** Path to the changed file, relative to the workspace root. */ + /** Path to the changed file, relative to the workspace root when the file lives under it. A file changed outside the workspace root keeps a `../`-relative path, or an absolute path when no relative path exists (for example a different Windows drive). */ @JsonProperty("path") String path, /** Unified diff content for the file. Empty when the diff was truncated. */ @JsonProperty("diff") String diff, diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 65fed3fbfc..7c855c4421 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.76-0", "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.76-0.tgz", + "integrity": "sha512-4H/UdjreF5h2rJVx8u2pbZA3mdhkeY3VXWbERNPOTb8VX0dvNrNoytBRLDznDHvoaicw44209z+3wdbG9tkYMQ==", "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.76-0", + "@github/copilot-darwin-x64": "1.0.76-0", + "@github/copilot-linux-arm64": "1.0.76-0", + "@github/copilot-linux-x64": "1.0.76-0", + "@github/copilot-linuxmusl-arm64": "1.0.76-0", + "@github/copilot-linuxmusl-x64": "1.0.76-0", + "@github/copilot-win32-arm64": "1.0.76-0", + "@github/copilot-win32-x64": "1.0.76-0" } }, "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.76-0.tgz", + "integrity": "sha512-jn7vkFF9HeLfwvudGWJJXqZTipFNVlgSuUuwpezkNOGf4p/O4T5Df7/5OZzaXjWoZ737anUsWpANifhxmblSLg==", "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.76-0.tgz", + "integrity": "sha512-Yezh/nyit6XuaQKtCJ08xOz3Th3+dpyILsa9yIbgCvjxQFwu1RyEnweZJQXTRLV54AsW1Z98jv0V4eIghGjdRw==", "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.76-0.tgz", + "integrity": "sha512-w/2JoB7Gu2Dd0RWwxEp2fTGiq+eZ6htli27IBfndpwJFTaKi61N1+T4X7PBMtke4jvrdDml0UVny1WTh+tXSzQ==", "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.76-0.tgz", + "integrity": "sha512-AOp6CxbR2yNpgjqee1AtzjkAwkoTVexMpeOBs7bm8Qgotljfkpz88FEMQx5n9mrQ8XbktOteNuoNucv+QPW/bQ==", "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.76-0.tgz", + "integrity": "sha512-AQDap2izdmMbQmB8aqseSnHvm3uwRSAW1YIfVtPpRVggnKJp1tB3XkDd+/pi28yW0hQd3SLktzBJU8emTJsHOg==", "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.76-0.tgz", + "integrity": "sha512-Av8J2QkxmaiiFERGT6DZ90FSSpB+CWlek7pU4IGsbX9KGUB/xrWSxVjnM9gOyYuvG4w3O7dJBPfq+nChDqEWZA==", "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.76-0.tgz", + "integrity": "sha512-hIk2y8td3cRx5dHI41gnBM3xE7Mj2GIFafr/Xc8OmN4nSXw897qzQd+nxA7IekWkyC9vYmi8eC37x4rV1Bmhkg==", "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.76-0.tgz", + "integrity": "sha512-0BwH5HcRY0vvCIYmtrGG6nKn1yS8YEhDVslGkgBWUAXXb6InzEuyVkb73gIIYLF4A9jz5d94BNXb9FuwclAPWg==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index aadba0ecee..a95e4f614a 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.76-0", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" diff --git a/nodejs/samples/package-lock.json b/nodejs/samples/package-lock.json index a12f7eedd4..847fe46f09 100644 --- a/nodejs/samples/package-lock.json +++ b/nodejs/samples/package-lock.json @@ -18,7 +18,7 @@ "version": "0.0.0-dev", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.73", + "@github/copilot": "^1.0.76-0", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index cf009115e1..cbdea86815 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -510,17 +510,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 +587,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 +610,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. * @@ -596,6 +654,84 @@ export type FilterMapping = [k: string]: ContentFilterMode; } | ContentFilterMode; +/** + * Reason a captured file was not restored. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryFileRestoreSkipReason". + */ +/** @experimental */ +export type HistoryFileRestoreSkipReason = + /** The file changed after Copilot's last captured write. */ + | "user-modified" + /** A faithful preimage was not captured. */ + | "skipped-capture"; +/** + * Reason a rewind read (rewind points, file-restore preview, or session diff) could not be answered from the session's file-change captures. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryRewindUnavailableReason". + */ +/** @experimental */ +export type HistoryRewindUnavailableReason = + /** The session did not opt into file-change tracking before its first turn. */ + | "file-change-tracking-disabled" + /** The session still has work that may mutate files or history. Transient: the same request succeeds once the session settles, so callers should retry rather than treat it as a failure. */ + | "session-busy" + /** Remote-backed rewind routing is not supported. */ + | "unsupported-remote-session"; +/** + * Aggregate file change represented by a rewind preview. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryRewindChangeType". + */ +/** @experimental */ +export type HistoryRewindChangeType = + /** The discarded turns created the file. */ + | "created" + /** The discarded turns deleted the file. */ + | "deleted" + /** The discarded turns modified the file. */ + | "modified"; +/** + * Scope of a rewind operation. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryRewindMode". + */ +/** @experimental */ +export type HistoryRewindMode = + /** Discard conversation events while leaving files unchanged. */ + | "conversation" + /** Discard conversation events and restore captured files changed by those turns. */ + | "conversation-and-files"; +/** + * Outcome of a rewind request. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryRewindOutcome". + */ +/** @experimental */ +export type HistoryRewindOutcome = + /** The requested rewind completed; reachable in either mode. */ + | "success" + /** The session still has work that may mutate files or history; reachable in either mode. */ + | "session-busy" + /** A conversation-and-files rewind was requested for a session that did not enable capture; conversation-only rewinds never produce this. */ + | "file-change-tracking-disabled" + /** Remote-backed rewind routing is not supported; reachable in either mode. */ + | "unsupported-remote-session" + /** File restore failed and all applied file changes were rolled back; only conversation-and-files rewinds produce this. */ + | "files-rolled-back" + /** File restore failed and its rollback could not fully restore the pre-rewind state; only conversation-and-files rewinds produce this. */ + | "rollback-incomplete" + /** Conversation truncation failed. In conversation-and-files mode any files that were restored are left in place because conversation history cannot be un-truncated; in conversation-only mode no files are restored. Consult restoredFiles for what, if anything, was applied. */ + | "truncation-failed" + /** The conversation was rewound (and, in conversation-and-files mode, captured files were restored), but persisted checkpoints could not be cleaned up; reachable in either mode. */ + | "checkpoint-cleanup-failed" + /** Files and conversation were rewound, but obsolete file snapshots could not be removed; only conversation-and-files rewinds produce this. */ + | "snapshot-prune-failed"; /** * Hook event name dispatched through the SDK callback transport. * @@ -1670,6 +1806,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 +1912,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 +2414,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 @@ -3361,6 +3543,32 @@ export interface AllowAllPermissionState { enabled: boolean; mode?: PermissionsAllowAllMode; } +/** + * The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "BuiltInModelCatalog". + */ +/** @experimental */ +export interface BuiltInModelCatalog { + /** + * Built-in model entries. + */ + models: BuiltInModelCatalogEntry[]; +} +/** + * A well-known model in the runtime's built-in catalog. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "BuiltInModelCatalogEntry". + */ +/** @experimental */ +export interface BuiltInModelCatalogEntry { + /** + * Well-known runtime model ID suitable for `ProviderConfig.modelId` or `ProviderModelConfig.modelId`. This is not necessarily the provider-facing deployment or model name and does not indicate CAPI entitlement or provider availability. + */ + id: string; +} /** * Cancellation result for a user-requested shell command. * @@ -4160,7 +4368,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; } @@ -4186,6 +4394,53 @@ export interface ConnectResult { */ version: string; } +/** + * Local file system absolute paths within the session working directory to check against its content-exclusion policy. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ContentExclusionCheckPathsRequest". + */ +/** @experimental */ +export interface ContentExclusionCheckPathsRequest { + /** + * Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates. + */ + paths: string[]; +} +/** + * Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ContentExclusionCheckPathsResult". + */ +/** @experimental */ +export interface ContentExclusionCheckPathsResult { + /** + * Whether the session's policy service was available for the complete batch. When false, checks is empty and callers must treat every requested path as excluded. + */ + available: boolean; + /** + * Per-path decisions in request order. Empty when available is false. + */ + checks: ContentExclusionPathCheck[]; +} +/** + * Content-exclusion decision for one requested path. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ContentExclusionPathCheck". + */ +/** @experimental */ +export interface ContentExclusionPathCheck { + /** + * The path supplied by the caller. + */ + path: string; + /** + * Whether the session's complete content-exclusion policy excludes the path. + */ + excluded: boolean; +} /** * A single large message currently in context. * @@ -4968,6 +5223,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. */ @@ -4989,6 +5248,28 @@ export interface FactoryAgentResult { [k: string]: unknown | undefined; }; } +/** + * 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 +5283,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. * @@ -5022,6 +5327,10 @@ export interface FactoryExecuteRequest { * Factory run identifier. */ runId: string; + /** + * Opaque token identifying this factory execution attempt. + */ + executionToken: string; /** * Factory input value. */ @@ -5040,10 +5349,39 @@ export interface FactoryExecuteResult { /** * Factory result value. */ - result: { + result?: { [k: string]: unknown | undefined; }; } +/** + * Parameters for paging factory progress. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "FactoryGetRunProgressRequest". + */ +/** @experimental */ +export interface FactoryGetRunProgressRequest { + /** + * Factory run identifier. + */ + 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 +5407,10 @@ export interface FactoryJournalGetRequest { * Factory run identifier. */ runId: string; + /** + * Opaque token identifying the current factory execution attempt. + */ + executionToken: string; /** * Namespaced journal key. */ @@ -5105,6 +5447,10 @@ export interface FactoryJournalPutRequest { * Factory run identifier. */ runId: string; + /** + * Opaque token identifying the current factory execution attempt. + */ + executionToken: string; /** * Namespaced journal key. */ @@ -5116,6 +5462,77 @@ export interface FactoryJournalPutRequest { [k: string]: unknown | undefined; }; } +/** + * 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 +5563,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 { +export interface FactoryProgressPage { + records: FactoryProgressLine[]; + oldestSeq: number | null; + newestSeq: number | null; + hasMoreOlder: boolean; + hasMoreNewer: boolean; /** - * Registered factory name. + * Run revision reflected by this page. */ - name: string; + revision: number; +} +/** + * Parameters for resuming a factory run from its persisted identity. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "FactoryResumeRequest". + */ +/** @experimental */ +export interface FactoryResumeRequest { /** - * Factory input value. + * Factory run identifier. */ - args: { - [k: string]: unknown | undefined; - }; - options?: RunOptions; + runId: string; + limits?: FactoryRunLimits; } /** - * Options controlling factory invocation. + * Wire-only per-invocation factory resource ceiling overrides. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema - * via the `definition` "RunOptions". + * via the `definition` "FactoryRunLimits". */ /** @experimental */ -export interface RunOptions { - limits?: FactoryRunLimits; +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. @@ -5241,6 +5730,71 @@ export interface FactoryRunResult { [k: string]: unknown | undefined; }; } +/** + * 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 { + /** + * Registered factory name. + */ + name: string; + /** + * Factory input value. + */ + args: { + [k: string]: unknown | undefined; + }; + 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. * @@ -5554,6 +6108,180 @@ export interface HistoryCompactResult { summaryContent?: string; contextWindow?: HistoryCompactContextWindow; } +/** + * Rewind points and file-change-tracking availability for the session. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryListRewindPointsResult". + */ +/** @experimental */ +export interface HistoryListRewindPointsResult { + /** + * Whether this session captured file changes from its first turn. + */ + fileChangeTrackingEnabled: boolean; + unavailableReason?: HistoryRewindUnavailableReason; + /** + * Root user turns in chronological order. Empty when `unavailableReason` is set. + */ + points: HistoryRewindPoint[]; +} +/** + * A root user turn that the session can rewind to. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryRewindPoint". + */ +/** @experimental */ +export interface HistoryRewindPoint { + /** + * ID of the user.message event that begins the discarded suffix. + */ + eventId: string; + /** + * User-visible message text for the turn. + */ + userMessage: string; + /** + * ISO timestamp of the user turn. + */ + timestamp: string; + /** + * Whether at least one file in this turn or a later turn can be restored. + */ + canRestoreFiles: boolean; + /** + * Number of unique files in this turn and all later turns that have captured changes. + */ + fileCount: number; + /** + * Whether this turn itself captured any file changes. + */ + turnChangedFiles: boolean; + /** + * Lines added by this turn's captured file changes. + */ + linesAdded: number; + /** + * Lines removed by this turn's captured file changes. + */ + linesRemoved: number; + /** + * Whether this turn was an automatically injected autopilot continuation. + */ + isAutopilotContinuation: boolean; +} +/** + * Event boundary to preview for conversation-and-files rewind. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryPreviewRewindRequest". + */ +/** @experimental */ +export interface HistoryPreviewRewindRequest { + /** + * ID of the user.message event that begins the discarded suffix. + */ + eventId: string; +} +/** + * Files and aggregate changes for a prospective rewind. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryPreviewRewindResult". + */ +/** @experimental */ +export interface HistoryPreviewRewindResult { + /** + * Whether file restore is available for this session. This is authoritative: switch on it and read `reason` only when it is false. + */ + available: boolean; + reason?: HistoryRewindUnavailableReason; + /** + * Number of unique files in the preview. + */ + fileCount: number; + /** + * Files ordered by path. + */ + files: HistoryRewindFilePreview[]; +} +/** + * A file that a conversation-and-files rewind would restore. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryRewindFilePreview". + */ +/** @experimental */ +export interface HistoryRewindFilePreview { + /** + * Absolute path of the captured file. + */ + path: string; + changeType: HistoryRewindChangeType; + /** + * Lines added across the discarded turns. + */ + linesAdded: number; + /** + * Lines removed across the discarded turns. + */ + linesRemoved: number; +} +/** + * Boundary and mode for rewinding session history. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryRewindRequest". + */ +/** @experimental */ +export interface HistoryRewindRequest { + /** + * ID of the user.message event that begins the discarded suffix. + */ + eventId: string; + mode: HistoryRewindMode; +} +/** + * Structured outcome of a rewind request. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistoryRewindResult". + */ +/** @experimental */ +export interface HistoryRewindResult { + outcome: HistoryRewindOutcome; + /** + * Number of persisted events removed by conversation truncation. Present only when truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`) and for `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`. + */ + eventsRemoved?: number; + /** + * Absolute paths restored to their captured preimages. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. + */ + restoredFiles: string[]; + /** + * Captured files intentionally left unchanged. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. + */ + skippedFiles: HistorySkippedFileRestore[]; + /** + * Failure detail. Set only for the failure and partial-failure outcomes (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`). + */ + error?: string; +} +/** + * A captured file that rewind intentionally left unchanged. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HistorySkippedFileRestore". + */ +/** @experimental */ +export interface HistorySkippedFileRestore { + /** + * Absolute path of the skipped file. + */ + path: string; + reason: HistoryFileRestoreSkipReason; +} /** * Markdown summary of the conversation context (empty when not available). * @@ -5592,6 +6320,14 @@ export interface HistoryTruncateResult { * Number of events that were removed */ eventsRemoved: number; + /** + * True when conversation truncation succeeded but post-truncation workspace checkpoint cleanup failed. History is already truncated; callers may still prune snapshots but should report a checkpoint-cleanup rather than a truncation failure. + */ + checkpointCleanupFailed?: boolean; + /** + * Failure detail when checkpointCleanupFailed is true. + */ + checkpointCleanupError?: string; } /** * Runtime-owned wire payload for a server-to-client hook callback invocation. @@ -5652,7 +6388,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 +6401,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 +6421,10 @@ export interface InstalledPluginSourceUrl { source: "url"; url: string; ref?: string; + /** + * Optional full 40-character hexadecimal commit SHA. + */ + sha?: string; path?: string; } /** @@ -5852,6 +6596,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. * @@ -6675,6 +7445,10 @@ export interface McpServerConfigStdio { oidc?: McpServerAuthConfig; auth?: McpServerAuthConfig; deferTools?: McpServerConfigDeferTools; + /** + * Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery is unaffected. + */ + disableToolCache?: boolean; /** * Executable command used to start the Stdio MCP server process. */ @@ -6732,6 +7506,10 @@ export interface McpServerConfigHttp { oidc?: McpServerAuthConfig; auth?: McpServerAuthConfig; deferTools?: McpServerConfigDeferTools; + /** + * Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery is unaffected. + */ + disableToolCache?: boolean; /** * URL of the remote MCP server endpoint. */ @@ -7235,6 +8013,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. * @@ -7678,7 +8482,7 @@ export interface McpSetEnvValueModeResult { mode: McpSetEnvValueModeDetails; } /** - * Server name and configuration for an individual MCP server start. + * Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "McpStartServerRequest". @@ -7689,7 +8493,7 @@ export interface McpStartServerRequest { * Name of the MCP server to start */ serverName: string; - config: McpServerConfig; + config?: McpServerConfig; } /** * MCP server startup filtering result. @@ -9742,13 +10546,18 @@ export interface PermissionsPathsUpdatePrimaryResult { /** @experimental */ export interface PermissionsPendingRequestsRequest {} /** - * No parameters; clears all session-scoped tool permission approvals. + * Clears session-scoped tool permission approvals, and optionally the location-scoped ones. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "PermissionsResetSessionApprovalsRequest". */ /** @experimental */ -export interface PermissionsResetSessionApprovalsRequest {} +export interface PermissionsResetSessionApprovalsRequest { + /** + * Whether location-scoped approvals are cleared too. Defaults to `true`. + */ + includeLocation?: boolean; +} /** * Indicates whether the operation succeeded. * @@ -10982,6 +11791,120 @@ 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 { + /** + * Opaque runtime-owned filter object. + */ + filter: { + [k: string]: unknown | undefined; + }; +} +/** + * 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. * @@ -11020,11 +11943,36 @@ export interface QueuePendingItemsResult { * via the `definition` "QueueRemoveMostRecentResult". */ /** @experimental */ -export interface QueueRemoveMostRecentResult { +export interface QueueRemoveMostRecentResult { + /** + * True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. + */ + 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 { /** - * True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. + * User-facing pending items in FIFO order. */ - removed: boolean; + 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. @@ -11579,6 +12527,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 +12669,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 +12712,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 +12826,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 +12916,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 +12954,31 @@ 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; + /** + * Optional structured notification kind. + */ + kind?: { + [k: string]: unknown | undefined; + }; + /** + * Internal delivery options, including passive policy. + */ + options?: { + [k: string]: unknown | undefined; + }; +} /** * Agents discovered across user, project, plugin, and remote sources. * @@ -12328,7 +13441,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". @@ -12379,6 +13492,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]: unknown | 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 +13655,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 +13668,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 +13688,10 @@ export interface SessionInstalledPluginSourceUrl { source: "url"; url: string; ref?: string; + /** + * Optional full 40-character hexadecimal commit SHA. + */ + sha?: string; path?: string; } /** @@ -12737,6 +13914,10 @@ export interface SessionOpenOptions { * Opt-in: self-fetch and enforce enterprise managed settings at session bootstrap. */ enableManagedSettings?: boolean; + /** + * Opt in to capturing file changes for session rewind and session diff. Capture cannot reconstruct changes made before it was enabled. On create it starts capture from the first turn. It is also honored on resume: for a session that already has tracked prior turns, tracking continues automatically even if this is omitted; passing it on resume additionally enables tracking for an eligible session that has no prior root turn yet. Resuming a session whose prior root turns were never tracked has no restorable baseline, so tracking stays disabled for it and rewind reports file change tracking as unavailable; the resume itself still succeeds, so sessions that predate tracking remain loadable. The opt-in is only rejected when the session can never track (a subagent session, or one without local session storage). It is intentionally absent from the mutable options update because enabling it after edits have occurred would create an incomplete, misleading baseline. Subagents share the parent session's capture store and are not tracked as separate rewind points: a file a subagent writes is attributed to whichever root user turn was open when the capture was staged, just before the tool body ran. A turn cannot open while a staged capture is still in flight, so a subagent tool that staged under the spawning turn stays attributed to it however late the write lands, while a capture it stages after the user's next message belongs to that later turn. Attribution decides which turn's rewind point counts and file preview include that write; it does not narrow which rewinds revert it, because a rewind restores every capture from the selected turn onward, so the earlier spawning turn reverts it as well. + */ + enableFileChangeTracking?: boolean; /** * Feature-flag values resolved by the host. */ @@ -12807,12 +13988,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 +14084,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 +14104,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. * @@ -13252,6 +14481,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 +14831,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 +14895,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 +15207,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; @@ -13939,7 +15236,7 @@ export interface SessionUpdateOptionsParams { */ disabledSkills?: string[]; /** - * Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag. + * Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`. */ enableOnDemandInstructionDiscovery?: boolean; /** @@ -14006,6 +15303,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. * @@ -15479,6 +16780,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. @@ -16002,7 +17307,7 @@ export interface VisibilitySetResult { /** @experimental */ export interface WorkspaceDiffFileChange { /** - * Path to the changed file, relative to the workspace root. + * Path to the changed file, relative to the workspace root when the file lives under it. A file changed outside the workspace root keeps a `../`-relative path, or an absolute path when no relative path exists (for example a different Windows drive). */ path: string; /** @@ -16023,24 +17328,67 @@ export interface WorkspaceDiffFileChange { * Workspace diff result for the requested mode. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema - * via the `definition` "WorkspaceDiffResult". + * via the `definition` "WorkspaceDiffResult". + */ +/** @experimental */ +export interface WorkspaceDiffResult { + requestedMode: WorkspaceDiffMode; + mode: WorkspaceDiffMode; + /** + * Changed files and their unified diffs. + */ + changes: WorkspaceDiffFileChange[]; + /** + * Default branch used for a branch diff, when branch mode was requested. + */ + baseBranch?: string; + /** + * Whether the requested diff fell back to unstaged changes, either because branch diff failed or session diff was unavailable. + */ + isFallback: boolean; + unavailableReason?: HistoryRewindUnavailableReason; +} +/** + * Compaction summary checkpoint to persist. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "WorkspacesAddSummaryRequest". */ /** @experimental */ -export interface WorkspaceDiffResult { - requestedMode: WorkspaceDiffMode; - mode: WorkspaceDiffMode; +export interface WorkspacesAddSummaryRequest { /** - * Changed files and their unified diffs. + * Summary title shown in checkpoint listings. */ - changes: WorkspaceDiffFileChange[]; + title: string; /** - * Default branch used for a branch diff, when branch mode was requested. + * Markdown summary content to persist. */ - baseBranch?: string; + 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 { /** - * Whether a requested branch diff fell back to unstaged changes because branch diff failed. + * True when the objective file exists. */ - isFallback: boolean; + exists: boolean; } /** * Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename. @@ -16080,6 +17428,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 +17455,21 @@ 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 { + /** + * Opaque workspace context supplied by the session host. + */ + context?: { + [k: string]: unknown | undefined; + }; +} /** * Current workspace metadata for the session, including its absolute filesystem path when available. * @@ -16155,6 +17531,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 +17635,64 @@ 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 { + /** + * Opaque workspace context supplied by the session host. + */ + context?: { + [k: string]: unknown | undefined; + }; + /** + * 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 * @@ -16295,6 +17742,13 @@ export function createServerRpc(connection: MessageConnection) { */ list: async (params: ModelsListRequest): Promise => connection.sendRequest("models.list", params), + /** + * Returns the running runtime's complete catalog of well-known built-in model IDs without authentication or network access. + * + * @returns The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. + */ + getBuiltInCatalog: async (): Promise => + connection.sendRequest("models.getBuiltInCatalog", {}), }, /** @experimental */ tools: { @@ -16927,6 +18381,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 +18417,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 +18496,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 +18612,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 +18630,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 +18829,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 +18886,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. * @@ -17345,7 +18944,7 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin saveLargePaste: async (params: WorkspacesSaveLargePasteRequest): Promise => connection.sendRequest("session.workspaces.saveLargePaste", { sessionId, ...params }), /** - * Computes a diff for the session workspace. + * Computes a diff for the session workspace. Never rejects for a busy session: a `session`-mode diff that cannot read the session's file-change captures falls back to an unstaged git diff with `isFallback: true` and reports why in `unavailableReason`. * * @param params Parameters for computing a workspace diff. * @@ -17640,9 +19239,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin removeGitHub: async (): Promise => connection.sendRequest("session.mcp.removeGitHub", { sessionId }), /** - * Starts an individual MCP server on the live session from a caller-supplied config. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server. + * Starts an individual MCP server on the live session. Omit `config` for a config-free start-by-name of an already-configured server (reuses the server's already-registered configuration); supply `config` to start from a caller-supplied configuration. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server. * - * @param params Server name and configuration for an individual MCP server start. + * @param params Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server. */ startServer: async (params: McpStartServerRequest): Promise => connection.sendRequest("session.mcp.startServer", { sessionId, ...params }), @@ -17689,6 +19288,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: { @@ -18155,10 +19763,12 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin /** * Clears session-scoped tool permission approvals. * + * @param params Clears session-scoped tool permission approvals, and optionally the location-scoped ones. + * * @returns Indicates whether the operation succeeded. */ - resetSessionApprovals: async (): Promise => - connection.sendRequest("session.permissions.resetSessionApprovals", { sessionId }), + resetSessionApprovals: async (params: PermissionsResetSessionApprovalsRequest): Promise => + connection.sendRequest("session.permissions.resetSessionApprovals", { sessionId, ...params }), /** * Notifies the runtime that a permission prompt UI has been shown to the user. * @@ -18366,9 +19976,21 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin connection.sendRequest("session.metadata.recomputeContextTokens", { sessionId, ...params }), }, /** @experimental */ + contentExclusion: { + /** + * Checks local file system absolute paths within the session working directory against its content-exclusion policy. Results preserve input order. Unsupported paths/filesystems and unavailable policy evaluation return available false, and callers must treat every requested path as excluded. + * + * @param params Local file system absolute paths within the session working directory to check against its content-exclusion policy. + * + * @returns Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable. + */ + checkPaths: async (params: ContentExclusionCheckPathsRequest): Promise => + connection.sendRequest("session.contentExclusion.checkPaths", { sessionId, ...params }), + }, + /** @experimental */ shell: { /** - * Starts a shell command and streams output through session notifications. + * Starts a shell command and streams output through session notifications. The command runs as the leader of its own process group (POSIX) or in a dedicated job object (Windows), so a forced termination — via "shell.kill", the request timeout, or session disposal — signals that whole group/job rather than only the direct child. Two gaps are worth planning for: a command that exits on its own does not trigger that teardown, and on POSIX a descendant that moves itself into a new session or process group (for example via "setsid") leaves the signalled group, so either can leave a background process running. * * @param params Shell command to run, with optional working directory and timeout in milliseconds. * @@ -18377,7 +19999,7 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin exec: async (params: ShellExecRequest): Promise => connection.sendRequest("session.shell.exec", { sessionId, ...params }), /** - * Sends a signal to a shell process previously started via "shell.exec". + * Sends a signal to a shell process previously started via "shell.exec". The signal targets the command's whole process group (POSIX) or job object (Windows), so descendants still in that group are signalled too, not just the direct child. On POSIX a descendant that moved itself into a new session or process group (for example via "setsid") is no longer in the signalled group and survives. * * @param params Identifier of a process previously returned by "shell.exec" and the signal to send. * @@ -18424,6 +20046,31 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ truncate: async (params: HistoryTruncateRequest): Promise => connection.sendRequest("session.history.truncate", { sessionId, ...params }), + /** + * Lists the user turns that the session can rewind to. Never rejects for a busy session: rewind reads need the session's file-change captures to be settled, so a session that still holds active work answers with `unavailableReason: "session-busy"` and no points, which the caller can retry. + * + * @returns Rewind points and file-change-tracking availability for the session. + */ + listRewindPoints: async (): Promise => + connection.sendRequest("session.history.listRewindPoints", { sessionId }), + /** + * Previews the files that a conversation-and-files rewind would restore. + * + * @param params Event boundary to preview for conversation-and-files rewind. + * + * @returns Files and aggregate changes for a prospective rewind. + */ + previewRewind: async (params: HistoryPreviewRewindRequest): Promise => + connection.sendRequest("session.history.previewRewind", { sessionId, ...params }), + /** + * Rewinds the session conversation, optionally restoring files changed by the discarded turns. Not crash-atomic: file restore and conversation truncation are separate stores, applied in that order, so a process crash between them can leave the workspace rewound while the conversation still contains the discarded turns. There is no recovery journal; re-running the same rewind is the recovery path for a crash before truncation lands, since file restore is idempotent (already-restored files are reported as skipped) and truncation is re-derived from the still-retained boundary event. After truncation lands that boundary no longer exists, so the same request is rejected; the only stage that can still be outstanding is snapshot pruning, whose failure leaves orphan snapshots the capture store tolerates. The reverse inconsistency cannot occur, because truncation is never applied before file restore succeeds. + * + * @param params Boundary and mode for rewinding session history. + * + * @returns Structured outcome of a rewind request. + */ + rewind: async (params: HistoryRewindRequest): Promise => + connection.sendRequest("session.history.rewind", { sessionId, ...params }), /** * Cancels any in-progress background compaction on a local session. * @@ -18589,6 +20236,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 +20299,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 +20543,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 +20683,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 b9c9612b8f..916b08e2b4 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -104,6 +104,7 @@ export type SessionEvent = | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent + | FactoryRunUpdatedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent @@ -156,6 +157,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 */ @@ -529,6 +538,21 @@ export type PermissionPromptRequest = | PermissionPromptRequestHook | PermissionPromptRequestExtensionManagement | PermissionPromptRequestExtensionPermissionAccess; +/** + * Why the auto-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs. + */ +/** @experimental */ +export type AutoApprovalJudgeFailureReason = + /** The judge model call exceeded its deadline. */ + | "timeout" + /** The judge model call was cancelled before it returned. */ + | "abort" + /** The judge model call completed but returned no content. */ + | "empty_response" + /** The judge model call failed (for example a transport, authentication, or rate-limit error). */ + | "model_error" + /** The judge model replied, but the reply carried no ALLOW/DENY verdict. */ + | "parse_error"; /** * Outcome of the auto-approval safety judge for a permission request. Present only when auto mode is enabled; its absence means the judge did not evaluate the request (auto mode was off). */ @@ -962,7 +986,7 @@ export interface ResumeData { */ contextTier?: ContextTier | null; /** - * When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume. + * When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false or omitted, pending work is normally marked as interrupted unless the resume passively joined live work owned by another client; sessionWasActive distinguishes that case. */ continuePendingWork?: boolean; /** @@ -995,7 +1019,7 @@ export interface ResumeData { */ sessionLimits?: SessionLimitsConfig | null; /** - * True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. + * True when this resume passively joined a session that already had live work running in the runtime - an agent turn, a native queue run, a queued resume continuation, or an in-flight send (for example, an extension joining a session another client was actively driving). False (or omitted) when the session had no live work or when the resume explicitly abandoned pending work, including cold resumes and suspended sessions that remain resident in memory. */ sessionWasActive?: boolean; verbosity?: Verbosity; @@ -1242,6 +1266,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 +2681,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; /** @@ -3365,6 +3390,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 +3619,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 @@ -4037,6 +4064,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 +4105,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 +4321,7 @@ export interface ModelCallFailureData { */ reasoningEffort?: string; requestFingerprint?: ModelCallFailureRequestFingerprint; + rte?: boolean; /** * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */ @@ -4372,6 +4405,12 @@ export interface ModelCallStartData { * Model identifier used for this API call, when known */ model?: string; + /** + * Previous response or interaction identifier included in the model request, when present + * + * @internal + */ + previousResponseId?: string; /** * Identifier of the assistant turn that initiated the model call */ @@ -4523,6 +4562,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 @@ -4731,6 +4771,7 @@ export interface ToolExecutionCompleteData { */ parentToolCallId?: string; result?: ToolExecutionCompleteResult; + rte?: boolean; /** * Whether this tool execution ran inside a sandbox container */ @@ -5863,6 +5904,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 @@ -6485,6 +6530,11 @@ export interface PermissionPromptRequestCommands { */ /** @experimental */ export interface PermissionAutoApproval { + failureReason?: AutoApprovalJudgeFailureReason; + /** + * Model id that produced the recommendation, when the judge was consulted and reported one. Absent for `excluded` (the judge was not consulted) and for failures that occurred before a model was selected. + */ + model?: string; /** * Human-readable reason for the judge's recommendation, when available. */ @@ -8598,6 +8648,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. */ diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 713e78cca0..fedc5e5b78 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""" @@ -1334,6 +1337,52 @@ def to_dict(self) -> dict: result["owner"] = from_str(self.owner) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ContentExclusionCheckPathsRequest: + """Local file system absolute paths within the session working directory to check against + its content-exclusion policy. + """ + paths: list[str] + """Local file system absolute paths within the session working directory to check. Results + are returned in the same order, including duplicates. + """ + + @staticmethod + def from_dict(obj: Any) -> 'ContentExclusionCheckPathsRequest': + assert isinstance(obj, dict) + paths = from_list(from_str, obj.get("paths")) + return ContentExclusionCheckPathsRequest(paths) + + def to_dict(self) -> dict: + result: dict = {} + result["paths"] = from_list(from_str, self.paths) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ContentExclusionPathCheck: + """Content-exclusion decision for one requested path.""" + + excluded: bool + """Whether the session's complete content-exclusion policy excludes the path.""" + + path: str + """The path supplied by the caller.""" + + @staticmethod + def from_dict(obj: Any) -> 'ContentExclusionPathCheck': + assert isinstance(obj, dict) + excluded = from_bool(obj.get("excluded")) + path = from_str(obj.get("path")) + return ContentExclusionPathCheck(excluded, path) + + def to_dict(self) -> dict: + result: dict = {} + result["excluded"] = from_bool(self.excluded) + result["path"] = from_str(self.path) + return result + # Experimental: this type is part of an experimental API and may change or be removed. class ContentFilterMode(Enum): """Controls how MCP tool result content is filtered: none leaves content unchanged, markdown @@ -2177,6 +2226,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 +2304,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 +2381,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 +2397,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 +2417,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 +2428,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 +2499,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 +2511,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 +2553,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 +2568,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 +2638,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: @@ -2713,6 +3011,161 @@ def to_dict(self) -> dict: result["customInstructions"] = from_union([from_str, from_none], self.custom_instructions) return result +# Experimental: this type is part of an experimental API and may change or be removed. +class HistoryFileRestoreSkipReason(Enum): + """Reason a captured file was not restored. + + Reason the file was not restored. + """ + SKIPPED_CAPTURE = "skipped-capture" + USER_MODIFIED = "user-modified" + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HistoryRewindPoint: + """A root user turn that the session can rewind to.""" + + can_restore_files: bool + """Whether at least one file in this turn or a later turn can be restored.""" + + event_id: str + """ID of the user.message event that begins the discarded suffix.""" + + file_count: int + """Number of unique files in this turn and all later turns that have captured changes.""" + + is_autopilot_continuation: bool + """Whether this turn was an automatically injected autopilot continuation.""" + + lines_added: int + """Lines added by this turn's captured file changes.""" + + lines_removed: int + """Lines removed by this turn's captured file changes.""" + + timestamp: str + """ISO timestamp of the user turn.""" + + turn_changed_files: bool + """Whether this turn itself captured any file changes.""" + + user_message: str + """User-visible message text for the turn.""" + + @staticmethod + def from_dict(obj: Any) -> 'HistoryRewindPoint': + assert isinstance(obj, dict) + can_restore_files = from_bool(obj.get("canRestoreFiles")) + event_id = from_str(obj.get("eventId")) + file_count = from_int(obj.get("fileCount")) + is_autopilot_continuation = from_bool(obj.get("isAutopilotContinuation")) + lines_added = from_int(obj.get("linesAdded")) + lines_removed = from_int(obj.get("linesRemoved")) + timestamp = from_str(obj.get("timestamp")) + turn_changed_files = from_bool(obj.get("turnChangedFiles")) + user_message = from_str(obj.get("userMessage")) + return HistoryRewindPoint(can_restore_files, event_id, file_count, is_autopilot_continuation, lines_added, lines_removed, timestamp, turn_changed_files, user_message) + + def to_dict(self) -> dict: + result: dict = {} + result["canRestoreFiles"] = from_bool(self.can_restore_files) + result["eventId"] = from_str(self.event_id) + result["fileCount"] = from_int(self.file_count) + result["isAutopilotContinuation"] = from_bool(self.is_autopilot_continuation) + result["linesAdded"] = from_int(self.lines_added) + result["linesRemoved"] = from_int(self.lines_removed) + result["timestamp"] = from_str(self.timestamp) + result["turnChangedFiles"] = from_bool(self.turn_changed_files) + result["userMessage"] = from_str(self.user_message) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +class HistoryRewindUnavailableReason(Enum): + """Why the listed points could not be produced, when applicable; the points list is empty + whenever it is set. `unsupported-remote-session` is permanent for the session and comes + with `fileChangeTrackingEnabled: false`. `session-busy` is transient and only ever + reported by a session that *is* tracking (`fileChangeTrackingEnabled: true`), because the + file-change captures cannot be read while work that may still mutate them is in flight; + the same request succeeds once the session settles, so a client that wants points should + retry rather than treat it as a failure. It is never `file-change-tracking-disabled`: an + untracked local session still lists conversation-only points and reports that through + `fileChangeTrackingEnabled: false`. + + Reason a rewind read (rewind points, file-restore preview, or session diff) could not be + answered from the session's file-change captures. + + Why file restore is unavailable, when applicable. Populated only when `available` is + false and never set when `available` is true. + + Why the session diff could not be produced, when applicable. Set only when `session` mode + was requested and `isFallback` is true, so a client can tell the permanent + `file-change-tracking-disabled` apart from the transient `session-busy`, which the same + request answers once the session settles. Never set for `unstaged` or `branch` mode, and + never `unsupported-remote-session`: a remote session's captures live on its own host, so + a `session`-mode diff is rejected for one rather than answered with a controller-side + fallback. + """ + FILE_CHANGE_TRACKING_DISABLED = "file-change-tracking-disabled" + SESSION_BUSY = "session-busy" + UNSUPPORTED_REMOTE_SESSION = "unsupported-remote-session" + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HistoryPreviewRewindRequest: + """Event boundary to preview for conversation-and-files rewind.""" + + event_id: str + """ID of the user.message event that begins the discarded suffix.""" + + @staticmethod + def from_dict(obj: Any) -> 'HistoryPreviewRewindRequest': + assert isinstance(obj, dict) + event_id = from_str(obj.get("eventId")) + return HistoryPreviewRewindRequest(event_id) + + def to_dict(self) -> dict: + result: dict = {} + result["eventId"] = from_str(self.event_id) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +class HistoryRewindChangeType(Enum): + """Aggregate change made across the discarded turns. + + Aggregate file change represented by a rewind preview. + """ + CREATED = "created" + DELETED = "deleted" + MODIFIED = "modified" + +# Experimental: this type is part of an experimental API and may change or be removed. +class HistoryRewindMode(Enum): + """Scope of a rewind operation. + + Whether to rewind only conversation history or also restore captured files. + """ + CONVERSATION = "conversation" + CONVERSATION_AND_FILES = "conversation-and-files" + +# Experimental: this type is part of an experimental API and may change or be removed. +class HistoryRewindOutcome(Enum): + """Outcome of a rewind request. + + Overall rewind outcome. This discriminates the result: it governs which of the remaining + fields are populated, so consumers must switch on it before reading `eventsRemoved`, + `restoredFiles`, `skippedFiles`, or `error`. See each field for the outcomes that + populate it. + """ + CHECKPOINT_CLEANUP_FAILED = "checkpoint-cleanup-failed" + FILES_ROLLED_BACK = "files-rolled-back" + FILE_CHANGE_TRACKING_DISABLED = "file-change-tracking-disabled" + ROLLBACK_INCOMPLETE = "rollback-incomplete" + SESSION_BUSY = "session-busy" + SNAPSHOT_PRUNE_FAILED = "snapshot-prune-failed" + SUCCESS = "success" + TRUNCATION_FAILED = "truncation-failed" + UNSUPPORTED_REMOTE_SESSION = "unsupported-remote-session" + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class HistorySummarizeForHandoffResult: @@ -2761,15 +3214,30 @@ class HistoryTruncateResult: events_removed: int """Number of events that were removed""" + checkpoint_cleanup_error: str | None = None + """Failure detail when checkpointCleanupFailed is true.""" + + checkpoint_cleanup_failed: bool | None = None + """True when conversation truncation succeeded but post-truncation workspace checkpoint + cleanup failed. History is already truncated; callers may still prune snapshots but + should report a checkpoint-cleanup rather than a truncation failure. + """ + @staticmethod def from_dict(obj: Any) -> 'HistoryTruncateResult': assert isinstance(obj, dict) events_removed = from_int(obj.get("eventsRemoved")) - return HistoryTruncateResult(events_removed) + checkpoint_cleanup_error = from_union([from_str, from_none], obj.get("checkpointCleanupError")) + checkpoint_cleanup_failed = from_union([from_bool, from_none], obj.get("checkpointCleanupFailed")) + return HistoryTruncateResult(events_removed, checkpoint_cleanup_error, checkpoint_cleanup_failed) def to_dict(self) -> dict: result: dict = {} result["eventsRemoved"] = from_int(self.events_removed) + if self.checkpoint_cleanup_error is not None: + result["checkpointCleanupError"] = from_union([from_str, from_none], self.checkpoint_cleanup_error) + if self.checkpoint_cleanup_failed is not None: + result["checkpointCleanupFailed"] = from_union([from_bool, from_none], self.checkpoint_cleanup_failed) return result class HMACAuthInfoType(Enum): @@ -2912,6 +3380,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 +4538,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 @@ -5753,14 +6305,21 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class PermissionsResetSessionApprovalsRequest: - """No parameters; clears all session-scoped tool permission approvals.""" + """Clears session-scoped tool permission approvals, and optionally the location-scoped ones.""" + + include_location: bool | None = None + """Whether location-scoped approvals are cleared too. Defaults to `true`.""" + @staticmethod def from_dict(obj: Any) -> 'PermissionsResetSessionApprovalsRequest': assert isinstance(obj, dict) - return PermissionsResetSessionApprovalsRequest() + include_location = from_union([from_bool, from_none], obj.get("includeLocation")) + return PermissionsResetSessionApprovalsRequest(include_location) def to_dict(self) -> dict: result: dict = {} + if self.include_location is not None: + result["includeLocation"] = from_union([from_bool, from_none], self.include_location) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -6494,6 +7053,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 +7741,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. @@ -7079,21 +7916,89 @@ def from_dict(obj: Any) -> 'ScheduleEntry': def to_dict(self) -> dict: result: dict = {} result["id"] = from_int(self.id) - result["nextRunAt"] = self.next_run_at.isoformat() - result["prompt"] = from_str(self.prompt) - result["recurring"] = from_bool(self.recurring) - if self.at is not None: - result["at"] = from_union([from_int, from_none], self.at) - if self.cron is not None: - result["cron"] = from_union([from_str, from_none], self.cron) - if self.display_prompt is not None: - result["displayPrompt"] = from_union([from_str, from_none], self.display_prompt) - if self.interval_ms is not None: - result["intervalMs"] = from_union([from_int, from_none], self.interval_ms) - if self.self_paced is not None: - result["selfPaced"] = from_union([from_bool, from_none], self.self_paced) - if self.tz is not None: - result["tz"] = from_union([from_str, from_none], self.tz) + result["nextRunAt"] = self.next_run_at.isoformat() + result["prompt"] = from_str(self.prompt) + result["recurring"] = from_bool(self.recurring) + if self.at is not None: + result["at"] = from_union([from_int, from_none], self.at) + if self.cron is not None: + result["cron"] = from_union([from_str, from_none], self.cron) + if self.display_prompt is not None: + result["displayPrompt"] = from_union([from_str, from_none], self.display_prompt) + if self.interval_ms is not None: + result["intervalMs"] = from_union([from_int, from_none], self.interval_ms) + if self.self_paced is not None: + result["selfPaced"] = from_union([from_bool, from_none], self.self_paced) + 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 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. @@ -7222,10 +8127,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 +8209,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 +8714,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 +8893,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 +9469,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 +9730,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 +9791,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 +11575,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 +11665,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 +11723,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: @@ -10627,71 +11796,128 @@ def from_dict(obj: Any) -> 'WorkspacesReadFileRequest': def to_dict(self) -> dict: result: dict = {} - result["path"] = from_str(self.path) + 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 WorkspacesReadFileResult: + """Contents of the requested workspace file as a UTF-8 string.""" + + content: str + """File content as a UTF-8 string""" + + @staticmethod + def from_dict(obj: Any) -> 'WorkspacesReadFileResult': + assert isinstance(obj, dict) + content = from_str(obj.get("content")) + return WorkspacesReadFileResult(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 WorkspacesSaveLargePasteRequest: + """Pasted content to save as a UTF-8 file in the session workspace.""" + + content: str + """Pasted content to save as a UTF-8 file""" + + @staticmethod + def from_dict(obj: Any) -> 'WorkspacesSaveLargePasteRequest': + assert isinstance(obj, dict) + content = from_str(obj.get("content")) + return WorkspacesSaveLargePasteRequest(content) + + def to_dict(self) -> dict: + result: dict = {} + result["content"] = from_str(self.content) + return result + +@dataclass +class Saved: + filename: str + """Filename within the workspace files directory""" + + file_path: str + """Absolute filesystem path to the saved paste file""" + + size_bytes: int + """Size of the saved file in bytes""" + + @staticmethod + def from_dict(obj: Any) -> 'Saved': + assert isinstance(obj, dict) + filename = from_str(obj.get("filename")) + file_path = from_str(obj.get("filePath")) + size_bytes = from_int(obj.get("sizeBytes")) + return Saved(filename, file_path, size_bytes) + + def to_dict(self) -> dict: + result: dict = {} + result["filename"] = from_str(self.filename) + result["filePath"] = from_str(self.file_path) + 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 WorkspacesReadFileResult: - """Contents of the requested workspace file as a UTF-8 string.""" +class WorkspacesTruncateSummariesRequest: + """Rollback point for local workspace summaries.""" - content: str - """File content as a UTF-8 string""" + keep_count: int + """Number of newest summaries to keep.""" @staticmethod - def from_dict(obj: Any) -> 'WorkspacesReadFileResult': + def from_dict(obj: Any) -> 'WorkspacesTruncateSummariesRequest': assert isinstance(obj, dict) - content = from_str(obj.get("content")) - return WorkspacesReadFileResult(content) + keep_count = from_int(obj.get("keepCount")) + return WorkspacesTruncateSummariesRequest(keep_count) def to_dict(self) -> dict: result: dict = {} - result["content"] = from_str(self.content) + 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 WorkspacesSaveLargePasteRequest: - """Pasted content to save as a UTF-8 file in the session workspace.""" +class WorkspacesWriteAutopilotObjectiveRequest: + """Autopilot objective file content to persist.""" content: str - """Pasted content to save as a UTF-8 file""" + """Autopilot objective file content.""" @staticmethod - def from_dict(obj: Any) -> 'WorkspacesSaveLargePasteRequest': + def from_dict(obj: Any) -> 'WorkspacesWriteAutopilotObjectiveRequest': assert isinstance(obj, dict) content = from_str(obj.get("content")) - return WorkspacesSaveLargePasteRequest(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 Saved: - filename: str - """Filename within the workspace files directory""" - - file_path: str - """Absolute filesystem path to the saved paste file""" +class WorkspacesWriteAutopilotObjectiveResult: + """Result of writing the autopilot objective file.""" - size_bytes: int - """Size of the saved file in bytes""" + operation: str + """Filesystem operation performed.""" @staticmethod - def from_dict(obj: Any) -> 'Saved': + def from_dict(obj: Any) -> 'WorkspacesWriteAutopilotObjectiveResult': assert isinstance(obj, dict) - filename = from_str(obj.get("filename")) - file_path = from_str(obj.get("filePath")) - size_bytes = from_int(obj.get("sizeBytes")) - return Saved(filename, file_path, size_bytes) + operation = from_str(obj.get("operation")) + return WorkspacesWriteAutopilotObjectiveResult(operation) def to_dict(self) -> dict: result: dict = {} - result["filename"] = from_str(self.filename) - result["filePath"] = from_str(self.file_path) - result["sizeBytes"] = from_int(self.size_bytes) + result["operation"] = from_str(self.operation) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -11173,6 +12399,32 @@ def to_dict(self) -> dict: result["summary"] = from_union([from_str, from_none], self.summary) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ContentExclusionCheckPathsResult: + """Batch content-exclusion result. Callers must fail closed when policy evaluation is + unavailable. + """ + available: bool + """Whether the session's policy service was available for the complete batch. When false, + checks is empty and callers must treat every requested path as excluded. + """ + checks: list[ContentExclusionPathCheck] + """Per-path decisions in request order. Empty when available is false.""" + + @staticmethod + def from_dict(obj: Any) -> 'ContentExclusionCheckPathsResult': + assert isinstance(obj, dict) + available = from_bool(obj.get("available")) + checks = from_list(ContentExclusionPathCheck.from_dict, obj.get("checks")) + return ContentExclusionCheckPathsResult(available, checks) + + def to_dict(self) -> dict: + result: dict = {} + result["available"] = from_bool(self.available) + result["checks"] = from_list(lambda x: to_class(ContentExclusionPathCheck, x), self.checks) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MetadataContextHeaviestMessagesResult: @@ -11953,6 +13205,9 @@ def to_dict(self) -> dict: class FactoryAgentRequest: """Parameters for one factory-scoped subagent call.""" + execution_token: str + """Opaque token identifying the current factory execution attempt.""" + factory_run_id: str """Factory run identifier that owns the subagent.""" @@ -11965,18 +13220,76 @@ class FactoryAgentRequest: @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(factory_run_id, opts, 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.""" + + reason: str | None = None + """Human-readable reason the resume did not proceed.""" + + code: str | None = None + """Stable failure code.""" + + operation: FactoryDurableOperation | None = None + """Execution-critical durable operation that failed.""" + + @staticmethod + def from_dict(obj: Any) -> 'FactoryRunFailure': + 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")) + 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["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. @dataclass class FactoryLogLine: @@ -12008,46 +13321,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. @@ -12090,36 +13485,157 @@ class HistoryCompactResult: success: bool """Whether compaction completed successfully""" - tokens_removed: int - """Number of tokens freed by compaction""" + tokens_removed: int + """Number of tokens freed by compaction""" + + context_window: HistoryCompactContextWindow | None = None + """Post-compaction context window usage breakdown""" + + summary_content: str | None = None + """Summary text produced by compaction. Omitted when compaction did not produce a summary + (e.g. failure path). + """ + + @staticmethod + def from_dict(obj: Any) -> 'HistoryCompactResult': + assert isinstance(obj, dict) + messages_removed = from_int(obj.get("messagesRemoved")) + success = from_bool(obj.get("success")) + tokens_removed = from_int(obj.get("tokensRemoved")) + context_window = from_union([HistoryCompactContextWindow.from_dict, from_none], obj.get("contextWindow")) + summary_content = from_union([from_str, from_none], obj.get("summaryContent")) + return HistoryCompactResult(messages_removed, success, tokens_removed, context_window, summary_content) + + def to_dict(self) -> dict: + result: dict = {} + result["messagesRemoved"] = from_int(self.messages_removed) + result["success"] = from_bool(self.success) + result["tokensRemoved"] = from_int(self.tokens_removed) + if self.context_window is not None: + result["contextWindow"] = from_union([lambda x: to_class(HistoryCompactContextWindow, x), from_none], self.context_window) + if self.summary_content is not None: + result["summaryContent"] = from_union([from_str, from_none], self.summary_content) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HistorySkippedFileRestore: + """A captured file that rewind intentionally left unchanged.""" + + path: str + """Absolute path of the skipped file.""" + + reason: HistoryFileRestoreSkipReason + """Reason the file was not restored.""" + + @staticmethod + def from_dict(obj: Any) -> 'HistorySkippedFileRestore': + assert isinstance(obj, dict) + path = from_str(obj.get("path")) + reason = HistoryFileRestoreSkipReason(obj.get("reason")) + return HistorySkippedFileRestore(path, reason) + + def to_dict(self) -> dict: + result: dict = {} + result["path"] = from_str(self.path) + result["reason"] = to_enum(HistoryFileRestoreSkipReason, self.reason) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HistoryListRewindPointsResult: + """Rewind points and file-change-tracking availability for the session.""" + + file_change_tracking_enabled: bool + """Whether this session captured file changes from its first turn.""" + + points: list[HistoryRewindPoint] + """Root user turns in chronological order. Empty when `unavailableReason` is set.""" + + unavailable_reason: HistoryRewindUnavailableReason | None = None + """Why the listed points could not be produced, when applicable; the points list is empty + whenever it is set. `unsupported-remote-session` is permanent for the session and comes + with `fileChangeTrackingEnabled: false`. `session-busy` is transient and only ever + reported by a session that *is* tracking (`fileChangeTrackingEnabled: true`), because the + file-change captures cannot be read while work that may still mutate them is in flight; + the same request succeeds once the session settles, so a client that wants points should + retry rather than treat it as a failure. It is never `file-change-tracking-disabled`: an + untracked local session still lists conversation-only points and reports that through + `fileChangeTrackingEnabled: false`. + """ + + @staticmethod + def from_dict(obj: Any) -> 'HistoryListRewindPointsResult': + assert isinstance(obj, dict) + file_change_tracking_enabled = from_bool(obj.get("fileChangeTrackingEnabled")) + points = from_list(HistoryRewindPoint.from_dict, obj.get("points")) + unavailable_reason = from_union([HistoryRewindUnavailableReason, from_none], obj.get("unavailableReason")) + return HistoryListRewindPointsResult(file_change_tracking_enabled, points, unavailable_reason) + + def to_dict(self) -> dict: + result: dict = {} + result["fileChangeTrackingEnabled"] = from_bool(self.file_change_tracking_enabled) + result["points"] = from_list(lambda x: to_class(HistoryRewindPoint, x), self.points) + if self.unavailable_reason is not None: + result["unavailableReason"] = from_union([lambda x: to_enum(HistoryRewindUnavailableReason, x), from_none], self.unavailable_reason) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HistoryRewindFilePreview: + """A file that a conversation-and-files rewind would restore.""" + + change_type: HistoryRewindChangeType + """Aggregate change made across the discarded turns.""" + + lines_added: int + """Lines added across the discarded turns.""" + + lines_removed: int + """Lines removed across the discarded turns.""" + + path: str + """Absolute path of the captured file.""" + + @staticmethod + def from_dict(obj: Any) -> 'HistoryRewindFilePreview': + assert isinstance(obj, dict) + change_type = HistoryRewindChangeType(obj.get("changeType")) + lines_added = from_int(obj.get("linesAdded")) + lines_removed = from_int(obj.get("linesRemoved")) + path = from_str(obj.get("path")) + return HistoryRewindFilePreview(change_type, lines_added, lines_removed, path) + + def to_dict(self) -> dict: + result: dict = {} + result["changeType"] = to_enum(HistoryRewindChangeType, self.change_type) + result["linesAdded"] = from_int(self.lines_added) + result["linesRemoved"] = from_int(self.lines_removed) + 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 HistoryRewindRequest: + """Boundary and mode for rewinding session history.""" - context_window: HistoryCompactContextWindow | None = None - """Post-compaction context window usage breakdown""" + event_id: str + """ID of the user.message event that begins the discarded suffix.""" - summary_content: str | None = None - """Summary text produced by compaction. Omitted when compaction did not produce a summary - (e.g. failure path). - """ + mode: HistoryRewindMode + """Whether to rewind only conversation history or also restore captured files.""" @staticmethod - def from_dict(obj: Any) -> 'HistoryCompactResult': + def from_dict(obj: Any) -> 'HistoryRewindRequest': assert isinstance(obj, dict) - messages_removed = from_int(obj.get("messagesRemoved")) - success = from_bool(obj.get("success")) - tokens_removed = from_int(obj.get("tokensRemoved")) - context_window = from_union([HistoryCompactContextWindow.from_dict, from_none], obj.get("contextWindow")) - summary_content = from_union([from_str, from_none], obj.get("summaryContent")) - return HistoryCompactResult(messages_removed, success, tokens_removed, context_window, summary_content) + event_id = from_str(obj.get("eventId")) + mode = HistoryRewindMode(obj.get("mode")) + return HistoryRewindRequest(event_id, mode) def to_dict(self) -> dict: result: dict = {} - result["messagesRemoved"] = from_int(self.messages_removed) - result["success"] = from_bool(self.success) - result["tokensRemoved"] = from_int(self.tokens_removed) - if self.context_window is not None: - result["contextWindow"] = from_union([lambda x: to_class(HistoryCompactContextWindow, x), from_none], self.context_window) - if self.summary_content is not None: - result["summaryContent"] = from_union([from_str, from_none], self.summary_content) + result["eventId"] = from_str(self.event_id) + result["mode"] = to_enum(HistoryRewindMode, self.mode) return result # Internal: this type is an internal SDK API and is not part of the public surface. @@ -12149,11 +13665,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 +13683,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 +13695,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 +13708,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 +13717,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 +13735,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 +13747,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 +13760,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 +13769,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 +13778,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 +13788,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 +13799,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 +13815,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 +13825,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 +13836,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 +13887,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 +13896,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 +13906,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 +13917,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 +13933,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 +13943,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 +13954,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. @@ -13085,6 +14633,10 @@ class MCPServerConfigStdio: """Controls if tools provided by this server can be loaded on demand via tool search (auto) or always included in the initial tool list (never) """ + disable_tool_cache: bool | None = None + """Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery + is unaffected. + """ env: dict[str, str] | None = None """Environment variables to pass to the Stdio MCP server process.""" @@ -13113,13 +14665,14 @@ def from_dict(obj: Any) -> 'MCPServerConfigStdio': auth = from_union([from_bool, MCPServerAuthConfigRedirectPort.from_dict, from_none], obj.get("auth")) cwd = from_union([from_str, from_none], obj.get("cwd")) defer_tools = from_union([MCPServerConfigDeferTools, from_none], obj.get("deferTools")) + disable_tool_cache = from_union([from_bool, from_none], obj.get("disableToolCache")) env = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("env")) filter_mapping = from_union([lambda x: from_dict(ContentFilterMode, x), ContentFilterMode, from_none], obj.get("filterMapping")) is_default_server = from_union([from_bool, from_none], obj.get("isDefaultServer")) oidc = from_union([from_bool, MCPServerAuthConfigRedirectPort.from_dict, from_none], obj.get("oidc")) timeout = from_union([from_int, from_none], obj.get("timeout")) tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("tools")) - return MCPServerConfigStdio(command, args, auth, cwd, defer_tools, env, filter_mapping, is_default_server, oidc, timeout, tools) + return MCPServerConfigStdio(command, args, auth, cwd, defer_tools, disable_tool_cache, env, filter_mapping, is_default_server, oidc, timeout, tools) def to_dict(self) -> dict: result: dict = {} @@ -13132,6 +14685,8 @@ def to_dict(self) -> dict: result["cwd"] = from_union([from_str, from_none], self.cwd) if self.defer_tools is not None: result["deferTools"] = from_union([lambda x: to_enum(MCPServerConfigDeferTools, x), from_none], self.defer_tools) + if self.disable_tool_cache is not None: + result["disableToolCache"] = from_union([from_bool, from_none], self.disable_tool_cache) if self.env is not None: result["env"] = from_union([lambda x: from_dict(from_str, x), from_none], self.env) if self.filter_mapping is not None: @@ -13231,6 +14786,9 @@ class MCPServerConfig: Replacement MCP server configuration (stdio process or remote HTTP/SSE). Omit to restart the server with its already-registered configuration (config-free restart-by-name). + MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server + with its already-registered configuration (config-free start-by-name). + Stdio MCP server configuration launched as a child process. Remote MCP server configuration accessed over HTTP or SSE. @@ -13251,6 +14809,10 @@ class MCPServerConfig: """Controls if tools provided by this server can be loaded on demand via tool search (auto) or always included in the initial tool list (never) """ + disable_tool_cache: bool | None = None + """Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery + is unaffected. + """ env: dict[str, str] | None = None """Environment variables to pass to the Stdio MCP server process.""" @@ -13297,6 +14859,7 @@ def from_dict(obj: Any) -> 'MCPServerConfig': command = from_union([from_str, from_none], obj.get("command")) cwd = from_union([from_str, from_none], obj.get("cwd")) defer_tools = from_union([MCPServerConfigDeferTools, from_none], obj.get("deferTools")) + disable_tool_cache = from_union([from_bool, from_none], obj.get("disableToolCache")) env = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("env")) filter_mapping = from_union([lambda x: from_dict(ContentFilterMode, x), ContentFilterMode, from_none], obj.get("filterMapping")) is_default_server = from_union([from_bool, from_none], obj.get("isDefaultServer")) @@ -13309,7 +14872,7 @@ def from_dict(obj: Any) -> 'MCPServerConfig': oauth_public_client = from_union([from_bool, from_none], obj.get("oauthPublicClient")) type = from_union([MCPServerConfigHTTPType, from_none], obj.get("type")) url = from_union([from_str, from_none], obj.get("url")) - return MCPServerConfig(args, auth, command, cwd, defer_tools, env, filter_mapping, is_default_server, oidc, timeout, tools, headers, oauth_client_id, oauth_grant_type, oauth_public_client, type, url) + return MCPServerConfig(args, auth, command, cwd, defer_tools, disable_tool_cache, env, filter_mapping, is_default_server, oidc, timeout, tools, headers, oauth_client_id, oauth_grant_type, oauth_public_client, type, url) def to_dict(self) -> dict: result: dict = {} @@ -13323,6 +14886,8 @@ def to_dict(self) -> dict: result["cwd"] = from_union([from_str, from_none], self.cwd) if self.defer_tools is not None: result["deferTools"] = from_union([lambda x: to_enum(MCPServerConfigDeferTools, x), from_none], self.defer_tools) + if self.disable_tool_cache is not None: + result["disableToolCache"] = from_union([from_bool, from_none], self.disable_tool_cache) if self.env is not None: result["env"] = from_union([lambda x: from_dict(from_str, x), from_none], self.env) if self.filter_mapping is not None: @@ -13364,6 +14929,10 @@ class MCPServerConfigHTTP: """Controls if tools provided by this server can be loaded on demand via tool search (auto) or always included in the initial tool list (never) """ + disable_tool_cache: bool | None = None + """Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery + is unaffected. + """ filter_mapping: dict[str, ContentFilterMode] | ContentFilterMode | None = None """Content filtering mode to apply to all tools, or a map of tool name to content filtering mode. @@ -13402,6 +14971,7 @@ def from_dict(obj: Any) -> 'MCPServerConfigHTTP': url = from_str(obj.get("url")) auth = from_union([from_bool, MCPServerAuthConfigRedirectPort.from_dict, from_none], obj.get("auth")) defer_tools = from_union([MCPServerConfigDeferTools, from_none], obj.get("deferTools")) + disable_tool_cache = from_union([from_bool, from_none], obj.get("disableToolCache")) filter_mapping = from_union([lambda x: from_dict(ContentFilterMode, x), ContentFilterMode, from_none], obj.get("filterMapping")) headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("headers")) is_default_server = from_union([from_bool, from_none], obj.get("isDefaultServer")) @@ -13412,7 +14982,7 @@ def from_dict(obj: Any) -> 'MCPServerConfigHTTP': timeout = from_union([from_int, from_none], obj.get("timeout")) tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("tools")) type = from_union([MCPServerConfigHTTPType, from_none], obj.get("type")) - return MCPServerConfigHTTP(url, auth, defer_tools, filter_mapping, headers, is_default_server, oauth_client_id, oauth_grant_type, oauth_public_client, oidc, timeout, tools, type) + return MCPServerConfigHTTP(url, auth, defer_tools, disable_tool_cache, filter_mapping, headers, is_default_server, oauth_client_id, oauth_grant_type, oauth_public_client, oidc, timeout, tools, type) def to_dict(self) -> dict: result: dict = {} @@ -13421,6 +14991,8 @@ def to_dict(self) -> dict: result["auth"] = from_union([from_bool, lambda x: to_class(MCPServerAuthConfigRedirectPort, x), from_none], self.auth) if self.defer_tools is not None: result["deferTools"] = from_union([lambda x: to_enum(MCPServerConfigDeferTools, x), from_none], self.defer_tools) + if self.disable_tool_cache is not None: + result["disableToolCache"] = from_union([from_bool, from_none], self.disable_tool_cache) if self.filter_mapping is not None: result["filterMapping"] = from_union([lambda x: from_dict(lambda x: to_enum(ContentFilterMode, x), x), lambda x: to_enum(ContentFilterMode, x), from_none], self.filter_mapping) if self.headers is not None: @@ -16534,6 +18106,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 +18283,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-` for prompts sent by another agent. """ traceparent: str | None = None """W3C Trace Context traceparent header for distributed tracing of this agent turn""" @@ -16841,7 +18438,7 @@ def to_dict(self) -> dict: @dataclass class SessionFSSqliteQueryRequest: """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. """ query: str """SQL query to execute""" @@ -16874,6 +18471,58 @@ def to_dict(self) -> dict: result["params"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.params) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionFSSqliteTransactionStatement: + """One statement in an atomic SQLite transaction.""" + + query: str + """SQL statement to execute.""" + + query_type: SessionFSSqliteQueryType + """How to execute the statement.""" + + params: dict[str, Any] | None = None + """Optional named bind parameters.""" + + @staticmethod + def from_dict(obj: Any) -> 'SessionFSSqliteTransactionStatement': + assert isinstance(obj, dict) + query = from_str(obj.get("query")) + query_type = SessionFSSqliteQueryType(obj.get("queryType")) + params = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("params")) + return SessionFSSqliteTransactionStatement(query, query_type, params) + + def to_dict(self) -> dict: + result: dict = {} + result["query"] = from_str(self.query) + result["queryType"] = to_enum(SessionFSSqliteQueryType, self.query_type) + if self.params is not None: + result["params"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.params) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionFSSqliteTransactionError: + """Classified SQLite transaction failure. busyOrLocked guarantees rollback; + postCommitAmbiguous must never be retried. + """ + error_class: SessionFSSqliteTransactionErrorClass + message: str + + @staticmethod + def from_dict(obj: Any) -> 'SessionFSSqliteTransactionError': + assert isinstance(obj, dict) + error_class = SessionFSSqliteTransactionErrorClass(obj.get("errorClass")) + message = from_str(obj.get("message")) + return SessionFSSqliteTransactionError(error_class, message) + + def to_dict(self) -> dict: + result: dict = {} + result["errorClass"] = to_enum(SessionFSSqliteTransactionErrorClass, self.error_class) + result["message"] = from_str(self.message) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionOpenOptionsAdditionalContentExclusionPolicyRule: @@ -16906,6 +18555,31 @@ def to_dict(self) -> dict: result["ifNoneMatch"] = from_union([lambda x: from_list(from_str, x), from_none], self.if_none_match) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ShellInitScript: + """A host-provided script sourced before each built-in shell command when its shell target + matches the active shell. + """ + path: str + """Path to the script to source.""" + + shell: ShellInitScriptShell + """Built-in shell that may source this script.""" + + @staticmethod + def from_dict(obj: Any) -> 'ShellInitScript': + assert isinstance(obj, dict) + path = from_str(obj.get("path")) + shell = ShellInitScriptShell(obj.get("shell")) + return ShellInitScript(path, shell) + + def to_dict(self) -> dict: + result: dict = {} + result["path"] = from_str(self.path) + result["shell"] = to_enum(ShellInitScriptShell, self.shell) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionsOpenProgress: @@ -18339,6 +20013,12 @@ class UIExitPlanModeResponse: auto_approve_edits: bool | None = None """Whether subsequent edits should be auto-approved without confirmation.""" + defer_implementation: bool | None = None + """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. + """ feedback: str | None = None """Feedback from the user when they declined the plan or requested changes.""" @@ -18352,15 +20032,18 @@ def from_dict(obj: Any) -> 'UIExitPlanModeResponse': assert isinstance(obj, dict) approved = from_bool(obj.get("approved")) auto_approve_edits = from_union([from_bool, from_none], obj.get("autoApproveEdits")) + defer_implementation = from_union([from_bool, from_none], obj.get("deferImplementation")) feedback = from_union([from_str, from_none], obj.get("feedback")) selected_action = from_union([UIExitPlanModeAction, from_none], obj.get("selectedAction")) - return UIExitPlanModeResponse(approved, auto_approve_edits, feedback, selected_action) + return UIExitPlanModeResponse(approved, auto_approve_edits, defer_implementation, feedback, selected_action) def to_dict(self) -> dict: result: dict = {} result["approved"] = from_bool(self.approved) if self.auto_approve_edits is not None: result["autoApproveEdits"] = from_union([from_bool, from_none], self.auto_approve_edits) + if self.defer_implementation is not None: + result["deferImplementation"] = from_union([from_bool, from_none], self.defer_implementation) if self.feedback is not None: result["feedback"] = from_union([from_str, from_none], self.feedback) if self.selected_action is not None: @@ -18505,8 +20188,10 @@ class WorkspaceDiffFileChange: """Unified diff content for the file. Empty when the diff was truncated.""" path: str - """Path to the changed file, relative to the workspace root.""" - + """Path to the changed file, relative to the workspace root when the file lives under it. A + file changed outside the workspace root keeps a `../`-relative path, or an absolute path + when no relative path exists (for example a different Windows drive). + """ is_truncated: bool | None = None """Whether the diff content was omitted because it exceeded the per-file size limit.""" @@ -19146,33 +20831,42 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass -class FactoryLogRequest: - """Parameters for recording factory progress.""" - - lines: list[FactoryLogLine] - """Ordered progress lines to append.""" +class FactoryRunTerminal: + """Prompt-safe terminal factory outcome.""" - run_id: str - """Factory run identifier.""" + error: str | None = None + failure: FactoryRunFailure | None = None + reason: str | None = None + result_preview: str | None = None @staticmethod - def from_dict(obj: Any) -> 'FactoryLogRequest': + def from_dict(obj: Any) -> 'FactoryRunTerminal': assert isinstance(obj, dict) - lines = from_list(FactoryLogLine.from_dict, obj.get("lines")) - run_id = from_str(obj.get("runId")) - return FactoryLogRequest(lines, run_id) + error = from_union([from_str, from_none], obj.get("error")) + failure = from_union([FactoryRunFailure.from_dict, from_none], obj.get("failure")) + reason = from_union([from_str, from_none], obj.get("reason")) + result_preview = from_union([from_str, from_none], obj.get("resultPreview")) + return FactoryRunTerminal(error, failure, reason, result_preview) def to_dict(self) -> dict: result: dict = {} - result["lines"] = from_list(lambda x: to_class(FactoryLogLine, x), self.lines) - result["runId"] = from_str(self.run_id) + if self.error is not None: + result["error"] = from_union([from_str, from_none], self.error) + if self.failure is not None: + result["failure"] = from_union([lambda x: to_class(FactoryRunFailure, x), from_none], self.failure) + if self.reason is not None: + result["reason"] = from_union([from_str, from_none], self.reason) + if self.result_preview is not None: + result["resultPreview"] = from_union([from_str, from_none], self.result_preview) return result # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class FactoryRunResult: - """Complete current or terminal factory run envelope.""" + """Terminal resumed run envelope. + Complete current or terminal factory run envelope. + """ run_id: str """Factory run identifier.""" @@ -19222,6 +20916,70 @@ def to_dict(self) -> dict: result["snapshot"] = self.snapshot return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FactoryLogRequest: + """Parameters for recording factory progress.""" + + execution_token: str + """Opaque token identifying the current factory execution attempt.""" + + lines: list[FactoryLogLine] + """Ordered progress lines to append.""" + + run_id: str + """Factory run identifier.""" + + @staticmethod + def from_dict(obj: Any) -> 'FactoryLogRequest': + assert isinstance(obj, dict) + execution_token = from_str(obj.get("executionToken")) + lines = from_list(FactoryLogLine.from_dict, obj.get("lines")) + run_id = from_str(obj.get("runId")) + return FactoryLogRequest(execution_token, lines, run_id) + + def to_dict(self) -> dict: + result: dict = {} + result["executionToken"] = from_str(self.execution_token) + result["lines"] = from_list(lambda x: to_class(FactoryLogLine, x), self.lines) + 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 FactoryProgressPage: + """A bidirectional page of factory progress.""" + + has_more_newer: bool + has_more_older: bool + records: list[FactoryProgressLine] + revision: int + """Run revision reflected by this page.""" + + newest_seq: int | None = None + oldest_seq: int | None = None + + @staticmethod + def from_dict(obj: Any) -> 'FactoryProgressPage': + assert isinstance(obj, dict) + has_more_newer = from_bool(obj.get("hasMoreNewer")) + has_more_older = from_bool(obj.get("hasMoreOlder")) + records = from_list(FactoryProgressLine.from_dict, obj.get("records")) + revision = from_int(obj.get("revision")) + newest_seq = from_union([from_int, from_none], obj.get("newestSeq")) + oldest_seq = from_union([from_int, from_none], obj.get("oldestSeq")) + return FactoryProgressPage(has_more_newer, has_more_older, records, revision, newest_seq, oldest_seq) + + def to_dict(self) -> dict: + result: dict = {} + result["hasMoreNewer"] = from_bool(self.has_more_newer) + result["hasMoreOlder"] = from_bool(self.has_more_older) + result["records"] = from_list(lambda x: to_class(FactoryProgressLine, x), self.records) + result["revision"] = from_int(self.revision) + result["newestSeq"] = from_union([from_int, from_none], self.newest_seq) + result["oldestSeq"] = from_union([from_int, from_none], self.oldest_seq) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class FactoryRunRequest: @@ -19252,6 +21010,103 @@ def to_dict(self) -> dict: result["options"] = from_union([lambda x: to_class(RunOptions, x), from_none], self.options) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HistoryRewindResult: + """Structured outcome of a rewind request.""" + + outcome: HistoryRewindOutcome + """Overall rewind outcome. This discriminates the result: it governs which of the remaining + fields are populated, so consumers must switch on it before reading `eventsRemoved`, + `restoredFiles`, `skippedFiles`, or `error`. See each field for the outcomes that + populate it. + """ + restored_files: list[str] + """Absolute paths restored to their captured preimages. Always empty for conversation-only + rewinds and for the unavailable outcomes (`session-busy`, + `file-change-tracking-disabled`, `unsupported-remote-session`); only + conversation-and-files outcomes that reached the file-restore stage populate it. + """ + skipped_files: list[HistorySkippedFileRestore] + """Captured files intentionally left unchanged. Always empty for conversation-only rewinds + and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, + `unsupported-remote-session`); only conversation-and-files outcomes that reached the + file-restore stage populate it. + """ + error: str | None = None + """Failure detail. Set only for the failure and partial-failure outcomes + (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, + `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the + unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, + `unsupported-remote-session`). + """ + events_removed: int | None = None + """Number of persisted events removed by conversation truncation. Present only when + truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and + `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, + `file-change-tracking-disabled`, `unsupported-remote-session`) and for + `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`. + """ + + @staticmethod + def from_dict(obj: Any) -> 'HistoryRewindResult': + assert isinstance(obj, dict) + outcome = HistoryRewindOutcome(obj.get("outcome")) + restored_files = from_list(from_str, obj.get("restoredFiles")) + skipped_files = from_list(HistorySkippedFileRestore.from_dict, obj.get("skippedFiles")) + error = from_union([from_str, from_none], obj.get("error")) + events_removed = from_union([from_int, from_none], obj.get("eventsRemoved")) + return HistoryRewindResult(outcome, restored_files, skipped_files, error, events_removed) + + def to_dict(self) -> dict: + result: dict = {} + result["outcome"] = to_enum(HistoryRewindOutcome, self.outcome) + result["restoredFiles"] = from_list(from_str, self.restored_files) + result["skippedFiles"] = from_list(lambda x: to_class(HistorySkippedFileRestore, x), self.skipped_files) + if self.error is not None: + result["error"] = from_union([from_str, from_none], self.error) + if self.events_removed is not None: + result["eventsRemoved"] = from_union([from_int, from_none], self.events_removed) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HistoryPreviewRewindResult: + """Files and aggregate changes for a prospective rewind.""" + + available: bool + """Whether file restore is available for this session. This is authoritative: switch on it + and read `reason` only when it is false. + """ + file_count: int + """Number of unique files in the preview.""" + + files: list[HistoryRewindFilePreview] + """Files ordered by path.""" + + reason: HistoryRewindUnavailableReason | None = None + """Why file restore is unavailable, when applicable. Populated only when `available` is + false and never set when `available` is true. + """ + + @staticmethod + def from_dict(obj: Any) -> 'HistoryPreviewRewindResult': + assert isinstance(obj, dict) + available = from_bool(obj.get("available")) + file_count = from_int(obj.get("fileCount")) + files = from_list(HistoryRewindFilePreview.from_dict, obj.get("files")) + reason = from_union([HistoryRewindUnavailableReason, from_none], obj.get("reason")) + return HistoryPreviewRewindResult(available, file_count, files, reason) + + def to_dict(self) -> dict: + result: dict = {} + result["available"] = from_bool(self.available) + result["fileCount"] = from_int(self.file_count) + result["files"] = from_list(lambda x: to_class(HistoryRewindFilePreview, x), self.files) + if self.reason is not None: + result["reason"] = from_union([lambda x: to_enum(HistoryRewindUnavailableReason, x), from_none], self.reason) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class InstalledPlugin: @@ -19401,6 +21256,8 @@ def to_dict(self) -> dict: class LocalSessionMetadataValue: """Persisted local session metadata, including identifiers, timestamps, summary/name, client, context, detached state, and task ID. + + Local session metadata, omitted when the session does not exist. """ is_remote: bool """Always false for local sessions.""" @@ -19786,6 +21643,32 @@ def to_dict(self) -> dict: result["workspace"] = from_union([lambda x: to_class(Workspace, x), from_none], self.workspace) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class WorkspacesUpdateMetadataRequest: + """Workspace metadata fields to update.""" + + context: Any = None + """Opaque workspace context supplied by the session host.""" + + name: str | None = None + """Optional workspace display name override.""" + + @staticmethod + def from_dict(obj: Any) -> 'WorkspacesUpdateMetadataRequest': + assert isinstance(obj, dict) + context = obj.get("context") + name = from_union([from_str, from_none], obj.get("name")) + return WorkspacesUpdateMetadataRequest(context, name) + + def to_dict(self) -> dict: + result: dict = {} + if self.context is not None: + result["context"] = self.context + if self.name is not None: + result["name"] = from_union([from_str, from_none], self.name) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPAppsHostContext: @@ -19922,25 +21805,29 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPStartServerRequest: - """Server name and configuration for an individual MCP server start.""" - - config: MCPServerConfig - """MCP server configuration (stdio process or remote HTTP/SSE)""" - + """Server name and optional configuration for an individual MCP server start. Omit `config` + for a config-free start-by-name of an already-configured server. + """ server_name: str """Name of the MCP server to start""" + config: MCPServerConfig | None = None + """MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server + with its already-registered configuration (config-free start-by-name). + """ + @staticmethod def from_dict(obj: Any) -> 'MCPStartServerRequest': assert isinstance(obj, dict) - config = MCPServerConfig.from_dict(obj.get("config")) server_name = from_str(obj.get("serverName")) - return MCPStartServerRequest(config, server_name) + config = from_union([MCPServerConfig.from_dict, from_none], obj.get("config")) + return MCPStartServerRequest(server_name, config) def to_dict(self) -> dict: result: dict = {} - result["config"] = to_class(MCPServerConfig, self.config) result["serverName"] = from_str(self.server_name) + if self.config is not None: + result["config"] = from_union([lambda x: to_class(MCPServerConfig, x), from_none], self.config) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -20571,16 +22458,52 @@ class QueuePendingItemsResult: """ @staticmethod - def from_dict(obj: Any) -> 'QueuePendingItemsResult': + def from_dict(obj: Any) -> 'QueuePendingItemsResult': + assert isinstance(obj, dict) + items = from_list(QueuePendingItems.from_dict, obj.get("items")) + steering_messages = from_list(from_str, obj.get("steeringMessages")) + return QueuePendingItemsResult(items, steering_messages) + + def to_dict(self) -> dict: + result: dict = {} + result["items"] = from_list(lambda x: to_class(QueuePendingItems, x), self.items) + result["steeringMessages"] = from_list(from_str, self.steering_messages) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class QueueSnapshotResult: + """Internal snapshot of native queue state for local session orchestration.""" + + items: list[QueuePendingItems] + """User-facing pending items in FIFO order.""" + + steering_messages: list[str] + """Immediate steering messages waiting for an active turn.""" + + item_orders: list[int] | None = None + """Insertion orders for queued items, aligned with `items`.""" + + steering_message_orders: list[int] | None = None + """Insertion orders for immediate steering messages, aligned with `steeringMessages`.""" + + @staticmethod + def from_dict(obj: Any) -> 'QueueSnapshotResult': assert isinstance(obj, dict) items = from_list(QueuePendingItems.from_dict, obj.get("items")) steering_messages = from_list(from_str, obj.get("steeringMessages")) - return QueuePendingItemsResult(items, steering_messages) + item_orders = from_union([lambda x: from_list(from_int, x), from_none], obj.get("itemOrders")) + steering_message_orders = from_union([lambda x: from_list(from_int, x), from_none], obj.get("steeringMessageOrders")) + return QueueSnapshotResult(items, steering_messages, item_orders, steering_message_orders) def to_dict(self) -> dict: result: dict = {} result["items"] = from_list(lambda x: to_class(QueuePendingItems, x), self.items) result["steeringMessages"] = from_list(from_str, self.steering_messages) + if self.item_orders is not None: + result["itemOrders"] = from_union([lambda x: from_list(from_int, x), from_none], self.item_orders) + if self.steering_message_orders is not None: + result["steeringMessageOrders"] = from_union([lambda x: from_list(from_int, x), from_none], self.steering_message_orders) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -20783,6 +22706,29 @@ def to_dict(self) -> dict: result["error"] = from_union([lambda x: to_class(SessionFSError, x), from_none], self.error) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionFSSqliteTransactionRequest: + """Statements to execute atomically. Providers apply busy handling for every call.""" + + session_id: str + """Target session identifier""" + + statements: list[SessionFSSqliteTransactionStatement] + + @staticmethod + def from_dict(obj: Any) -> 'SessionFSSqliteTransactionRequest': + assert isinstance(obj, dict) + session_id = from_str(obj.get("sessionId")) + statements = from_list(SessionFSSqliteTransactionStatement.from_dict, obj.get("statements")) + return SessionFSSqliteTransactionRequest(session_id, statements) + + def to_dict(self) -> dict: + result: dict = {} + result["sessionId"] = from_str(self.session_id) + result["statements"] = from_list(lambda x: to_class(SessionFSSqliteTransactionStatement, x), self.statements) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionOpenOptionsAdditionalContentExclusionPolicy: @@ -20811,6 +22757,57 @@ def to_dict(self) -> dict: result["scope"] = to_enum(AdditionalContentExclusionPolicyScope, self.scope) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ShellOptions: + """Per-session settings for built-in shell tools.""" + + init_profile: ShellInitProfile | None = None + """Controls automatic non-interactive profile loading where supported. Explicit initScripts + are unaffected. + """ + init_scripts: list[ShellInitScript] | None = None + """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. + """ + process_flags: list[str] | None = None + """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`. + """ + + @staticmethod + def from_dict(obj: Any) -> 'ShellOptions': + assert isinstance(obj, dict) + init_profile = from_union([ShellInitProfile, from_none], obj.get("initProfile")) + init_scripts = from_union([lambda x: from_list(ShellInitScript.from_dict, x), from_none], obj.get("initScripts")) + process_flags = from_union([lambda x: from_list(from_str, x), from_none], obj.get("processFlags")) + return ShellOptions(init_profile, init_scripts, process_flags) + + def to_dict(self) -> dict: + result: dict = {} + if self.init_profile is not None: + result["initProfile"] = from_union([lambda x: to_enum(ShellInitProfile, x), from_none], self.init_profile) + if self.init_scripts is not None: + result["initScripts"] = from_union([lambda x: from_list(lambda x: to_class(ShellInitScript, x), x), from_none], self.init_scripts) + if self.process_flags is not None: + result["processFlags"] = from_union([lambda x: from_list(from_str, x), from_none], self.process_flags) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionSettingsSnapshot: @@ -21442,8 +23439,9 @@ class WorkspaceDiffResult: """Changed files and their unified diffs.""" is_fallback: bool - """Whether a requested branch diff fell back to unstaged changes because branch diff failed.""" - + """Whether the requested diff fell back to unstaged changes, either because branch diff + failed or session diff was unavailable. + """ mode: WorkspaceDiffMode """Effective mode used for the returned changes.""" @@ -21453,6 +23451,16 @@ class WorkspaceDiffResult: base_branch: str | None = None """Default branch used for a branch diff, when branch mode was requested.""" + unavailable_reason: HistoryRewindUnavailableReason | None = None + """Why the session diff could not be produced, when applicable. Set only when `session` mode + was requested and `isFallback` is true, so a client can tell the permanent + `file-change-tracking-disabled` apart from the transient `session-busy`, which the same + request answers once the session settles. Never set for `unstaged` or `branch` mode, and + never `unsupported-remote-session`: a remote session's captures live on its own host, so + a `session`-mode diff is rejected for one rather than answered with a controller-side + fallback. + """ + @staticmethod def from_dict(obj: Any) -> 'WorkspaceDiffResult': assert isinstance(obj, dict) @@ -21461,7 +23469,8 @@ def from_dict(obj: Any) -> 'WorkspaceDiffResult': mode = WorkspaceDiffMode(obj.get("mode")) requested_mode = WorkspaceDiffMode(obj.get("requestedMode")) base_branch = from_union([from_str, from_none], obj.get("baseBranch")) - return WorkspaceDiffResult(changes, is_fallback, mode, requested_mode, base_branch) + unavailable_reason = from_union([HistoryRewindUnavailableReason, from_none], obj.get("unavailableReason")) + return WorkspaceDiffResult(changes, is_fallback, mode, requested_mode, base_branch, unavailable_reason) def to_dict(self) -> dict: result: dict = {} @@ -21471,6 +23480,8 @@ def to_dict(self) -> dict: result["requestedMode"] = to_enum(WorkspaceDiffMode, self.requested_mode) if self.base_branch is not None: result["baseBranch"] = from_union([from_str, from_none], self.base_branch) + if self.unavailable_reason is not None: + result["unavailableReason"] = from_union([lambda x: to_enum(HistoryRewindUnavailableReason, x), from_none], self.unavailable_reason) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -21679,6 +23690,183 @@ def to_dict(self) -> dict: result["result"] = from_union([lambda x: to_class(ExternalToolTextResultForLlm, x), from_str, from_none], self.result) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FactoryRunSummary: + """Durable factory run summary with read-time live overlays.""" + + consumed: FactoryRunConsumed + created_at: int + declared_limits: FactoryDeclaredLimits + declared_phase_count: int + description: str + factory_name: str + live_agent_count: int + observed_at: int + revision: int + run_id: str + status: FactoryRunStatus + total_spawned_agent_count: int + updated_at: int + active_segment_started_at: int | None = None + approved: FactoryDeclaredLimits | None = None + completed_at: int | None = None + current_phase: FactoryCurrentPhase | None = None + started_at: int | None = None + terminal: FactoryRunTerminal | None = None + + @staticmethod + def from_dict(obj: Any) -> 'FactoryRunSummary': + assert isinstance(obj, dict) + consumed = FactoryRunConsumed.from_dict(obj.get("consumed")) + created_at = from_int(obj.get("createdAt")) + declared_limits = FactoryDeclaredLimits.from_dict(obj.get("declaredLimits")) + declared_phase_count = from_int(obj.get("declaredPhaseCount")) + description = from_str(obj.get("description")) + factory_name = from_str(obj.get("factoryName")) + live_agent_count = from_int(obj.get("liveAgentCount")) + observed_at = from_int(obj.get("observedAt")) + revision = from_int(obj.get("revision")) + run_id = from_str(obj.get("runId")) + status = FactoryRunStatus(obj.get("status")) + total_spawned_agent_count = from_int(obj.get("totalSpawnedAgentCount")) + updated_at = from_int(obj.get("updatedAt")) + active_segment_started_at = from_union([from_int, from_none], obj.get("activeSegmentStartedAt")) + approved = from_union([FactoryDeclaredLimits.from_dict, from_none], obj.get("approved")) + completed_at = from_union([from_int, from_none], obj.get("completedAt")) + current_phase = from_union([FactoryCurrentPhase.from_dict, from_none], obj.get("currentPhase")) + started_at = from_union([from_int, from_none], obj.get("startedAt")) + terminal = from_union([FactoryRunTerminal.from_dict, from_none], obj.get("terminal")) + return FactoryRunSummary(consumed, created_at, declared_limits, declared_phase_count, description, factory_name, live_agent_count, observed_at, revision, run_id, status, total_spawned_agent_count, updated_at, active_segment_started_at, approved, completed_at, current_phase, started_at, terminal) + + def to_dict(self) -> dict: + result: dict = {} + result["consumed"] = to_class(FactoryRunConsumed, self.consumed) + result["createdAt"] = from_int(self.created_at) + result["declaredLimits"] = to_class(FactoryDeclaredLimits, self.declared_limits) + result["declaredPhaseCount"] = from_int(self.declared_phase_count) + result["description"] = from_str(self.description) + result["factoryName"] = from_str(self.factory_name) + result["liveAgentCount"] = from_int(self.live_agent_count) + result["observedAt"] = from_int(self.observed_at) + result["revision"] = from_int(self.revision) + result["runId"] = from_str(self.run_id) + result["status"] = to_enum(FactoryRunStatus, self.status) + result["totalSpawnedAgentCount"] = from_int(self.total_spawned_agent_count) + result["updatedAt"] = from_int(self.updated_at) + result["activeSegmentStartedAt"] = from_union([from_int, from_none], self.active_segment_started_at) + result["approved"] = from_union([lambda x: to_class(FactoryDeclaredLimits, x), from_none], self.approved) + result["completedAt"] = from_union([from_int, from_none], self.completed_at) + result["currentPhase"] = from_union([lambda x: to_class(FactoryCurrentPhase, x), from_none], self.current_phase) + result["startedAt"] = from_union([from_int, from_none], self.started_at) + result["terminal"] = from_union([lambda x: to_class(FactoryRunTerminal, x), from_none], self.terminal) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FactoryResumeResult: + """Resolved persisted factory identity and resumed run envelope.""" + + factory_name: str + """Persisted factory name resolved for the resumed run.""" + + run: FactoryRunResult + """Terminal resumed run envelope.""" + + @staticmethod + def from_dict(obj: Any) -> 'FactoryResumeResult': + assert isinstance(obj, dict) + factory_name = from_str(obj.get("factoryName")) + run = FactoryRunResult.from_dict(obj.get("run")) + return FactoryResumeResult(factory_name, run) + + def to_dict(self) -> dict: + result: dict = {} + result["factoryName"] = from_str(self.factory_name) + result["run"] = to_class(FactoryRunResult, self.run) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FactoryRunDetail: + """Full factory run observability detail.""" + + agents: list[FactoryAgentSummary] + consumed: FactoryRunConsumed + created_at: int + declared_limits: FactoryDeclaredLimits + declared_phase_count: int + description: str + factory_name: str + live_agent_count: int + observed_at: int + phases: list[FactoryPhaseObservation] + progress: FactoryProgressPage + revision: int + run_id: str + status: FactoryRunStatus + total_spawned_agent_count: int + updated_at: int + active_segment_started_at: int | None = None + approved: FactoryDeclaredLimits | None = None + completed_at: int | None = None + current_phase: FactoryCurrentPhase | None = None + started_at: int | None = None + terminal: FactoryRunTerminal | None = None + + @staticmethod + def from_dict(obj: Any) -> 'FactoryRunDetail': + assert isinstance(obj, dict) + agents = from_list(FactoryAgentSummary.from_dict, obj.get("agents")) + consumed = FactoryRunConsumed.from_dict(obj.get("consumed")) + created_at = from_int(obj.get("createdAt")) + declared_limits = FactoryDeclaredLimits.from_dict(obj.get("declaredLimits")) + declared_phase_count = from_int(obj.get("declaredPhaseCount")) + description = from_str(obj.get("description")) + factory_name = from_str(obj.get("factoryName")) + live_agent_count = from_int(obj.get("liveAgentCount")) + observed_at = from_int(obj.get("observedAt")) + phases = from_list(FactoryPhaseObservation.from_dict, obj.get("phases")) + progress = FactoryProgressPage.from_dict(obj.get("progress")) + revision = from_int(obj.get("revision")) + run_id = from_str(obj.get("runId")) + status = FactoryRunStatus(obj.get("status")) + total_spawned_agent_count = from_int(obj.get("totalSpawnedAgentCount")) + updated_at = from_int(obj.get("updatedAt")) + active_segment_started_at = from_union([from_int, from_none], obj.get("activeSegmentStartedAt")) + approved = from_union([FactoryDeclaredLimits.from_dict, from_none], obj.get("approved")) + completed_at = from_union([from_int, from_none], obj.get("completedAt")) + current_phase = from_union([FactoryCurrentPhase.from_dict, from_none], obj.get("currentPhase")) + started_at = from_union([from_int, from_none], obj.get("startedAt")) + terminal = from_union([FactoryRunTerminal.from_dict, from_none], obj.get("terminal")) + return FactoryRunDetail(agents, consumed, created_at, declared_limits, declared_phase_count, description, factory_name, live_agent_count, observed_at, phases, progress, revision, run_id, status, total_spawned_agent_count, updated_at, active_segment_started_at, approved, completed_at, current_phase, started_at, terminal) + + def to_dict(self) -> dict: + result: dict = {} + result["agents"] = from_list(lambda x: to_class(FactoryAgentSummary, x), self.agents) + result["consumed"] = to_class(FactoryRunConsumed, self.consumed) + result["createdAt"] = from_int(self.created_at) + result["declaredLimits"] = to_class(FactoryDeclaredLimits, self.declared_limits) + result["declaredPhaseCount"] = from_int(self.declared_phase_count) + result["description"] = from_str(self.description) + result["factoryName"] = from_str(self.factory_name) + result["liveAgentCount"] = from_int(self.live_agent_count) + result["observedAt"] = from_int(self.observed_at) + result["phases"] = from_list(lambda x: to_class(FactoryPhaseObservation, x), self.phases) + result["progress"] = to_class(FactoryProgressPage, self.progress) + result["revision"] = from_int(self.revision) + result["runId"] = from_str(self.run_id) + result["status"] = to_enum(FactoryRunStatus, self.status) + result["totalSpawnedAgentCount"] = from_int(self.total_spawned_agent_count) + result["updatedAt"] = from_int(self.updated_at) + result["activeSegmentStartedAt"] = from_union([from_int, from_none], self.active_segment_started_at) + result["approved"] = from_union([lambda x: to_class(FactoryDeclaredLimits, x), from_none], self.approved) + result["completedAt"] = from_union([from_int, from_none], self.completed_at) + result["currentPhase"] = from_union([lambda x: to_class(FactoryCurrentPhase, x), from_none], self.current_phase) + result["startedAt"] = from_union([from_int, from_none], self.started_at) + result["terminal"] = from_union([lambda x: to_class(FactoryRunTerminal, x), from_none], self.terminal) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionsSetAdditionalPluginsRequest: @@ -21743,6 +23931,26 @@ def to_dict(self) -> dict: result["sessions"] = from_list(lambda x: to_class(LocalSessionMetadataValue, x), self.sessions) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionsGetMetadataResult: + """Persisted local session metadata when the session exists.""" + + session: LocalSessionMetadataValue | None = None + """Local session metadata, omitted when the session does not exist.""" + + @staticmethod + def from_dict(obj: Any) -> 'SessionsGetMetadataResult': + assert isinstance(obj, dict) + session = from_union([LocalSessionMetadataValue.from_dict, from_none], obj.get("session")) + return SessionsGetMetadataResult(session) + + def to_dict(self) -> dict: + result: dict = {} + if self.session is not None: + result["session"] = from_union([lambda x: to_class(LocalSessionMetadataValue, x), from_none], self.session) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionOpenResult: @@ -22183,6 +24391,28 @@ def to_dict(self) -> dict: result["userPolicy"] = from_union([lambda x: to_class(SandboxConfigUserPolicy, x), from_none], self.user_policy) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionFSSqliteTransactionResult: + """Per-statement results, or a classified transaction error.""" + + results: list[SessionFSSqliteQueryResult] + error: SessionFSSqliteTransactionError | None = None + + @staticmethod + def from_dict(obj: Any) -> 'SessionFSSqliteTransactionResult': + assert isinstance(obj, dict) + results = from_list(SessionFSSqliteQueryResult.from_dict, obj.get("results")) + error = from_union([SessionFSSqliteTransactionError.from_dict, from_none], obj.get("error")) + return SessionFSSqliteTransactionResult(results, error) + + def to_dict(self) -> dict: + result: dict = {} + result["results"] = from_list(lambda x: to_class(SessionFSSqliteQueryResult, x), self.results) + if self.error is not None: + result["error"] = from_union([lambda x: to_class(SessionFSSqliteTransactionError, x), from_none], self.error) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPListToolsResult: @@ -22232,6 +24462,46 @@ def to_dict(self) -> dict: result["required"] = from_union([lambda x: from_list(from_str, x), from_none], self.required) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FactoryListRunsResult: + """Factory runs in durable creation order.""" + + runs: list[FactoryRunSummary] + + @staticmethod + def from_dict(obj: Any) -> 'FactoryListRunsResult': + assert isinstance(obj, dict) + runs = from_list(FactoryRunSummary.from_dict, obj.get("runs")) + return FactoryListRunsResult(runs) + + def to_dict(self) -> dict: + result: dict = {} + result["runs"] = from_list(lambda x: to_class(FactoryRunSummary, x), self.runs) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class BuiltInModelCatalogEntry: + """A well-known model in the runtime's built-in catalog.""" + + id: str + """Well-known runtime model ID suitable for `ProviderConfig.modelId` or + `ProviderModelConfig.modelId`. This is not necessarily the provider-facing deployment or + model name and does not indicate CAPI entitlement or provider availability. + """ + + @staticmethod + def from_dict(obj: Any) -> 'BuiltInModelCatalogEntry': + assert isinstance(obj, dict) + id = from_str(obj.get("id")) + return BuiltInModelCatalogEntry(id) + + def to_dict(self) -> dict: + result: dict = {} + result["id"] = from_str(self.id) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ProviderAddRequest: @@ -22336,6 +24606,28 @@ class SessionOpenOptions: `assistant.message` event. Off by default; may change or be removed while the citations surface is experimental. """ + enable_file_change_tracking: bool | None = None + """Opt in to capturing file changes for session rewind and session diff. Capture cannot + reconstruct changes made before it was enabled. On create it starts capture from the + first turn. It is also honored on resume: for a session that already has tracked prior + turns, tracking continues automatically even if this is omitted; passing it on resume + additionally enables tracking for an eligible session that has no prior root turn yet. + Resuming a session whose prior root turns were never tracked has no restorable baseline, + so tracking stays disabled for it and rewind reports file change tracking as unavailable; + the resume itself still succeeds, so sessions that predate tracking remain loadable. The + opt-in is only rejected when the session can never track (a subagent session, or one + without local session storage). It is intentionally absent from the mutable options + update because enabling it after edits have occurred would create an incomplete, + misleading baseline. Subagents share the parent session's capture store and are not + tracked as separate rewind points: a file a subagent writes is attributed to whichever + root user turn was open when the capture was staged, just before the tool body ran. A + turn cannot open while a staged capture is still in flight, so a subagent tool that + staged under the spawning turn stays attributed to it however late the write lands, while + a capture it stages after the user's next message belongs to that later turn. Attribution + decides which turn's rewind point counts and file preview include that write; it does not + narrow which rewinds revert it, because a rewind restores every capture from the selected + turn onward, so the earlier spawning turn reverts it as well. + """ enable_managed_settings: bool | None = None """Opt-in: self-fetch and enforce enterprise managed settings at session bootstrap.""" @@ -22354,6 +24646,9 @@ class SessionOpenOptions: events_log_directory: str | None = None """Override directory for session event logs.""" + events_log_includes_subagents: bool | None = None + """Whether subagent callback events should be forwarded into the session event log sink.""" + excluded_builtin_agents: list[str] | None = None """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 @@ -22449,11 +24744,14 @@ class SessionOpenOptions: session_limits: SessionLimitsConfig | None = None """Initial session limits.""" + shell: ShellOptions | None = None + """Per-session settings for built-in shell tools.""" + shell_init_profile: str | None = None - """Shell init profile.""" + """Use shell.initProfile instead. Shell init profile.""" shell_process_flags: list[str] | None = None - """Per-shell process flags.""" + """PowerShell process flags applied to built-in and user-requested shell commands.""" skill_directories: list[str] | None = None """Additional directories to search for skills.""" @@ -22495,12 +24793,14 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': disabled_instruction_sources = from_union([lambda x: from_list(from_str, x), from_none], obj.get("disabledInstructionSources")) disabled_skills = from_union([lambda x: from_list(from_str, x), from_none], obj.get("disabledSkills")) enable_citations = from_union([from_bool, from_none], obj.get("enableCitations")) + enable_file_change_tracking = from_union([from_bool, from_none], obj.get("enableFileChangeTracking")) enable_managed_settings = from_union([from_bool, from_none], obj.get("enableManagedSettings")) enable_on_demand_instruction_discovery = from_union([from_bool, from_none], obj.get("enableOnDemandInstructionDiscovery")) enable_script_safety = from_union([from_bool, from_none], obj.get("enableScriptSafety")) enable_streaming = from_union([from_bool, from_none], obj.get("enableStreaming")) env_value_mode = from_union([MCPSetEnvValueModeDetails, from_none], obj.get("envValueMode")) events_log_directory = from_union([from_str, from_none], obj.get("eventsLogDirectory")) + events_log_includes_subagents = from_union([from_bool, from_none], obj.get("eventsLogIncludesSubagents")) excluded_builtin_agents = from_union([lambda x: from_list(from_str, x), from_none], obj.get("excludedBuiltinAgents")) excluded_tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("excludedTools")) exp_assignments = obj.get("expAssignments") @@ -22529,6 +24829,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': session_capabilities = from_union([lambda x: from_list(SessionCapability, x), from_none], obj.get("sessionCapabilities")) session_id = from_union([from_str, from_none], obj.get("sessionId")) session_limits = from_union([SessionLimitsConfig.from_dict, from_none], obj.get("sessionLimits")) + shell = from_union([ShellOptions.from_dict, from_none], obj.get("shell")) shell_init_profile = from_union([from_str, from_none], obj.get("shellInitProfile")) shell_process_flags = from_union([lambda x: from_list(from_str, x), from_none], obj.get("shellProcessFlags")) skill_directories = from_union([lambda x: from_list(from_str, x), from_none], obj.get("skillDirectories")) @@ -22537,7 +24838,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': verbosity = from_union([Verbosity, from_none], obj.get("verbosity")) working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) working_directory_context = from_union([SessionContext.from_dict, from_none], obj.get("workingDirectoryContext")) - return SessionOpenOptions(additional_content_exclusion_policies, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_skills, enable_citations, enable_managed_settings, enable_on_demand_instruction_discovery, enable_script_safety, enable_streaming, env_value_mode, events_log_directory, excluded_builtin_agents, excluded_tools, exp_assignments, feature_flags, included_builtin_agents, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, session_capabilities, session_id, session_limits, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, verbosity, working_directory, working_directory_context) + return SessionOpenOptions(additional_content_exclusion_policies, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_skills, enable_citations, enable_file_change_tracking, enable_managed_settings, enable_on_demand_instruction_discovery, enable_script_safety, enable_streaming, env_value_mode, events_log_directory, events_log_includes_subagents, excluded_builtin_agents, excluded_tools, exp_assignments, feature_flags, included_builtin_agents, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, session_capabilities, session_id, session_limits, shell, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, verbosity, working_directory, working_directory_context) def to_dict(self) -> dict: result: dict = {} @@ -22579,6 +24880,8 @@ def to_dict(self) -> dict: result["disabledSkills"] = from_union([lambda x: from_list(from_str, x), from_none], self.disabled_skills) if self.enable_citations is not None: result["enableCitations"] = from_union([from_bool, from_none], self.enable_citations) + if self.enable_file_change_tracking is not None: + result["enableFileChangeTracking"] = from_union([from_bool, from_none], self.enable_file_change_tracking) if self.enable_managed_settings is not None: result["enableManagedSettings"] = from_union([from_bool, from_none], self.enable_managed_settings) if self.enable_on_demand_instruction_discovery is not None: @@ -22591,6 +24894,8 @@ def to_dict(self) -> dict: result["envValueMode"] = from_union([lambda x: to_enum(MCPSetEnvValueModeDetails, x), from_none], self.env_value_mode) if self.events_log_directory is not None: result["eventsLogDirectory"] = from_union([from_str, from_none], self.events_log_directory) + if self.events_log_includes_subagents is not None: + result["eventsLogIncludesSubagents"] = from_union([from_bool, from_none], self.events_log_includes_subagents) if self.excluded_builtin_agents is not None: result["excludedBuiltinAgents"] = from_union([lambda x: from_list(from_str, x), from_none], self.excluded_builtin_agents) if self.excluded_tools is not None: @@ -22647,6 +24952,8 @@ def to_dict(self) -> dict: result["sessionId"] = from_union([from_str, from_none], self.session_id) if self.session_limits is not None: result["sessionLimits"] = from_union([lambda x: to_class(SessionLimitsConfig, x), from_none], self.session_limits) + if self.shell is not None: + result["shell"] = from_union([lambda x: to_class(ShellOptions, x), from_none], self.shell) if self.shell_init_profile is not None: result["shellInitProfile"] = from_union([from_str, from_none], self.shell_init_profile) if self.shell_process_flags is not None: @@ -22726,7 +25033,7 @@ class SessionUpdateOptionsParams: enable_on_demand_instruction_discovery: bool | None = None """Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with - `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag. + `skipCustomInstructions`. """ enable_reasoning_summaries: bool | None = None """Whether to surface reasoning-summary events from the model.""" @@ -22752,6 +25059,9 @@ class SessionUpdateOptionsParams: """Override directory for the session-events log. When unset, the runtime's default events log directory is used. """ + events_log_includes_subagents: bool | None = None + """Whether subagent callback events should be forwarded into the session event log sink.""" + excluded_builtin_agents: list[str] | None = None """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 @@ -22827,11 +25137,14 @@ class SessionUpdateOptionsParams: session_limits: SessionLimitsConfig | None = None """Optional session limits. Pass null to clear the session limits.""" + shell: ShellOptions | None = None + """Per-session settings for built-in shell tools.""" + shell_init_profile: str | None = None - """Shell init profile (`None` or `NonInteractive`).""" + """Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`).""" shell_process_flags: list[str] | None = None - """Per-shell process flags (e.g., `pwsh` arguments).""" + """PowerShell process flags applied to built-in and user-requested shell commands.""" skill_directories: list[str] | None = None """Additional directories to search for skills.""" @@ -22887,6 +25200,7 @@ def from_dict(obj: Any) -> 'SessionUpdateOptionsParams': enable_streaming = from_union([from_bool, from_none], obj.get("enableStreaming")) env_value_mode = from_union([MCPSetEnvValueModeDetails, from_none], obj.get("envValueMode")) events_log_directory = from_union([from_str, from_none], obj.get("eventsLogDirectory")) + events_log_includes_subagents = from_union([from_bool, from_none], obj.get("eventsLogIncludesSubagents")) excluded_builtin_agents = from_union([lambda x: from_list(from_str, x), from_none], obj.get("excludedBuiltinAgents")) excluded_tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("excludedTools")) feature_flags = from_union([lambda x: from_dict(from_bool, x), from_none], obj.get("featureFlags")) @@ -22908,6 +25222,7 @@ def from_dict(obj: Any) -> 'SessionUpdateOptionsParams': sandbox_config = from_union([SandboxConfig.from_dict, from_none], obj.get("sandboxConfig")) session_capabilities = from_union([lambda x: from_list(SessionCapability, x), from_none], obj.get("sessionCapabilities")) session_limits = from_union([SessionLimitsConfig.from_dict, from_none], obj.get("sessionLimits")) + shell = from_union([ShellOptions.from_dict, from_none], obj.get("shell")) shell_init_profile = from_union([from_str, from_none], obj.get("shellInitProfile")) shell_process_flags = from_union([lambda x: from_list(from_str, x), from_none], obj.get("shellProcessFlags")) skill_directories = from_union([lambda x: from_list(from_str, x), from_none], obj.get("skillDirectories")) @@ -22918,7 +25233,7 @@ def from_dict(obj: Any) -> 'SessionUpdateOptionsParams': trajectory_file = from_union([from_str, from_none], obj.get("trajectoryFile")) verbosity = from_union([Verbosity, from_none], obj.get("verbosity")) working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) - return SessionUpdateOptionsParams(additional_content_exclusion_policies, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, available_tools, capi, client_name, coauthor_enabled, context_tier, continue_on_auto_mode, copilot_url, custom_agents_local_only, disabled_instruction_sources, disabled_skills, enable_file_hooks, enable_host_git_operations, enable_on_demand_instruction_discovery, enable_reasoning_summaries, enable_script_safety, enable_session_store, enable_skills, enable_streaming, env_value_mode, events_log_directory, excluded_builtin_agents, excluded_tools, feature_flags, included_builtin_agents, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, manage_schedule_enabled, max_inline_binary_bytes, model, model_capabilities_overrides, organization_custom_instructions, provider, reasoning_effort, reasoning_summary, running_in_interactive_mode, sandbox_config, session_capabilities, session_limits, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, skip_embedding_retrieval, suppress_custom_agent_prompt, tool_filter_precedence, trajectory_file, verbosity, working_directory) + return SessionUpdateOptionsParams(additional_content_exclusion_policies, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, available_tools, capi, client_name, coauthor_enabled, context_tier, continue_on_auto_mode, copilot_url, custom_agents_local_only, disabled_instruction_sources, disabled_skills, enable_file_hooks, enable_host_git_operations, enable_on_demand_instruction_discovery, enable_reasoning_summaries, enable_script_safety, enable_session_store, enable_skills, enable_streaming, env_value_mode, events_log_directory, events_log_includes_subagents, excluded_builtin_agents, excluded_tools, feature_flags, included_builtin_agents, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, manage_schedule_enabled, max_inline_binary_bytes, model, model_capabilities_overrides, organization_custom_instructions, provider, reasoning_effort, reasoning_summary, running_in_interactive_mode, sandbox_config, session_capabilities, session_limits, shell, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, skip_embedding_retrieval, suppress_custom_agent_prompt, tool_filter_precedence, trajectory_file, verbosity, working_directory) def to_dict(self) -> dict: result: dict = {} @@ -22970,6 +25285,8 @@ def to_dict(self) -> dict: result["envValueMode"] = from_union([lambda x: to_enum(MCPSetEnvValueModeDetails, x), from_none], self.env_value_mode) if self.events_log_directory is not None: result["eventsLogDirectory"] = from_union([from_str, from_none], self.events_log_directory) + if self.events_log_includes_subagents is not None: + result["eventsLogIncludesSubagents"] = from_union([from_bool, from_none], self.events_log_includes_subagents) if self.excluded_builtin_agents is not None: result["excludedBuiltinAgents"] = from_union([lambda x: from_list(from_str, x), from_none], self.excluded_builtin_agents) if self.excluded_tools is not None: @@ -23012,6 +25329,8 @@ def to_dict(self) -> dict: result["sessionCapabilities"] = from_union([lambda x: from_list(lambda x: to_enum(SessionCapability, x), x), from_none], self.session_capabilities) if self.session_limits is not None: result["sessionLimits"] = from_union([lambda x: to_class(SessionLimitsConfig, x), from_none], self.session_limits) + if self.shell is not None: + result["shell"] = from_union([lambda x: to_class(ShellOptions, x), from_none], self.shell) if self.shell_init_profile is not None: result["shellInitProfile"] = from_union([from_str, from_none], self.shell_init_profile) if self.shell_process_flags is not None: @@ -23058,6 +25377,26 @@ def to_dict(self) -> dict: result["requestedSchema"] = to_class(UIElicitationSchema, self.requested_schema) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class BuiltInModelCatalog: + """The running runtime's complete catalog of well-known built-in model IDs, including + supported models and additional IDs with built-in metadata. + """ + models: list[BuiltInModelCatalogEntry] + """Built-in model entries.""" + + @staticmethod + def from_dict(obj: Any) -> 'BuiltInModelCatalog': + assert isinstance(obj, dict) + models = from_list(BuiltInModelCatalogEntry.from_dict, obj.get("models")) + return BuiltInModelCatalog(models) + + def to_dict(self) -> dict: + result: dict = {} + result["models"] = from_list(lambda x: to_class(BuiltInModelCatalogEntry, x), self.models) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionsOpenCreate: @@ -25011,6 +27350,8 @@ class RPC: api_key_auth_info: APIKeyAuthInfo auth_info: AuthInfo auth_info_type: AuthInfoType + built_in_model_catalog: BuiltInModelCatalog + built_in_model_catalog_entry: BuiltInModelCatalogEntry cancel_user_requested_shell_command_result: CancelUserRequestedShellCommandResult canvas_action: CanvasAction canvas_action_invoke_request: CanvasActionInvokeRequest @@ -25045,6 +27386,9 @@ class RPC: connect_remote_session_params: ConnectRemoteSessionParams connect_request: _ConnectRequest connect_result: _ConnectResult + content_exclusion_check_paths_request: ContentExclusionCheckPathsRequest + content_exclusion_check_paths_result: ContentExclusionCheckPathsResult + content_exclusion_path_check: ContentExclusionPathCheck content_filter_mode: ContentFilterMode context_heaviest_message: ContextHeaviestMessage copilot_api_token_auth_info: CopilotAPITokenAuthInfo @@ -25109,22 +27453,39 @@ class RPC: factory_agent_options: FactoryAgentOptions factory_agent_request: FactoryAgentRequest factory_agent_result: FactoryAgentResult + factory_agent_summary: FactoryAgentSummary factory_cancel_request: FactoryCancelRequest + factory_current_phase: FactoryCurrentPhase + factory_declared_limits: FactoryDeclaredLimits + factory_durable_operation: FactoryDurableOperation factory_execute_request: FactoryExecuteRequest factory_execute_result: FactoryExecuteResult + factory_get_run_progress_request: FactoryGetRunProgressRequest factory_get_run_request: FactoryGetRunRequest factory_journal_get_request: FactoryJournalGetRequest factory_journal_get_result: FactoryJournalGetResult factory_journal_put_request: FactoryJournalPutRequest + factory_list_runs_request: FactoryListRunsRequest + factory_list_runs_result: FactoryListRunsResult factory_log_line: FactoryLogLine factory_log_line_kind: FactoryLogLineKind factory_log_request: FactoryLogRequest + factory_phase_observation: FactoryPhaseObservation + factory_phase_status: FactoryPhaseStatus + factory_progress_line: FactoryProgressLine + factory_progress_page: FactoryProgressPage + factory_resume_request: FactoryResumeRequest + factory_resume_result: FactoryResumeResult + factory_run_consumed: FactoryRunConsumed + factory_run_detail: FactoryRunDetail factory_run_failure: FactoryRunFailure factory_run_failure_kind: FactoryRunFailureKind factory_run_limits: FactoryRunLimits factory_run_request: FactoryRunRequest factory_run_result: FactoryRunResult factory_run_status: FactoryRunStatus + factory_run_summary: FactoryRunSummary + factory_run_terminal: FactoryRunTerminal filter_mapping: dict[str, ContentFilterMode] | ContentFilterMode fleet_start_request: FleetStartRequest fleet_start_result: FleetStartResult @@ -25142,6 +27503,19 @@ class RPC: history_compact_context_window: HistoryCompactContextWindow history_compact_request: HistoryCompactRequest history_compact_result: HistoryCompactResult + history_file_restore_skip_reason: HistoryFileRestoreSkipReason + history_list_rewind_points_result: HistoryListRewindPointsResult + history_preview_rewind_request: HistoryPreviewRewindRequest + history_preview_rewind_result: HistoryPreviewRewindResult + history_rewind_change_type: HistoryRewindChangeType + history_rewind_file_preview: HistoryRewindFilePreview + history_rewind_mode: HistoryRewindMode + history_rewind_outcome: HistoryRewindOutcome + history_rewind_point: HistoryRewindPoint + history_rewind_request: HistoryRewindRequest + history_rewind_result: HistoryRewindResult + history_rewind_unavailable_reason: HistoryRewindUnavailableReason + history_skipped_file_restore: HistorySkippedFileRestore history_summarize_for_handoff_result: HistorySummarizeForHandoffResult history_truncate_request: HistoryTruncateRequest history_truncate_result: HistoryTruncateResult @@ -25165,6 +27539,8 @@ class RPC: instruction_source: InstructionSource instruction_source_location: InstructionLocation instruction_source_type: InstructionSourceType + interrupt_main_turn_request: InterruptMainTurnRequest + interrupt_main_turn_result: InterruptMainTurnResult llm_inference_headers: dict[str, list[str]] llm_inference_http_request_chunk_request: LlmInferenceHTTPRequestChunkRequest llm_inference_http_request_chunk_result: LlmInferenceHTTPRequestChunkResult @@ -25244,6 +27620,8 @@ class RPC: mcp_oauth_login_request: MCPOauthLoginRequest mcp_oauth_login_result: MCPOauthLoginResult mcp_oauth_pending_request_response: MCPOauthPendingRequestResponse + mcp_oauth_respond_request: MCPOauthRespondRequest + mcp_oauth_respond_result: MCPOauthRespondResult mcp_register_external_client_request: MCPRegisterExternalClientRequest mcp_reload_with_config_request: MCPReloadWithConfigRequest mcp_remove_git_hub_result: MCPRemoveGitHubResult @@ -25499,13 +27877,22 @@ class RPC: push_attachment_selection_details_end: PushAttachmentSelectionDetailsEnd push_attachment_selection_details_start: PushAttachmentSelectionDetailsStart push_git_hub_repo_ref: PushGitHubRepoRef + queue_begin_deferred_idle_drain_request: QueueBeginDeferredIdleDrainRequest + queue_begin_deferred_idle_drain_result: QueueBeginDeferredIdleDrainResult + queue_consume_system_notifications_request: QueueConsumeSystemNotificationsRequest queued_command_handled: QueuedCommandHandled queued_command_not_handled: QueuedCommandNotHandled queued_command_result: QueuedCommandResult + queue_defer_session_idle_request: QueueDeferSessionIdleRequest + queue_enqueue_resume_pending_result: QueueEnqueueResumePendingResult + queue_finish_deferred_idle_drain_request: QueueFinishDeferredIdleDrainRequest + queue_finish_deferred_idle_drain_result: QueueFinishDeferredIdleDrainResult + queue_has_pending_result: QueueHasPendingResult queue_pending_items: QueuePendingItems queue_pending_items_kind: QueuePendingItemsKind queue_pending_items_result: QueuePendingItemsResult queue_remove_most_recent_result: QueueRemoveMostRecentResult + queue_snapshot_result: QueueSnapshotResult register_event_interest_params: RegisterEventInterestParams register_event_interest_result: RegisterEventInterestResult register_extension_tools_params: _RegisterExtensionToolsParams @@ -25539,8 +27926,15 @@ class RPC: sandbox_config_user_policy_filesystem: SandboxConfigUserPolicyFilesystem sandbox_config_user_policy_network: SandboxConfigUserPolicyNetwork sandbox_config_user_policy_seatbelt: SandboxConfigUserPolicySeatbelt + schedule_add_at_request: ScheduleAddAtRequest + schedule_add_cron_request: ScheduleAddCronRequest + schedule_add_request: ScheduleAddRequest + schedule_add_result: ScheduleAddResult + schedule_add_self_paced_request: ScheduleAddSelfPacedRequest schedule_entry: ScheduleEntry + schedule_has_self_paced_result: ScheduleHasSelfPacedResult schedule_list: ScheduleList + schedule_rearm_self_paced_request: ScheduleRearmSelfPacedRequest schedule_stop_request: ScheduleStopRequest schedule_stop_result: ScheduleStopResult secrets_add_filter_values_request: SecretsAddFilterValuesRequest @@ -25553,6 +27947,7 @@ class RPC: send_mode: SendMode send_request: SendRequest send_result: SendResult + send_system_notification_request: SendSystemNotificationRequest server_agent_list: ServerAgentList server_instruction_source_list: ServerInstructionSourceList server_skill: ServerSkill @@ -25560,6 +27955,7 @@ class RPC: session_activity: SessionActivity session_auth_status: SessionAuthStatus session_bulk_delete_result: SessionBulkDeleteResult + session_cancel_all_background_agents_result: int session_capability: SessionCapability session_completion_item: SessionCompletionItem session_context: SessionContext @@ -25590,6 +27986,11 @@ class RPC: session_fs_sqlite_query_request: SessionFSSqliteQueryRequest session_fs_sqlite_query_result: SessionFSSqliteQueryResult session_fs_sqlite_query_type: SessionFSSqliteQueryType + session_fs_sqlite_transaction_error: SessionFSSqliteTransactionError + session_fs_sqlite_transaction_error_class: SessionFSSqliteTransactionErrorClass + session_fs_sqlite_transaction_request: SessionFSSqliteTransactionRequest + session_fs_sqlite_transaction_result: SessionFSSqliteTransactionResult + session_fs_sqlite_transaction_statement: SessionFSSqliteTransactionStatement session_fs_stat_request: SessionFSStatRequest session_fs_stat_result: SessionFSStatResult session_fs_write_file_request: SessionFSWriteFileRequest @@ -25623,6 +28024,7 @@ class RPC: sessions_check_in_use_result: SessionsCheckInUseResult sessions_close_request: SessionsCloseRequest sessions_close_result: SessionsCloseResult + sessions_delete_request: SessionsDeleteRequest sessions_enrich_metadata_request: SessionsEnrichMetadataRequest session_set_credentials_params: SessionSetCredentialsParams session_set_credentials_result: SessionSetCredentialsResult @@ -25648,9 +28050,13 @@ class RPC: sessions_get_event_file_path_result: SessionsGetEventFilePathResult sessions_get_last_for_context_request: SessionsGetLastForContextRequest sessions_get_last_for_context_result: SessionsGetLastForContextResult + sessions_get_metadata_request: SessionsGetMetadataRequest + sessions_get_metadata_result: SessionsGetMetadataResult sessions_get_persisted_remote_steerable_request: SessionsGetPersistedRemoteSteerableRequest sessions_get_persisted_remote_steerable_result: SessionsGetPersistedRemoteSteerableResult session_sizes: SessionSizes + sessions_list_non_empty_session_ids_request: SessionsListNonEmptySessionIDSRequest + sessions_list_non_empty_session_ids_result: SessionsListNonEmptySessionIDSResult sessions_list_request: SessionsListRequest sessions_load_deferred_repo_hooks_request: SessionsLoadDeferredRepoHooksRequest sessions_open_attach: SessionsOpenAttach @@ -25690,9 +28096,13 @@ class RPC: shell_exec_request: ShellExecRequest shell_exec_result: ShellExecResult shell_execute_user_requested_request: ShellExecuteUserRequestedRequest + shell_init_profile: ShellInitProfile + shell_init_script: ShellInitScript + shell_init_script_shell: ShellInitScriptShell shell_kill_request: ShellKillRequest shell_kill_result: ShellKillResult shell_kill_signal: ShellKillSignal + shell_options: ShellOptions shutdown_request: ShutdownRequest skill: Skill skill_discovery_path: SkillDiscoveryPath @@ -25815,20 +28225,30 @@ class RPC: workspace_diff_file_change_type: WorkspaceDiffFileChangeType workspace_diff_mode: WorkspaceDiffMode workspace_diff_result: WorkspaceDiffResult + workspaces_add_summary_request: WorkspacesAddSummaryRequest + workspaces_add_summary_result: WorkspacesAddSummaryResult + workspaces_autopilot_objective_exists_result: WorkspacesAutopilotObjectiveExistsResult workspaces_checkpoints: WorkspacesCheckpoints workspaces_create_file_request: WorkspacesCreateFileRequest + workspaces_delete_autopilot_objective_result: WorkspacesDeleteAutopilotObjectiveResult workspaces_diff_request: WorkspacesDiffRequest + workspaces_ensure_request: WorkspacesEnsureRequest workspaces_get_workspace_result: WorkspacesGetWorkspaceResult workspaces_list_checkpoints_result: WorkspacesListCheckpointsResult workspaces_list_files_result: WorkspacesListFilesResult + workspaces_read_autopilot_objective_result: WorkspacesReadAutopilotObjectiveResult workspaces_read_checkpoint_request: WorkspacesReadCheckpointRequest workspaces_read_checkpoint_result: WorkspacesReadCheckpointResult workspaces_read_file_request: WorkspacesReadFileRequest workspaces_read_file_result: WorkspacesReadFileResult workspaces_save_large_paste_request: WorkspacesSaveLargePasteRequest workspaces_save_large_paste_result: WorkspacesSaveLargePasteResult + workspaces_truncate_summaries_request: WorkspacesTruncateSummariesRequest workspace_summary_host_type: HostType + workspaces_update_metadata_request: WorkspacesUpdateMetadataRequest workspaces_workspace_details_host_type: HostType + workspaces_write_autopilot_objective_request: WorkspacesWriteAutopilotObjectiveRequest + workspaces_write_autopilot_objective_result: WorkspacesWriteAutopilotObjectiveResult session_context_attribution: SessionContextAttribution | None = None session_context_info: SessionContextInfo | None = None subagent_settings: SubagentSettings | None = None @@ -25884,6 +28304,8 @@ def from_dict(obj: Any) -> 'RPC': api_key_auth_info = APIKeyAuthInfo.from_dict(obj.get("ApiKeyAuthInfo")) auth_info = _load_AuthInfo(obj.get("AuthInfo")) auth_info_type = AuthInfoType(obj.get("AuthInfoType")) + built_in_model_catalog = BuiltInModelCatalog.from_dict(obj.get("BuiltInModelCatalog")) + built_in_model_catalog_entry = BuiltInModelCatalogEntry.from_dict(obj.get("BuiltInModelCatalogEntry")) cancel_user_requested_shell_command_result = CancelUserRequestedShellCommandResult.from_dict(obj.get("CancelUserRequestedShellCommandResult")) canvas_action = CanvasAction.from_dict(obj.get("CanvasAction")) canvas_action_invoke_request = CanvasActionInvokeRequest.from_dict(obj.get("CanvasActionInvokeRequest")) @@ -25918,6 +28340,9 @@ def from_dict(obj: Any) -> 'RPC': connect_remote_session_params = ConnectRemoteSessionParams.from_dict(obj.get("ConnectRemoteSessionParams")) connect_request = _ConnectRequest.from_dict(obj.get("ConnectRequest")) connect_result = _ConnectResult.from_dict(obj.get("ConnectResult")) + content_exclusion_check_paths_request = ContentExclusionCheckPathsRequest.from_dict(obj.get("ContentExclusionCheckPathsRequest")) + content_exclusion_check_paths_result = ContentExclusionCheckPathsResult.from_dict(obj.get("ContentExclusionCheckPathsResult")) + content_exclusion_path_check = ContentExclusionPathCheck.from_dict(obj.get("ContentExclusionPathCheck")) content_filter_mode = ContentFilterMode(obj.get("ContentFilterMode")) context_heaviest_message = ContextHeaviestMessage.from_dict(obj.get("ContextHeaviestMessage")) copilot_api_token_auth_info = CopilotAPITokenAuthInfo.from_dict(obj.get("CopilotApiTokenAuthInfo")) @@ -25982,22 +28407,39 @@ def from_dict(obj: Any) -> 'RPC': factory_agent_options = FactoryAgentOptions.from_dict(obj.get("FactoryAgentOptions")) factory_agent_request = FactoryAgentRequest.from_dict(obj.get("FactoryAgentRequest")) factory_agent_result = FactoryAgentResult.from_dict(obj.get("FactoryAgentResult")) + factory_agent_summary = FactoryAgentSummary.from_dict(obj.get("FactoryAgentSummary")) factory_cancel_request = FactoryCancelRequest.from_dict(obj.get("FactoryCancelRequest")) + factory_current_phase = FactoryCurrentPhase.from_dict(obj.get("FactoryCurrentPhase")) + factory_declared_limits = FactoryDeclaredLimits.from_dict(obj.get("FactoryDeclaredLimits")) + factory_durable_operation = FactoryDurableOperation(obj.get("FactoryDurableOperation")) factory_execute_request = FactoryExecuteRequest.from_dict(obj.get("FactoryExecuteRequest")) factory_execute_result = FactoryExecuteResult.from_dict(obj.get("FactoryExecuteResult")) + factory_get_run_progress_request = FactoryGetRunProgressRequest.from_dict(obj.get("FactoryGetRunProgressRequest")) factory_get_run_request = FactoryGetRunRequest.from_dict(obj.get("FactoryGetRunRequest")) factory_journal_get_request = FactoryJournalGetRequest.from_dict(obj.get("FactoryJournalGetRequest")) factory_journal_get_result = FactoryJournalGetResult.from_dict(obj.get("FactoryJournalGetResult")) factory_journal_put_request = FactoryJournalPutRequest.from_dict(obj.get("FactoryJournalPutRequest")) + factory_list_runs_request = FactoryListRunsRequest.from_dict(obj.get("FactoryListRunsRequest")) + factory_list_runs_result = FactoryListRunsResult.from_dict(obj.get("FactoryListRunsResult")) factory_log_line = FactoryLogLine.from_dict(obj.get("FactoryLogLine")) factory_log_line_kind = FactoryLogLineKind(obj.get("FactoryLogLineKind")) factory_log_request = FactoryLogRequest.from_dict(obj.get("FactoryLogRequest")) + factory_phase_observation = FactoryPhaseObservation.from_dict(obj.get("FactoryPhaseObservation")) + factory_phase_status = FactoryPhaseStatus(obj.get("FactoryPhaseStatus")) + factory_progress_line = FactoryProgressLine.from_dict(obj.get("FactoryProgressLine")) + factory_progress_page = FactoryProgressPage.from_dict(obj.get("FactoryProgressPage")) + factory_resume_request = FactoryResumeRequest.from_dict(obj.get("FactoryResumeRequest")) + factory_resume_result = FactoryResumeResult.from_dict(obj.get("FactoryResumeResult")) + factory_run_consumed = FactoryRunConsumed.from_dict(obj.get("FactoryRunConsumed")) + factory_run_detail = FactoryRunDetail.from_dict(obj.get("FactoryRunDetail")) factory_run_failure = FactoryRunFailure.from_dict(obj.get("FactoryRunFailure")) factory_run_failure_kind = FactoryRunFailureKind(obj.get("FactoryRunFailureKind")) factory_run_limits = FactoryRunLimits.from_dict(obj.get("FactoryRunLimits")) factory_run_request = FactoryRunRequest.from_dict(obj.get("FactoryRunRequest")) factory_run_result = FactoryRunResult.from_dict(obj.get("FactoryRunResult")) factory_run_status = FactoryRunStatus(obj.get("FactoryRunStatus")) + factory_run_summary = FactoryRunSummary.from_dict(obj.get("FactoryRunSummary")) + factory_run_terminal = FactoryRunTerminal.from_dict(obj.get("FactoryRunTerminal")) filter_mapping = from_union([lambda x: from_dict(ContentFilterMode, x), ContentFilterMode], obj.get("FilterMapping")) fleet_start_request = FleetStartRequest.from_dict(obj.get("FleetStartRequest")) fleet_start_result = FleetStartResult.from_dict(obj.get("FleetStartResult")) @@ -26015,6 +28457,19 @@ def from_dict(obj: Any) -> 'RPC': history_compact_context_window = HistoryCompactContextWindow.from_dict(obj.get("HistoryCompactContextWindow")) history_compact_request = HistoryCompactRequest.from_dict(obj.get("HistoryCompactRequest")) history_compact_result = HistoryCompactResult.from_dict(obj.get("HistoryCompactResult")) + history_file_restore_skip_reason = HistoryFileRestoreSkipReason(obj.get("HistoryFileRestoreSkipReason")) + history_list_rewind_points_result = HistoryListRewindPointsResult.from_dict(obj.get("HistoryListRewindPointsResult")) + history_preview_rewind_request = HistoryPreviewRewindRequest.from_dict(obj.get("HistoryPreviewRewindRequest")) + history_preview_rewind_result = HistoryPreviewRewindResult.from_dict(obj.get("HistoryPreviewRewindResult")) + history_rewind_change_type = HistoryRewindChangeType(obj.get("HistoryRewindChangeType")) + history_rewind_file_preview = HistoryRewindFilePreview.from_dict(obj.get("HistoryRewindFilePreview")) + history_rewind_mode = HistoryRewindMode(obj.get("HistoryRewindMode")) + history_rewind_outcome = HistoryRewindOutcome(obj.get("HistoryRewindOutcome")) + history_rewind_point = HistoryRewindPoint.from_dict(obj.get("HistoryRewindPoint")) + history_rewind_request = HistoryRewindRequest.from_dict(obj.get("HistoryRewindRequest")) + history_rewind_result = HistoryRewindResult.from_dict(obj.get("HistoryRewindResult")) + history_rewind_unavailable_reason = HistoryRewindUnavailableReason(obj.get("HistoryRewindUnavailableReason")) + history_skipped_file_restore = HistorySkippedFileRestore.from_dict(obj.get("HistorySkippedFileRestore")) history_summarize_for_handoff_result = HistorySummarizeForHandoffResult.from_dict(obj.get("HistorySummarizeForHandoffResult")) history_truncate_request = HistoryTruncateRequest.from_dict(obj.get("HistoryTruncateRequest")) history_truncate_result = HistoryTruncateResult.from_dict(obj.get("HistoryTruncateResult")) @@ -26038,6 +28493,8 @@ def from_dict(obj: Any) -> 'RPC': instruction_source = InstructionSource.from_dict(obj.get("InstructionSource")) instruction_source_location = InstructionLocation(obj.get("InstructionSourceLocation")) instruction_source_type = InstructionSourceType(obj.get("InstructionSourceType")) + interrupt_main_turn_request = InterruptMainTurnRequest.from_dict(obj.get("InterruptMainTurnRequest")) + interrupt_main_turn_result = InterruptMainTurnResult.from_dict(obj.get("InterruptMainTurnResult")) llm_inference_headers = from_dict(lambda x: from_list(from_str, x), obj.get("LlmInferenceHeaders")) llm_inference_http_request_chunk_request = LlmInferenceHTTPRequestChunkRequest.from_dict(obj.get("LlmInferenceHttpRequestChunkRequest")) llm_inference_http_request_chunk_result = LlmInferenceHTTPRequestChunkResult.from_dict(obj.get("LlmInferenceHttpRequestChunkResult")) @@ -26117,6 +28574,8 @@ def from_dict(obj: Any) -> 'RPC': mcp_oauth_login_request = MCPOauthLoginRequest.from_dict(obj.get("McpOauthLoginRequest")) mcp_oauth_login_result = MCPOauthLoginResult.from_dict(obj.get("McpOauthLoginResult")) mcp_oauth_pending_request_response = MCPOauthPendingRequestResponse.from_dict(obj.get("McpOauthPendingRequestResponse")) + mcp_oauth_respond_request = MCPOauthRespondRequest.from_dict(obj.get("McpOauthRespondRequest")) + mcp_oauth_respond_result = MCPOauthRespondResult.from_dict(obj.get("McpOauthRespondResult")) mcp_register_external_client_request = MCPRegisterExternalClientRequest.from_dict(obj.get("McpRegisterExternalClientRequest")) mcp_reload_with_config_request = MCPReloadWithConfigRequest.from_dict(obj.get("McpReloadWithConfigRequest")) mcp_remove_git_hub_result = MCPRemoveGitHubResult.from_dict(obj.get("McpRemoveGitHubResult")) @@ -26372,13 +28831,22 @@ def from_dict(obj: Any) -> 'RPC': push_attachment_selection_details_end = PushAttachmentSelectionDetailsEnd.from_dict(obj.get("PushAttachmentSelectionDetailsEnd")) push_attachment_selection_details_start = PushAttachmentSelectionDetailsStart.from_dict(obj.get("PushAttachmentSelectionDetailsStart")) push_git_hub_repo_ref = PushGitHubRepoRef.from_dict(obj.get("PushGitHubRepoRef")) + queue_begin_deferred_idle_drain_request = QueueBeginDeferredIdleDrainRequest.from_dict(obj.get("QueueBeginDeferredIdleDrainRequest")) + queue_begin_deferred_idle_drain_result = QueueBeginDeferredIdleDrainResult.from_dict(obj.get("QueueBeginDeferredIdleDrainResult")) + queue_consume_system_notifications_request = QueueConsumeSystemNotificationsRequest.from_dict(obj.get("QueueConsumeSystemNotificationsRequest")) queued_command_handled = QueuedCommandHandled.from_dict(obj.get("QueuedCommandHandled")) queued_command_not_handled = QueuedCommandNotHandled.from_dict(obj.get("QueuedCommandNotHandled")) queued_command_result = _load_QueuedCommandResult(obj.get("QueuedCommandResult")) + queue_defer_session_idle_request = QueueDeferSessionIdleRequest.from_dict(obj.get("QueueDeferSessionIdleRequest")) + queue_enqueue_resume_pending_result = QueueEnqueueResumePendingResult.from_dict(obj.get("QueueEnqueueResumePendingResult")) + queue_finish_deferred_idle_drain_request = QueueFinishDeferredIdleDrainRequest.from_dict(obj.get("QueueFinishDeferredIdleDrainRequest")) + queue_finish_deferred_idle_drain_result = QueueFinishDeferredIdleDrainResult.from_dict(obj.get("QueueFinishDeferredIdleDrainResult")) + queue_has_pending_result = QueueHasPendingResult.from_dict(obj.get("QueueHasPendingResult")) queue_pending_items = QueuePendingItems.from_dict(obj.get("QueuePendingItems")) queue_pending_items_kind = QueuePendingItemsKind(obj.get("QueuePendingItemsKind")) queue_pending_items_result = QueuePendingItemsResult.from_dict(obj.get("QueuePendingItemsResult")) queue_remove_most_recent_result = QueueRemoveMostRecentResult.from_dict(obj.get("QueueRemoveMostRecentResult")) + queue_snapshot_result = QueueSnapshotResult.from_dict(obj.get("QueueSnapshotResult")) register_event_interest_params = RegisterEventInterestParams.from_dict(obj.get("RegisterEventInterestParams")) register_event_interest_result = RegisterEventInterestResult.from_dict(obj.get("RegisterEventInterestResult")) register_extension_tools_params = _RegisterExtensionToolsParams.from_dict(obj.get("RegisterExtensionToolsParams")) @@ -26412,8 +28880,15 @@ def from_dict(obj: Any) -> 'RPC': sandbox_config_user_policy_filesystem = SandboxConfigUserPolicyFilesystem.from_dict(obj.get("SandboxConfigUserPolicyFilesystem")) sandbox_config_user_policy_network = SandboxConfigUserPolicyNetwork.from_dict(obj.get("SandboxConfigUserPolicyNetwork")) sandbox_config_user_policy_seatbelt = SandboxConfigUserPolicySeatbelt.from_dict(obj.get("SandboxConfigUserPolicySeatbelt")) + schedule_add_at_request = ScheduleAddAtRequest.from_dict(obj.get("ScheduleAddAtRequest")) + schedule_add_cron_request = ScheduleAddCronRequest.from_dict(obj.get("ScheduleAddCronRequest")) + schedule_add_request = ScheduleAddRequest.from_dict(obj.get("ScheduleAddRequest")) + schedule_add_result = ScheduleAddResult.from_dict(obj.get("ScheduleAddResult")) + schedule_add_self_paced_request = ScheduleAddSelfPacedRequest.from_dict(obj.get("ScheduleAddSelfPacedRequest")) schedule_entry = ScheduleEntry.from_dict(obj.get("ScheduleEntry")) + schedule_has_self_paced_result = ScheduleHasSelfPacedResult.from_dict(obj.get("ScheduleHasSelfPacedResult")) schedule_list = ScheduleList.from_dict(obj.get("ScheduleList")) + schedule_rearm_self_paced_request = ScheduleRearmSelfPacedRequest.from_dict(obj.get("ScheduleRearmSelfPacedRequest")) schedule_stop_request = ScheduleStopRequest.from_dict(obj.get("ScheduleStopRequest")) schedule_stop_result = ScheduleStopResult.from_dict(obj.get("ScheduleStopResult")) secrets_add_filter_values_request = SecretsAddFilterValuesRequest.from_dict(obj.get("SecretsAddFilterValuesRequest")) @@ -26426,6 +28901,7 @@ def from_dict(obj: Any) -> 'RPC': send_mode = SendMode(obj.get("SendMode")) send_request = SendRequest.from_dict(obj.get("SendRequest")) send_result = SendResult.from_dict(obj.get("SendResult")) + send_system_notification_request = SendSystemNotificationRequest.from_dict(obj.get("SendSystemNotificationRequest")) server_agent_list = ServerAgentList.from_dict(obj.get("ServerAgentList")) server_instruction_source_list = ServerInstructionSourceList.from_dict(obj.get("ServerInstructionSourceList")) server_skill = ServerSkill.from_dict(obj.get("ServerSkill")) @@ -26433,6 +28909,7 @@ def from_dict(obj: Any) -> 'RPC': session_activity = SessionActivity.from_dict(obj.get("SessionActivity")) session_auth_status = SessionAuthStatus.from_dict(obj.get("SessionAuthStatus")) session_bulk_delete_result = SessionBulkDeleteResult.from_dict(obj.get("SessionBulkDeleteResult")) + session_cancel_all_background_agents_result = from_int(obj.get("SessionCancelAllBackgroundAgentsResult")) session_capability = SessionCapability(obj.get("SessionCapability")) session_completion_item = SessionCompletionItem.from_dict(obj.get("SessionCompletionItem")) session_context = SessionContext.from_dict(obj.get("SessionContext")) @@ -26463,6 +28940,11 @@ def from_dict(obj: Any) -> 'RPC': session_fs_sqlite_query_request = SessionFSSqliteQueryRequest.from_dict(obj.get("SessionFsSqliteQueryRequest")) session_fs_sqlite_query_result = SessionFSSqliteQueryResult.from_dict(obj.get("SessionFsSqliteQueryResult")) session_fs_sqlite_query_type = SessionFSSqliteQueryType(obj.get("SessionFsSqliteQueryType")) + session_fs_sqlite_transaction_error = SessionFSSqliteTransactionError.from_dict(obj.get("SessionFsSqliteTransactionError")) + session_fs_sqlite_transaction_error_class = SessionFSSqliteTransactionErrorClass(obj.get("SessionFsSqliteTransactionErrorClass")) + session_fs_sqlite_transaction_request = SessionFSSqliteTransactionRequest.from_dict(obj.get("SessionFsSqliteTransactionRequest")) + session_fs_sqlite_transaction_result = SessionFSSqliteTransactionResult.from_dict(obj.get("SessionFsSqliteTransactionResult")) + session_fs_sqlite_transaction_statement = SessionFSSqliteTransactionStatement.from_dict(obj.get("SessionFsSqliteTransactionStatement")) session_fs_stat_request = SessionFSStatRequest.from_dict(obj.get("SessionFsStatRequest")) session_fs_stat_result = SessionFSStatResult.from_dict(obj.get("SessionFsStatResult")) session_fs_write_file_request = SessionFSWriteFileRequest.from_dict(obj.get("SessionFsWriteFileRequest")) @@ -26496,6 +28978,7 @@ def from_dict(obj: Any) -> 'RPC': sessions_check_in_use_result = SessionsCheckInUseResult.from_dict(obj.get("SessionsCheckInUseResult")) sessions_close_request = SessionsCloseRequest.from_dict(obj.get("SessionsCloseRequest")) sessions_close_result = SessionsCloseResult.from_dict(obj.get("SessionsCloseResult")) + sessions_delete_request = SessionsDeleteRequest.from_dict(obj.get("SessionsDeleteRequest")) sessions_enrich_metadata_request = SessionsEnrichMetadataRequest.from_dict(obj.get("SessionsEnrichMetadataRequest")) session_set_credentials_params = SessionSetCredentialsParams.from_dict(obj.get("SessionSetCredentialsParams")) session_set_credentials_result = SessionSetCredentialsResult.from_dict(obj.get("SessionSetCredentialsResult")) @@ -26521,9 +29004,13 @@ def from_dict(obj: Any) -> 'RPC': sessions_get_event_file_path_result = SessionsGetEventFilePathResult.from_dict(obj.get("SessionsGetEventFilePathResult")) sessions_get_last_for_context_request = SessionsGetLastForContextRequest.from_dict(obj.get("SessionsGetLastForContextRequest")) sessions_get_last_for_context_result = SessionsGetLastForContextResult.from_dict(obj.get("SessionsGetLastForContextResult")) + sessions_get_metadata_request = SessionsGetMetadataRequest.from_dict(obj.get("SessionsGetMetadataRequest")) + sessions_get_metadata_result = SessionsGetMetadataResult.from_dict(obj.get("SessionsGetMetadataResult")) sessions_get_persisted_remote_steerable_request = SessionsGetPersistedRemoteSteerableRequest.from_dict(obj.get("SessionsGetPersistedRemoteSteerableRequest")) sessions_get_persisted_remote_steerable_result = SessionsGetPersistedRemoteSteerableResult.from_dict(obj.get("SessionsGetPersistedRemoteSteerableResult")) session_sizes = SessionSizes.from_dict(obj.get("SessionSizes")) + sessions_list_non_empty_session_ids_request = SessionsListNonEmptySessionIDSRequest.from_dict(obj.get("SessionsListNonEmptySessionIdsRequest")) + sessions_list_non_empty_session_ids_result = SessionsListNonEmptySessionIDSResult.from_dict(obj.get("SessionsListNonEmptySessionIdsResult")) sessions_list_request = SessionsListRequest.from_dict(obj.get("SessionsListRequest")) sessions_load_deferred_repo_hooks_request = SessionsLoadDeferredRepoHooksRequest.from_dict(obj.get("SessionsLoadDeferredRepoHooksRequest")) sessions_open_attach = SessionsOpenAttach.from_dict(obj.get("SessionsOpenAttach")) @@ -26563,9 +29050,13 @@ def from_dict(obj: Any) -> 'RPC': shell_exec_request = ShellExecRequest.from_dict(obj.get("ShellExecRequest")) shell_exec_result = ShellExecResult.from_dict(obj.get("ShellExecResult")) shell_execute_user_requested_request = ShellExecuteUserRequestedRequest.from_dict(obj.get("ShellExecuteUserRequestedRequest")) + shell_init_profile = ShellInitProfile(obj.get("ShellInitProfile")) + shell_init_script = ShellInitScript.from_dict(obj.get("ShellInitScript")) + shell_init_script_shell = ShellInitScriptShell(obj.get("ShellInitScriptShell")) shell_kill_request = ShellKillRequest.from_dict(obj.get("ShellKillRequest")) shell_kill_result = ShellKillResult.from_dict(obj.get("ShellKillResult")) shell_kill_signal = ShellKillSignal(obj.get("ShellKillSignal")) + shell_options = ShellOptions.from_dict(obj.get("ShellOptions")) shutdown_request = ShutdownRequest.from_dict(obj.get("ShutdownRequest")) skill = Skill.from_dict(obj.get("Skill")) skill_discovery_path = SkillDiscoveryPath.from_dict(obj.get("SkillDiscoveryPath")) @@ -26688,26 +29179,36 @@ def from_dict(obj: Any) -> 'RPC': workspace_diff_file_change_type = WorkspaceDiffFileChangeType(obj.get("WorkspaceDiffFileChangeType")) workspace_diff_mode = WorkspaceDiffMode(obj.get("WorkspaceDiffMode")) workspace_diff_result = WorkspaceDiffResult.from_dict(obj.get("WorkspaceDiffResult")) + workspaces_add_summary_request = WorkspacesAddSummaryRequest.from_dict(obj.get("WorkspacesAddSummaryRequest")) + workspaces_add_summary_result = WorkspacesAddSummaryResult.from_dict(obj.get("WorkspacesAddSummaryResult")) + workspaces_autopilot_objective_exists_result = WorkspacesAutopilotObjectiveExistsResult.from_dict(obj.get("WorkspacesAutopilotObjectiveExistsResult")) workspaces_checkpoints = WorkspacesCheckpoints.from_dict(obj.get("WorkspacesCheckpoints")) workspaces_create_file_request = WorkspacesCreateFileRequest.from_dict(obj.get("WorkspacesCreateFileRequest")) + workspaces_delete_autopilot_objective_result = WorkspacesDeleteAutopilotObjectiveResult.from_dict(obj.get("WorkspacesDeleteAutopilotObjectiveResult")) workspaces_diff_request = WorkspacesDiffRequest.from_dict(obj.get("WorkspacesDiffRequest")) + workspaces_ensure_request = WorkspacesEnsureRequest.from_dict(obj.get("WorkspacesEnsureRequest")) workspaces_get_workspace_result = WorkspacesGetWorkspaceResult.from_dict(obj.get("WorkspacesGetWorkspaceResult")) workspaces_list_checkpoints_result = WorkspacesListCheckpointsResult.from_dict(obj.get("WorkspacesListCheckpointsResult")) workspaces_list_files_result = WorkspacesListFilesResult.from_dict(obj.get("WorkspacesListFilesResult")) + workspaces_read_autopilot_objective_result = WorkspacesReadAutopilotObjectiveResult.from_dict(obj.get("WorkspacesReadAutopilotObjectiveResult")) workspaces_read_checkpoint_request = WorkspacesReadCheckpointRequest.from_dict(obj.get("WorkspacesReadCheckpointRequest")) workspaces_read_checkpoint_result = WorkspacesReadCheckpointResult.from_dict(obj.get("WorkspacesReadCheckpointResult")) workspaces_read_file_request = WorkspacesReadFileRequest.from_dict(obj.get("WorkspacesReadFileRequest")) workspaces_read_file_result = WorkspacesReadFileResult.from_dict(obj.get("WorkspacesReadFileResult")) workspaces_save_large_paste_request = WorkspacesSaveLargePasteRequest.from_dict(obj.get("WorkspacesSaveLargePasteRequest")) workspaces_save_large_paste_result = WorkspacesSaveLargePasteResult.from_dict(obj.get("WorkspacesSaveLargePasteResult")) + workspaces_truncate_summaries_request = WorkspacesTruncateSummariesRequest.from_dict(obj.get("WorkspacesTruncateSummariesRequest")) workspace_summary_host_type = HostType(obj.get("WorkspaceSummaryHostType")) + workspaces_update_metadata_request = WorkspacesUpdateMetadataRequest.from_dict(obj.get("WorkspacesUpdateMetadataRequest")) workspaces_workspace_details_host_type = HostType(obj.get("WorkspacesWorkspaceDetailsHostType")) + workspaces_write_autopilot_objective_request = WorkspacesWriteAutopilotObjectiveRequest.from_dict(obj.get("WorkspacesWriteAutopilotObjectiveRequest")) + workspaces_write_autopilot_objective_result = WorkspacesWriteAutopilotObjectiveResult.from_dict(obj.get("WorkspacesWriteAutopilotObjectiveResult")) session_context_attribution = from_union([SessionContextAttribution.from_dict, from_none], obj.get("SessionContextAttribution")) session_context_info = from_union([SessionContextInfo.from_dict, from_none], obj.get("SessionContextInfo")) subagent_settings = from_union([SubagentSettings.from_dict, from_none], obj.get("SubagentSettings")) task_progress = from_union([TaskProgress.from_dict, from_none], obj.get("TaskProgress")) workspace_summary = from_union([WorkspaceSummary.from_dict, from_none], obj.get("WorkspaceSummary")) - return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agents_get_discovery_paths_request, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_session_context, capi_session_options, command_list, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, discovered_canvas, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, factory_abort_request, factory_ack_result, factory_agent_options, factory_agent_request, factory_agent_result, factory_cancel_request, factory_execute_request, factory_execute_result, factory_get_run_request, factory_journal_get_request, factory_journal_get_result, factory_journal_put_request, factory_log_line, factory_log_line_kind, factory_log_request, factory_run_failure, factory_run_failure_kind, factory_run_limits, factory_run_request, factory_run_result, factory_run_status, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_type, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_register_external_client_request, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_picker_category, model_picker_price_category, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_allow_all_mode, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_allow_all_source, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queued_command_handled, queued_command_not_handled, queued_command_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_most_recent_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, run_options, sandbox_config, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_seatbelt, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_auth_status, session_bulk_delete_result, session_capability, session_completion_item, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_model_price_category, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, shell_cancel_user_requested_request, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_diff_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspace_summary_host_type, workspaces_workspace_details_host_type, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) + return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agents_get_discovery_paths_request, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, built_in_model_catalog, built_in_model_catalog_entry, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_session_context, capi_session_options, command_list, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, discovered_canvas, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, factory_abort_request, factory_ack_result, factory_agent_options, factory_agent_request, factory_agent_result, factory_agent_summary, factory_cancel_request, factory_current_phase, factory_declared_limits, factory_durable_operation, factory_execute_request, factory_execute_result, factory_get_run_progress_request, factory_get_run_request, factory_journal_get_request, factory_journal_get_result, factory_journal_put_request, factory_list_runs_request, factory_list_runs_result, factory_log_line, factory_log_line_kind, factory_log_request, factory_phase_observation, factory_phase_status, factory_progress_line, factory_progress_page, factory_resume_request, factory_resume_result, factory_run_consumed, factory_run_detail, factory_run_failure, factory_run_failure_kind, factory_run_limits, factory_run_request, factory_run_result, factory_run_status, factory_run_summary, factory_run_terminal, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_type, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, interrupt_main_turn_request, interrupt_main_turn_result, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_register_external_client_request, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_picker_category, model_picker_price_category, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_allow_all_mode, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_allow_all_source, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_most_recent_result, queue_snapshot_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, run_options, sandbox_config, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_seatbelt, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_auth_status, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_completion_item, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_model_price_category, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, shell_cancel_user_requested_request, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -26757,6 +29258,8 @@ def to_dict(self) -> dict: result["ApiKeyAuthInfo"] = to_class(APIKeyAuthInfo, self.api_key_auth_info) result["AuthInfo"] = (self.auth_info).to_dict() result["AuthInfoType"] = to_enum(AuthInfoType, self.auth_info_type) + result["BuiltInModelCatalog"] = to_class(BuiltInModelCatalog, self.built_in_model_catalog) + result["BuiltInModelCatalogEntry"] = to_class(BuiltInModelCatalogEntry, self.built_in_model_catalog_entry) result["CancelUserRequestedShellCommandResult"] = to_class(CancelUserRequestedShellCommandResult, self.cancel_user_requested_shell_command_result) result["CanvasAction"] = to_class(CanvasAction, self.canvas_action) result["CanvasActionInvokeRequest"] = to_class(CanvasActionInvokeRequest, self.canvas_action_invoke_request) @@ -26791,6 +29294,9 @@ def to_dict(self) -> dict: result["ConnectRemoteSessionParams"] = to_class(ConnectRemoteSessionParams, self.connect_remote_session_params) result["ConnectRequest"] = to_class(_ConnectRequest, self.connect_request) result["ConnectResult"] = to_class(_ConnectResult, self.connect_result) + result["ContentExclusionCheckPathsRequest"] = to_class(ContentExclusionCheckPathsRequest, self.content_exclusion_check_paths_request) + result["ContentExclusionCheckPathsResult"] = to_class(ContentExclusionCheckPathsResult, self.content_exclusion_check_paths_result) + result["ContentExclusionPathCheck"] = to_class(ContentExclusionPathCheck, self.content_exclusion_path_check) result["ContentFilterMode"] = to_enum(ContentFilterMode, self.content_filter_mode) result["ContextHeaviestMessage"] = to_class(ContextHeaviestMessage, self.context_heaviest_message) result["CopilotApiTokenAuthInfo"] = to_class(CopilotAPITokenAuthInfo, self.copilot_api_token_auth_info) @@ -26855,22 +29361,39 @@ def to_dict(self) -> dict: result["FactoryAgentOptions"] = to_class(FactoryAgentOptions, self.factory_agent_options) result["FactoryAgentRequest"] = to_class(FactoryAgentRequest, self.factory_agent_request) result["FactoryAgentResult"] = to_class(FactoryAgentResult, self.factory_agent_result) + result["FactoryAgentSummary"] = to_class(FactoryAgentSummary, self.factory_agent_summary) result["FactoryCancelRequest"] = to_class(FactoryCancelRequest, self.factory_cancel_request) + result["FactoryCurrentPhase"] = to_class(FactoryCurrentPhase, self.factory_current_phase) + result["FactoryDeclaredLimits"] = to_class(FactoryDeclaredLimits, self.factory_declared_limits) + result["FactoryDurableOperation"] = to_enum(FactoryDurableOperation, self.factory_durable_operation) result["FactoryExecuteRequest"] = to_class(FactoryExecuteRequest, self.factory_execute_request) result["FactoryExecuteResult"] = to_class(FactoryExecuteResult, self.factory_execute_result) + result["FactoryGetRunProgressRequest"] = to_class(FactoryGetRunProgressRequest, self.factory_get_run_progress_request) result["FactoryGetRunRequest"] = to_class(FactoryGetRunRequest, self.factory_get_run_request) result["FactoryJournalGetRequest"] = to_class(FactoryJournalGetRequest, self.factory_journal_get_request) result["FactoryJournalGetResult"] = to_class(FactoryJournalGetResult, self.factory_journal_get_result) result["FactoryJournalPutRequest"] = to_class(FactoryJournalPutRequest, self.factory_journal_put_request) + result["FactoryListRunsRequest"] = to_class(FactoryListRunsRequest, self.factory_list_runs_request) + result["FactoryListRunsResult"] = to_class(FactoryListRunsResult, self.factory_list_runs_result) result["FactoryLogLine"] = to_class(FactoryLogLine, self.factory_log_line) result["FactoryLogLineKind"] = to_enum(FactoryLogLineKind, self.factory_log_line_kind) result["FactoryLogRequest"] = to_class(FactoryLogRequest, self.factory_log_request) + result["FactoryPhaseObservation"] = to_class(FactoryPhaseObservation, self.factory_phase_observation) + result["FactoryPhaseStatus"] = to_enum(FactoryPhaseStatus, self.factory_phase_status) + result["FactoryProgressLine"] = to_class(FactoryProgressLine, self.factory_progress_line) + result["FactoryProgressPage"] = to_class(FactoryProgressPage, self.factory_progress_page) + result["FactoryResumeRequest"] = to_class(FactoryResumeRequest, self.factory_resume_request) + result["FactoryResumeResult"] = to_class(FactoryResumeResult, self.factory_resume_result) + result["FactoryRunConsumed"] = to_class(FactoryRunConsumed, self.factory_run_consumed) + result["FactoryRunDetail"] = to_class(FactoryRunDetail, self.factory_run_detail) result["FactoryRunFailure"] = to_class(FactoryRunFailure, self.factory_run_failure) result["FactoryRunFailureKind"] = to_enum(FactoryRunFailureKind, self.factory_run_failure_kind) result["FactoryRunLimits"] = to_class(FactoryRunLimits, self.factory_run_limits) result["FactoryRunRequest"] = to_class(FactoryRunRequest, self.factory_run_request) result["FactoryRunResult"] = to_class(FactoryRunResult, self.factory_run_result) result["FactoryRunStatus"] = to_enum(FactoryRunStatus, self.factory_run_status) + result["FactoryRunSummary"] = to_class(FactoryRunSummary, self.factory_run_summary) + result["FactoryRunTerminal"] = to_class(FactoryRunTerminal, self.factory_run_terminal) result["FilterMapping"] = from_union([lambda x: from_dict(lambda x: to_enum(ContentFilterMode, x), x), lambda x: to_enum(ContentFilterMode, x)], self.filter_mapping) result["FleetStartRequest"] = to_class(FleetStartRequest, self.fleet_start_request) result["FleetStartResult"] = to_class(FleetStartResult, self.fleet_start_result) @@ -26888,6 +29411,19 @@ def to_dict(self) -> dict: result["HistoryCompactContextWindow"] = to_class(HistoryCompactContextWindow, self.history_compact_context_window) result["HistoryCompactRequest"] = to_class(HistoryCompactRequest, self.history_compact_request) result["HistoryCompactResult"] = to_class(HistoryCompactResult, self.history_compact_result) + result["HistoryFileRestoreSkipReason"] = to_enum(HistoryFileRestoreSkipReason, self.history_file_restore_skip_reason) + result["HistoryListRewindPointsResult"] = to_class(HistoryListRewindPointsResult, self.history_list_rewind_points_result) + result["HistoryPreviewRewindRequest"] = to_class(HistoryPreviewRewindRequest, self.history_preview_rewind_request) + result["HistoryPreviewRewindResult"] = to_class(HistoryPreviewRewindResult, self.history_preview_rewind_result) + result["HistoryRewindChangeType"] = to_enum(HistoryRewindChangeType, self.history_rewind_change_type) + result["HistoryRewindFilePreview"] = to_class(HistoryRewindFilePreview, self.history_rewind_file_preview) + result["HistoryRewindMode"] = to_enum(HistoryRewindMode, self.history_rewind_mode) + result["HistoryRewindOutcome"] = to_enum(HistoryRewindOutcome, self.history_rewind_outcome) + result["HistoryRewindPoint"] = to_class(HistoryRewindPoint, self.history_rewind_point) + result["HistoryRewindRequest"] = to_class(HistoryRewindRequest, self.history_rewind_request) + result["HistoryRewindResult"] = to_class(HistoryRewindResult, self.history_rewind_result) + result["HistoryRewindUnavailableReason"] = to_enum(HistoryRewindUnavailableReason, self.history_rewind_unavailable_reason) + result["HistorySkippedFileRestore"] = to_class(HistorySkippedFileRestore, self.history_skipped_file_restore) result["HistorySummarizeForHandoffResult"] = to_class(HistorySummarizeForHandoffResult, self.history_summarize_for_handoff_result) result["HistoryTruncateRequest"] = to_class(HistoryTruncateRequest, self.history_truncate_request) result["HistoryTruncateResult"] = to_class(HistoryTruncateResult, self.history_truncate_result) @@ -26911,6 +29447,8 @@ def to_dict(self) -> dict: result["InstructionSource"] = to_class(InstructionSource, self.instruction_source) result["InstructionSourceLocation"] = to_enum(InstructionLocation, self.instruction_source_location) result["InstructionSourceType"] = to_enum(InstructionSourceType, self.instruction_source_type) + result["InterruptMainTurnRequest"] = to_class(InterruptMainTurnRequest, self.interrupt_main_turn_request) + result["InterruptMainTurnResult"] = to_class(InterruptMainTurnResult, self.interrupt_main_turn_result) result["LlmInferenceHeaders"] = from_dict(lambda x: from_list(from_str, x), self.llm_inference_headers) result["LlmInferenceHttpRequestChunkRequest"] = to_class(LlmInferenceHTTPRequestChunkRequest, self.llm_inference_http_request_chunk_request) result["LlmInferenceHttpRequestChunkResult"] = to_class(LlmInferenceHTTPRequestChunkResult, self.llm_inference_http_request_chunk_result) @@ -26990,6 +29528,8 @@ def to_dict(self) -> dict: result["McpOauthLoginRequest"] = to_class(MCPOauthLoginRequest, self.mcp_oauth_login_request) result["McpOauthLoginResult"] = to_class(MCPOauthLoginResult, self.mcp_oauth_login_result) result["McpOauthPendingRequestResponse"] = to_class(MCPOauthPendingRequestResponse, self.mcp_oauth_pending_request_response) + result["McpOauthRespondRequest"] = to_class(MCPOauthRespondRequest, self.mcp_oauth_respond_request) + result["McpOauthRespondResult"] = to_class(MCPOauthRespondResult, self.mcp_oauth_respond_result) result["McpRegisterExternalClientRequest"] = to_class(MCPRegisterExternalClientRequest, self.mcp_register_external_client_request) result["McpReloadWithConfigRequest"] = to_class(MCPReloadWithConfigRequest, self.mcp_reload_with_config_request) result["McpRemoveGitHubResult"] = to_class(MCPRemoveGitHubResult, self.mcp_remove_git_hub_result) @@ -27245,13 +29785,22 @@ def to_dict(self) -> dict: result["PushAttachmentSelectionDetailsEnd"] = to_class(PushAttachmentSelectionDetailsEnd, self.push_attachment_selection_details_end) result["PushAttachmentSelectionDetailsStart"] = to_class(PushAttachmentSelectionDetailsStart, self.push_attachment_selection_details_start) result["PushGitHubRepoRef"] = to_class(PushGitHubRepoRef, self.push_git_hub_repo_ref) + result["QueueBeginDeferredIdleDrainRequest"] = to_class(QueueBeginDeferredIdleDrainRequest, self.queue_begin_deferred_idle_drain_request) + result["QueueBeginDeferredIdleDrainResult"] = to_class(QueueBeginDeferredIdleDrainResult, self.queue_begin_deferred_idle_drain_result) + result["QueueConsumeSystemNotificationsRequest"] = to_class(QueueConsumeSystemNotificationsRequest, self.queue_consume_system_notifications_request) result["QueuedCommandHandled"] = to_class(QueuedCommandHandled, self.queued_command_handled) result["QueuedCommandNotHandled"] = to_class(QueuedCommandNotHandled, self.queued_command_not_handled) result["QueuedCommandResult"] = (self.queued_command_result).to_dict() + result["QueueDeferSessionIdleRequest"] = to_class(QueueDeferSessionIdleRequest, self.queue_defer_session_idle_request) + result["QueueEnqueueResumePendingResult"] = to_class(QueueEnqueueResumePendingResult, self.queue_enqueue_resume_pending_result) + result["QueueFinishDeferredIdleDrainRequest"] = to_class(QueueFinishDeferredIdleDrainRequest, self.queue_finish_deferred_idle_drain_request) + result["QueueFinishDeferredIdleDrainResult"] = to_class(QueueFinishDeferredIdleDrainResult, self.queue_finish_deferred_idle_drain_result) + result["QueueHasPendingResult"] = to_class(QueueHasPendingResult, self.queue_has_pending_result) result["QueuePendingItems"] = to_class(QueuePendingItems, self.queue_pending_items) result["QueuePendingItemsKind"] = to_enum(QueuePendingItemsKind, self.queue_pending_items_kind) result["QueuePendingItemsResult"] = to_class(QueuePendingItemsResult, self.queue_pending_items_result) result["QueueRemoveMostRecentResult"] = to_class(QueueRemoveMostRecentResult, self.queue_remove_most_recent_result) + result["QueueSnapshotResult"] = to_class(QueueSnapshotResult, self.queue_snapshot_result) result["RegisterEventInterestParams"] = to_class(RegisterEventInterestParams, self.register_event_interest_params) result["RegisterEventInterestResult"] = to_class(RegisterEventInterestResult, self.register_event_interest_result) result["RegisterExtensionToolsParams"] = to_class(_RegisterExtensionToolsParams, self.register_extension_tools_params) @@ -27285,8 +29834,15 @@ def to_dict(self) -> dict: result["SandboxConfigUserPolicyFilesystem"] = to_class(SandboxConfigUserPolicyFilesystem, self.sandbox_config_user_policy_filesystem) result["SandboxConfigUserPolicyNetwork"] = to_class(SandboxConfigUserPolicyNetwork, self.sandbox_config_user_policy_network) result["SandboxConfigUserPolicySeatbelt"] = to_class(SandboxConfigUserPolicySeatbelt, self.sandbox_config_user_policy_seatbelt) + result["ScheduleAddAtRequest"] = to_class(ScheduleAddAtRequest, self.schedule_add_at_request) + result["ScheduleAddCronRequest"] = to_class(ScheduleAddCronRequest, self.schedule_add_cron_request) + result["ScheduleAddRequest"] = to_class(ScheduleAddRequest, self.schedule_add_request) + result["ScheduleAddResult"] = to_class(ScheduleAddResult, self.schedule_add_result) + result["ScheduleAddSelfPacedRequest"] = to_class(ScheduleAddSelfPacedRequest, self.schedule_add_self_paced_request) result["ScheduleEntry"] = to_class(ScheduleEntry, self.schedule_entry) + result["ScheduleHasSelfPacedResult"] = to_class(ScheduleHasSelfPacedResult, self.schedule_has_self_paced_result) result["ScheduleList"] = to_class(ScheduleList, self.schedule_list) + result["ScheduleRearmSelfPacedRequest"] = to_class(ScheduleRearmSelfPacedRequest, self.schedule_rearm_self_paced_request) result["ScheduleStopRequest"] = to_class(ScheduleStopRequest, self.schedule_stop_request) result["ScheduleStopResult"] = to_class(ScheduleStopResult, self.schedule_stop_result) result["SecretsAddFilterValuesRequest"] = to_class(SecretsAddFilterValuesRequest, self.secrets_add_filter_values_request) @@ -27299,6 +29855,7 @@ def to_dict(self) -> dict: result["SendMode"] = to_enum(SendMode, self.send_mode) result["SendRequest"] = to_class(SendRequest, self.send_request) result["SendResult"] = to_class(SendResult, self.send_result) + result["SendSystemNotificationRequest"] = to_class(SendSystemNotificationRequest, self.send_system_notification_request) result["ServerAgentList"] = to_class(ServerAgentList, self.server_agent_list) result["ServerInstructionSourceList"] = to_class(ServerInstructionSourceList, self.server_instruction_source_list) result["ServerSkill"] = to_class(ServerSkill, self.server_skill) @@ -27306,6 +29863,7 @@ def to_dict(self) -> dict: result["SessionActivity"] = to_class(SessionActivity, self.session_activity) result["SessionAuthStatus"] = to_class(SessionAuthStatus, self.session_auth_status) result["SessionBulkDeleteResult"] = to_class(SessionBulkDeleteResult, self.session_bulk_delete_result) + result["SessionCancelAllBackgroundAgentsResult"] = from_int(self.session_cancel_all_background_agents_result) result["SessionCapability"] = to_enum(SessionCapability, self.session_capability) result["SessionCompletionItem"] = to_class(SessionCompletionItem, self.session_completion_item) result["SessionContext"] = to_class(SessionContext, self.session_context) @@ -27336,6 +29894,11 @@ def to_dict(self) -> dict: result["SessionFsSqliteQueryRequest"] = to_class(SessionFSSqliteQueryRequest, self.session_fs_sqlite_query_request) result["SessionFsSqliteQueryResult"] = to_class(SessionFSSqliteQueryResult, self.session_fs_sqlite_query_result) result["SessionFsSqliteQueryType"] = to_enum(SessionFSSqliteQueryType, self.session_fs_sqlite_query_type) + result["SessionFsSqliteTransactionError"] = to_class(SessionFSSqliteTransactionError, self.session_fs_sqlite_transaction_error) + result["SessionFsSqliteTransactionErrorClass"] = to_enum(SessionFSSqliteTransactionErrorClass, self.session_fs_sqlite_transaction_error_class) + result["SessionFsSqliteTransactionRequest"] = to_class(SessionFSSqliteTransactionRequest, self.session_fs_sqlite_transaction_request) + result["SessionFsSqliteTransactionResult"] = to_class(SessionFSSqliteTransactionResult, self.session_fs_sqlite_transaction_result) + result["SessionFsSqliteTransactionStatement"] = to_class(SessionFSSqliteTransactionStatement, self.session_fs_sqlite_transaction_statement) result["SessionFsStatRequest"] = to_class(SessionFSStatRequest, self.session_fs_stat_request) result["SessionFsStatResult"] = to_class(SessionFSStatResult, self.session_fs_stat_result) result["SessionFsWriteFileRequest"] = to_class(SessionFSWriteFileRequest, self.session_fs_write_file_request) @@ -27369,6 +29932,7 @@ def to_dict(self) -> dict: result["SessionsCheckInUseResult"] = to_class(SessionsCheckInUseResult, self.sessions_check_in_use_result) result["SessionsCloseRequest"] = to_class(SessionsCloseRequest, self.sessions_close_request) result["SessionsCloseResult"] = to_class(SessionsCloseResult, self.sessions_close_result) + result["SessionsDeleteRequest"] = to_class(SessionsDeleteRequest, self.sessions_delete_request) result["SessionsEnrichMetadataRequest"] = to_class(SessionsEnrichMetadataRequest, self.sessions_enrich_metadata_request) result["SessionSetCredentialsParams"] = to_class(SessionSetCredentialsParams, self.session_set_credentials_params) result["SessionSetCredentialsResult"] = to_class(SessionSetCredentialsResult, self.session_set_credentials_result) @@ -27394,9 +29958,13 @@ def to_dict(self) -> dict: result["SessionsGetEventFilePathResult"] = to_class(SessionsGetEventFilePathResult, self.sessions_get_event_file_path_result) result["SessionsGetLastForContextRequest"] = to_class(SessionsGetLastForContextRequest, self.sessions_get_last_for_context_request) result["SessionsGetLastForContextResult"] = to_class(SessionsGetLastForContextResult, self.sessions_get_last_for_context_result) + result["SessionsGetMetadataRequest"] = to_class(SessionsGetMetadataRequest, self.sessions_get_metadata_request) + result["SessionsGetMetadataResult"] = to_class(SessionsGetMetadataResult, self.sessions_get_metadata_result) result["SessionsGetPersistedRemoteSteerableRequest"] = to_class(SessionsGetPersistedRemoteSteerableRequest, self.sessions_get_persisted_remote_steerable_request) result["SessionsGetPersistedRemoteSteerableResult"] = to_class(SessionsGetPersistedRemoteSteerableResult, self.sessions_get_persisted_remote_steerable_result) result["SessionSizes"] = to_class(SessionSizes, self.session_sizes) + result["SessionsListNonEmptySessionIdsRequest"] = to_class(SessionsListNonEmptySessionIDSRequest, self.sessions_list_non_empty_session_ids_request) + result["SessionsListNonEmptySessionIdsResult"] = to_class(SessionsListNonEmptySessionIDSResult, self.sessions_list_non_empty_session_ids_result) result["SessionsListRequest"] = to_class(SessionsListRequest, self.sessions_list_request) result["SessionsLoadDeferredRepoHooksRequest"] = to_class(SessionsLoadDeferredRepoHooksRequest, self.sessions_load_deferred_repo_hooks_request) result["SessionsOpenAttach"] = to_class(SessionsOpenAttach, self.sessions_open_attach) @@ -27436,9 +30004,13 @@ def to_dict(self) -> dict: result["ShellExecRequest"] = to_class(ShellExecRequest, self.shell_exec_request) result["ShellExecResult"] = to_class(ShellExecResult, self.shell_exec_result) result["ShellExecuteUserRequestedRequest"] = to_class(ShellExecuteUserRequestedRequest, self.shell_execute_user_requested_request) + result["ShellInitProfile"] = to_enum(ShellInitProfile, self.shell_init_profile) + result["ShellInitScript"] = to_class(ShellInitScript, self.shell_init_script) + result["ShellInitScriptShell"] = to_enum(ShellInitScriptShell, self.shell_init_script_shell) result["ShellKillRequest"] = to_class(ShellKillRequest, self.shell_kill_request) result["ShellKillResult"] = to_class(ShellKillResult, self.shell_kill_result) result["ShellKillSignal"] = to_enum(ShellKillSignal, self.shell_kill_signal) + result["ShellOptions"] = to_class(ShellOptions, self.shell_options) result["ShutdownRequest"] = to_class(ShutdownRequest, self.shutdown_request) result["Skill"] = to_class(Skill, self.skill) result["SkillDiscoveryPath"] = to_class(SkillDiscoveryPath, self.skill_discovery_path) @@ -27561,20 +30133,30 @@ def to_dict(self) -> dict: result["WorkspaceDiffFileChangeType"] = to_enum(WorkspaceDiffFileChangeType, self.workspace_diff_file_change_type) result["WorkspaceDiffMode"] = to_enum(WorkspaceDiffMode, self.workspace_diff_mode) result["WorkspaceDiffResult"] = to_class(WorkspaceDiffResult, self.workspace_diff_result) + result["WorkspacesAddSummaryRequest"] = to_class(WorkspacesAddSummaryRequest, self.workspaces_add_summary_request) + result["WorkspacesAddSummaryResult"] = to_class(WorkspacesAddSummaryResult, self.workspaces_add_summary_result) + result["WorkspacesAutopilotObjectiveExistsResult"] = to_class(WorkspacesAutopilotObjectiveExistsResult, self.workspaces_autopilot_objective_exists_result) result["WorkspacesCheckpoints"] = to_class(WorkspacesCheckpoints, self.workspaces_checkpoints) result["WorkspacesCreateFileRequest"] = to_class(WorkspacesCreateFileRequest, self.workspaces_create_file_request) + result["WorkspacesDeleteAutopilotObjectiveResult"] = to_class(WorkspacesDeleteAutopilotObjectiveResult, self.workspaces_delete_autopilot_objective_result) result["WorkspacesDiffRequest"] = to_class(WorkspacesDiffRequest, self.workspaces_diff_request) + result["WorkspacesEnsureRequest"] = to_class(WorkspacesEnsureRequest, self.workspaces_ensure_request) result["WorkspacesGetWorkspaceResult"] = to_class(WorkspacesGetWorkspaceResult, self.workspaces_get_workspace_result) result["WorkspacesListCheckpointsResult"] = to_class(WorkspacesListCheckpointsResult, self.workspaces_list_checkpoints_result) result["WorkspacesListFilesResult"] = to_class(WorkspacesListFilesResult, self.workspaces_list_files_result) + result["WorkspacesReadAutopilotObjectiveResult"] = to_class(WorkspacesReadAutopilotObjectiveResult, self.workspaces_read_autopilot_objective_result) result["WorkspacesReadCheckpointRequest"] = to_class(WorkspacesReadCheckpointRequest, self.workspaces_read_checkpoint_request) result["WorkspacesReadCheckpointResult"] = to_class(WorkspacesReadCheckpointResult, self.workspaces_read_checkpoint_result) result["WorkspacesReadFileRequest"] = to_class(WorkspacesReadFileRequest, self.workspaces_read_file_request) result["WorkspacesReadFileResult"] = to_class(WorkspacesReadFileResult, self.workspaces_read_file_result) result["WorkspacesSaveLargePasteRequest"] = to_class(WorkspacesSaveLargePasteRequest, self.workspaces_save_large_paste_request) result["WorkspacesSaveLargePasteResult"] = to_class(WorkspacesSaveLargePasteResult, self.workspaces_save_large_paste_result) + result["WorkspacesTruncateSummariesRequest"] = to_class(WorkspacesTruncateSummariesRequest, self.workspaces_truncate_summaries_request) result["WorkspaceSummaryHostType"] = to_enum(HostType, self.workspace_summary_host_type) + result["WorkspacesUpdateMetadataRequest"] = to_class(WorkspacesUpdateMetadataRequest, self.workspaces_update_metadata_request) result["WorkspacesWorkspaceDetailsHostType"] = to_enum(HostType, self.workspaces_workspace_details_host_type) + result["WorkspacesWriteAutopilotObjectiveRequest"] = to_class(WorkspacesWriteAutopilotObjectiveRequest, self.workspaces_write_autopilot_objective_request) + result["WorkspacesWriteAutopilotObjectiveResult"] = to_class(WorkspacesWriteAutopilotObjectiveResult, self.workspaces_write_autopilot_objective_result) result["SessionContextAttribution"] = from_union([lambda x: to_class(SessionContextAttribution, x), from_none], self.session_context_attribution) result["SessionContextInfo"] = from_union([lambda x: to_class(SessionContextInfo, x), from_none], self.session_context_info) result["SubagentSettings"] = from_union([lambda x: to_class(SubagentSettings, x), from_none], self.subagent_settings) @@ -27847,6 +30429,7 @@ def _load_TaskInfo(obj: Any) -> "TaskInfo": ProviderEndpointType = ProviderType ProviderEndpointWireApi = ProviderWireAPI RemoteSessionMetadataTaskType = TaskType +SessionCancelAllBackgroundAgentsResult = int SessionContextHostType = HostType SessionFsReaddirWithTypesEntryType = DebugCollectLogsEntryKind SessionMcpAppsCallToolResult = dict @@ -27898,6 +30481,10 @@ async def list(self, params: ModelsListRequest, *, timeout: float | None = None) params_dict = {k: v for k, v in params.to_dict().items() if v is not None} return ModelList.from_dict(_patch_model_capabilities(await self._client.request("models.list", params_dict, **_timeout_kwargs(timeout)))) + async def get_built_in_catalog(self, *, timeout: float | None = None) -> BuiltInModelCatalog: + "Returns the running runtime's complete catalog of well-known built-in model IDs without authentication or network access.\n\nReturns:\n The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata." + return BuiltInModelCatalog.from_dict(await self._client.request("models.getBuiltInCatalog", {}, **_timeout_kwargs(timeout))) + # Experimental: this API group is experimental and may change or be removed. class ServerToolsApi: @@ -28370,6 +30957,16 @@ class _InternalServerSessionsApi: def __init__(self, client: "JsonRpcClient"): self._client = client + async def _get_metadata(self, params: SessionsGetMetadataRequest, *, timeout: float | None = None) -> SessionsGetMetadataResult: + "Reads lightweight persisted metadata for one local session without opening it.\n\nArgs:\n params: Session ID whose persisted metadata should be read.\n\nReturns:\n Persisted local session metadata when the session exists.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict = {k: v for k, v in params.to_dict().items() if v is not None} + return SessionsGetMetadataResult.from_dict(await self._client.request("sessions.getMetadata", params_dict, **_timeout_kwargs(timeout))) + + async def _list_non_empty_session_ids(self, params: SessionsListNonEmptySessionIDSRequest, *, timeout: float | None = None) -> SessionsListNonEmptySessionIDSResult: + "Lists recent local session IDs that contain user-visible history, omitting housekeeping-only sessions.\n\nArgs:\n params: Limit for non-empty local session IDs.\n\nReturns:\n Recent local session IDs that contain user-visible history.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict = {k: v for k, v in params.to_dict().items() if v is not None} + return SessionsListNonEmptySessionIDSResult.from_dict(await self._client.request("sessions.listNonEmptySessionIds", params_dict, **_timeout_kwargs(timeout))) + async def _get_event_file_path(self, params: SessionsGetEventFilePathRequest, *, timeout: float | None = None) -> SessionsGetEventFilePathResult: "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.\n\nArgs:\n params: Session ID whose event-log file path to compute.\n\nReturns:\n Absolute path to the session's events.jsonl file on disk.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} @@ -28380,6 +30977,11 @@ async def _get_persisted_remote_steerable(self, params: SessionsGetPersistedRemo params_dict = {k: v for k, v in params.to_dict().items() if v is not None} return SessionsGetPersistedRemoteSteerableResult.from_dict(await self._client.request("sessions.getPersistedRemoteSteerable", params_dict, **_timeout_kwargs(timeout))) + async def _delete(self, params: SessionsDeleteRequest, *, timeout: float | None = None) -> None: + "Deletes one local session from disk after running the same lifecycle hooks as the session manager.\n\nArgs:\n params: Session ID to delete from disk.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict = {k: v for k, v in params.to_dict().items() if v is not None} + await self._client.request("sessions.delete", params_dict, **_timeout_kwargs(timeout)) + async def _get_board_entry_count(self, params: SessionsGetBoardEntryCountRequest, *, timeout: float | None = None) -> SessionsGetBoardEntryCountResult: "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.\n\nArgs:\n params: Session ID whose board entry count should be returned.\n\nReturns:\n Dynamic-context board entry count, when available.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} @@ -28511,12 +31113,34 @@ async def run(self, params: FactoryRunRequest, *, timeout: float | None = None) params_dict["sessionId"] = self._session_id return FactoryRunResult.from_dict(await self._client.request("session.factory.run", params_dict, **_timeout_kwargs(timeout))) + async def resume(self, params: FactoryResumeRequest, *, timeout: float | None = None) -> FactoryResumeResult: + "Resumes a factory run using its persisted name, arguments, journal, and accounting.\n\nArgs:\n params: Parameters for resuming a factory run from its persisted identity.\n\nReturns:\n Resolved persisted factory identity and resumed run envelope." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return FactoryResumeResult.from_dict(await self._client.request("session.factory.resume", params_dict, **_timeout_kwargs(timeout))) + async def get_run(self, params: FactoryGetRunRequest, *, timeout: float | None = None) -> FactoryRunResult: "Gets the current or settled envelope for a factory run.\n\nArgs:\n params: Parameters for retrieving a factory run.\n\nReturns:\n Complete current or terminal factory run envelope." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return FactoryRunResult.from_dict(await self._client.request("session.factory.getRun", params_dict, **_timeout_kwargs(timeout))) + async def list_runs(self, *, timeout: float | None = None) -> FactoryListRunsResult: + "Lists durable factory runs for this session in creation order.\n\nReturns:\n Factory runs in durable creation order." + return FactoryListRunsResult.from_dict(await self._client.request("session.factory.listRuns", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def get_run_detail(self, params: FactoryGetRunRequest, *, timeout: float | None = None) -> FactoryRunDetail: + "Gets durable and live observability detail for one factory run.\n\nArgs:\n params: Parameters for retrieving a factory run.\n\nReturns:\n Full factory run observability detail." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return FactoryRunDetail.from_dict(await self._client.request("session.factory.getRunDetail", params_dict, **_timeout_kwargs(timeout))) + + async def get_run_progress(self, params: FactoryGetRunProgressRequest, *, timeout: float | None = None) -> FactoryProgressPage: + "Pages durable progress for one factory run.\n\nArgs:\n params: Parameters for paging factory progress.\n\nReturns:\n A bidirectional page of factory progress." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return FactoryProgressPage.from_dict(await self._client.request("session.factory.getRunProgress", params_dict, **_timeout_kwargs(timeout))) + async def cancel(self, params: FactoryCancelRequest, *, timeout: float | None = None) -> FactoryRunResult: "Requests cancellation of a factory run and returns its run envelope.\n\nArgs:\n params: Parameters for cancelling a factory run.\n\nReturns:\n Complete current or terminal factory run envelope." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} @@ -28644,6 +31268,18 @@ async def get_workspace(self, *, timeout: float | None = None) -> WorkspacesGetW "Gets current workspace metadata for the session.\n\nReturns:\n Current workspace metadata for the session, including its absolute filesystem path when available." return WorkspacesGetWorkspaceResult.from_dict(await self._client.request("session.workspaces.getWorkspace", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + async def update_metadata(self, params: WorkspacesUpdateMetadataRequest, *, timeout: float | None = None) -> WorkspacesGetWorkspaceResult: + "Updates workspace metadata for a local session and returns the refreshed workspace.\n\nArgs:\n params: Workspace metadata fields to update.\n\nReturns:\n Current workspace metadata for the session, including its absolute filesystem path when available." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return WorkspacesGetWorkspaceResult.from_dict(await self._client.request("session.workspaces.updateMetadata", params_dict, **_timeout_kwargs(timeout))) + + async def ensure(self, params: WorkspacesEnsureRequest, *, timeout: float | None = None) -> WorkspacesGetWorkspaceResult: + "Ensures a local session workspace exists and returns it.\n\nArgs:\n params: Optional session context used when creating a local workspace.\n\nReturns:\n Current workspace metadata for the session, including its absolute filesystem path when available." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return WorkspacesGetWorkspaceResult.from_dict(await self._client.request("session.workspaces.ensure", params_dict, **_timeout_kwargs(timeout))) + async def list_files(self, *, timeout: float | None = None) -> WorkspacesListFilesResult: "Lists files stored in the session workspace files directory.\n\nReturns:\n Relative paths of files stored in the session workspace files directory." return WorkspacesListFilesResult.from_dict(await self._client.request("session.workspaces.listFiles", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -28670,6 +31306,36 @@ async def read_checkpoint(self, params: WorkspacesReadCheckpointRequest, *, time params_dict["sessionId"] = self._session_id return WorkspacesReadCheckpointResult.from_dict(await self._client.request("session.workspaces.readCheckpoint", params_dict, **_timeout_kwargs(timeout))) + async def add_summary(self, params: WorkspacesAddSummaryRequest, *, timeout: float | None = None) -> WorkspacesAddSummaryResult: + "Adds a compaction summary checkpoint to the local session workspace.\n\nArgs:\n params: Compaction summary checkpoint to persist.\n\nReturns:\n Persisted summary metadata and refreshed workspace metadata." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return WorkspacesAddSummaryResult.from_dict(await self._client.request("session.workspaces.addSummary", params_dict, **_timeout_kwargs(timeout))) + + async def truncate_summaries(self, params: WorkspacesTruncateSummariesRequest, *, timeout: float | None = None) -> WorkspacesGetWorkspaceResult: + "Truncates local workspace compaction summaries after a rollback.\n\nArgs:\n params: Rollback point for local workspace summaries.\n\nReturns:\n Current workspace metadata for the session, including its absolute filesystem path when available." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return WorkspacesGetWorkspaceResult.from_dict(await self._client.request("session.workspaces.truncateSummaries", params_dict, **_timeout_kwargs(timeout))) + + async def read_autopilot_objective(self, *, timeout: float | None = None) -> WorkspacesReadAutopilotObjectiveResult: + "Reads the autopilot objective state file from the local session workspace.\n\nReturns:\n Autopilot objective file content, or null when missing." + return WorkspacesReadAutopilotObjectiveResult.from_dict(await self._client.request("session.workspaces.readAutopilotObjective", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def write_autopilot_objective(self, params: WorkspacesWriteAutopilotObjectiveRequest, *, timeout: float | None = None) -> WorkspacesWriteAutopilotObjectiveResult: + "Writes the autopilot objective state file in the local session workspace.\n\nArgs:\n params: Autopilot objective file content to persist.\n\nReturns:\n Result of writing the autopilot objective file." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return WorkspacesWriteAutopilotObjectiveResult.from_dict(await self._client.request("session.workspaces.writeAutopilotObjective", params_dict, **_timeout_kwargs(timeout))) + + async def delete_autopilot_objective(self, *, timeout: float | None = None) -> WorkspacesDeleteAutopilotObjectiveResult: + "Deletes the autopilot objective state file from the local session workspace.\n\nReturns:\n Result of deleting the autopilot objective file." + return WorkspacesDeleteAutopilotObjectiveResult.from_dict(await self._client.request("session.workspaces.deleteAutopilotObjective", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def autopilot_objective_exists(self, *, timeout: float | None = None) -> WorkspacesAutopilotObjectiveExistsResult: + "Checks whether the local session workspace has an autopilot objective state file.\n\nReturns:\n Whether the autopilot objective file exists." + return WorkspacesAutopilotObjectiveExistsResult.from_dict(await self._client.request("session.workspaces.autopilotObjectiveExists", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + async def save_large_paste(self, params: WorkspacesSaveLargePasteRequest, *, timeout: float | None = None) -> WorkspacesSaveLargePasteResult: "Saves pasted content as a UTF-8 file in the session workspace.\n\nArgs:\n params: Pasted content to save as a UTF-8 file in the session workspace.\n\nReturns:\n Descriptor for the saved paste file, or null when the workspace is unavailable." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} @@ -28677,7 +31343,7 @@ async def save_large_paste(self, params: WorkspacesSaveLargePasteRequest, *, tim return WorkspacesSaveLargePasteResult.from_dict(await self._client.request("session.workspaces.saveLargePaste", params_dict, **_timeout_kwargs(timeout))) async def diff(self, params: WorkspacesDiffRequest, *, timeout: float | None = None) -> WorkspaceDiffResult: - "Computes a diff for the session workspace.\n\nArgs:\n params: Parameters for computing a workspace diff.\n\nReturns:\n Workspace diff result for the requested mode." + "Computes a diff for the session workspace. Never rejects for a busy session: a `session`-mode diff that cannot read the session's file-change captures falls back to an unstaged git diff with `isFallback: true` and reports why in `unavailableReason`.\n\nArgs:\n params: Parameters for computing a workspace diff.\n\nReturns:\n Workspace diff result for the requested mode." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return WorkspaceDiffResult.from_dict(await self._client.request("session.workspaces.diff", params_dict, **_timeout_kwargs(timeout))) @@ -28869,6 +31535,12 @@ async def login(self, params: MCPOauthLoginRequest, *, timeout: float | None = N params_dict["sessionId"] = self._session_id return MCPOauthLoginResult.from_dict(await self._client.request("session.mcp.oauth.login", params_dict, **_timeout_kwargs(timeout))) + async def respond(self, params: MCPOauthRespondRequest, *, timeout: float | None = None) -> MCPOauthRespondResult: + "Responds to a pending MCP OAuth authorization request by its request id.\n\nArgs:\n params: Pending MCP OAuth request id to respond to.\n\nReturns:\n Indicates whether the pending MCP OAuth response was accepted." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return MCPOauthRespondResult.from_dict(await self._client.request("session.mcp.oauth.respond", params_dict, **_timeout_kwargs(timeout))) + # Experimental: this API group is experimental and may change or be removed. class McpHeadersApi: @@ -29008,7 +31680,7 @@ async def remove_git_hub(self, *, timeout: float | None = None) -> MCPRemoveGitH return MCPRemoveGitHubResult.from_dict(await self._client.request("session.mcp.removeGitHub", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def start_server(self, params: MCPStartServerRequest, *, timeout: float | None = None) -> None: - "Starts an individual MCP server on the live session from a caller-supplied config. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server.\n\nArgs:\n params: Server name and configuration for an individual MCP server start." + "Starts an individual MCP server on the live session. Omit `config` for a config-free start-by-name of an already-configured server (reuses the server's already-registered configuration); supply `config` to start from a caller-supplied configuration. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server.\n\nArgs:\n params: Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.mcp.startServer", params_dict, **_timeout_kwargs(timeout)) @@ -29425,9 +32097,11 @@ async def set_required(self, params: PermissionsSetRequiredRequest, *, timeout: params_dict["sessionId"] = self._session_id return PermissionsSetRequiredResult.from_dict(await self._client.request("session.permissions.setRequired", params_dict, **_timeout_kwargs(timeout))) - async def reset_session_approvals(self, *, timeout: float | None = None) -> PermissionsResetSessionApprovalsResult: - "Clears session-scoped tool permission approvals.\n\nReturns:\n Indicates whether the operation succeeded." - return PermissionsResetSessionApprovalsResult.from_dict(await self._client.request("session.permissions.resetSessionApprovals", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + async def reset_session_approvals(self, params: PermissionsResetSessionApprovalsRequest, *, timeout: float | None = None) -> PermissionsResetSessionApprovalsResult: + "Clears session-scoped tool permission approvals.\n\nArgs:\n params: Clears session-scoped tool permission approvals, and optionally the location-scoped ones.\n\nReturns:\n Indicates whether the operation succeeded." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return PermissionsResetSessionApprovalsResult.from_dict(await self._client.request("session.permissions.resetSessionApprovals", params_dict, **_timeout_kwargs(timeout))) async def notify_prompt_shown(self, params: PermissionPromptShownNotification, *, timeout: float | None = None) -> PermissionsNotifyPromptShownResult: "Notifies the runtime that a permission prompt UI has been shown to the user.\n\nArgs:\n params: Notification payload describing the permission prompt that the client just rendered.\n\nReturns:\n Indicates whether the operation succeeded." @@ -29489,6 +32163,19 @@ async def recompute_context_tokens(self, params: MetadataRecomputeContextTokensR return MetadataRecomputeContextTokensResult.from_dict(await self._client.request("session.metadata.recomputeContextTokens", params_dict, **_timeout_kwargs(timeout))) +# Experimental: this API group is experimental and may change or be removed. +class ContentExclusionApi: + def __init__(self, client: "JsonRpcClient", session_id: str): + self._client = client + self._session_id = session_id + + async def check_paths(self, params: ContentExclusionCheckPathsRequest, *, timeout: float | None = None) -> ContentExclusionCheckPathsResult: + "Checks local file system absolute paths within the session working directory against its content-exclusion policy. Results preserve input order. Unsupported paths/filesystems and unavailable policy evaluation return available false, and callers must treat every requested path as excluded.\n\nArgs:\n params: Local file system absolute paths within the session working directory to check against its content-exclusion policy.\n\nReturns:\n Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return ContentExclusionCheckPathsResult.from_dict(await self._client.request("session.contentExclusion.checkPaths", params_dict, **_timeout_kwargs(timeout))) + + # Experimental: this API group is experimental and may change or be removed. class ShellApi: def __init__(self, client: "JsonRpcClient", session_id: str): @@ -29496,13 +32183,13 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def exec(self, params: ShellExecRequest, *, timeout: float | None = None) -> ShellExecResult: - "Starts a shell command and streams output through session notifications.\n\nArgs:\n params: Shell command to run, with optional working directory and timeout in milliseconds.\n\nReturns:\n Identifier of the spawned process, used to correlate streamed output and exit notifications." + "Starts a shell command and streams output through session notifications. The command runs as the leader of its own process group (POSIX) or in a dedicated job object (Windows), so a forced termination — via \"shell.kill\", the request timeout, or session disposal — signals that whole group/job rather than only the direct child. Two gaps are worth planning for: a command that exits on its own does not trigger that teardown, and on POSIX a descendant that moves itself into a new session or process group (for example via \"setsid\") leaves the signalled group, so either can leave a background process running.\n\nArgs:\n params: Shell command to run, with optional working directory and timeout in milliseconds.\n\nReturns:\n Identifier of the spawned process, used to correlate streamed output and exit notifications." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return ShellExecResult.from_dict(await self._client.request("session.shell.exec", params_dict, **_timeout_kwargs(timeout))) async def kill(self, params: ShellKillRequest, *, timeout: float | None = None) -> ShellKillResult: - "Sends a signal to a shell process previously started via \"shell.exec\".\n\nArgs:\n params: Identifier of a process previously returned by \"shell.exec\" and the signal to send.\n\nReturns:\n Indicates whether the signal was delivered; false if the process was unknown or already exited." + "Sends a signal to a shell process previously started via \"shell.exec\". The signal targets the command's whole process group (POSIX) or job object (Windows), so descendants still in that group are signalled too, not just the direct child. On POSIX a descendant that moved itself into a new session or process group (for example via \"setsid\") is no longer in the signalled group and survives.\n\nArgs:\n params: Identifier of a process previously returned by \"shell.exec\" and the signal to send.\n\nReturns:\n Indicates whether the signal was delivered; false if the process was unknown or already exited." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return ShellKillResult.from_dict(await self._client.request("session.shell.kill", params_dict, **_timeout_kwargs(timeout))) @@ -29538,6 +32225,22 @@ async def truncate(self, params: HistoryTruncateRequest, *, timeout: float | Non params_dict["sessionId"] = self._session_id return HistoryTruncateResult.from_dict(await self._client.request("session.history.truncate", params_dict, **_timeout_kwargs(timeout))) + async def list_rewind_points(self, *, timeout: float | None = None) -> HistoryListRewindPointsResult: + "Lists the user turns that the session can rewind to. Never rejects for a busy session: rewind reads need the session's file-change captures to be settled, so a session that still holds active work answers with `unavailableReason: \"session-busy\"` and no points, which the caller can retry.\n\nReturns:\n Rewind points and file-change-tracking availability for the session." + return HistoryListRewindPointsResult.from_dict(await self._client.request("session.history.listRewindPoints", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def preview_rewind(self, params: HistoryPreviewRewindRequest, *, timeout: float | None = None) -> HistoryPreviewRewindResult: + "Previews the files that a conversation-and-files rewind would restore.\n\nArgs:\n params: Event boundary to preview for conversation-and-files rewind.\n\nReturns:\n Files and aggregate changes for a prospective rewind." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return HistoryPreviewRewindResult.from_dict(await self._client.request("session.history.previewRewind", params_dict, **_timeout_kwargs(timeout))) + + async def rewind(self, params: HistoryRewindRequest, *, timeout: float | None = None) -> HistoryRewindResult: + "Rewinds the session conversation, optionally restoring files changed by the discarded turns. Not crash-atomic: file restore and conversation truncation are separate stores, applied in that order, so a process crash between them can leave the workspace rewound while the conversation still contains the discarded turns. There is no recovery journal; re-running the same rewind is the recovery path for a crash before truncation lands, since file restore is idempotent (already-restored files are reported as skipped) and truncation is re-derived from the still-retained boundary event. After truncation lands that boundary no longer exists, so the same request is rejected; the only stage that can still be outstanding is snapshot pruning, whose failure leaves orphan snapshots the capture store tolerates. The reverse inconsistency cannot occur, because truncation is never applied before file restore succeeds.\n\nArgs:\n params: Boundary and mode for rewinding session history.\n\nReturns:\n Structured outcome of a rewind request." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return HistoryRewindResult.from_dict(await self._client.request("session.history.rewind", params_dict, **_timeout_kwargs(timeout))) + async def cancel_background_compaction(self, *, timeout: float | None = None) -> HistoryCancelBackgroundCompactionResult: "Cancels any in-progress background compaction on a local session.\n\nReturns:\n Indicates whether an in-progress background compaction was cancelled." return HistoryCancelBackgroundCompactionResult.from_dict(await self._client.request("session.history.cancelBackgroundCompaction", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -29699,6 +32402,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self.ui = UiApi(client, session_id) self.permissions = PermissionsApi(client, session_id) self.metadata = MetadataApi(client, session_id) + self.content_exclusion = ContentExclusionApi(client, session_id) self.shell = ShellApi(client, session_id) self.history = HistoryApi(client, session_id) self.queue = QueueApi(client, session_id) @@ -29730,6 +32434,16 @@ async def abort(self, params: AbortRequest, *, timeout: float | None = None) -> params_dict["sessionId"] = self._session_id return AbortResult.from_dict(await self._client.request("session.abort", params_dict, **_timeout_kwargs(timeout))) + async def interrupt_main_turn(self, params: InterruptMainTurnRequest, *, timeout: float | None = None) -> InterruptMainTurnResult: + "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.\n\nArgs:\n params: Parameters for interrupting the main agent turn.\n\nReturns:\n Result of interrupting the main agent turn.\n\n.. warning:: This API is experimental and may change or be removed in future versions." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return InterruptMainTurnResult.from_dict(await self._client.request("session.interruptMainTurn", params_dict, **_timeout_kwargs(timeout))) + + async def cancel_all_background_agents(self, *, timeout: float | None = None) -> int: + "Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running.\n\nReturns:\n The number of running background agents (task-registry agents) that were cancelled.\n\n.. warning:: This API is experimental and may change or be removed in future versions." + return int(await self._client.request("session.cancelAllBackgroundAgents", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + async def shutdown(self, params: ShutdownRequest, *, timeout: float | None = None) -> None: "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.\n\nArgs:\n params: Parameters for shutting down the session\n\n.. warning:: This API is experimental and may change or be removed in future versions." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} @@ -29791,6 +32505,98 @@ async def _evaluate_predicate(self, params: SessionSettingsEvaluatePredicateRequ return SessionSettingsEvaluatePredicateResult.from_dict(await self._client.request("session.settings.evaluatePredicate", params_dict, **_timeout_kwargs(timeout))) +# Experimental: this API group is experimental and may change or be removed. +class _InternalQueueApi: + def __init__(self, client: "JsonRpcClient", session_id: str): + self._client = client + self._session_id = session_id + + async def _snapshot(self, *, timeout: float | None = None) -> QueueSnapshotResult: + "Returns the internal native queue snapshot for in-process session orchestration.\n\nReturns:\n Internal snapshot of native queue state for local session orchestration.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + return QueueSnapshotResult.from_dict(await self._client.request("session.queue.snapshot", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def _has_pending(self, *, timeout: float | None = None) -> QueueHasPendingResult: + "Reports whether the local session has native queued work pending.\n\nReturns:\n Whether the native queue has pending work.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + return QueueHasPendingResult.from_dict(await self._client.request("session.queue.hasPending", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def _begin_deferred_idle_drain(self, params: QueueBeginDeferredIdleDrainRequest, *, timeout: float | None = None) -> QueueBeginDeferredIdleDrainResult: + "Begins a native deferred-idle drain when background work has quiesced.\n\nArgs:\n params: Inputs for starting a deferred-idle drain.\n\nReturns:\n Whether a deferred-idle drain should run.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return QueueBeginDeferredIdleDrainResult.from_dict(await self._client.request("session.queue.beginDeferredIdleDrain", params_dict, **_timeout_kwargs(timeout))) + + async def _finish_deferred_idle_drain(self, params: QueueFinishDeferredIdleDrainRequest, *, timeout: float | None = None) -> QueueFinishDeferredIdleDrainResult: + "Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle.\n\nArgs:\n params: Inputs for completing a deferred-idle drain.\n\nReturns:\n Action selected by the native deferred-idle drain.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return QueueFinishDeferredIdleDrainResult.from_dict(await self._client.request("session.queue.finishDeferredIdleDrain", params_dict, **_timeout_kwargs(timeout))) + + async def _defer_session_idle(self, params: QueueDeferSessionIdleRequest, *, timeout: float | None = None) -> None: + "Marks session.idle as deferred by native background work state.\n\nArgs:\n params: Inputs for marking session.idle deferred in native state.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + await self._client.request("session.queue.deferSessionIdle", params_dict, **_timeout_kwargs(timeout)) + + async def _consume_system_notifications(self, params: QueueConsumeSystemNotificationsRequest, *, timeout: float | None = None) -> QueueRemoveMostRecentResult: + "Consumes queued native system notifications matching an internal filter.\n\nArgs:\n params: Internal filter for consuming queued system notifications.\n\nReturns:\n Indicates whether a user-facing pending item was removed.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return QueueRemoveMostRecentResult.from_dict(await self._client.request("session.queue.consumeSystemNotifications", params_dict, **_timeout_kwargs(timeout))) + + async def _enqueue_resume_pending(self, *, timeout: float | None = None) -> QueueEnqueueResumePendingResult: + "Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn.\n\nReturns:\n Result of enqueueing the resume-pending wake item.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + return QueueEnqueueResumePendingResult.from_dict(await self._client.request("session.queue.enqueueResumePending", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def _process(self, *, timeout: float | None = None) -> None: + "Drains the native local-session work queue for in-process session orchestration.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + await self._client.request("session.queue.process", {"sessionId": self._session_id}, **_timeout_kwargs(timeout)) + + +# Experimental: this API group is experimental and may change or be removed. +class _InternalScheduleApi: + def __init__(self, client: "JsonRpcClient", session_id: str): + self._client = client + self._session_id = session_id + + async def _hydrate(self, *, timeout: float | None = None) -> None: + "Hydrates the native schedule registry from persisted session events.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + await self._client.request("session.schedule.hydrate", {"sessionId": self._session_id}, **_timeout_kwargs(timeout)) + + async def _has_self_paced(self, *, timeout: float | None = None) -> ScheduleHasSelfPacedResult: + "Reports whether the session has an active self-paced scheduled prompt.\n\nReturns:\n Whether the session currently has an active self-paced schedule.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + return ScheduleHasSelfPacedResult.from_dict(await self._client.request("session.schedule.hasSelfPaced", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def _add(self, params: ScheduleAddRequest, *, timeout: float | None = None) -> ScheduleAddResult: + "Registers a relative-interval scheduled prompt.\n\nArgs:\n params: Register a relative-interval scheduled prompt.\n\nReturns:\n Result of registering or re-arming a scheduled prompt.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return ScheduleAddResult.from_dict(await self._client.request("session.schedule.add", params_dict, **_timeout_kwargs(timeout))) + + async def _add_cron(self, params: ScheduleAddCronRequest, *, timeout: float | None = None) -> ScheduleAddResult: + "Registers a recurring cron scheduled prompt.\n\nArgs:\n params: Register a cron scheduled prompt.\n\nReturns:\n Result of registering or re-arming a scheduled prompt.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return ScheduleAddResult.from_dict(await self._client.request("session.schedule.addCron", params_dict, **_timeout_kwargs(timeout))) + + async def _add_at(self, params: ScheduleAddAtRequest, *, timeout: float | None = None) -> ScheduleAddResult: + "Registers an absolute-time scheduled prompt.\n\nArgs:\n params: Register an absolute-time scheduled prompt.\n\nReturns:\n Result of registering or re-arming a scheduled prompt.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return ScheduleAddResult.from_dict(await self._client.request("session.schedule.addAt", params_dict, **_timeout_kwargs(timeout))) + + async def _add_self_paced(self, params: ScheduleAddSelfPacedRequest, *, timeout: float | None = None) -> ScheduleAddResult: + "Registers a self-paced scheduled prompt.\n\nArgs:\n params: Register a self-paced scheduled prompt.\n\nReturns:\n Result of registering or re-arming a scheduled prompt.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return ScheduleAddResult.from_dict(await self._client.request("session.schedule.addSelfPaced", params_dict, **_timeout_kwargs(timeout))) + + async def _rearm_self_paced(self, params: ScheduleRearmSelfPacedRequest, *, timeout: float | None = None) -> ScheduleAddResult: + "Re-arms an active self-paced scheduled prompt.\n\nArgs:\n params: Re-arm a self-paced scheduled prompt.\n\nReturns:\n Result of registering or re-arming a scheduled prompt.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return ScheduleAddResult.from_dict(await self._client.request("session.schedule.rearmSelfPaced", params_dict, **_timeout_kwargs(timeout))) + + class _InternalSessionRpc: """Internal SDK session-scoped RPC methods. Not part of the public API.""" def __init__(self, client: "JsonRpcClient", session_id: str): @@ -29798,6 +32604,14 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id self.mcp = _InternalMcpApi(client, session_id) self.settings = _InternalSettingsApi(client, session_id) + self.queue = _InternalQueueApi(client, session_id) + self.schedule = _InternalScheduleApi(client, session_id) + + async def _send_system_notification(self, params: SendSystemNotificationRequest, *, timeout: float | None = None) -> None: + "Queues or sends an internal system notification to the session according to its passive policy.\n\nArgs:\n params: Internal request for sending a system notification.\n\n.. warning:: This API is experimental and may change or be removed in future versions.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + await self._client.request("session.sendSystemNotification", params_dict, **_timeout_kwargs(timeout)) # Experimental: this API group is experimental and may change or be removed. @@ -29848,7 +32662,10 @@ async def rename(self, params: SessionFSRenameRequest) -> SessionFSError | None: "Renames or moves a path in the client-provided session filesystem.\n\nArgs:\n params: Source and destination paths for renaming or moving an entry in the client-provided session filesystem.\n\nReturns:\n Describes a filesystem error." pass async def sqlite_query(self, params: SessionFSSqliteQueryRequest) -> SessionFSSqliteQueryResult: - "Executes a SQLite query against the per-session database.\n\nArgs:\n params: SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database.\n\nReturns:\n Query results including rows, columns, and rows affected, or a filesystem error if execution failed." + "Executes a SQLite query against the per-session database. Providers apply busy handling for every call.\n\nArgs:\n 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.\n\nReturns:\n Query results including rows, columns, and rows affected, or a filesystem error if execution failed." + pass + async def sqlite_transaction(self, params: SessionFSSqliteTransactionRequest) -> SessionFSSqliteTransactionResult: + "Executes SQLite statements atomically on the provider-owned connection.\n\nArgs:\n params: Statements to execute atomically. Providers apply busy handling for every call.\n\nReturns:\n Per-statement results, or a classified transaction error." pass async def sqlite_exists(self, params: SessionFSSqliteExistsRequest) -> SessionFSSqliteExistsResult: "Checks whether the per-session SQLite database already exists, without creating it.\n\nArgs:\n params: Identifies the target session.\n\nReturns:\n Indicates whether the per-session SQLite database already exists." @@ -29976,6 +32793,13 @@ async def handle_session_fs_sqlite_query(params: dict) -> dict | None: result = await handler.sqlite_query(request) return result.to_dict() client.set_request_handler("sessionFs.sqliteQuery", handle_session_fs_sqlite_query) + async def handle_session_fs_sqlite_transaction(params: dict) -> dict | None: + request = SessionFSSqliteTransactionRequest.from_dict(params) + handler = get_handlers(request.session_id).session_fs + if handler is None: raise RuntimeError(f"No session_fs handler registered for session: {request.session_id}") + result = await handler.sqlite_transaction(request) + return result.to_dict() + client.set_request_handler("sessionFs.sqliteTransaction", handle_session_fs_sqlite_transaction) async def handle_session_fs_sqlite_exists(params: dict) -> dict | None: request = SessionFSSqliteExistsRequest.from_dict(params) handler = get_handlers(request.session_id).session_fs @@ -30127,6 +32951,8 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "ApprovalKind", "AuthInfo", "AuthInfoType", + "BuiltInModelCatalog", + "BuiltInModelCatalogEntry", "CancelUserRequestedShellCommandResult", "CanvasAction", "CanvasActionApi", @@ -30166,6 +32992,10 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "ConnectedRemoteSessionMetadata", "ConnectedRemoteSessionMetadataKind", "ConnectedRemoteSessionMetadataRepository", + "ContentExclusionApi", + "ContentExclusionCheckPathsRequest", + "ContentExclusionCheckPathsResult", + "ContentExclusionPathCheck", "ContentFilterMode", "ContextHeaviestMessage", "CopilotAPITokenAuthInfo", @@ -30244,19 +33074,34 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "FactoryAgentOptions", "FactoryAgentRequest", "FactoryAgentResult", + "FactoryAgentSummary", "FactoryApi", "FactoryCancelRequest", + "FactoryCurrentPhase", + "FactoryDeclaredLimits", + "FactoryDurableOperation", "FactoryExecuteRequest", "FactoryExecuteResult", + "FactoryGetRunProgressRequest", "FactoryGetRunRequest", "FactoryHandler", "FactoryJournalApi", "FactoryJournalGetRequest", "FactoryJournalGetResult", "FactoryJournalPutRequest", + "FactoryListRunsRequest", + "FactoryListRunsResult", "FactoryLogLine", "FactoryLogLineKind", "FactoryLogRequest", + "FactoryPhaseObservation", + "FactoryPhaseStatus", + "FactoryProgressLine", + "FactoryProgressPage", + "FactoryResumeRequest", + "FactoryResumeResult", + "FactoryRunConsumed", + "FactoryRunDetail", "FactoryRunFailure", "FactoryRunFailureKind", "FactoryRunFailureType", @@ -30264,6 +33109,8 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "FactoryRunRequest", "FactoryRunResult", "FactoryRunStatus", + "FactoryRunSummary", + "FactoryRunTerminal", "FilterMapping", "FleetApi", "FleetStartRequest", @@ -30289,6 +33136,19 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "HistoryCompactContextWindow", "HistoryCompactRequest", "HistoryCompactResult", + "HistoryFileRestoreSkipReason", + "HistoryListRewindPointsResult", + "HistoryPreviewRewindRequest", + "HistoryPreviewRewindResult", + "HistoryRewindChangeType", + "HistoryRewindFilePreview", + "HistoryRewindMode", + "HistoryRewindOutcome", + "HistoryRewindPoint", + "HistoryRewindRequest", + "HistoryRewindResult", + "HistoryRewindUnavailableReason", + "HistorySkippedFileRestore", "HistorySummarizeForHandoffResult", "HistoryTruncateRequest", "HistoryTruncateResult", @@ -30313,6 +33173,8 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "InstructionsDiscoverRequest", "InstructionsGetDiscoveryPathsRequest", "InstructionsGetSourcesResult", + "InterruptMainTurnRequest", + "InterruptMainTurnResult", "KindEnum", "LlmInferenceHTTPRequestChunkRequest", "LlmInferenceHTTPRequestChunkResult", @@ -30381,6 +33243,8 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "MCPOauthLoginResult", "MCPOauthPendingRequestResponse", "MCPOauthPendingRequestResponseKind", + "MCPOauthRespondRequest", + "MCPOauthRespondResult", "MCPRegisterExternalClientRequest", "MCPReloadWithConfigRequest", "MCPRemoveGitHubResult", @@ -30720,10 +33584,19 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "PushAttachmentType", "PushGitHubRepoRef", "QueueApi", + "QueueBeginDeferredIdleDrainRequest", + "QueueBeginDeferredIdleDrainResult", + "QueueConsumeSystemNotificationsRequest", + "QueueDeferSessionIdleRequest", + "QueueEnqueueResumePendingResult", + "QueueFinishDeferredIdleDrainRequest", + "QueueFinishDeferredIdleDrainResult", + "QueueHasPendingResult", "QueuePendingItems", "QueuePendingItemsKind", "QueuePendingItemsResult", "QueueRemoveMostRecentResult", + "QueueSnapshotResult", "QueuedCommandHandled", "QueuedCommandNotHandled", "QueuedCommandResult", @@ -30766,9 +33639,16 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "SandboxConfigUserPolicyNetwork", "SandboxConfigUserPolicySeatbelt", "Saved", + "ScheduleAddAtRequest", + "ScheduleAddCronRequest", + "ScheduleAddRequest", + "ScheduleAddResult", + "ScheduleAddSelfPacedRequest", "ScheduleApi", "ScheduleEntry", + "ScheduleHasSelfPacedResult", "ScheduleList", + "ScheduleRearmSelfPacedRequest", "ScheduleStopRequest", "ScheduleStopResult", "SecretsAddFilterValuesRequest", @@ -30781,6 +33661,7 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "SendMode", "SendRequest", "SendResult", + "SendSystemNotificationRequest", "ServerAccountApi", "ServerAgentList", "ServerAgentRegistryApi", @@ -30809,6 +33690,7 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "SessionActivity", "SessionAuthStatus", "SessionBulkDeleteResult", + "SessionCancelAllBackgroundAgentsResult", "SessionCapability", "SessionCompletionItem", "SessionContext", @@ -30840,6 +33722,11 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "SessionFSSqliteQueryRequest", "SessionFSSqliteQueryResult", "SessionFSSqliteQueryType", + "SessionFSSqliteTransactionError", + "SessionFSSqliteTransactionErrorClass", + "SessionFSSqliteTransactionRequest", + "SessionFSSqliteTransactionResult", + "SessionFSSqliteTransactionStatement", "SessionFSStatRequest", "SessionFSStatResult", "SessionFSWriteFileRequest", @@ -30896,6 +33783,7 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "SessionsCheckInUseResult", "SessionsCloseRequest", "SessionsCloseResult", + "SessionsDeleteRequest", "SessionsEnrichMetadataRequest", "SessionsFindByPrefixRequest", "SessionsFindByPrefixResult", @@ -30909,8 +33797,12 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "SessionsGetEventFilePathResult", "SessionsGetLastForContextRequest", "SessionsGetLastForContextResult", + "SessionsGetMetadataRequest", + "SessionsGetMetadataResult", "SessionsGetPersistedRemoteSteerableRequest", "SessionsGetPersistedRemoteSteerableResult", + "SessionsListNonEmptySessionIDSRequest", + "SessionsListNonEmptySessionIDSResult", "SessionsListRequest", "SessionsLoadDeferredRepoHooksRequest", "SessionsOpenAttach", @@ -30951,9 +33843,13 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "ShellExecRequest", "ShellExecResult", "ShellExecuteUserRequestedRequest", + "ShellInitProfile", + "ShellInitScript", + "ShellInitScriptShell", "ShellKillRequest", "ShellKillResult", "ShellKillSignal", + "ShellOptions", "ShutdownRequest", "Skill", "SkillDiscoveryPath", @@ -31106,20 +34002,30 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "WorkspaceDiffResult", "WorkspaceSummary", "WorkspaceSummaryHostType", + "WorkspacesAddSummaryRequest", + "WorkspacesAddSummaryResult", "WorkspacesApi", + "WorkspacesAutopilotObjectiveExistsResult", "WorkspacesCheckpoints", "WorkspacesCreateFileRequest", + "WorkspacesDeleteAutopilotObjectiveResult", "WorkspacesDiffRequest", + "WorkspacesEnsureRequest", "WorkspacesGetWorkspaceResult", "WorkspacesListCheckpointsResult", "WorkspacesListFilesResult", + "WorkspacesReadAutopilotObjectiveResult", "WorkspacesReadCheckpointRequest", "WorkspacesReadCheckpointResult", "WorkspacesReadFileRequest", "WorkspacesReadFileResult", "WorkspacesSaveLargePasteRequest", "WorkspacesSaveLargePasteResult", + "WorkspacesTruncateSummariesRequest", + "WorkspacesUpdateMetadataRequest", "WorkspacesWorkspaceDetailsHostType", + "WorkspacesWriteAutopilotObjectiveRequest", + "WorkspacesWriteAutopilotObjectiveResult", "rpc_from_dict", "rpc_to_dict", ] diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index fecd5839ed..a5c65f0eae 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -223,6 +223,8 @@ class SessionEventType(Enum): EXIT_PLAN_MODE_COMPLETED = "exit_plan_mode.completed" SESSION_TOOLS_UPDATED = "session.tools_updated" SESSION_BACKGROUND_TASKS_CHANGED = "session.background_tasks_changed" + # Experimental: this event is part of an experimental API and may change or be removed. + FACTORY_RUN_UPDATED = "factory.run_updated" SESSION_SKILLS_LOADED = "session.skills_loaded" SESSION_CUSTOM_AGENTS_UPDATED = "session.custom_agents_updated" SESSION_MCP_SERVERS_LOADED = "session.mcp_servers_loaded" @@ -774,6 +776,30 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FactoryRunUpdatedData: + "Ephemeral invalidation signal for a changed factory run." + revision: int + run_id: str + + @staticmethod + def from_dict(obj: Any) -> "FactoryRunUpdatedData": + assert isinstance(obj, dict) + revision = from_int(obj.get("revision")) + run_id = from_str(obj.get("runId")) + return FactoryRunUpdatedData( + revision=revision, + run_id=run_id, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["revision"] = to_int(self.revision) + 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 OmittedBinaryResult: @@ -821,21 +847,31 @@ def to_dict(self) -> dict: class PermissionAutoApproval: "Auto-approval judge information attached to a permission request. Present (non-null) only when the session's allow-all mode is \"auto\"; its absence means auto mode was off and the judge did not evaluate the request. The `recommendation` conveys the judge's disposition for this request." recommendation: AutoApprovalRecommendation + failure_reason: AutoApprovalJudgeFailureReason | None = None + model: str | None = None reason: str | None = None @staticmethod def from_dict(obj: Any) -> "PermissionAutoApproval": assert isinstance(obj, dict) recommendation = parse_enum(AutoApprovalRecommendation, obj.get("recommendation")) + failure_reason = from_union([from_none, lambda x: parse_enum(AutoApprovalJudgeFailureReason, x)], obj.get("failureReason")) + model = from_union([from_none, from_str], obj.get("model")) reason = from_union([from_none, from_str], obj.get("reason")) return PermissionAutoApproval( recommendation=recommendation, + failure_reason=failure_reason, + model=model, reason=reason, ) def to_dict(self) -> dict: result: dict = {} result["recommendation"] = to_enum(AutoApprovalRecommendation, self.recommendation) + if self.failure_reason is not None: + result["failureReason"] = from_union([from_none, lambda x: to_enum(AutoApprovalJudgeFailureReason, x)], self.failure_reason) + if self.model is not None: + result["model"] = from_union([from_none, from_str], self.model) if self.reason is not None: result["reason"] = from_union([from_none, from_str], self.reason) return result @@ -1246,6 +1282,7 @@ class AssistantMessageData: reasoning_text: str | None = None reasoning_wire_field: str | None = None request_id: str | None = None + rte: bool | None = None server_tools: AssistantMessageServerTools | None = None service_request_id: str | None = None tool_requests: list[AssistantMessageToolRequest] | None = None @@ -1269,6 +1306,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": reasoning_text = from_union([from_none, from_str], obj.get("reasoningText")) reasoning_wire_field = from_union([from_none, from_str], obj.get("reasoningWireField")) request_id = from_union([from_none, from_str], obj.get("requestId")) + rte = from_union([from_none, from_bool], obj.get("rte")) server_tools = from_union([from_none, AssistantMessageServerTools.from_dict], obj.get("serverTools")) service_request_id = from_union([from_none, from_str], obj.get("serviceRequestId")) tool_requests = from_union([from_none, lambda x: from_list(AssistantMessageToolRequest.from_dict, x)], obj.get("toolRequests")) @@ -1289,6 +1327,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": reasoning_text=reasoning_text, reasoning_wire_field=reasoning_wire_field, request_id=request_id, + rte=rte, server_tools=server_tools, service_request_id=service_request_id, tool_requests=tool_requests, @@ -1325,6 +1364,8 @@ def to_dict(self) -> dict: result["reasoningWireField"] = from_union([from_none, from_str], self.reasoning_wire_field) if self.request_id is not None: result["requestId"] = from_union([from_none, from_str], self.request_id) + if self.rte is not None: + result["rte"] = from_union([from_none, from_bool], self.rte) if self.server_tools is not None: result["serverTools"] = from_union([from_none, lambda x: to_class(AssistantMessageServerTools, x)], self.server_tools) if self.service_request_id is not None: @@ -1447,21 +1488,26 @@ class AssistantReasoningData: "Assistant reasoning content for timeline display with complete thinking text" content: str reasoning_id: str + rte: bool | None = None @staticmethod def from_dict(obj: Any) -> "AssistantReasoningData": assert isinstance(obj, dict) content = from_str(obj.get("content")) reasoning_id = from_str(obj.get("reasoningId")) + rte = from_union([from_none, from_bool], obj.get("rte")) return AssistantReasoningData( content=content, reasoning_id=reasoning_id, + rte=rte, ) def to_dict(self) -> dict: result: dict = {} result["content"] = from_str(self.content) result["reasoningId"] = from_str(self.reasoning_id) + if self.rte is not None: + result["rte"] = from_union([from_none, from_bool], self.rte) return result @@ -1722,6 +1768,7 @@ class AssistantUsageData: finish_reason: str | None = None initiator: str | None = None input_tokens: int | None = None + interaction_type: str | None = None inter_token_latency: timedelta | None = None output_tokens: int | None = None # Deprecated: this field is deprecated. @@ -1731,6 +1778,7 @@ class AssistantUsageData: _quota_snapshots: dict[str, _AssistantUsageQuotaSnapshot] | None = None reasoning_effort: str | None = None reasoning_tokens: int | None = None + rte: bool | None = None service_request_id: str | None = None time_to_first_token: timedelta | None = None @@ -1750,6 +1798,7 @@ def from_dict(obj: Any) -> "AssistantUsageData": finish_reason = from_union([from_none, from_str], obj.get("finishReason")) initiator = from_union([from_none, from_str], obj.get("initiator")) input_tokens = from_union([from_none, from_int], obj.get("inputTokens")) + interaction_type = from_union([from_none, from_str], obj.get("interactionType")) inter_token_latency = from_union([from_none, from_timedelta], obj.get("interTokenLatencyMs")) output_tokens = from_union([from_none, from_int], obj.get("outputTokens")) parent_tool_call_id = from_union([from_none, from_str], obj.get("parentToolCallId")) @@ -1757,6 +1806,7 @@ def from_dict(obj: Any) -> "AssistantUsageData": _quota_snapshots = from_union([from_none, lambda x: from_dict(_AssistantUsageQuotaSnapshot.from_dict, x)], obj.get("quotaSnapshots")) reasoning_effort = from_union([from_none, from_str], obj.get("reasoningEffort")) reasoning_tokens = from_union([from_none, from_int], obj.get("reasoningTokens")) + rte = from_union([from_none, from_bool], obj.get("rte")) service_request_id = from_union([from_none, from_str], obj.get("serviceRequestId")) time_to_first_token = from_union([from_none, from_timedelta], obj.get("timeToFirstTokenMs")) return AssistantUsageData( @@ -1773,6 +1823,7 @@ def from_dict(obj: Any) -> "AssistantUsageData": finish_reason=finish_reason, initiator=initiator, input_tokens=input_tokens, + interaction_type=interaction_type, inter_token_latency=inter_token_latency, output_tokens=output_tokens, parent_tool_call_id=parent_tool_call_id, @@ -1780,6 +1831,7 @@ def from_dict(obj: Any) -> "AssistantUsageData": _quota_snapshots=_quota_snapshots, reasoning_effort=reasoning_effort, reasoning_tokens=reasoning_tokens, + rte=rte, service_request_id=service_request_id, time_to_first_token=time_to_first_token, ) @@ -1811,6 +1863,8 @@ def to_dict(self) -> dict: result["initiator"] = from_union([from_none, from_str], self.initiator) if self.input_tokens is not None: result["inputTokens"] = from_union([from_none, to_int], self.input_tokens) + if self.interaction_type is not None: + result["interactionType"] = from_union([from_none, from_str], self.interaction_type) if self.inter_token_latency is not None: result["interTokenLatencyMs"] = from_union([from_none, to_timedelta], self.inter_token_latency) if self.output_tokens is not None: @@ -1825,6 +1879,8 @@ def to_dict(self) -> dict: result["reasoningEffort"] = from_union([from_none, from_str], self.reasoning_effort) if self.reasoning_tokens is not None: result["reasoningTokens"] = from_union([from_none, to_int], self.reasoning_tokens) + if self.rte is not None: + result["rte"] = from_union([from_none, from_bool], self.rte) if self.service_request_id is not None: result["serviceRequestId"] = from_union([from_none, from_str], self.service_request_id) if self.time_to_first_token is not None: @@ -3956,6 +4012,7 @@ class ModelCallFailureData: _quota_snapshots: dict[str, _AssistantUsageQuotaSnapshot] | None = None reasoning_effort: str | None = None request_fingerprint: ModelCallFailureRequestFingerprint | None = None + rte: bool | None = None service_request_id: str | None = None status_code: int | None = None transport: ModelCallFailureTransport | None = None @@ -3982,6 +4039,7 @@ def from_dict(obj: Any) -> "ModelCallFailureData": _quota_snapshots = from_union([from_none, lambda x: from_dict(_AssistantUsageQuotaSnapshot.from_dict, x)], obj.get("quotaSnapshots")) reasoning_effort = from_union([from_none, from_str], obj.get("reasoningEffort")) request_fingerprint = from_union([from_none, ModelCallFailureRequestFingerprint.from_dict], obj.get("requestFingerprint")) + rte = from_union([from_none, from_bool], obj.get("rte")) service_request_id = from_union([from_none, from_str], obj.get("serviceRequestId")) status_code = from_union([from_none, from_int], obj.get("statusCode")) transport = from_union([from_none, lambda x: parse_enum(ModelCallFailureTransport, x)], obj.get("transport")) @@ -4005,6 +4063,7 @@ def from_dict(obj: Any) -> "ModelCallFailureData": _quota_snapshots=_quota_snapshots, reasoning_effort=reasoning_effort, request_fingerprint=request_fingerprint, + rte=rte, service_request_id=service_request_id, status_code=status_code, transport=transport, @@ -4049,6 +4108,8 @@ def to_dict(self) -> dict: result["reasoningEffort"] = from_union([from_none, from_str], self.reasoning_effort) if self.request_fingerprint is not None: result["requestFingerprint"] = from_union([from_none, lambda x: to_class(ModelCallFailureRequestFingerprint, x)], self.request_fingerprint) + if self.rte is not None: + result["rte"] = from_union([from_none, from_bool], self.rte) if self.service_request_id is not None: result["serviceRequestId"] = from_union([from_none, from_str], self.service_request_id) if self.status_code is not None: @@ -4107,15 +4168,19 @@ class ModelCallStartData: "Model API dispatch metadata for internal telemetry" turn_id: str model: str | None = None + # Internal: this field is an internal SDK API and is not part of the public surface. + _previous_response_id: str | None = None @staticmethod def from_dict(obj: Any) -> "ModelCallStartData": assert isinstance(obj, dict) turn_id = from_str(obj.get("turnId")) model = from_union([from_none, from_str], obj.get("model")) + _previous_response_id = from_union([from_none, from_str], obj.get("previousResponseId")) return ModelCallStartData( turn_id=turn_id, model=model, + _previous_response_id=_previous_response_id, ) def to_dict(self) -> dict: @@ -4123,6 +4188,8 @@ def to_dict(self) -> dict: result["turnId"] = from_str(self.turn_id) if self.model is not None: result["model"] = from_union([from_none, from_str], self.model) + if self._previous_response_id is not None: + result["previousResponseId"] = from_union([from_none, from_str], self._previous_response_id) return result @@ -6404,6 +6471,7 @@ class SessionScheduleCreatedData: cron: str | None = None display_prompt: str | None = None interval: timedelta | None = None + origin: ScheduleOrigin | None = None recurring: bool | None = None self_paced: bool | None = None tz: str | None = None @@ -6417,6 +6485,7 @@ def from_dict(obj: Any) -> "SessionScheduleCreatedData": cron = from_union([from_none, from_str], obj.get("cron")) display_prompt = from_union([from_none, from_str], obj.get("displayPrompt")) interval = from_union([from_none, from_timedelta], obj.get("intervalMs")) + origin = from_union([from_none, lambda x: parse_enum(ScheduleOrigin, x)], obj.get("origin")) recurring = from_union([from_none, from_bool], obj.get("recurring")) self_paced = from_union([from_none, from_bool], obj.get("selfPaced")) tz = from_union([from_none, from_str], obj.get("tz")) @@ -6427,6 +6496,7 @@ def from_dict(obj: Any) -> "SessionScheduleCreatedData": cron=cron, display_prompt=display_prompt, interval=interval, + origin=origin, recurring=recurring, self_paced=self_paced, tz=tz, @@ -6444,6 +6514,8 @@ def to_dict(self) -> dict: result["displayPrompt"] = from_union([from_none, from_str], self.display_prompt) if self.interval is not None: result["intervalMs"] = from_union([from_none, to_timedelta_int], self.interval) + if self.origin is not None: + result["origin"] = from_union([from_none, lambda x: to_enum(ScheduleOrigin, x)], self.origin) if self.recurring is not None: result["recurring"] = from_union([from_none, from_bool], self.recurring) if self.self_paced is not None: @@ -7407,6 +7479,7 @@ class SystemMessageData: "System/developer instruction content with role and optional template metadata" content: str role: SystemMessageRole + interaction_id: str | None = None metadata: SystemMessageMetadata | None = None name: str | None = None @@ -7415,11 +7488,13 @@ def from_dict(obj: Any) -> "SystemMessageData": assert isinstance(obj, dict) content = from_str(obj.get("content")) role = parse_enum(SystemMessageRole, obj.get("role")) + interaction_id = from_union([from_none, from_str], obj.get("interactionId")) metadata = from_union([from_none, SystemMessageMetadata.from_dict], obj.get("metadata")) name = from_union([from_none, from_str], obj.get("name")) return SystemMessageData( content=content, role=role, + interaction_id=interaction_id, metadata=metadata, name=name, ) @@ -7428,6 +7503,8 @@ def to_dict(self) -> dict: result: dict = {} result["content"] = from_str(self.content) result["role"] = to_enum(SystemMessageRole, self.role) + if self.interaction_id is not None: + result["interactionId"] = from_union([from_none, from_str], self.interaction_id) if self.metadata is not None: result["metadata"] = from_union([from_none, lambda x: to_class(SystemMessageMetadata, x)], self.metadata) if self.name is not None: @@ -7906,6 +7983,7 @@ class ToolExecutionCompleteData: # Deprecated: this field is deprecated. parent_tool_call_id: str | None = None result: ToolExecutionCompleteResult | None = None + rte: bool | None = None sandboxed: bool | None = None tool_description: ToolExecutionCompleteToolDescription | None = None tool_telemetry: dict[str, Any] | None = None @@ -7923,6 +8001,7 @@ def from_dict(obj: Any) -> "ToolExecutionCompleteData": model = from_union([from_none, from_str], obj.get("model")) parent_tool_call_id = from_union([from_none, from_str], obj.get("parentToolCallId")) result = from_union([from_none, ToolExecutionCompleteResult.from_dict], obj.get("result")) + rte = from_union([from_none, from_bool], obj.get("rte")) sandboxed = from_union([from_none, from_bool], obj.get("sandboxed")) tool_description = from_union([from_none, ToolExecutionCompleteToolDescription.from_dict], obj.get("toolDescription")) tool_telemetry = from_union([from_none, lambda x: from_dict(lambda x: x, x)], obj.get("toolTelemetry")) @@ -7937,6 +8016,7 @@ def from_dict(obj: Any) -> "ToolExecutionCompleteData": model=model, parent_tool_call_id=parent_tool_call_id, result=result, + rte=rte, sandboxed=sandboxed, tool_description=tool_description, tool_telemetry=tool_telemetry, @@ -7961,6 +8041,8 @@ def to_dict(self) -> dict: result["parentToolCallId"] = from_union([from_none, from_str], self.parent_tool_call_id) if self.result is not None: result["result"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteResult, x)], self.result) + if self.rte is not None: + result["rte"] = from_union([from_none, from_bool], self.rte) if self.sandboxed is not None: result["sandboxed"] = from_union([from_none, from_bool], self.sandboxed) if self.tool_description is not None: @@ -8396,6 +8478,7 @@ class ToolExecutionStartData: model: str | None = None # Deprecated: this field is deprecated. parent_tool_call_id: str | None = None + rte: bool | None = None shell_tool_info: ToolExecutionStartShellToolInfo | None = None tool_description: ToolExecutionStartToolDescription | None = None turn_id: str | None = None @@ -8411,6 +8494,7 @@ def from_dict(obj: Any) -> "ToolExecutionStartData": mcp_tool_name = from_union([from_none, from_str], obj.get("mcpToolName")) model = from_union([from_none, from_str], obj.get("model")) parent_tool_call_id = from_union([from_none, from_str], obj.get("parentToolCallId")) + rte = from_union([from_none, from_bool], obj.get("rte")) shell_tool_info = from_union([from_none, ToolExecutionStartShellToolInfo.from_dict], obj.get("shellToolInfo")) tool_description = from_union([from_none, ToolExecutionStartToolDescription.from_dict], obj.get("toolDescription")) turn_id = from_union([from_none, from_str], obj.get("turnId")) @@ -8423,6 +8507,7 @@ def from_dict(obj: Any) -> "ToolExecutionStartData": mcp_tool_name=mcp_tool_name, model=model, parent_tool_call_id=parent_tool_call_id, + rte=rte, shell_tool_info=shell_tool_info, tool_description=tool_description, turn_id=turn_id, @@ -8444,6 +8529,8 @@ def to_dict(self) -> dict: result["model"] = from_union([from_none, from_str], self.model) if self.parent_tool_call_id is not None: result["parentToolCallId"] = from_union([from_none, from_str], self.parent_tool_call_id) + if self.rte is not None: + result["rte"] = from_union([from_none, from_bool], self.rte) if self.shell_tool_info is not None: result["shellToolInfo"] = from_union([from_none, lambda x: to_class(ToolExecutionStartShellToolInfo, x)], self.shell_tool_info) if self.tool_description is not None: @@ -9145,6 +9232,21 @@ def _load_UserToolSessionApproval(obj: Any) -> "UserToolSessionApproval": PermissionResult = PermissionApproved | PermissionApprovedForSession | PermissionApprovedForLocation | PermissionCancelled | PermissionDeniedByRules | PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser | PermissionDeniedInteractivelyByUser | PermissionDeniedByContentExclusionPolicy | PermissionDeniedByPermissionRequestHook +# Experimental: this enum is part of an experimental API and may change or be removed. +class AutoApprovalJudgeFailureReason(Enum): + "Why the auto-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs." + # The judge model call exceeded its deadline. + TIMEOUT = "timeout" + # The judge model call was cancelled before it returned. + ABORT = "abort" + # The judge model call completed but returned no content. + EMPTY_RESPONSE = "empty_response" + # The judge model call failed (for example a transport, authentication, or rate-limit error). + MODEL_ERROR = "model_error" + # The judge model replied, but the reply carried no ALLOW/DENY verdict. + PARSE_ERROR = "parse_error" + + # Experimental: this enum is part of an experimental API and may change or be removed. class AutoApprovalRecommendation(Enum): "Outcome of the auto-approval safety judge for a permission request. Present only when auto mode is enabled; its absence means the judge did not evaluate the request (auto mode was off)." @@ -9562,6 +9664,14 @@ class ReasoningSummary(Enum): DETAILED = "detailed" +class ScheduleOrigin(Enum): + "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." + # The schedule was created by an explicit user action, such as `/every` or `/after`. + USER = "user" + # The schedule was created by the agent via the `manage_schedule` tool. + MODEL = "model" + + class SessionLimitsExhaustedResponseAction(Enum): "User action selected for an exhausted session limit." # Increase the current max by an exact AI Credits amount. @@ -9708,7 +9818,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantTurnRetryData | AssistantIntentData | AssistantServerToolProgressData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | ModelCallFailureData | ModelCallStartData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | ToolSearchActivatedData | SkillInvokedData | SubagentStartedData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | SessionManagedSettingsResolvedData | SessionManagedSettingsEnforcedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data +SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantTurnRetryData | AssistantIntentData | AssistantServerToolProgressData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | ModelCallFailureData | ModelCallStartData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | ToolSearchActivatedData | SkillInvokedData | SubagentStartedData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | SessionManagedSettingsResolvedData | SessionManagedSettingsEnforcedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | FactoryRunUpdatedData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -9831,6 +9941,7 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.EXIT_PLAN_MODE_COMPLETED: data = ExitPlanModeCompletedData.from_dict(data_obj) case SessionEventType.SESSION_TOOLS_UPDATED: data = SessionToolsUpdatedData.from_dict(data_obj) case SessionEventType.SESSION_BACKGROUND_TASKS_CHANGED: data = SessionBackgroundTasksChangedData.from_dict(data_obj) + case SessionEventType.FACTORY_RUN_UPDATED: data = FactoryRunUpdatedData.from_dict(data_obj) case SessionEventType.SESSION_SKILLS_LOADED: data = SessionSkillsLoadedData.from_dict(data_obj) case SessionEventType.SESSION_CUSTOM_AGENTS_UPDATED: data = SessionCustomAgentsUpdatedData.from_dict(data_obj) case SessionEventType.SESSION_MCP_SERVERS_LOADED: data = SessionMcpServersLoadedData.from_dict(data_obj) @@ -9926,6 +10037,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "AttachmentSelectionDetails", "AttachmentSelectionDetailsEnd", "AttachmentSelectionDetailsStart", + "AutoApprovalJudgeFailureReason", "AutoApprovalRecommendation", "AutoModeResolvedReasoningBucket", "AutoModeSwitchCompletedData", @@ -9975,6 +10087,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "ExtensionsLoadedExtensionStatus", "ExternalToolCompletedData", "ExternalToolRequestedData", + "FactoryRunUpdatedData", "GitHubRepoRef", "HandoffRepository", "HandoffSourceType", @@ -10070,6 +10183,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "ReasoningSummary", "SamplingCompletedData", "SamplingRequestedData", + "ScheduleOrigin", "SessionAutoModeResolvedData", "SessionAutopilotObjectiveChangedData", "SessionBackgroundTasksChangedData", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index bd32d490cd..834566ee30 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -24,6 +24,8 @@ pub mod rpc_methods { pub const CONNECT: &str = "connect"; /// `models.list` pub const MODELS_LIST: &str = "models.list"; + /// `models.getBuiltInCatalog` + pub const MODELS_GETBUILTINCATALOG: &str = "models.getBuiltInCatalog"; /// `tools.list` pub const TOOLS_LIST: &str = "tools.list"; /// `account.getQuota` @@ -118,6 +120,10 @@ pub mod rpc_methods { pub const SESSIONS_CONNECT: &str = "sessions.connect"; /// `sessions.list` pub const SESSIONS_LIST: &str = "sessions.list"; + /// `sessions.getMetadata` + pub const SESSIONS_GETMETADATA: &str = "sessions.getMetadata"; + /// `sessions.listNonEmptySessionIds` + pub const SESSIONS_LISTNONEMPTYSESSIONIDS: &str = "sessions.listNonEmptySessionIds"; /// `sessions.findByTaskId` pub const SESSIONS_FINDBYTASKID: &str = "sessions.findByTaskId"; /// `sessions.findByPrefix` @@ -136,6 +142,8 @@ pub mod rpc_methods { pub const SESSIONS_CLOSE: &str = "sessions.close"; /// `sessions.bulkDelete` pub const SESSIONS_BULKDELETE: &str = "sessions.bulkDelete"; + /// `sessions.delete` + pub const SESSIONS_DELETE: &str = "sessions.delete"; /// `sessions.pruneOld` pub const SESSIONS_PRUNEOLD: &str = "sessions.pruneOld"; /// `sessions.save` @@ -175,8 +183,14 @@ pub mod rpc_methods { pub const SESSION_SEND: &str = "session.send"; /// `session.sendMessages` pub const SESSION_SENDMESSAGES: &str = "session.sendMessages"; + /// `session.sendSystemNotification` + pub const SESSION_SENDSYSTEMNOTIFICATION: &str = "session.sendSystemNotification"; /// `session.abort` pub const SESSION_ABORT: &str = "session.abort"; + /// `session.interruptMainTurn` + pub const SESSION_INTERRUPTMAINTURN: &str = "session.interruptMainTurn"; + /// `session.cancelAllBackgroundAgents` + pub const SESSION_CANCELALLBACKGROUNDAGENTS: &str = "session.cancelAllBackgroundAgents"; /// `session.shutdown` pub const SESSION_SHUTDOWN: &str = "session.shutdown"; /// `session.gitHubAuth.getStatus` @@ -197,8 +211,16 @@ pub mod rpc_methods { pub const SESSION_CANVAS_ACTION_INVOKE: &str = "session.canvas.action.invoke"; /// `session.factory.run` pub const SESSION_FACTORY_RUN: &str = "session.factory.run"; + /// `session.factory.resume` + pub const SESSION_FACTORY_RESUME: &str = "session.factory.resume"; /// `session.factory.getRun` pub const SESSION_FACTORY_GETRUN: &str = "session.factory.getRun"; + /// `session.factory.listRuns` + pub const SESSION_FACTORY_LISTRUNS: &str = "session.factory.listRuns"; + /// `session.factory.getRunDetail` + pub const SESSION_FACTORY_GETRUNDETAIL: &str = "session.factory.getRunDetail"; + /// `session.factory.getRunProgress` + pub const SESSION_FACTORY_GETRUNPROGRESS: &str = "session.factory.getRunProgress"; /// `session.factory.cancel` pub const SESSION_FACTORY_CANCEL: &str = "session.factory.cancel"; /// `session.factory.log` @@ -240,6 +262,10 @@ pub mod rpc_methods { "session.plan.readSqlTodosWithDependencies"; /// `session.workspaces.getWorkspace` pub const SESSION_WORKSPACES_GETWORKSPACE: &str = "session.workspaces.getWorkspace"; + /// `session.workspaces.updateMetadata` + pub const SESSION_WORKSPACES_UPDATEMETADATA: &str = "session.workspaces.updateMetadata"; + /// `session.workspaces.ensure` + pub const SESSION_WORKSPACES_ENSURE: &str = "session.workspaces.ensure"; /// `session.workspaces.listFiles` pub const SESSION_WORKSPACES_LISTFILES: &str = "session.workspaces.listFiles"; /// `session.workspaces.readFile` @@ -250,6 +276,22 @@ pub mod rpc_methods { pub const SESSION_WORKSPACES_LISTCHECKPOINTS: &str = "session.workspaces.listCheckpoints"; /// `session.workspaces.readCheckpoint` pub const SESSION_WORKSPACES_READCHECKPOINT: &str = "session.workspaces.readCheckpoint"; + /// `session.workspaces.addSummary` + pub const SESSION_WORKSPACES_ADDSUMMARY: &str = "session.workspaces.addSummary"; + /// `session.workspaces.truncateSummaries` + pub const SESSION_WORKSPACES_TRUNCATESUMMARIES: &str = "session.workspaces.truncateSummaries"; + /// `session.workspaces.readAutopilotObjective` + pub const SESSION_WORKSPACES_READAUTOPILOTOBJECTIVE: &str = + "session.workspaces.readAutopilotObjective"; + /// `session.workspaces.writeAutopilotObjective` + pub const SESSION_WORKSPACES_WRITEAUTOPILOTOBJECTIVE: &str = + "session.workspaces.writeAutopilotObjective"; + /// `session.workspaces.deleteAutopilotObjective` + pub const SESSION_WORKSPACES_DELETEAUTOPILOTOBJECTIVE: &str = + "session.workspaces.deleteAutopilotObjective"; + /// `session.workspaces.autopilotObjectiveExists` + pub const SESSION_WORKSPACES_AUTOPILOTOBJECTIVEEXISTS: &str = + "session.workspaces.autopilotObjectiveExists"; /// `session.workspaces.saveLargePaste` pub const SESSION_WORKSPACES_SAVELARGEPASTE: &str = "session.workspaces.saveLargePaste"; /// `session.workspaces.diff` @@ -347,6 +389,8 @@ pub mod rpc_methods { "session.mcp.oauth.handlePendingRequest"; /// `session.mcp.oauth.login` pub const SESSION_MCP_OAUTH_LOGIN: &str = "session.mcp.oauth.login"; + /// `session.mcp.oauth.respond` + pub const SESSION_MCP_OAUTH_RESPOND: &str = "session.mcp.oauth.respond"; /// `session.mcp.headers.handlePendingHeadersRefreshRequest` pub const SESSION_MCP_HEADERS_HANDLEPENDINGHEADERSREFRESHREQUEST: &str = "session.mcp.headers.handlePendingHeadersRefreshRequest"; @@ -518,6 +562,8 @@ pub mod rpc_methods { pub const SESSION_SETTINGS_SNAPSHOT: &str = "session.settings.snapshot"; /// `session.settings.evaluatePredicate` pub const SESSION_SETTINGS_EVALUATEPREDICATE: &str = "session.settings.evaluatePredicate"; + /// `session.contentExclusion.checkPaths` + pub const SESSION_CONTENTEXCLUSION_CHECKPATHS: &str = "session.contentExclusion.checkPaths"; /// `session.shell.exec` pub const SESSION_SHELL_EXEC: &str = "session.shell.exec"; /// `session.shell.kill` @@ -530,6 +576,12 @@ pub mod rpc_methods { pub const SESSION_HISTORY_COMPACT: &str = "session.history.compact"; /// `session.history.truncate` pub const SESSION_HISTORY_TRUNCATE: &str = "session.history.truncate"; + /// `session.history.listRewindPoints` + pub const SESSION_HISTORY_LISTREWINDPOINTS: &str = "session.history.listRewindPoints"; + /// `session.history.previewRewind` + pub const SESSION_HISTORY_PREVIEWREWIND: &str = "session.history.previewRewind"; + /// `session.history.rewind` + pub const SESSION_HISTORY_REWIND: &str = "session.history.rewind"; /// `session.history.cancelBackgroundCompaction` pub const SESSION_HISTORY_CANCELBACKGROUNDCOMPACTION: &str = "session.history.cancelBackgroundCompaction"; @@ -539,10 +591,27 @@ pub mod rpc_methods { pub const SESSION_HISTORY_SUMMARIZEFORHANDOFF: &str = "session.history.summarizeForHandoff"; /// `session.queue.pendingItems` pub const SESSION_QUEUE_PENDINGITEMS: &str = "session.queue.pendingItems"; + /// `session.queue.snapshot` + pub const SESSION_QUEUE_SNAPSHOT: &str = "session.queue.snapshot"; + /// `session.queue.hasPending` + pub const SESSION_QUEUE_HASPENDING: &str = "session.queue.hasPending"; + /// `session.queue.beginDeferredIdleDrain` + pub const SESSION_QUEUE_BEGINDEFERREDIDLEDRAIN: &str = "session.queue.beginDeferredIdleDrain"; + /// `session.queue.finishDeferredIdleDrain` + pub const SESSION_QUEUE_FINISHDEFERREDIDLEDRAIN: &str = "session.queue.finishDeferredIdleDrain"; + /// `session.queue.deferSessionIdle` + pub const SESSION_QUEUE_DEFERSESSIONIDLE: &str = "session.queue.deferSessionIdle"; /// `session.queue.removeMostRecent` pub const SESSION_QUEUE_REMOVEMOSTRECENT: &str = "session.queue.removeMostRecent"; /// `session.queue.clear` pub const SESSION_QUEUE_CLEAR: &str = "session.queue.clear"; + /// `session.queue.consumeSystemNotifications` + pub const SESSION_QUEUE_CONSUMESYSTEMNOTIFICATIONS: &str = + "session.queue.consumeSystemNotifications"; + /// `session.queue.enqueueResumePending` + pub const SESSION_QUEUE_ENQUEUERESUMEPENDING: &str = "session.queue.enqueueResumePending"; + /// `session.queue.process` + pub const SESSION_QUEUE_PROCESS: &str = "session.queue.process"; /// `session.eventLog.read` pub const SESSION_EVENTLOG_READ: &str = "session.eventLog.read"; /// `session.eventLog.tail` @@ -565,6 +634,20 @@ pub mod rpc_methods { pub const SESSION_VISIBILITY_SET: &str = "session.visibility.set"; /// `session.schedule.list` pub const SESSION_SCHEDULE_LIST: &str = "session.schedule.list"; + /// `session.schedule.hydrate` + pub const SESSION_SCHEDULE_HYDRATE: &str = "session.schedule.hydrate"; + /// `session.schedule.hasSelfPaced` + pub const SESSION_SCHEDULE_HASSELFPACED: &str = "session.schedule.hasSelfPaced"; + /// `session.schedule.add` + pub const SESSION_SCHEDULE_ADD: &str = "session.schedule.add"; + /// `session.schedule.addCron` + pub const SESSION_SCHEDULE_ADDCRON: &str = "session.schedule.addCron"; + /// `session.schedule.addAt` + pub const SESSION_SCHEDULE_ADDAT: &str = "session.schedule.addAt"; + /// `session.schedule.addSelfPaced` + pub const SESSION_SCHEDULE_ADDSELFPACED: &str = "session.schedule.addSelfPaced"; + /// `session.schedule.rearmSelfPaced` + pub const SESSION_SCHEDULE_REARMSELFPACED: &str = "session.schedule.rearmSelfPaced"; /// `session.schedule.stop` pub const SESSION_SCHEDULE_STOP: &str = "session.schedule.stop"; /// `providerToken.getToken` @@ -595,6 +678,8 @@ pub mod rpc_methods { pub const SESSIONFS_RENAME: &str = "sessionFs.rename"; /// `sessionFs.sqliteQuery` pub const SESSIONFS_SQLITEQUERY: &str = "sessionFs.sqliteQuery"; + /// `sessionFs.sqliteTransaction` + pub const SESSIONFS_SQLITETRANSACTION: &str = "sessionFs.sqliteTransaction"; /// `sessionFs.sqliteExists` pub const SESSIONFS_SQLITEEXISTS: &str = "sessionFs.sqliteExists"; /// `canvas.open` @@ -2092,6 +2177,36 @@ pub struct AttachmentSelection { pub r#type: AttachmentSelectionType, } +/// A well-known model in the runtime's built-in catalog. +/// +///

+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct BuiltInModelCatalogEntry { + /// Well-known runtime model ID suitable for `ProviderConfig.modelId` or `ProviderModelConfig.modelId`. This is not necessarily the provider-facing deployment or model name and does not indicate CAPI entitlement or provider availability. + pub id: String, +} + +/// The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct BuiltInModelCatalog { + /// Built-in model entries. + pub models: Vec, +} + /// Cancellation result for a user-requested shell command. /// ///
@@ -2853,7 +2968,7 @@ pub struct ConnectRemoteSessionParams { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub(crate) struct 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. #[serde(skip_serializing_if = "Option::is_none")] pub enable_git_hub_telemetry_forwarding: Option, /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN @@ -2880,6 +2995,55 @@ pub(crate) struct ConnectResult { pub version: String, } +/// Local file system absolute paths within the session working directory to check against its content-exclusion policy. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ContentExclusionCheckPathsRequest { + /// Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates. + pub paths: Vec, +} + +/// Content-exclusion decision for one requested path. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ContentExclusionPathCheck { + /// Whether the session's complete content-exclusion policy excludes the path. + pub excluded: bool, + /// The path supplied by the caller. + pub path: String, +} + +/// Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ContentExclusionCheckPathsResult { + /// Whether the session's policy service was available for the complete batch. When false, checks is empty and callers must treat every requested path as excluded. + pub available: bool, + /// Per-path decisions in request order. Empty when available is false. + pub checks: Vec, +} + /// A single large message currently in context. /// ///
@@ -3724,6 +3888,8 @@ pub struct FactoryAgentOptions { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct FactoryAgentRequest { + /// Opaque token identifying the current factory execution attempt. + pub execution_token: String, /// Factory run identifier that owns the subagent. pub factory_run_id: String, /// Subagent execution options. @@ -3748,6 +3914,37 @@ pub struct FactoryAgentResult { pub result: Option, } +/// Prompt-safe durable identity and live status for a direct factory agent. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FactoryAgentSummary { + pub active_ms: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub activity: Option, + pub agent_id: String, + pub agent_type: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub completed_at: Option, + pub label: String, + pub phase_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub requested_model: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub resolved_model: Option, + pub run_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub started_at: Option, + pub status: String, + pub tool_call_id: String, +} + /// Parameters for cancelling a factory run. /// ///
@@ -3763,6 +3960,42 @@ pub struct FactoryCancelRequest { pub run_id: String, } +/// Current factory phase identity. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FactoryCurrentPhase { + pub id: String, + pub ordinal: Option, +} + +/// Declared or approved factory resource ceilings. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FactoryDeclaredLimits { + #[serde(skip_serializing_if = "Option::is_none")] + pub max_ai_credits: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub max_concurrent_subagents: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub max_total_subagents: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub timeout_seconds: Option, +} + /// Parameters sent to the owning extension to execute a factory closure. /// ///
@@ -3780,6 +4013,8 @@ pub struct FactoryExecuteRequest { pub name: String, /// Factory run identifier. pub run_id: String, + /// Opaque token identifying this factory execution attempt. + pub execution_token: String, /// Factory input value. pub args: serde_json::Value, } @@ -3796,7 +4031,35 @@ pub struct FactoryExecuteRequest { #[serde(rename_all = "camelCase")] pub struct FactoryExecuteResult { /// Factory result value. - pub result: serde_json::Value, + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option, +} + +/// Parameters for paging factory progress. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FactoryGetRunProgressRequest { + /// Exclusive forward cursor. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_seq: Option, + /// Exclusive backward cursor. + #[serde(skip_serializing_if = "Option::is_none")] + pub before_seq: Option, + /// Maximum records to return. Defaults to 200 and is capped at 500. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Optional phase identifier used to scope records and cursors. + #[serde(skip_serializing_if = "Option::is_none")] + pub phase_id: Option, + /// Factory run identifier. + pub run_id: String, } /// Parameters for retrieving a factory run. @@ -3825,6 +4088,8 @@ pub struct FactoryGetRunRequest { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct FactoryJournalGetRequest { + /// Opaque token identifying the current factory execution attempt. + pub execution_token: String, /// Namespaced journal key. pub key: String, /// Factory run identifier. @@ -3860,6 +4125,8 @@ pub struct FactoryJournalGetResult { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct FactoryJournalPutRequest { + /// Opaque token identifying the current factory execution attempt. + pub execution_token: String, /// Namespaced journal key. pub key: String, /// JSON result to memoize. @@ -3868,7 +4135,7 @@ pub struct FactoryJournalPutRequest { pub run_id: String, } -/// One ordered factory progress line. +/// Empty parameters for listing factory runs. /// ///
/// @@ -3878,16 +4145,9 @@ pub struct FactoryJournalPutRequest { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct FactoryLogLine { - /// Progress line kind. - pub kind: FactoryLogLineKind, - /// Monotonic sequence number within the factory run. - pub seq: i64, - /// Progress text. - pub text: String, -} +pub struct FactoryListRunsRequest {} -/// Parameters for recording factory progress. +/// Durable factory resource consumption. /// ///
/// @@ -3897,14 +4157,13 @@ pub struct FactoryLogLine { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct FactoryLogRequest { - /// Ordered progress lines to append. - pub lines: Vec, - /// Factory run identifier. - pub run_id: String, +pub struct FactoryRunConsumed { + pub active_ms: i64, + pub nano_aiu: i64, + pub subagents: i64, } -/// Wire-only per-invocation factory resource ceiling overrides. +/// Prompt-safe terminal factory outcome. /// ///
/// @@ -3914,19 +4173,18 @@ pub struct FactoryLogRequest { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct FactoryRunLimits { - /// Maximum number of factory subagents that may run concurrently. +pub struct FactoryRunTerminal { #[serde(skip_serializing_if = "Option::is_none")] - pub max_concurrent_subagents: Option, - /// Maximum total number of factory subagents that may be admitted. + pub error: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub max_total_subagents: Option, - /// Factory active-run timeout in milliseconds. + pub failure: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub timeout: Option, + pub reason: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub result_preview: Option, } -/// Options controlling factory invocation. +/// Durable factory run summary with read-time live overlays. /// ///
/// @@ -3936,16 +4194,29 @@ pub struct FactoryRunLimits { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct RunOptions { - /// Per-invocation resource ceiling overrides. - #[serde(skip_serializing_if = "Option::is_none")] - pub limits: Option, - /// Run identifier whose journal and progress should seed this resumed run. - #[serde(skip_serializing_if = "Option::is_none")] - pub resume_from_run_id: Option, +pub struct FactoryRunSummary { + pub active_segment_started_at: Option, + pub approved: Option, + pub completed_at: Option, + pub consumed: FactoryRunConsumed, + pub created_at: i64, + pub current_phase: Option, + pub declared_limits: FactoryDeclaredLimits, + pub declared_phase_count: i64, + pub description: String, + pub factory_name: String, + pub live_agent_count: i64, + pub observed_at: i64, + pub revision: i64, + pub run_id: String, + pub started_at: Option, + pub status: FactoryRunStatus, + pub terminal: Option, + pub total_spawned_agent_count: i64, + pub updated_at: i64, } -/// Parameters for invoking a registered factory. +/// Factory runs in durable creation order. /// ///
/// @@ -3955,17 +4226,11 @@ pub struct RunOptions { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct FactoryRunRequest { - /// Factory input value. - pub args: serde_json::Value, - /// Registered factory name. - pub name: String, - /// Factory invocation options. - #[serde(skip_serializing_if = "Option::is_none")] - pub options: Option, +pub struct FactoryListRunsResult { + pub runs: Vec, } -/// Complete current or terminal factory run envelope. +/// One ordered factory progress line. /// ///
/// @@ -3975,29 +4240,16 @@ pub struct FactoryRunRequest { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct FactoryRunResult { - /// Error message for an errored run. - #[serde(skip_serializing_if = "Option::is_none")] - pub error: Option, - /// Machine-readable failure details for an errored run. - #[serde(skip_serializing_if = "Option::is_none")] - pub failure: Option, - /// Reason for a halted or cancelled run. - #[serde(skip_serializing_if = "Option::is_none")] - pub reason: Option, - /// Completed factory result. - #[serde(skip_serializing_if = "Option::is_none")] - pub result: Option, - /// Factory run identifier. - pub run_id: String, - /// Partial journal and progress snapshot for a halted, cancelled, or errored run. - #[serde(skip_serializing_if = "Option::is_none")] - pub snapshot: Option, - /// Current or terminal factory run status. - pub status: FactoryRunStatus, +pub struct FactoryLogLine { + /// Progress line kind. + pub kind: FactoryLogLineKind, + /// Monotonic sequence number within the factory run. + pub seq: i64, + /// Progress text. + pub text: String, } -/// Optional user prompt to combine with the fleet orchestration instructions. +/// Parameters for recording factory progress. /// ///
/// @@ -4007,13 +4259,16 @@ pub struct FactoryRunResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct FleetStartRequest { - /// Optional user prompt to combine with fleet instructions - #[serde(skip_serializing_if = "Option::is_none")] - pub prompt: Option, +pub struct FactoryLogRequest { + /// Opaque token identifying the current factory execution attempt. + pub execution_token: String, + /// Ordered progress lines to append. + pub lines: Vec, + /// Factory run identifier. + pub run_id: String, } -/// Indicates whether fleet mode was successfully activated. +/// Durable lifecycle and timing for one factory phase. /// ///
/// @@ -4023,12 +4278,26 @@ pub struct FleetStartRequest { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct FleetStartResult { - /// Whether fleet mode was successfully activated - pub started: bool, +pub struct FactoryPhaseObservation { + pub accumulated_active_ms: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub completed_at: Option, + pub current_active_ms: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + pub entry_count: i64, + pub id: String, + pub last_entered_run_attempt: i64, + pub live_agent_count: i64, + pub ordinal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub started_at: Option, + pub status: FactoryPhaseStatus, + pub title: String, + pub total_agent_count: i64, } -/// Folder path to add to trusted folders. +/// One durable factory progress record. /// ///
/// @@ -4038,12 +4307,22 @@ pub struct FleetStartResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct FolderTrustAddParams { - /// Folder path to mark as trusted - pub path: String, +pub struct FactoryProgressLine { + /// Resume attempt that emitted this record. + pub attempt: i64, + /// Progress record kind. + pub kind: FactoryLogLineKind, + /// Phase active when the record was emitted, or null before any phase. + pub phase_id: Option, + /// Epoch milliseconds when the record was persisted. + pub recorded_at: i64, + /// Global monotonic sequence number within the run. + pub seq: i64, + /// Prompt-safe progress text. + pub text: String, } -/// Folder path to check for trust. +/// A bidirectional page of factory progress. /// ///
/// @@ -4053,12 +4332,17 @@ pub struct FolderTrustAddParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct FolderTrustCheckParams { - /// Folder path to check - pub path: String, +pub struct FactoryProgressPage { + pub has_more_newer: bool, + pub has_more_older: bool, + pub newest_seq: Option, + pub oldest_seq: Option, + pub records: Vec, + /// Run revision reflected by this page. + pub revision: i64, } -/// Folder trust check result. +/// Wire-only per-invocation factory resource ceiling overrides. /// ///
/// @@ -4068,12 +4352,22 @@ pub struct FolderTrustCheckParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct FolderTrustCheckResult { - /// Whether the folder is trusted - pub trusted: bool, +pub struct 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_ai_credits: Option, + /// Maximum number of factory subagents that may run concurrently. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_concurrent_subagents: Option, + /// Maximum total number of factory subagents that may be admitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_total_subagents: Option, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub timeout_seconds: Option, } -/// Authentication-info variant for GitHub CLI credentials, carrying host, login, and the `gh auth token` value. +/// Parameters for resuming a factory run from its persisted identity. /// ///
/// @@ -4083,11 +4377,228 @@ pub struct FolderTrustCheckResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct GhCliAuthInfo { - /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. +pub struct FactoryResumeRequest { + /// Optional per-invocation resource ceiling overrides. #[serde(skip_serializing_if = "Option::is_none")] - pub copilot_user: Option, - /// Authentication host. + pub limits: Option, + /// Factory run identifier. + pub run_id: String, +} + +/// Complete current or terminal factory run envelope. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FactoryRunResult { + /// Error message for an errored run. + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Machine-readable failure details for an errored run. + #[serde(skip_serializing_if = "Option::is_none")] + pub failure: Option, + /// Reason for a halted or cancelled run. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Completed factory result. + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option, + /// Factory run identifier. + pub run_id: String, + /// Partial journal and progress snapshot for a halted, cancelled, or errored run. + #[serde(skip_serializing_if = "Option::is_none")] + pub snapshot: Option, + /// Current or terminal factory run status. + pub status: FactoryRunStatus, +} + +/// Resolved persisted factory identity and resumed run envelope. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FactoryResumeResult { + /// Persisted factory name resolved for the resumed run. + pub factory_name: String, + /// Terminal resumed run envelope. + pub run: FactoryRunResult, +} + +/// Full factory run observability detail. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FactoryRunDetail { + pub active_segment_started_at: Option, + pub agents: Vec, + pub approved: Option, + pub completed_at: Option, + pub consumed: FactoryRunConsumed, + pub created_at: i64, + pub current_phase: Option, + pub declared_limits: FactoryDeclaredLimits, + pub declared_phase_count: i64, + pub description: String, + pub factory_name: String, + pub live_agent_count: i64, + pub observed_at: i64, + pub phases: Vec, + pub progress: FactoryProgressPage, + pub revision: i64, + pub run_id: String, + pub started_at: Option, + pub status: FactoryRunStatus, + pub terminal: Option, + pub total_spawned_agent_count: i64, + pub updated_at: i64, +} + +/// Options controlling factory invocation. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RunOptions { + /// Per-invocation resource ceiling overrides. + #[serde(skip_serializing_if = "Option::is_none")] + pub limits: Option, + /// Run identifier whose journal and progress should seed this resumed run. + #[serde(skip_serializing_if = "Option::is_none")] + pub resume_from_run_id: Option, +} + +/// Parameters for invoking a registered factory. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FactoryRunRequest { + /// Factory input value. + pub args: serde_json::Value, + /// Registered factory name. + pub name: String, + /// Factory invocation options. + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option, +} + +/// Optional user prompt to combine with the fleet orchestration instructions. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FleetStartRequest { + /// Optional user prompt to combine with fleet instructions + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, +} + +/// Indicates whether fleet mode was successfully activated. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FleetStartResult { + /// Whether fleet mode was successfully activated + pub started: bool, +} + +/// Folder path to add to trusted folders. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FolderTrustAddParams { + /// Folder path to mark as trusted + pub path: String, +} + +/// Folder path to check for trust. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FolderTrustCheckParams { + /// Folder path to check + pub path: String, +} + +/// Folder trust check result. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FolderTrustCheckResult { + /// Whether the folder is trusted + pub trusted: bool, +} + +/// Authentication-info variant for GitHub CLI credentials, carrying host, login, and the `gh auth token` value. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct GhCliAuthInfo { + /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. + #[serde(skip_serializing_if = "Option::is_none")] + pub copilot_user: Option, + /// Authentication host. pub host: String, /// User login as reported by `gh auth status`. pub login: String, @@ -4341,7 +4852,7 @@ pub struct HistoryCompactResult { pub tokens_removed: i64, } -/// Markdown summary of the conversation context (empty when not available). +/// A root user turn that the session can rewind to. /// ///
/// @@ -4351,12 +4862,28 @@ pub struct HistoryCompactResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct HistorySummarizeForHandoffResult { - /// Markdown summary of the conversation context produced by an LLM. Empty string when there are no messages or when the session does not support local summarization. - pub summary: String, +pub struct HistoryRewindPoint { + /// Whether at least one file in this turn or a later turn can be restored. + pub can_restore_files: bool, + /// ID of the user.message event that begins the discarded suffix. + pub event_id: String, + /// Number of unique files in this turn and all later turns that have captured changes. + pub file_count: i64, + /// Whether this turn was an automatically injected autopilot continuation. + pub is_autopilot_continuation: bool, + /// Lines added by this turn's captured file changes. + pub lines_added: i64, + /// Lines removed by this turn's captured file changes. + pub lines_removed: i64, + /// ISO timestamp of the user turn. + pub timestamp: String, + /// Whether this turn itself captured any file changes. + pub turn_changed_files: bool, + /// User-visible message text for the turn. + pub user_message: String, } -/// Identifier of the event to truncate to; this event and all later events are removed. +/// Rewind points and file-change-tracking availability for the session. /// ///
/// @@ -4366,12 +4893,17 @@ pub struct HistorySummarizeForHandoffResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct HistoryTruncateRequest { - /// Event ID to truncate to. This event and all events after it are removed from the session. - pub event_id: String, +pub struct HistoryListRewindPointsResult { + /// Whether this session captured file changes from its first turn. + pub file_change_tracking_enabled: bool, + /// Root user turns in chronological order. Empty when `unavailableReason` is set. + pub points: Vec, + /// Why the listed points could not be produced, when applicable; the points list is empty whenever it is set. `unsupported-remote-session` is permanent for the session and comes with `fileChangeTrackingEnabled: false`. `session-busy` is transient and only ever reported by a session that *is* tracking (`fileChangeTrackingEnabled: true`), because the file-change captures cannot be read while work that may still mutate them is in flight; the same request succeeds once the session settles, so a client that wants points should retry rather than treat it as a failure. It is never `file-change-tracking-disabled`: an untracked local session still lists conversation-only points and reports that through `fileChangeTrackingEnabled: false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unavailable_reason: Option, } -/// Number of events that were removed by the truncation. +/// Event boundary to preview for conversation-and-files rewind. /// ///
/// @@ -4381,12 +4913,12 @@ pub struct HistoryTruncateRequest { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct HistoryTruncateResult { - /// Number of events that were removed - pub events_removed: i64, +pub struct HistoryPreviewRewindRequest { + /// ID of the user.message event that begins the discarded suffix. + pub event_id: String, } -/// Authentication-info variant for GitHub-internal HMAC auth, carrying the public GitHub host and HMAC secret. +/// A file that a conversation-and-files rewind would restore. /// ///
/// @@ -4396,37 +4928,57 @@ pub struct HistoryTruncateResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct HMACAuthInfo { - /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. - #[serde(skip_serializing_if = "Option::is_none")] - pub copilot_user: Option, - /// HMAC secret used to sign requests. - pub hmac: String, - /// Authentication host. HMAC auth always targets the public GitHub host. - pub host: HMACAuthInfoHost, - /// HMAC-based authentication used by GitHub-internal services. - pub r#type: HMACAuthInfoType, +pub struct HistoryRewindFilePreview { + /// Aggregate change made across the discarded turns. + pub change_type: HistoryRewindChangeType, + /// Lines added across the discarded turns. + pub lines_added: i64, + /// Lines removed across the discarded turns. + pub lines_removed: i64, + /// Absolute path of the captured file. + pub path: String, } -/// Runtime-owned wire payload for a server-to-client hook callback invocation. +/// Files and aggregate changes for a prospective rewind. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub(crate) struct HookInvokeRequest { - #[doc(hidden)] - pub(crate) hook_type: HookType, - pub input: serde_json::Value, - pub session_id: SessionId, +pub struct HistoryPreviewRewindResult { + /// Whether file restore is available for this session. This is authoritative: switch on it and read `reason` only when it is false. + pub available: bool, + /// Number of unique files in the preview. + pub file_count: i64, + /// Files ordered by path. + pub files: Vec, + /// Why file restore is unavailable, when applicable. Populated only when `available` is false and never set when `available` is true. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, } -/// Optional output returned by an SDK callback hook. +/// Boundary and mode for rewinding session history. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub(crate) struct HookInvokeResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub output: Option, +pub struct HistoryRewindRequest { + /// ID of the user.message event that begins the discarded suffix. + pub event_id: String, + /// Whether to rewind only conversation history or also restore captured files. + pub mode: HistoryRewindMode, } -/// Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source. +/// A captured file that rewind intentionally left unchanged. /// ///
/// @@ -4436,11 +4988,144 @@ pub(crate) struct HookInvokeResponse { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct InstalledPlugin { - /// Path where the plugin is cached locally - #[serde(rename = "cache_path", skip_serializing_if = "Option::is_none")] - pub cache_path: Option, - /// Whether the plugin is currently enabled +pub struct HistorySkippedFileRestore { + /// Absolute path of the skipped file. + pub path: String, + /// Reason the file was not restored. + pub reason: HistoryFileRestoreSkipReason, +} + +/// Structured outcome of a rewind request. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HistoryRewindResult { + /// Failure detail. Set only for the failure and partial-failure outcomes (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`). + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Number of persisted events removed by conversation truncation. Present only when truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`) and for `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`. + #[serde(skip_serializing_if = "Option::is_none")] + pub events_removed: Option, + /// Overall rewind outcome. This discriminates the result: it governs which of the remaining fields are populated, so consumers must switch on it before reading `eventsRemoved`, `restoredFiles`, `skippedFiles`, or `error`. See each field for the outcomes that populate it. + pub outcome: HistoryRewindOutcome, + /// Absolute paths restored to their captured preimages. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. + pub restored_files: Vec, + /// Captured files intentionally left unchanged. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. + pub skipped_files: Vec, +} + +/// Markdown summary of the conversation context (empty when not available). +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HistorySummarizeForHandoffResult { + /// Markdown summary of the conversation context produced by an LLM. Empty string when there are no messages or when the session does not support local summarization. + pub summary: String, +} + +/// Identifier of the event to truncate to; this event and all later events are removed. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HistoryTruncateRequest { + /// Event ID to truncate to. This event and all events after it are removed from the session. + pub event_id: String, +} + +/// Number of events that were removed by the truncation. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HistoryTruncateResult { + /// Failure detail when checkpointCleanupFailed is true. + #[serde(skip_serializing_if = "Option::is_none")] + pub checkpoint_cleanup_error: Option, + /// True when conversation truncation succeeded but post-truncation workspace checkpoint cleanup failed. History is already truncated; callers may still prune snapshots but should report a checkpoint-cleanup rather than a truncation failure. + #[serde(skip_serializing_if = "Option::is_none")] + pub checkpoint_cleanup_failed: Option, + /// Number of events that were removed + pub events_removed: i64, +} + +/// Authentication-info variant for GitHub-internal HMAC auth, carrying the public GitHub host and HMAC secret. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HMACAuthInfo { + /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. + #[serde(skip_serializing_if = "Option::is_none")] + pub copilot_user: Option, + /// HMAC secret used to sign requests. + pub hmac: String, + /// Authentication host. HMAC auth always targets the public GitHub host. + pub host: HMACAuthInfoHost, + /// HMAC-based authentication used by GitHub-internal services. + pub r#type: HMACAuthInfoType, +} + +/// Runtime-owned wire payload for a server-to-client hook callback invocation. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub(crate) struct HookInvokeRequest { + #[doc(hidden)] + pub(crate) hook_type: HookType, + pub input: serde_json::Value, + pub session_id: SessionId, +} + +/// Optional output returned by an SDK callback hook. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub(crate) struct HookInvokeResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub output: Option, +} + +/// Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct InstalledPlugin { + /// Path where the plugin is cached locally + #[serde(rename = "cache_path", skip_serializing_if = "Option::is_none")] + pub cache_path: Option, + /// Whether the plugin is currently enabled pub enabled: bool, /// Installation timestamp #[serde(rename = "installed_at")] @@ -4482,7 +5167,7 @@ pub struct InstalledPluginInfo { pub version: Option, } -/// 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. /// ///
/// @@ -4498,6 +5183,9 @@ pub struct InstalledPluginSourceGitHub { #[serde(skip_serializing_if = "Option::is_none")] pub r#ref: Option, pub repo: String, + /// Optional full 40-character hexadecimal commit SHA. + #[serde(skip_serializing_if = "Option::is_none")] + pub sha: Option, /// Constant value. Always "github". pub source: InstalledPluginSourceGitHubSource, } @@ -4518,7 +5206,7 @@ pub struct InstalledPluginSourceLocal { pub source: InstalledPluginSourceLocalSource, } -/// 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. /// ///
/// @@ -4533,6 +5221,9 @@ pub struct InstalledPluginSourceUrl { pub path: Option, #[serde(skip_serializing_if = "Option::is_none")] pub r#ref: Option, + /// Optional full 40-character hexadecimal commit SHA. + #[serde(skip_serializing_if = "Option::is_none")] + pub sha: Option, /// Constant value. Always "url". pub source: InstalledPluginSourceUrlSource, pub url: String, @@ -4667,6 +5358,37 @@ pub struct InstructionsGetSourcesResult { pub sources: Vec, } +/// Parameters for interrupting the main agent turn. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub flush_queued: Option, +} + +/// Result of interrupting the main agent turn. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct InterruptMainTurnResult { + /// Whether an in-flight main agent turn was interrupted. False when the main loop was not processing. + pub interrupted: bool, +} + /// A request body chunk or cancellation signal. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -5994,6 +6716,36 @@ pub struct McpOauthLoginResult { pub authorization_url: Option, } +/// Pending MCP OAuth request id to respond to. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct McpOauthRespondRequest { + /// OAuth request identifier from the mcp.oauth_required event + pub request_id: RequestId, +} + +/// Indicates whether the pending MCP OAuth response was accepted. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct McpOauthRespondResult { + /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved. + pub success: bool, +} + /// Registration parameters for an external MCP client. /// ///
@@ -6412,6 +7164,9 @@ pub struct McpServerConfigHttp { /// Controls if tools provided by this server can be loaded on demand via tool search (auto) or always included in the initial tool list (never) #[serde(skip_serializing_if = "Option::is_none")] pub defer_tools: Option, + /// Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery is unaffected. + #[serde(skip_serializing_if = "Option::is_none")] + pub disable_tool_cache: Option, /// Content filtering mode to apply to all tools, or a map of tool name to content filtering mode. #[serde(skip_serializing_if = "Option::is_none")] pub filter_mapping: Option, @@ -6471,6 +7226,9 @@ pub struct McpServerConfigStdio { /// Controls if tools provided by this server can be loaded on demand via tool search (auto) or always included in the initial tool list (never) #[serde(skip_serializing_if = "Option::is_none")] pub defer_tools: Option, + /// Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery is unaffected. + #[serde(skip_serializing_if = "Option::is_none")] + pub disable_tool_cache: Option, /// Environment variables to pass to the Stdio MCP server process. #[serde(skip_serializing_if = "Option::is_none")] pub env: Option>, @@ -6539,7 +7297,7 @@ pub struct McpSetEnvValueModeResult { pub mode: McpSetEnvValueModeDetails, } -/// Server name and configuration for an individual MCP server start. +/// Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server. /// ///
/// @@ -6550,8 +7308,9 @@ pub struct McpSetEnvValueModeResult { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct McpStartServerRequest { - /// MCP server configuration (stdio process or remote HTTP/SSE) - pub config: serde_json::Value, + /// MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server with its already-registered configuration (config-free start-by-name). + #[serde(skip_serializing_if = "Option::is_none")] + pub config: Option, /// Name of the MCP server to start pub server_name: String, } @@ -8937,7 +9696,7 @@ pub struct PermissionsPathsUpdatePrimaryResult { #[serde(rename_all = "camelCase")] pub struct PermissionsPendingRequestsRequest {} -/// No parameters; clears all session-scoped tool permission approvals. +/// Clears session-scoped tool permission approvals, and optionally the location-scoped ones. /// ///
/// @@ -8947,7 +9706,11 @@ pub struct PermissionsPendingRequestsRequest {} ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct PermissionsResetSessionApprovalsRequest {} +pub struct PermissionsResetSessionApprovalsRequest { + /// Whether location-scoped approvals are cleared too. Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub include_location: Option, +} /// Indicates whether the operation succeeded. /// @@ -10214,7 +10977,7 @@ pub struct PushAttachmentSelection { pub r#type: PushAttachmentSelectionType, } -/// Queued-command response indicating the host executed the command, with an optional flag to stop queue processing. +/// Inputs for starting a deferred-idle drain. /// ///
/// @@ -10224,15 +10987,12 @@ pub struct PushAttachmentSelection { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct QueuedCommandHandled { - /// The host actually executed the queued command. - pub handled: bool, - /// When true, the runtime will not process subsequent queued commands until a new request comes in. - #[serde(skip_serializing_if = "Option::is_none")] - pub stop_processing_queue: Option, +pub struct QueueBeginDeferredIdleDrainRequest { + /// Whether the host still has active background work. + pub active_background_work: bool, } -/// Queued-command response indicating the host did not execute the command and the queue may continue. +/// Whether a deferred-idle drain should run. /// ///
/// @@ -10242,12 +11002,12 @@ pub struct QueuedCommandHandled { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct QueuedCommandNotHandled { - /// The host did not execute the queued command. Unblocks the queue without claiming the command was processed (e.g. when the handler threw before completing). - pub handled: bool, +pub struct QueueBeginDeferredIdleDrainResult { + /// True when the host should run finishDeferredIdleDrain asynchronously. + pub should_drain: bool, } -/// User-facing pending queue entry, with kind and display text for a queued message, slash command, or model change. +/// Internal filter for consuming queued system notifications. /// ///
/// @@ -10257,14 +11017,12 @@ pub struct QueuedCommandNotHandled { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct QueuePendingItems { - /// Human-readable text to display for this queue entry in the UI - pub display_text: String, - /// Whether this item is a queued user message or a queued slash command / model change - pub kind: QueuePendingItemsKind, +pub struct QueueConsumeSystemNotificationsRequest { + /// Opaque runtime-owned filter object. + pub filter: serde_json::Value, } -/// Snapshot of the session's pending queued items and immediate-steering messages. +/// Queued-command response indicating the host executed the command, with an optional flag to stop queue processing. /// ///
/// @@ -10274,14 +11032,15 @@ pub struct QueuePendingItems { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct QueuePendingItemsResult { - /// Pending queued items in submission order. Includes user messages, queued slash commands, and queued model changes; omits internal system items. - pub items: Vec, - /// Display text for messages currently in the immediate steering queue (interjections sent during a running turn). - pub steering_messages: Vec, +pub struct QueuedCommandHandled { + /// The host actually executed the queued command. + pub handled: bool, + /// When true, the runtime will not process subsequent queued commands until a new request comes in. + #[serde(skip_serializing_if = "Option::is_none")] + pub stop_processing_queue: Option, } -/// Indicates whether a user-facing pending item was removed. +/// Queued-command response indicating the host did not execute the command and the queue may continue. /// ///
/// @@ -10291,12 +11050,12 @@ pub struct QueuePendingItemsResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct QueueRemoveMostRecentResult { - /// True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. - pub removed: bool, +pub struct QueuedCommandNotHandled { + /// The host did not execute the queued command. Unblocks the queue without claiming the command was processed (e.g. when the handler threw before completing). + pub handled: bool, } -/// Event type to register consumer interest for, used by runtime gating logic. +/// Inputs for marking session.idle deferred in native state. /// ///
/// @@ -10306,12 +11065,12 @@ pub struct QueueRemoveMostRecentResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct RegisterEventInterestParams { - /// The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates interactive OAuth token acquisition to the consumer via `mcp.oauth_required` events; when no interest is registered the runtime still attempts non-interactive reconnect from cached or refreshable tokens, and only marks the server `needs-auth` if usable credentials are unavailable — it does not open a browser or start interactive OAuth without a consumer). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. - pub event_type: String, +pub struct QueueDeferSessionIdleRequest { + /// Whether the deferred idle was caused by an aborted foreground turn. + pub aborted: bool, } -/// Opaque handle representing an event-type interest registration. +/// Result of enqueueing the resume-pending wake item. /// ///
/// @@ -10321,12 +11080,12 @@ pub struct RegisterEventInterestParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct RegisterEventInterestResult { - /// Opaque handle for this registration. Pass to releaseInterest to release. Each call to registerInterest produces a fresh handle, even when the same eventType is registered multiple times. - pub handle: String, +pub struct QueueEnqueueResumePendingResult { + /// True when a wake item was newly queued. + pub queued: bool, } -/// Optional registration options. +/// Inputs for completing a deferred-idle drain. /// ///
/// @@ -10336,14 +11095,14 @@ pub struct RegisterEventInterestResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionsRegisterExtensionToolsOnSessionOptions { - /// In-process `() => boolean` gating callback (CLI-only optimization). Marked internal: replaced by runtime-side enable/disable RPCs in the SDK migration. - #[doc(hidden)] - #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) enabled: Option, +pub struct QueueFinishDeferredIdleDrainRequest { + /// Whether the host still has active background work. + pub active_background_work: bool, + /// Whether native queued work remains. + pub has_pending: bool, } -/// Params to attach an extension loader's tools to a session. +/// Action selected by the native deferred-idle drain. /// ///
/// @@ -10353,18 +11112,14 @@ pub struct SessionsRegisterExtensionToolsOnSessionOptions { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub(crate) struct RegisterExtensionToolsParams { - /// 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. - #[doc(hidden)] - pub(crate) loader: serde_json::Value, - /// Optional registration options. - #[serde(skip_serializing_if = "Option::is_none")] - pub options: Option, - /// Session to register extension tools on. - pub session_id: SessionId, +pub struct QueueFinishDeferredIdleDrainResult { + /// Whether the deferred idle was caused by an aborted foreground turn. + pub aborted: bool, + /// One of none, processQueue, or emitSessionIdle. + pub action: String, } -/// Handle for releasing the extension tool registration. +/// Whether the native queue has pending work. /// ///
/// @@ -10374,13 +11129,12 @@ pub(crate) struct RegisterExtensionToolsParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub(crate) struct RegisterExtensionToolsResult { - /// In-process unsubscribe function (CLI-only optimization). Marked internal: replaced by an explicit `extensions.unregister` RPC in the SDK migration. - #[doc(hidden)] - pub(crate) unsubscribe: serde_json::Value, +pub struct QueueHasPendingResult { + /// True when queued or immediate native work is pending. + pub has_pending: bool, } -/// Opaque handle previously returned by `registerInterest` to release. +/// User-facing pending queue entry, with kind and display text for a queued message, slash command, or model change. /// ///
/// @@ -10390,11 +11144,167 @@ pub(crate) struct RegisterExtensionToolsResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct ReleaseEventInterestParams { - /// Handle returned by a previous `registerInterest` call. Idempotent: releasing an unknown or already-released handle is a no-op (returns success). When the last outstanding handle for an event type is released, the runtime reverts to its 'no consumer' code path for that event type. - pub handle: String, -} - +pub struct QueuePendingItems { + /// Human-readable text to display for this queue entry in the UI + pub display_text: String, + /// Whether this item is a queued user message or a queued slash command / model change + pub kind: QueuePendingItemsKind, +} + +/// Snapshot of the session's pending queued items and immediate-steering messages. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct QueuePendingItemsResult { + /// Pending queued items in submission order. Includes user messages, queued slash commands, and queued model changes; omits internal system items. + pub items: Vec, + /// Display text for messages currently in the immediate steering queue (interjections sent during a running turn). + pub steering_messages: Vec, +} + +/// Indicates whether a user-facing pending item was removed. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct QueueRemoveMostRecentResult { + /// True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. + pub removed: bool, +} + +/// Internal snapshot of native queue state for local session orchestration. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct QueueSnapshotResult { + /// Insertion orders for queued items, aligned with `items`. + #[serde(skip_serializing_if = "Option::is_none")] + pub item_orders: Option>, + /// User-facing pending items in FIFO order. + pub items: Vec, + /// Insertion orders for immediate steering messages, aligned with `steeringMessages`. + #[serde(skip_serializing_if = "Option::is_none")] + pub steering_message_orders: Option>, + /// Immediate steering messages waiting for an active turn. + pub steering_messages: Vec, +} + +/// Event type to register consumer interest for, used by runtime gating logic. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RegisterEventInterestParams { + /// The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates interactive OAuth token acquisition to the consumer via `mcp.oauth_required` events; when no interest is registered the runtime still attempts non-interactive reconnect from cached or refreshable tokens, and only marks the server `needs-auth` if usable credentials are unavailable — it does not open a browser or start interactive OAuth without a consumer). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. + pub event_type: String, +} + +/// Opaque handle representing an event-type interest registration. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RegisterEventInterestResult { + /// Opaque handle for this registration. Pass to releaseInterest to release. Each call to registerInterest produces a fresh handle, even when the same eventType is registered multiple times. + pub handle: String, +} + +/// Optional registration options. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionsRegisterExtensionToolsOnSessionOptions { + /// In-process `() => boolean` gating callback (CLI-only optimization). Marked internal: replaced by runtime-side enable/disable RPCs in the SDK migration. + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) enabled: Option, +} + +/// Params to attach an extension loader's tools to a session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub(crate) struct RegisterExtensionToolsParams { + /// 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. + #[doc(hidden)] + pub(crate) loader: serde_json::Value, + /// Optional registration options. + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option, + /// Session to register extension tools on. + pub session_id: SessionId, +} + +/// Handle for releasing the extension tool registration. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub(crate) struct RegisterExtensionToolsResult { + /// In-process unsubscribe function (CLI-only optimization). Marked internal: replaced by an explicit `extensions.unregister` RPC in the SDK migration. + #[doc(hidden)] + pub(crate) unsubscribe: serde_json::Value, +} + +/// Opaque handle previously returned by `registerInterest` to release. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ReleaseEventInterestParams { + /// Handle returned by a previous `registerInterest` call. Idempotent: releasing an unknown or already-released handle is a no-op (returns success). When the last outstanding handle for an event type is released, the runtime reverts to its 'no consumer' code path for that event type. + pub handle: String, +} + /// Reattach to an existing MC session without creating a new one. /// ///
@@ -10880,6 +11790,78 @@ pub struct SandboxConfig { pub user_policy: Option, } +/// Register an absolute-time scheduled prompt. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ScheduleAddAtRequest { + /// Epoch milliseconds when the prompt should fire. + pub at: i64, + /// Optional display-only prompt label. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_prompt: Option, + /// Prompt text to enqueue when the schedule fires. + pub prompt: String, + /// Whether the schedule should re-arm after each tick. Defaults to false. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, +} + +/// Register a cron scheduled prompt. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ScheduleAddCronRequest { + /// 5-field cron expression. + pub cron: String, + /// Optional display-only prompt label. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_prompt: Option, + /// Prompt text to enqueue when the schedule fires. + pub prompt: String, + /// Whether the schedule should re-arm after each tick. Defaults to true. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// IANA timezone for evaluating the cron expression. + #[serde(skip_serializing_if = "Option::is_none")] + pub tz: Option, +} + +/// Register a relative-interval scheduled prompt. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ScheduleAddRequest { + /// Optional display-only prompt label. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_prompt: Option, + /// Human-readable interval such as `30s`, `5m`, or `2h`. + pub interval: String, + /// Prompt text to enqueue when the schedule fires. + pub prompt: String, + /// Whether the schedule should re-arm after each tick. Defaults to true. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, +} + /// Scheduled prompt entry with ID, timing (`intervalMs`, `cron`, or `at`), prompt text, recurrence, and next run time. /// ///
@@ -10919,6 +11901,58 @@ pub struct ScheduleEntry { pub tz: Option, } +/// Result of registering or re-arming a scheduled prompt. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ScheduleAddResult { + /// The registered or updated schedule entry. + #[serde(skip_serializing_if = "Option::is_none")] + pub entry: Option, + /// User-facing validation error, when registration failed. + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +/// Register a self-paced scheduled prompt. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ScheduleAddSelfPacedRequest { + /// Optional display-only prompt label. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_prompt: Option, + /// Prompt text to enqueue when the schedule fires. + pub prompt: String, +} + +/// Whether the session currently has an active self-paced schedule. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ScheduleHasSelfPacedResult { + /// True when at least one active schedule is self-paced. + pub has_self_paced: bool, +} + /// Snapshot of the currently active recurring prompts for this session. /// ///
@@ -10934,6 +11968,23 @@ pub struct ScheduleList { pub entries: Vec, } +/// Re-arm a self-paced scheduled prompt. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ScheduleRearmSelfPacedRequest { + /// Epoch milliseconds when the prompt should next fire. + pub at: i64, + /// Id of the self-paced scheduled prompt. + pub id: i64, +} + /// Identifier of the scheduled prompt to remove. /// ///
@@ -11039,7 +12090,7 @@ pub struct SendMessageItem { /// If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange #[serde(skip_serializing_if = "Option::is_none")] pub required_tool: Option, - /// 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. #[doc(hidden)] #[serde(skip_serializing_if = "Option::is_none")] pub(crate) source: Option, @@ -11133,7 +12184,7 @@ pub struct SendRequest { /// If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange #[serde(skip_serializing_if = "Option::is_none")] pub required_tool: Option, - /// 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. #[doc(hidden)] #[serde(skip_serializing_if = "Option::is_none")] pub(crate) source: Option, @@ -11163,7 +12214,7 @@ pub struct SendResult { pub message_id: String, } -/// Agents discovered across user, project, plugin, and remote sources. +/// Internal request for sending a system notification. /// ///
/// @@ -11173,9 +12224,30 @@ pub struct SendResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct ServerAgentList { - /// All discovered agents across all sources - pub agents: Vec, +pub struct SendSystemNotificationRequest { + /// Optional structured notification kind. + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option, + /// Notification text to deliver to the model. + pub message: String, + /// Internal delivery options, including passive policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option, +} + +/// Agents discovered across user, project, plugin, and remote sources. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ServerAgentList { + /// All discovered agents across all sources + pub agents: Vec, } /// Instruction sources discovered across user, repository, and plugin sources. @@ -11726,7 +12798,7 @@ pub struct SessionFsSqliteExistsResult { pub exists: bool, } -/// 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. /// ///
/// @@ -11773,6 +12845,73 @@ pub struct SessionFsSqliteQueryResult { pub rows_affected: i64, } +/// Classified SQLite transaction failure. busyOrLocked guarantees rollback; postCommitAmbiguous must never be retried. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFsSqliteTransactionError { + pub error_class: SessionFsSqliteTransactionErrorClass, + pub message: String, +} + +/// One statement in an atomic SQLite transaction. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFsSqliteTransactionStatement { + /// Optional named bind parameters. + #[serde(skip_serializing_if = "Option::is_none")] + pub params: Option>, + /// SQL statement to execute. + pub query: String, + /// How to execute the statement. + pub query_type: SessionFsSqliteQueryType, +} + +/// Statements to execute atomically. Providers apply busy handling for every call. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFsSqliteTransactionRequest { + /// Target session identifier + pub session_id: SessionId, + pub statements: Vec, +} + +/// Per-statement results, or a classified transaction error. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFsSqliteTransactionResult { + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + pub results: Vec, +} + /// Path whose metadata should be returned from the client-provided session filesystem. /// ///
@@ -11869,7 +13008,7 @@ pub struct SessionInstalledPlugin { pub version: Option, } -/// 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. /// ///
/// @@ -11885,6 +13024,9 @@ pub struct SessionInstalledPluginSourceGitHub { #[serde(skip_serializing_if = "Option::is_none")] pub r#ref: Option, pub repo: String, + /// Optional full 40-character hexadecimal commit SHA. + #[serde(skip_serializing_if = "Option::is_none")] + pub sha: Option, /// Constant value. Always "github". pub source: SessionInstalledPluginSourceGitHubSource, } @@ -11905,7 +13047,7 @@ pub struct SessionInstalledPluginSourceLocal { pub source: SessionInstalledPluginSourceLocalSource, } -/// 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. /// ///
/// @@ -11920,6 +13062,9 @@ pub struct SessionInstalledPluginSourceUrl { pub path: Option, #[serde(skip_serializing_if = "Option::is_none")] pub r#ref: Option, + /// Optional full 40-character hexadecimal commit SHA. + #[serde(skip_serializing_if = "Option::is_none")] + pub sha: Option, /// Constant value. Always "url". pub source: SessionInstalledPluginSourceUrlSource, pub url: String, @@ -12154,6 +13299,55 @@ pub struct SessionOpenOptionsAdditionalContentExclusionPolicy { pub scope: SessionOpenOptionsAdditionalContentExclusionPolicyScope, } +/// A host-provided script sourced before each built-in shell command when its shell target matches the active shell. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ShellInitScript { + /// Path to the script to source. + pub path: String, + /// Built-in shell that may source this script. + pub shell: ShellInitScriptShell, +} + +/// Per-session settings for built-in shell tools. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ShellOptions { + /// Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected. + #[serde(skip_serializing_if = "Option::is_none")] + pub init_profile: Option, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub init_scripts: Option>, + /// 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`. + #[serde(skip_serializing_if = "Option::is_none")] + pub process_flags: Option>, +} + /// Session construction options. /// ///
@@ -12237,6 +13431,9 @@ pub struct SessionOpenOptions { ///
#[serde(skip_serializing_if = "Option::is_none")] pub enable_citations: Option, + /// Opt in to capturing file changes for session rewind and session diff. Capture cannot reconstruct changes made before it was enabled. On create it starts capture from the first turn. It is also honored on resume: for a session that already has tracked prior turns, tracking continues automatically even if this is omitted; passing it on resume additionally enables tracking for an eligible session that has no prior root turn yet. Resuming a session whose prior root turns were never tracked has no restorable baseline, so tracking stays disabled for it and rewind reports file change tracking as unavailable; the resume itself still succeeds, so sessions that predate tracking remain loadable. The opt-in is only rejected when the session can never track (a subagent session, or one without local session storage). It is intentionally absent from the mutable options update because enabling it after edits have occurred would create an incomplete, misleading baseline. Subagents share the parent session's capture store and are not tracked as separate rewind points: a file a subagent writes is attributed to whichever root user turn was open when the capture was staged, just before the tool body ran. A turn cannot open while a staged capture is still in flight, so a subagent tool that staged under the spawning turn stays attributed to it however late the write lands, while a capture it stages after the user's next message belongs to that later turn. Attribution decides which turn's rewind point counts and file preview include that write; it does not narrow which rewinds revert it, because a rewind restores every capture from the selected turn onward, so the earlier spawning turn reverts it as well. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_file_change_tracking: Option, /// Opt-in: self-fetch and enforce enterprise managed settings at session bootstrap. #[serde(skip_serializing_if = "Option::is_none")] pub enable_managed_settings: Option, @@ -12255,6 +13452,9 @@ pub struct SessionOpenOptions { /// Override directory for session event logs. #[serde(skip_serializing_if = "Option::is_none")] pub events_log_directory: Option, + /// Whether subagent callback events should be forwarded into the session event log sink. + #[serde(skip_serializing_if = "Option::is_none")] + pub events_log_includes_subagents: Option, /// 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. #[serde(skip_serializing_if = "Option::is_none")] pub excluded_builtin_agents: Option>, @@ -12354,10 +13554,15 @@ pub struct SessionOpenOptions { /// Initial session limits. #[serde(skip_serializing_if = "Option::is_none")] pub session_limits: Option, - /// Shell init profile. + /// Per-session settings for built-in shell tools. + #[serde(skip_serializing_if = "Option::is_none")] + pub shell: Option, + /// Use shell.initProfile instead. Shell init profile. + #[doc(hidden)] + #[deprecated] #[serde(skip_serializing_if = "Option::is_none")] pub shell_init_profile: Option, - /// Per-shell process flags. + /// PowerShell process flags applied to built-in and user-requested shell commands. #[serde(skip_serializing_if = "Option::is_none")] pub shell_process_flags: Option>, /// Additional directories to search for skills. @@ -12699,6 +13904,24 @@ pub struct SessionsCloseRequest { #[serde(rename_all = "camelCase")] pub struct SessionsCloseResult {} +/// Session ID to delete from disk. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionsDeleteRequest { + /// Session ID to delete + pub session_id: SessionId, + /// Internal resolved session directory path to delete + #[serde(skip_serializing_if = "Option::is_none")] + pub session_path: Option, +} + /// Session metadata records to enrich with summary and context information. /// ///
@@ -13142,6 +14365,37 @@ pub struct SessionsGetLastForContextResult { pub session_id: Option, } +/// Session ID whose persisted metadata should be read. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionsGetMetadataRequest { + /// Session ID to inspect + pub session_id: SessionId, +} + +/// Persisted local session metadata when the session exists. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionsGetMetadataResult { + /// Local session metadata, omitted when the session does not exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option, +} + /// Session ID to look up the persisted remote-steerable flag for. /// ///
@@ -13188,6 +14442,37 @@ pub struct SessionSizes { pub sizes: HashMap, } +/// Limit for non-empty local session IDs. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionsListNonEmptySessionIdsRequest { + /// Maximum number of session IDs to return. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, +} + +/// Recent local session IDs that contain user-visible history. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionsListNonEmptySessionIdsResult { + /// Session IDs ordered newest-first. + pub session_ids: Vec, +} + /// Optional source filter, metadata-load limit, and context filter applied to the returned sessions. /// ///
@@ -13518,7 +14803,7 @@ pub struct SessionUpdateOptionsParams { /// Whether to enable host git operations (context resolution, child repo scanning, git info in system prompt). #[serde(skip_serializing_if = "Option::is_none")] pub enable_host_git_operations: Option, - /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag. + /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`. #[serde(skip_serializing_if = "Option::is_none")] pub enable_on_demand_instruction_discovery: Option, /// Whether to surface reasoning-summary events from the model. @@ -13542,6 +14827,9 @@ pub struct SessionUpdateOptionsParams { /// Override directory for the session-events log. When unset, the runtime's default events log directory is used. #[serde(skip_serializing_if = "Option::is_none")] pub events_log_directory: Option, + /// Whether subagent callback events should be forwarded into the session event log sink. + #[serde(skip_serializing_if = "Option::is_none")] + pub events_log_includes_subagents: Option, /// 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. #[serde(skip_serializing_if = "Option::is_none")] pub excluded_builtin_agents: Option>, @@ -13605,10 +14893,15 @@ pub struct SessionUpdateOptionsParams { /// Optional session limits. Pass null to clear the session limits. #[serde(skip_serializing_if = "Option::is_none")] pub session_limits: Option, - /// Shell init profile (`None` or `NonInteractive`). + /// Per-session settings for built-in shell tools. + #[serde(skip_serializing_if = "Option::is_none")] + pub shell: Option, + /// Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`). + #[doc(hidden)] + #[deprecated] #[serde(skip_serializing_if = "Option::is_none")] pub shell_init_profile: Option, - /// Per-shell process flags (e.g., `pwsh` arguments). + /// PowerShell process flags applied to built-in and user-requested shell commands. #[serde(skip_serializing_if = "Option::is_none")] pub shell_process_flags: Option>, /// Additional directories to search for skills. @@ -15126,6 +16419,9 @@ pub struct UIExitPlanModeResponse { /// Whether subsequent edits should be auto-approved without confirmation. #[serde(skip_serializing_if = "Option::is_none")] pub auto_approve_edits: Option, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub defer_implementation: Option, /// Feedback from the user when they declined the plan or requested changes. #[serde(skip_serializing_if = "Option::is_none")] pub feedback: Option, @@ -15725,7 +17021,7 @@ pub struct WorkspaceDiffFileChange { /// Original file path for renamed files. #[serde(skip_serializing_if = "Option::is_none")] pub old_path: Option, - /// Path to the changed file, relative to the workspace root. + /// Path to the changed file, relative to the workspace root when the file lives under it. A file changed outside the workspace root keeps a `../`-relative path, or an absolute path when no relative path exists (for example a different Windows drive). pub path: String, } @@ -15745,12 +17041,64 @@ pub struct WorkspaceDiffResult { pub base_branch: Option, /// Changed files and their unified diffs. pub changes: Vec, - /// Whether a requested branch diff fell back to unstaged changes because branch diff failed. + /// Whether the requested diff fell back to unstaged changes, either because branch diff failed or session diff was unavailable. pub is_fallback: bool, /// Effective mode used for the returned changes. pub mode: WorkspaceDiffMode, /// Diff mode requested by the client. pub requested_mode: WorkspaceDiffMode, + /// Why the session diff could not be produced, when applicable. Set only when `session` mode was requested and `isFallback` is true, so a client can tell the permanent `file-change-tracking-disabled` apart from the transient `session-busy`, which the same request answers once the session settles. Never set for `unstaged` or `branch` mode, and never `unsupported-remote-session`: a remote session's captures live on its own host, so a `session`-mode diff is rejected for one rather than answered with a controller-side fallback. + #[serde(skip_serializing_if = "Option::is_none")] + pub unavailable_reason: Option, +} + +/// Compaction summary checkpoint to persist. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WorkspacesAddSummaryRequest { + /// Markdown summary content to persist. + pub content: String, + /// Summary title shown in checkpoint listings. + pub title: String, +} + +/// Persisted summary metadata and refreshed workspace metadata. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WorkspacesAddSummaryResult { + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub workspace: Option, +} + +/// Whether the autopilot objective file exists. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WorkspacesAutopilotObjectiveExistsResult { + /// True when the objective file exists. + pub exists: bool, } /// Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename. @@ -15789,6 +17137,21 @@ pub struct WorkspacesCreateFileRequest { pub path: String, } +/// Result of deleting the autopilot objective file. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WorkspacesDeleteAutopilotObjectiveResult { + /// True when a file was deleted. + pub deleted: bool, +} + /// Parameters for computing a workspace diff. /// ///
@@ -15807,6 +17170,22 @@ pub struct WorkspacesDiffRequest { pub mode: WorkspaceDiffMode, } +/// Optional session context used when creating a local workspace. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WorkspacesEnsureRequest { + /// Opaque workspace context supplied by the session host. + #[serde(skip_serializing_if = "Option::is_none")] + pub context: Option, +} + #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct WorkspacesGetWorkspaceResultWorkspace { @@ -15897,6 +17276,21 @@ pub struct WorkspacesListFilesResult { pub files: Vec, } +/// Autopilot objective file content, or null when missing. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WorkspacesReadAutopilotObjectiveResult { + /// Autopilot objective file content, or null when missing. + pub content: Option, +} + /// Checkpoint number to read. /// ///
@@ -15998,6 +17392,21 @@ pub struct WorkspacesSaveLargePasteResult { pub saved: Option, } +/// Rollback point for local workspace summaries. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WorkspacesTruncateSummariesRequest { + /// Number of newest summaries to keep. + pub keep_count: i64, +} + /// Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags). /// ///
@@ -16040,7 +17449,56 @@ pub struct WorkspaceSummary { pub user_named: Option, } -/// List of Copilot models available to the resolved user, including capabilities and billing metadata. +/// Workspace metadata fields to update. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WorkspacesUpdateMetadataRequest { + /// Opaque workspace context supplied by the session host. + #[serde(skip_serializing_if = "Option::is_none")] + pub context: Option, + /// Optional workspace display name override. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +/// Autopilot objective file content to persist. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WorkspacesWriteAutopilotObjectiveRequest { + /// Autopilot objective file content. + pub content: String, +} + +/// Result of writing the autopilot objective file. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WorkspacesWriteAutopilotObjectiveResult { + /// Filesystem operation performed. + pub operation: String, +} + +/// List of Copilot models available to the resolved user, including capabilities and billing metadata. /// ///
/// @@ -16055,6 +17513,21 @@ pub struct ModelsListResult { pub models: Vec, } +/// The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ModelsGetBuiltInCatalogResult { + /// Built-in model entries. + pub models: Vec, +} + /// Built-in tools available for the requested model, with their parameters and instructions. /// ///
@@ -16670,6 +18143,36 @@ pub struct SessionAbortResult { pub success: bool, } +/// Result of interrupting the main agent turn. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionInterruptMainTurnResult { + /// Whether an in-flight main agent turn was interrupted. False when the main loop was not processing. + pub interrupted: bool, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionCancelAllBackgroundAgentsParams { + /// Target session identifier + pub session_id: SessionId, +} + /// Identifies the target session. /// ///
@@ -16900,6 +18403,23 @@ pub struct SessionFactoryRunResult { pub status: FactoryRunStatus, } +/// Resolved persisted factory identity and resumed run envelope. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFactoryResumeResult { + /// Persisted factory name resolved for the resumed run. + pub factory_name: String, + /// Terminal resumed run envelope. + pub run: FactoryRunResult, +} + /// Complete current or terminal factory run envelope. /// ///
@@ -16932,6 +18452,75 @@ pub struct SessionFactoryGetRunResult { pub status: FactoryRunStatus, } +/// Factory runs in durable creation order. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFactoryListRunsResult { + pub runs: Vec, +} + +/// Full factory run observability detail. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFactoryGetRunDetailResult { + pub active_segment_started_at: Option, + pub agents: Vec, + pub approved: Option, + pub completed_at: Option, + pub consumed: FactoryRunConsumed, + pub created_at: i64, + pub current_phase: Option, + pub declared_limits: FactoryDeclaredLimits, + pub declared_phase_count: i64, + pub description: String, + pub factory_name: String, + pub live_agent_count: i64, + pub observed_at: i64, + pub phases: Vec, + pub progress: FactoryProgressPage, + pub revision: i64, + pub run_id: String, + pub started_at: Option, + pub status: FactoryRunStatus, + pub terminal: Option, + pub total_spawned_agent_count: i64, + pub updated_at: i64, +} + +/// A bidirectional page of factory progress. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFactoryGetRunProgressResult { + pub has_more_newer: bool, + pub has_more_older: bool, + pub newest_seq: Option, + pub oldest_seq: Option, + pub records: Vec, + /// Run revision reflected by this page. + pub revision: i64, +} + /// Complete current or terminal factory run envelope. /// ///
@@ -17075,7 +18664,271 @@ pub struct SessionModelSwitchToResult { pub model_id: Option, } -/// Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns. +/// Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionModelSetReasoningEffortResult { + /// Reasoning effort level recorded on the session after the update + pub reasoning_effort: String, +} + +/// The list of models available to this session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionModelListResult { + /// 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`). + pub list: Vec, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_price_categories: Option>, + /// Per-quota snapshots returned alongside the model list, keyed by quota type. + #[serde(skip_serializing_if = "Option::is_none")] + pub quota_snapshots: Option>, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionModeGetParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionNameGetParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// The session's friendly name, or null when not yet set. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionNameGetResult { + /// The session name (user-set or auto-generated), or null if not yet set + pub name: Option, +} + +/// Indicates whether the auto-generated summary was applied as the session's name. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionNameSetAutoResult { + /// Whether the auto-generated summary was persisted. False if the session already has a user-set name, the summary normalized to empty, or the session does not have a workspace. + pub applied: bool, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionPlanReadParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Existence, contents, and resolved path of the session plan file. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionPlanReadResult { + /// The content of the plan file, or null if it does not exist + pub content: Option, + /// Whether the plan file exists in the workspace + pub exists: bool, + /// Absolute file path of the plan file, or null if workspace is not enabled + pub path: Option, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionPlanDeleteParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionPlanReadSqlTodosParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Todo rows read from the session SQL database. Empty when no session database is available. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionPlanReadSqlTodosResult { + /// Rows from the session SQL todos table, ordered by creation time and id. + pub rows: Vec, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionPlanReadSqlTodosWithDependenciesParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Todo rows + dependency edges read from the session SQL database. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionPlanReadSqlTodosWithDependenciesResult { + /// Edges from the session SQL todo_deps table. Empty when no database, no todo_deps table, or the SELECT failed. Read independently from `rows`, so a broken todo_deps table does not affect the rows result and vice versa. + pub dependencies: Vec, + /// Rows from the session SQL todos table, ordered by creation time and id. Empty when no database, no todos table, or the SELECT failed. + pub rows: Vec, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionWorkspacesGetWorkspaceParams { + /// Target session identifier + pub session_id: SessionId, +} + +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionWorkspacesGetWorkspaceResultWorkspace { + #[serde(skip_serializing_if = "Option::is_none")] + pub branch: Option, + #[serde( + rename = "chronicle_sync_dismissed", + skip_serializing_if = "Option::is_none" + )] + pub chronicle_sync_dismissed: Option, + #[serde(rename = "client_name", skip_serializing_if = "Option::is_none")] + pub client_name: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cwd: Option, + #[serde(rename = "git_root", skip_serializing_if = "Option::is_none")] + pub git_root: Option, + /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. + #[serde(rename = "host_type", skip_serializing_if = "Option::is_none")] + pub host_type: Option, + pub id: String, + #[serde(rename = "mc_last_event_id", skip_serializing_if = "Option::is_none")] + pub mc_last_event_id: Option, + #[serde(rename = "mc_session_id", skip_serializing_if = "Option::is_none")] + pub mc_session_id: Option, + #[serde(rename = "mc_task_id", skip_serializing_if = "Option::is_none")] + pub mc_task_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "remote_steerable", skip_serializing_if = "Option::is_none")] + pub remote_steerable: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub repository: Option, + #[serde(rename = "summary_count", skip_serializing_if = "Option::is_none")] + pub summary_count: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "user_named", skip_serializing_if = "Option::is_none")] + pub user_named: Option, +} + +/// Current workspace metadata for the session, including its absolute filesystem path when available. /// ///
/// @@ -17085,48 +18938,57 @@ pub struct SessionModelSwitchToResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionModelSetReasoningEffortResult { - /// Reasoning effort level recorded on the session after the update - pub reasoning_effort: String, +pub struct SessionWorkspacesGetWorkspaceResult { + /// Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). + #[serde(skip_serializing_if = "Option::is_none")] + pub path: Option, + /// Current workspace metadata, or null if not available + pub workspace: Option, } -/// The list of models available to this session. -/// -///
-/// -/// **Experimental.** This type is part of an experimental wire-protocol surface -/// and may change or be removed in future SDK or CLI releases. -/// -///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionModelListResult { - /// 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`). - pub list: Vec, - /// 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. +pub struct SessionWorkspacesUpdateMetadataResultWorkspace { #[serde(skip_serializing_if = "Option::is_none")] - pub model_price_categories: Option>, - /// Per-quota snapshots returned alongside the model list, keyed by quota type. + pub branch: Option, + #[serde( + rename = "chronicle_sync_dismissed", + skip_serializing_if = "Option::is_none" + )] + pub chronicle_sync_dismissed: Option, + #[serde(rename = "client_name", skip_serializing_if = "Option::is_none")] + pub client_name: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub quota_snapshots: Option>, -} - -/// Identifies the target session. -/// -///
-/// -/// **Experimental.** This type is part of an experimental wire-protocol surface -/// and may change or be removed in future SDK or CLI releases. -/// -///
-#[derive(Debug, Clone, Default, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct SessionModeGetParams { - /// Target session identifier - pub session_id: SessionId, + pub cwd: Option, + #[serde(rename = "git_root", skip_serializing_if = "Option::is_none")] + pub git_root: Option, + /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. + #[serde(rename = "host_type", skip_serializing_if = "Option::is_none")] + pub host_type: Option, + pub id: String, + #[serde(rename = "mc_last_event_id", skip_serializing_if = "Option::is_none")] + pub mc_last_event_id: Option, + #[serde(rename = "mc_session_id", skip_serializing_if = "Option::is_none")] + pub mc_session_id: Option, + #[serde(rename = "mc_task_id", skip_serializing_if = "Option::is_none")] + pub mc_task_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "remote_steerable", skip_serializing_if = "Option::is_none")] + pub remote_steerable: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub repository: Option, + #[serde(rename = "summary_count", skip_serializing_if = "Option::is_none")] + pub summary_count: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "user_named", skip_serializing_if = "Option::is_none")] + pub user_named: Option, } -/// Identifies the target session. +/// Current workspace metadata for the session, including its absolute filesystem path when available. /// ///
/// @@ -17136,27 +18998,57 @@ pub struct SessionModeGetParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionNameGetParams { - /// Target session identifier - pub session_id: SessionId, +pub struct SessionWorkspacesUpdateMetadataResult { + /// Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). + #[serde(skip_serializing_if = "Option::is_none")] + pub path: Option, + /// Current workspace metadata, or null if not available + pub workspace: Option, } -/// The session's friendly name, or null when not yet set. -/// -///
-/// -/// **Experimental.** This type is part of an experimental wire-protocol surface -/// and may change or be removed in future SDK or CLI releases. -/// -///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionNameGetResult { - /// The session name (user-set or auto-generated), or null if not yet set +pub struct SessionWorkspacesEnsureResultWorkspace { + #[serde(skip_serializing_if = "Option::is_none")] + pub branch: Option, + #[serde( + rename = "chronicle_sync_dismissed", + skip_serializing_if = "Option::is_none" + )] + pub chronicle_sync_dismissed: Option, + #[serde(rename = "client_name", skip_serializing_if = "Option::is_none")] + pub client_name: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cwd: Option, + #[serde(rename = "git_root", skip_serializing_if = "Option::is_none")] + pub git_root: Option, + /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. + #[serde(rename = "host_type", skip_serializing_if = "Option::is_none")] + pub host_type: Option, + pub id: String, + #[serde(rename = "mc_last_event_id", skip_serializing_if = "Option::is_none")] + pub mc_last_event_id: Option, + #[serde(rename = "mc_session_id", skip_serializing_if = "Option::is_none")] + pub mc_session_id: Option, + #[serde(rename = "mc_task_id", skip_serializing_if = "Option::is_none")] + pub mc_task_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, + #[serde(rename = "remote_steerable", skip_serializing_if = "Option::is_none")] + pub remote_steerable: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub repository: Option, + #[serde(rename = "summary_count", skip_serializing_if = "Option::is_none")] + pub summary_count: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "user_named", skip_serializing_if = "Option::is_none")] + pub user_named: Option, } -/// Indicates whether the auto-generated summary was applied as the session's name. +/// Current workspace metadata for the session, including its absolute filesystem path when available. /// ///
/// @@ -17166,9 +19058,12 @@ pub struct SessionNameGetResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionNameSetAutoResult { - /// Whether the auto-generated summary was persisted. False if the session already has a user-set name, the summary normalized to empty, or the session does not have a workspace. - pub applied: bool, +pub struct SessionWorkspacesEnsureResult { + /// Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). + #[serde(skip_serializing_if = "Option::is_none")] + pub path: Option, + /// Current workspace metadata, or null if not available + pub workspace: Option, } /// Identifies the target session. @@ -17181,12 +19076,12 @@ pub struct SessionNameSetAutoResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionPlanReadParams { +pub struct SessionWorkspacesListFilesParams { /// Target session identifier pub session_id: SessionId, } -/// Existence, contents, and resolved path of the session plan file. +/// Relative paths of files stored in the session workspace files directory. /// ///
/// @@ -17196,16 +19091,12 @@ pub struct SessionPlanReadParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionPlanReadResult { - /// The content of the plan file, or null if it does not exist - pub content: Option, - /// Whether the plan file exists in the workspace - pub exists: bool, - /// Absolute file path of the plan file, or null if workspace is not enabled - pub path: Option, +pub struct SessionWorkspacesListFilesResult { + /// Relative file paths in the workspace files directory + pub files: Vec, } -/// Identifies the target session. +/// Contents of the requested workspace file as a UTF-8 string. /// ///
/// @@ -17215,9 +19106,9 @@ pub struct SessionPlanReadResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionPlanDeleteParams { - /// Target session identifier - pub session_id: SessionId, +pub struct SessionWorkspacesReadFileResult { + /// File content as a UTF-8 string + pub content: String, } /// Identifies the target session. @@ -17230,27 +19121,12 @@ pub struct SessionPlanDeleteParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionPlanReadSqlTodosParams { +pub struct SessionWorkspacesListCheckpointsParams { /// Target session identifier pub session_id: SessionId, } -/// Todo rows read from the session SQL database. Empty when no session database is available. -/// -///
-/// -/// **Experimental.** This type is part of an experimental wire-protocol surface -/// and may change or be removed in future SDK or CLI releases. -/// -///
-#[derive(Debug, Clone, Default, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct SessionPlanReadSqlTodosResult { - /// Rows from the session SQL todos table, ordered by creation time and id. - pub rows: Vec, -} - -/// Identifies the target session. +/// Workspace checkpoints in chronological order; empty when the workspace is not enabled. /// ///
/// @@ -17260,12 +19136,12 @@ pub struct SessionPlanReadSqlTodosResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionPlanReadSqlTodosWithDependenciesParams { - /// Target session identifier - pub session_id: SessionId, +pub struct SessionWorkspacesListCheckpointsResult { + /// Workspace checkpoints in chronological order. Empty when workspace is not enabled. + pub checkpoints: Vec, } -/// Todo rows + dependency edges read from the session SQL database. +/// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. /// ///
/// @@ -17275,14 +19151,12 @@ pub struct SessionPlanReadSqlTodosWithDependenciesParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionPlanReadSqlTodosWithDependenciesResult { - /// Edges from the session SQL todo_deps table. Empty when no database, no todo_deps table, or the SELECT failed. Read independently from `rows`, so a broken todo_deps table does not affect the rows result and vice versa. - pub dependencies: Vec, - /// Rows from the session SQL todos table, ordered by creation time and id. Empty when no database, no todos table, or the SELECT failed. - pub rows: Vec, +pub struct SessionWorkspacesReadCheckpointResult { + /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing + pub content: Option, } -/// Identifies the target session. +/// Persisted summary metadata and refreshed workspace metadata. /// ///
/// @@ -17292,14 +19166,16 @@ pub struct SessionPlanReadSqlTodosWithDependenciesResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionWorkspacesGetWorkspaceParams { - /// Target session identifier - pub session_id: SessionId, +pub struct SessionWorkspacesAddSummaryResult { + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub workspace: Option, } #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionWorkspacesGetWorkspaceResultWorkspace { +pub struct SessionWorkspacesTruncateSummariesResultWorkspace { #[serde(skip_serializing_if = "Option::is_none")] pub branch: Option, #[serde( @@ -17349,12 +19225,12 @@ pub struct SessionWorkspacesGetWorkspaceResultWorkspace { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionWorkspacesGetWorkspaceResult { +pub struct SessionWorkspacesTruncateSummariesResult { /// Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). #[serde(skip_serializing_if = "Option::is_none")] pub path: Option, /// Current workspace metadata, or null if not available - pub workspace: Option, + pub workspace: Option, } /// Identifies the target session. @@ -17367,12 +19243,12 @@ pub struct SessionWorkspacesGetWorkspaceResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionWorkspacesListFilesParams { +pub struct SessionWorkspacesReadAutopilotObjectiveParams { /// Target session identifier pub session_id: SessionId, } -/// Relative paths of files stored in the session workspace files directory. +/// Autopilot objective file content, or null when missing. /// ///
/// @@ -17382,12 +19258,12 @@ pub struct SessionWorkspacesListFilesParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionWorkspacesListFilesResult { - /// Relative file paths in the workspace files directory - pub files: Vec, +pub struct SessionWorkspacesReadAutopilotObjectiveResult { + /// Autopilot objective file content, or null when missing. + pub content: Option, } -/// Contents of the requested workspace file as a UTF-8 string. +/// Result of writing the autopilot objective file. /// ///
/// @@ -17397,9 +19273,9 @@ pub struct SessionWorkspacesListFilesResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionWorkspacesReadFileResult { - /// File content as a UTF-8 string - pub content: String, +pub struct SessionWorkspacesWriteAutopilotObjectiveResult { + /// Filesystem operation performed. + pub operation: String, } /// Identifies the target session. @@ -17412,12 +19288,12 @@ pub struct SessionWorkspacesReadFileResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionWorkspacesListCheckpointsParams { +pub struct SessionWorkspacesDeleteAutopilotObjectiveParams { /// Target session identifier pub session_id: SessionId, } -/// Workspace checkpoints in chronological order; empty when the workspace is not enabled. +/// Result of deleting the autopilot objective file. /// ///
/// @@ -17427,12 +19303,12 @@ pub struct SessionWorkspacesListCheckpointsParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionWorkspacesListCheckpointsResult { - /// Workspace checkpoints in chronological order. Empty when workspace is not enabled. - pub checkpoints: Vec, +pub struct SessionWorkspacesDeleteAutopilotObjectiveResult { + /// True when a file was deleted. + pub deleted: bool, } -/// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. +/// Identifies the target session. /// ///
/// @@ -17442,9 +19318,24 @@ pub struct SessionWorkspacesListCheckpointsResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionWorkspacesReadCheckpointResult { - /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing - pub content: Option, +pub struct SessionWorkspacesAutopilotObjectiveExistsParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Whether the autopilot objective file exists. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionWorkspacesAutopilotObjectiveExistsResult { + /// True when the objective file exists. + pub exists: bool, } #[derive(Debug, Clone, Default, Serialize, Deserialize)] @@ -17489,12 +19380,15 @@ pub struct SessionWorkspacesDiffResult { pub base_branch: Option, /// Changed files and their unified diffs. pub changes: Vec, - /// Whether a requested branch diff fell back to unstaged changes because branch diff failed. + /// Whether the requested diff fell back to unstaged changes, either because branch diff failed or session diff was unavailable. pub is_fallback: bool, /// Effective mode used for the returned changes. pub mode: WorkspaceDiffMode, /// Diff mode requested by the client. pub requested_mode: WorkspaceDiffMode, + /// Why the session diff could not be produced, when applicable. Set only when `session` mode was requested and `isFallback` is true, so a client can tell the permanent `file-change-tracking-disabled` apart from the transient `session-busy`, which the same request answers once the session settles. Never set for `unstaged` or `branch` mode, and never `unsupported-remote-session`: a remote session's captures live on its own host, so a `session`-mode diff is rejected for one rather than answered with a controller-side fallback. + #[serde(skip_serializing_if = "Option::is_none")] + pub unavailable_reason: Option, } /// Identifies the target session. @@ -18260,7 +20154,23 @@ pub struct SessionMcpOauthHandlePendingRequestResult { pub success: bool, } -/// OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server. +/// OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionMcpOauthLoginResult { + /// URL the caller should open in a browser to complete OAuth. Omitted when cached tokens were still valid and no browser interaction was needed — the server is already reconnected in that case. When present, the runtime starts the callback listener before returning and continues the flow in the background; completion is signaled via session.mcp_server_status_changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub authorization_url: Option, +} + +/// Indicates whether the pending MCP OAuth response was accepted. /// ///
/// @@ -18270,10 +20180,9 @@ pub struct SessionMcpOauthHandlePendingRequestResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionMcpOauthLoginResult { - /// URL the caller should open in a browser to complete OAuth. Omitted when cached tokens were still valid and no browser interaction was needed — the server is already reconnected in that case. When present, the runtime starts the callback listener before returning and continues the flow in the background; completion is signaled via session.mcp_server_status_changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub authorization_url: Option, +pub struct SessionMcpOauthRespondResult { + /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved. + pub success: bool, } /// Indicates whether the pending MCP headers refresh response was accepted. @@ -19612,12 +21521,298 @@ pub struct SessionMetadataRecomputeContextTokensResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionSettingsSnapshotParams { +pub struct SessionSettingsSnapshotParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Redacted, serializable view of session runtime settings for SDK boundary consumers. Secrets and raw feature flags are intentionally excluded. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionSettingsSnapshotResult { + #[serde(skip_serializing_if = "Option::is_none")] + pub client_name: Option, + pub job: SessionSettingsJobSnapshot, + pub model: SessionSettingsModelSnapshot, + pub online_evaluation: SessionSettingsOnlineEvaluationSnapshot, + pub repo: SessionSettingsRepoSnapshot, + #[serde(skip_serializing_if = "Option::is_none")] + pub start_time_ms: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub timeout_ms: Option, + pub validation: SessionSettingsValidationSnapshot, + #[serde(skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +/// Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionContentExclusionCheckPathsResult { + /// Whether the session's policy service was available for the complete batch. When false, checks is empty and callers must treat every requested path as excluded. + pub available: bool, + /// Per-path decisions in request order. Empty when available is false. + pub checks: Vec, +} + +/// Identifier of the spawned process, used to correlate streamed output and exit notifications. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionShellExecResult { + /// Unique identifier for tracking streamed output + pub process_id: String, +} + +/// Indicates whether the signal was delivered; false if the process was unknown or already exited. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionShellKillResult { + /// Whether the signal was sent successfully + pub killed: bool, +} + +/// Result of a user-requested shell command. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionShellExecuteUserRequestedResult { + /// Error output when the execution failed + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Process exit code, when available + #[serde(skip_serializing_if = "Option::is_none")] + pub exit_code: Option, + /// Captured command output + pub output: String, + /// Whether the command completed successfully + pub success: bool, + /// Tool call id emitted for the shell execution + pub tool_call_id: String, +} + +/// Cancellation result for a user-requested shell command. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionShellCancelUserRequestedResult { + /// Whether an in-flight execution was found and signalled to cancel + pub cancelled: bool, +} + +/// Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionHistoryCompactResult { + /// Post-compaction context window usage breakdown + #[serde(skip_serializing_if = "Option::is_none")] + pub context_window: Option, + /// Number of messages removed during compaction + pub messages_removed: i64, + /// Whether compaction completed successfully + pub success: bool, + /// Summary text produced by compaction. Omitted when compaction did not produce a summary (e.g. failure path). + #[serde(skip_serializing_if = "Option::is_none")] + pub summary_content: Option, + /// Number of tokens freed by compaction + pub tokens_removed: i64, +} + +/// Number of events that were removed by the truncation. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionHistoryTruncateResult { + /// Failure detail when checkpointCleanupFailed is true. + #[serde(skip_serializing_if = "Option::is_none")] + pub checkpoint_cleanup_error: Option, + /// True when conversation truncation succeeded but post-truncation workspace checkpoint cleanup failed. History is already truncated; callers may still prune snapshots but should report a checkpoint-cleanup rather than a truncation failure. + #[serde(skip_serializing_if = "Option::is_none")] + pub checkpoint_cleanup_failed: Option, + /// Number of events that were removed + pub events_removed: i64, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionHistoryListRewindPointsParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Rewind points and file-change-tracking availability for the session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionHistoryListRewindPointsResult { + /// Whether this session captured file changes from its first turn. + pub file_change_tracking_enabled: bool, + /// Root user turns in chronological order. Empty when `unavailableReason` is set. + pub points: Vec, + /// Why the listed points could not be produced, when applicable; the points list is empty whenever it is set. `unsupported-remote-session` is permanent for the session and comes with `fileChangeTrackingEnabled: false`. `session-busy` is transient and only ever reported by a session that *is* tracking (`fileChangeTrackingEnabled: true`), because the file-change captures cannot be read while work that may still mutate them is in flight; the same request succeeds once the session settles, so a client that wants points should retry rather than treat it as a failure. It is never `file-change-tracking-disabled`: an untracked local session still lists conversation-only points and reports that through `fileChangeTrackingEnabled: false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unavailable_reason: Option, +} + +/// Files and aggregate changes for a prospective rewind. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionHistoryPreviewRewindResult { + /// Whether file restore is available for this session. This is authoritative: switch on it and read `reason` only when it is false. + pub available: bool, + /// Number of unique files in the preview. + pub file_count: i64, + /// Files ordered by path. + pub files: Vec, + /// Why file restore is unavailable, when applicable. Populated only when `available` is false and never set when `available` is true. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, +} + +/// Structured outcome of a rewind request. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionHistoryRewindResult { + /// Failure detail. Set only for the failure and partial-failure outcomes (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`). + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Number of persisted events removed by conversation truncation. Present only when truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`) and for `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`. + #[serde(skip_serializing_if = "Option::is_none")] + pub events_removed: Option, + /// Overall rewind outcome. This discriminates the result: it governs which of the remaining fields are populated, so consumers must switch on it before reading `eventsRemoved`, `restoredFiles`, `skippedFiles`, or `error`. See each field for the outcomes that populate it. + pub outcome: HistoryRewindOutcome, + /// Absolute paths restored to their captured preimages. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. + pub restored_files: Vec, + /// Captured files intentionally left unchanged. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. + pub skipped_files: Vec, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionHistoryCancelBackgroundCompactionParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Indicates whether an in-progress background compaction was cancelled. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionHistoryCancelBackgroundCompactionResult { + /// Whether an in-progress background compaction was cancelled. False when no compaction was running, when the session is remote, or when the underlying processor was unavailable. + pub cancelled: bool, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionHistoryAbortManualCompactionParams { /// Target session identifier pub session_id: SessionId, } -/// Redacted, serializable view of session runtime settings for SDK boundary consumers. Secrets and raw feature flags are intentionally excluded. +/// Indicates whether an in-progress manual compaction was aborted. /// ///
/// @@ -19627,23 +21822,12 @@ pub struct SessionSettingsSnapshotParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionSettingsSnapshotResult { - #[serde(skip_serializing_if = "Option::is_none")] - pub client_name: Option, - pub job: SessionSettingsJobSnapshot, - pub model: SessionSettingsModelSnapshot, - pub online_evaluation: SessionSettingsOnlineEvaluationSnapshot, - pub repo: SessionSettingsRepoSnapshot, - #[serde(skip_serializing_if = "Option::is_none")] - pub start_time_ms: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub timeout_ms: Option, - pub validation: SessionSettingsValidationSnapshot, - #[serde(skip_serializing_if = "Option::is_none")] - pub version: Option, +pub struct SessionHistoryAbortManualCompactionResult { + /// Whether an in-progress manual compaction was aborted. False when no manual compaction was running, when its abort controller was already aborted, or when the session is remote. + pub aborted: bool, } -/// Identifier of the spawned process, used to correlate streamed output and exit notifications. +/// Identifies the target session. /// ///
/// @@ -19653,12 +21837,12 @@ pub struct SessionSettingsSnapshotResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionShellExecResult { - /// Unique identifier for tracking streamed output - pub process_id: String, +pub struct SessionHistorySummarizeForHandoffParams { + /// Target session identifier + pub session_id: SessionId, } -/// Indicates whether the signal was delivered; false if the process was unknown or already exited. +/// Markdown summary of the conversation context (empty when not available). /// ///
/// @@ -19668,12 +21852,12 @@ pub struct SessionShellExecResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionShellKillResult { - /// Whether the signal was sent successfully - pub killed: bool, +pub struct SessionHistorySummarizeForHandoffResult { + /// Markdown summary of the conversation context produced by an LLM. Empty string when there are no messages or when the session does not support local summarization. + pub summary: String, } -/// Result of a user-requested shell command. +/// Identifies the target session. /// ///
/// @@ -19683,22 +21867,12 @@ pub struct SessionShellKillResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionShellExecuteUserRequestedResult { - /// Error output when the execution failed - #[serde(skip_serializing_if = "Option::is_none")] - pub error: Option, - /// Process exit code, when available - #[serde(skip_serializing_if = "Option::is_none")] - pub exit_code: Option, - /// Captured command output - pub output: String, - /// Whether the command completed successfully - pub success: bool, - /// Tool call id emitted for the shell execution - pub tool_call_id: String, +pub struct SessionQueuePendingItemsParams { + /// Target session identifier + pub session_id: SessionId, } -/// Cancellation result for a user-requested shell command. +/// Snapshot of the session's pending queued items and immediate-steering messages. /// ///
/// @@ -19708,12 +21882,14 @@ pub struct SessionShellExecuteUserRequestedResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionShellCancelUserRequestedResult { - /// Whether an in-flight execution was found and signalled to cancel - pub cancelled: bool, +pub struct SessionQueuePendingItemsResult { + /// Pending queued items in submission order. Includes user messages, queued slash commands, and queued model changes; omits internal system items. + pub items: Vec, + /// Display text for messages currently in the immediate steering queue (interjections sent during a running turn). + pub steering_messages: Vec, } -/// Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown. +/// Identifies the target session. /// ///
/// @@ -19723,22 +21899,12 @@ pub struct SessionShellCancelUserRequestedResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionHistoryCompactResult { - /// Post-compaction context window usage breakdown - #[serde(skip_serializing_if = "Option::is_none")] - pub context_window: Option, - /// Number of messages removed during compaction - pub messages_removed: i64, - /// Whether compaction completed successfully - pub success: bool, - /// Summary text produced by compaction. Omitted when compaction did not produce a summary (e.g. failure path). - #[serde(skip_serializing_if = "Option::is_none")] - pub summary_content: Option, - /// Number of tokens freed by compaction - pub tokens_removed: i64, +pub struct SessionQueueSnapshotParams { + /// Target session identifier + pub session_id: SessionId, } -/// Number of events that were removed by the truncation. +/// Internal snapshot of native queue state for local session orchestration. /// ///
/// @@ -19748,9 +21914,17 @@ pub struct SessionHistoryCompactResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionHistoryTruncateResult { - /// Number of events that were removed - pub events_removed: i64, +pub struct SessionQueueSnapshotResult { + /// Insertion orders for queued items, aligned with `items`. + #[serde(skip_serializing_if = "Option::is_none")] + pub item_orders: Option>, + /// User-facing pending items in FIFO order. + pub items: Vec, + /// Insertion orders for immediate steering messages, aligned with `steeringMessages`. + #[serde(skip_serializing_if = "Option::is_none")] + pub steering_message_orders: Option>, + /// Immediate steering messages waiting for an active turn. + pub steering_messages: Vec, } /// Identifies the target session. @@ -19763,12 +21937,12 @@ pub struct SessionHistoryTruncateResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionHistoryCancelBackgroundCompactionParams { +pub struct SessionQueueHasPendingParams { /// Target session identifier pub session_id: SessionId, } -/// Indicates whether an in-progress background compaction was cancelled. +/// Whether the native queue has pending work. /// ///
/// @@ -19778,12 +21952,12 @@ pub struct SessionHistoryCancelBackgroundCompactionParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionHistoryCancelBackgroundCompactionResult { - /// Whether an in-progress background compaction was cancelled. False when no compaction was running, when the session is remote, or when the underlying processor was unavailable. - pub cancelled: bool, +pub struct SessionQueueHasPendingResult { + /// True when queued or immediate native work is pending. + pub has_pending: bool, } -/// Identifies the target session. +/// Whether a deferred-idle drain should run. /// ///
/// @@ -19793,12 +21967,12 @@ pub struct SessionHistoryCancelBackgroundCompactionResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionHistoryAbortManualCompactionParams { - /// Target session identifier - pub session_id: SessionId, +pub struct SessionQueueBeginDeferredIdleDrainResult { + /// True when the host should run finishDeferredIdleDrain asynchronously. + pub should_drain: bool, } -/// Indicates whether an in-progress manual compaction was aborted. +/// Action selected by the native deferred-idle drain. /// ///
/// @@ -19808,9 +21982,11 @@ pub struct SessionHistoryAbortManualCompactionParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionHistoryAbortManualCompactionResult { - /// Whether an in-progress manual compaction was aborted. False when no manual compaction was running, when its abort controller was already aborted, or when the session is remote. +pub struct SessionQueueFinishDeferredIdleDrainResult { + /// Whether the deferred idle was caused by an aborted foreground turn. pub aborted: bool, + /// One of none, processQueue, or emitSessionIdle. + pub action: String, } /// Identifies the target session. @@ -19823,12 +21999,12 @@ pub struct SessionHistoryAbortManualCompactionResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionHistorySummarizeForHandoffParams { +pub struct SessionQueueRemoveMostRecentParams { /// Target session identifier pub session_id: SessionId, } -/// Markdown summary of the conversation context (empty when not available). +/// Indicates whether a user-facing pending item was removed. /// ///
/// @@ -19838,9 +22014,9 @@ pub struct SessionHistorySummarizeForHandoffParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionHistorySummarizeForHandoffResult { - /// Markdown summary of the conversation context produced by an LLM. Empty string when there are no messages or when the session does not support local summarization. - pub summary: String, +pub struct SessionQueueRemoveMostRecentResult { + /// True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. + pub removed: bool, } /// Identifies the target session. @@ -19853,12 +22029,12 @@ pub struct SessionHistorySummarizeForHandoffResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionQueuePendingItemsParams { +pub struct SessionQueueClearParams { /// Target session identifier pub session_id: SessionId, } -/// Snapshot of the session's pending queued items and immediate-steering messages. +/// Indicates whether a user-facing pending item was removed. /// ///
/// @@ -19868,11 +22044,9 @@ pub struct SessionQueuePendingItemsParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionQueuePendingItemsResult { - /// Pending queued items in submission order. Includes user messages, queued slash commands, and queued model changes; omits internal system items. - pub items: Vec, - /// Display text for messages currently in the immediate steering queue (interjections sent during a running turn). - pub steering_messages: Vec, +pub struct SessionQueueConsumeSystemNotificationsResult { + /// True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. + pub removed: bool, } /// Identifies the target session. @@ -19885,12 +22059,12 @@ pub struct SessionQueuePendingItemsResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionQueueRemoveMostRecentParams { +pub struct SessionQueueEnqueueResumePendingParams { /// Target session identifier pub session_id: SessionId, } -/// Indicates whether a user-facing pending item was removed. +/// Result of enqueueing the resume-pending wake item. /// ///
/// @@ -19900,9 +22074,9 @@ pub struct SessionQueueRemoveMostRecentParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionQueueRemoveMostRecentResult { - /// True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. - pub removed: bool, +pub struct SessionQueueEnqueueResumePendingResult { + /// True when a wake item was newly queued. + pub queued: bool, } /// Identifies the target session. @@ -19915,7 +22089,7 @@ pub struct SessionQueueRemoveMostRecentResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionQueueClearParams { +pub struct SessionQueueProcessParams { /// Target session identifier pub session_id: SessionId, } @@ -20082,12 +22256,141 @@ pub struct SessionRemoteEnableResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionRemoteDisableParams { +pub struct SessionRemoteDisableParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionRemoteNotifySteerableChangedResult {} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionVisibilityGetParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Current sharing status and shareable GitHub URL for a session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionVisibilityGetResult { + /// Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved. + #[serde(skip_serializing_if = "Option::is_none")] + pub share_url: Option, + /// Current sharing status. Absent when the session is not synced or the status could not be retrieved (e.g. the user is not authenticated). + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the session cannot be shared and `status`/`shareUrl` are absent. + pub synced: bool, +} + +/// Effective sharing status and shareable GitHub URL after updating session visibility. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionVisibilitySetResult { + /// Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved. + #[serde(skip_serializing_if = "Option::is_none")] + pub share_url: Option, + /// Effective sharing status after the update. May differ from the requested status for task types that are already visible to repository readers by default. Absent when the update could not be applied (e.g. the session is not synced or the user is not authenticated). + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the visibility change could not be applied and `status`/`shareUrl` are absent. + pub synced: bool, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionScheduleListParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Snapshot of the currently active recurring prompts for this session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionScheduleListResult { + /// Active scheduled prompts, ordered by id. + pub entries: Vec, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionScheduleHydrateParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionScheduleHasSelfPacedParams { /// Target session identifier pub session_id: SessionId, } -/// Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own. +/// Whether the session currently has an active self-paced schedule. /// ///
/// @@ -20097,9 +22400,12 @@ pub struct SessionRemoteDisableParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionRemoteNotifySteerableChangedResult {} +pub struct SessionScheduleHasSelfPacedResult { + /// True when at least one active schedule is self-paced. + pub has_self_paced: bool, +} -/// Identifies the target session. +/// Result of registering or re-arming a scheduled prompt. /// ///
/// @@ -20109,12 +22415,16 @@ pub struct SessionRemoteNotifySteerableChangedResult {} ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionVisibilityGetParams { - /// Target session identifier - pub session_id: SessionId, +pub struct SessionScheduleAddResult { + /// The registered or updated schedule entry. + #[serde(skip_serializing_if = "Option::is_none")] + pub entry: Option, + /// User-facing validation error, when registration failed. + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, } -/// Current sharing status and shareable GitHub URL for a session. +/// Result of registering or re-arming a scheduled prompt. /// ///
/// @@ -20124,18 +22434,16 @@ pub struct SessionVisibilityGetParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionVisibilityGetResult { - /// Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved. +pub struct SessionScheduleAddCronResult { + /// The registered or updated schedule entry. #[serde(skip_serializing_if = "Option::is_none")] - pub share_url: Option, - /// Current sharing status. Absent when the session is not synced or the status could not be retrieved (e.g. the user is not authenticated). + pub entry: Option, + /// User-facing validation error, when registration failed. #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the session cannot be shared and `status`/`shareUrl` are absent. - pub synced: bool, + pub error: Option, } -/// Effective sharing status and shareable GitHub URL after updating session visibility. +/// Result of registering or re-arming a scheduled prompt. /// ///
/// @@ -20145,18 +22453,16 @@ pub struct SessionVisibilityGetResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionVisibilitySetResult { - /// Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved. +pub struct SessionScheduleAddAtResult { + /// The registered or updated schedule entry. #[serde(skip_serializing_if = "Option::is_none")] - pub share_url: Option, - /// Effective sharing status after the update. May differ from the requested status for task types that are already visible to repository readers by default. Absent when the update could not be applied (e.g. the session is not synced or the user is not authenticated). + pub entry: Option, + /// User-facing validation error, when registration failed. #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - /// Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the visibility change could not be applied and `status`/`shareUrl` are absent. - pub synced: bool, + pub error: Option, } -/// Identifies the target session. +/// Result of registering or re-arming a scheduled prompt. /// ///
/// @@ -20166,12 +22472,16 @@ pub struct SessionVisibilitySetResult { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionScheduleListParams { - /// Target session identifier - pub session_id: SessionId, +pub struct SessionScheduleAddSelfPacedResult { + /// The registered or updated schedule entry. + #[serde(skip_serializing_if = "Option::is_none")] + pub entry: Option, + /// User-facing validation error, when registration failed. + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, } -/// Snapshot of the currently active recurring prompts for this session. +/// Result of registering or re-arming a scheduled prompt. /// ///
/// @@ -20181,9 +22491,13 @@ pub struct SessionScheduleListParams { ///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct SessionScheduleListResult { - /// Active scheduled prompts, ordered by id. - pub entries: Vec, +pub struct SessionScheduleRearmSelfPacedResult { + /// The registered or updated schedule entry. + #[serde(skip_serializing_if = "Option::is_none")] + pub entry: Option, + /// User-facing validation error, when registration failed. + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, } /// Remove a scheduled prompt by id. The result entry is omitted if the id was unknown. @@ -21364,6 +23678,86 @@ pub enum ExternalToolTextResultForLlmContentTextType { Text, } +/// Execution-critical factory storage operation. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FactoryDurableOperation { + /// Creating the durable run and declared phases. + #[serde(rename = "createRun")] + CreateRun, + /// Persisting the transition to running. + #[serde(rename = "markRunStarted")] + MarkRunStarted, + /// Persisting the terminal run envelope. + #[serde(rename = "finishRun")] + FinishRun, + /// Persisting subagent admission accounting. + #[serde(rename = "reserveAgent")] + ReserveAgent, + /// Rolling back an uncommitted subagent admission. + #[serde(rename = "releaseAgent")] + ReleaseAgent, + /// Persisting an idempotent model-usage charge. + #[serde(rename = "chargeCredit")] + ChargeCredit, + /// Persisting active execution time. + #[serde(rename = "addElapsed")] + AddElapsed, + /// Reading the authoritative AI-credit total. + #[serde(rename = "reconcileCreditTotal")] + ReconcileCreditTotal, + /// Reading a journal entry without treating storage failure as a cache miss. + #[serde(rename = "journalGet")] + JournalGet, + /// Persisting a journal entry before reporting success. + #[serde(rename = "journalPut")] + JournalPut, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Current or terminal state of a factory run. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FactoryRunStatus { + /// The run was minted and is awaiting approval. + #[serde(rename = "pending")] + Pending, + /// The run is executing. + #[serde(rename = "running")] + Running, + /// The run completed successfully. + #[serde(rename = "completed")] + Completed, + /// The run was interrupted while resource budget remained. + #[serde(rename = "halted")] + Halted, + /// The run was cancelled before completion. + #[serde(rename = "cancelled")] + Cancelled, + /// The factory body failed or reached a cumulative resource ceiling. + #[serde(rename = "error")] + Error, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Kind of factory progress line. /// ///
@@ -21386,6 +23780,34 @@ pub enum FactoryLogLineKind { Unknown, } +/// Derived lifecycle state of a factory phase. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FactoryPhaseStatus { + /// The phase has not been entered yet. + #[serde(rename = "pending")] + Pending, + /// The phase is currently entered and accumulating active time. + #[serde(rename = "active")] + Active, + /// The phase was entered and has since been closed. + #[serde(rename = "completed")] + Completed, + /// The phase was never entered because a later phase was entered or the run reached a terminal state. + #[serde(rename = "skipped")] + Skipped, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Cumulative resource ceiling that stopped a factory run. /// ///
@@ -21399,16 +23821,27 @@ pub enum FactoryRunFailureKind { /// The run admitted the approved maximum total number of subagents. #[serde(rename = "maxTotalSubagents")] MaxTotalSubagents, - /// The run reached the approved timeout deadline. - #[serde(rename = "timeout")] - Timeout, + /// The run reached the approved accumulated active-execution time in seconds. + #[serde(rename = "timeoutSeconds")] + TimeoutSeconds, + /// The run's settled subagent model usage exceeded the approved AI-credit ceiling, or no headroom remained for another subagent. + #[serde(rename = "maxAiCredits")] + MaxAiCredits, /// Unknown variant for forward compatibility. #[default] #[serde(other)] Unknown, } -/// Current or terminal state of a factory run. +/// Authentication via the `gh` CLI's saved credentials. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum GhCliAuthInfoType { + #[serde(rename = "gh-cli")] + #[default] + GhCli, +} + +/// Reason a captured file was not restored. /// ///
/// @@ -21417,37 +23850,132 @@ pub enum FactoryRunFailureKind { /// ///
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] -pub enum FactoryRunStatus { - /// The run was minted and is awaiting approval. - #[serde(rename = "pending")] - Pending, - /// The run is executing. - #[serde(rename = "running")] - Running, - /// The run completed successfully. - #[serde(rename = "completed")] - Completed, - /// The run was interrupted while resource budget remained. - #[serde(rename = "halted")] - Halted, - /// The run was cancelled before completion. - #[serde(rename = "cancelled")] - Cancelled, - /// The factory body failed or reached a cumulative resource ceiling. - #[serde(rename = "error")] - Error, +pub enum HistoryFileRestoreSkipReason { + /// The file changed after Copilot's last captured write. + #[serde(rename = "user-modified")] + UserModified, + /// A faithful preimage was not captured. + #[serde(rename = "skipped-capture")] + SkippedCapture, /// Unknown variant for forward compatibility. #[default] #[serde(other)] Unknown, } -/// Authentication via the `gh` CLI's saved credentials. +/// Reason a rewind read (rewind points, file-restore preview, or session diff) could not be answered from the session's file-change captures. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] -pub enum GhCliAuthInfoType { - #[serde(rename = "gh-cli")] +pub enum HistoryRewindUnavailableReason { + /// The session did not opt into file-change tracking before its first turn. + #[serde(rename = "file-change-tracking-disabled")] + FileChangeTrackingDisabled, + /// The session still has work that may mutate files or history. Transient: the same request succeeds once the session settles, so callers should retry rather than treat it as a failure. + #[serde(rename = "session-busy")] + SessionBusy, + /// Remote-backed rewind routing is not supported. + #[serde(rename = "unsupported-remote-session")] + UnsupportedRemoteSession, + /// Unknown variant for forward compatibility. #[default] - GhCli, + #[serde(other)] + Unknown, +} + +/// Aggregate file change represented by a rewind preview. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum HistoryRewindChangeType { + /// The discarded turns created the file. + #[serde(rename = "created")] + Created, + /// The discarded turns deleted the file. + #[serde(rename = "deleted")] + Deleted, + /// The discarded turns modified the file. + #[serde(rename = "modified")] + Modified, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Scope of a rewind operation. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum HistoryRewindMode { + /// Discard conversation events while leaving files unchanged. + #[serde(rename = "conversation")] + Conversation, + /// Discard conversation events and restore captured files changed by those turns. + #[serde(rename = "conversation-and-files")] + ConversationAndFiles, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Outcome of a rewind request. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum HistoryRewindOutcome { + /// The requested rewind completed; reachable in either mode. + #[serde(rename = "success")] + Success, + /// The session still has work that may mutate files or history; reachable in either mode. + #[serde(rename = "session-busy")] + SessionBusy, + /// A conversation-and-files rewind was requested for a session that did not enable capture; conversation-only rewinds never produce this. + #[serde(rename = "file-change-tracking-disabled")] + FileChangeTrackingDisabled, + /// Remote-backed rewind routing is not supported; reachable in either mode. + #[serde(rename = "unsupported-remote-session")] + UnsupportedRemoteSession, + /// File restore failed and all applied file changes were rolled back; only conversation-and-files rewinds produce this. + #[serde(rename = "files-rolled-back")] + FilesRolledBack, + /// File restore failed and its rollback could not fully restore the pre-rewind state; only conversation-and-files rewinds produce this. + #[serde(rename = "rollback-incomplete")] + RollbackIncomplete, + /// Conversation truncation failed. In conversation-and-files mode any files that were restored are left in place because conversation history cannot be un-truncated; in conversation-only mode no files are restored. Consult restoredFiles for what, if anything, was applied. + #[serde(rename = "truncation-failed")] + TruncationFailed, + /// The conversation was rewound (and, in conversation-and-files mode, captured files were restored), but persisted checkpoints could not be cleaned up; reachable in either mode. + #[serde(rename = "checkpoint-cleanup-failed")] + CheckpointCleanupFailed, + /// Files and conversation were rewound, but obsolete file snapshots could not be removed; only conversation-and-files rewinds produce this. + #[serde(rename = "snapshot-prune-failed")] + SnapshotPruneFailed, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, } /// Authentication host. HMAC auth always targets the public GitHub host. @@ -23508,6 +26036,31 @@ pub enum SessionFsSqliteQueryType { Unknown, } +/// SQLite transaction failure classification. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum SessionFsSqliteTransactionErrorClass { + /// SQLite reported BUSY or LOCKED before commit; the transaction was rolled back and may be retried. + #[serde(rename = "busyOrLocked")] + BusyOrLocked, + /// The statement, database, or provider failed definitively and must not be retried automatically. + #[serde(rename = "fatal")] + Fatal, + /// The transport failed after the provider may have committed; retrying could duplicate effects. + #[serde(rename = "postCommitAmbiguous")] + PostCommitAmbiguous, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Constant value. Always "github". #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum SessionInstalledPluginSourceGitHubSource { @@ -23623,6 +26176,50 @@ pub enum SessionOpenOptionsReasoningSummary { Unknown, } +/// Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ShellInitProfile { + /// Disable automatic non-interactive profile loading. Explicit initScripts still run. + #[serde(rename = "none")] + None, + /// Allow automatic non-interactive profile loading when supported. Explicit initScripts still run. + #[serde(rename = "non-interactive")] + NonInteractive, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Supported built-in shells for initialization scripts. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ShellInitScriptShell { + /// Source the script in the built-in Bash shell on macOS and Linux. + #[serde(rename = "bash")] + Bash, + /// Source the script in the built-in PowerShell shell on Windows. + #[serde(rename = "powershell")] + Powershell, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Create a new local session. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum SessionsOpenCreateKind { diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 431ffa3aed..f1ca9d7aad 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -942,6 +942,30 @@ impl<'a> ClientRpcModels<'a> { .await?; Ok(serde_json::from_value(_value)?) } + + /// Returns the running runtime's complete catalog of well-known built-in model IDs without authentication or network access. + /// + /// Wire method: `models.getBuiltInCatalog`. + /// + /// # Returns + /// + /// The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn get_built_in_catalog(&self) -> Result { + let wire_params = serde_json::json!({}); + let _value = self + .client + .call(rpc_methods::MODELS_GETBUILTINCATALOG, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } } /// `plugins.*` RPCs. @@ -1569,6 +1593,71 @@ impl<'a> ClientRpcSessions<'a> { Ok(serde_json::from_value(_value)?) } + /// Reads lightweight persisted metadata for one local session without opening it. + /// + /// Wire method: `sessions.getMetadata`. + /// + /// # Parameters + /// + /// * `params` - Session ID whose persisted metadata should be read. + /// + /// # Returns + /// + /// Persisted local session metadata when the session exists. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn get_metadata( + &self, + params: SessionsGetMetadataRequest, + ) -> Result { + let wire_params = serde_json::to_value(params)?; + let _value = self + .client + .call(rpc_methods::SESSIONS_GETMETADATA, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Lists recent local session IDs that contain user-visible history, omitting housekeeping-only sessions. + /// + /// Wire method: `sessions.listNonEmptySessionIds`. + /// + /// # Parameters + /// + /// * `params` - Limit for non-empty local session IDs. + /// + /// # Returns + /// + /// Recent local session IDs that contain user-visible history. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn list_non_empty_session_ids( + &self, + params: SessionsListNonEmptySessionIdsRequest, + ) -> Result { + let wire_params = serde_json::to_value(params)?; + let _value = self + .client + .call( + rpc_methods::SESSIONS_LISTNONEMPTYSESSIONIDS, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Finds the local session bound to a GitHub task ID, if any. /// /// Wire method: `sessions.findByTaskId`. @@ -1841,6 +1930,30 @@ impl<'a> ClientRpcSessions<'a> { Ok(serde_json::from_value(_value)?) } + /// Deletes one local session from disk after running the same lifecycle hooks as the session manager. + /// + /// Wire method: `sessions.delete`. + /// + /// # Parameters + /// + /// * `params` - Session ID to delete from disk. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn delete(&self, params: SessionsDeleteRequest) -> Result<(), Error> { + let wire_params = serde_json::to_value(params)?; + let _value = self + .client + .call(rpc_methods::SESSIONS_DELETE, Some(wire_params)) + .await?; + Ok(()) + } + /// Deletes sessions older than the given threshold, with optional dry-run and exclusion list. /// /// Wire method: `sessions.pruneOld`. @@ -2619,6 +2732,13 @@ impl<'a> SessionRpc<'a> { } } + /// `session.contentExclusion.*` sub-namespace. + pub fn content_exclusion(&self) -> SessionRpcContentExclusion<'a> { + SessionRpcContentExclusion { + session: self.session, + } + } + /// `session.debug.*` sub-namespace. pub fn debug(&self) -> SessionRpcDebug<'a> { SessionRpcDebug { @@ -2927,6 +3047,38 @@ impl<'a> SessionRpc<'a> { Ok(serde_json::from_value(_value)?) } + /// Queues or sends an internal system notification to the session according to its passive policy. + /// + /// Wire method: `session.sendSystemNotification`. + /// + /// # Parameters + /// + /// * `params` - Internal request for sending a system notification. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn send_system_notification( + &self, + params: SendSystemNotificationRequest, + ) -> Result<(), Error> { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_SENDSYSTEMNOTIFICATION, + Some(wire_params), + ) + .await?; + Ok(()) + } + /// Aborts the current agent turn. /// /// Wire method: `session.abort`. @@ -2957,6 +3109,69 @@ impl<'a> SessionRpc<'a> { Ok(serde_json::from_value(_value)?) } + /// 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. + /// + /// Wire method: `session.interruptMainTurn`. + /// + /// # Parameters + /// + /// * `params` - Parameters for interrupting the main agent turn. + /// + /// # Returns + /// + /// Result of interrupting the main agent turn. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn interrupt_main_turn( + &self, + params: InterruptMainTurnRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_INTERRUPTMAINTURN, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running. + /// + /// Wire method: `session.cancelAllBackgroundAgents`. + /// + /// # Returns + /// + /// The number of running background agents (task-registry agents) that were cancelled. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn cancel_all_background_agents( + &self, + ) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_CANCELALLBACKGROUNDAGENTS, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// 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. /// /// Wire method: `session.shutdown`. @@ -3618,6 +3833,50 @@ impl<'a> SessionRpcCompletions<'a> { } } +/// `session.contentExclusion.*` RPCs. +#[derive(Clone, Copy)] +pub struct SessionRpcContentExclusion<'a> { + pub(crate) session: &'a Session, +} + +impl<'a> SessionRpcContentExclusion<'a> { + /// Checks local file system absolute paths within the session working directory against its content-exclusion policy. Results preserve input order. Unsupported paths/filesystems and unavailable policy evaluation return available false, and callers must treat every requested path as excluded. + /// + /// Wire method: `session.contentExclusion.checkPaths`. + /// + /// # Parameters + /// + /// * `params` - Local file system absolute paths within the session working directory to check against its content-exclusion policy. + /// + /// # Returns + /// + /// Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn check_paths( + &self, + params: ContentExclusionCheckPathsRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_CONTENTEXCLUSION_CHECKPATHS, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } +} + /// `session.debug.*` RPCs. #[derive(Clone, Copy)] pub struct SessionRpcDebug<'a> { @@ -3976,17 +4235,17 @@ impl<'a> SessionRpcFactory<'a> { Ok(serde_json::from_value(_value)?) } - /// Gets the current or settled envelope for a factory run. + /// Resumes a factory run using its persisted name, arguments, journal, and accounting. /// - /// Wire method: `session.factory.getRun`. + /// Wire method: `session.factory.resume`. /// /// # Parameters /// - /// * `params` - Parameters for retrieving a factory run. + /// * `params` - Parameters for resuming a factory run from its persisted identity. /// /// # Returns /// - /// Complete current or terminal factory run envelope. + /// Resolved persisted factory identity and resumed run envelope. /// ///
/// @@ -3995,24 +4254,24 @@ impl<'a> SessionRpcFactory<'a> { /// SDK and CLI versions if your code depends on it. /// ///
- pub async fn get_run(&self, params: FactoryGetRunRequest) -> Result { + pub async fn resume(&self, params: FactoryResumeRequest) -> Result { let mut wire_params = serde_json::to_value(params)?; wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); let _value = self .session .client() - .call(rpc_methods::SESSION_FACTORY_GETRUN, Some(wire_params)) + .call(rpc_methods::SESSION_FACTORY_RESUME, Some(wire_params)) .await?; Ok(serde_json::from_value(_value)?) } - /// Requests cancellation of a factory run and returns its run envelope. + /// Gets the current or settled envelope for a factory run. /// - /// Wire method: `session.factory.cancel`. + /// Wire method: `session.factory.getRun`. /// /// # Parameters /// - /// * `params` - Parameters for cancelling a factory run. + /// * `params` - Parameters for retrieving a factory run. /// /// # Returns /// @@ -4025,28 +4284,24 @@ impl<'a> SessionRpcFactory<'a> { /// SDK and CLI versions if your code depends on it. /// ///
- pub async fn cancel(&self, params: FactoryCancelRequest) -> Result { + pub async fn get_run(&self, params: FactoryGetRunRequest) -> Result { let mut wire_params = serde_json::to_value(params)?; wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); let _value = self .session .client() - .call(rpc_methods::SESSION_FACTORY_CANCEL, Some(wire_params)) + .call(rpc_methods::SESSION_FACTORY_GETRUN, Some(wire_params)) .await?; Ok(serde_json::from_value(_value)?) } - /// Records a batch of ordered factory progress lines. + /// Lists durable factory runs for this session in creation order. /// - /// Wire method: `session.factory.log`. - /// - /// # Parameters - /// - /// * `params` - Parameters for recording factory progress. + /// Wire method: `session.factory.listRuns`. /// /// # Returns /// - /// Acknowledgement that a factory request was accepted. + /// Factory runs in durable creation order. /// ///
/// @@ -4055,28 +4310,27 @@ impl<'a> SessionRpcFactory<'a> { /// SDK and CLI versions if your code depends on it. /// ///
- pub async fn log(&self, params: FactoryLogRequest) -> Result { - let mut wire_params = serde_json::to_value(params)?; - wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + pub async fn list_runs(&self) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); let _value = self .session .client() - .call(rpc_methods::SESSION_FACTORY_LOG, Some(wire_params)) + .call(rpc_methods::SESSION_FACTORY_LISTRUNS, Some(wire_params)) .await?; Ok(serde_json::from_value(_value)?) } - /// Runs one factory-scoped subagent and returns its result. + /// Gets durable and live observability detail for one factory run. /// - /// Wire method: `session.factory.agent`. + /// Wire method: `session.factory.getRunDetail`. /// /// # Parameters /// - /// * `params` - Parameters for one factory-scoped subagent call. + /// * `params` - Parameters for retrieving a factory run. /// /// # Returns /// - /// Result of one factory-scoped subagent call. + /// Full factory run observability detail. /// ///
/// @@ -4085,36 +4339,31 @@ impl<'a> SessionRpcFactory<'a> { /// SDK and CLI versions if your code depends on it. /// ///
- pub async fn agent(&self, params: FactoryAgentRequest) -> Result { + pub async fn get_run_detail( + &self, + params: FactoryGetRunRequest, + ) -> Result { let mut wire_params = serde_json::to_value(params)?; wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); let _value = self .session .client() - .call(rpc_methods::SESSION_FACTORY_AGENT, Some(wire_params)) + .call(rpc_methods::SESSION_FACTORY_GETRUNDETAIL, Some(wire_params)) .await?; Ok(serde_json::from_value(_value)?) } -} - -/// `session.factory.journal.*` RPCs. -#[derive(Clone, Copy)] -pub struct SessionRpcFactoryJournal<'a> { - pub(crate) session: &'a Session, -} -impl<'a> SessionRpcFactoryJournal<'a> { - /// Reads a memoized factory journal entry. + /// Pages durable progress for one factory run. /// - /// Wire method: `session.factory.journal.get`. + /// Wire method: `session.factory.getRunProgress`. /// /// # Parameters /// - /// * `params` - Parameters for reading a factory journal entry. + /// * `params` - Parameters for paging factory progress. /// /// # Returns /// - /// Result of reading a factory journal entry. + /// A bidirectional page of factory progress. /// ///
/// @@ -4123,21 +4372,155 @@ impl<'a> SessionRpcFactoryJournal<'a> { /// SDK and CLI versions if your code depends on it. /// ///
- pub async fn get( + pub async fn get_run_progress( &self, - params: FactoryJournalGetRequest, - ) -> Result { + params: FactoryGetRunProgressRequest, + ) -> Result { let mut wire_params = serde_json::to_value(params)?; wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); let _value = self .session .client() - .call(rpc_methods::SESSION_FACTORY_JOURNAL_GET, Some(wire_params)) + .call( + rpc_methods::SESSION_FACTORY_GETRUNPROGRESS, + Some(wire_params), + ) .await?; Ok(serde_json::from_value(_value)?) } - /// Stores a memoized factory journal entry. + /// Requests cancellation of a factory run and returns its run envelope. + /// + /// Wire method: `session.factory.cancel`. + /// + /// # Parameters + /// + /// * `params` - Parameters for cancelling a factory run. + /// + /// # Returns + /// + /// Complete current or terminal factory run envelope. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn cancel(&self, params: FactoryCancelRequest) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_FACTORY_CANCEL, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Records a batch of ordered factory progress lines. + /// + /// Wire method: `session.factory.log`. + /// + /// # Parameters + /// + /// * `params` - Parameters for recording factory progress. + /// + /// # Returns + /// + /// Acknowledgement that a factory request was accepted. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn log(&self, params: FactoryLogRequest) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_FACTORY_LOG, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Runs one factory-scoped subagent and returns its result. + /// + /// Wire method: `session.factory.agent`. + /// + /// # Parameters + /// + /// * `params` - Parameters for one factory-scoped subagent call. + /// + /// # Returns + /// + /// Result of one factory-scoped subagent call. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn agent(&self, params: FactoryAgentRequest) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_FACTORY_AGENT, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } +} + +/// `session.factory.journal.*` RPCs. +#[derive(Clone, Copy)] +pub struct SessionRpcFactoryJournal<'a> { + pub(crate) session: &'a Session, +} + +impl<'a> SessionRpcFactoryJournal<'a> { + /// Reads a memoized factory journal entry. + /// + /// Wire method: `session.factory.journal.get`. + /// + /// # Parameters + /// + /// * `params` - Parameters for reading a factory journal entry. + /// + /// # Returns + /// + /// Result of reading a factory journal entry. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn get( + &self, + params: FactoryJournalGetRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_FACTORY_JOURNAL_GET, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Stores a memoized factory journal entry. /// /// Wire method: `session.factory.journal.put`. /// @@ -4373,6 +4756,100 @@ impl<'a> SessionRpcHistory<'a> { Ok(serde_json::from_value(_value)?) } + /// Lists the user turns that the session can rewind to. Never rejects for a busy session: rewind reads need the session's file-change captures to be settled, so a session that still holds active work answers with `unavailableReason: "session-busy"` and no points, which the caller can retry. + /// + /// Wire method: `session.history.listRewindPoints`. + /// + /// # Returns + /// + /// Rewind points and file-change-tracking availability for the session. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn list_rewind_points(&self) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_HISTORY_LISTREWINDPOINTS, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Previews the files that a conversation-and-files rewind would restore. + /// + /// Wire method: `session.history.previewRewind`. + /// + /// # Parameters + /// + /// * `params` - Event boundary to preview for conversation-and-files rewind. + /// + /// # Returns + /// + /// Files and aggregate changes for a prospective rewind. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn preview_rewind( + &self, + params: HistoryPreviewRewindRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_HISTORY_PREVIEWREWIND, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Rewinds the session conversation, optionally restoring files changed by the discarded turns. Not crash-atomic: file restore and conversation truncation are separate stores, applied in that order, so a process crash between them can leave the workspace rewound while the conversation still contains the discarded turns. There is no recovery journal; re-running the same rewind is the recovery path for a crash before truncation lands, since file restore is idempotent (already-restored files are reported as skipped) and truncation is re-derived from the still-retained boundary event. After truncation lands that boundary no longer exists, so the same request is rejected; the only stage that can still be outstanding is snapshot pruning, whose failure leaves orphan snapshots the capture store tolerates. The reverse inconsistency cannot occur, because truncation is never applied before file restore succeeds. + /// + /// Wire method: `session.history.rewind`. + /// + /// # Parameters + /// + /// * `params` - Boundary and mode for rewinding session history. + /// + /// # Returns + /// + /// Structured outcome of a rewind request. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn rewind(&self, params: HistoryRewindRequest) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_HISTORY_REWIND, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Cancels any in-progress background compaction on a local session. /// /// Wire method: `session.history.cancelBackgroundCompaction`. @@ -4891,13 +5368,13 @@ impl<'a> SessionRpcMcp<'a> { Ok(serde_json::from_value(_value)?) } - /// Starts an individual MCP server on the live session from a caller-supplied config. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server. + /// Starts an individual MCP server on the live session. Omit `config` for a config-free start-by-name of an already-configured server (reuses the server's already-registered configuration); supply `config` to start from a caller-supplied configuration. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server. /// /// Wire method: `session.mcp.startServer`. /// /// # Parameters /// - /// * `params` - Server name and configuration for an individual MCP server start. + /// * `params` - Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server. /// ///
/// @@ -5386,6 +5863,39 @@ impl<'a> SessionRpcMcpOauth<'a> { .await?; Ok(serde_json::from_value(_value)?) } + + /// Responds to a pending MCP OAuth authorization request by its request id. + /// + /// Wire method: `session.mcp.oauth.respond`. + /// + /// # Parameters + /// + /// * `params` - Pending MCP OAuth request id to respond to. + /// + /// # Returns + /// + /// Indicates whether the pending MCP OAuth response was accepted. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn respond( + &self, + params: McpOauthRespondRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_MCP_OAUTH_RESPOND, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } } /// `session.mcp.resources.*` RPCs. @@ -6449,6 +6959,10 @@ impl<'a> SessionRpcPermissions<'a> { /// /// Wire method: `session.permissions.resetSessionApprovals`. /// + /// # Parameters + /// + /// * `params` - Clears session-scoped tool permission approvals, and optionally the location-scoped ones. + /// /// # Returns /// /// Indicates whether the operation succeeded. @@ -6462,8 +6976,10 @@ impl<'a> SessionRpcPermissions<'a> { ///
pub async fn reset_session_approvals( &self, + params: PermissionsResetSessionApprovalsRequest, ) -> Result { - let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); let _value = self .session .client() @@ -7275,13 +7791,13 @@ impl<'a> SessionRpcQueue<'a> { Ok(serde_json::from_value(_value)?) } - /// Removes the most recently queued user-facing item (LIFO). + /// Returns the internal native queue snapshot for in-process session orchestration. /// - /// Wire method: `session.queue.removeMostRecent`. + /// Wire method: `session.queue.snapshot`. /// /// # Returns /// - /// Indicates whether a user-facing pending item was removed. + /// Internal snapshot of native queue state for local session orchestration. /// ///
/// @@ -7290,22 +7806,23 @@ impl<'a> SessionRpcQueue<'a> { /// SDK and CLI versions if your code depends on it. /// ///
- pub async fn remove_most_recent(&self) -> Result { + pub(crate) async fn snapshot(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); let _value = self .session .client() - .call( - rpc_methods::SESSION_QUEUE_REMOVEMOSTRECENT, - Some(wire_params), - ) + .call(rpc_methods::SESSION_QUEUE_SNAPSHOT, Some(wire_params)) .await?; Ok(serde_json::from_value(_value)?) } - /// Clears all pending queued items on the local session. + /// Reports whether the local session has native queued work pending. /// - /// Wire method: `session.queue.clear`. + /// Wire method: `session.queue.hasPending`. + /// + /// # Returns + /// + /// Whether the native queue has pending work. /// ///
/// @@ -7314,16 +7831,256 @@ impl<'a> SessionRpcQueue<'a> { /// SDK and CLI versions if your code depends on it. /// ///
- pub async fn clear(&self) -> Result<(), Error> { + pub(crate) async fn has_pending(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); let _value = self .session .client() - .call(rpc_methods::SESSION_QUEUE_CLEAR, Some(wire_params)) + .call(rpc_methods::SESSION_QUEUE_HASPENDING, Some(wire_params)) .await?; - Ok(()) + Ok(serde_json::from_value(_value)?) } -} + + /// Begins a native deferred-idle drain when background work has quiesced. + /// + /// Wire method: `session.queue.beginDeferredIdleDrain`. + /// + /// # Parameters + /// + /// * `params` - Inputs for starting a deferred-idle drain. + /// + /// # Returns + /// + /// Whether a deferred-idle drain should run. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn begin_deferred_idle_drain( + &self, + params: QueueBeginDeferredIdleDrainRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_QUEUE_BEGINDEFERREDIDLEDRAIN, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle. + /// + /// Wire method: `session.queue.finishDeferredIdleDrain`. + /// + /// # Parameters + /// + /// * `params` - Inputs for completing a deferred-idle drain. + /// + /// # Returns + /// + /// Action selected by the native deferred-idle drain. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn finish_deferred_idle_drain( + &self, + params: QueueFinishDeferredIdleDrainRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_QUEUE_FINISHDEFERREDIDLEDRAIN, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Marks session.idle as deferred by native background work state. + /// + /// Wire method: `session.queue.deferSessionIdle`. + /// + /// # Parameters + /// + /// * `params` - Inputs for marking session.idle deferred in native state. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn defer_session_idle( + &self, + params: QueueDeferSessionIdleRequest, + ) -> Result<(), Error> { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_QUEUE_DEFERSESSIONIDLE, + Some(wire_params), + ) + .await?; + Ok(()) + } + + /// Removes the most recently queued user-facing item (LIFO). + /// + /// Wire method: `session.queue.removeMostRecent`. + /// + /// # Returns + /// + /// Indicates whether a user-facing pending item was removed. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn remove_most_recent(&self) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_QUEUE_REMOVEMOSTRECENT, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Clears all pending queued items on the local session. + /// + /// Wire method: `session.queue.clear`. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn clear(&self) -> Result<(), Error> { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_QUEUE_CLEAR, Some(wire_params)) + .await?; + Ok(()) + } + + /// Consumes queued native system notifications matching an internal filter. + /// + /// Wire method: `session.queue.consumeSystemNotifications`. + /// + /// # Parameters + /// + /// * `params` - Internal filter for consuming queued system notifications. + /// + /// # Returns + /// + /// Indicates whether a user-facing pending item was removed. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn consume_system_notifications( + &self, + params: QueueConsumeSystemNotificationsRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_QUEUE_CONSUMESYSTEMNOTIFICATIONS, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn. + /// + /// Wire method: `session.queue.enqueueResumePending`. + /// + /// # Returns + /// + /// Result of enqueueing the resume-pending wake item. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn enqueue_resume_pending( + &self, + ) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_QUEUE_ENQUEUERESUMEPENDING, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Drains the native local-session work queue for in-process session orchestration. + /// + /// Wire method: `session.queue.process`. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn process(&self) -> Result<(), Error> { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_QUEUE_PROCESS, Some(wire_params)) + .await?; + Ok(()) + } +} /// `session.remote.*` RPCs. #[derive(Clone, Copy)] @@ -7364,7 +8121,217 @@ impl<'a> SessionRpcRemote<'a> { /// Disables remote session export and steering. /// - /// Wire method: `session.remote.disable`. + /// Wire method: `session.remote.disable`. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn disable(&self) -> Result<(), Error> { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_REMOTE_DISABLE, Some(wire_params)) + .await?; + Ok(()) + } + + /// Persists a remote-steerability change emitted by the host as a session event. + /// + /// Wire method: `session.remote.notifySteerableChanged`. + /// + /// # Parameters + /// + /// * `params` - New remote-steerability state to persist as a `session.remote_steerable_changed` event. + /// + /// # Returns + /// + /// Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn notify_steerable_changed( + &self, + params: RemoteNotifySteerableChangedRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_REMOTE_NOTIFYSTEERABLECHANGED, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } +} + +/// `session.schedule.*` RPCs. +#[derive(Clone, Copy)] +pub struct SessionRpcSchedule<'a> { + pub(crate) session: &'a Session, +} + +impl<'a> SessionRpcSchedule<'a> { + /// Lists the session's currently active scheduled prompts. + /// + /// Wire method: `session.schedule.list`. + /// + /// # Returns + /// + /// Snapshot of the currently active recurring prompts for this session. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn list(&self) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_SCHEDULE_LIST, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Hydrates the native schedule registry from persisted session events. + /// + /// Wire method: `session.schedule.hydrate`. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn hydrate(&self) -> Result<(), Error> { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_SCHEDULE_HYDRATE, Some(wire_params)) + .await?; + Ok(()) + } + + /// Reports whether the session has an active self-paced scheduled prompt. + /// + /// Wire method: `session.schedule.hasSelfPaced`. + /// + /// # Returns + /// + /// Whether the session currently has an active self-paced schedule. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn has_self_paced(&self) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_SCHEDULE_HASSELFPACED, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Registers a relative-interval scheduled prompt. + /// + /// Wire method: `session.schedule.add`. + /// + /// # Parameters + /// + /// * `params` - Register a relative-interval scheduled prompt. + /// + /// # Returns + /// + /// Result of registering or re-arming a scheduled prompt. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn add(&self, params: ScheduleAddRequest) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_SCHEDULE_ADD, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Registers a recurring cron scheduled prompt. + /// + /// Wire method: `session.schedule.addCron`. + /// + /// # Parameters + /// + /// * `params` - Register a cron scheduled prompt. + /// + /// # Returns + /// + /// Result of registering or re-arming a scheduled prompt. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn add_cron( + &self, + params: ScheduleAddCronRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_SCHEDULE_ADDCRON, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Registers an absolute-time scheduled prompt. + /// + /// Wire method: `session.schedule.addAt`. + /// + /// # Parameters + /// + /// * `params` - Register an absolute-time scheduled prompt. + /// + /// # Returns + /// + /// Result of registering or re-arming a scheduled prompt. /// ///
/// @@ -7373,27 +8340,31 @@ impl<'a> SessionRpcRemote<'a> { /// SDK and CLI versions if your code depends on it. /// ///
- pub async fn disable(&self) -> Result<(), Error> { - let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + pub(crate) async fn add_at( + &self, + params: ScheduleAddAtRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); let _value = self .session .client() - .call(rpc_methods::SESSION_REMOTE_DISABLE, Some(wire_params)) + .call(rpc_methods::SESSION_SCHEDULE_ADDAT, Some(wire_params)) .await?; - Ok(()) + Ok(serde_json::from_value(_value)?) } - /// Persists a remote-steerability change emitted by the host as a session event. + /// Registers a self-paced scheduled prompt. /// - /// Wire method: `session.remote.notifySteerableChanged`. + /// Wire method: `session.schedule.addSelfPaced`. /// /// # Parameters /// - /// * `params` - New remote-steerability state to persist as a `session.remote_steerable_changed` event. + /// * `params` - Register a self-paced scheduled prompt. /// /// # Returns /// - /// Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own. + /// Result of registering or re-arming a scheduled prompt. /// ///
/// @@ -7402,38 +8373,34 @@ impl<'a> SessionRpcRemote<'a> { /// SDK and CLI versions if your code depends on it. /// ///
- pub async fn notify_steerable_changed( + pub(crate) async fn add_self_paced( &self, - params: RemoteNotifySteerableChangedRequest, - ) -> Result { + params: ScheduleAddSelfPacedRequest, + ) -> Result { let mut wire_params = serde_json::to_value(params)?; wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); let _value = self .session .client() .call( - rpc_methods::SESSION_REMOTE_NOTIFYSTEERABLECHANGED, + rpc_methods::SESSION_SCHEDULE_ADDSELFPACED, Some(wire_params), ) .await?; Ok(serde_json::from_value(_value)?) } -} - -/// `session.schedule.*` RPCs. -#[derive(Clone, Copy)] -pub struct SessionRpcSchedule<'a> { - pub(crate) session: &'a Session, -} -impl<'a> SessionRpcSchedule<'a> { - /// Lists the session's currently active scheduled prompts. + /// Re-arms an active self-paced scheduled prompt. /// - /// Wire method: `session.schedule.list`. + /// Wire method: `session.schedule.rearmSelfPaced`. + /// + /// # Parameters + /// + /// * `params` - Re-arm a self-paced scheduled prompt. /// /// # Returns /// - /// Snapshot of the currently active recurring prompts for this session. + /// Result of registering or re-arming a scheduled prompt. /// ///
/// @@ -7442,12 +8409,19 @@ impl<'a> SessionRpcSchedule<'a> { /// SDK and CLI versions if your code depends on it. /// ///
- pub async fn list(&self) -> Result { - let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + pub(crate) async fn rearm_self_paced( + &self, + params: ScheduleRearmSelfPacedRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); let _value = self .session .client() - .call(rpc_methods::SESSION_SCHEDULE_LIST, Some(wire_params)) + .call( + rpc_methods::SESSION_SCHEDULE_REARMSELFPACED, + Some(wire_params), + ) .await?; Ok(serde_json::from_value(_value)?) } @@ -7559,7 +8533,7 @@ pub struct SessionRpcShell<'a> { } impl<'a> SessionRpcShell<'a> { - /// Starts a shell command and streams output through session notifications. + /// Starts a shell command and streams output through session notifications. The command runs as the leader of its own process group (POSIX) or in a dedicated job object (Windows), so a forced termination — via "shell.kill", the request timeout, or session disposal — signals that whole group/job rather than only the direct child. Two gaps are worth planning for: a command that exits on its own does not trigger that teardown, and on POSIX a descendant that moves itself into a new session or process group (for example via "setsid") leaves the signalled group, so either can leave a background process running. /// /// Wire method: `session.shell.exec`. /// @@ -7589,7 +8563,7 @@ impl<'a> SessionRpcShell<'a> { Ok(serde_json::from_value(_value)?) } - /// Sends a signal to a shell process previously started via "shell.exec". + /// Sends a signal to a shell process previously started via "shell.exec". The signal targets the command's whole process group (POSIX) or job object (Windows), so descendants still in that group are signalled too, not just the direct child. On POSIX a descendant that moved itself into a new session or process group (for example via "setsid") is no longer in the signalled group and survives. /// /// Wire method: `session.shell.kill`. /// @@ -8875,6 +9849,75 @@ impl<'a> SessionRpcWorkspaces<'a> { Ok(serde_json::from_value(_value)?) } + /// Updates workspace metadata for a local session and returns the refreshed workspace. + /// + /// Wire method: `session.workspaces.updateMetadata`. + /// + /// # Parameters + /// + /// * `params` - Workspace metadata fields to update. + /// + /// # Returns + /// + /// Current workspace metadata for the session, including its absolute filesystem path when available. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn update_metadata( + &self, + params: WorkspacesUpdateMetadataRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_WORKSPACES_UPDATEMETADATA, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Ensures a local session workspace exists and returns it. + /// + /// Wire method: `session.workspaces.ensure`. + /// + /// # Parameters + /// + /// * `params` - Optional session context used when creating a local workspace. + /// + /// # Returns + /// + /// Current workspace metadata for the session, including its absolute filesystem path when available. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn ensure( + &self, + params: WorkspacesEnsureRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_WORKSPACES_ENSURE, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Lists files stored in the session workspace files directory. /// /// Wire method: `session.workspaces.listFiles`. @@ -9026,6 +10069,204 @@ impl<'a> SessionRpcWorkspaces<'a> { Ok(serde_json::from_value(_value)?) } + /// Adds a compaction summary checkpoint to the local session workspace. + /// + /// Wire method: `session.workspaces.addSummary`. + /// + /// # Parameters + /// + /// * `params` - Compaction summary checkpoint to persist. + /// + /// # Returns + /// + /// Persisted summary metadata and refreshed workspace metadata. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn add_summary( + &self, + params: WorkspacesAddSummaryRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_WORKSPACES_ADDSUMMARY, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Truncates local workspace compaction summaries after a rollback. + /// + /// Wire method: `session.workspaces.truncateSummaries`. + /// + /// # Parameters + /// + /// * `params` - Rollback point for local workspace summaries. + /// + /// # Returns + /// + /// Current workspace metadata for the session, including its absolute filesystem path when available. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn truncate_summaries( + &self, + params: WorkspacesTruncateSummariesRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_WORKSPACES_TRUNCATESUMMARIES, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Reads the autopilot objective state file from the local session workspace. + /// + /// Wire method: `session.workspaces.readAutopilotObjective`. + /// + /// # Returns + /// + /// Autopilot objective file content, or null when missing. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn read_autopilot_objective( + &self, + ) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_WORKSPACES_READAUTOPILOTOBJECTIVE, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Writes the autopilot objective state file in the local session workspace. + /// + /// Wire method: `session.workspaces.writeAutopilotObjective`. + /// + /// # Parameters + /// + /// * `params` - Autopilot objective file content to persist. + /// + /// # Returns + /// + /// Result of writing the autopilot objective file. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn write_autopilot_objective( + &self, + params: WorkspacesWriteAutopilotObjectiveRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_WORKSPACES_WRITEAUTOPILOTOBJECTIVE, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Deletes the autopilot objective state file from the local session workspace. + /// + /// Wire method: `session.workspaces.deleteAutopilotObjective`. + /// + /// # Returns + /// + /// Result of deleting the autopilot objective file. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn delete_autopilot_objective( + &self, + ) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_WORKSPACES_DELETEAUTOPILOTOBJECTIVE, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Checks whether the local session workspace has an autopilot objective state file. + /// + /// Wire method: `session.workspaces.autopilotObjectiveExists`. + /// + /// # Returns + /// + /// Whether the autopilot objective file exists. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn autopilot_objective_exists( + &self, + ) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_WORKSPACES_AUTOPILOTOBJECTIVEEXISTS, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Saves pasted content as a UTF-8 file in the session workspace. /// /// Wire method: `session.workspaces.saveLargePaste`. @@ -9062,7 +10303,7 @@ impl<'a> SessionRpcWorkspaces<'a> { Ok(serde_json::from_value(_value)?) } - /// Computes a diff for the session workspace. + /// Computes a diff for the session workspace. Never rejects for a busy session: a `session`-mode diff that cannot read the session's file-change captures falls back to an unstaged git diff with `isFallback: true` and reports why in `unavailableReason`. /// /// Wire method: `session.workspaces.diff`. /// diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index abc7dca626..95f82844e3 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -233,6 +233,15 @@ pub enum SessionEventType { SessionToolsUpdated, #[serde(rename = "session.background_tasks_changed")] SessionBackgroundTasksChanged, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "factory.run_updated")] + FactoryRunUpdated, #[serde(rename = "session.skills_loaded")] SessionSkillsLoaded, #[serde(rename = "session.custom_agents_updated")] @@ -534,6 +543,15 @@ pub enum SessionEventData { SessionToolsUpdated(SessionToolsUpdatedData), #[serde(rename = "session.background_tasks_changed")] SessionBackgroundTasksChanged(SessionBackgroundTasksChangedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "factory.run_updated")] + FactoryRunUpdated(FactoryRunUpdatedData), #[serde(rename = "session.skills_loaded")] SessionSkillsLoaded(SessionSkillsLoadedData), #[serde(rename = "session.custom_agents_updated")] @@ -734,7 +752,7 @@ pub struct SessionResumeData { /// Context tier currently selected at resume time; null when no tier is active #[serde(skip_serializing_if = "Option::is_none")] pub context_tier: Option, - /// When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume. + /// When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false or omitted, pending work is normally marked as interrupted unless the resume passively joined live work owned by another client; sessionWasActive distinguishes that case. #[serde(skip_serializing_if = "Option::is_none")] pub continue_pending_work: Option, /// Total number of persisted events in the session at the time of resume @@ -759,7 +777,7 @@ pub struct SessionResumeData { /// Session limits currently configured at resume time; null when no limits are active #[serde(skip_serializing_if = "Option::is_none")] pub session_limits: Option, - /// True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. + /// True when this resume passively joined a session that already had live work running in the runtime - an agent turn, a native queue run, a queued resume continuation, or an in-flight send (for example, an extension joining a session another client was actively driving). False (or omitted) when the session had no live work or when the resume explicitly abandoned pending work, including cold resumes and suspended sessions that remain resident in memory. #[serde(skip_serializing_if = "Option::is_none")] pub session_was_active: Option, /// Output verbosity level used for model calls, if applicable (e.g. "low", "medium", "high") @@ -841,6 +859,9 @@ pub struct SessionScheduleCreatedData { /// Interval between ticks in milliseconds (relative-interval schedules) #[serde(skip_serializing_if = "Option::is_none")] pub interval_ms: Option, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub origin: Option, /// Prompt text that gets enqueued on every tick pub prompt: String, /// Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`) @@ -1492,7 +1513,7 @@ pub struct UserMessageData { /// Parent agent task ID for background telemetry correlated to this user turn #[serde(skip_serializing_if = "Option::is_none")] pub parent_agent_task_id: Option, - /// 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) #[serde(skip_serializing_if = "Option::is_none")] pub source: Option, /// Normalized document MIME types that were sent natively instead of through tagged_files XML @@ -1564,6 +1585,8 @@ pub struct AssistantReasoningData { pub content: String, /// Unique identifier for this reasoning block pub reasoning_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub rte: Option, } /// Session event "assistant.reasoning_delta". Streaming reasoning delta for incremental extended thinking updates @@ -1792,6 +1815,8 @@ pub struct AssistantMessageData { /// GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs #[serde(skip_serializing_if = "Option::is_none")] pub request_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub rte: Option, /// Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping #[serde(skip_serializing_if = "Option::is_none")] pub server_tools: Option, @@ -1968,6 +1993,9 @@ pub struct AssistantUsageData { /// Number of input tokens consumed #[serde(skip_serializing_if = "Option::is_none")] pub input_tokens: Option, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub interaction_type: Option, /// Average inter-token latency in milliseconds. Only available for streaming requests #[serde(skip_serializing_if = "Option::is_none")] pub inter_token_latency_ms: Option, @@ -1994,6 +2022,8 @@ pub struct AssistantUsageData { /// Number of output tokens used for reasoning (e.g., chain-of-thought) #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_tokens: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub rte: Option, /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation #[serde(skip_serializing_if = "Option::is_none")] pub service_request_id: Option, @@ -2082,6 +2112,8 @@ pub struct ModelCallFailureData { /// 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. #[serde(skip_serializing_if = "Option::is_none")] pub request_fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub rte: Option, /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation #[serde(skip_serializing_if = "Option::is_none")] pub service_request_id: Option, @@ -2102,6 +2134,10 @@ pub struct ModelCallStartData { /// Model identifier used for this API call, when known #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, + /// Previous response or interaction identifier included in the model request, when present + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) previous_response_id: Option, /// Identifier of the assistant turn that initiated the model call pub turn_id: String, } @@ -2196,6 +2232,8 @@ pub struct ToolExecutionStartData { #[deprecated] #[serde(skip_serializing_if = "Option::is_none")] pub parent_tool_call_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub rte: Option, /// 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. #[serde(skip_serializing_if = "Option::is_none")] pub shell_tool_info: Option, @@ -2636,6 +2674,8 @@ pub struct ToolExecutionCompleteData { /// Tool execution result on success #[serde(skip_serializing_if = "Option::is_none")] pub result: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub rte: Option, /// Whether this tool execution ran inside a sandbox container #[serde(skip_serializing_if = "Option::is_none")] pub sandboxed: Option, @@ -2877,6 +2917,9 @@ pub struct SystemMessageMetadata { pub struct SystemMessageData { /// The system or developer prompt text sent as model input pub content: String, + /// Logical interaction identifier for the model run receiving this prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub interaction_id: Option, /// Metadata about the prompt template and its construction #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, @@ -3148,6 +3191,12 @@ pub struct PermissionRequestExtensionPermissionAccess { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PermissionAutoApproval { + /// Classified cause of an `error` recommendation. Absent for every other recommendation. + #[serde(skip_serializing_if = "Option::is_none")] + pub failure_reason: Option, + /// Model id that produced the recommendation, when the judge was consulted and reported one. Absent for `excluded` (the judge was not consulted) and for failures that occurred before a model was selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, /// Human-readable reason for the judge's recommendation, when available. #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option, @@ -4229,6 +4278,22 @@ pub struct SessionToolsUpdatedData { #[serde(rename_all = "camelCase")] pub struct SessionBackgroundTasksChangedData {} +/// Session event "factory.run_updated". Ephemeral invalidation signal for a changed factory run. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FactoryRunUpdatedData { + /// Monotonic revision now available for the run. + pub revision: i64, + pub run_id: String, +} + /// A single resolved skill in `session.skills_loaded`, including source, invocability, enabled state, path, and argument hint. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -4703,6 +4768,21 @@ pub enum Verbosity { Unknown, } +/// 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. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ScheduleOrigin { + /// The schedule was created by an explicit user action, such as `/every` or `/after`. + #[serde(rename = "user")] + User, + /// The schedule was created by the agent via the `manage_schedule` tool. + #[serde(rename = "model")] + Model, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// The type of operation performed on the autopilot objective state file #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum AutopilotObjectiveChangedOperation { @@ -5325,6 +5405,37 @@ pub enum PermissionRequest { ExtensionPermissionAccess(PermissionRequestExtensionPermissionAccess), } +/// Why the auto-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum AutoApprovalJudgeFailureReason { + /// The judge model call exceeded its deadline. + #[serde(rename = "timeout")] + Timeout, + /// The judge model call was cancelled before it returned. + #[serde(rename = "abort")] + Abort, + /// The judge model call completed but returned no content. + #[serde(rename = "empty_response")] + EmptyResponse, + /// The judge model call failed (for example a transport, authentication, or rate-limit error). + #[serde(rename = "model_error")] + ModelError, + /// The judge model replied, but the reply carried no ALLOW/DENY verdict. + #[serde(rename = "parse_error")] + ParseError, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Outcome of the auto-approval safety judge for a permission request. Present only when auto mode is enabled; its absence means the judge did not evaluate the request (auto mode was off). /// ///
diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index ffd36162c5..6332d97a2b 100644 --- a/test/harness/package-lock.json +++ b/test/harness/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@github/copilot": "^1.0.73", + "@github/copilot": "^1.0.76-0", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", @@ -501,9 +501,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.76-0.tgz", + "integrity": "sha512-4H/UdjreF5h2rJVx8u2pbZA3mdhkeY3VXWbERNPOTb8VX0dvNrNoytBRLDznDHvoaicw44209z+3wdbG9tkYMQ==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { @@ -513,20 +513,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.76-0", + "@github/copilot-darwin-x64": "1.0.76-0", + "@github/copilot-linux-arm64": "1.0.76-0", + "@github/copilot-linux-x64": "1.0.76-0", + "@github/copilot-linuxmusl-arm64": "1.0.76-0", + "@github/copilot-linuxmusl-x64": "1.0.76-0", + "@github/copilot-win32-arm64": "1.0.76-0", + "@github/copilot-win32-x64": "1.0.76-0" } }, "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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.76-0.tgz", + "integrity": "sha512-jn7vkFF9HeLfwvudGWJJXqZTipFNVlgSuUuwpezkNOGf4p/O4T5Df7/5OZzaXjWoZ737anUsWpANifhxmblSLg==", "cpu": [ "arm64" ], @@ -541,9 +541,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.76-0.tgz", + "integrity": "sha512-Yezh/nyit6XuaQKtCJ08xOz3Th3+dpyILsa9yIbgCvjxQFwu1RyEnweZJQXTRLV54AsW1Z98jv0V4eIghGjdRw==", "cpu": [ "x64" ], @@ -558,9 +558,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.76-0.tgz", + "integrity": "sha512-w/2JoB7Gu2Dd0RWwxEp2fTGiq+eZ6htli27IBfndpwJFTaKi61N1+T4X7PBMtke4jvrdDml0UVny1WTh+tXSzQ==", "cpu": [ "arm64" ], @@ -575,9 +575,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.76-0.tgz", + "integrity": "sha512-AOp6CxbR2yNpgjqee1AtzjkAwkoTVexMpeOBs7bm8Qgotljfkpz88FEMQx5n9mrQ8XbktOteNuoNucv+QPW/bQ==", "cpu": [ "x64" ], @@ -592,9 +592,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.76-0.tgz", + "integrity": "sha512-AQDap2izdmMbQmB8aqseSnHvm3uwRSAW1YIfVtPpRVggnKJp1tB3XkDd+/pi28yW0hQd3SLktzBJU8emTJsHOg==", "cpu": [ "arm64" ], @@ -609,9 +609,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.76-0.tgz", + "integrity": "sha512-Av8J2QkxmaiiFERGT6DZ90FSSpB+CWlek7pU4IGsbX9KGUB/xrWSxVjnM9gOyYuvG4w3O7dJBPfq+nChDqEWZA==", "cpu": [ "x64" ], @@ -626,9 +626,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.76-0.tgz", + "integrity": "sha512-hIk2y8td3cRx5dHI41gnBM3xE7Mj2GIFafr/Xc8OmN4nSXw897qzQd+nxA7IekWkyC9vYmi8eC37x4rV1Bmhkg==", "cpu": [ "arm64" ], @@ -643,9 +643,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.76-0", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.76-0.tgz", + "integrity": "sha512-0BwH5HcRY0vvCIYmtrGG6nKn1yS8YEhDVslGkgBWUAXXb6InzEuyVkb73gIIYLF4A9jz5d94BNXb9FuwclAPWg==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index c77a25f541..ea8a1c274f 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -14,7 +14,7 @@ "node": "^20.19.0 || >=22.12.0" }, "devDependencies": { - "@github/copilot": "^1.0.73", + "@github/copilot": "^1.0.76-0", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", From 4c232cdef646271bda20ecb1740613a7ad6dd025 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 28 Jul 2026 00:42:51 -0400 Subject: [PATCH 2/7] Adapt hand-written SDK code to CLI 1.0.76-0 wire changes CI was red across all six SDKs after the @github/copilot bump. All failures were build/typecheck breakages from the regenerated wire types. 1. New `sessionFs.sqliteTransaction` RPC The CLI added `sessionFs.sqliteTransaction` to the SessionFs client handler interface, so every hand-written provider adapter stopped satisfying it (TS2741 / Go interface mismatch / ty invalid-return-type / CS0535). Rust dispatches by method name so it still compiled, but silently had no handler. Added a required `transaction` member to the SQLite provider interface in each language plus the adapter plumbing: - nodejs: `SessionFsSqliteStatement`, `SessionFsSqliteTransactionFailure`, `SessionFsSqliteProvider.transaction`, adapter `sqliteTransaction` - go: `SessionFSSqliteProvider.SqliteTransaction`, `SessionFSSqliteTransactionFailure` - python: `SessionFsSqliteProvider.sqlite_transaction`, `SessionFsSqliteTransactionFailure` - dotnet: `ISessionFsSqliteProvider.TransactionAsync`, `SessionFsSqliteStatement`, `SessionFsSqliteTransactionException` - rust: `SessionFsSqliteProvider::sqlite_transaction`, `SessionFsSqliteTransactionError`, dispatch arm Provider errors and "sqlite not supported" both surface as a *result-level* classified error (busyOrLocked / fatal / postCommitAmbiguous) rather than a transport error, since the runtime uses the class for retry decisions. In-repo test providers were updated with real BEGIN IMMEDIATE / COMMIT / ROLLBACK implementations. 2. Rust codegen bug for primitive RPC results `session.cancelAllBackgroundAgents` has an inline `{"type":"integer"}` result. `getResultTypeName()` named it `SessionCancelAllBackgroundAgentsResult`, but the type-emitting loops in scripts/codegen/rust.ts only handled enum/array/map/object schemas, so no alias was emitted (E0425). Added `rustScalarType` / `emitRustScalarAlias` and regenerated. 3. Java records gained components - `SessionOptionsUpdateParams`: `shell`, `eventsLogIncludesSubagents` - `SessionHistoryTruncateResult`: `checkpointCleanupFailed`, `checkpointCleanupError` - `AssistantMessageEventData`: `rte` Fixed the positional constructor call sites in CopilotClient and two tests. 4. Collateral wire changes - `permissions.resetSessionApprovals` now takes a params object (Go + Rust e2e call sites) - `UIExitPlanModeResponse` gained `defer_implementation` (Rust struct literal) Generated by Copilot Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e615d062-bcb7-431e-aa9c-d3e47405723a --- dotnet/src/SessionFsProvider.cs | 116 ++++++++++++++++++ .../E2E/InMemorySessionFsSqliteHandler.cs | 58 +++++++-- dotnet/test/E2E/SessionFsE2ETests.cs | 3 + go/internal/e2e/rpc_session_state_e2e_test.go | 2 +- go/internal/e2e/session_fs_sqlite_e2e_test.go | 34 +++-- go/session_fs_provider.go | 74 +++++++++++ .../com/github/copilot/CopilotClient.java | 2 + .../copilot/SessionEventHandlingTest.java | 2 +- .../rpc/GeneratedRpcRecordsCoverageTest.java | 4 +- nodejs/src/index.ts | 3 + nodejs/src/sessionFsProvider.ts | 80 +++++++++++- nodejs/src/types.ts | 3 + nodejs/test/e2e/session_fs.e2e.test.ts | 24 ++++ nodejs/test/e2e/session_fs_sqlite.e2e.test.ts | 106 +++++++++++----- nodejs/test/session_fs_adapter.test.ts | 23 ++++ python/copilot/__init__.py | 2 + python/copilot/session_fs_provider.py | 78 ++++++++++++ python/e2e/test_session_fs_e2e.py | 19 +++ python/e2e/test_session_fs_sqlite_e2e.py | 46 ++++++- rust/src/generated/api_types.rs | 10 ++ rust/src/session_fs.rs | 59 ++++++++- rust/src/session_fs_dispatch.rs | 69 ++++++++++- rust/src/types.rs | 3 +- rust/tests/e2e/rpc_additional_edge_cases.rs | 5 +- rust/tests/e2e/rpc_session_state.rs | 5 +- rust/tests/e2e/rpc_tasks_and_handlers.rs | 1 + rust/tests/e2e/session_fs_sqlite.rs | 106 +++++++++++----- rust/tests/session_test.rs | 27 +++- scripts/codegen/rust.ts | 43 +++++++ 29 files changed, 910 insertions(+), 97 deletions(-) diff --git a/dotnet/src/SessionFsProvider.cs b/dotnet/src/SessionFsProvider.cs index fbb8df507d..d4e99567ca 100644 --- a/dotnet/src/SessionFsProvider.cs +++ b/dotnet/src/SessionFsProvider.cs @@ -3,6 +3,7 @@ *--------------------------------------------------------------------------------------------*/ using GitHub.Copilot.Rpc; +using System.Diagnostics.CodeAnalysis; using System.Text.Json; namespace GitHub.Copilot; @@ -27,6 +28,23 @@ public sealed class SessionFsSqliteResult public long? LastInsertRowid { get; set; } } +/// +/// One statement in an atomic SQLite transaction passed to +/// . +/// +[Experimental(Diagnostics.Experimental)] +public sealed class SessionFsSqliteStatement +{ + /// How to execute: "exec", "query", or "run". + public SessionFsSqliteQueryType QueryType { get; set; } + + /// SQL statement to execute. + public string Query { get; set; } = string.Empty; + + /// Optional named bind parameters. + public IDictionary? Params { get; set; } +} + /// /// Optional interface for subclasses that support /// per-session SQLite databases. Implement this interface on your provider to enable @@ -48,6 +66,20 @@ public interface ISessionFsSqliteProvider IDictionary? bindParams, CancellationToken cancellationToken); + /// + /// Executes atomically against the per-session database. + /// + /// Statements to execute in order, inside a single transaction. + /// Cancellation token. + /// One result per statement, in the same order as . + /// + /// Thrown to tell the runtime how the failure should be classified. Any other exception + /// is reported as . + /// + Task> TransactionAsync( + IList statements, + CancellationToken cancellationToken); + /// /// Checks whether the per-session SQLite database already exists, without creating it. /// @@ -55,6 +87,32 @@ public interface ISessionFsSqliteProvider Task ExistsAsync(CancellationToken cancellationToken); } +/// +/// Thrown by an to classify a failed SQLite transaction. +/// guarantees the transaction +/// rolled back and is safe to retry; +/// must never be retried. +/// +[Experimental(Diagnostics.Experimental)] +public sealed class SessionFsSqliteTransactionException : Exception +{ + /// Initializes a new instance of the class. + /// Human-readable failure description. + /// How the runtime should classify the failure. + /// Optional underlying exception. + public SessionFsSqliteTransactionException( + string message, + SessionFsSqliteTransactionErrorClass errorClass, + Exception? innerException = null) + : base(message, innerException) + { + ErrorClass = errorClass; + } + + /// Gets the failure classification reported to the runtime. + public SessionFsSqliteTransactionErrorClass ErrorClass { get; } +} + /// /// Base class for session filesystem providers. Subclasses override the /// virtual methods and use normal C# patterns (return values, throw exceptions). @@ -309,6 +367,64 @@ async Task ISessionFsHandler.SqliteQueryAsync(Sessio } } + async Task ISessionFsHandler.SqliteTransactionAsync(SessionFsSqliteTransactionRequest request, CancellationToken cancellationToken) + { + if (this is not ISessionFsSqliteProvider sqliteProvider) + { + return new SessionFsSqliteTransactionResult + { + Error = new SessionFsSqliteTransactionError + { + ErrorClass = SessionFsSqliteTransactionErrorClass.Fatal, + Message = "SQLite is not supported by this provider.", + }, + }; + } + + IList results; + try + { + var statements = request.Statements.Select(statement => new SessionFsSqliteStatement + { + QueryType = statement.QueryType, + Query = statement.Query, + Params = statement.Params?.ToDictionary(kvp => kvp.Key, kvp => JsonElementToValue(kvp.Value)), + }).ToList(); + results = await sqliteProvider.TransactionAsync(statements, cancellationToken).ConfigureAwait(false); + } + catch (SessionFsSqliteTransactionException ex) + { + return new SessionFsSqliteTransactionResult + { + Error = new SessionFsSqliteTransactionError { ErrorClass = ex.ErrorClass, Message = ex.Message }, + }; + } + catch (Exception ex) + { + return new SessionFsSqliteTransactionResult + { + Error = new SessionFsSqliteTransactionError + { + ErrorClass = SessionFsSqliteTransactionErrorClass.Fatal, + Message = ex.Message, + }, + }; + } + + return new SessionFsSqliteTransactionResult + { + Results = results.Select(result => new SessionFsSqliteQueryResult + { + Rows = result.Rows?.Select(row => (IDictionary)row.ToDictionary( + kvp => kvp.Key, + kvp => CopilotClient.ToJsonElementForWire(kvp.Value)!.Value)).ToList() ?? [], + Columns = result.Columns ?? [], + RowsAffected = result.RowsAffected, + LastInsertRowid = result.LastInsertRowid, + }).ToList(), + }; + } + async Task ISessionFsHandler.SqliteExistsAsync(SessionFsSqliteExistsRequest request, CancellationToken cancellationToken) { if (this is not ISessionFsSqliteProvider sqliteProvider) diff --git a/dotnet/test/E2E/InMemorySessionFsSqliteHandler.cs b/dotnet/test/E2E/InMemorySessionFsSqliteHandler.cs index 4e573ff5ca..8a6e81cd60 100644 --- a/dotnet/test/E2E/InMemorySessionFsSqliteHandler.cs +++ b/dotnet/test/E2E/InMemorySessionFsSqliteHandler.cs @@ -45,28 +45,68 @@ private SqliteConnection GetOrCreateDb() string query, IDictionary? bindParams, CancellationToken cancellationToken) + { + return Task.FromResult(RunStatement(GetOrCreateDb(), null, queryType, query, bindParams)); + } + + public Task> TransactionAsync( + IList statements, + CancellationToken cancellationToken) + { + var db = GetOrCreateDb(); + using var transaction = db.BeginTransaction(); + try + { + IList results = statements + .Select(statement => RunStatement(db, transaction, statement.QueryType, statement.Query, statement.Params) + ?? new SessionFsSqliteResult()) + .ToList(); + transaction.Commit(); + return Task.FromResult(results); + } + catch (SqliteException ex) + { + transaction.Rollback(); + var errorClass = ex.SqliteErrorCode is 5 or 6 + ? SessionFsSqliteTransactionErrorClass.BusyOrLocked + : SessionFsSqliteTransactionErrorClass.Fatal; + throw new SessionFsSqliteTransactionException(ex.Message, errorClass, ex); + } + catch (Exception ex) + { + transaction.Rollback(); + throw new SessionFsSqliteTransactionException(ex.Message, SessionFsSqliteTransactionErrorClass.Fatal, ex); + } + } + + private SessionFsSqliteResult? RunStatement( + SqliteConnection db, + SqliteTransaction? transaction, + SessionFsSqliteQueryType queryType, + string query, + IDictionary? bindParams) { sqliteCalls.Add(new SqliteCall(sessionId, queryType.Value, query)); var trimmed = query.Trim(); if (trimmed.Length == 0) { - return Task.FromResult(null); + return null; } - var db = GetOrCreateDb(); - if (queryType == SessionFsSqliteQueryType.Exec) { using var cmd = db.CreateCommand(); + cmd.Transaction = transaction; cmd.CommandText = trimmed; cmd.ExecuteNonQuery(); - return Task.FromResult(null); + return null; } if (queryType == SessionFsSqliteQueryType.Query) { using var cmd = db.CreateCommand(); + cmd.Transaction = transaction; cmd.CommandText = trimmed; AddParams(cmd, bindParams); @@ -88,33 +128,35 @@ private SqliteConnection GetOrCreateDb() rows.Add(row); } - return Task.FromResult(new SessionFsSqliteResult + return new SessionFsSqliteResult { Columns = columns, Rows = rows, RowsAffected = 0, - }); + }; } if (queryType == SessionFsSqliteQueryType.Run) { using var cmd = db.CreateCommand(); + cmd.Transaction = transaction; cmd.CommandText = trimmed; AddParams(cmd, bindParams); var rowsAffected = cmd.ExecuteNonQuery(); using var rowidCmd = db.CreateCommand(); + rowidCmd.Transaction = transaction; rowidCmd.CommandText = "SELECT last_insert_rowid()"; var lastRowid = rowidCmd.ExecuteScalar(); - return Task.FromResult(new SessionFsSqliteResult + return new SessionFsSqliteResult { Columns = [], Rows = [], RowsAffected = rowsAffected, LastInsertRowid = lastRowid is long l ? l : null, - }); + }; } throw new ArgumentException($"Unknown queryType: {queryType}"); diff --git a/dotnet/test/E2E/SessionFsE2ETests.cs b/dotnet/test/E2E/SessionFsE2ETests.cs index cf91e3ddc8..b2f93addda 100644 --- a/dotnet/test/E2E/SessionFsE2ETests.cs +++ b/dotnet/test/E2E/SessionFsE2ETests.cs @@ -616,6 +616,9 @@ protected override Task RenameAsync(string src, string dest, CancellationToken c Task ISessionFsSqliteProvider.QueryAsync(SessionFsSqliteQueryType queryType, string query, IDictionary? bindParams, CancellationToken cancellationToken) => Task.FromException(exception); + Task> ISessionFsSqliteProvider.TransactionAsync(IList statements, CancellationToken cancellationToken) => + Task.FromException>(exception); + Task ISessionFsSqliteProvider.ExistsAsync(CancellationToken cancellationToken) => Task.FromException(exception); } diff --git a/go/internal/e2e/rpc_session_state_e2e_test.go b/go/internal/e2e/rpc_session_state_e2e_test.go index 00c2e9ef63..4046ab97fe 100644 --- a/go/internal/e2e/rpc_session_state_e2e_test.go +++ b/go/internal/e2e/rpc_session_state_e2e_test.go @@ -1083,7 +1083,7 @@ func TestRPCSessionStateE2E(t *testing.T) { t.Errorf("Expected SetApproveAll(true) to succeed, got %+v", approve) } - reset, err := session.RPC.Permissions.ResetSessionApprovals(t.Context()) + reset, err := session.RPC.Permissions.ResetSessionApprovals(t.Context(), &rpc.PermissionsResetSessionApprovalsRequest{}) if err != nil { t.Fatalf("Failed to call ResetSessionApprovals: %v", err) } diff --git a/go/internal/e2e/session_fs_sqlite_e2e_test.go b/go/internal/e2e/session_fs_sqlite_e2e_test.go index fa3b49e488..745514b34e 100644 --- a/go/internal/e2e/session_fs_sqlite_e2e_test.go +++ b/go/internal/e2e/session_fs_sqlite_e2e_test.go @@ -198,6 +198,26 @@ func (p *inMemorySqliteProvider) Rename(src string, dest string) error { func (p *inMemorySqliteProvider) SqliteQuery(queryType rpc.SessionFSSqliteQueryType, query string, params map[string]any) (*copilot.SessionFSSqliteQueryResult, error) { p.mu.Lock() defer p.mu.Unlock() + return p.runQueryLocked(queryType, query), nil +} + +func (p *inMemorySqliteProvider) SqliteTransaction(statements []rpc.SessionFSSqliteTransactionStatement) ([]copilot.SessionFSSqliteQueryResult, error) { + p.mu.Lock() + defer p.mu.Unlock() + results := make([]copilot.SessionFSSqliteQueryResult, 0, len(statements)) + for _, statement := range statements { + results = append(results, *p.runQueryLocked(statement.QueryType, statement.Query)) + } + return results, nil +} + +// runQueryLocked returns canned results based on query type. The agent doesn't +// know or care whether a real SQLite database is behind this — it just receives +// SQL tool results. These stubs return plausible responses so the agent can +// proceed normally without pulling in a real SQLite dependency. +// +// Callers must hold p.mu. +func (p *inMemorySqliteProvider) runQueryLocked(queryType rpc.SessionFSSqliteQueryType, query string) *copilot.SessionFSSqliteQueryResult { p.hadQuery = true *p.sqliteCalls = append(*p.sqliteCalls, sqliteCall{ SessionID: p.sessionID, @@ -205,14 +225,10 @@ func (p *inMemorySqliteProvider) SqliteQuery(queryType rpc.SessionFSSqliteQueryT Query: query, }) - // Return canned results based on query type. The agent doesn't know or care - // whether a real SQLite database is behind this — it just receives SQL tool - // results. These stubs return plausible responses so the agent can proceed - // normally without pulling in a real SQLite dependency. upper := strings.ToUpper(strings.TrimSpace(query)) switch queryType { case rpc.SessionFSSqliteQueryTypeExec: - return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil + return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}} case rpc.SessionFSSqliteQueryTypeRun: lastID := int64(1) return &copilot.SessionFSSqliteQueryResult{ @@ -220,17 +236,17 @@ func (p *inMemorySqliteProvider) SqliteQuery(queryType rpc.SessionFSSqliteQueryT Rows: []map[string]any{}, RowsAffected: 1, LastInsertRowid: &lastID, - }, nil + } case rpc.SessionFSSqliteQueryTypeQuery: if strings.Contains(upper, "SELECT") { return &copilot.SessionFSSqliteQueryResult{ Columns: []string{"id", "name"}, Rows: []map[string]any{{"id": "a1", "name": "Widget"}}, - }, nil + } } - return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil + return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}} } - return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil + return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}} } func (p *inMemorySqliteProvider) SqliteExists() (bool, error) { diff --git a/go/session_fs_provider.go b/go/session_fs_provider.go index d2227d629e..45061ff8a0 100644 --- a/go/session_fs_provider.go +++ b/go/session_fs_provider.go @@ -58,10 +58,35 @@ type SessionFSProvider interface { type SessionFSSqliteProvider interface { // SqliteQuery executes a SQLite query against the provider's per-session database. SqliteQuery(queryType rpc.SessionFSSqliteQueryType, query string, params map[string]any) (*SessionFSSqliteQueryResult, error) + // SqliteTransaction executes statements atomically against the provider's + // per-session database, applying busy handling to every statement and rolling + // the whole batch back if any statement fails. It returns one result per + // statement, in the same order. + // + // Return a [*SessionFSSqliteTransactionFailure] to classify the failure for + // the runtime; any other error is reported as + // [rpc.SessionFSSqliteTransactionErrorClassFatal]. + SqliteTransaction(statements []rpc.SessionFSSqliteTransactionStatement) ([]SessionFSSqliteQueryResult, error) // SqliteExists checks whether the provider has a SQLite database for the session. SqliteExists() (bool, error) } +// SessionFSSqliteTransactionFailure classifies a SQLite transaction failure for +// the runtime. Return it from [SessionFSSqliteProvider.SqliteTransaction] with +// [rpc.SessionFSSqliteTransactionErrorClassBusyOrLocked] when SQLite reported +// BUSY or LOCKED before commit and the transaction was rolled back, so the +// runtime knows the call is safe to retry. +type SessionFSSqliteTransactionFailure struct { + // Class is the failure classification reported to the runtime. + Class rpc.SessionFSSqliteTransactionErrorClass + // Message describes the failure. + Message string +} + +func (e *SessionFSSqliteTransactionFailure) Error() string { + return e.Message +} + // SessionFSSqliteQueryResult holds the result of a SQLite query execution. // Same shape as the generated RPC type but without the Error field, // since providers signal errors by returning a Go error. @@ -230,6 +255,41 @@ func (a *sessionFSAdapter) SqliteQuery(request *rpc.SessionFSSqliteQueryRequest) }, nil } +func (a *sessionFSAdapter) SqliteTransaction(request *rpc.SessionFSSqliteTransactionRequest) (*rpc.SessionFSSqliteTransactionResult, error) { + sp, ok := a.provider.(SessionFSSqliteProvider) + if !ok { + return &rpc.SessionFSSqliteTransactionResult{ + Results: []rpc.SessionFSSqliteQueryResult{}, + Error: &rpc.SessionFSSqliteTransactionError{ + ErrorClass: rpc.SessionFSSqliteTransactionErrorClassFatal, + Message: "SQLite is not supported by this session filesystem provider", + }, + }, nil + } + results, err := sp.SqliteTransaction(request.Statements) + if err != nil { + return &rpc.SessionFSSqliteTransactionResult{ + Results: []rpc.SessionFSSqliteQueryResult{}, + Error: toSessionFSSqliteTransactionError(err), + }, nil + } + wireResults := make([]rpc.SessionFSSqliteQueryResult, 0, len(results)) + for _, result := range results { + var wireRowid *int64 + if result.LastInsertRowid != nil { + rowid := *result.LastInsertRowid + wireRowid = &rowid + } + wireResults = append(wireResults, rpc.SessionFSSqliteQueryResult{ + Columns: result.Columns, + Rows: result.Rows, + RowsAffected: result.RowsAffected, + LastInsertRowid: wireRowid, + }) + } + return &rpc.SessionFSSqliteTransactionResult{Results: wireResults}, nil +} + func (a *sessionFSAdapter) SqliteExists(request *rpc.SessionFSSqliteExistsRequest) (*rpc.SessionFSSqliteExistsResult, error) { sp, ok := a.provider.(SessionFSSqliteProvider) if !ok { @@ -250,3 +310,17 @@ func toSessionFSError(err error) *rpc.SessionFSError { msg := err.Error() return &rpc.SessionFSError{Code: code, Message: &msg} } + +func toSessionFSSqliteTransactionError(err error) *rpc.SessionFSSqliteTransactionError { + var failure *SessionFSSqliteTransactionFailure + if errors.As(err, &failure) { + return &rpc.SessionFSSqliteTransactionError{ + ErrorClass: failure.Class, + Message: failure.Message, + } + } + return &rpc.SessionFSSqliteTransactionError{ + ErrorClass: rpc.SessionFSSqliteTransactionErrorClassFatal, + Message: err.Error(), + } +} diff --git a/java/src/main/java/com/github/copilot/CopilotClient.java b/java/src/main/java/com/github/copilot/CopilotClient.java index 7244c8c0a5..7112a3d339 100644 --- a/java/src/main/java/com/github/copilot/CopilotClient.java +++ b/java/src/main/java/com/github/copilot/CopilotClient.java @@ -941,6 +941,7 @@ CompletableFuture updateSessionOptionsForMode(CopilotSession session, Bool null, // excludedBuiltinAgents null, // toolFilterPrecedence null, // enableScriptSafety + null, // shell null, // shellInitProfile null, // shellProcessFlags null, // sandboxConfig @@ -966,6 +967,7 @@ CompletableFuture updateSessionOptionsForMode(CopilotSession session, Bool null, // enableReasoningSummaries null, // agentContext null, // eventsLogDirectory + null, // eventsLogIncludesSubagents null, // additionalContentExclusionPolicies patchSchedule, // manageScheduleEnabled null, // sessionCapabilities diff --git a/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java b/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java index 1cf3ceff1f..6363e90caf 100644 --- a/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java +++ b/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java @@ -865,7 +865,7 @@ private SessionStartEvent createSessionStartEvent(String sessionId) { private AssistantMessageEvent createAssistantMessageEvent(String content) { var event = new AssistantMessageEvent(); var data = new AssistantMessageEvent.AssistantMessageEventData(null, null, content, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null); + null, null, null, null, null, null, null, null, null, null, null, null, null); event.setData(data); return event; } diff --git a/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java b/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java index 2b6b0164d5..f5536e7153 100644 --- a/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java +++ b/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java @@ -614,8 +614,10 @@ void sessionHistoryCompactResult_nested() { @Test void sessionHistoryTruncateResult_record() { - var result = new SessionHistoryTruncateResult(3L); + var result = new SessionHistoryTruncateResult(3L, false, null); assertEquals(3L, result.eventsRemoved()); + assertEquals(false, result.checkpointCleanupFailed()); + assertNull(result.checkpointCleanupError()); } @Test diff --git a/nodejs/src/index.ts b/nodejs/src/index.ts index c1ab289150..e0569a7d68 100644 --- a/nodejs/src/index.ts +++ b/nodejs/src/index.ts @@ -32,6 +32,7 @@ export { CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, + SessionFsSqliteTransactionFailure, SYSTEM_MESSAGE_SECTIONS, } from "./types.js"; // Re-export the generated session-event types (every *Event interface and @@ -141,6 +142,8 @@ export type { SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, + SessionFsSqliteStatement, + SessionFsSqliteTransactionErrorClass, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, diff --git a/nodejs/src/sessionFsProvider.ts b/nodejs/src/sessionFsProvider.ts index 0bc1987503..8280e701d8 100644 --- a/nodejs/src/sessionFsProvider.ts +++ b/nodejs/src/sessionFsProvider.ts @@ -8,10 +8,12 @@ import type { SessionFsStatResult, SessionFsReaddirWithTypesEntry, SessionFsSqliteQueryResult as GeneratedSqliteQueryResult, + SessionFsSqliteTransactionError as GeneratedSqliteTransactionError, + SessionFsSqliteTransactionErrorClass, SessionFsSqliteQueryType, } from "./generated/rpc.js"; -export type { SessionFsSqliteQueryType }; +export type { SessionFsSqliteQueryType, SessionFsSqliteTransactionErrorClass }; /** * File metadata returned by {@link SessionFsProvider.stat}. @@ -27,6 +29,40 @@ export type SessionFsFileInfo = Omit; */ export type SessionFsSqliteQueryResult = Omit; +/** + * One statement in an atomic SQLite transaction passed to + * {@link SessionFsSqliteProvider.transaction}. + */ +export interface SessionFsSqliteStatement { + /** How to execute: `"exec"` for DDL/multi-statement, `"query"` for SELECT, `"run"` for INSERT/UPDATE/DELETE. */ + queryType: SessionFsSqliteQueryType; + + /** SQL statement to execute. */ + query: string; + + /** Optional named bind parameters. */ + params?: Record; +} + +/** + * Error thrown by {@link SessionFsSqliteProvider.transaction} to classify a + * transaction failure for the runtime. + * + * Any other thrown value is reported as `"fatal"`. Throw this with + * `"busyOrLocked"` when SQLite reported BUSY/LOCKED before commit and the + * transaction was rolled back, so the runtime knows the call is safe to retry. + */ +export class SessionFsSqliteTransactionFailure extends Error { + /** Failure classification reported to the runtime. */ + readonly errorClass: SessionFsSqliteTransactionErrorClass; + + constructor(message: string, errorClass: SessionFsSqliteTransactionErrorClass = "fatal") { + super(message); + this.name = "SessionFsSqliteTransactionFailure"; + this.errorClass = errorClass; + } +} + /** * SQLite operations for the per-session database. * Implementers provide query execution and existence checking. @@ -45,6 +81,18 @@ export interface SessionFsSqliteProvider { params?: Record ): Promise; + /** + * Execute `statements` atomically against the per-session database. + * + * Apply busy handling to every statement and roll back the whole batch if + * any statement fails. Throw {@link SessionFsSqliteTransactionFailure} to + * classify the failure; any other thrown value is reported as `"fatal"`. + * + * @param statements - Statements to execute in order inside a single transaction. + * @returns One result per statement, in the same order. + */ + transaction(statements: SessionFsSqliteStatement[]): Promise; + /** * Check whether the per-session database already exists, without creating it. */ @@ -219,6 +267,26 @@ export function createSessionFsAdapter(provider: SessionFsProvider): SessionFsHa ); return result ?? { rows: [], columns: [], rowsAffected: 0 }; }, + sqliteTransaction: async ({ statements }) => { + if (!provider.sqlite) { + throw new Error("SQLite is not supported by this provider"); + } + try { + const results = await provider.sqlite.transaction( + statements.map((statement) => ({ + queryType: statement.queryType, + query: statement.query, + params: normalizeSqliteParams(statement.params), + })) + ); + return { results: results.map((result) => ({ ...result })) }; + } catch (err) { + // Unlike sqliteQuery, transaction failures carry a classification the + // runtime uses to decide whether a retry is safe, so they are reported + // as a result-level error instead of a JSON-RPC error. + return { results: [], error: toSqliteTransactionError(err) }; + } + }, sqliteExists: async () => { if (!provider.sqlite) { throw new Error("SQLite is not supported by this provider"); @@ -233,3 +301,13 @@ function toSessionFsError(err: unknown): SessionFsError { const code = e.code === "ENOENT" ? "ENOENT" : "UNKNOWN"; return { code, message: e.message ?? String(err) }; } + +function toSqliteTransactionError(err: unknown): GeneratedSqliteTransactionError { + if (err instanceof SessionFsSqliteTransactionFailure) { + return { errorClass: err.errorClass, message: err.message }; + } + return { + errorClass: "fatal", + message: err instanceof Error ? err.message : String(err), + }; +} diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index e48c9064c1..988c1e21fb 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -43,6 +43,9 @@ export type { SessionFsFileInfo } from "./sessionFsProvider.js"; export type { SessionFsSqliteQueryResult } from "./sessionFsProvider.js"; export type { SessionFsSqliteQueryType } from "./sessionFsProvider.js"; export type { SessionFsSqliteProvider } from "./sessionFsProvider.js"; +export type { SessionFsSqliteStatement } from "./sessionFsProvider.js"; +export type { SessionFsSqliteTransactionErrorClass } from "./sessionFsProvider.js"; +export { SessionFsSqliteTransactionFailure } from "./sessionFsProvider.js"; export type { LlmInferenceHeaders } from "./generated/rpc.js"; export type { CopilotRequestContext } from "./copilotRequestHandler.js"; export { diff --git a/nodejs/test/e2e/session_fs.e2e.test.ts b/nodejs/test/e2e/session_fs.e2e.test.ts index 11de9582e1..5726d39b5f 100644 --- a/nodejs/test/e2e/session_fs.e2e.test.ts +++ b/nodejs/test/e2e/session_fs.e2e.test.ts @@ -299,6 +299,20 @@ describe("Session Fs Adapter", () => { rowsAffected: 0, }; }, + async transaction(statements) { + return statements.map((statement) => ({ + columns: ["sessionId", "query", "queryType", "answer"], + rows: [ + { + sessionId: "handler-session", + query: statement.query, + queryType: statement.queryType, + answer: statement.params?.answer, + }, + ], + rowsAffected: 0, + })); + }, async exists() { return true; }, @@ -433,6 +447,9 @@ describe("Session Fs Adapter", () => { query: async () => { throw enoent; }, + transaction: async () => { + throw enoent; + }, exists: async () => { throw enoent; }, @@ -589,6 +606,13 @@ function createTestSessionFsHandler( rowsAffected: 0, }; }, + async transaction(statements) { + return statements.map(() => ({ + columns: [], + rows: [], + rowsAffected: 0, + })); + }, async exists() { return true; }, diff --git a/nodejs/test/e2e/session_fs_sqlite.e2e.test.ts b/nodejs/test/e2e/session_fs_sqlite.e2e.test.ts index cea67c1453..4383f561f0 100644 --- a/nodejs/test/e2e/session_fs_sqlite.e2e.test.ts +++ b/nodejs/test/e2e/session_fs_sqlite.e2e.test.ts @@ -18,6 +18,8 @@ import { type SessionFsFileInfo, type SessionFsSqliteQueryResult, type SessionFsSqliteQueryType, + type SessionFsSqliteStatement, + SessionFsSqliteTransactionFailure, } from "../../src/index.js"; import { createSdkTestContext } from "./harness/sdkTestContext.js"; @@ -207,41 +209,38 @@ function createTestSessionFsHandlerWithSqlite( params?: Record ): Promise { sqliteCalls.push({ sessionId: session.sessionId, queryType, query }); - + return runStatement(getOrCreateDb(), queryType, query, params); + }, + async transaction( + statements: SessionFsSqliteStatement[] + ): Promise { const database = getOrCreateDb(); - const trimmed = query.trim(); - if (trimmed.length === 0) { - return undefined; - } - - switch (queryType) { - case "exec": - database.exec(trimmed); - return undefined; - - case "query": { - const stmt = database.prepare(trimmed); - const rows = (params ? stmt.all(params) : stmt.all()) as Record< - string, - unknown - >[]; - const columns = rows.length > 0 ? Object.keys(rows[0]) : []; - return { rows, columns, rowsAffected: 0 }; - } - - case "run": { - const stmt = database.prepare(trimmed); - const result = params ? stmt.run(params) : stmt.run(); - return { - rows: [], - columns: [], - rowsAffected: Number(result.changes), - lastInsertRowid: - result.lastInsertRowid !== undefined - ? Number(result.lastInsertRowid) - : undefined, - }; - } + database.exec("BEGIN IMMEDIATE"); + try { + const results = statements.map((statement) => { + sqliteCalls.push({ + sessionId: session.sessionId, + queryType: statement.queryType, + query: statement.query, + }); + return ( + runStatement( + database, + statement.queryType, + statement.query, + statement.params + ) ?? { rows: [], columns: [], rowsAffected: 0 } + ); + }); + database.exec("COMMIT"); + return results; + } catch (err) { + database.exec("ROLLBACK"); + const message = err instanceof Error ? err.message : String(err); + throw new SessionFsSqliteTransactionFailure( + message, + /busy|locked/i.test(message) ? "busyOrLocked" : "fatal" + ); } }, async exists(): Promise { @@ -250,3 +249,42 @@ function createTestSessionFsHandlerWithSqlite( }, }; } + +function runStatement( + database: DatabaseSync, + queryType: SessionFsSqliteQueryType, + query: string, + params?: Record +): SessionFsSqliteQueryResult | undefined { + const trimmed = query.trim(); + if (trimmed.length === 0) { + return undefined; + } + + switch (queryType) { + case "exec": + database.exec(trimmed); + return undefined; + + case "query": { + const stmt = database.prepare(trimmed); + const rows = (params ? stmt.all(params) : stmt.all()) as Record[]; + const columns = rows.length > 0 ? Object.keys(rows[0]) : []; + return { rows, columns, rowsAffected: 0 }; + } + + case "run": { + const stmt = database.prepare(trimmed); + const result = params ? stmt.run(params) : stmt.run(); + return { + rows: [], + columns: [], + rowsAffected: Number(result.changes), + lastInsertRowid: + result.lastInsertRowid !== undefined + ? Number(result.lastInsertRowid) + : undefined, + }; + } + } +} diff --git a/nodejs/test/session_fs_adapter.test.ts b/nodejs/test/session_fs_adapter.test.ts index fb62d99045..98749dffba 100644 --- a/nodejs/test/session_fs_adapter.test.ts +++ b/nodejs/test/session_fs_adapter.test.ts @@ -67,6 +67,20 @@ describe("SessionFsAdapter", () => { rowsAffected: 0, }; }, + async transaction(statements) { + return statements.map((statement) => ({ + columns: ["sessionId", "query", "queryType", "answer"], + rows: [ + { + sessionId, + query: statement.query, + queryType: statement.queryType, + answer: statement.params?.answer, + }, + ], + rowsAffected: 0, + })); + }, async exists() { return true; }, @@ -205,6 +219,7 @@ describe("SessionFsAdapter", () => { rename: () => Promise.reject(error), sqlite: { query: () => Promise.reject(error), + transaction: () => Promise.reject(error), exists: () => Promise.reject(error), }, }; @@ -244,6 +259,14 @@ describe("SessionFsAdapter", () => { ).rejects.toThrow("missing file"); await expect(handler.sqliteExists({ sessionId })).rejects.toThrow("missing file"); + // sqliteTransaction reports a classified result-level error instead + const transaction = await handler.sqliteTransaction({ + sessionId, + statements: [{ query: "select 1", queryType: "query" }], + }); + expect(transaction.results).toEqual([]); + expect(transaction.error).toEqual({ errorClass: "fatal", message: "missing file" }); + const unknownProvider = createSessionFsAdapter(makeThrowingProvider(makeError("bad path"))); const unknownError = await unknownProvider.writeFile({ sessionId, diff --git a/python/copilot/__init__.py b/python/copilot/__init__.py index 6fb59a8957..829f1542b8 100644 --- a/python/copilot/__init__.py +++ b/python/copilot/__init__.py @@ -175,6 +175,7 @@ SessionFsProvider, SessionFsSqliteProvider, SessionFsSqliteQueryResult, + SessionFsSqliteTransactionFailure, create_session_fs_adapter, ) from .tools import ( @@ -318,6 +319,7 @@ "SessionFsProvider", "SessionFsSqliteProvider", "SessionFsSqliteQueryResult", + "SessionFsSqliteTransactionFailure", "SessionHooks", "SessionLimitsConfig", "SessionLifecycleEvent", diff --git a/python/copilot/session_fs_provider.py b/python/copilot/session_fs_provider.py index 355724da48..c07aae6d42 100644 --- a/python/copilot/session_fs_provider.py +++ b/python/copilot/session_fs_provider.py @@ -34,11 +34,19 @@ SessionFSReadFileResult, SessionFSSqliteExistsResult, SessionFSSqliteQueryType, + SessionFSSqliteTransactionErrorClass, + SessionFSSqliteTransactionStatement, SessionFSStatResult, ) from .generated.rpc import ( SessionFSSqliteQueryResult as _GeneratedSqliteQueryResult, ) +from .generated.rpc import ( + SessionFSSqliteTransactionError as _GeneratedSqliteTransactionError, +) +from .generated.rpc import ( + SessionFSSqliteTransactionResult as _GeneratedSqliteTransactionResult, +) @dataclass @@ -130,11 +138,42 @@ async def sqlite_query( no result set is produced; the adapter will substitute an empty result. """ + @abc.abstractmethod + async def sqlite_transaction( + self, + statements: list[SessionFSSqliteTransactionStatement], + ) -> list[SessionFsSqliteQueryResult]: + """Execute ``statements`` atomically against the per-session database. + + Return one result per statement, in order. Raise + :class:`SessionFsSqliteTransactionFailure` to tell the runtime how the + failure should be classified; any other exception is reported as + ``fatal``. + """ + @abc.abstractmethod async def sqlite_exists(self) -> bool: """Return whether the provider has a SQLite database for this session.""" +class SessionFsSqliteTransactionFailure(Exception): + """Raised by a provider to classify a failed SQLite transaction. + + ``busy_or_locked`` guarantees the transaction rolled back and is safe to + retry; ``post_commit_ambiguous`` must never be retried. + """ + + def __init__( + self, + message: str, + error_class: SessionFSSqliteTransactionErrorClass = ( + SessionFSSqliteTransactionErrorClass.FATAL + ), + ) -> None: + super().__init__(message) + self.error_class = error_class + + @dataclass class SessionFsSqliteQueryResult: """Result of a SQLite query execution. @@ -294,6 +333,45 @@ async def sqlite_query(self, params: Any) -> _GeneratedSqliteQueryResult: last_insert_rowid=result.last_insert_rowid, ) + async def sqlite_transaction(self, params: Any) -> _GeneratedSqliteTransactionResult: + if not isinstance(self._p, SessionFsSqliteProvider): + return _GeneratedSqliteTransactionResult( + results=[], + error=_GeneratedSqliteTransactionError( + error_class=SessionFSSqliteTransactionErrorClass.FATAL, + message="SQLite is not supported by this SessionFs provider", + ), + ) + try: + results = await self._p.sqlite_transaction(list(params.statements)) + except SessionFsSqliteTransactionFailure as exc: + return _GeneratedSqliteTransactionResult( + results=[], + error=_GeneratedSqliteTransactionError( + error_class=exc.error_class, + message=str(exc), + ), + ) + except Exception as exc: + return _GeneratedSqliteTransactionResult( + results=[], + error=_GeneratedSqliteTransactionError( + error_class=SessionFSSqliteTransactionErrorClass.FATAL, + message=str(exc), + ), + ) + return _GeneratedSqliteTransactionResult( + results=[ + _GeneratedSqliteQueryResult( + columns=result.columns, + rows=result.rows, + rows_affected=result.rows_affected, + last_insert_rowid=result.last_insert_rowid, + ) + for result in results + ], + ) + async def sqlite_exists(self, params: Any) -> SessionFSSqliteExistsResult: if not isinstance(self._p, SessionFsSqliteProvider): return SessionFSSqliteExistsResult.from_dict({"exists": False}) diff --git a/python/e2e/test_session_fs_e2e.py b/python/e2e/test_session_fs_e2e.py index fbfde6ee78..0d86303264 100644 --- a/python/e2e/test_session_fs_e2e.py +++ b/python/e2e/test_session_fs_e2e.py @@ -280,6 +280,8 @@ async def test_should_map_all_sessionfs_handler_operations(self, ctx: E2ETestCon SessionFSSqliteExistsRequest, SessionFSSqliteQueryRequest, SessionFSSqliteQueryType, + SessionFSSqliteTransactionErrorClass, + SessionFSSqliteTransactionRequest, SessionFSStatRequest, SessionFSWriteFileRequest, ) @@ -403,6 +405,15 @@ async def test_should_map_all_sessionfs_handler_operations(self, ctx: E2ETestCon assert sqlite_query.error is not None assert sqlite_query.error.code == SessionFSErrorCode.UNKNOWN + sqlite_transaction = await handler.sqlite_transaction( + SessionFSSqliteTransactionRequest(session_id=session_id, statements=[]) + ) + assert sqlite_transaction.results == [] + assert sqlite_transaction.error is not None + assert ( + sqlite_transaction.error.error_class == SessionFSSqliteTransactionErrorClass.FATAL + ) + sqlite_exists = await handler.sqlite_exists( SessionFSSqliteExistsRequest(session_id=session_id) ) @@ -429,6 +440,8 @@ async def test_sessionfsprovider_converts_exceptions_to_rpc_errors(self): SessionFSSqliteExistsRequest, SessionFSSqliteQueryRequest, SessionFSSqliteQueryType, + SessionFSSqliteTransactionErrorClass, + SessionFSSqliteTransactionRequest, SessionFSStatRequest, SessionFSWriteFileRequest, ) @@ -536,6 +549,12 @@ def assert_fs_error(error) -> None: assert sqlite_query.columns == [] assert sqlite_query.rows == [] assert sqlite_query.rows_affected == 0 + sqlite_transaction = await handler.sqlite_transaction( + SessionFSSqliteTransactionRequest(session_id=sid, statements=[]) + ) + assert sqlite_transaction.results == [] + assert sqlite_transaction.error is not None + assert sqlite_transaction.error.error_class == SessionFSSqliteTransactionErrorClass.FATAL sqlite_exists = await handler.sqlite_exists(SessionFSSqliteExistsRequest(session_id=sid)) assert sqlite_exists.exists is False diff --git a/python/e2e/test_session_fs_sqlite_e2e.py b/python/e2e/test_session_fs_sqlite_e2e.py index c82cc793f1..d5d79edd47 100644 --- a/python/e2e/test_session_fs_sqlite_e2e.py +++ b/python/e2e/test_session_fs_sqlite_e2e.py @@ -8,6 +8,7 @@ import sqlite3 import tempfile from pathlib import Path +from typing import Any import pytest import pytest_asyncio @@ -17,6 +18,8 @@ SessionFSReaddirWithTypesEntry, SessionFSReaddirWithTypesEntryType, SessionFSSqliteQueryType, + SessionFSSqliteTransactionErrorClass, + SessionFSSqliteTransactionStatement, ) from copilot.session import PermissionHandler from copilot.session_fs_provider import ( @@ -24,6 +27,7 @@ SessionFsProvider, SessionFsSqliteProvider, SessionFsSqliteQueryResult, + SessionFsSqliteTransactionFailure, ) from .testharness import DEFAULT_GITHUB_TOKEN, E2ETestContext @@ -151,6 +155,41 @@ async def sqlite_query( query: str, params: dict[str, float | str | None] | None = None, ) -> SessionFsSqliteQueryResult | None: + return self._run_statement(self._get_or_create_db(), query_type, query, params) + + async def sqlite_transaction( + self, + statements: list[SessionFSSqliteTransactionStatement], + ) -> list[SessionFsSqliteQueryResult]: + db = self._get_or_create_db() + db.execute("BEGIN IMMEDIATE") + try: + results = [ + self._run_statement( + db, statement.query_type, statement.query, statement.params, commit=False + ) + for statement in statements + ] + db.commit() + except Exception as exc: + db.rollback() + message = str(exc) + error_class = ( + SessionFSSqliteTransactionErrorClass.BUSY_OR_LOCKED + if "locked" in message or "busy" in message + else SessionFSSqliteTransactionErrorClass.FATAL + ) + raise SessionFsSqliteTransactionFailure(message, error_class) from exc + return results + + def _run_statement( + self, + db: sqlite3.Connection, + query_type: SessionFSSqliteQueryType, + query: str, + params: dict[str, Any] | None = None, + commit: bool = True, + ) -> SessionFsSqliteQueryResult: self._sqlite_calls.append( { "sessionId": self._session_id, @@ -159,14 +198,14 @@ async def sqlite_query( } ) - db = self._get_or_create_db() trimmed = query.strip() if not trimmed: return SessionFsSqliteQueryResult(columns=[], rows=[], rows_affected=0) if query_type == SessionFSSqliteQueryType.EXEC: db.executescript(trimmed) - db.commit() + if commit: + db.commit() return SessionFsSqliteQueryResult(columns=[], rows=[], rows_affected=0) if query_type == SessionFSSqliteQueryType.QUERY: @@ -177,7 +216,8 @@ async def sqlite_query( # run (INSERT/UPDATE/DELETE) cursor = db.execute(trimmed, params or {}) - db.commit() + if commit: + db.commit() return SessionFsSqliteQueryResult( columns=[], rows=[], diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 834566ee30..653aba02e6 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -22620,6 +22620,16 @@ pub type UIElicitationResponseContent = HashMap; ///
pub type AccountGetAllUsersResult = Vec; +/// The number of running background agents (task-registry agents) that were cancelled. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+pub type SessionCancelAllBackgroundAgentsResult = i64; + /// Standard MCP CallToolResult /// ///
diff --git a/rust/src/session_fs.rs b/rust/src/session_fs.rs index da4d3e3c96..68babd0c30 100644 --- a/rust/src/session_fs.rs +++ b/rust/src/session_fs.rs @@ -47,11 +47,14 @@ use std::fmt; use async_trait::async_trait; -pub use crate::generated::api_types::SessionFsSqliteQueryType; use crate::generated::api_types::{ SessionFsError, SessionFsErrorCode, SessionFsReaddirWithTypesEntry, SessionFsReaddirWithTypesEntryType, SessionFsSetProviderConventions, SessionFsStatResult, }; +pub use crate::generated::api_types::{ + SessionFsSqliteQueryType, SessionFsSqliteTransactionErrorClass, + SessionFsSqliteTransactionStatement, +}; use crate::{Custom, Repr}; /// Optional capabilities declared by a session filesystem provider. @@ -528,10 +531,64 @@ pub trait SessionFsSqliteProvider: Send + Sync { params: Option<&HashMap>, ) -> Result, FsError>; + /// Execute `statements` atomically against the provider's per-session + /// database, returning one result per statement, in order. + /// + /// Return `Err` with a [`SessionFsSqliteTransactionError`] describing how + /// the failure should be classified. `BusyOrLocked` guarantees the + /// transaction rolled back and is safe to retry; `PostCommitAmbiguous` + /// must never be retried. + async fn sqlite_transaction( + &self, + statements: &[SessionFsSqliteTransactionStatement], + ) -> Result, SessionFsSqliteTransactionError>; + /// Check whether the provider has a SQLite database for this session. async fn sqlite_exists(&self) -> Result; } +/// Classified SQLite transaction failure returned by +/// [`SessionFsSqliteProvider::sqlite_transaction`]. +#[derive(Debug, Clone)] +pub struct SessionFsSqliteTransactionError { + /// How the runtime should classify the failure. + pub error_class: SessionFsSqliteTransactionErrorClass, + /// Human-readable failure description. + pub message: String, +} + +impl SessionFsSqliteTransactionError { + /// Create a `Fatal` transaction error with the given message. + pub fn fatal(message: impl Into) -> Self { + Self { + error_class: SessionFsSqliteTransactionErrorClass::Fatal, + message: message.into(), + } + } + + /// Create a `BusyOrLocked` transaction error with the given message. + pub fn busy_or_locked(message: impl Into) -> Self { + Self { + error_class: SessionFsSqliteTransactionErrorClass::BusyOrLocked, + message: message.into(), + } + } +} + +impl std::fmt::Display for SessionFsSqliteTransactionError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(&self.message) + } +} + +impl std::error::Error for SessionFsSqliteTransactionError {} + +impl From for SessionFsSqliteTransactionError { + fn from(error: FsError) -> Self { + Self::fatal(error.to_string()) + } +} + /// Result of a SQLite query execution via [`SessionFsSqliteProvider::sqlite_query`]. /// /// Same shape as the generated RPC type but without the `error` field, diff --git a/rust/src/session_fs_dispatch.rs b/rust/src/session_fs_dispatch.rs index 9c5780d37f..c84981ac0c 100644 --- a/rust/src/session_fs_dispatch.rs +++ b/rust/src/session_fs_dispatch.rs @@ -18,7 +18,10 @@ use crate::generated::api_types::{ SessionFsReaddirWithTypesRequest, SessionFsReaddirWithTypesResult, SessionFsRenameRequest, SessionFsRmRequest, SessionFsSqliteExistsParams, SessionFsSqliteExistsResult, SessionFsSqliteQueryRequest, SessionFsSqliteQueryResult as GeneratedSqliteQueryResult, - SessionFsStatRequest, SessionFsStatResult, SessionFsWriteFileRequest, + SessionFsSqliteTransactionError as GeneratedSqliteTransactionError, + SessionFsSqliteTransactionErrorClass, SessionFsSqliteTransactionRequest, + SessionFsSqliteTransactionResult as GeneratedSqliteTransactionResult, SessionFsStatRequest, + SessionFsStatResult, SessionFsWriteFileRequest, }; use crate::session_fs::SessionFsProvider; use crate::{Client, JsonRpcRequest, JsonRpcResponse, error_codes}; @@ -371,6 +374,69 @@ pub(crate) async fn sqlite_query( respond(client, id, result).await; } +pub(crate) async fn sqlite_transaction( + client: &Client, + provider: &Arc, + request: JsonRpcRequest, +) { + let params: SessionFsSqliteTransactionRequest = match parse_params(&request) { + Some(p) => p, + None => { + send_error( + client, + request.id, + "invalid sessionFs.sqliteTransaction params", + ) + .await; + return; + } + }; + let id = request.id; + let sqlite = match provider.sqlite() { + Some(s) => s, + None => { + // SQLite not supported — return a result-level error, not a + // transport error, so the CLI can surface it gracefully. + respond( + client, + id, + GeneratedSqliteTransactionResult { + results: Vec::new(), + error: Some(GeneratedSqliteTransactionError { + error_class: SessionFsSqliteTransactionErrorClass::Fatal, + message: "SQLite is not supported by this SessionFs provider".to_string(), + }), + }, + ) + .await; + return; + } + }; + let result = match sqlite.sqlite_transaction(¶ms.statements).await { + Ok(results) => GeneratedSqliteTransactionResult { + results: results + .into_iter() + .map(|result| GeneratedSqliteQueryResult { + columns: result.columns, + rows: result.rows, + rows_affected: result.rows_affected, + last_insert_rowid: result.last_insert_rowid, + error: None, + }) + .collect(), + error: None, + }, + Err(e) => GeneratedSqliteTransactionResult { + results: Vec::new(), + error: Some(GeneratedSqliteTransactionError { + error_class: e.error_class, + message: e.message, + }), + }, + }; + respond(client, id, result).await; +} + pub(crate) async fn sqlite_exists( client: &Client, provider: &Arc, @@ -431,6 +497,7 @@ pub(crate) async fn dispatch( "sessionFs.rm" => rm(client, &provider, request).await, "sessionFs.rename" => rename(client, &provider, request).await, "sessionFs.sqliteQuery" => sqlite_query(client, &provider, request).await, + "sessionFs.sqliteTransaction" => sqlite_transaction(client, &provider, request).await, "sessionFs.sqliteExists" => sqlite_exists(client, &provider, request).await, _ => { warn!(method = %method, "unknown sessionFs.* method"); diff --git a/rust/src/types.rs b/rust/src/types.rs index dcbb51e488..67e6df3ea6 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -33,7 +33,8 @@ use crate::provider_token::BearerTokenProvider; pub use crate::session_fs::{ DirEntry, DirEntryKind, FileInfo, FsError, SessionFsCapabilities, SessionFsConfig, SessionFsConventions, SessionFsProvider, SessionFsSqliteProvider, SessionFsSqliteQueryResult, - SessionFsSqliteQueryType, + SessionFsSqliteQueryType, SessionFsSqliteTransactionError, + SessionFsSqliteTransactionErrorClass, SessionFsSqliteTransactionStatement, }; pub use crate::trace_context::{TraceContext, TraceContextProvider}; use crate::transforms::SystemMessageTransform; diff --git a/rust/tests/e2e/rpc_additional_edge_cases.rs b/rust/tests/e2e/rpc_additional_edge_cases.rs index cce35a9856..135b394959 100644 --- a/rust/tests/e2e/rpc_additional_edge_cases.rs +++ b/rust/tests/e2e/rpc_additional_edge_cases.rs @@ -1,5 +1,6 @@ use github_copilot_sdk::rpc::{ - ModeSetRequest, NameSetRequest, PermissionsSetApproveAllRequest, PlanUpdateRequest, + ModeSetRequest, NameSetRequest, PermissionsResetSessionApprovalsRequest, + PermissionsSetApproveAllRequest, PlanUpdateRequest, ShellExecRequest, WorkspacesCreateFileRequest, WorkspacesReadFileRequest, }; use github_copilot_sdk::session_events::SessionMode; @@ -365,7 +366,7 @@ async fn permissions_reset_session_approvals_on_fresh_session_is_noop() { let result = session .rpc() .permissions() - .reset_session_approvals() + .reset_session_approvals(PermissionsResetSessionApprovalsRequest::default()) .await .expect("reset approvals"); assert!(result.success); diff --git a/rust/tests/e2e/rpc_session_state.rs b/rust/tests/e2e/rpc_session_state.rs index 199ff2a2b5..9809116d1f 100644 --- a/rust/tests/e2e/rpc_session_state.rs +++ b/rust/tests/e2e/rpc_session_state.rs @@ -5,7 +5,8 @@ use github_copilot_sdk::rpc::{ MetadataRecomputeContextTokensRequest, MetadataRecordContextChangeRequest, MetadataSetWorkingDirectoryRequest, MetadataSnapshotCurrentMode, ModeSetRequest, ModelSetReasoningEffortRequest, ModelSwitchToRequest, NameSetAutoRequest, NameSetRequest, - PermissionsSetApproveAllRequest, PlanUpdateRequest, SessionSetCredentialsParams, + PermissionsResetSessionApprovalsRequest, PermissionsSetApproveAllRequest, PlanUpdateRequest, + SessionSetCredentialsParams, SessionUpdateOptionsParams, SessionWorkingDirectoryContext, SessionWorkingDirectoryContextHostType, SessionsForkRequest, ShutdownRequest, TelemetrySetFeatureOverridesRequest, WorkspacesCreateFileRequest, WorkspacesReadFileRequest, @@ -1023,7 +1024,7 @@ async fn should_call_session_usage_and_permission_rpcs() { session .rpc() .permissions() - .reset_session_approvals() + .reset_session_approvals(PermissionsResetSessionApprovalsRequest::default()) .await .expect("reset approvals") .success diff --git a/rust/tests/e2e/rpc_tasks_and_handlers.rs b/rust/tests/e2e/rpc_tasks_and_handlers.rs index 601cc70bf2..e065715790 100644 --- a/rust/tests/e2e/rpc_tasks_and_handlers.rs +++ b/rust/tests/e2e/rpc_tasks_and_handlers.rs @@ -322,6 +322,7 @@ async fn should_return_expected_results_for_missing_pending_handler_requestids() response: UIExitPlanModeResponse { approved: false, auto_approve_edits: None, + defer_implementation: None, feedback: Some("not now".to_string()), selected_action: None, }, diff --git a/rust/tests/e2e/session_fs_sqlite.rs b/rust/tests/e2e/session_fs_sqlite.rs index 0b99d951b0..ed7f8a1a72 100644 --- a/rust/tests/e2e/session_fs_sqlite.rs +++ b/rust/tests/e2e/session_fs_sqlite.rs @@ -6,7 +6,8 @@ use github_copilot_sdk::session_fs::{FsError, FsErrorKind}; use github_copilot_sdk::{ Client, DirEntry, DirEntryKind, FileInfo, SessionConfig, SessionFsCapabilities, SessionFsConfig, SessionFsConventions, SessionFsProvider, SessionFsSqliteProvider, - SessionFsSqliteQueryResult, SessionFsSqliteQueryType, + SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteTransactionError, + SessionFsSqliteTransactionStatement, }; use rusqlite::Connection; @@ -219,40 +220,92 @@ impl SessionFsSqliteProvider for InMemorySqliteProvider { query: &str, _params: Option<&HashMap>, ) -> Result, FsError> { + let mut db_guard = self.db.lock().unwrap(); + let db = Self::get_or_create_db(&mut db_guard)?; + Ok(Some(Self::run_statement( + db, + query_type, + query, + &self.session_id, + &self.sqlite_calls, + )?)) + } + + async fn sqlite_transaction( + &self, + statements: &[SessionFsSqliteTransactionStatement], + ) -> Result, SessionFsSqliteTransactionError> { + let mut db_guard = self.db.lock().unwrap(); + let db = Self::get_or_create_db(&mut db_guard)?; + db.execute_batch("BEGIN IMMEDIATE") + .map_err(|e| Self::classify_sqlite_error(&e))?; + let mut results = Vec::with_capacity(statements.len()); + for statement in statements { + match Self::run_statement( + db, + statement.query_type.clone(), + &statement.query, + &self.session_id, + &self.sqlite_calls, + ) { + Ok(result) => results.push(result), + Err(e) => { + let _ = db.execute_batch("ROLLBACK"); + return Err(SessionFsSqliteTransactionError::fatal(e.to_string())); + } + } + } + db.execute_batch("COMMIT").map_err(|e| { + let _ = db.execute_batch("ROLLBACK"); + Self::classify_sqlite_error(&e) + })?; + Ok(results) + } + + async fn sqlite_exists(&self) -> Result { + Ok(self.db.lock().unwrap().is_some()) + } +} + +impl InMemorySqliteProvider { + fn classify_sqlite_error(error: &rusqlite::Error) -> SessionFsSqliteTransactionError { + let message = error.to_string(); + if message.contains("locked") || message.contains("busy") { + SessionFsSqliteTransactionError::busy_or_locked(message) + } else { + SessionFsSqliteTransactionError::fatal(message) + } + } + + fn run_statement( + db: &Connection, + query_type: SessionFsSqliteQueryType, + query: &str, + session_id: &str, + sqlite_calls: &Arc>>, + ) -> Result { let qt_str = match query_type { SessionFsSqliteQueryType::Exec => "exec", SessionFsSqliteQueryType::Query => "query", SessionFsSqliteQueryType::Run => "run", SessionFsSqliteQueryType::Unknown => "unknown", }; - self.sqlite_calls.lock().unwrap().push(SqliteCall { - session_id: self.session_id.clone(), + sqlite_calls.lock().unwrap().push(SqliteCall { + session_id: session_id.to_string(), query_type: qt_str.to_string(), query: query.to_string(), }); - let mut db_guard = self.db.lock().unwrap(); - let db = Self::get_or_create_db(&mut db_guard)?; let trimmed = query.trim(); if trimmed.is_empty() { - return Ok(Some(SessionFsSqliteQueryResult { - columns: vec![], - rows: vec![], - rows_affected: 0, - last_insert_rowid: None, - })); + return Ok(SessionFsSqliteQueryResult::default()); } match query_type { SessionFsSqliteQueryType::Exec => { db.execute_batch(trimmed) .map_err(|e| FsError::new(FsErrorKind::Other, e))?; - Ok(Some(SessionFsSqliteQueryResult { - columns: vec![], - rows: vec![], - rows_affected: 0, - last_insert_rowid: None, - })) + Ok(SessionFsSqliteQueryResult::default()) } SessionFsSqliteQueryType::Query => { let mut stmt = db @@ -292,37 +345,28 @@ impl SessionFsSqliteProvider for InMemorySqliteProvider { } rows.push(map); } - Ok(Some(SessionFsSqliteQueryResult { + Ok(SessionFsSqliteQueryResult { columns, rows, rows_affected: 0, last_insert_rowid: None, - })) + }) } SessionFsSqliteQueryType::Run => { let affected = db .execute(trimmed, []) .map_err(|e| FsError::new(FsErrorKind::Other, e))?; let last_id = db.last_insert_rowid(); - Ok(Some(SessionFsSqliteQueryResult { + Ok(SessionFsSqliteQueryResult { columns: vec![], rows: vec![], rows_affected: affected as i64, last_insert_rowid: Some(last_id), - })) + }) } - _ => Ok(Some(SessionFsSqliteQueryResult { - columns: vec![], - rows: vec![], - rows_affected: 0, - last_insert_rowid: None, - })), + _ => Ok(SessionFsSqliteQueryResult::default()), } } - - async fn sqlite_exists(&self) -> Result { - Ok(self.db.lock().unwrap().is_some()) - } } fn session_state_path_sqlite() -> String { diff --git a/rust/tests/session_test.rs b/rust/tests/session_test.rs index 122ec475df..41cae3e950 100644 --- a/rust/tests/session_test.rs +++ b/rust/tests/session_test.rs @@ -4309,7 +4309,7 @@ async fn command_execute_handler_error_propagates_to_ack() { use github_copilot_sdk::session_fs::{ DirEntry, DirEntryKind, FileInfo, FsError, FsErrorKind, SessionFsConventions, SessionFsProvider, SessionFsSqliteProvider, SessionFsSqliteQueryResult, - SessionFsSqliteQueryType, + SessionFsSqliteQueryType, SessionFsSqliteTransactionError, SessionFsSqliteTransactionStatement, }; struct RecordingFsProvider { @@ -4431,6 +4431,24 @@ impl SessionFsSqliteProvider for RecordingFsProvider { })) } + async fn sqlite_transaction( + &self, + statements: &[SessionFsSqliteTransactionStatement], + ) -> Result, SessionFsSqliteTransactionError> { + let mut results = Vec::with_capacity(statements.len()); + for statement in statements { + let result = self + .sqlite_query( + statement.query_type.clone(), + &statement.query, + statement.params.as_ref(), + ) + .await?; + results.push(result.unwrap_or_default()); + } + Ok(results) + } + async fn sqlite_exists(&self) -> Result { Ok(true) } @@ -4619,6 +4637,13 @@ async fn session_fs_maps_sqlite_errors_to_results() { )) } + async fn sqlite_transaction( + &self, + _statements: &[SessionFsSqliteTransactionStatement], + ) -> Result, SessionFsSqliteTransactionError> { + Err(SessionFsSqliteTransactionError::fatal("sqlite unavailable")) + } + async fn sqlite_exists(&self) -> Result { Err(FsError::with_message( FsErrorKind::Other, diff --git a/scripts/codegen/rust.ts b/scripts/codegen/rust.ts index a04f5a21c5..127dc2e48d 100644 --- a/scripts/codegen/rust.ts +++ b/scripts/codegen/rust.ts @@ -575,6 +575,45 @@ function emitRustMapAlias( ); } +/** + * Map a primitive JSON Schema type to its Rust equivalent, or `undefined` when + * the schema is not a plain scalar. Mirrors the primitive branches of + * {@link resolveRustType}. + */ +function rustScalarType(schema: JSONSchema7): string | undefined { + if (schema.enum || schema.const !== undefined) return undefined; + switch (schema.type) { + case "string": + return "String"; + case "number": + return "f64"; + case "integer": + return isIntegerSchemaBoundedToInt32(schema) ? "i32" : "i64"; + case "boolean": + return "bool"; + default: + return undefined; + } +} + +/** + * Emit a type alias for a named schema that resolves to a primitive scalar + * (e.g. an RPC result declared as `{ "type": "integer" }`). Without this the + * generated RPC surface would reference a `*Result` type that was never + * defined. + */ +function emitRustScalarAlias( + typeName: string, + schema: JSONSchema7, + ctx: RustCodegenCtx, + description?: string, +): void { + if (ctx.generatedNames.has(typeName)) return; + const scalarType = rustScalarType(schema); + if (!scalarType) return; + emitRustTypeAlias(typeName, schema, scalarType, ctx, description); +} + function rustRpcResultDescription( method: RpcMethod, resultSchema: JSONSchema7 | undefined, @@ -1527,6 +1566,8 @@ function generateApiTypesCode( } else { tryEmitRustUnion(schema, name, "", ctx); } + } else { + emitRustScalarAlias(name, schema, ctx, schema.description); } } @@ -1576,6 +1617,8 @@ function generateApiTypesCode( emitRustMapAlias(resultName, resolved, ctx, resolved.description); } else if (isObjectSchema(resolved)) { emitRustStruct(resultName, resolved, ctx, resolved.description); + } else { + emitRustScalarAlias(resultName, resolved, ctx, resolved.description); } } } From 094b0aab5caa5ac9ed04a56c2bc6175743ec8005 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 28 Jul 2026 07:45:58 -0400 Subject: [PATCH 3/7] Apply nightly rustfmt import wrapping to two Rust e2e tests Adding PermissionsResetSessionApprovalsRequest to these use blocks changed how nightly rustfmt reflows them. Matches `cargo +nightly-2026-04-14 fmt --all -- --config-path .rustfmt.nightly.toml`, which both the Rust SDK Tests fmt check and the codegen verify job run. Generated by Copilot Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e615d062-bcb7-431e-aa9c-d3e47405723a --- rust/tests/e2e/rpc_additional_edge_cases.rs | 4 ++-- rust/tests/e2e/rpc_session_state.rs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/rust/tests/e2e/rpc_additional_edge_cases.rs b/rust/tests/e2e/rpc_additional_edge_cases.rs index 135b394959..59891e94a7 100644 --- a/rust/tests/e2e/rpc_additional_edge_cases.rs +++ b/rust/tests/e2e/rpc_additional_edge_cases.rs @@ -1,7 +1,7 @@ use github_copilot_sdk::rpc::{ ModeSetRequest, NameSetRequest, PermissionsResetSessionApprovalsRequest, - PermissionsSetApproveAllRequest, PlanUpdateRequest, - ShellExecRequest, WorkspacesCreateFileRequest, WorkspacesReadFileRequest, + PermissionsSetApproveAllRequest, PlanUpdateRequest, ShellExecRequest, + WorkspacesCreateFileRequest, WorkspacesReadFileRequest, }; use github_copilot_sdk::session_events::SessionMode; diff --git a/rust/tests/e2e/rpc_session_state.rs b/rust/tests/e2e/rpc_session_state.rs index 9809116d1f..6292521903 100644 --- a/rust/tests/e2e/rpc_session_state.rs +++ b/rust/tests/e2e/rpc_session_state.rs @@ -6,8 +6,7 @@ use github_copilot_sdk::rpc::{ MetadataSetWorkingDirectoryRequest, MetadataSnapshotCurrentMode, ModeSetRequest, ModelSetReasoningEffortRequest, ModelSwitchToRequest, NameSetAutoRequest, NameSetRequest, PermissionsResetSessionApprovalsRequest, PermissionsSetApproveAllRequest, PlanUpdateRequest, - SessionSetCredentialsParams, - SessionUpdateOptionsParams, SessionWorkingDirectoryContext, + SessionSetCredentialsParams, SessionUpdateOptionsParams, SessionWorkingDirectoryContext, SessionWorkingDirectoryContextHostType, SessionsForkRequest, ShutdownRequest, TelemetrySetFeatureOverridesRequest, WorkspacesCreateFileRequest, WorkspacesReadFileRequest, }; From 951d4bf719efced7f62deaaf6cbde5bec54143f0 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 28 Jul 2026 08:25:35 -0400 Subject: [PATCH 4/7] Fix Go sqlite stub and Python resetSessionApprovals call for CLI 1.0.76-0 Two follow-ups from the CLI bump: * The Go e2e sqlite provider is a stub (no cgo sqlite dependency) that returned a canned {id, name} row for every SELECT. The runtime now reads its own inbox_entries bookkeeping table through the SessionFS sqlite provider and deserializes those rows into typed structs, so it rejected the canned row with 'Invalid inbox row: missing field recipient_session_id'. Scope the canned row to the `items` table the test actually models and return an empty result set for everything else. * permissions.resetSessionApprovals now takes a params object, which is a required argument in the generated Python API. Pass PermissionsResetSessionApprovalsRequest() at the e2e call site (the Go and Rust call sites were already updated). Generated by Copilot Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e615d062-bcb7-431e-aa9c-d3e47405723a --- go/internal/e2e/session_fs_sqlite_e2e_test.go | 19 ++++++++++++++++++- python/e2e/test_rpc_session_state_e2e.py | 5 ++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/go/internal/e2e/session_fs_sqlite_e2e_test.go b/go/internal/e2e/session_fs_sqlite_e2e_test.go index 745514b34e..20cd777834 100644 --- a/go/internal/e2e/session_fs_sqlite_e2e_test.go +++ b/go/internal/e2e/session_fs_sqlite_e2e_test.go @@ -238,7 +238,12 @@ func (p *inMemorySqliteProvider) runQueryLocked(queryType rpc.SessionFSSqliteQue LastInsertRowid: &lastID, } case rpc.SessionFSSqliteQueryTypeQuery: - if strings.Contains(upper, "SELECT") { + // Only the "items" table the test asks the agent to create is modelled + // here. The runtime also reads its own bookkeeping tables (for example + // inbox_entries) through this provider and deserializes those rows into + // typed structs, so returning the canned item row for every SELECT would + // make the runtime reject rows it cannot parse. + if strings.Contains(upper, "SELECT") && readsTable(upper, "ITEMS") { return &copilot.SessionFSSqliteQueryResult{ Columns: []string{"id", "name"}, Rows: []map[string]any{{"id": "a1", "name": "Widget"}}, @@ -249,6 +254,18 @@ func (p *inMemorySqliteProvider) runQueryLocked(queryType rpc.SessionFSSqliteQue return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}} } +// readsTable reports whether an upper-cased SQL statement selects from the given +// table, tolerating the quoting styles the agent may emit. +func readsTable(upperQuery string, table string) bool { + names := []string{table, `"` + table + `"`, "`" + table + "`", "[" + table + "]", "MAIN." + table} + for _, name := range names { + if strings.Contains(upperQuery, "FROM "+name) { + return true + } + } + return false +} + func (p *inMemorySqliteProvider) SqliteExists() (bool, error) { p.mu.Lock() defer p.mu.Unlock() diff --git a/python/e2e/test_rpc_session_state_e2e.py b/python/e2e/test_rpc_session_state_e2e.py index 51c1059bb7..f4b03d2e65 100644 --- a/python/e2e/test_rpc_session_state_e2e.py +++ b/python/e2e/test_rpc_session_state_e2e.py @@ -33,6 +33,7 @@ ModeSetRequest, NameSetAutoRequest, NameSetRequest, + PermissionsResetSessionApprovalsRequest, PermissionsSetApproveAllRequest, PlanUpdateRequest, SessionSetCredentialsParams, @@ -594,7 +595,9 @@ async def test_should_call_session_usage_and_permission_rpcs(self, ctx: E2ETestC ) assert approve_all.success - reset = await session.rpc.permissions.reset_session_approvals() + reset = await session.rpc.permissions.reset_session_approvals( + PermissionsResetSessionApprovalsRequest() + ) assert reset.success finally: await session.rpc.permissions.set_approve_all( From 2e54b4718398a01a56b9f73ccf9161ccd2c5775a Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 28 Jul 2026 10:26:00 -0400 Subject: [PATCH 5/7] Close Go/.NET shell-test teardown gap The "should kill shell process" e2e test exists in all five SDKs, but only Node, Python and Rust destroy the session at the end of it. Go tears the whole client down with client.ForceStop() and .NET simply ended at the last assert, so neither ever exercised session.destroy after a session.shell.exec. That gap is why Go and .NET stayed green on CLI 1.0.76-0 while Node, Python and Rust hang: the hang is in session.destroy after a shell exec, and the two green SDKs never made the call. Adding the teardown makes all five cover the same sequence. Verified locally against the same CLI binary (1.0.76-0, sha256 b8bfad2c...): with the added Disconnect(), the Go test hangs past a 3-minute timeout where it previously passed in seconds. The same test passes on CLI 1.0.73. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e615d062-bcb7-431e-aa9c-d3e47405723a --- dotnet/test/E2E/RpcShellAndFleetE2ETests.cs | 2 ++ go/internal/e2e/rpc_shell_and_fleet_e2e_test.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/dotnet/test/E2E/RpcShellAndFleetE2ETests.cs b/dotnet/test/E2E/RpcShellAndFleetE2ETests.cs index a51fc7daea..13daff67f9 100644 --- a/dotnet/test/E2E/RpcShellAndFleetE2ETests.cs +++ b/dotnet/test/E2E/RpcShellAndFleetE2ETests.cs @@ -41,6 +41,8 @@ public async Task Should_Kill_Shell_Process() var killResult = await session.Rpc.Shell.KillAsync(execResult.ProcessId); Assert.True(killResult.Killed); + + await session.DisposeAsync(); } [Fact] diff --git a/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go b/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go index d7ffd725d7..3a1b7c3620 100644 --- a/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go +++ b/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go @@ -81,6 +81,10 @@ func TestRPCShellAndFleetE2E(t *testing.T) { if !kill.Killed { t.Errorf("Expected shell.kill to report Killed=true, got %+v", kill) } + + if err := session.Disconnect(); err != nil { + t.Fatalf("Failed to disconnect session: %v", err) + } }) t.Run("should start fleet and complete custom tool task", func(t *testing.T) { From f0c846c727314d06b9e970dff1dafa419838ec8f Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 28 Jul 2026 10:33:32 -0400 Subject: [PATCH 6/7] Remove Rust e2e test for session.mcp.registerExternalClient The runtime team confirmed this method is marked `visibility: internal` in the shared API contract: its `client` and `transport` fields are live in-process MCP SDK instances that cannot be serialized over JSON-RPC. No SDK exposes it as a typed method, and the Rust test drove it through a raw `call_session_rpc` with placeholder JSON objects that could never satisfy that contract. It passed on CLI 1.0.73 only because the old TypeScript dispatch happened to route internal methods generically. 1.0.76-0 routes the method through the Rust native registry, where the host-effect switch has no case for it, so it now returns -32603 "Unsupported native session host effect". That is correct behaviour, not a regression, so the test is removed along with its now-orphaned snapshot and a note recording why the gap is deliberate. Both `call_session_rpc` and `is_mcp_server_running` remain in use by other tests in the file, so no helper became dead. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e615d062-bcb7-431e-aa9c-d3e47405723a --- rust/tests/e2e/rpc_mcp_lifecycle.rs | 57 ++----------------- ...er_and_unregister_external_mcp_client.yaml | 3 - 2 files changed, 5 insertions(+), 55 deletions(-) delete mode 100644 test/snapshots/rpc_mcp_lifecycle/should_register_and_unregister_external_mcp_client.yaml diff --git a/rust/tests/e2e/rpc_mcp_lifecycle.rs b/rust/tests/e2e/rpc_mcp_lifecycle.rs index 028b5a527f..aa3adcf5c3 100644 --- a/rust/tests/e2e/rpc_mcp_lifecycle.rs +++ b/rust/tests/e2e/rpc_mcp_lifecycle.rs @@ -194,58 +194,11 @@ async fn should_start_and_restart_mcp_server() { .await; } -#[tokio::test] -async fn should_register_and_unregister_external_mcp_client() { - with_e2e_context( - "rpc_mcp_lifecycle", - "should_register_and_unregister_external_mcp_client", - |ctx| { - Box::pin(async move { - ctx.set_default_copilot_user(); - let host_server = "rpc-lifecycle-extclient-host"; - let client = ctx.start_client().await; - let session = - client - .create_session(ctx.approve_all_session_config().with_mcp_servers( - create_test_mcp_servers(ctx.repo_root(), host_server), - )) - .await - .expect("create session"); - wait_for_mcp_server_status(&session, host_server, McpServerStatus::Connected).await; - - let external_name = "rpc-lifecycle-external-client"; - assert!(!is_mcp_server_running(&session, external_name).await); - - call_session_rpc( - &session, - "session.mcp.registerExternalClient", - json!({ - "serverName": external_name, - "client": { "id": external_name }, - "transport": { "kind": "in-process" }, - "config": { "command": "noop" } - }), - ) - .await - .expect("register external MCP client"); - assert!(is_mcp_server_running(&session, external_name).await); - - call_session_rpc( - &session, - "session.mcp.unregisterExternalClient", - json!({ "serverName": external_name }), - ) - .await - .expect("unregister external MCP client"); - assert!(!is_mcp_server_running(&session, external_name).await); - - session.disconnect().await.expect("disconnect session"); - client.stop().await.expect("stop client"); - }) - }, - ) - .await; -} +// There is deliberately no e2e test for `session.mcp.registerExternalClient`. That method is +// marked `visibility: internal` in the shared API contract: its `client` and `transport` fields +// are live in-process MCP SDK instances, so it cannot be driven over JSON-RPC, and no SDK +// exposes it as a typed method. A raw-RPC test used to pass only because older CLIs routed +// internal methods generically; it never exercised a supported wire API. #[tokio::test] async fn should_reload_mcp_servers_with_config() { diff --git a/test/snapshots/rpc_mcp_lifecycle/should_register_and_unregister_external_mcp_client.yaml b/test/snapshots/rpc_mcp_lifecycle/should_register_and_unregister_external_mcp_client.yaml deleted file mode 100644 index 056351ddb4..0000000000 --- a/test/snapshots/rpc_mcp_lifecycle/should_register_and_unregister_external_mcp_client.yaml +++ /dev/null @@ -1,3 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: [] From c33d8e2979350a58d585062359946ed161cb79b2 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 28 Jul 2026 11:55:56 -0400 Subject: [PATCH 7/7] Bound Python e2e tests with a per-test timeout pytest-timeout has been a declared dev dependency for a while but was never configured, and the Python job sets no timeout-minutes either. When CLI 1.0.76-0 introduced a session.destroy deadlock, five of the six Python jobs sat in_progress for hours instead of failing, producing no diagnostic signal at all and holding runners until GitHub's 6-hour job limit. Setting timeout = 300 makes a deadlocked test fail in five minutes with a full stack dump pointing at the blocked call, which is how the other SDKs already behave (Node uses 30s/60s/180s per test, Go bounds the package at 20m). The value is deliberately generous: the whole Python suite completes in about 10 minutes, so no individual test comes close to 300s. Verified locally that pytest honours the setting from pyproject.toml and that it interrupts a hanging test with a traceback. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e615d062-bcb7-431e-aa9c-d3e47405723a --- python/pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/pyproject.toml b/python/pyproject.toml index a867fe51dd..7e6274d9c0 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -92,3 +92,7 @@ python_files = "test_*.py" python_classes = "Test*" python_functions = "test_*" asyncio_mode = "auto" +# Bound every test so a deadlock fails fast with a stack dump instead of occupying the +# whole CI leg until GitHub's 6-hour job limit. The full suite runs in ~10 minutes, so no +# individual test legitimately approaches this. +timeout = 300