From 1c6d19f28302b8caa3cbecc9b20de69e61fcc958 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 29 Jul 2026 21:51:30 +0000
Subject: [PATCH 1/6] Update @github/copilot to 1.0.76-5
- Updated nodejs and test harness dependencies
- Re-ran code generators
- Formatted generated code
---
dotnet/src/Generated/Rpc.cs | 20450 +++++++++-------
dotnet/src/Generated/SessionEvents.cs | 555 +-
go/rpc/zrpc.go | 3212 ++-
go/rpc/zrpc_encoding.go | 183 +-
go/rpc/zsession_encoding.go | 25 +
go/rpc/zsession_events.go | 216 +-
go/zsession_events.go | 24 +
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 +
.../copilot/generated/CompactionTrigger.java | 41 +
.../generated/FactoryRunUpdatedEvent.java | 42 +
.../generated/ModelCallFailureEvent.java | 1 +
.../generated/ModelCallStartEvent.java | 4 +-
.../generated/PermissionRequestedEvent.java | 2 +
.../copilot/generated/ScheduleOrigin.java | 35 +
.../SessionAutoModeResolvedEvent.java | 20 +-
.../SessionCompactionCompleteEvent.java | 6 +-
.../SessionCompactionStartEvent.java | 8 +-
.../generated/SessionContextChangedEvent.java | 4 +-
.../copilot/generated/SessionEvent.java | 2 +
.../SessionManagedSettingsResolvedEvent.java | 2 +
.../copilot/generated/SessionResumeEvent.java | 4 +-
.../SessionScheduleCreatedEvent.java | 4 +-
.../generated/SessionTaskCompleteEvent.java | 10 +-
.../copilot/generated/SystemMessageEvent.java | 2 +
.../generated/TaskCompletionOutcome.java | 37 +
.../generated/ToolExecutionCompleteEvent.java | 1 +
.../generated/ToolExecutionStartEvent.java | 1 +
.../copilot/generated/UserMessageEvent.java | 2 +-
.../generated/WorkingDirectoryContext.java | 4 +-
.../copilot/generated/rpc/AgentInfo.java | 10 +-
.../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 +
.../generated/rpc/InstructionSource.java | 2 +-
.../generated/rpc/McpFilteredServer.java | 4 +-
.../copilot/generated/rpc/McpHostState.java | 2 +-
.../copilot/generated/rpc/ModelBilling.java | 2 +-
.../generated/rpc/ModelBillingPromo.java | 6 +-
.../rpc/ModelsGetBuiltInCatalogResult.java | 31 +
.../generated/rpc/QueueInsertMessage.java | 51 +
.../generated/rpc/QueuePendingItems.java | 6 +-
.../rpc/SandboxConfigUserPolicyNetwork.java | 4 +-
.../SandboxConfigUserPolicyNetworkProxy.java | 31 +
.../generated/rpc/SendMessageItem.java | 2 +-
.../generated/rpc/ServerModelsApi.java | 11 +
.../generated/rpc/ServerSessionsApi.java | 33 +
.../generated/rpc/SessionAgentApi.java | 4 +-
.../generated/rpc/SessionAgentListResult.java | 4 +-
...ssionCancelAllBackgroundAgentsParams.java} | 4 +-
.../generated/rpc/SessionCommandsApi.java | 2 +-
.../rpc/SessionContentExclusionApi.java | 49 +
...ssionContentExclusionCheckPathsParams.java | 33 +
...ssionContentExclusionCheckPathsResult.java | 33 +
.../rpc/SessionEventLogReadParams.java | 4 +-
.../rpc/SessionEventLogReadResult.java | 2 +-
.../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 | 45 +-
.../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 +
.../rpc/SessionLimitPredictionApi.java | 42 +
.../SessionLimitPredictionBaselineData.java | 29 +
.../rpc/SessionLimitPredictionClientType.java | 35 +
.../rpc/SessionLimitPredictionDetails.java | 44 +
.../rpc/SessionLimitPredictionResult.java | 35 +
...SessionLimitPredictionResultAvailable.java | 37 +
...ssionLimitPredictionResultUnavailable.java | 37 +
.../rpc/SessionLimitPredictionSource.java | 37 +
.../rpc/SessionLimitPredictionTier.java | 39 +
.../rpc/SessionLimitPredictionTierOption.java | 28 +
...ssionLimitPredictionUnavailableReason.java | 35 +
.../copilot/generated/rpc/SessionMcpApi.java | 2 +-
.../generated/rpc/SessionMcpOauthApi.java | 16 +
.../rpc/SessionMcpOauthRespondParams.java | 32 +
.../rpc/SessionMcpOauthRespondResult.java | 30 +
.../rpc/SessionMcpStartServerParams.java | 4 +-
.../generated/rpc/SessionModelApi.java | 2 +-
.../rpc/SessionModelSwitchToParams.java | 4 +-
.../rpc/SessionModelSwitchToResult.java | 4 +-
.../rpc/SessionOptionsUpdateParams.java | 10 +-
.../generated/rpc/SessionPermissionsApi.java | 11 +-
...ermissionsResetSessionApprovalsParams.java | 6 +-
.../generated/rpc/SessionPluginsApi.java | 2 +-
.../generated/rpc/SessionProviderApi.java | 2 +-
.../rpc/SessionProviderGetEndpointParams.java | 30 -
.../generated/rpc/SessionQueueApi.java | 222 +
...sionQueueBeginDeferredIdleDrainParams.java | 32 +
...sionQueueBeginDeferredIdleDrainResult.java | 30 +
...QueueConsumeSystemNotificationsParams.java | 32 +
...QueueConsumeSystemNotificationsResult.java | 30 +
.../SessionQueueDeferSessionIdleParams.java | 32 +
...ava => SessionQueueDuplicateAtParams.java} | 7 +-
.../rpc/SessionQueueDuplicateAtResult.java | 30 +
...essionQueueEnqueueResumePendingParams.java | 30 +
...essionQueueEnqueueResumePendingResult.java | 30 +
...ionQueueFinishDeferredIdleDrainParams.java | 34 +
...ionQueueFinishDeferredIdleDrainResult.java | 32 +
...java => SessionQueueHasPendingParams.java} | 4 +-
.../rpc/SessionQueueHasPendingResult.java | 30 +
.../rpc/SessionQueueInsertAtParams.java | 33 +
.../rpc/SessionQueueInsertAtResult.java | 30 +
.../rpc/SessionQueueMoveItemParams.java | 34 +
.../rpc/SessionQueueMoveItemResult.java | 30 +
...ms.java => SessionQueueProcessParams.java} | 2 +-
.../rpc/SessionQueueRemoveAtParams.java | 31 +
.../rpc/SessionQueueRemoveAtResult.java | 30 +
.../rpc/SessionQueueSendNowParams.java | 31 +
.../rpc/SessionQueueSendNowResult.java | 30 +
.../rpc/SessionQueueSetDrainPausedParams.java | 31 +
...s.java => SessionQueueSnapshotParams.java} | 4 +-
.../rpc/SessionQueueSnapshotResult.java | 37 +
.../rpc/SessionQueueUpdateTextParams.java | 33 +
.../rpc/SessionQueueUpdateTextResult.java | 30 +
.../copilot/generated/rpc/SessionRpc.java | 49 +
.../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 +
.../rpc/SessionSendMessagesParams.java | 2 +-
.../generated/rpc/SessionSendParams.java | 4 +-
.../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 | 3055 ++-
nodejs/src/generated/session-events.ts | 272 +-
python/copilot/generated/rpc.py | 5169 +++-
python/copilot/generated/session_events.py | 352 +-
rust/src/generated/api_types.rs | 11934 +++++----
rust/src/generated/rpc.rs | 1761 +-
rust/src/generated/session_events.rs | 267 +-
test/harness/package-lock.json | 72 +-
test/harness/package.json | 2 +-
223 files changed, 38834 insertions(+), 14153 deletions(-)
create mode 100644 java/src/generated/java/com/github/copilot/generated/CompactionTrigger.java
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/TaskCompletionOutcome.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/QueueInsertMessage.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicyNetworkProxy.java
rename java/src/generated/java/com/github/copilot/generated/rpc/{SessionPluginsReloadParams.java => SessionCancelAllBackgroundAgentsParams.java} (89%)
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/SessionLimitPredictionApi.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitPredictionBaselineData.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitPredictionClientType.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitPredictionDetails.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitPredictionResult.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitPredictionResultAvailable.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitPredictionResultUnavailable.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitPredictionSource.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitPredictionTier.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitPredictionTierOption.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionLimitPredictionUnavailableReason.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
delete mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionProviderGetEndpointParams.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
rename java/src/generated/java/com/github/copilot/generated/rpc/{SessionCommandsListParams.java => SessionQueueDuplicateAtParams.java} (84%)
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueDuplicateAtResult.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
rename java/src/generated/java/com/github/copilot/generated/rpc/{SessionHistoryCompactParams.java => SessionQueueHasPendingParams.java} (92%)
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/SessionQueueInsertAtParams.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueInsertAtResult.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueMoveItemParams.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueMoveItemResult.java
rename java/src/generated/java/com/github/copilot/generated/rpc/{SessionAgentListParams.java => SessionQueueProcessParams.java} (96%)
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueRemoveAtParams.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueRemoveAtResult.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSendNowParams.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSendNowResult.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueSetDrainPausedParams.java
rename java/src/generated/java/com/github/copilot/generated/rpc/{SessionModelListParams.java => SessionQueueSnapshotParams.java} (92%)
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/SessionQueueUpdateTextParams.java
create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionQueueUpdateTextResult.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..427cc0d77c 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; }
@@ -74,7 +74,7 @@ internal sealed class ConnectRequest
public string? Token { get; set; }
}
-/// Active server-driven promotion for a model, including its discount and expiry.
+/// Active server-driven promotion for a model, including its discount and optional expiry.
[Experimental(Diagnostics.Experimental)]
public sealed class ModelBillingPromo
{
@@ -82,15 +82,15 @@ public sealed class ModelBillingPromo
[JsonPropertyName("discountPercent")]
public double? DiscountPercent { get; set; }
- /// UTC ISO 8601 timestamp marking when the promotion ends. Always present: the API only surfaces a promo whose expiry parses and is in the future. Consumers should treat a past value as expired.
+ /// UTC ISO 8601 timestamp marking when the promotion ends. Optional: an open-ended promotion omits this field. When present, the API only surfaces a promo whose expiry parses and is in the future, so consumers should treat a past value as expired.
[JsonPropertyName("endsAt")]
- public string EndsAt { get; set; } = string.Empty;
+ public string? EndsAt { get; set; }
/// Stable identifier for the promotion campaign.
[JsonPropertyName("id")]
public string? Id { get; set; }
- /// Human-readable promotion message. Does not include the expiry timestamp; consumers may format endsAt and append it.
+ /// Human-readable promotion message. Does not include the expiry timestamp; consumers may format endsAt and append it when present.
[JsonPropertyName("message")]
public string? Message { get; set; }
}
@@ -197,7 +197,7 @@ public sealed class ModelBilling
[JsonPropertyName("multiplier")]
public double? Multiplier { get; set; }
- /// Active server-driven promotion for this model, if any. Present when the model is being promoted with a time-boxed discount.
+ /// Active server-driven promotion for this model, if any. Present when the model is being promoted with a discount, which may be time-boxed or open-ended.
[JsonPropertyName("promo")]
public ModelBillingPromo? Promo { 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
@@ -1588,7 +1606,7 @@ internal sealed class SkillsConfigSetDisabledSkillsRequest
public IList DisabledSkills { get => field ??= []; set; }
}
-/// Custom agent metadata, including identifiers, display details, source, tools, model, MCP servers, skills, and file path.
+/// Agent metadata, including identifiers, display details, source, tools, model, MCP servers, skills, and file path.
[Experimental(Diagnostics.Experimental)]
public sealed class AgentInfo
{
@@ -1609,11 +1627,11 @@ public sealed class AgentInfo
[JsonPropertyName("mcpServers")]
public IDictionary? McpServers { get; set; }
- /// Preferred model id for this agent. When omitted, inherits the outer agent's model.
+ /// Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference.
[JsonPropertyName("model")]
public string? Model { get; set; }
- /// Unique identifier of the custom agent.
+ /// Name of the agent. Use `id` as the stable selection identifier.
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
@@ -1621,6 +1639,10 @@ public sealed class AgentInfo
[JsonPropertyName("path")]
public string? Path { get; set; }
+ /// Authored base prompt for the agent. Runtime prompt assembly may add dynamic context at invocation time. Omitted from `session.agent.list` unless `includePrompt` is true.
+ [JsonPropertyName("prompt")]
+ public string? Prompt { get; set; }
+
/// Skill names preloaded into this agent's context. Omitted means none.
[JsonPropertyName("skills")]
public IList? Skills { get; set; }
@@ -1735,7 +1757,7 @@ public sealed class InstructionSource
[JsonPropertyName("location")]
public InstructionSourceLocation Location { get; set; }
- /// The project path this source was discovered from. Only set by sessionless discovery for repository/working-directory sources, where it disambiguates same-named files (e.g. .github/copilot-instructions.md) across multiple workspace roots. The session-scoped getSources leaves it unset.
+ /// The project path this source was discovered from. Only set by sessionless discovery for repository, working-directory, and project-scoped plugin sources, where it disambiguates sources across multiple workspace roots. The session-scoped getSources leaves it unset.
[JsonPropertyName("projectPath")]
public string? ProjectPath { get; set; }
@@ -2484,6 +2506,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 +2737,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 +2826,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 +3522,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; }
@@ -3465,7 +3536,7 @@ internal sealed class SendRequest
[JsonPropertyName("tracestate")]
public string? Tracestate { get; set; }
- /// If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves.
+ /// If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly.
[JsonPropertyName("wait")]
public bool? Wait { get; set; }
}
@@ -3504,8 +3575,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; }
@@ -3547,11 +3618,32 @@ internal sealed class SendMessagesRequest
[JsonPropertyName("tracestate")]
public string? Tracestate { get; set; }
- /// If true, await completion of the agentic loop for this turn before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageIds`; the caller can rely on the agent having processed the messages before the call resolves.
+ /// If true, await completion of the agentic loop for this turn before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageIds`; the caller can rely on the agent having processed the messages before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly.
[JsonPropertyName("wait")]
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 +3670,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 +4218,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 +4265,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 +4323,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 +4335,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 +4374,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 +4404,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,2327 +4417,2533 @@ 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; }
-/// One ordered factory progress line.
-[Experimental(Diagnostics.Experimental)]
-public sealed class FactoryLogLine
-{
- /// Progress line kind.
- [JsonPropertyName("kind")]
- public FactoryLogLineKind Kind { get; set; }
+ /// Gets or sets the maxConcurrentSubagents value.
+ [JsonPropertyName("maxConcurrentSubagents")]
+ public long? MaxConcurrentSubagents { get; set; }
- /// Monotonic sequence number within the factory run.
- [JsonPropertyName("seq")]
- public long Seq { get; set; }
+ /// Gets or sets the maxTotalSubagents value.
+ [JsonPropertyName("maxTotalSubagents")]
+ public long? MaxTotalSubagents { get; set; }
- /// Progress text.
- [JsonPropertyName("text")]
- public string Text { get; set; } = string.Empty;
+ /// Gets or sets the timeoutSeconds value.
+ [JsonPropertyName("timeoutSeconds")]
+ public double? TimeoutSeconds { get; set; }
}
-/// Parameters for recording factory progress.
+/// Durable factory resource consumption.
[Experimental(Diagnostics.Experimental)]
-internal sealed class FactoryLogRequest
+public sealed class FactoryRunConsumed
{
- /// Ordered progress lines to append.
- [JsonPropertyName("lines")]
- public IList Lines { get => field ??= []; set; }
+ /// Gets or sets the activeMs value.
+ [JsonPropertyName("activeMs")]
+ public long ActiveMs { get; set; }
- /// Factory run identifier.
- [JsonPropertyName("runId")]
- public string RunId { get; set; } = string.Empty;
+ /// Gets or sets the nanoAiu value.
+ [JsonPropertyName("nanoAiu")]
+ public long NanoAiu { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Gets or sets the subagents value.
+ [JsonPropertyName("subagents")]
+ public long Subagents { get; set; }
}
-/// Result of one factory-scoped subagent call.
+/// Current factory phase identity.
[Experimental(Diagnostics.Experimental)]
-public sealed class FactoryAgentResult
+public sealed class FactoryCurrentPhase
{
- /// Agent result, omitted when the agent produced no result.
- [JsonPropertyName("result")]
- public JsonElement? Result { get; set; }
+ /// Gets or sets the id value.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Gets or sets the ordinal value.
+ [JsonPropertyName("ordinal")]
+ public long? Ordinal { get; set; }
}
-/// Options for one factory-scoped subagent call.
+/// Prompt-safe terminal factory outcome.
[Experimental(Diagnostics.Experimental)]
-public sealed class FactoryAgentOptions
+public sealed class FactoryRunTerminal
{
- /// Optional label distinguishing otherwise identical memoized agent calls.
- [JsonPropertyName("label")]
- public string? Label { get; set; }
+ /// Gets or sets the error value.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
- /// Optional model identifier for the subagent.
- [JsonPropertyName("model")]
- public string? Model { get; set; }
+ /// Gets or sets the failure value.
+ [JsonPropertyName("failure")]
+ public FactoryRunFailure? Failure { get; set; }
- /// Optional JSON Schema for structured agent output.
- [JsonPropertyName("schema")]
- public JsonElement? Schema { 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; }
}
-/// Parameters for one factory-scoped subagent call.
+/// Durable factory run summary with read-time live overlays.
[Experimental(Diagnostics.Experimental)]
-internal sealed class FactoryAgentRequest
+public sealed class FactoryRunSummary
{
- /// Factory run identifier that owns the subagent.
- [JsonPropertyName("factoryRunId")]
- public string FactoryRunId { get; set; } = string.Empty;
+ /// Gets or sets the activeSegmentStartedAt value.
+ [JsonPropertyName("activeSegmentStartedAt")]
+ public long? ActiveSegmentStartedAt { get; set; }
- /// Subagent execution options.
- [JsonPropertyName("opts")]
- public FactoryAgentOptions Opts { get => field ??= new(); set; }
+ /// Gets or sets the approved value.
+ [JsonPropertyName("approved")]
+ public FactoryDeclaredLimits? Approved { get; set; }
- /// Prompt to send to the subagent.
- [JsonPropertyName("prompt")]
- public string Prompt { get; set; } = string.Empty;
+ /// Gets or sets the completedAt value.
+ [JsonPropertyName("completedAt")]
+ public long? CompletedAt { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Gets or sets the consumed value.
+ [JsonPropertyName("consumed")]
+ public FactoryRunConsumed Consumed { get => field ??= new(); set; }
-/// Result of reading a factory journal entry.
-[Experimental(Diagnostics.Experimental)]
-public sealed class FactoryJournalGetResult
-{
- /// Whether the journal contained the requested key.
- [JsonPropertyName("hit")]
- public bool Hit { get; set; }
+ /// Gets or sets the createdAt value.
+ [JsonPropertyName("createdAt")]
+ public long CreatedAt { get; set; }
- /// Cached JSON result. The hit field distinguishes a cached JSON null from a miss.
- [JsonPropertyName("resultJson")]
- public JsonElement? ResultJson { get; set; }
-}
+ /// Gets or sets the currentPhase value.
+ [JsonPropertyName("currentPhase")]
+ public FactoryCurrentPhase? CurrentPhase { get; set; }
-/// Parameters for reading a factory journal entry.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class FactoryJournalGetRequest
-{
- /// Namespaced journal key.
- [JsonPropertyName("key")]
- public string Key { get; set; } = string.Empty;
+ /// Gets or sets the declaredLimits value.
+ [JsonPropertyName("declaredLimits")]
+ public FactoryDeclaredLimits DeclaredLimits { get => field ??= new(); set; }
- /// Factory run identifier.
- [JsonPropertyName("runId")]
- public string RunId { get; set; } = string.Empty;
+ /// Gets or sets the declaredPhaseCount value.
+ [JsonPropertyName("declaredPhaseCount")]
+ public long DeclaredPhaseCount { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Gets or sets the description value.
+ [JsonPropertyName("description")]
+ public string Description { get; set; } = string.Empty;
-/// Parameters for storing a factory journal entry.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class FactoryJournalPutRequest
-{
- /// Namespaced journal key.
- [JsonPropertyName("key")]
- public string Key { get; set; } = string.Empty;
+ /// Gets or sets the factoryName value.
+ [JsonPropertyName("factoryName")]
+ public string FactoryName { get; set; } = string.Empty;
- /// JSON result to memoize.
- [JsonPropertyName("resultJson")]
- public JsonElement ResultJson { get; set; }
+ /// Gets or sets the liveAgentCount value.
+ [JsonPropertyName("liveAgentCount")]
+ public long LiveAgentCount { get; set; }
- /// Factory run identifier.
+ /// 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;
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { 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; }
}
-/// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume.
+/// Factory runs in durable creation order.
[Experimental(Diagnostics.Experimental)]
-public sealed class CurrentModel
+public sealed class FactoryListRunsResult
{
- /// Context tier for models that support multiple context-window sizes.
- [JsonPropertyName("contextTier")]
- public ContextTier? ContextTier { get; set; }
-
- /// Currently active model identifier.
- [JsonPropertyName("modelId")]
- public string? ModelId { get; set; }
-
- /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot.
- [JsonPropertyName("reasoningEffort")]
- public string? ReasoningEffort { get; set; }
+ /// Gets or sets the runs value.
+ [JsonPropertyName("runs")]
+ public IList Runs { get => field ??= []; set; }
}
-/// Identifies the target session.
+/// Empty parameters for listing factory runs.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionModelGetCurrentRequest
+internal sealed class FactoryListRunsRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// The model identifier active on the session after the switch.
+/// Prompt-safe durable identity and live status for a direct factory agent.
[Experimental(Diagnostics.Experimental)]
-public sealed class ModelSwitchToResult
+public sealed class FactoryAgentSummary
{
- /// Currently active model identifier after the switch.
- [JsonPropertyName("modelId")]
- public string? ModelId { get; set; }
-}
+ /// Gets or sets the activeMs value.
+ [JsonPropertyName("activeMs")]
+ public long ActiveMs { get; set; }
-/// Vision-specific limits.
-[Experimental(Diagnostics.Experimental)]
-public sealed class ModelCapabilitiesOverrideLimitsVision
-{
- /// Maximum image size in bytes.
- [JsonPropertyName("max_prompt_image_size")]
- public long? MaxPromptImageSize { get; set; }
+ /// Gets or sets the activity value.
+ [JsonPropertyName("activity")]
+ public string? Activity { get; set; }
- /// Maximum number of images per prompt.
- [JsonPropertyName("max_prompt_images")]
- public long? MaxPromptImages { get; set; }
+ /// Gets or sets the agentId value.
+ [JsonPropertyName("agentId")]
+ public string AgentId { get; set; } = string.Empty;
- /// MIME types the model accepts.
- [JsonPropertyName("supported_media_types")]
- public IList? SupportedMediaTypes { get; set; }
-}
+ /// Gets or sets the agentType value.
+ [JsonPropertyName("agentType")]
+ public string AgentType { get; set; } = string.Empty;
-/// Token limits for prompts, outputs, and context window.
-[Experimental(Diagnostics.Experimental)]
-public sealed class ModelCapabilitiesOverrideLimits
-{
- /// Maximum total context window size in tokens.
- [JsonPropertyName("max_context_window_tokens")]
- public long? MaxContextWindowTokens { get; set; }
+ /// Gets or sets the completedAt value.
+ [JsonPropertyName("completedAt")]
+ public long? CompletedAt { get; set; }
- /// Maximum number of output/completion tokens.
- [JsonPropertyName("max_output_tokens")]
- public long? MaxOutputTokens { get; set; }
+ /// Gets or sets the label value.
+ [JsonPropertyName("label")]
+ public string Label { get; set; } = string.Empty;
- /// Maximum number of prompt/input tokens.
- [JsonPropertyName("max_prompt_tokens")]
- public long? MaxPromptTokens { get; set; }
+ /// Gets or sets the phaseId value.
+ [JsonPropertyName("phaseId")]
+ public string? PhaseId { get; set; }
- /// Vision-specific limits.
- [JsonPropertyName("vision")]
- public ModelCapabilitiesOverrideLimitsVision? Vision { get; set; }
-}
+ /// Gets or sets the requestedModel value.
+ [JsonPropertyName("requestedModel")]
+ public string? RequestedModel { get; set; }
-/// Feature flags indicating what the model supports.
-[Experimental(Diagnostics.Experimental)]
-public sealed class ModelCapabilitiesOverrideSupports
-{
- /// Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8).
- [JsonPropertyName("adaptive_thinking")]
- public AdaptiveThinkingSupport? AdaptiveThinking { get; set; }
+ /// Gets or sets the resolvedModel value.
+ [JsonPropertyName("resolvedModel")]
+ public string? ResolvedModel { get; set; }
- /// Whether this model supports reasoning effort configuration.
- [JsonPropertyName("reasoningEffort")]
- public bool? ReasoningEffort { get; set; }
+ /// Gets or sets the runId value.
+ [JsonPropertyName("runId")]
+ public string RunId { get; set; } = string.Empty;
- /// Whether this model supports vision/image input.
- [JsonPropertyName("vision")]
- public bool? Vision { get; set; }
-}
+ /// Gets or sets the startedAt value.
+ [JsonPropertyName("startedAt")]
+ public long? StartedAt { get; set; }
-/// Optional capability overrides (vision, tool_calls, reasoning, etc.).
-[Experimental(Diagnostics.Experimental)]
-public sealed class ModelCapabilitiesOverride
-{
- /// Token limits for prompts, outputs, and context window.
- [JsonPropertyName("limits")]
- public ModelCapabilitiesOverrideLimits? Limits { get; set; }
+ /// Gets or sets the status value.
+ [JsonPropertyName("status")]
+ public string Status { get; set; } = string.Empty;
- /// Feature flags indicating what the model supports.
- [JsonPropertyName("supports")]
- public ModelCapabilitiesOverrideSupports? Supports { get; set; }
+ /// Gets or sets the toolCallId value.
+ [JsonPropertyName("toolCallId")]
+ public string ToolCallId { get; set; } = string.Empty;
}
-/// Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.
+/// Durable lifecycle and timing for one factory phase.
[Experimental(Diagnostics.Experimental)]
-internal sealed class ModelSwitchToRequest
+public sealed class FactoryPhaseObservation
{
- /// Explicit context tier for the selected model. `"default"` / `"long_context"` apply the requested tier; omit this field to use normal model behavior with no explicit tier.
- [JsonPropertyName("contextTier")]
- public ContextTier? ContextTier { get; set; }
+ /// Gets or sets the accumulatedActiveMs value.
+ [JsonPropertyName("accumulatedActiveMs")]
+ public long AccumulatedActiveMs { get; set; }
- /// Override individual model capabilities resolved by the runtime.
- [JsonPropertyName("modelCapabilities")]
- public ModelCapabilitiesOverride? ModelCapabilities { get; set; }
+ /// Gets or sets the completedAt value.
+ [JsonPropertyName("completedAt")]
+ public long? CompletedAt { get; set; }
- /// Model selection id to switch to, as returned by `list`. A bare id (e.g. `claude-sonnet-4.6`) names a Copilot (CAPI) model; a provider-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a registry BYOK model.
- [JsonPropertyName("modelId")]
- public string ModelId { get; set; } = string.Empty;
+ /// Gets or sets the currentActiveMs value.
+ [JsonPropertyName("currentActiveMs")]
+ public long CurrentActiveMs { get; set; }
- /// Reasoning effort level to use for the model. "none" disables reasoning.
- [JsonPropertyName("reasoningEffort")]
- public string? ReasoningEffort { get; set; }
+ /// Gets or sets the detail value.
+ [JsonPropertyName("detail")]
+ public string? Detail { get; set; }
- /// Reasoning summary mode to request for supported model clients.
- [JsonPropertyName("reasoningSummary")]
- public ReasoningSummary? ReasoningSummary { get; set; }
+ /// Gets or sets the entryCount value.
+ [JsonPropertyName("entryCount")]
+ public long EntryCount { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Gets or sets the id value.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
- /// Output verbosity level to request for supported models.
- [JsonPropertyName("verbosity")]
- public Verbosity? Verbosity { get; set; }
-}
+ /// Gets or sets the lastEnteredRunAttempt value.
+ [JsonPropertyName("lastEnteredRunAttempt")]
+ public long LastEnteredRunAttempt { get; set; }
-/// Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns.
-[Experimental(Diagnostics.Experimental)]
-public sealed class ModelSetReasoningEffortResult
-{
- /// Reasoning effort level recorded on the session after the update.
- [JsonPropertyName("reasoningEffort")]
- public string ReasoningEffort { get; set; } = string.Empty;
-}
+ /// Gets or sets the liveAgentCount value.
+ [JsonPropertyName("liveAgentCount")]
+ public long LiveAgentCount { get; set; }
-/// Reasoning effort level to apply to the currently selected model.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class ModelSetReasoningEffortRequest
-{
- /// Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling.
- [JsonPropertyName("reasoningEffort")]
- public string ReasoningEffort { get; set; } = string.Empty;
+ /// Gets or sets the ordinal value.
+ [JsonPropertyName("ordinal")]
+ public long? Ordinal { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Gets or sets the startedAt value.
+ [JsonPropertyName("startedAt")]
+ public long? StartedAt { get; set; }
-/// Cost-category metadata for a CAPI model.
-[Experimental(Diagnostics.Experimental)]
-public sealed class SessionModelPriceCategory
-{
- /// Gets or sets the id value.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ /// Gets or sets the status value.
+ [JsonPropertyName("status")]
+ public FactoryPhaseStatus Status { get; set; }
- /// Gets or sets the priceCategory value.
- [JsonPropertyName("priceCategory")]
- public ModelPickerPriceCategory PriceCategory { 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; }
}
-/// The list of models available to this session.
+/// One durable factory progress record.
[Experimental(Diagnostics.Experimental)]
-public sealed class SessionModelList
+public sealed class FactoryProgressLine
{
- /// 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`).
- [JsonPropertyName("list")]
- public IList List { get => field ??= []; set; }
+ /// Resume attempt that emitted this record.
+ [JsonPropertyName("attempt")]
+ public long Attempt { get; set; }
- /// 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.
- [JsonPropertyName("modelPriceCategories")]
- public IList? ModelPriceCategories { get; set; }
+ /// Progress record kind.
+ [JsonPropertyName("kind")]
+ public FactoryLogLineKind Kind { get; set; }
- /// Per-quota snapshots returned alongside the model list, keyed by quota type.
- [JsonPropertyName("quotaSnapshots")]
- public IDictionary? QuotaSnapshots { 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;
}
-/// Optional listing options.
+/// A bidirectional page of factory progress.
[Experimental(Diagnostics.Experimental)]
-public sealed class ModelListRequest
+public sealed class FactoryProgressPage
{
- /// If true, bypasses the per-session model list cache and re-fetches from CAPI.
- [JsonPropertyName("skipCache")]
- public bool? SkipCache { get; set; }
+ /// 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; }
}
-/// Optional listing options.
+/// Full factory run observability detail.
[Experimental(Diagnostics.Experimental)]
-internal sealed class ModelListRequestWithSession
+public sealed class FactoryRunDetail
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Gets or sets the activeSegmentStartedAt value.
+ [JsonPropertyName("activeSegmentStartedAt")]
+ public long? ActiveSegmentStartedAt { get; set; }
- /// If true, bypasses the per-session model list cache and re-fetches from CAPI.
- [JsonPropertyName("skipCache")]
- public bool? SkipCache { 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; }
}
-/// Identifies the target session.
+/// Parameters for paging factory progress.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionModeGetRequest
+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;
}
-/// Agent interaction mode to apply to the session.
+/// Parameters for cancelling a factory run.
[Experimental(Diagnostics.Experimental)]
-internal sealed class ModeSetRequest
+internal sealed class FactoryCancelRequest
{
- /// The session mode the agent is operating in.
- [JsonPropertyName("mode")]
- public SessionMode Mode { 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;
}
-/// The session's friendly name, or null when not yet set.
+/// Acknowledgement that a factory request was accepted.
[Experimental(Diagnostics.Experimental)]
-public sealed class NameGetResult
+public sealed class FactoryAckResult
{
- /// The session name (user-set or auto-generated), or null if not yet set.
- [JsonPropertyName("name")]
- public string? Name { get; set; }
}
-/// Identifies the target session.
+/// One ordered factory progress line.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionNameGetRequest
+public sealed class FactoryLogLine
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// 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;
}
-/// New friendly name to apply to the session.
+/// Parameters for recording factory progress.
[Experimental(Diagnostics.Experimental)]
-internal sealed class NameSetRequest
+internal sealed class FactoryLogRequest
{
- /// New session name (1–100 characters, trimmed of leading/trailing whitespace).
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [MaxLength(100)]
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// 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;
}
-/// Indicates whether the auto-generated summary was applied as the session's name.
+/// Result of one factory-scoped subagent call.
[Experimental(Diagnostics.Experimental)]
-public sealed class NameSetAutoResult
+public sealed class FactoryAgentResult
{
- /// 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.
- [JsonPropertyName("applied")]
- public bool Applied { get; set; }
+ /// Agent result, omitted when the agent produced no result.
+ [JsonPropertyName("result")]
+ public JsonElement? Result { get; set; }
}
-/// Auto-generated session summary to apply as the session's name when no user-set name exists.
+/// Options for one factory-scoped subagent call.
[Experimental(Diagnostics.Experimental)]
-internal sealed class NameSetAutoRequest
+public sealed class FactoryAgentOptions
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Optional label distinguishing otherwise identical memoized agent calls.
+ [JsonPropertyName("label")]
+ public string? Label { get; set; }
- /// Auto-generated session summary. Empty/whitespace-only values are ignored; values are trimmed before persisting.
- [JsonPropertyName("summary")]
- public string Summary { get; set; } = string.Empty;
+ /// Optional model identifier for the subagent.
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
+
+ /// Optional JSON Schema for structured agent output.
+ [JsonPropertyName("schema")]
+ public JsonElement? Schema { get; set; }
}
-/// Existence, contents, and resolved path of the session plan file.
+/// Parameters for one factory-scoped subagent call.
[Experimental(Diagnostics.Experimental)]
-public sealed class PlanReadResult
+internal sealed class FactoryAgentRequest
{
- /// The content of the plan file, or null if it does not exist.
- [JsonPropertyName("content")]
- public string? Content { get; set; }
+ /// Opaque token identifying the current factory execution attempt.
+ [JsonPropertyName("executionToken")]
+ public string ExecutionToken { get; set; } = string.Empty;
- /// Whether the plan file exists in the workspace.
- [JsonPropertyName("exists")]
- public bool Exists { get; set; }
+ /// Factory run identifier that owns the subagent.
+ [JsonPropertyName("factoryRunId")]
+ public string FactoryRunId { get; set; } = string.Empty;
- /// Absolute file path of the plan file, or null if workspace is not enabled.
- [JsonPropertyName("path")]
- public string? Path { get; set; }
-}
+ /// Subagent execution options.
+ [JsonPropertyName("opts")]
+ public FactoryAgentOptions Opts { get => field ??= new(); set; }
+
+ /// Prompt to send to the subagent.
+ [JsonPropertyName("prompt")]
+ public string Prompt { get; set; } = string.Empty;
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionPlanReadRequest
-{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Replacement contents to write to the session plan file.
+/// Result of reading a factory journal entry.
[Experimental(Diagnostics.Experimental)]
-internal sealed class PlanUpdateRequest
+public sealed class FactoryJournalGetResult
{
- /// The new content for the plan file.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
+ /// Whether the journal contained the requested key.
+ [JsonPropertyName("hit")]
+ public bool Hit { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Cached JSON result. The hit field distinguishes a cached JSON null from a miss.
+ [JsonPropertyName("resultJson")]
+ public JsonElement? ResultJson { get; set; }
}
-/// Identifies the target session.
+/// Parameters for reading a factory journal entry.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionPlanDeleteRequest
+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;
+
+ /// Factory run identifier.
+ [JsonPropertyName("runId")]
+ public string RunId { get; set; } = string.Empty;
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// A single todo row read from the session SQL `todos` table. All fields are optional because the SQL schema is best-effort and the agent may not have populated every column.
+/// Parameters for storing a factory journal entry.
[Experimental(Diagnostics.Experimental)]
-public sealed class PlanSqlTodosRow
+internal sealed class FactoryJournalPutRequest
{
- /// Todo description.
- [JsonPropertyName("description")]
- public string? Description { get; set; }
+ /// Opaque token identifying the current factory execution attempt.
+ [JsonPropertyName("executionToken")]
+ public string ExecutionToken { get; set; } = string.Empty;
- /// Todo identifier.
- [JsonPropertyName("id")]
- public string? Id { get; set; }
+ /// Namespaced journal key.
+ [JsonPropertyName("key")]
+ public string Key { get; set; } = string.Empty;
- /// Todo status.
- [JsonPropertyName("status")]
- public string? Status { get; set; }
+ /// JSON result to memoize.
+ [JsonPropertyName("resultJson")]
+ public JsonElement ResultJson { get; set; }
- /// Todo title.
- [JsonPropertyName("title")]
- public string? Title { 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;
}
-/// Todo rows read from the session SQL database. Empty when no session database is available.
+/// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume.
[Experimental(Diagnostics.Experimental)]
-public sealed class PlanReadSqlTodosResult
+public sealed class CurrentModel
{
- /// Rows from the session SQL todos table, ordered by creation time and id.
- [JsonPropertyName("rows")]
- public IList Rows { get => field ??= []; set; }
+ /// Context tier for models that support multiple context-window sizes.
+ [JsonPropertyName("contextTier")]
+ public ContextTier? ContextTier { get; set; }
+
+ /// Currently active model identifier.
+ [JsonPropertyName("modelId")]
+ public string? ModelId { get; set; }
+
+ /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot.
+ [JsonPropertyName("reasoningEffort")]
+ public string? ReasoningEffort { get; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionPlanReadSqlTodosRequest
+internal sealed class SessionModelGetCurrentRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// A single dependency edge read from the session SQL `todo_deps` table, indicating that one todo must complete before another.
+/// The model identifier active on the session after the switch.
[Experimental(Diagnostics.Experimental)]
-public sealed class PlanSqlTodoDependency
+public sealed class ModelSwitchToResult
{
- /// ID of the todo it depends on.
- [JsonPropertyName("dependsOn")]
- public string DependsOn { get; set; } = string.Empty;
+ /// True when the switch was deferred (enqueued as a cancellable `/model` command) because a turn was active or another model change was already queued, rather than applied immediately. When true, the session's live model is unchanged until the queued change drains.
+ [JsonPropertyName("deferred")]
+ public bool? Deferred { get; set; }
- /// ID of the todo that has the dependency.
- [JsonPropertyName("todoId")]
- public string TodoId { get; set; } = string.Empty;
+ /// Currently active model identifier after the switch.
+ [JsonPropertyName("modelId")]
+ public string? ModelId { get; set; }
}
-/// Todo rows + dependency edges read from the session SQL database.
+/// Vision-specific limits.
[Experimental(Diagnostics.Experimental)]
-public sealed class PlanReadSqlTodosWithDependenciesResult
+public sealed class ModelCapabilitiesOverrideLimitsVision
{
- /// 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.
- [JsonPropertyName("dependencies")]
- public IList Dependencies { get => field ??= []; set; }
+ /// Maximum image size in bytes.
+ [JsonPropertyName("max_prompt_image_size")]
+ public long? MaxPromptImageSize { get; set; }
- /// Rows from the session SQL todos table, ordered by creation time and id. Empty when no database, no todos table, or the SELECT failed.
- [JsonPropertyName("rows")]
- public IList Rows { get => field ??= []; set; }
-}
+ /// Maximum number of images per prompt.
+ [JsonPropertyName("max_prompt_images")]
+ public long? MaxPromptImages { get; set; }
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionPlanReadSqlTodosWithDependenciesRequest
-{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// MIME types the model accepts.
+ [JsonPropertyName("supported_media_types")]
+ public IList? SupportedMediaTypes { get; set; }
}
-/// RPC data type for WorkspacesGetWorkspaceResultWorkspace operations.
-public sealed class WorkspacesGetWorkspaceResultWorkspace
+/// Token limits for prompts, outputs, and context window.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ModelCapabilitiesOverrideLimits
{
- /// Gets or sets the branch value.
- [JsonPropertyName("branch")]
- public string? Branch { get; set; }
+ /// Maximum total context window size in tokens.
+ [JsonPropertyName("max_context_window_tokens")]
+ public long? MaxContextWindowTokens { get; set; }
- /// Gets or sets the chronicle_sync_dismissed value.
- [JsonPropertyName("chronicle_sync_dismissed")]
- public bool? ChronicleSyncDismissed { get; set; }
+ /// Maximum number of output/completion tokens.
+ [JsonPropertyName("max_output_tokens")]
+ public long? MaxOutputTokens { get; set; }
- /// Gets or sets the client_name value.
- [JsonPropertyName("client_name")]
- public string? ClientName { get; set; }
+ /// Maximum number of prompt/input tokens.
+ [JsonPropertyName("max_prompt_tokens")]
+ public long? MaxPromptTokens { get; set; }
- /// Gets or sets the created_at value.
- [JsonPropertyName("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
+ /// Vision-specific limits.
+ [JsonPropertyName("vision")]
+ public ModelCapabilitiesOverrideLimitsVision? Vision { get; set; }
+}
- /// Gets or sets the cwd value.
- [JsonPropertyName("cwd")]
- public string? Cwd { get; set; }
+/// Feature flags indicating what the model supports.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ModelCapabilitiesOverrideSupports
+{
+ /// Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8).
+ [JsonPropertyName("adaptive_thinking")]
+ public AdaptiveThinkingSupport? AdaptiveThinking { get; set; }
- /// Gets or sets the git_root value.
- [JsonPropertyName("git_root")]
- public string? GitRoot { get; set; }
+ /// Whether this model supports reasoning effort configuration.
+ [JsonPropertyName("reasoningEffort")]
+ public bool? ReasoningEffort { get; set; }
- /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration.
- [JsonPropertyName("host_type")]
- public WorkspacesWorkspaceDetailsHostType? HostType { get; set; }
+ /// Whether this model supports vision/image input.
+ [JsonPropertyName("vision")]
+ public bool? Vision { get; set; }
+}
- /// Gets or sets the id value.
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+/// Optional capability overrides (vision, tool_calls, reasoning, etc.).
+[Experimental(Diagnostics.Experimental)]
+public sealed class ModelCapabilitiesOverride
+{
+ /// Token limits for prompts, outputs, and context window.
+ [JsonPropertyName("limits")]
+ public ModelCapabilitiesOverrideLimits? Limits { get; set; }
- /// Gets or sets the mc_last_event_id value.
- [JsonPropertyName("mc_last_event_id")]
- public string? McLastEventId { get; set; }
+ /// Feature flags indicating what the model supports.
+ [JsonPropertyName("supports")]
+ public ModelCapabilitiesOverrideSupports? Supports { get; set; }
+}
- /// Gets or sets the mc_session_id value.
- [JsonPropertyName("mc_session_id")]
- public string? McSessionId { get; set; }
+/// Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ModelSwitchToRequest
+{
+ /// Explicit context tier for the selected model. `"default"` / `"long_context"` apply the requested tier; omit this field to use normal model behavior with no explicit tier.
+ [JsonPropertyName("contextTier")]
+ public ContextTier? ContextTier { get; set; }
- /// Gets or sets the mc_task_id value.
- [JsonPropertyName("mc_task_id")]
- public string? McTaskId { get; set; }
+ /// When true, defer this switch (enqueue it) if another model change is already queued, even when no turn is active — so it drains last (FIFO) and wins over the already-queued change. Intended for genuine user-initiated model selections; internal restore/reapply switches omit it and apply immediately when no turn is active. When no other model change is queued this has no effect (a switch still applies immediately unless a turn is active).
+ [JsonPropertyName("deferIfModelChangeQueued")]
+ public bool? DeferIfModelChangeQueued { get; set; }
- /// Gets or sets the name value.
- [JsonPropertyName("name")]
- public string? Name { get; set; }
+ /// Override individual model capabilities resolved by the runtime.
+ [JsonPropertyName("modelCapabilities")]
+ public ModelCapabilitiesOverride? ModelCapabilities { get; set; }
- /// Gets or sets the remote_steerable value.
- [JsonPropertyName("remote_steerable")]
- public bool? RemoteSteerable { get; set; }
+ /// Model selection id to switch to, as returned by `list`. A bare id (e.g. `claude-sonnet-4.6`) names a Copilot (CAPI) model; a provider-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a registry BYOK model.
+ [JsonPropertyName("modelId")]
+ public string ModelId { get; set; } = string.Empty;
- /// Gets or sets the repository value.
- [JsonPropertyName("repository")]
- public string? Repository { get; set; }
+ /// Reasoning effort level to use for the model. "none" disables reasoning.
+ [JsonPropertyName("reasoningEffort")]
+ public string? ReasoningEffort { get; set; }
- /// Gets or sets the summary_count value.
- [JsonPropertyName("summary_count")]
- public long? SummaryCount { get; set; }
+ /// Reasoning summary mode to request for supported model clients.
+ [JsonPropertyName("reasoningSummary")]
+ public ReasoningSummary? ReasoningSummary { get; set; }
- /// Gets or sets the updated_at value.
- [JsonPropertyName("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
- /// Gets or sets the user_named value.
- [JsonPropertyName("user_named")]
- public bool? UserNamed { get; set; }
+ /// Output verbosity level to request for supported models.
+ [JsonPropertyName("verbosity")]
+ public Verbosity? Verbosity { get; set; }
}
-/// Current workspace metadata for the session, including its absolute filesystem path when available.
+/// Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesGetWorkspaceResult
+public sealed class ModelSetReasoningEffortResult
{
- /// 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; }
+ /// Reasoning effort level recorded on the session after the update.
+ [JsonPropertyName("reasoningEffort")]
+ public string ReasoningEffort { get; set; } = string.Empty;
}
-/// Identifies the target session.
+/// Reasoning effort level to apply to the currently selected model.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionWorkspacesGetWorkspaceRequest
+internal sealed class ModelSetReasoningEffortRequest
{
+ /// Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling.
+ [JsonPropertyName("reasoningEffort")]
+ public string ReasoningEffort { 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.
+/// Cost-category metadata for a CAPI model.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesListFilesResult
+public sealed class SessionModelPriceCategory
{
- /// Relative file paths in the workspace files directory.
- [JsonPropertyName("files")]
- public IList Files { get => field ??= []; set; }
+ /// Gets or sets the id value.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Gets or sets the priceCategory value.
+ [JsonPropertyName("priceCategory")]
+ public ModelPickerPriceCategory PriceCategory { get; set; }
}
-/// Identifies the target session.
+/// The list of models available to this session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionWorkspacesListFilesRequest
+public sealed class SessionModelList
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// 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`).
+ [JsonPropertyName("list")]
+ public IList List { get => field ??= []; set; }
+
+ /// 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.
+ [JsonPropertyName("modelPriceCategories")]
+ public IList? ModelPriceCategories { get; set; }
+
+ /// Per-quota snapshots returned alongside the model list, keyed by quota type.
+ [JsonPropertyName("quotaSnapshots")]
+ public IDictionary? QuotaSnapshots { get; set; }
}
-/// Contents of the requested workspace file as a UTF-8 string.
+/// RPC data type for SessionModelList operations.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesReadFileResult
+public sealed class SessionModelListRequest
{
- /// File content as a UTF-8 string.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
+ /// If true, bypasses the per-session model list cache and re-fetches from CAPI.
+ [JsonPropertyName("skipCache")]
+ public bool? SkipCache { get; set; }
}
-/// Relative path of the workspace file to read.
+/// RPC data type for SessionModelListRequestWithSession operations.
[Experimental(Diagnostics.Experimental)]
-internal sealed class WorkspacesReadFileRequest
+internal sealed class SessionModelListRequestWithSession
{
- /// 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;
+
+ /// If true, bypasses the per-session model list cache and re-fetches from CAPI.
+ [JsonPropertyName("skipCache")]
+ public bool? SkipCache { get; set; }
}
-/// Relative path and UTF-8 content for the workspace file to create or overwrite.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class WorkspacesCreateFileRequest
+internal sealed class SessionModeGetRequest
{
- /// 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.
+/// Agent interaction mode to apply to the session.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesCheckpoints
+internal sealed class ModeSetRequest
{
- /// 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; }
+ /// The session mode the agent is operating in.
+ [JsonPropertyName("mode")]
+ public SessionMode Mode { get; set; }
- /// Human-readable checkpoint title.
- [JsonPropertyName("title")]
- public string Title { get; set; } = string.Empty;
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Workspace checkpoints in chronological order; empty when the workspace is not enabled.
+/// The session's friendly name, or null when not yet set.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesListCheckpointsResult
+public sealed class NameGetResult
{
- /// Workspace checkpoints in chronological order. Empty when workspace is not enabled.
- [JsonPropertyName("checkpoints")]
- public IList Checkpoints { get => field ??= []; set; }
-}
-
+ /// The session name (user-set or auto-generated), or null if not yet set.
+ [JsonPropertyName("name")]
+ public string? Name { get; set; }
+}
+
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionWorkspacesListCheckpointsRequest
+internal sealed class SessionNameGetRequest
{
/// 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.
+/// New friendly name to apply to the session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class WorkspacesReadCheckpointRequest
+internal sealed class NameSetRequest
{
- /// Checkpoint number to read.
- [JsonPropertyName("number")]
- public long Number { get; set; }
+ /// New session name (1–100 characters, trimmed of leading/trailing whitespace).
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [MaxLength(100)]
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// RPC data type for WorkspacesSaveLargePasteResultSaved operations.
-public sealed class WorkspacesSaveLargePasteResultSaved
-{
- /// Filename within the workspace files directory.
- [JsonPropertyName("filename")]
- public string Filename { get; set; } = string.Empty;
-
- /// Absolute filesystem path to the saved paste file.
- [JsonPropertyName("filePath")]
- public string FilePath { get; set; } = string.Empty;
-
- /// Size of the saved file in bytes.
- [JsonPropertyName("sizeBytes")]
- public long SizeBytes { get; set; }
-}
-
-/// Descriptor for the saved paste file, or null when the workspace is unavailable.
+/// Indicates whether the auto-generated summary was applied as the session's name.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspacesSaveLargePasteResult
+public sealed class NameSetAutoResult
{
- /// Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime, non-infinite sessions, remote sessions).
- [JsonPropertyName("saved")]
- public WorkspacesSaveLargePasteResultSaved? Saved { get; set; }
+ /// 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.
+ [JsonPropertyName("applied")]
+ public bool Applied { get; set; }
}
-/// Pasted content to save as a UTF-8 file in the session workspace.
+/// Auto-generated session summary to apply as the session's name when no user-set name exists.
[Experimental(Diagnostics.Experimental)]
-internal sealed class WorkspacesSaveLargePasteRequest
+internal sealed class NameSetAutoRequest
{
- /// Pasted content to save as a UTF-8 file.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
+
+ /// Auto-generated session summary. Empty/whitespace-only values are ignored; values are trimmed before persisting.
+ [JsonPropertyName("summary")]
+ public string Summary { get; set; } = string.Empty;
}
-/// A single changed file and its unified diff.
+/// Existence, contents, and resolved path of the session plan file.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspaceDiffFileChange
+public sealed class PlanReadResult
{
- /// Type of change represented by this file diff.
- [JsonPropertyName("changeType")]
- public WorkspaceDiffFileChangeType ChangeType { get; set; }
-
- /// Unified diff content for the file. Empty when the diff was truncated.
- [JsonPropertyName("diff")]
- public string Diff { get; set; } = string.Empty;
-
- /// Whether the diff content was omitted because it exceeded the per-file size limit.
- [JsonPropertyName("isTruncated")]
- public bool? IsTruncated { get; set; }
+ /// The content of the plan file, or null if it does not exist.
+ [JsonPropertyName("content")]
+ public string? Content { get; set; }
- /// Original file path for renamed files.
- [JsonPropertyName("oldPath")]
- public string? OldPath { get; set; }
+ /// Whether the plan file exists in the workspace.
+ [JsonPropertyName("exists")]
+ public bool Exists { get; set; }
- /// Path to the changed file, relative to the workspace root.
+ /// Absolute file path of the plan file, or null if workspace is not enabled.
[JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
+ public string? Path { get; set; }
}
-/// Workspace diff result for the requested mode.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public sealed class WorkspaceDiffResult
+internal sealed class SessionPlanReadRequest
{
- /// Default branch used for a branch diff, when branch mode was requested.
- [JsonPropertyName("baseBranch")]
- public string? BaseBranch { get; set; }
-
- /// Changed files and their unified diffs.
- [JsonPropertyName("changes")]
- public IList Changes { get => field ??= []; set; }
-
- /// Whether a requested branch diff fell back to unstaged changes because branch diff failed.
- [JsonPropertyName("isFallback")]
- public bool IsFallback { get; set; }
-
- /// Effective mode used for the returned changes.
- [JsonPropertyName("mode")]
- public WorkspaceDiffMode Mode { get; set; }
-
- /// Diff mode requested by the client.
- [JsonPropertyName("requestedMode")]
- public WorkspaceDiffMode RequestedMode { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Parameters for computing a workspace diff.
+/// Replacement contents to write to the session plan file.
[Experimental(Diagnostics.Experimental)]
-internal sealed class WorkspacesDiffRequest
+internal sealed class PlanUpdateRequest
{
- /// When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false.
- [JsonPropertyName("ignoreWhitespace")]
- public bool? IgnoreWhitespace { get; set; }
-
- /// Diff mode requested by the client.
- [JsonPropertyName("mode")]
- public WorkspaceDiffMode Mode { get; set; }
+ /// The new content for the plan file.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`).
-[Experimental(Diagnostics.Experimental)]
-public sealed class CompletionsGetTriggerCharactersResult
-{
- /// Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven completions for the session.
- [JsonPropertyName("triggerCharacters")]
- public IList TriggerCharacters { get => field ??= []; set; }
-}
-
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionCompletionsGetTriggerCharactersRequest
+internal sealed class SessionPlanDeleteRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced.
-[Experimental(Diagnostics.Experimental)]
-public sealed class SessionCompletionItem
-{
- /// Text spliced into the composer when the item is accepted.
- [JsonPropertyName("insertText")]
- public string InsertText { get; set; } = string.Empty;
-
- /// Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the host's display kind.
- [JsonPropertyName("kind")]
- public string? Kind { get; set; }
-
- /// Primary display label for the picker row. Falls back to `insertText` when absent.
- [JsonPropertyName("label")]
- public string? Label { get; set; }
-
- /// End (exclusive) of the replacement range in `text`, in UTF-16 code units.
- [JsonPropertyName("rangeEnd")]
- public long? RangeEnd { get; set; }
-
- /// Start of the replacement range in `text`, in UTF-16 code units.
- [JsonPropertyName("rangeStart")]
- public long? RangeStart { get; set; }
-}
-
-/// Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions.
+/// A single todo row read from the session SQL `todos` table. All fields are optional because the SQL schema is best-effort and the agent may not have populated every column.
[Experimental(Diagnostics.Experimental)]
-public sealed class CompletionsRequestResult
+public sealed class PlanSqlTodosRow
{
- /// Completion items in host-ranked order.
- [JsonPropertyName("items")]
- public IList Items { get => field ??= []; set; }
-}
+ /// Todo description.
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
-/// Request host-driven completions for the current composer input.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class CompletionsRequestRequest
-{
- /// Cursor offset within `text`, in UTF-16 code units.
- [JsonPropertyName("offset")]
- public long Offset { get; set; }
+ /// Todo identifier.
+ [JsonPropertyName("id")]
+ public string? Id { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Todo status.
+ [JsonPropertyName("status")]
+ public string? Status { get; set; }
- /// The full composed composer input.
- [JsonPropertyName("text")]
- public string Text { get; set; } = string.Empty;
+ /// Todo title.
+ [JsonPropertyName("title")]
+ public string? Title { get; set; }
}
-/// Instruction sources loaded for the session, in merge order.
+/// Todo rows read from the session SQL database. Empty when no session database is available.
[Experimental(Diagnostics.Experimental)]
-public sealed class InstructionsGetSourcesResult
+public sealed class PlanReadSqlTodosResult
{
- /// Instruction sources for the session.
- [JsonPropertyName("sources")]
- public IList Sources { get => field ??= []; set; }
+ /// Rows from the session SQL todos table, ordered by creation time and id.
+ [JsonPropertyName("rows")]
+ public IList Rows { get => field ??= []; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionInstructionsGetSourcesRequest
+internal sealed class SessionPlanReadSqlTodosRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether fleet mode was successfully activated.
-[Experimental(Diagnostics.Experimental)]
-public sealed class FleetStartResult
-{
- /// Whether fleet mode was successfully activated.
- [JsonPropertyName("started")]
- public bool Started { get; set; }
-}
-
-/// Optional user prompt to combine with the fleet orchestration instructions.
+/// A single dependency edge read from the session SQL `todo_deps` table, indicating that one todo must complete before another.
[Experimental(Diagnostics.Experimental)]
-internal sealed class FleetStartRequest
+public sealed class PlanSqlTodoDependency
{
- /// Optional user prompt to combine with fleet instructions.
- [JsonPropertyName("prompt")]
- public string? Prompt { get; set; }
+ /// ID of the todo it depends on.
+ [JsonPropertyName("dependsOn")]
+ public string DependsOn { get; set; } = string.Empty;
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// ID of the todo that has the dependency.
+ [JsonPropertyName("todoId")]
+ public string TodoId { get; set; } = string.Empty;
}
-/// Custom agents available to the session.
+/// Todo rows + dependency edges read from the session SQL database.
[Experimental(Diagnostics.Experimental)]
-public sealed class AgentList
+public sealed class PlanReadSqlTodosWithDependenciesResult
{
- /// Available custom agents.
- [JsonPropertyName("agents")]
- public IList Agents { get => field ??= []; set; }
+ /// 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.
+ [JsonPropertyName("dependencies")]
+ public IList Dependencies { get => field ??= []; set; }
+
+ /// Rows from the session SQL todos table, ordered by creation time and id. Empty when no database, no todos table, or the SELECT failed.
+ [JsonPropertyName("rows")]
+ public IList Rows { get => field ??= []; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionAgentListRequest
+internal sealed class SessionPlanReadSqlTodosWithDependenciesRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// The currently selected custom agent, or null when using the default agent.
-[Experimental(Diagnostics.Experimental)]
-public sealed class AgentGetCurrentResult
-{
- /// Currently selected custom agent, or null if using the default agent.
- [JsonPropertyName("agent")]
- public AgentInfo? Agent { get; set; }
+/// RPC data type for WorkspacesGetWorkspaceResultWorkspace operations.
+public sealed class WorkspacesGetWorkspaceResultWorkspace
+{
+ /// Gets or sets the branch value.
+ [JsonPropertyName("branch")]
+ public string? Branch { get; set; }
+
+ /// Gets or sets the chronicle_sync_dismissed value.
+ [JsonPropertyName("chronicle_sync_dismissed")]
+ public bool? ChronicleSyncDismissed { get; set; }
+
+ /// Gets or sets the client_name value.
+ [JsonPropertyName("client_name")]
+ public string? ClientName { get; set; }
+
+ /// Gets or sets the created_at value.
+ [JsonPropertyName("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
+
+ /// Gets or sets the cwd value.
+ [JsonPropertyName("cwd")]
+ public string? Cwd { get; set; }
+
+ /// Gets or sets the git_root value.
+ [JsonPropertyName("git_root")]
+ public string? GitRoot { get; set; }
+
+ /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration.
+ [JsonPropertyName("host_type")]
+ public WorkspacesWorkspaceDetailsHostType? HostType { get; set; }
+
+ /// Gets or sets the id value.
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Gets or sets the mc_last_event_id value.
+ [JsonPropertyName("mc_last_event_id")]
+ public string? McLastEventId { get; set; }
+
+ /// Gets or sets the mc_session_id value.
+ [JsonPropertyName("mc_session_id")]
+ public string? McSessionId { get; set; }
+
+ /// Gets or sets the mc_task_id value.
+ [JsonPropertyName("mc_task_id")]
+ public string? McTaskId { get; set; }
+
+ /// Gets or sets the name value.
+ [JsonPropertyName("name")]
+ public string? Name { get; set; }
+
+ /// Gets or sets the remote_steerable value.
+ [JsonPropertyName("remote_steerable")]
+ public bool? RemoteSteerable { get; set; }
+
+ /// Gets or sets the repository value.
+ [JsonPropertyName("repository")]
+ public string? Repository { get; set; }
+
+ /// Gets or sets the summary_count value.
+ [JsonPropertyName("summary_count")]
+ public long? SummaryCount { get; set; }
+
+ /// Gets or sets the updated_at value.
+ [JsonPropertyName("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
+
+ /// Gets or sets the user_named value.
+ [JsonPropertyName("user_named")]
+ public bool? UserNamed { get; set; }
+}
+
+/// 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 SessionAgentGetCurrentRequest
+internal sealed class SessionWorkspacesGetWorkspaceRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// The newly selected custom agent.
+/// Workspace metadata fields to update.
[Experimental(Diagnostics.Experimental)]
-public sealed class AgentSelectResult
+internal sealed class WorkspacesUpdateMetadataRequest
{
- /// The newly selected custom agent.
- [JsonPropertyName("agent")]
- public AgentInfo Agent { get => field ??= new(); set; }
-}
+ /// Opaque workspace context supplied by the session host.
+ [JsonPropertyName("context")]
+ public JsonElement? Context { get; set; }
-/// Name of the custom agent to select for subsequent turns.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class AgentSelectRequest
-{
- /// Name of the custom agent to select.
+ /// Optional workspace display name override.
[JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ public string? Name { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Identifies the target session.
+/// Optional session context used when creating a local workspace.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionAgentDeselectRequest
+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;
}
-/// Custom agents available to the session after reloading definitions from disk.
+/// Relative paths of files stored in the session workspace files directory.
[Experimental(Diagnostics.Experimental)]
-public sealed class AgentReloadResult
+public sealed class WorkspacesListFilesResult
{
- /// Reloaded custom agents.
- [JsonPropertyName("agents")]
- public IList Agents { get => field ??= []; set; }
+ /// 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 SessionAgentReloadRequest
+internal sealed class SessionWorkspacesListFilesRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Identifier assigned to the newly started background agent task.
+/// Contents of the requested workspace file as a UTF-8 string.
[Experimental(Diagnostics.Experimental)]
-public sealed class TasksStartAgentResult
+public sealed class WorkspacesReadFileResult
{
- /// Generated agent ID for the background task.
- [JsonPropertyName("agentId")]
- public string AgentId { get; set; } = string.Empty;
+ /// File content as a UTF-8 string.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
}
-/// Agent type, prompt, name, and optional description and model override for the new task.
+/// Relative path of the workspace file to read.
[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksStartAgentRequest
+internal sealed class WorkspacesReadFileRequest
{
- /// Type of agent to start (e.g., 'explore', 'task', 'general-purpose').
- [JsonPropertyName("agentType")]
- public string AgentType { get; set; } = string.Empty;
-
- /// Short description of the task.
- [JsonPropertyName("description")]
- public string? Description { get; set; }
+ /// Relative path within the workspace files directory.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
- /// Optional model override.
- [JsonPropertyName("model")]
- public string? Model { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Short name for the agent, used to generate a human-readable ID.
- [JsonPropertyName("name")]
- public string Name { 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;
- /// Task prompt for the agent.
- [JsonPropertyName("prompt")]
- public string Prompt { 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;
}
-/// Tracked task union returned by task APIs, containing either an agent task or a shell task.
-/// Polymorphic base type discriminated by type.
+/// Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename.
[Experimental(Diagnostics.Experimental)]
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "type",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(TaskInfoAgent), "agent")]
-[JsonDerivedType(typeof(TaskInfoShell), "shell")]
-public partial class TaskInfo
+public sealed class WorkspacesCheckpoints
{
- /// The type discriminator.
- [JsonPropertyName("type")]
- public virtual string Type { get; set; } = string.Empty;
+ /// 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; }
+}
-/// Tracked background agent task metadata, including IDs, status, timing, agent type, prompt, model, result, and latest response.
-/// The agent variant of .
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public partial class TaskInfoAgent : TaskInfo
+internal sealed class SessionWorkspacesListCheckpointsRequest
{
- ///
- [JsonIgnore]
- public override string Type => "agent";
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// ISO 8601 timestamp when the current active period began.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("activeStartedAt")]
- public DateTimeOffset? ActiveStartedAt { get; set; }
+/// 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; }
+}
- /// Accumulated active execution time in milliseconds.
- [JsonConverter(typeof(MillisecondsTimeSpanConverter))]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("activeTimeMs")]
- public TimeSpan? ActiveTime { get; set; }
+/// Checkpoint number to read.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class WorkspacesReadCheckpointRequest
+{
+ /// Checkpoint number to read.
+ [JsonPropertyName("number")]
+ public long Number { get; set; }
- /// Type of agent running this task.
- [JsonPropertyName("agentType")]
- public required string AgentType { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Whether the task is currently in the original sync wait and can be moved to background mode. False once it is already backgrounded, idle, finished, or no longer has a promotable sync waiter.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("canPromoteToBackground")]
- public bool? CanPromoteToBackground { get; set; }
+/// RPC data type for WorkspacesAddSummaryResultSummary operations.
+public sealed class WorkspacesAddSummaryResultSummary
+{
+}
- /// ISO 8601 timestamp when the task finished.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("completedAt")]
- public DateTimeOffset? CompletedAt { get; set; }
+/// RPC data type for WorkspacesAddSummaryResultWorkspace operations.
+public sealed class WorkspacesAddSummaryResultWorkspace
+{
+}
- /// Short description of the task.
- [JsonPropertyName("description")]
- public required string Description { get; set; }
-
- /// Error message when the task failed.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("error")]
- public string? Error { get; set; }
-
- /// Whether task execution is synchronously awaited or managed in the background.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("executionMode")]
- public TaskExecutionMode? ExecutionMode { get; set; }
-
- /// Unique task identifier.
- [JsonPropertyName("id")]
- public required string Id { get; set; }
-
- /// ISO 8601 timestamp when the agent entered idle state.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("idleSince")]
- public DateTimeOffset? IdleSince { get; set; }
-
- /// Most recent response text from the agent.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("latestResponse")]
- public string? LatestResponse { get; set; }
-
- /// Requested model override for the task when specified.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("model")]
- public string? Model { get; set; }
-
- /// Most recent prompt delivered to the agent. Updated whenever the agent receives a follow-up message.
- [JsonPropertyName("prompt")]
- public required string Prompt { get; set; }
-
- /// Runtime model resolved for the task when available.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("resolvedModel")]
- public string? ResolvedModel { get; set; }
-
- /// Result text from the task when available.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("result")]
- public string? Result { get; set; }
-
- /// ISO 8601 timestamp when the task was started.
- [JsonPropertyName("startedAt")]
- public required DateTimeOffset StartedAt { get; set; }
-
- /// Current lifecycle status of the task.
- [JsonPropertyName("status")]
- public required TaskStatus Status { get; set; }
+/// Persisted summary metadata and refreshed workspace metadata.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspacesAddSummaryResult
+{
+ /// Gets or sets the summary value.
+ [JsonPropertyName("summary")]
+ public WorkspacesAddSummaryResultSummary? Summary { get; set; }
- /// Tool call ID associated with this agent task.
- [JsonPropertyName("toolCallId")]
- public required string ToolCallId { get; set; }
+ /// Gets or sets the workspace value.
+ [JsonPropertyName("workspace")]
+ public WorkspacesAddSummaryResultWorkspace? Workspace { get; set; }
}
-/// Tracked shell task metadata, including ID, command, status, timing, attachment/execution mode, log path, and PID.
-/// The shell variant of .
+/// Compaction summary checkpoint to persist.
[Experimental(Diagnostics.Experimental)]
-public partial class TaskInfoShell : TaskInfo
+internal sealed class WorkspacesAddSummaryRequest
{
- ///
- [JsonIgnore]
- public override string Type => "shell";
-
- /// Whether the shell runs inside a managed PTY session or as an independent background process.
- [JsonPropertyName("attachmentMode")]
- public required TaskShellInfoAttachmentMode AttachmentMode { get; set; }
-
- /// Whether this shell task can be promoted to background mode.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("canPromoteToBackground")]
- public bool? CanPromoteToBackground { get; set; }
-
- /// Command being executed.
- [JsonPropertyName("command")]
- public required string Command { get; set; }
-
- /// ISO 8601 timestamp when the task finished.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("completedAt")]
- public DateTimeOffset? CompletedAt { get; set; }
-
- /// Short description of the task.
- [JsonPropertyName("description")]
- public required string Description { get; set; }
-
- /// Whether task execution is synchronously awaited or managed in the background.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("executionMode")]
- public TaskExecutionMode? ExecutionMode { get; set; }
-
- /// Unique task identifier.
- [JsonPropertyName("id")]
- public required string Id { get; set; }
+ /// Markdown summary content to persist.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
- /// Path to the detached shell log, when available.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("logPath")]
- public string? LogPath { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
- /// Process ID when available.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("pid")]
- public long? Pid { get; set; }
+ /// Summary title shown in checkpoint listings.
+ [JsonPropertyName("title")]
+ public string Title { get; set; } = string.Empty;
+}
- /// ISO 8601 timestamp when the task was started.
- [JsonPropertyName("startedAt")]
- public required DateTimeOffset StartedAt { get; set; }
+/// Rollback point for local workspace summaries.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class WorkspacesTruncateSummariesRequest
+{
+ /// Number of newest summaries to keep.
+ [JsonPropertyName("keepCount")]
+ public long KeepCount { get; set; }
- /// Current lifecycle status of the task.
- [JsonPropertyName("status")]
- public required TaskStatus Status { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Background tasks currently tracked by the session.
+/// Autopilot objective file content, or null when missing.
[Experimental(Diagnostics.Experimental)]
-public sealed class TaskList
+public sealed class WorkspacesReadAutopilotObjectiveResult
{
- /// Currently tracked tasks.
- [JsonPropertyName("tasks")]
- public IList Tasks { get => field ??= []; set; }
+ /// Autopilot objective file content, or null when missing.
+ [JsonPropertyName("content")]
+ public string? Content { get; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionTasksListRequest
+internal sealed class SessionWorkspacesReadAutopilotObjectiveRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop.
+/// Result of writing the autopilot objective file.
[Experimental(Diagnostics.Experimental)]
-public sealed class TasksRefreshResult
+public sealed class WorkspacesWriteAutopilotObjectiveResult
{
+ /// Filesystem operation performed.
+ [JsonPropertyName("operation")]
+ public string Operation { get; set; } = string.Empty;
}
-/// Identifies the target session.
+/// Autopilot objective file content to persist.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionTasksRefreshRequest
+internal sealed class WorkspacesWriteAutopilotObjectiveRequest
{
+ /// Autopilot objective file content.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS).
+/// Result of deleting the autopilot objective file.
[Experimental(Diagnostics.Experimental)]
-public sealed class TasksWaitForPendingResult
+public sealed class WorkspacesDeleteAutopilotObjectiveResult
{
+ /// True when a file was deleted.
+ [JsonPropertyName("deleted")]
+ public bool Deleted { get; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionTasksWaitForPendingRequest
+internal sealed class SessionWorkspacesDeleteAutopilotObjectiveRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Polymorphic base type discriminated by type.
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "type",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(TasksGetProgressResultProgressAgent), "agent")]
-[JsonDerivedType(typeof(TasksGetProgressResultProgressShell), "shell")]
-public partial class TasksGetProgressResultProgress
-{
- /// The type discriminator.
- [JsonPropertyName("type")]
- public virtual string Type { get; set; } = string.Empty;
-}
-
-
-/// Timestamped display line for task progress output or recent agent activity.
+/// Whether the autopilot objective file exists.
[Experimental(Diagnostics.Experimental)]
-public sealed class TaskProgressLine
+public sealed class WorkspacesAutopilotObjectiveExistsResult
{
- /// Display message, e.g., "▸ bash", "✓ edit src/foo.ts".
- [JsonPropertyName("message")]
- public string Message { get; set; } = string.Empty;
-
- /// ISO 8601 timestamp when this event occurred.
- [JsonPropertyName("timestamp")]
- public DateTimeOffset Timestamp { get; set; }
+ /// True when the objective file exists.
+ [JsonPropertyName("exists")]
+ public bool Exists { get; set; }
}
-/// Progress snapshot for an agent task, with recent activity lines and optional latest intent.
-/// The agent variant of .
-public partial class TasksGetProgressResultProgressAgent : TasksGetProgressResultProgress
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionWorkspacesAutopilotObjectiveExistsRequest
{
- ///
- [JsonIgnore]
- public override string Type => "agent";
-
- /// The most recent intent reported by the agent.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("latestIntent")]
- public string? LatestIntent { get; set; }
-
- /// Recent tool execution events converted to display lines.
- [JsonPropertyName("recentActivity")]
- public required IList RecentActivity { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Progress snapshot for a shell task, with recent stdout/stderr output and optional process ID.
-/// The shell variant of .
-public partial class TasksGetProgressResultProgressShell : TasksGetProgressResultProgress
+/// RPC data type for WorkspacesSaveLargePasteResultSaved operations.
+public sealed class WorkspacesSaveLargePasteResultSaved
{
- ///
- [JsonIgnore]
- public override string Type => "shell";
+ /// Filename within the workspace files directory.
+ [JsonPropertyName("filename")]
+ public string Filename { get; set; } = string.Empty;
- /// Process ID when available.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("pid")]
- public long? Pid { get; set; }
+ /// Absolute filesystem path to the saved paste file.
+ [JsonPropertyName("filePath")]
+ public string FilePath { get; set; } = string.Empty;
- /// Recent stdout/stderr lines from the running shell command.
- [JsonPropertyName("recentOutput")]
- public required string RecentOutput { get; set; }
+ /// Size of the saved file in bytes.
+ [JsonPropertyName("sizeBytes")]
+ public long SizeBytes { get; set; }
}
-/// Progress information for the task, or null when no task with that ID is tracked.
+/// Descriptor for the saved paste file, or null when the workspace is unavailable.
[Experimental(Diagnostics.Experimental)]
-public sealed class TasksGetProgressResult
+public sealed class WorkspacesSaveLargePasteResult
{
- /// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked.
- [JsonPropertyName("progress")]
- public TasksGetProgressResultProgress? Progress { get; set; }
+ /// Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime, non-infinite sessions, remote sessions).
+ [JsonPropertyName("saved")]
+ public WorkspacesSaveLargePasteResultSaved? Saved { get; set; }
}
-/// Identifier of the background task to fetch progress for.
+/// Pasted content to save as a UTF-8 file in the session workspace.
[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksGetProgressRequest
+internal sealed class WorkspacesSaveLargePasteRequest
{
- /// Task identifier (agent ID or shell ID).
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ /// Pasted content to save as a UTF-8 file.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// The first sync-waiting task that can currently be promoted to background mode.
+/// A single changed file and its unified diff.
[Experimental(Diagnostics.Experimental)]
-public sealed class TasksGetCurrentPromotableResult
+public sealed class WorkspaceDiffFileChange
{
- /// The first sync-waiting task (agent first, then shell) that can currently be promoted to background mode. Omitted if no such task exists. The returned task is guaranteed to have executionMode='sync' and canPromoteToBackground=true at the time of the call.
- [JsonPropertyName("task")]
- public TaskInfo? Task { get; set; }
-}
+ /// Type of change represented by this file diff.
+ [JsonPropertyName("changeType")]
+ public WorkspaceDiffFileChangeType ChangeType { get; set; }
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionTasksGetCurrentPromotableRequest
-{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Unified diff content for the file. Empty when the diff was truncated.
+ [JsonPropertyName("diff")]
+ public string Diff { get; set; } = string.Empty;
-/// Indicates whether the task was successfully promoted to background mode.
-[Experimental(Diagnostics.Experimental)]
-public sealed class TasksPromoteToBackgroundResult
+ /// Whether the diff content was omitted because it exceeded the per-file size limit.
+ [JsonPropertyName("isTruncated")]
+ public bool? IsTruncated { get; set; }
+
+ /// Original file path for renamed files.
+ [JsonPropertyName("oldPath")]
+ public string? OldPath { get; set; }
+
+ /// 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;
+}
+
+/// Workspace diff result for the requested mode.
+[Experimental(Diagnostics.Experimental)]
+public sealed class WorkspaceDiffResult
{
- /// Whether the task was successfully promoted to background mode.
- [JsonPropertyName("promoted")]
- public bool Promoted { get; set; }
+ /// Default branch used for a branch diff, when branch mode was requested.
+ [JsonPropertyName("baseBranch")]
+ public string? BaseBranch { get; set; }
+
+ /// Changed files and their unified diffs.
+ [JsonPropertyName("changes")]
+ public IList Changes { get => field ??= []; set; }
+
+ /// 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; }
+
+ /// Effective mode used for the returned changes.
+ [JsonPropertyName("mode")]
+ public WorkspaceDiffMode Mode { get; set; }
+
+ /// 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; }
}
-/// Identifier of the task to promote to background mode.
+/// Parameters for computing a workspace diff.
[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksPromoteToBackgroundRequest
+internal sealed class WorkspacesDiffRequest
{
- /// Task identifier.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ /// When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false.
+ [JsonPropertyName("ignoreWhitespace")]
+ public bool? IgnoreWhitespace { get; set; }
+
+ /// Diff mode requested by the client.
+ [JsonPropertyName("mode")]
+ public WorkspaceDiffMode Mode { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// The promoted task as it now exists in background mode, omitted if no promotable task was waiting.
+/// Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`).
[Experimental(Diagnostics.Experimental)]
-public sealed class TasksPromoteCurrentToBackgroundResult
+public sealed class CompletionsGetTriggerCharactersResult
{
- /// The promoted task as it now exists in background mode, omitted if no promotable task was waiting. Atomic operation: avoids the race window of getCurrentPromotable + promoteToBackground.
- [JsonPropertyName("task")]
- public TaskInfo? Task { get; set; }
+ /// Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven completions for the session.
+ [JsonPropertyName("triggerCharacters")]
+ public IList TriggerCharacters { get => field ??= []; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionTasksPromoteCurrentToBackgroundRequest
+internal sealed class SessionCompletionsGetTriggerCharactersRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the background task was successfully cancelled.
+/// A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced.
[Experimental(Diagnostics.Experimental)]
-public sealed class TasksCancelResult
+public sealed class SessionCompletionItem
{
- /// Whether the task was successfully cancelled.
- [JsonPropertyName("cancelled")]
- public bool Cancelled { get; set; }
+ /// Text spliced into the composer when the item is accepted.
+ [JsonPropertyName("insertText")]
+ public string InsertText { get; set; } = string.Empty;
+
+ /// Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the host's display kind.
+ [JsonPropertyName("kind")]
+ public string? Kind { get; set; }
+
+ /// Primary display label for the picker row. Falls back to `insertText` when absent.
+ [JsonPropertyName("label")]
+ public string? Label { get; set; }
+
+ /// End (exclusive) of the replacement range in `text`, in UTF-16 code units.
+ [JsonPropertyName("rangeEnd")]
+ public long? RangeEnd { get; set; }
+
+ /// Start of the replacement range in `text`, in UTF-16 code units.
+ [JsonPropertyName("rangeStart")]
+ public long? RangeStart { get; set; }
}
-/// Identifier of the background task to cancel.
+/// Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions.
[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksCancelRequest
+public sealed class CompletionsRequestResult
{
- /// Task identifier.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ /// Completion items in host-ranked order.
+ [JsonPropertyName("items")]
+ public IList Items { get => field ??= []; set; }
+}
+
+/// Request host-driven completions for the current composer input.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class CompletionsRequestRequest
+{
+ /// Cursor offset within `text`, in UTF-16 code units.
+ [JsonPropertyName("offset")]
+ public long Offset { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
+
+ /// The full composed composer input.
+ [JsonPropertyName("text")]
+ public string Text { get; set; } = string.Empty;
}
-/// Indicates whether the task was removed. False when the task does not exist or is still running/idle.
+/// Instruction sources loaded for the session, in merge order.
[Experimental(Diagnostics.Experimental)]
-public sealed class TasksRemoveResult
+public sealed class InstructionsGetSourcesResult
{
- /// Whether the task was removed. Returns false if the task does not exist or is still running/idle (cancel it first).
- [JsonPropertyName("removed")]
- public bool Removed { get; set; }
+ /// Instruction sources for the session.
+ [JsonPropertyName("sources")]
+ public IList Sources { get => field ??= []; set; }
}
-/// Identifier of the completed or cancelled task to remove from tracking.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksRemoveRequest
+internal sealed class SessionInstructionsGetSourcesRequest
{
- /// Task identifier.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the message was delivered, with an error message when delivery failed.
+/// Indicates whether fleet mode was successfully activated.
[Experimental(Diagnostics.Experimental)]
-public sealed class TasksSendMessageResult
+public sealed class FleetStartResult
{
- /// Error message if delivery failed.
- [JsonPropertyName("error")]
- public string? Error { get; set; }
-
- /// Whether the message was successfully delivered or steered.
- [JsonPropertyName("sent")]
- public bool Sent { get; set; }
+ /// Whether fleet mode was successfully activated.
+ [JsonPropertyName("started")]
+ public bool Started { get; set; }
}
-/// Identifier of the target agent task, message content, and optional sender agent ID.
+/// Optional user prompt to combine with the fleet orchestration instructions.
[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksSendMessageRequest
+internal sealed class FleetStartRequest
{
- /// Agent ID of the sender, if sent on behalf of another agent.
- [JsonPropertyName("fromAgentId")]
- public string? FromAgentId { get; set; }
-
- /// Agent task identifier.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
-
- /// Message content to send to the agent.
- [JsonPropertyName("message")]
- public string Message { get; set; } = string.Empty;
+ /// Optional user prompt to combine with fleet instructions.
+ [JsonPropertyName("prompt")]
+ public string? Prompt { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Skill metadata available to a session, with name, description, source, enabled/invocable state, path, plugin, and argument hint.
+/// Agents available to the session.
[Experimental(Diagnostics.Experimental)]
-public sealed class Skill
+public sealed class AgentList
{
- /// Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field.
- [JsonPropertyName("argumentHint")]
- public string? ArgumentHint { get; set; }
-
- /// Description of what the skill does.
- [JsonPropertyName("description")]
- public string Description { get; set; } = string.Empty;
-
- /// Whether the skill is currently enabled.
- [JsonPropertyName("enabled")]
- public bool Enabled { get; set; }
+ /// Available agents.
+ [JsonPropertyName("agents")]
+ public IList Agents { get => field ??= []; set; }
+}
- /// Unique identifier for the skill.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+/// RPC data type for SessionAgentList operations.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionAgentListRequest
+{
+ /// When true, request the session's configured built-in agents alongside custom agents. Listing applies feature, context, inclusion, exclusion, and user-disabled-agent policy, but does not evaluate transient invocation requirements such as model availability. Built-in metadata may be omitted when the session cannot project it, such as a relay session.
+ [JsonPropertyName("includeBuiltInAgents")]
+ public bool? IncludeBuiltInAgents { get; set; }
- /// Absolute path to the skill file.
- [JsonPropertyName("path")]
- public string? Path { get; set; }
+ /// When true, request authored base prompt text on each AgentInfo. Prompt text may be omitted when unavailable, such as for agents projected through a relay session.
+ [JsonPropertyName("includePrompt")]
+ public bool? IncludePrompt { get; set; }
+}
- /// Name of the plugin that provides the skill, when source is 'plugin'.
- [JsonPropertyName("pluginName")]
- public string? PluginName { get; set; }
+/// RPC data type for SessionAgentListRequestWithSession operations.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionAgentListRequestWithSession
+{
+ /// When true, request the session's configured built-in agents alongside custom agents. Listing applies feature, context, inclusion, exclusion, and user-disabled-agent policy, but does not evaluate transient invocation requirements such as model availability. Built-in metadata may be omitted when the session cannot project it, such as a relay session.
+ [JsonPropertyName("includeBuiltInAgents")]
+ public bool? IncludeBuiltInAgents { get; set; }
- /// Source location type (e.g., project, personal-copilot, plugin, builtin).
- [JsonPropertyName("source")]
- public SkillSource Source { get; set; }
+ /// When true, request authored base prompt text on each AgentInfo. Prompt text may be omitted when unavailable, such as for agents projected through a relay session.
+ [JsonPropertyName("includePrompt")]
+ public bool? IncludePrompt { get; set; }
- /// Whether the skill can be invoked by the user as a slash command.
- [JsonPropertyName("userInvocable")]
- public bool UserInvocable { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Skills available to the session, with their enabled state.
+/// The currently selected custom agent, or null when using the default agent.
[Experimental(Diagnostics.Experimental)]
-public sealed class SkillList
+public sealed class AgentGetCurrentResult
{
- /// Available skills.
- [JsonPropertyName("skills")]
- public IList Skills { get => field ??= []; set; }
+ /// Currently selected custom agent, or null if using the default agent.
+ [JsonPropertyName("agent")]
+ public AgentInfo? Agent { get; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionSkillsListRequest
+internal sealed class SessionAgentGetCurrentRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Skill invocation record with name, path, content, allowed tools, and turn number.
+/// The newly selected custom agent.
[Experimental(Diagnostics.Experimental)]
-public sealed class SkillsInvokedSkill
+public sealed class AgentSelectResult
{
- /// Tools that should be auto-approved when this skill is active, captured at invocation time.
- [JsonPropertyName("allowedTools")]
- public IList? AllowedTools { get; set; }
-
- /// Full content of the skill file.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
-
- /// Turn number when the skill was invoked.
- [JsonPropertyName("invokedAtTurn")]
- public long InvokedAtTurn { get; set; }
-
- /// Unique identifier for the skill.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
-
- /// Path to the SKILL.md file.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
+ /// The newly selected custom agent.
+ [JsonPropertyName("agent")]
+ public AgentInfo Agent { get => field ??= new(); set; }
}
-/// Skills invoked during this session, ordered by invocation time (most recent last).
+/// Name of the custom agent to select for subsequent turns.
[Experimental(Diagnostics.Experimental)]
-public sealed class SkillsGetInvokedResult
+internal sealed class AgentSelectRequest
{
- /// Skills invoked during this session, ordered by invocation time (most recent last).
- [JsonPropertyName("skills")]
- public IList Skills { get => field ??= []; set; }
-}
+ /// Name of the custom agent to select.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionSkillsGetInvokedRequest
-{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Name of the skill to enable for the session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SkillsEnableRequest
-{
- /// Name of the skill to enable.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
-
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
-
-/// Name of the skill to disable for the session.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SkillsDisableRequest
+internal sealed class SessionAgentDeselectRequest
{
- /// Name of the skill to disable.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Diagnostics from reloading skill definitions, with warnings and errors as separate lists.
+/// Custom agents available to the session after reloading definitions from disk.
[Experimental(Diagnostics.Experimental)]
-public sealed class SkillsLoadDiagnostics
+public sealed class AgentReloadResult
{
- /// Errors emitted while loading skills (e.g. skills that failed to load entirely).
- [JsonPropertyName("errors")]
- public IList Errors { get => field ??= []; set; }
-
- /// Warnings emitted while loading skills (e.g. skills that loaded but had issues).
- [JsonPropertyName("warnings")]
- public IList Warnings { get => field ??= []; set; }
+ /// Reloaded custom agents.
+ [JsonPropertyName("agents")]
+ public IList Agents { get => field ??= []; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionSkillsReloadRequest
+internal sealed class SessionAgentReloadRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Identifies the target session.
+/// Identifier assigned to the newly started background agent task.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionSkillsEnsureLoadedRequest
+public sealed class TasksStartAgentResult
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Generated agent ID for the background task.
+ [JsonPropertyName("agentId")]
+ public string AgentId { get; set; } = string.Empty;
}
-/// Recorded MCP server connection failure.
+/// Agent type, prompt, name, and optional description and model override for the new task.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpServerFailureInfo
+internal sealed class TasksStartAgentRequest
{
- /// Failure message produced when the MCP server connection failed.
- [JsonPropertyName("message")]
- public string Message { get; set; } = string.Empty;
+ /// Type of agent to start (e.g., 'explore', 'task', 'general-purpose').
+ [JsonPropertyName("agentType")]
+ public string AgentType { get; set; } = string.Empty;
- /// epoch-ms timestamp at which the failure was recorded.
- [JsonPropertyName("timestamp")]
- public long Timestamp { get; set; }
+ /// Short description of the task.
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
+
+ /// Optional model override.
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
+
+ /// Short name for the agent, used to generate a human-readable ID.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Task prompt for the agent.
+ [JsonPropertyName("prompt")]
+ public string Prompt { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Recorded MCP server pending-auth state.
+/// Tracked task union returned by task APIs, containing either an agent task or a shell task.
+/// Polymorphic base type discriminated by type.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpServerNeedsAuthInfo
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "type",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(TaskInfoAgent), "agent")]
+[JsonDerivedType(typeof(TaskInfoShell), "shell")]
+public partial class TaskInfo
{
- /// epoch-ms timestamp at which the server signalled it needs authentication.
- [JsonPropertyName("timestamp")]
- public long Timestamp { get; set; }
+ /// The type discriminator.
+ [JsonPropertyName("type")]
+ public virtual string Type { get; set; } = string.Empty;
}
-/// Host-level state, omitted when no MCP host is initialized.
+
+/// Tracked background agent task metadata, including IDs, status, timing, agent type, prompt, model, result, and latest response.
+/// The agent variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class McpHostState
+public partial class TaskInfoAgent : TaskInfo
{
- /// Names of currently-connected MCP clients.
- [JsonPropertyName("clients")]
- public IList Clients { get => field ??= []; set; }
+ ///
+ [JsonIgnore]
+ public override string Type => "agent";
- /// Configured servers that are explicitly disabled.
- [JsonPropertyName("disabledServers")]
- public IList DisabledServers { get => field ??= []; set; }
+ /// ISO 8601 timestamp when the current active period began.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("activeStartedAt")]
+ public DateTimeOffset? ActiveStartedAt { get; set; }
- /// Map of server name to recorded connection failure.
- [JsonPropertyName("failedServers")]
- public IDictionary FailedServers { get => field ??= new Dictionary(); set; }
+ /// Accumulated active execution time in milliseconds.
+ [JsonConverter(typeof(MillisecondsTimeSpanConverter))]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("activeTimeMs")]
+ public TimeSpan? ActiveTime { get; set; }
- /// Configured servers filtered out by enterprise allowlist policy.
- [JsonPropertyName("filteredServers")]
- public IList FilteredServers { get => field ??= []; set; }
+ /// Type of agent running this task.
+ [JsonPropertyName("agentType")]
+ public required string AgentType { get; set; }
- /// Whether third-party MCP servers are policy-enabled for this session.
- [JsonPropertyName("mcp3pEnabled")]
- public bool Mcp3pEnabled { get; set; }
+ /// Whether the task is currently in the original sync wait and can be moved to background mode. False once it is already backgrounded, idle, finished, or no longer has a promotable sync waiter.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("canPromoteToBackground")]
+ public bool? CanPromoteToBackground { get; set; }
- /// Map of server name to recorded pending-auth state.
- [JsonPropertyName("needsAuthServers")]
- public IDictionary NeedsAuthServers { get => field ??= new Dictionary(); set; }
+ /// ISO 8601 timestamp when the task finished.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("completedAt")]
+ public DateTimeOffset? CompletedAt { get; set; }
- /// Names of servers with in-flight connection attempts.
- [JsonPropertyName("pendingConnections")]
- public IList PendingConnections { get => field ??= []; set; }
-}
+ /// Short description of the task.
+ [JsonPropertyName("description")]
+ public required string Description { get; set; }
-/// MCP server status entry, including config source/plugin source and any connection error.
-[Experimental(Diagnostics.Experimental)]
-public sealed class McpServer
-{
- /// Error message if the server failed to connect.
+ /// Error message when the task failed.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("error")]
public string? Error { get; set; }
- /// Server name (config key).
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Whether task execution is synchronously awaited or managed in the background.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("executionMode")]
+ public TaskExecutionMode? ExecutionMode { get; set; }
- /// Configuration source: user, workspace, plugin, or builtin.
- [JsonPropertyName("source")]
- public McpServerSource? Source { get; set; }
+ /// Unique task identifier.
+ [JsonPropertyName("id")]
+ public required string Id { get; set; }
- /// Plugin name that provided this server, when source is plugin.
- [JsonPropertyName("sourcePlugin")]
- public string? SourcePlugin { get; set; }
+ /// ISO 8601 timestamp when the agent entered idle state.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("idleSince")]
+ public DateTimeOffset? IdleSince { get; set; }
- /// Plugin version that provided this server, when source is plugin.
- [JsonPropertyName("sourcePluginVersion")]
- public string? SourcePluginVersion { get; set; }
+ /// Most recent response text from the agent.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("latestResponse")]
+ public string? LatestResponse { get; set; }
- /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured.
- [JsonPropertyName("status")]
- public McpServerStatus Status { get; set; }
-}
+ /// Requested model override for the task when specified.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
-/// MCP servers configured for the session, with their connection status and host-level state.
-[Experimental(Diagnostics.Experimental)]
-public sealed class McpServerList
-{
- /// Host-level state, omitted when no MCP host is initialized.
- [JsonPropertyName("host")]
- public McpHostState? Host { get; set; }
+ /// Most recent prompt delivered to the agent. Updated whenever the agent receives a follow-up message.
+ [JsonPropertyName("prompt")]
+ public required string Prompt { get; set; }
- /// Configured MCP servers.
- [JsonPropertyName("servers")]
- public IList Servers { get => field ??= []; set; }
-}
+ /// Runtime model resolved for the task when available.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("resolvedModel")]
+ public string? ResolvedModel { get; set; }
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionMcpListRequest
-{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Result text from the task when available.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("result")]
+ public string? Result { get; set; }
-/// Normalized MCP Apps discovery metadata from a tool's `_meta.ui` block.
-[Experimental(Diagnostics.Experimental)]
-public sealed class McpToolUi
-{
- /// URI of the tool's MCP App resource, typically a `ui://` resource identifier. Use `session.mcp.resources.read` to fetch its HTML and resource metadata.
- [JsonPropertyName("resourceUri")]
- public string? ResourceUri { get; set; }
+ /// ISO 8601 timestamp when the task was started.
+ [JsonPropertyName("startedAt")]
+ public required DateTimeOffset StartedAt { get; set; }
- /// Tool visibility advertised by the server. When absent, MCP Apps defaults apply.
- [JsonPropertyName("visibility")]
- public IList? Visibility { get; set; }
+ /// Current lifecycle status of the task.
+ [JsonPropertyName("status")]
+ public required TaskStatus Status { get; set; }
+
+ /// Tool call ID associated with this agent task.
+ [JsonPropertyName("toolCallId")]
+ public required string ToolCallId { get; set; }
}
-/// MCP tool metadata with tool name, optional description, and normalized MCP Apps discovery metadata.
+/// Tracked shell task metadata, including ID, command, status, timing, attachment/execution mode, log path, and PID.
+/// The shell variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class McpTools
+public partial class TaskInfoShell : TaskInfo
{
- /// Tool description, when provided.
- [JsonPropertyName("description")]
- public string? Description { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Type => "shell";
- /// Tool name.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Whether the shell runs inside a managed PTY session or as an independent background process.
+ [JsonPropertyName("attachmentMode")]
+ public required TaskShellInfoAttachmentMode AttachmentMode { get; set; }
- /// Normalized MCP Apps discovery metadata. An empty object indicates that a valid `_meta.ui` block was present without recognized fields.
- [JsonPropertyName("ui")]
- public McpToolUi? Ui { get; set; }
+ /// Whether this shell task can be promoted to background mode.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("canPromoteToBackground")]
+ public bool? CanPromoteToBackground { get; set; }
+
+ /// Command being executed.
+ [JsonPropertyName("command")]
+ public required string Command { get; set; }
+
+ /// ISO 8601 timestamp when the task finished.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("completedAt")]
+ public DateTimeOffset? CompletedAt { get; set; }
+
+ /// Short description of the task.
+ [JsonPropertyName("description")]
+ public required string Description { get; set; }
+
+ /// Whether task execution is synchronously awaited or managed in the background.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("executionMode")]
+ public TaskExecutionMode? ExecutionMode { get; set; }
+
+ /// Unique task identifier.
+ [JsonPropertyName("id")]
+ public required string Id { get; set; }
+
+ /// Path to the detached shell log, when available.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("logPath")]
+ public string? LogPath { get; set; }
+
+ /// Process ID when available.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("pid")]
+ public long? Pid { get; set; }
+
+ /// ISO 8601 timestamp when the task was started.
+ [JsonPropertyName("startedAt")]
+ public required DateTimeOffset StartedAt { get; set; }
+
+ /// Current lifecycle status of the task.
+ [JsonPropertyName("status")]
+ public required TaskStatus Status { get; set; }
}
-/// Tools exposed by the connected MCP server. Throws when the server is not connected.
+/// Background tasks currently tracked by the session.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpListToolsResult
+public sealed class TaskList
{
- /// Tools exposed by the server.
- [JsonPropertyName("tools")]
- public IList Tools { get => field ??= []; set; }
+ /// Currently tracked tasks.
+ [JsonPropertyName("tasks")]
+ public IList Tasks { get => field ??= []; set; }
}
-/// Server name whose tool list should be returned.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpListToolsRequest
+internal sealed class SessionTasksListRequest
{
- /// Name of the connected MCP server whose tools to list.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Name of the MCP server to enable for the session.
+/// Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpEnableRequest
+public sealed class TasksRefreshResult
{
- /// Name of the MCP server to enable.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+}
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionTasksRefreshRequest
+{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Name of the MCP server to disable for the session.
+/// Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS).
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpDisableRequest
+public sealed class TasksWaitForPendingResult
{
- /// Name of the MCP server to disable.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
-
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionMcpReloadRequest
+internal sealed class SessionTasksWaitForPendingRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// MCP server allowed by policy, with server name and optional PII-free explanatory note.
+/// Polymorphic base type discriminated by type.
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "type",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(TasksGetProgressResultProgressAgent), "agent")]
+[JsonDerivedType(typeof(TasksGetProgressResultProgressShell), "shell")]
+public partial class TasksGetProgressResultProgress
+{
+ /// The type discriminator.
+ [JsonPropertyName("type")]
+ public virtual string Type { get; set; } = string.Empty;
+}
+
+
+/// Timestamped display line for task progress output or recent agent activity.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpAllowedServer
+public sealed class TaskProgressLine
{
- /// Allowed server name.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Display message, e.g., "▸ bash", "✓ edit src/foo.ts".
+ [JsonPropertyName("message")]
+ public string Message { get; set; } = string.Empty;
- /// PII-free note explaining why the server was allowed.
- [JsonPropertyName("redactedNote")]
- public string? RedactedNote { get; set; }
+ /// ISO 8601 timestamp when this event occurred.
+ [JsonPropertyName("timestamp")]
+ public DateTimeOffset Timestamp { get; set; }
}
-/// MCP server filtered by policy, with name, reason, optional redacted reason, and enterprise login.
-[Experimental(Diagnostics.Experimental)]
-public sealed class McpFilteredServer
+/// Progress snapshot for an agent task, with recent activity lines and optional latest intent.
+/// The agent variant of .
+public partial class TasksGetProgressResultProgressAgent : TasksGetProgressResultProgress
{
- /// Enterprise login associated with an allowlist policy.
- [JsonPropertyName("enterpriseName")]
- public string? EnterpriseName { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Type => "agent";
- /// Filtered server name.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// The most recent intent reported by the agent.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("latestIntent")]
+ public string? LatestIntent { get; set; }
- /// Human-readable filter reason.
- [JsonPropertyName("reason")]
- public string Reason { get; set; } = string.Empty;
+ /// Recent tool execution events converted to display lines.
+ [JsonPropertyName("recentActivity")]
+ public required IList RecentActivity { get; set; }
+}
- /// PII-free filter reason.
- [JsonPropertyName("redactedReason")]
- public string? RedactedReason { get; set; }
+/// Progress snapshot for a shell task, with recent stdout/stderr output and optional process ID.
+/// The shell variant of .
+public partial class TasksGetProgressResultProgressShell : TasksGetProgressResultProgress
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "shell";
+
+ /// Process ID when available.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("pid")]
+ public long? Pid { get; set; }
+
+ /// Recent stdout/stderr lines from the running shell command.
+ [JsonPropertyName("recentOutput")]
+ public required string RecentOutput { get; set; }
}
-/// MCP server startup filtering result.
+/// Progress information for the task, or null when no task with that ID is tracked.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpStartServersResult
+public sealed class TasksGetProgressResult
{
- /// Non-default servers allowed by policy.
- [JsonPropertyName("allowedServers")]
- public IList? AllowedServers { get; set; }
-
- /// Servers filtered out before startup.
- [JsonPropertyName("filteredServers")]
- public IList FilteredServers { get => field ??= []; set; }
+ /// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked.
+ [JsonPropertyName("progress")]
+ public TasksGetProgressResultProgress? Progress { get; set; }
}
-/// Opaque MCP reload configuration.
+/// Identifier of the background task to fetch progress for.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpReloadWithConfigRequest
+internal sealed class TasksGetProgressRequest
{
- /// Opaque runtime MCP reload configuration. Marked internal: an in-process runtime shape (reloadMcpServers throws over the wire).
- [JsonInclude]
- [JsonPropertyName("config")]
- internal JsonElement Config { get; set; }
+ /// Task identifier (agent ID or shell ID).
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape.
+/// The first sync-waiting task that can currently be promoted to background mode.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpExecuteSamplingResult
+public sealed class TasksGetCurrentPromotableResult
{
+ /// The first sync-waiting task (agent first, then shell) that can currently be promoted to background mode. Omitted if no such task exists. The returned task is guaranteed to have executionMode='sync' and canPromoteToBackground=true at the time of the call.
+ [JsonPropertyName("task")]
+ public TaskInfo? Task { get; set; }
}
-/// Outcome of an MCP sampling execution: success result, failure error, or cancellation.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpSamplingExecutionResult
+internal sealed class SessionTasksGetCurrentPromotableRequest
{
- /// Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution.
- [JsonPropertyName("action")]
- public McpSamplingExecutionAction Action { get; set; }
-
- /// Error description, present when action='failure'.
- [JsonPropertyName("error")]
- public string? Error { get; set; }
-
- /// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape.
- [JsonPropertyName("result")]
- public McpExecuteSamplingResult? Result { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally.
+/// Indicates whether the task was successfully promoted to background mode.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpExecuteSamplingRequest
+public sealed class TasksPromoteToBackgroundResult
{
+ /// Whether the task was successfully promoted to background mode.
+ [JsonPropertyName("promoted")]
+ public bool Promoted { get; set; }
}
-/// Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference.
+/// Identifier of the task to promote to background mode.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpExecuteSamplingParams
+internal sealed class TasksPromoteToBackgroundRequest
{
- /// The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle).
- [JsonPropertyName("mcpRequestId")]
- public JsonElement McpRequestId { get; set; }
-
- /// Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally.
- [JsonPropertyName("request")]
- public McpExecuteSamplingRequest Request { get => field ??= new(); set; }
-
- /// Caller-provided unique identifier for this sampling execution. Use this same ID with cancelSamplingExecution to cancel the in-flight call. Must be unique within the session for the lifetime of the call.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
-
- /// Name of the MCP server that initiated the sampling request.
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// Task identifier.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether an in-flight sampling execution with the given requestId was found and cancelled.
+/// The promoted task as it now exists in background mode, omitted if no promotable task was waiting.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpCancelSamplingExecutionResult
+public sealed class TasksPromoteCurrentToBackgroundResult
{
- /// True if an in-flight execution with the given requestId was found and signalled to cancel. False when no such execution is in flight (already completed, never started, or cancelled by another caller).
- [JsonPropertyName("cancelled")]
- public bool Cancelled { get; set; }
+ /// The promoted task as it now exists in background mode, omitted if no promotable task was waiting. Atomic operation: avoids the race window of getCurrentPromotable + promoteToBackground.
+ [JsonPropertyName("task")]
+ public TaskInfo? Task { get; set; }
}
-/// The requestId previously passed to executeSampling that should be cancelled.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpCancelSamplingExecutionParams
+internal sealed class SessionTasksPromoteCurrentToBackgroundRequest
{
- /// The requestId previously passed to executeSampling that should be cancelled.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Env-value mode recorded on the session after the update.
+/// Indicates whether the background task was successfully cancelled.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpSetEnvValueModeResult
+public sealed class TasksCancelResult
{
- /// Mode recorded on the session after the update.
- [JsonPropertyName("mode")]
- public McpSetEnvValueModeDetails Mode { get; set; }
+ /// Whether the task was successfully cancelled.
+ [JsonPropertyName("cancelled")]
+ public bool Cancelled { get; set; }
}
-/// Mode controlling how MCP server env values are resolved (`direct` or `indirect`).
+/// Identifier of the background task to cancel.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpSetEnvValueModeParams
+internal sealed class TasksCancelRequest
{
- /// How environment-variable values supplied to MCP servers are resolved. "direct" passes literal string values; "indirect" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to "direct".
- [JsonPropertyName("mode")]
- public McpSetEnvValueModeDetails Mode { get; set; }
+ /// Task identifier.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove).
+/// Indicates whether the task was removed. False when the task does not exist or is still running/idle.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpRemoveGitHubResult
+public sealed class TasksRemoveResult
{
- /// True when the auto-managed `github` MCP server was removed; false when no removal happened (e.g. user has explicitly configured a `github` server, or the server was not registered).
+ /// Whether the task was removed. Returns false if the task does not exist or is still running/idle (cancel it first).
[JsonPropertyName("removed")]
public bool Removed { get; set; }
}
-/// Identifies the target session.
+/// Identifier of the completed or cancelled task to remove from tracking.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionMcpRemoveGitHubRequest
+internal sealed class TasksRemoveRequest
{
+ /// Task identifier.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Result of configuring GitHub MCP.
+/// Indicates whether the message was delivered, with an error message when delivery failed.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpConfigureGitHubResult
+public sealed class TasksSendMessageResult
{
- /// Whether GitHub MCP configuration changed.
- [JsonPropertyName("changed")]
- public bool Changed { get; set; }
+ /// Error message if delivery failed.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+
+ /// Whether the message was successfully delivered or steered.
+ [JsonPropertyName("sent")]
+ public bool Sent { get; set; }
}
-/// Opaque auth info used to configure GitHub MCP.
+/// Identifier of the target agent task, message content, and optional sender agent ID.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpConfigureGitHubRequest
+internal sealed class TasksSendMessageRequest
{
- /// Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire).
- [JsonInclude]
- [JsonPropertyName("authInfo")]
- internal JsonElement AuthInfo { get; set; }
+ /// Agent ID of the sender, if sent on behalf of another agent.
+ [JsonPropertyName("fromAgentId")]
+ public string? FromAgentId { get; set; }
+
+ /// Agent task identifier.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Message content to send to the agent.
+ [JsonPropertyName("message")]
+ public string Message { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Server name and configuration for an individual MCP server start.
+/// Skill metadata available to a session, with name, description, source, enabled/invocable state, path, plugin, and argument hint.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpStartServerRequest
+public sealed class Skill
{
- /// MCP server configuration (stdio process or remote HTTP/SSE).
- [JsonPropertyName("config")]
- public JsonElement Config { get; set; }
+ /// Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field.
+ [JsonPropertyName("argumentHint")]
+ public string? ArgumentHint { get; set; }
- /// Name of the MCP server to start.
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// Description of what the skill does.
+ [JsonPropertyName("description")]
+ public string Description { get; set; } = string.Empty;
+
+ /// Whether the skill is currently enabled.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
+
+ /// Unique identifier for the skill.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Absolute path to the skill file.
+ [JsonPropertyName("path")]
+ public string? Path { get; set; }
+
+ /// Name of the plugin that provides the skill, when source is 'plugin'.
+ [JsonPropertyName("pluginName")]
+ public string? PluginName { get; set; }
+
+ /// Source location type (e.g., project, personal-copilot, plugin, builtin).
+ [JsonPropertyName("source")]
+ public SkillSource Source { get; set; }
+
+ /// Whether the skill can be invoked by the user as a slash command.
+ [JsonPropertyName("userInvocable")]
+ public bool UserInvocable { get; set; }
+}
+
+/// Skills available to the session, with their enabled state.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SkillList
+{
+ /// Available skills.
+ [JsonPropertyName("skills")]
+ public IList Skills { get => field ??= []; set; }
+}
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionSkillsListRequest
+{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Server name and optional replacement configuration for an individual MCP server restart. Omit `config` for a config-free restart-by-name of an already-configured server.
+/// Skill invocation record with name, path, content, allowed tools, and turn number.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpRestartServerRequest
+public sealed class SkillsInvokedSkill
{
- /// 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).
- [JsonPropertyName("config")]
- public JsonElement? Config { get; set; }
+ /// Tools that should be auto-approved when this skill is active, captured at invocation time.
+ [JsonPropertyName("allowedTools")]
+ public IList? AllowedTools { get; set; }
- /// Name of the MCP server to restart.
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// Full content of the skill file.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Turn number when the skill was invoked.
+ [JsonPropertyName("invokedAtTurn")]
+ public long InvokedAtTurn { get; set; }
+
+ /// Unique identifier for the skill.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Path to the SKILL.md file.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
}
-/// Server name for an individual MCP server stop.
+/// Skills invoked during this session, ordered by invocation time (most recent last).
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpStopServerRequest
+public sealed class SkillsGetInvokedResult
{
- /// Name of the MCP server to stop.
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// Skills invoked during this session, ordered by invocation time (most recent last).
+ [JsonPropertyName("skills")]
+ public IList Skills { get => field ??= []; set; }
+}
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionSkillsGetInvokedRequest
+{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Registration parameters for an external MCP client.
+/// Name of the skill to enable for the session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpRegisterExternalClientRequest
+internal sealed class SkillsEnableRequest
{
- /// In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary.
- [JsonInclude]
- [JsonPropertyName("client")]
- internal JsonElement Client { get; set; }
-
- /// In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions.
- [JsonInclude]
- [JsonPropertyName("config")]
- internal JsonElement Config { get; set; }
-
- /// Logical server name for the external client.
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// Name of the skill to enable.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
-
- /// In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary.
- [JsonInclude]
- [JsonPropertyName("transport")]
- internal JsonElement Transport { get; set; }
}
-/// Server name identifying the external client to remove.
+/// Name of the skill to disable for the session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpUnregisterExternalClientRequest
+internal sealed class SkillsDisableRequest
{
- /// Server name of the external client to unregister.
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// Name of the skill to disable.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Whether the named MCP server is running.
+/// Diagnostics from reloading skill definitions, with warnings and errors as separate lists.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpIsServerRunningResult
+public sealed class SkillsLoadDiagnostics
{
- /// True if the server has an active client and transport.
- [JsonPropertyName("running")]
- public bool Running { get; set; }
+ /// Errors emitted while loading skills (e.g. skills that failed to load entirely).
+ [JsonPropertyName("errors")]
+ public IList Errors { get => field ??= []; set; }
+
+ /// Warnings emitted while loading skills (e.g. skills that loaded but had issues).
+ [JsonPropertyName("warnings")]
+ public IList Warnings { get => field ??= []; set; }
}
-/// Server name to check running status for.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpIsServerRunningRequest
+internal sealed class SessionSkillsReloadRequest
{
- /// Name of the MCP server to check.
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the pending MCP OAuth response was accepted.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpOauthHandlePendingResult
+internal sealed class SessionSkillsEnsureLoadedRequest
{
- /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Host response to the pending OAuth request.
-/// Polymorphic base type discriminated by kind.
+/// Recorded MCP server connection failure.
[Experimental(Diagnostics.Experimental)]
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "kind",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(McpOauthPendingRequestResponseToken), "token")]
-[JsonDerivedType(typeof(McpOauthPendingRequestResponseCancelled), "cancelled")]
-public partial class McpOauthPendingRequestResponse
+public sealed class McpServerFailureInfo
{
- /// The type discriminator.
- [JsonPropertyName("kind")]
- public virtual string Kind { get; set; } = string.Empty;
+ /// Failure message produced when the MCP server connection failed.
+ [JsonPropertyName("message")]
+ public string Message { get; set; } = string.Empty;
+
+ /// epoch-ms timestamp at which the failure was recorded.
+ [JsonPropertyName("timestamp")]
+ public long Timestamp { get; set; }
}
+/// Recorded MCP server pending-auth state.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpServerNeedsAuthInfo
+{
+ /// epoch-ms timestamp at which the server signalled it needs authentication.
+ [JsonPropertyName("timestamp")]
+ public long Timestamp { get; set; }
+}
-/// The token variant of .
+/// Host-level state, omitted when no MCP host is initialized.
[Experimental(Diagnostics.Experimental)]
-public partial class McpOauthPendingRequestResponseToken : McpOauthPendingRequestResponse
+public sealed class McpHostState
{
- ///
- [JsonIgnore]
- public override string Kind => "token";
+ /// Names of currently-connected MCP clients.
+ [JsonPropertyName("clients")]
+ public IList Clients { get => field ??= []; set; }
- /// Access token acquired by the SDK host.
- [JsonPropertyName("accessToken")]
- public required string AccessToken { get; set; }
+ /// Configured servers that are explicitly disabled.
+ [JsonPropertyName("disabledServers")]
+ public IList DisabledServers { get => field ??= []; set; }
- /// Token lifetime in seconds, if known.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("expiresIn")]
- public long? ExpiresIn { get; set; }
+ /// Map of server name to recorded connection failure.
+ [JsonPropertyName("failedServers")]
+ public IDictionary FailedServers { get => field ??= new Dictionary(); set; }
- /// OAuth token type. Defaults to Bearer when omitted.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("tokenType")]
- public string? TokenType { get; set; }
+ /// Configured servers filtered out by MCP server policy.
+ [JsonPropertyName("filteredServers")]
+ public IList FilteredServers { get => field ??= []; set; }
+
+ /// Whether third-party MCP servers are policy-enabled for this session.
+ [JsonPropertyName("mcp3pEnabled")]
+ public bool Mcp3pEnabled { get; set; }
+
+ /// Map of server name to recorded pending-auth state.
+ [JsonPropertyName("needsAuthServers")]
+ public IDictionary NeedsAuthServers { get => field ??= new Dictionary(); set; }
+
+ /// Names of servers with in-flight connection attempts.
+ [JsonPropertyName("pendingConnections")]
+ public IList PendingConnections { get => field ??= []; set; }
}
-/// The cancelled variant of .
+/// MCP server status entry, including config source/plugin source and any connection error.
[Experimental(Diagnostics.Experimental)]
-public partial class McpOauthPendingRequestResponseCancelled : McpOauthPendingRequestResponse
+public sealed class McpServer
{
- ///
- [JsonIgnore]
- public override string Kind => "cancelled";
+ /// Error message if the server failed to connect.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+
+ /// Server name (config key).
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Configuration source: user, workspace, plugin, or builtin.
+ [JsonPropertyName("source")]
+ public McpServerSource? Source { get; set; }
+
+ /// Plugin name that provided this server, when source is plugin.
+ [JsonPropertyName("sourcePlugin")]
+ public string? SourcePlugin { get; set; }
+
+ /// Plugin version that provided this server, when source is plugin.
+ [JsonPropertyName("sourcePluginVersion")]
+ public string? SourcePluginVersion { get; set; }
+
+ /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured.
+ [JsonPropertyName("status")]
+ public McpServerStatus Status { get; set; }
}
-/// Pending MCP OAuth request ID and host-provided token or cancellation response.
+/// MCP servers configured for the session, with their connection status and host-level state.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpOauthHandlePendingRequest
+public sealed class McpServerList
{
- /// OAuth request identifier from the mcp.oauth_required event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
+ /// Host-level state, omitted when no MCP host is initialized.
+ [JsonPropertyName("host")]
+ public McpHostState? Host { get; set; }
- /// Host response to the pending OAuth request.
- [JsonPropertyName("result")]
- public McpOauthPendingRequestResponse Result { get => field ??= new(); set; }
+ /// Configured MCP servers.
+ [JsonPropertyName("servers")]
+ public IList Servers { get => field ??= []; set; }
+}
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionMcpListRequest
+{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
+/// Normalized MCP Apps discovery metadata from a tool's `_meta.ui` block.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpOauthLoginResult
+public sealed class McpToolUi
{
- /// 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.
- [Url]
- [StringSyntax(StringSyntaxAttribute.Uri)]
- [JsonPropertyName("authorizationUrl")]
- public string? AuthorizationUrl { get; set; }
+ /// URI of the tool's MCP App resource, typically a `ui://` resource identifier. Use `session.mcp.resources.read` to fetch its HTML and resource metadata.
+ [JsonPropertyName("resourceUri")]
+ public string? ResourceUri { get; set; }
+
+ /// Tool visibility advertised by the server. When absent, MCP Apps defaults apply.
+ [JsonPropertyName("visibility")]
+ public IList? Visibility { get; set; }
}
-/// Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.
+/// MCP tool metadata with tool name, optional description, and normalized MCP Apps discovery metadata.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpOauthLoginRequest
+public sealed class McpTools
{
- /// Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return.
- [JsonPropertyName("callbackSuccessMessage")]
- public string? CallbackSuccessMessage { get; set; }
-
- /// Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration.
- [JsonPropertyName("clientId")]
- public string? ClientId { get; set; }
-
- /// Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees.
- [JsonPropertyName("clientName")]
- public string? ClientName { get; set; }
-
- /// Optional OAuth client secret override for this login. The runtime treats this as an ephemeral host-owned secret, uses it for this authentication attempt and does not persist it.
- [JsonPropertyName("clientSecret")]
- public string? ClientSecret { get; set; }
+ /// Tool description, when provided.
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
- /// When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck.
- [JsonPropertyName("forceReauth")]
- public bool? ForceReauth { get; set; }
+ /// Tool name.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// Optional OAuth grant type override for this login. Defaults to the server configuration, or authorization_code when no grant type is specified.
- [JsonPropertyName("grantType")]
- public McpOauthLoginGrantType? GrantType { get; set; }
+ /// Normalized MCP Apps discovery metadata. An empty object indicates that a valid `_meta.ui` block was present without recognized fields.
+ [JsonPropertyName("ui")]
+ public McpToolUi? Ui { get; set; }
+}
- /// Optional override indicating whether the static OAuth client is public. When false, the runtime treats it as confidential and uses the per-login clientSecret if provided, otherwise retrieving the client secret from the MCP OAuth secret store.
- [JsonPropertyName("publicClient")]
- public bool? PublicClient { get; set; }
+/// Tools exposed by the connected MCP server. Throws when the server is not connected.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpListToolsResult
+{
+ /// Tools exposed by the server.
+ [JsonPropertyName("tools")]
+ public IList Tools { get => field ??= []; set; }
+}
- /// Name of the remote MCP server to authenticate.
+/// Server name whose tool list should be returned.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpListToolsRequest
+{
+ /// Name of the connected MCP server whose tools to list.
[RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
[MinLength(1)]
@@ -6583,343 +6955,290 @@ internal sealed class McpOauthLoginRequest
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the pending MCP headers refresh response was accepted.
+/// Name of the MCP server to enable for the session.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpHeadersHandlePendingHeadersRefreshRequestResult
+internal sealed class McpEnableRequest
{
- /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Name of the MCP server to enable.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Host response: supply dynamic headers or decline this refresh.
-/// Polymorphic base type discriminated by kind.
+/// Name of the MCP server to disable for the session.
[Experimental(Diagnostics.Experimental)]
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "kind",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(McpHeadersHandlePendingHeadersRefreshRequestHeaders), "headers")]
-[JsonDerivedType(typeof(McpHeadersHandlePendingHeadersRefreshRequestNone), "none")]
-public partial class McpHeadersHandlePendingHeadersRefreshRequest
+internal sealed class McpDisableRequest
{
- /// The type discriminator.
- [JsonPropertyName("kind")]
- public virtual string Kind { get; set; } = string.Empty;
-}
+ /// Name of the MCP server to disable.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
-/// The headers variant of .
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public partial class McpHeadersHandlePendingHeadersRefreshRequestHeaders : McpHeadersHandlePendingHeadersRefreshRequest
+internal sealed class SessionMcpReloadRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "headers";
-
- /// Headers to overlay onto the MCP request. Dynamic headers override static config headers but do not replace SDK-managed request headers.
- [JsonPropertyName("headers")]
- public required IDictionary Headers { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// The none variant of .
+/// MCP server allowed by policy, with server name and optional PII-free explanatory note.
[Experimental(Diagnostics.Experimental)]
-public partial class McpHeadersHandlePendingHeadersRefreshRequestNone : McpHeadersHandlePendingHeadersRefreshRequest
+public sealed class McpAllowedServer
{
- ///
- [JsonIgnore]
- public override string Kind => "none";
+ /// Allowed server name.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// PII-free note explaining why the server was allowed.
+ [JsonPropertyName("redactedNote")]
+ public string? RedactedNote { get; set; }
}
-/// MCP headers refresh request id and the host response.
+/// MCP server filtered by policy, with name, reason, and optional redacted reason.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpHeadersHandlePendingHeadersRefreshRequestRequest
+public sealed class McpFilteredServer
{
- /// Headers refresh request identifier from mcp.headers_refresh_required.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
-
- /// Host response: supply dynamic headers or decline this refresh.
- [JsonPropertyName("result")]
- public McpHeadersHandlePendingHeadersRefreshRequest Result { get => field ??= new(); set; }
-
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
-
-/// MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource metadata.
-[Experimental(Diagnostics.Experimental)]
-public sealed class McpAppsResourceContent
-{
- /// Resource-level metadata (CSP, permissions, etc.).
- [JsonPropertyName("_meta")]
- public IDictionary? Meta { get; set; }
-
- /// Base64-encoded binary content.
- [JsonPropertyName("blob")]
- public string? Blob { get; set; }
+ /// Deprecated. This field is no longer populated.
+ [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("enterpriseName")]
+ public string? EnterpriseName { get; set; }
- /// MIME type of the content.
- [JsonPropertyName("mimeType")]
- public string? MimeType { get; set; }
+ /// Filtered server name.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// Text content (e.g. HTML).
- [JsonPropertyName("text")]
- public string? Text { get; set; }
+ /// Human-readable filter reason.
+ [JsonPropertyName("reason")]
+ public string Reason { get; set; } = string.Empty;
- /// The resource URI (typically ui://...).
- [JsonPropertyName("uri")]
- public string Uri { get; set; } = string.Empty;
+ /// PII-free filter reason.
+ [JsonPropertyName("redactedReason")]
+ public string? RedactedReason { get; set; }
}
-/// Resource contents returned by the MCP server.
+/// MCP server startup filtering result.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpAppsReadResourceResult
+internal sealed class McpStartServersResult
{
- /// Resource contents returned by the server.
- [JsonPropertyName("contents")]
- public IList Contents { get => field ??= []; set; }
+ /// Non-default servers allowed by policy.
+ [JsonPropertyName("allowedServers")]
+ public IList? AllowedServers { get; set; }
+
+ /// Servers filtered out before startup.
+ [JsonPropertyName("filteredServers")]
+ public IList FilteredServers { get => field ??= []; set; }
}
-/// MCP server and resource URI to fetch.
+/// Opaque MCP reload configuration.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpAppsReadResourceRequest
+internal sealed class McpReloadWithConfigRequest
{
- /// Name of the MCP server hosting the resource.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// Opaque runtime MCP reload configuration. Marked internal: an in-process runtime shape (reloadMcpServers throws over the wire).
+ [JsonInclude]
+ [JsonPropertyName("config")]
+ internal JsonElement Config { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
-
- /// Resource URI (typically ui://...).
- [JsonPropertyName("uri")]
- public string Uri { get; set; } = string.Empty;
}
-/// App-callable tools from the named MCP server.
+/// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpAppsListToolsResult
+public sealed class McpExecuteSamplingResult
{
- /// App-callable tools from the server.
- [JsonPropertyName("tools")]
- public IList> Tools { get => field ??= []; set; }
}
-/// MCP server to list app-callable tools for.
+/// Outcome of an MCP sampling execution: success result, failure error, or cancellation.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpAppsListToolsRequest
+public sealed class McpSamplingExecutionResult
{
- /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("originServerName")]
- public string OriginServerName { get; set; } = string.Empty;
+ /// Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution.
+ [JsonPropertyName("action")]
+ public McpSamplingExecutionAction Action { get; set; }
- /// MCP server hosting the app.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// Error description, present when action='failure'.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape.
+ [JsonPropertyName("result")]
+ public McpExecuteSamplingResult? Result { get; set; }
}
-/// MCP server, tool name, and arguments to invoke from an MCP App view.
+/// Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpAppsCallToolRequest
+public sealed class McpExecuteSamplingRequest
{
- /// Tool arguments.
- [JsonPropertyName("arguments")]
- public IDictionary? Arguments { get; set; }
+}
- /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("originServerName")]
- public string OriginServerName { get; set; } = string.Empty;
+/// Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpExecuteSamplingParams
+{
+ /// The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle).
+ [JsonPropertyName("mcpRequestId")]
+ public JsonElement McpRequestId { get; set; }
- /// MCP server hosting the tool.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
+ /// Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally.
+ [JsonPropertyName("request")]
+ public McpExecuteSamplingRequest Request { get => field ??= new(); set; }
+
+ /// Caller-provided unique identifier for this sampling execution. Use this same ID with cancelSamplingExecution to cancel the in-flight call. Must be unique within the session for the lifetime of the call.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// Name of the MCP server that initiated the sampling request.
[JsonPropertyName("serverName")]
public string ServerName { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
-
- /// MCP tool name.
- [JsonPropertyName("toolName")]
- public string ToolName { get; set; } = string.Empty;
}
-/// Host context advertised to MCP App guests.
+/// Indicates whether an in-flight sampling execution with the given requestId was found and cancelled.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpAppsSetHostContextDetails
+public sealed class McpCancelSamplingExecutionResult
{
- /// Display modes the host supports.
- [JsonPropertyName("availableDisplayModes")]
- public IList? AvailableDisplayModes { get; set; }
-
- /// Current display mode (SEP-1865).
- [JsonPropertyName("displayMode")]
- public McpAppsSetHostContextDetailsDisplayMode? DisplayMode { get; set; }
-
- /// BCP-47 locale, e.g. 'en-US'.
- [JsonPropertyName("locale")]
- public string? Locale { get; set; }
-
- /// Platform type for responsive design.
- [JsonPropertyName("platform")]
- public McpAppsSetHostContextDetailsPlatform? Platform { get; set; }
-
- /// UI theme preference per SEP-1865.
- [JsonPropertyName("theme")]
- public McpAppsSetHostContextDetailsTheme? Theme { get; set; }
-
- /// IANA timezone, e.g. 'America/New_York'.
- [JsonPropertyName("timeZone")]
- public string? TimeZone { get; set; }
-
- /// Host application identifier.
- [JsonPropertyName("userAgent")]
- public string? UserAgent { get; set; }
+ /// True if an in-flight execution with the given requestId was found and signalled to cancel. False when no such execution is in flight (already completed, never started, or cancelled by another caller).
+ [JsonPropertyName("cancelled")]
+ public bool Cancelled { get; set; }
}
-/// Host context to advertise to MCP App guests.
+/// The requestId previously passed to executeSampling that should be cancelled.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpAppsSetHostContextRequest
+internal sealed class McpCancelSamplingExecutionParams
{
- /// Host context advertised to MCP App guests.
- [JsonPropertyName("context")]
- public McpAppsSetHostContextDetails Context { get => field ??= new(); set; }
+ /// The requestId previously passed to executeSampling that should be cancelled.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Current host context.
+/// Env-value mode recorded on the session after the update.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpAppsHostContextDetails
+public sealed class McpSetEnvValueModeResult
{
- /// Display modes the host supports.
- [JsonPropertyName("availableDisplayModes")]
- public IList? AvailableDisplayModes { get; set; }
-
- /// Current display mode (SEP-1865).
- [JsonPropertyName("displayMode")]
- public McpAppsHostContextDetailsDisplayMode? DisplayMode { get; set; }
-
- /// BCP-47 locale, e.g. 'en-US'.
- [JsonPropertyName("locale")]
- public string? Locale { get; set; }
-
- /// Platform type for responsive design.
- [JsonPropertyName("platform")]
- public McpAppsHostContextDetailsPlatform? Platform { get; set; }
-
- /// UI theme preference per SEP-1865.
- [JsonPropertyName("theme")]
- public McpAppsHostContextDetailsTheme? Theme { get; set; }
+ /// Mode recorded on the session after the update.
+ [JsonPropertyName("mode")]
+ public McpSetEnvValueModeDetails Mode { get; set; }
+}
- /// IANA timezone, e.g. 'America/New_York'.
- [JsonPropertyName("timeZone")]
- public string? TimeZone { get; set; }
+/// Mode controlling how MCP server env values are resolved (`direct` or `indirect`).
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpSetEnvValueModeParams
+{
+ /// How environment-variable values supplied to MCP servers are resolved. "direct" passes literal string values; "indirect" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to "direct".
+ [JsonPropertyName("mode")]
+ public McpSetEnvValueModeDetails Mode { get; set; }
- /// Host application identifier.
- [JsonPropertyName("userAgent")]
- public string? UserAgent { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Current host context advertised to MCP App guests.
+/// Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove).
[Experimental(Diagnostics.Experimental)]
-public sealed class McpAppsHostContext
+public sealed class McpRemoveGitHubResult
{
- /// Current host context.
- [JsonPropertyName("context")]
- public McpAppsHostContextDetails Context { get => field ??= new(); set; }
+ /// True when the auto-managed `github` MCP server was removed; false when no removal happened (e.g. user has explicitly configured a `github` server, or the server was not registered).
+ [JsonPropertyName("removed")]
+ public bool Removed { get; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionMcpAppsGetHostContextRequest
+internal sealed class SessionMcpRemoveGitHubRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Capability negotiation snapshot.
+/// Result of configuring GitHub MCP.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpAppsDiagnoseCapability
+internal sealed class McpConfigureGitHubResult
{
- /// Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers.
- [JsonPropertyName("advertised")]
- public bool Advertised { get; set; }
+ /// Whether GitHub MCP configuration changed.
+ [JsonPropertyName("changed")]
+ public bool Changed { get; set; }
+}
- /// Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on.
- [JsonPropertyName("featureFlagEnabled")]
- public bool FeatureFlagEnabled { get; set; }
+/// Opaque auth info used to configure GitHub MCP.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpConfigureGitHubRequest
+{
+ /// Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire).
+ [JsonInclude]
+ [JsonPropertyName("authInfo")]
+ internal JsonElement AuthInfo { get; set; }
- /// Whether the session has the `mcp-apps` capability.
- [JsonPropertyName("sessionHasMcpApps")]
- public bool SessionHasMcpApps { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// What the server returned for this session.
+/// 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)]
-public sealed class McpAppsDiagnoseServer
+internal sealed class McpStartServerRequest
{
- /// Whether the named server is currently connected.
- [JsonPropertyName("connected")]
- public bool Connected { get; set; }
-
- /// Up to 5 tool names with `_meta.ui` for quick inspection.
- [JsonPropertyName("sampleToolNames")]
- public IList SampleToolNames { get => field ??= []; set; }
+ /// 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; }
- /// Total tools returned by the server's tools/list.
- [JsonPropertyName("toolCount")]
- public double ToolCount { get; set; }
+ /// Name of the MCP server to start.
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
- /// Tools whose `_meta.ui` is populated (resourceUri and/or visibility set).
- [JsonPropertyName("toolsWithUiMeta")]
- public double ToolsWithUiMeta { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Diagnostic snapshot of MCP Apps wiring for the named server.
+/// Server name and optional replacement configuration for an individual MCP server restart. Omit `config` for a config-free restart-by-name of an already-configured server.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpAppsDiagnoseResult
+internal sealed class McpRestartServerRequest
{
- /// Capability negotiation snapshot.
- [JsonPropertyName("capability")]
- public McpAppsDiagnoseCapability Capability { get => field ??= new(); set; }
+ /// 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).
+ [JsonPropertyName("config")]
+ public JsonElement? Config { get; set; }
- /// What the server returned for this session.
- [JsonPropertyName("server")]
- public McpAppsDiagnoseServer Server { get => field ??= new(); set; }
+ /// Name of the MCP server to restart.
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// MCP server to diagnose MCP Apps wiring for.
+/// Server name for an individual MCP server stop.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpAppsDiagnoseRequest
+internal sealed class McpStopServerRequest
{
- /// MCP server to probe.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
+ /// Name of the MCP server to stop.
[JsonPropertyName("serverName")]
public string ServerName { get; set; } = string.Empty;
@@ -6928,173 +7247,187 @@ internal sealed class McpAppsDiagnoseRequest
public string SessionId { get; set; } = string.Empty;
}
-/// MCP resource content with URI, optional MIME type, text or base64 blob, and resource metadata.
+/// Registration parameters for an external MCP client.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpResourceContent
+internal sealed class McpRegisterExternalClientRequest
{
- /// Resource-level metadata (CSP, permissions, etc.).
- [JsonPropertyName("_meta")]
- public IDictionary? Meta { get; set; }
+ /// In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary.
+ [JsonInclude]
+ [JsonPropertyName("client")]
+ internal JsonElement Client { get; set; }
- /// Base64-encoded binary content.
- [JsonPropertyName("blob")]
- public string? Blob { get; set; }
+ /// In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions.
+ [JsonInclude]
+ [JsonPropertyName("config")]
+ internal JsonElement Config { get; set; }
- /// MIME type of the content.
- [JsonPropertyName("mimeType")]
- public string? MimeType { get; set; }
+ /// Logical server name for the external client.
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
- /// Text content (e.g. HTML).
- [JsonPropertyName("text")]
- public string? Text { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
- /// The resource URI.
- [JsonPropertyName("uri")]
- public string Uri { get; set; } = string.Empty;
+ /// In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary.
+ [JsonInclude]
+ [JsonPropertyName("transport")]
+ internal JsonElement Transport { get; set; }
}
-/// Resource contents returned by the MCP server.
+/// Server name identifying the external client to remove.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpResourcesReadResult
+internal sealed class McpUnregisterExternalClientRequest
{
- /// Resource contents returned by the server.
- [JsonPropertyName("contents")]
- public IList Contents { get => field ??= []; set; }
+ /// Server name of the external client to unregister.
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// MCP server and resource URI to fetch.
+/// Whether the named MCP server is running.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpResourcesReadRequest
+public sealed class McpIsServerRunningResult
{
- /// Name of the MCP server hosting the resource.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
+ /// True if the server has an active client and transport.
+ [JsonPropertyName("running")]
+ public bool Running { get; set; }
+}
+
+/// Server name to check running status for.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpIsServerRunningRequest
+{
+ /// Name of the MCP server to check.
[JsonPropertyName("serverName")]
public string ServerName { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
-
- /// Resource URI.
- [JsonPropertyName("uri")]
- public string Uri { get; set; } = string.Empty;
}
-/// Standard MCP resource annotations plus preserved non-standard annotation fields.
+/// Indicates whether the pending MCP OAuth response was accepted.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpResourceAnnotations
+public sealed class McpOauthHandlePendingResult
{
- /// Server-provided non-standard annotation fields preserved from the MCP response.
- [JsonPropertyName("additionalProperties")]
- public IDictionary? AdditionalProperties { get; set; }
-
- /// Intended audience roles for this resource.
- [JsonPropertyName("audience")]
- public IList? Audience { get; set; }
-
- /// Last-modified timestamp hint.
- [JsonPropertyName("lastModified")]
- public string? LastModified { get; set; }
-
- /// Priority hint for model/client use.
- [JsonPropertyName("priority")]
- public double? Priority { get; set; }
+ /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
}
-/// A resource icon descriptor plus preserved non-standard icon fields.
+/// Host response to the pending OAuth request.
+/// Polymorphic base type discriminated by kind.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpResourceIcon
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "kind",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(McpOauthPendingRequestResponseToken), "token")]
+[JsonDerivedType(typeof(McpOauthPendingRequestResponseCancelled), "cancelled")]
+public partial class McpOauthPendingRequestResponse
{
- /// Server-provided non-standard icon fields preserved from the MCP response.
- [JsonPropertyName("additionalProperties")]
- public IDictionary? AdditionalProperties { get; set; }
+ /// The type discriminator.
+ [JsonPropertyName("kind")]
+ public virtual string Kind { get; set; } = string.Empty;
+}
- /// Icon MIME type, when known.
- [JsonPropertyName("mimeType")]
- public string? MimeType { get; set; }
- /// Icon sizes hint.
- [JsonPropertyName("sizes")]
- public string? Sizes { get; set; }
+/// The token variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class McpOauthPendingRequestResponseToken : McpOauthPendingRequestResponse
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "token";
- /// Icon URI.
- [JsonPropertyName("src")]
- public string Src { get; set; } = string.Empty;
+ /// Access token acquired by the SDK host.
+ [JsonPropertyName("accessToken")]
+ public required string AccessToken { get; set; }
- /// Theme hint for this icon.
- [JsonPropertyName("theme")]
- public string? Theme { get; set; }
+ /// Token lifetime in seconds, if known.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("expiresIn")]
+ public long? ExpiresIn { get; set; }
+
+ /// OAuth token type. Defaults to Bearer when omitted.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("tokenType")]
+ public string? TokenType { get; set; }
}
-/// An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, MIME type, size, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`.
+/// The cancelled variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class McpResource
+public partial class McpOauthPendingRequestResponseCancelled : McpOauthPendingRequestResponse
{
- /// Resource-level metadata.
- [JsonPropertyName("_meta")]
- public IDictionary? Meta { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "cancelled";
+}
- /// Server-provided non-standard descriptor fields preserved from the MCP response.
- [JsonPropertyName("additionalProperties")]
- public IDictionary? AdditionalProperties { get; set; }
+/// Pending MCP OAuth request ID and host-provided token or cancellation response.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpOauthHandlePendingRequest
+{
+ /// OAuth request identifier from the mcp.oauth_required event.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
- /// Model/client annotations associated with this resource.
- [JsonPropertyName("annotations")]
- public McpResourceAnnotations? Annotations { get; set; }
+ /// Host response to the pending OAuth request.
+ [JsonPropertyName("result")]
+ public McpOauthPendingRequestResponse Result { get => field ??= new(); set; }
- /// Optional description of what this resource represents.
- [JsonPropertyName("description")]
- public string? Description { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Icons associated with this resource.
- [JsonPropertyName("icons")]
- public IList? Icons { get; set; }
-
- /// MIME type of the resource, if known.
- [JsonPropertyName("mimeType")]
- public string? MimeType { get; set; }
+/// OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpOauthLoginResult
+{
+ /// 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.
+ [Url]
+ [StringSyntax(StringSyntaxAttribute.Uri)]
+ [JsonPropertyName("authorizationUrl")]
+ public string? AuthorizationUrl { get; set; }
+}
- /// The programmatic name of the resource.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+/// Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpOauthLoginRequest
+{
+ /// Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return.
+ [JsonPropertyName("callbackSuccessMessage")]
+ public string? CallbackSuccessMessage { get; set; }
- /// Resource size in bytes, when known.
- [JsonPropertyName("size")]
- public long? Size { get; set; }
+ /// Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration.
+ [JsonPropertyName("clientId")]
+ public string? ClientId { get; set; }
- /// Optional human-readable display title.
- [JsonPropertyName("title")]
- public string? Title { get; set; }
+ /// Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees.
+ [JsonPropertyName("clientName")]
+ public string? ClientName { get; set; }
- /// The resource URI (e.g. ui://... or file:///...).
- [JsonPropertyName("uri")]
- public string Uri { get; set; } = string.Empty;
-}
+ /// Optional OAuth client secret override for this login. The runtime treats this as an ephemeral host-owned secret, uses it for this authentication attempt and does not persist it.
+ [JsonPropertyName("clientSecret")]
+ public string? ClientSecret { get; set; }
-/// One page of resources advertised by the named MCP server.
-[Experimental(Diagnostics.Experimental)]
-public sealed class McpResourcesListResult
-{
- /// Opaque cursor for the next page, if the server has more resources.
- [JsonPropertyName("nextCursor")]
- public string? NextCursor { get; set; }
+ /// When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck.
+ [JsonPropertyName("forceReauth")]
+ public bool? ForceReauth { get; set; }
- /// Resources advertised by the server (proxied MCP `resources/list`).
- [JsonPropertyName("resources")]
- public IList Resources { get => field ??= []; set; }
-}
+ /// Optional OAuth grant type override for this login. Defaults to the server configuration, or authorization_code when no grant type is specified.
+ [JsonPropertyName("grantType")]
+ public McpOauthLoginGrantType? GrantType { get; set; }
-/// MCP server whose resources to enumerate.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class McpResourcesListRequest
-{
- /// Opaque MCP pagination cursor from a prior `nextCursor` value.
- [JsonPropertyName("cursor")]
- public string? Cursor { get; set; }
+ /// Optional override indicating whether the static OAuth client is public. When false, the runtime treats it as confidential and uses the per-login clientSecret if provided, otherwise retrieving the client secret from the MCP OAuth secret store.
+ [JsonPropertyName("publicClient")]
+ public bool? PublicClient { get; set; }
- /// Name of the MCP server whose resources to enumerate.
+ /// Name of the remote MCP server to authenticate.
[RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
[MinLength(1)]
@@ -7106,5942 +7439,8556 @@ internal sealed class McpResourcesListRequest
public string SessionId { get; set; } = string.Empty;
}
-/// An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, name, and optional title, description, MIME type, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`.
+/// Indicates whether the pending MCP OAuth response was accepted.
[Experimental(Diagnostics.Experimental)]
-public sealed class McpResourceTemplate
+public sealed class McpOauthRespondResult
{
- /// Resource-template-level metadata.
- [JsonPropertyName("_meta")]
- public IDictionary? Meta { get; set; }
-
- /// Server-provided non-standard descriptor fields preserved from the MCP response.
- [JsonPropertyName("additionalProperties")]
- public IDictionary? AdditionalProperties { get; set; }
+ /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
- /// Model/client annotations associated with this template.
- [JsonPropertyName("annotations")]
- public McpResourceAnnotations? Annotations { 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;
- /// Optional description of what this template is for.
- [JsonPropertyName("description")]
- public string? Description { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Icons associated with resources matching this template.
- [JsonPropertyName("icons")]
- public IList? Icons { get; set; }
+/// Indicates whether the pending MCP headers refresh response was accepted.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpHeadersHandlePendingHeadersRefreshRequestResult
+{
+ /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
- /// MIME type for resources matching this template, if uniform.
- [JsonPropertyName("mimeType")]
- public string? MimeType { get; set; }
+/// Host response: supply dynamic headers or decline this refresh.
+/// Polymorphic base type discriminated by kind.
+[Experimental(Diagnostics.Experimental)]
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "kind",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(McpHeadersHandlePendingHeadersRefreshRequestHeaders), "headers")]
+[JsonDerivedType(typeof(McpHeadersHandlePendingHeadersRefreshRequestNone), "none")]
+public partial class McpHeadersHandlePendingHeadersRefreshRequest
+{
+ /// The type discriminator.
+ [JsonPropertyName("kind")]
+ public virtual string Kind { get; set; } = string.Empty;
+}
- /// The programmatic name of the resource template.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
- /// Optional human-readable display title.
- [JsonPropertyName("title")]
- public string? Title { get; set; }
+/// The headers variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class McpHeadersHandlePendingHeadersRefreshRequestHeaders : McpHeadersHandlePendingHeadersRefreshRequest
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "headers";
- /// An RFC 6570 URI template for constructing resource URIs.
- [JsonPropertyName("uriTemplate")]
- public string UriTemplate { get; set; } = string.Empty;
+ /// Headers to overlay onto the MCP request. Dynamic headers override static config headers but do not replace SDK-managed request headers.
+ [JsonPropertyName("headers")]
+ public required IDictionary Headers { get; set; }
}
-/// One page of resource templates advertised by the named MCP server.
+/// The none variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class McpResourcesListTemplatesResult
+public partial class McpHeadersHandlePendingHeadersRefreshRequestNone : McpHeadersHandlePendingHeadersRefreshRequest
{
- /// Opaque cursor for the next page, if the server has more resource templates.
- [JsonPropertyName("nextCursor")]
- public string? NextCursor { get; set; }
-
- /// Resource templates advertised by the server (proxied MCP `resources/templates/list`).
- [JsonPropertyName("resourceTemplates")]
- public IList ResourceTemplates { get => field ??= []; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "none";
}
-/// MCP server whose resource templates to enumerate.
+/// MCP headers refresh request id and the host response.
[Experimental(Diagnostics.Experimental)]
-internal sealed class McpResourcesListTemplatesRequest
+internal sealed class McpHeadersHandlePendingHeadersRefreshRequestRequest
{
- /// Opaque MCP pagination cursor from a prior `nextCursor` value.
- [JsonPropertyName("cursor")]
- public string? Cursor { get; set; }
+ /// Headers refresh request identifier from mcp.headers_refresh_required.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
- /// Name of the MCP server whose resource templates to enumerate.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// Host response: supply dynamic headers or decline this refresh.
+ [JsonPropertyName("result")]
+ public McpHeadersHandlePendingHeadersRefreshRequest Result { get => field ??= new(); set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Session plugin metadata, with name, marketplace, optional version, and enabled state.
+/// MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource metadata.
[Experimental(Diagnostics.Experimental)]
-public sealed class Plugin
+public sealed class McpAppsResourceContent
{
- /// Whether the plugin is currently enabled.
- [JsonPropertyName("enabled")]
- public bool Enabled { get; set; }
+ /// Resource-level metadata (CSP, permissions, etc.).
+ [JsonPropertyName("_meta")]
+ public IDictionary? Meta { get; set; }
- /// Marketplace the plugin came from.
- [JsonPropertyName("marketplace")]
- public string Marketplace { get; set; } = string.Empty;
+ /// Base64-encoded binary content.
+ [JsonPropertyName("blob")]
+ public string? Blob { get; set; }
- /// Plugin name.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// MIME type of the content.
+ [JsonPropertyName("mimeType")]
+ public string? MimeType { get; set; }
- /// Installed version.
- [JsonPropertyName("version")]
- public string? Version { get; set; }
+ /// Text content (e.g. HTML).
+ [JsonPropertyName("text")]
+ public string? Text { get; set; }
+
+ /// The resource URI (typically ui://...).
+ [JsonPropertyName("uri")]
+ public string Uri { get; set; } = string.Empty;
}
-/// Plugins installed for the session, with their enabled state and version metadata.
+/// Resource contents returned by the MCP server.
[Experimental(Diagnostics.Experimental)]
-public sealed class PluginList
+public sealed class McpAppsReadResourceResult
{
- /// Installed plugins.
- [JsonPropertyName("plugins")]
- public IList Plugins { get => field ??= []; set; }
+ /// Resource contents returned by the server.
+ [JsonPropertyName("contents")]
+ public IList Contents { get => field ??= []; set; }
}
-/// Identifies the target session.
+/// MCP server and resource URI to fetch.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionPluginsListRequest
+internal sealed class McpAppsReadResourceRequest
{
+ /// Name of the MCP server hosting the resource.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
+
+ /// Resource URI (typically ui://...).
+ [JsonPropertyName("uri")]
+ public string Uri { get; set; } = string.Empty;
}
-/// Optional flags controlling which side effects the reload performs.
+/// App-callable tools from the named MCP server.
[Experimental(Diagnostics.Experimental)]
-public sealed class PluginsReloadRequest
+public sealed class McpAppsListToolsResult
{
- /// When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`.
- [JsonPropertyName("deferRepoHooks")]
- public bool? DeferRepoHooks { get; set; }
-
- /// Re-run custom-agent discovery after refreshing plugins. Defaults to true.
- [JsonPropertyName("reloadCustomAgents")]
- public bool? ReloadCustomAgents { get; set; }
-
- /// Re-discover and relaunch subprocess extensions (including plugin-shipped extensions) after refreshing plugins. Defaults to true. Has no effect when the session has no active extension controller (e.g. extensions were not requested for the session).
- [JsonPropertyName("reloadExtensions")]
- public bool? ReloadExtensions { get; set; }
+ /// App-callable tools from the server.
+ [JsonPropertyName("tools")]
+ public IList> Tools { get => field ??= []; set; }
+}
- /// Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions).
- [JsonPropertyName("reloadHooks")]
- public bool? ReloadHooks { get; set; }
-
- /// Reload MCP server connections after refreshing plugins. Defaults to true.
- [JsonPropertyName("reloadMcp")]
- public bool? ReloadMcp { get; set; }
-}
-
-/// Optional flags controlling which side effects the reload performs.
+/// MCP server to list app-callable tools for.
[Experimental(Diagnostics.Experimental)]
-internal sealed class PluginsReloadRequestWithSession
+internal sealed class McpAppsListToolsRequest
{
- /// When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`.
- [JsonPropertyName("deferRepoHooks")]
- public bool? DeferRepoHooks { get; set; }
-
- /// Re-run custom-agent discovery after refreshing plugins. Defaults to true.
- [JsonPropertyName("reloadCustomAgents")]
- public bool? ReloadCustomAgents { get; set; }
-
- /// Re-discover and relaunch subprocess extensions (including plugin-shipped extensions) after refreshing plugins. Defaults to true. Has no effect when the session has no active extension controller (e.g. extensions were not requested for the session).
- [JsonPropertyName("reloadExtensions")]
- public bool? ReloadExtensions { get; set; }
-
- /// Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions).
- [JsonPropertyName("reloadHooks")]
- public bool? ReloadHooks { get; set; }
+ /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("originServerName")]
+ public string OriginServerName { get; set; } = string.Empty;
- /// Reload MCP server connections after refreshing plugins. Defaults to true.
- [JsonPropertyName("reloadMcp")]
- public bool? ReloadMcp { get; set; }
+ /// MCP server hosting the app.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Short-lived, rotating credential the caller must send on every request, in addition to `apiKey` if one is present. Omitted when the endpoint does not require one.
+/// MCP server, tool name, and arguments to invoke from an MCP App view.
[Experimental(Diagnostics.Experimental)]
-public sealed class ProviderSessionToken
+internal sealed class McpAppsCallToolRequest
{
- /// When the token expires, if known. Callers should refresh by calling `getEndpoint` again before this time, or reactively on any 401/403 response from `baseUrl`.
- [JsonPropertyName("expiresAt")]
- public DateTimeOffset? ExpiresAt { get; set; }
+ /// Tool arguments.
+ [JsonPropertyName("arguments")]
+ public IDictionary? Arguments { get; set; }
- /// HTTP header name the token must be sent under.
- [JsonPropertyName("header")]
- public string Header { get; set; } = string.Empty;
+ /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("originServerName")]
+ public string OriginServerName { get; set; } = string.Empty;
- /// The model the token is bound to, when applicable. When set, the token is only valid for requests against this model.
- [JsonPropertyName("model")]
- public string? Model { get; set; }
+ /// MCP server hosting the tool.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
- /// The short-lived token value.
- [JsonPropertyName("token")]
- public string Token { get; set; } = string.Empty;
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// MCP tool name.
+ [JsonPropertyName("toolName")]
+ public string ToolName { get; set; } = string.Empty;
}
-/// A snapshot of the provider endpoint the session is currently configured to talk to.
+/// Host context advertised to MCP App guests.
[Experimental(Diagnostics.Experimental)]
-public sealed class ProviderEndpoint
+public sealed class McpAppsSetHostContextDetails
{
- /// A credential the caller should use with this endpoint. Omitted only when the endpoint accepts unauthenticated requests.
- [JsonPropertyName("apiKey")]
- public string? ApiKey { get; set; }
-
- /// Base URL to pass to the LLM client library.
- [Url]
- [StringSyntax(StringSyntaxAttribute.Uri)]
- [JsonPropertyName("baseUrl")]
- public string BaseUrl { get; set; } = string.Empty;
+ /// Display modes the host supports.
+ [JsonPropertyName("availableDisplayModes")]
+ public IList? AvailableDisplayModes { get; set; }
- /// HTTP headers the caller must include on every outbound request.
- [JsonPropertyName("headers")]
- public IDictionary Headers { get => field ??= new Dictionary(); set; }
+ /// Current display mode (SEP-1865).
+ [JsonPropertyName("displayMode")]
+ public McpAppsSetHostContextDetailsDisplayMode? DisplayMode { get; set; }
- /// Short-lived, rotating credential the caller must send on every request, in addition to `apiKey` if one is present. Omitted when the endpoint does not require one.
- [JsonPropertyName("sessionToken")]
- public ProviderSessionToken? SessionToken { get; set; }
+ /// BCP-47 locale, e.g. 'en-US'.
+ [JsonPropertyName("locale")]
+ public string? Locale { get; set; }
- /// Transport to be used for provider requests.
- [JsonPropertyName("transport")]
- public ProviderEndpointTransport? Transport { get; set; }
+ /// Platform type for responsive design.
+ [JsonPropertyName("platform")]
+ public McpAppsSetHostContextDetailsPlatform? Platform { get; set; }
- /// Provider family. Matches the `type` field of a BYOK provider config.
- [JsonPropertyName("type")]
- public ProviderEndpointType Type { get; set; }
+ /// UI theme preference per SEP-1865.
+ [JsonPropertyName("theme")]
+ public McpAppsSetHostContextDetailsTheme? Theme { get; set; }
- /// Wire API to be used, when required for the provider type.
- [JsonPropertyName("wireApi")]
- public ProviderEndpointWireApi? WireApi { get; set; }
-}
+ /// IANA timezone, e.g. 'America/New_York'.
+ [JsonPropertyName("timeZone")]
+ public string? TimeZone { get; set; }
-/// Optional model identifier to scope the endpoint snapshot to.
-[Experimental(Diagnostics.Experimental)]
-public sealed class ProviderGetEndpointRequest
-{
- /// Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using.
- [JsonPropertyName("modelId")]
- public string? ModelId { get; set; }
+ /// Host application identifier.
+ [JsonPropertyName("userAgent")]
+ public string? UserAgent { get; set; }
}
-/// Optional model identifier to scope the endpoint snapshot to.
+/// Host context to advertise to MCP App guests.
[Experimental(Diagnostics.Experimental)]
-internal sealed class ProviderGetEndpointRequestWithSession
+internal sealed class McpAppsSetHostContextRequest
{
- /// Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using.
- [JsonPropertyName("modelId")]
- public string? ModelId { get; set; }
+ /// Host context advertised to MCP App guests.
+ [JsonPropertyName("context")]
+ public McpAppsSetHostContextDetails Context { get => field ??= new(); set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// The selectable model entries synthesized for the models added by this call.
-[Experimental(Diagnostics.Experimental)]
-public sealed class ProviderAddResult
-{
- /// Synthesized selectable model entries for the newly added BYOK models, each under its provider-qualified selection id (`provider/id`). Empty when only providers were added.
- [JsonPropertyName("models")]
- public IList Models { get => field ??= []; set; }
-}
-
-/// A BYOK model definition referencing a named provider.
+/// Current host context.
[Experimental(Diagnostics.Experimental)]
-public sealed class ProviderModelConfig
+public sealed class McpAppsHostContextDetails
{
- /// Optional capability overrides (vision, tool_calls, reasoning, etc.).
- [JsonPropertyName("capabilities")]
- public ModelCapabilitiesOverride? Capabilities { get; set; }
-
- /// Provider-local model id, unique within its provider. The session-wide selection id (shown in the model list and passed to switchTo) is the provider-qualified `provider/id`.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ /// Display modes the host supports.
+ [JsonPropertyName("availableDisplayModes")]
+ public IList? AvailableDisplayModes { get; set; }
- /// Maximum context window tokens for the model.
- [JsonPropertyName("maxContextWindowTokens")]
- public double? MaxContextWindowTokens { get; set; }
+ /// Current display mode (SEP-1865).
+ [JsonPropertyName("displayMode")]
+ public McpAppsHostContextDetailsDisplayMode? DisplayMode { get; set; }
- /// Maximum output tokens for the model.
- [JsonPropertyName("maxOutputTokens")]
- public double? MaxOutputTokens { get; set; }
+ /// BCP-47 locale, e.g. 'en-US'.
+ [JsonPropertyName("locale")]
+ public string? Locale { get; set; }
- /// Maximum prompt/input tokens for the model.
- [JsonPropertyName("maxPromptTokens")]
- public double? MaxPromptTokens { get; set; }
+ /// Platform type for responsive design.
+ [JsonPropertyName("platform")]
+ public McpAppsHostContextDetailsPlatform? Platform { get; set; }
- /// Well-known base model id used for behavior/capability/config lookup. Defaults to `id`.
- [JsonPropertyName("modelId")]
- public string? ModelId { get; set; }
+ /// UI theme preference per SEP-1865.
+ [JsonPropertyName("theme")]
+ public McpAppsHostContextDetailsTheme? Theme { get; set; }
- /// Display name for model pickers. Defaults to the provider-qualified selection id (`provider/id`).
- [JsonPropertyName("name")]
- public string? Name { get; set; }
+ /// IANA timezone, e.g. 'America/New_York'.
+ [JsonPropertyName("timeZone")]
+ public string? TimeZone { get; set; }
- /// Name of the NamedProviderConfig that serves this model.
- [JsonPropertyName("provider")]
- public string Provider { get; set; } = string.Empty;
+ /// Host application identifier.
+ [JsonPropertyName("userAgent")]
+ public string? UserAgent { get; set; }
+}
- /// The model name sent to the provider API for inference. Defaults to `id`.
- [JsonPropertyName("wireModel")]
- public string? WireModel { get; set; }
+/// Current host context advertised to MCP App guests.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpAppsHostContext
+{
+ /// Current host context.
+ [JsonPropertyName("context")]
+ public McpAppsHostContextDetails Context { get => field ??= new(); set; }
}
-/// Azure-specific provider options.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public sealed class ProviderConfigAzure
+internal sealed class SessionMcpAppsGetHostContextRequest
{
- /// API version. When set, uses the versioned deployment route. When omitted, uses the GA versionless v1 route.
- [JsonPropertyName("apiVersion")]
- public string? ApiVersion { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// A named BYOK provider connection (transport + credentials).
+/// Capability negotiation snapshot.
[Experimental(Diagnostics.Experimental)]
-public sealed class NamedProviderConfig
+public sealed class McpAppsDiagnoseCapability
{
- /// API key. Optional for local providers like Ollama.
- [JsonPropertyName("apiKey")]
- public string? ApiKey { get; set; }
+ /// Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers.
+ [JsonPropertyName("advertised")]
+ public bool Advertised { get; set; }
- /// Azure-specific provider options.
- [JsonPropertyName("azure")]
- public ProviderConfigAzure? Azure { get; set; }
+ /// Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on.
+ [JsonPropertyName("featureFlagEnabled")]
+ public bool FeatureFlagEnabled { get; set; }
- /// API endpoint URL.
- [JsonPropertyName("baseUrl")]
- public string BaseUrl { get; set; } = string.Empty;
+ /// Whether the session has the `mcp-apps` capability.
+ [JsonPropertyName("sessionHasMcpApps")]
+ public bool SessionHasMcpApps { get; set; }
+}
- /// Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set.
- [JsonPropertyName("bearerToken")]
- public string? BearerToken { get; set; }
+/// What the server returned for this session.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpAppsDiagnoseServer
+{
+ /// Whether the named server is currently connected.
+ [JsonPropertyName("connected")]
+ public bool Connected { get; set; }
- /// When true, the SDK client supplies bearer tokens on demand: the runtime calls the client-session `providerToken.getToken` callback before each request and applies the returned token as an `Authorization: Bearer <token>` header. This is the bearer/OAuth scheme used by Azure AD / managed-identity tokens and provider OAuth access tokens (including Anthropic's), not a provider-specific API-key header such as Anthropic's `x-api-key`. The token-acquiring function itself stays on the SDK side and is never serialized; only this flag crosses the wire. When set alongside `apiKey`/`bearerToken`, the callback takes precedence: the runtime applies the token returned by `providerToken.getToken` as the `Authorization: Bearer` header for each request and does not send the static credential.
- [JsonPropertyName("hasBearerTokenProvider")]
- public bool? HasBearerTokenProvider { get; set; }
-
- /// Custom HTTP headers to include in all outbound requests to the provider.
- [JsonPropertyName("headers")]
- public IDictionary? Headers { get; set; }
+ /// Up to 5 tool names with `_meta.ui` for quick inspection.
+ [JsonPropertyName("sampleToolNames")]
+ public IList SampleToolNames { get => field ??= []; set; }
- /// Stable identifier referenced by BYOK model definitions. Must not contain '/'.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Total tools returned by the server's tools/list.
+ [JsonPropertyName("toolCount")]
+ public double ToolCount { get; set; }
- /// Provider transport. Defaults to "http".
- [JsonPropertyName("transport")]
- public ProviderConfigTransport? Transport { get; set; }
+ /// Tools whose `_meta.ui` is populated (resourceUri and/or visibility set).
+ [JsonPropertyName("toolsWithUiMeta")]
+ public double ToolsWithUiMeta { get; set; }
+}
- /// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs.
- [JsonPropertyName("type")]
- public ProviderConfigType? Type { get; set; }
+/// Diagnostic snapshot of MCP Apps wiring for the named server.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpAppsDiagnoseResult
+{
+ /// Capability negotiation snapshot.
+ [JsonPropertyName("capability")]
+ public McpAppsDiagnoseCapability Capability { get => field ??= new(); set; }
- /// Wire API format (openai/azure only). Defaults to "completions".
- [JsonPropertyName("wireApi")]
- public ProviderConfigWireApi? WireApi { get; set; }
+ /// What the server returned for this session.
+ [JsonPropertyName("server")]
+ public McpAppsDiagnoseServer Server { get => field ??= new(); set; }
}
-/// BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both.
+/// MCP server to diagnose MCP Apps wiring for.
[Experimental(Diagnostics.Experimental)]
-internal sealed class ProviderAddRequest
+internal sealed class McpAppsDiagnoseRequest
{
- /// BYOK model definitions to register. Each must reference a provider that is already registered or included in this same call. Selection ids (`provider/id`) must be unique across the registry.
- [JsonPropertyName("models")]
- public IList? Models { get; set; }
-
- /// Named BYOK provider connections to register, additive to any providers already in the registry. Each name must be unique across the registry and must not contain '/'.
- [JsonPropertyName("providers")]
- public IList? Providers { get; set; }
+ /// MCP server to probe.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the session options patch was applied successfully.
+/// MCP resource content with URI, optional MIME type, text or base64 blob, and resource metadata.
[Experimental(Diagnostics.Experimental)]
-public sealed class SessionUpdateOptionsResult
+public sealed class McpResourceContent
{
- /// Number of hooks loaded from installed plugins, returned when installedPlugins is updated.
- [JsonPropertyName("pluginHookCount")]
- public long? PluginHookCount { get; set; }
+ /// Resource-level metadata (CSP, permissions, etc.).
+ [JsonPropertyName("_meta")]
+ public IDictionary? Meta { get; set; }
- /// Whether the operation succeeded.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Base64-encoded binary content.
+ [JsonPropertyName("blob")]
+ public string? Blob { get; set; }
+
+ /// MIME type of the content.
+ [JsonPropertyName("mimeType")]
+ public string? MimeType { get; set; }
+
+ /// Text content (e.g. HTML).
+ [JsonPropertyName("text")]
+ public string? Text { get; set; }
+
+ /// The resource URI.
+ [JsonPropertyName("uri")]
+ public string Uri { get; set; } = string.Empty;
}
-/// Source descriptor for a `session.options.update` content-exclusion rule, with source name and type.
+/// Resource contents returned by the MCP server.
[Experimental(Diagnostics.Experimental)]
-public sealed class OptionsUpdateAdditionalContentExclusionPolicyRuleSource
+public sealed class McpResourcesReadResult
{
- /// Gets or sets the name value.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
-
- /// Gets or sets the type value.
- [JsonPropertyName("type")]
- public string Type { get; set; } = string.Empty;
+ /// Resource contents returned by the server.
+ [JsonPropertyName("contents")]
+ public IList Contents { get => field ??= []; set; }
}
-/// Single content-exclusion rule supplied to `session.options.update`, with paths, match conditions, and source.
+/// MCP server and resource URI to fetch.
[Experimental(Diagnostics.Experimental)]
-public sealed class OptionsUpdateAdditionalContentExclusionPolicyRule
+internal sealed class McpResourcesReadRequest
{
- /// Gets or sets the ifAnyMatch value.
- [JsonPropertyName("ifAnyMatch")]
- public IList? IfAnyMatch { get; set; }
-
- /// Gets or sets the ifNoneMatch value.
- [JsonPropertyName("ifNoneMatch")]
- public IList? IfNoneMatch { get; set; }
+ /// Name of the MCP server hosting the resource.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
- /// Gets or sets the paths value.
- [JsonPropertyName("paths")]
- public IList Paths { get => field ??= []; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
- /// Source descriptor for a `session.options.update` content-exclusion rule, with source name and type.
- [JsonPropertyName("source")]
- public OptionsUpdateAdditionalContentExclusionPolicyRuleSource Source { get => field ??= new(); set; }
+ /// Resource URI.
+ [JsonPropertyName("uri")]
+ public string Uri { get; set; } = string.Empty;
}
-/// Content-exclusion policy supplied to `session.options.update`, with rules, last-updated data, and scope.
+/// Standard MCP resource annotations plus preserved non-standard annotation fields.
[Experimental(Diagnostics.Experimental)]
-public sealed class OptionsUpdateAdditionalContentExclusionPolicy
+public sealed class McpResourceAnnotations
{
- /// Gets or sets the last_updated_at value.
- [JsonPropertyName("last_updated_at")]
- public JsonElement LastUpdatedAt { get; set; }
+ /// Server-provided non-standard annotation fields preserved from the MCP response.
+ [JsonPropertyName("additionalProperties")]
+ public IDictionary? AdditionalProperties { get; set; }
- /// Gets or sets the rules value.
- [JsonPropertyName("rules")]
- public IList Rules { get => field ??= []; set; }
+ /// Intended audience roles for this resource.
+ [JsonPropertyName("audience")]
+ public IList? Audience { get; set; }
- /// Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration.
- [JsonPropertyName("scope")]
- public OptionsUpdateAdditionalContentExclusionPolicyScope Scope { get; set; }
+ /// Last-modified timestamp hint.
+ [JsonPropertyName("lastModified")]
+ public string? LastModified { get; set; }
+
+ /// Priority hint for model/client use.
+ [JsonPropertyName("priority")]
+ public double? Priority { get; set; }
}
-/// Options scoped to the built-in CAPI (Copilot API) provider.
+/// A resource icon descriptor plus preserved non-standard icon fields.
[Experimental(Diagnostics.Experimental)]
-public sealed class CapiSessionOptions
+public sealed class McpResourceIcon
{
- /// Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable.
- [JsonPropertyName("enableWebSocketResponses")]
- public bool? EnableWebSocketResponses { get; set; }
+ /// Server-provided non-standard icon fields preserved from the MCP response.
+ [JsonPropertyName("additionalProperties")]
+ public IDictionary? AdditionalProperties { get; set; }
+
+ /// Icon MIME type, when known.
+ [JsonPropertyName("mimeType")]
+ public string? MimeType { get; set; }
+
+ /// Icon sizes hint.
+ [JsonPropertyName("sizes")]
+ public string? Sizes { get; set; }
+
+ /// Icon URI.
+ [JsonPropertyName("src")]
+ public string Src { get; set; } = string.Empty;
+
+ /// Theme hint for this icon.
+ [JsonPropertyName("theme")]
+ public string? Theme { get; set; }
}
-/// Installed plugin record for a session, with marketplace, version, install time, enabled state, cache path, and source.
+/// An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, MIME type, size, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`.
[Experimental(Diagnostics.Experimental)]
-public sealed class SessionInstalledPlugin
+public sealed class McpResource
{
- /// Path where the plugin is cached locally.
- [JsonPropertyName("cache_path")]
- public string? CachePath { get; set; }
+ /// Resource-level metadata.
+ [JsonPropertyName("_meta")]
+ public IDictionary? Meta { get; set; }
- /// Whether the plugin is currently enabled.
- [JsonPropertyName("enabled")]
- public bool Enabled { get; set; }
+ /// Server-provided non-standard descriptor fields preserved from the MCP response.
+ [JsonPropertyName("additionalProperties")]
+ public IDictionary? AdditionalProperties { get; set; }
- /// Installation timestamp (ISO-8601).
- [JsonPropertyName("installed_at")]
- public string InstalledAt { get; set; } = string.Empty;
+ /// Model/client annotations associated with this resource.
+ [JsonPropertyName("annotations")]
+ public McpResourceAnnotations? Annotations { get; set; }
- /// Marketplace the plugin came from (empty string for direct repo installs).
- [JsonPropertyName("marketplace")]
- public string Marketplace { get; set; } = string.Empty;
+ /// Optional description of what this resource represents.
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
- /// Plugin name.
+ /// Icons associated with this resource.
+ [JsonPropertyName("icons")]
+ public IList? Icons { get; set; }
+
+ /// MIME type of the resource, if known.
+ [JsonPropertyName("mimeType")]
+ public string? MimeType { get; set; }
+
+ /// The programmatic name of the resource.
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
- /// Source descriptor for direct repo installs (when marketplace is empty).
- [JsonPropertyName("source")]
- public JsonElement? Source { get; set; }
+ /// Resource size in bytes, when known.
+ [JsonPropertyName("size")]
+ public long? Size { get; set; }
- /// Installed version, if known.
- [JsonPropertyName("version")]
- public string? Version { get; set; }
+ /// Optional human-readable display title.
+ [JsonPropertyName("title")]
+ public string? Title { get; set; }
+
+ /// The resource URI (e.g. ui://... or file:///...).
+ [JsonPropertyName("uri")]
+ public string Uri { get; set; } = string.Empty;
}
-/// Custom model-provider configuration (BYOK).
+/// One page of resources advertised by the named MCP server.
[Experimental(Diagnostics.Experimental)]
-public sealed class ProviderConfig
+public sealed class McpResourcesListResult
{
- /// API key. Optional for local providers like Ollama.
- [JsonPropertyName("apiKey")]
- public string? ApiKey { get; set; }
-
- /// Azure-specific provider options.
- [JsonPropertyName("azure")]
- public ProviderConfigAzure? Azure { get; set; }
+ /// Opaque cursor for the next page, if the server has more resources.
+ [JsonPropertyName("nextCursor")]
+ public string? NextCursor { get; set; }
- /// API endpoint URL.
- [JsonPropertyName("baseUrl")]
- public string BaseUrl { get; set; } = string.Empty;
+ /// Resources advertised by the server (proxied MCP `resources/list`).
+ [JsonPropertyName("resources")]
+ public IList Resources { get => field ??= []; set; }
+}
- /// Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set.
- [JsonPropertyName("bearerToken")]
- public string? BearerToken { get; set; }
+/// MCP server whose resources to enumerate.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpResourcesListRequest
+{
+ /// Opaque MCP pagination cursor from a prior `nextCursor` value.
+ [JsonPropertyName("cursor")]
+ public string? Cursor { get; set; }
- /// When true, the SDK client supplies bearer tokens on demand: the runtime calls the client-session `providerToken.getToken` callback before each request and applies the returned token as an `Authorization: Bearer <token>` header. This is the bearer/OAuth scheme used by Azure AD / managed-identity tokens and provider OAuth access tokens (including Anthropic's), not a provider-specific API-key header such as Anthropic's `x-api-key`. The token-acquiring function itself stays on the SDK side and is never serialized; only this flag crosses the wire. When set alongside `apiKey`/`bearerToken`, the callback takes precedence: the runtime applies the token returned by `providerToken.getToken` as the `Authorization: Bearer` header for each request and does not send the static credential.
- [JsonPropertyName("hasBearerTokenProvider")]
- public bool? HasBearerTokenProvider { get; set; }
+ /// Name of the MCP server whose resources to enumerate.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
- /// Custom HTTP headers to include in all outbound requests to the provider.
- [JsonPropertyName("headers")]
- public IDictionary? Headers { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Maximum context window tokens for the model.
- [JsonPropertyName("maxContextWindowTokens")]
- public double? MaxContextWindowTokens { get; set; }
+/// An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, name, and optional title, description, MIME type, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpResourceTemplate
+{
+ /// Resource-template-level metadata.
+ [JsonPropertyName("_meta")]
+ public IDictionary? Meta { get; set; }
- /// Maximum output tokens for the model.
- [JsonPropertyName("maxOutputTokens")]
- public double? MaxOutputTokens { get; set; }
+ /// Server-provided non-standard descriptor fields preserved from the MCP response.
+ [JsonPropertyName("additionalProperties")]
+ public IDictionary? AdditionalProperties { get; set; }
- /// Maximum prompt/input tokens for the model.
- [JsonPropertyName("maxPromptTokens")]
- public double? MaxPromptTokens { get; set; }
+ /// Model/client annotations associated with this template.
+ [JsonPropertyName("annotations")]
+ public McpResourceAnnotations? Annotations { get; set; }
- /// Well-known model ID used for capability lookup. When set, agent behavior config and token limits are inferred from this model.
- [JsonPropertyName("modelId")]
- public string? ModelId { get; set; }
+ /// Optional description of what this template is for.
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
- /// Provider transport. Defaults to "http".
- [JsonPropertyName("transport")]
- public ProviderConfigTransport? Transport { get; set; }
+ /// Icons associated with resources matching this template.
+ [JsonPropertyName("icons")]
+ public IList? Icons { get; set; }
- /// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs.
- [JsonPropertyName("type")]
- public ProviderConfigType? Type { get; set; }
+ /// MIME type for resources matching this template, if uniform.
+ [JsonPropertyName("mimeType")]
+ public string? MimeType { get; set; }
- /// Wire API format (openai/azure only). Defaults to "completions".
- [JsonPropertyName("wireApi")]
- public ProviderConfigWireApi? WireApi { get; set; }
+ /// The programmatic name of the resource template.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// The model identifier sent to the provider API for inference (the "wire" model), as opposed to modelId which is the well-known base.
- [JsonPropertyName("wireModel")]
- public string? WireModel { get; set; }
+ /// Optional human-readable display title.
+ [JsonPropertyName("title")]
+ public string? Title { get; set; }
+
+ /// An RFC 6570 URI template for constructing resource URIs.
+ [JsonPropertyName("uriTemplate")]
+ public string UriTemplate { get; set; } = string.Empty;
}
-/// macOS seatbelt experimental options.
+/// One page of resource templates advertised by the named MCP server.
[Experimental(Diagnostics.Experimental)]
-public sealed class SandboxConfigUserPolicyExperimentalSeatbelt
+public sealed class McpResourcesListTemplatesResult
{
- /// Whether the macOS seatbelt profile may access the keychain.
- [JsonPropertyName("keychainAccess")]
- public bool? KeychainAccess { get; set; }
+ /// Opaque cursor for the next page, if the server has more resource templates.
+ [JsonPropertyName("nextCursor")]
+ public string? NextCursor { get; set; }
+
+ /// Resource templates advertised by the server (proxied MCP `resources/templates/list`).
+ [JsonPropertyName("resourceTemplates")]
+ public IList ResourceTemplates { get => field ??= []; set; }
}
-/// Platform-specific experimental policy fields.
+/// MCP server whose resource templates to enumerate.
[Experimental(Diagnostics.Experimental)]
-public sealed class SandboxConfigUserPolicyExperimental
+internal sealed class McpResourcesListTemplatesRequest
{
- /// macOS seatbelt experimental options.
- [JsonPropertyName("seatbelt")]
- public SandboxConfigUserPolicyExperimentalSeatbelt? Seatbelt { get; set; }
+ /// Opaque MCP pagination cursor from a prior `nextCursor` value.
+ [JsonPropertyName("cursor")]
+ public string? Cursor { get; set; }
+
+ /// Name of the MCP server whose resource templates to enumerate.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Filesystem rules to merge into the base policy.
+/// Session plugin metadata, with name, marketplace, optional version, and enabled state.
[Experimental(Diagnostics.Experimental)]
-public sealed class SandboxConfigUserPolicyFilesystem
+public sealed class Plugin
{
- /// Whether to clear the policy when the session exits.
- [JsonPropertyName("clearPolicyOnExit")]
- public bool? ClearPolicyOnExit { get; set; }
+ /// Whether the plugin is currently enabled.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
- /// Paths explicitly denied.
- [JsonPropertyName("deniedPaths")]
- public IList? DeniedPaths { get; set; }
+ /// Marketplace the plugin came from.
+ [JsonPropertyName("marketplace")]
+ public string Marketplace { get; set; } = string.Empty;
- /// Paths granted read-only access.
- [JsonPropertyName("readonlyPaths")]
- public IList? ReadonlyPaths { get; set; }
+ /// Plugin name.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// Paths granted read/write access.
- [JsonPropertyName("readwritePaths")]
- public IList? ReadwritePaths { get; set; }
+ /// Installed version.
+ [JsonPropertyName("version")]
+ public string? Version { get; set; }
}
-/// Network rules to merge into the base policy.
+/// Plugins installed for the session, with their enabled state and version metadata.
[Experimental(Diagnostics.Experimental)]
-public sealed class SandboxConfigUserPolicyNetwork
+public sealed class PluginList
{
- /// Whether traffic to local/loopback addresses is allowed.
- [JsonPropertyName("allowLocalNetwork")]
- public bool? AllowLocalNetwork { get; set; }
-
- /// Whether outbound network traffic is allowed at all.
- [JsonPropertyName("allowOutbound")]
- public bool? AllowOutbound { get; set; }
+ /// Installed plugins.
+ [JsonPropertyName("plugins")]
+ public IList Plugins { get => field ??= []; set; }
}
-/// macOS seatbelt-specific options.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public sealed class SandboxConfigUserPolicySeatbelt
+internal sealed class SessionPluginsListRequest
{
- /// Whether the macOS seatbelt profile may access the keychain.
- [JsonPropertyName("keychainAccess")]
- public bool? KeychainAccess { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// User-managed sandbox policy fragment merged into the auto-discovered base policy.
+/// RPC data type for SessionPluginsReload operations.
[Experimental(Diagnostics.Experimental)]
-public sealed class SandboxConfigUserPolicy
+public sealed class SessionPluginsReloadRequest
{
- /// Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is absent.
- [JsonPropertyName("experimental")]
- public SandboxConfigUserPolicyExperimental? Experimental { get; set; }
+ /// When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`.
+ [JsonPropertyName("deferRepoHooks")]
+ public bool? DeferRepoHooks { get; set; }
- /// Filesystem rules to merge into the base policy.
- [JsonPropertyName("filesystem")]
- public SandboxConfigUserPolicyFilesystem? Filesystem { get; set; }
+ /// Re-run custom-agent discovery after refreshing plugins. Defaults to true.
+ [JsonPropertyName("reloadCustomAgents")]
+ public bool? ReloadCustomAgents { get; set; }
- /// Network rules to merge into the base policy.
- [JsonPropertyName("network")]
- public SandboxConfigUserPolicyNetwork? Network { get; set; }
+ /// Re-discover and relaunch subprocess extensions (including plugin-shipped extensions) after refreshing plugins. Defaults to true. Has no effect when the session has no active extension controller (e.g. extensions were not requested for the session).
+ [JsonPropertyName("reloadExtensions")]
+ public bool? ReloadExtensions { get; set; }
- /// macOS seatbelt options to merge into the base policy.
- [JsonPropertyName("seatbelt")]
- public SandboxConfigUserPolicySeatbelt? Seatbelt { get; set; }
+ /// Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions).
+ [JsonPropertyName("reloadHooks")]
+ public bool? ReloadHooks { get; set; }
+
+ /// Reload MCP server connections after refreshing plugins. Defaults to true.
+ [JsonPropertyName("reloadMcp")]
+ public bool? ReloadMcp { get; set; }
}
-/// Resolved sandbox configuration.
+/// RPC data type for SessionPluginsReloadRequestWithSession operations.
[Experimental(Diagnostics.Experimental)]
-public sealed class SandboxConfig
+internal sealed class SessionPluginsReloadRequestWithSession
{
- /// Whether to auto-add the current working directory to readwritePaths. Default: true.
- [JsonPropertyName("addCurrentWorkingDirectory")]
- public bool? AddCurrentWorkingDirectory { get; set; }
+ /// When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`.
+ [JsonPropertyName("deferRepoHooks")]
+ public bool? DeferRepoHooks { get; set; }
- /// Whether sandboxing is enabled for the session.
- [JsonPropertyName("enabled")]
- public bool Enabled { get; set; }
+ /// Re-run custom-agent discovery after refreshing plugins. Defaults to true.
+ [JsonPropertyName("reloadCustomAgents")]
+ public bool? ReloadCustomAgents { get; set; }
- /// Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the OS keyring the sandbox blocks. Default: false (opt-in).
- [JsonPropertyName("ghAuth")]
- public bool? GhAuth { get; set; }
+ /// Re-discover and relaunch subprocess extensions (including plugin-shipped extensions) after refreshing plugins. Defaults to true. Has no effect when the session has no active extension controller (e.g. extensions were not requested for the session).
+ [JsonPropertyName("reloadExtensions")]
+ public bool? ReloadExtensions { get; set; }
- /// Whether to inject the Copilot GitHub token as an `http.<host>.extraheader` so authenticated HTTPS git works inside the sandbox without the shell-based credential helper the sandbox blocks. Default: false (opt-in).
- [JsonPropertyName("gitAuth")]
- public bool? GitAuth { get; set; }
+ /// Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions).
+ [JsonPropertyName("reloadHooks")]
+ public bool? ReloadHooks { get; set; }
- /// User-managed sandbox policy fragment merged into the auto-discovered base policy.
- [JsonPropertyName("userPolicy")]
- public SandboxConfigUserPolicy? UserPolicy { get; set; }
+ /// Reload MCP server connections after refreshing plugins. Defaults to true.
+ [JsonPropertyName("reloadMcp")]
+ public bool? ReloadMcp { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Patch of mutable session options to apply to the running session.
+/// Short-lived, rotating credential the caller must send on every request, in addition to `apiKey` if one is present. Omitted when the endpoint does not require one.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionUpdateOptionsParams
+public sealed class ProviderSessionToken
{
- /// Additional content-exclusion policies to merge into the session's policy set.
- [Experimental(Diagnostics.Experimental)]
- [JsonPropertyName("additionalContentExclusionPolicies")]
- public IList? AdditionalContentExclusionPolicies { get; set; }
+ /// When the token expires, if known. Callers should refresh by calling `getEndpoint` again before this time, or reactively on any 401/403 response from `baseUrl`.
+ [JsonPropertyName("expiresAt")]
+ public DateTimeOffset? ExpiresAt { get; set; }
- /// Runtime context discriminator (e.g., `cli`, `actions`).
- [JsonPropertyName("agentContext")]
- public string? AgentContext { get; set; }
+ /// HTTP header name the token must be sent under.
+ [JsonPropertyName("header")]
+ public string Header { get; set; } = string.Empty;
- /// Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers.
- [JsonPropertyName("allowAllMcpServerInstructions")]
- public bool? AllowAllMcpServerInstructions { get; set; }
+ /// The model the token is bound to, when applicable. When set, the token is only valid for requests against this model.
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
- /// Whether to disable the `ask_user` tool (encourages autonomous behavior).
- [JsonPropertyName("askUserDisabled")]
- public bool? AskUserDisabled { get; set; }
-
- /// Allowlist of tool names available to this session.
- [JsonPropertyName("availableTools")]
- public IList? AvailableTools { get; set; }
-
- /// Options scoped to the built-in CAPI (Copilot API) provider.
- [JsonPropertyName("capi")]
- public CapiSessionOptions? Capi { get; set; }
+ /// The short-lived token value.
+ [JsonPropertyName("token")]
+ public string Token { get; set; } = string.Empty;
+}
- /// Identifier of the client driving the session.
- [JsonPropertyName("clientName")]
- public string? ClientName { get; set; }
+/// A snapshot of the provider endpoint the session is currently configured to talk to.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ProviderEndpoint
+{
+ /// A credential the caller should use with this endpoint. Omitted only when the endpoint accepts unauthenticated requests.
+ [JsonPropertyName("apiKey")]
+ public string? ApiKey { get; set; }
- /// Whether to include the `Co-authored-by` trailer in commit messages.
- [JsonPropertyName("coauthorEnabled")]
- public bool? CoauthorEnabled { get; set; }
+ /// Base URL to pass to the LLM client library.
+ [Url]
+ [StringSyntax(StringSyntaxAttribute.Uri)]
+ [JsonPropertyName("baseUrl")]
+ public string BaseUrl { get; set; } = string.Empty;
- /// Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier.
- [JsonPropertyName("contextTier")]
- public OptionsUpdateContextTier? ContextTier { get; set; }
+ /// HTTP headers the caller must include on every outbound request.
+ [JsonPropertyName("headers")]
+ public IDictionary Headers { get => field ??= new Dictionary(); set; }
- /// Whether to allow auto-mode continuation across turns.
- [JsonPropertyName("continueOnAutoMode")]
- public bool? ContinueOnAutoMode { get; set; }
+ /// Short-lived, rotating credential the caller must send on every request, in addition to `apiKey` if one is present. Omitted when the endpoint does not require one.
+ [JsonPropertyName("sessionToken")]
+ public ProviderSessionToken? SessionToken { get; set; }
- /// Override URL for the Copilot API endpoint.
- [JsonPropertyName("copilotUrl")]
- public string? CopilotUrl { get; set; }
+ /// Transport to be used for provider requests.
+ [JsonPropertyName("transport")]
+ public ProviderEndpointTransport? Transport { get; set; }
- /// Whether to default custom agents to local-only execution.
- [JsonPropertyName("customAgentsLocalOnly")]
- public bool? CustomAgentsLocalOnly { get; set; }
+ /// Provider family. Matches the `type` field of a BYOK provider config.
+ [JsonPropertyName("type")]
+ public ProviderEndpointType Type { get; set; }
- /// Instruction source IDs to exclude from the system prompt.
- [JsonPropertyName("disabledInstructionSources")]
- public IList? DisabledInstructionSources { get; set; }
+ /// Wire API to be used, when required for the provider type.
+ [JsonPropertyName("wireApi")]
+ public ProviderEndpointWireApi? WireApi { get; set; }
+}
- /// Skill IDs that should be excluded from this session.
- [JsonPropertyName("disabledSkills")]
- public IList? DisabledSkills { get; set; }
+/// RPC data type for SessionProviderGetEndpoint operations.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionProviderGetEndpointRequest
+{
+ /// Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using.
+ [JsonPropertyName("modelId")]
+ public string? ModelId { get; set; }
+}
- /// Whether to enable loading of `.github/hooks/` filesystem hooks. Separate from the SDK callback hook mechanism.
- [JsonPropertyName("enableFileHooks")]
- public bool? EnableFileHooks { get; set; }
+/// RPC data type for SessionProviderGetEndpointRequestWithSession operations.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionProviderGetEndpointRequestWithSession
+{
+ /// Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using.
+ [JsonPropertyName("modelId")]
+ public string? ModelId { get; set; }
- /// Whether to enable host git operations (context resolution, child repo scanning, git info in system prompt).
- [JsonPropertyName("enableHostGitOperations")]
- public bool? EnableHostGitOperations { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// 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.
- [JsonPropertyName("enableOnDemandInstructionDiscovery")]
- public bool? EnableOnDemandInstructionDiscovery { get; set; }
+/// The selectable model entries synthesized for the models added by this call.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ProviderAddResult
+{
+ /// Synthesized selectable model entries for the newly added BYOK models, each under its provider-qualified selection id (`provider/id`). Empty when only providers were added.
+ [JsonPropertyName("models")]
+ public IList Models { get => field ??= []; set; }
+}
- /// Whether to surface reasoning-summary events from the model.
- [JsonPropertyName("enableReasoningSummaries")]
- public bool? EnableReasoningSummaries { get; set; }
+/// A BYOK model definition referencing a named provider.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ProviderModelConfig
+{
+ /// Optional capability overrides (vision, tool_calls, reasoning, etc.).
+ [JsonPropertyName("capabilities")]
+ public ModelCapabilitiesOverride? Capabilities { get; set; }
- /// Whether shell-script safety heuristics are enabled.
- [JsonPropertyName("enableScriptSafety")]
- public bool? EnableScriptSafety { get; set; }
+ /// Provider-local model id, unique within its provider. The session-wide selection id (shown in the model list and passed to switchTo) is the provider-qualified `provider/id`.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
- /// Whether to enable cross-session store writes and reads.
- [JsonPropertyName("enableSessionStore")]
- public bool? EnableSessionStore { get; set; }
+ /// Maximum context window tokens for the model.
+ [JsonPropertyName("maxContextWindowTokens")]
+ public double? MaxContextWindowTokens { get; set; }
- /// Whether to enable skill directory scanning and loading. Falls back to enableConfigDiscovery when unset.
- [JsonPropertyName("enableSkills")]
- public bool? EnableSkills { get; set; }
+ /// Maximum output tokens for the model.
+ [JsonPropertyName("maxOutputTokens")]
+ public double? MaxOutputTokens { get; set; }
- /// Whether to stream model responses.
- [JsonPropertyName("enableStreaming")]
- public bool? EnableStreaming { get; set; }
+ /// Maximum prompt/input tokens for the model.
+ [JsonPropertyName("maxPromptTokens")]
+ public double? MaxPromptTokens { get; set; }
- /// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch).
- [JsonPropertyName("envValueMode")]
- public OptionsUpdateEnvValueMode? EnvValueMode { get; set; }
+ /// Well-known base model id used for behavior/capability/config lookup. Defaults to `id`.
+ [JsonPropertyName("modelId")]
+ public string? ModelId { get; set; }
- /// Override directory for the session-events log. When unset, the runtime's default events log directory is used.
- [JsonPropertyName("eventsLogDirectory")]
- public string? EventsLogDirectory { get; set; }
+ /// Display name for model pickers. Defaults to the provider-qualified selection id (`provider/id`).
+ [JsonPropertyName("name")]
+ public string? Name { 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; }
+ /// Name of the NamedProviderConfig that serves this model.
+ [JsonPropertyName("provider")]
+ public string Provider { get; set; } = string.Empty;
- /// Denylist of tool names for this session.
- [JsonPropertyName("excludedTools")]
- public IList? ExcludedTools { get; set; }
+ /// The model name sent to the provider API for inference. Defaults to `id`.
+ [JsonPropertyName("wireModel")]
+ public string? WireModel { get; set; }
+}
- /// Map of feature-flag IDs to their boolean enabled state.
- [JsonPropertyName("featureFlags")]
- public IDictionary? FeatureFlags { get; set; }
+/// Azure-specific provider options.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ProviderConfigAzure
+{
+ /// API version. When set, uses the versioned deployment route. When omitted, uses the GA versionless v1 route.
+ [JsonPropertyName("apiVersion")]
+ public string? ApiVersion { get; set; }
+}
- /// Built-in subagent names to include in this session. When specified, only these built-ins are available, subject to runtime availability and exclusions. Custom agents with the same name remain available. Set to null to remove the allowlist restriction.
- [JsonPropertyName("includedBuiltinAgents")]
- public IList? IncludedBuiltinAgents { get; set; }
+/// A named BYOK provider connection (transport + credentials).
+[Experimental(Diagnostics.Experimental)]
+public sealed class NamedProviderConfig
+{
+ /// API key. Optional for local providers like Ollama.
+ [JsonPropertyName("apiKey")]
+ public string? ApiKey { get; set; }
- /// Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes.
- [JsonPropertyName("installedPlugins")]
- public IList? InstalledPlugins { get; set; }
+ /// Azure-specific provider options.
+ [JsonPropertyName("azure")]
+ public ProviderConfigAzure? Azure { get; set; }
- /// Stable integration identifier used for analytics and rate-limit attribution.
- [JsonPropertyName("integrationId")]
- public string? IntegrationId { get; set; }
+ /// API endpoint URL.
+ [JsonPropertyName("baseUrl")]
+ public string BaseUrl { get; set; } = string.Empty;
- /// Whether experimental capabilities are enabled.
- [JsonPropertyName("isExperimentalMode")]
- public bool? IsExperimentalMode { get; set; }
+ /// Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set.
+ [JsonPropertyName("bearerToken")]
+ public string? BearerToken { get; set; }
- /// Whether interactive shell sessions are logged.
- [JsonPropertyName("logInteractiveShells")]
- public bool? LogInteractiveShells { get; set; }
+ /// When true, the SDK client supplies bearer tokens on demand: the runtime calls the client-session `providerToken.getToken` callback before each request and applies the returned token as an `Authorization: Bearer <token>` header. This is the bearer/OAuth scheme used by Azure AD / managed-identity tokens and provider OAuth access tokens (including Anthropic's), not a provider-specific API-key header such as Anthropic's `x-api-key`. The token-acquiring function itself stays on the SDK side and is never serialized; only this flag crosses the wire. When set alongside `apiKey`/`bearerToken`, the callback takes precedence: the runtime applies the token returned by `providerToken.getToken` as the `Authorization: Bearer` header for each request and does not send the static credential.
+ [JsonPropertyName("hasBearerTokenProvider")]
+ public bool? HasBearerTokenProvider { get; set; }
- /// Identifier sent to LSP-style integrations.
- [JsonPropertyName("lspClientName")]
- public string? LspClientName { get; set; }
+ /// Custom HTTP headers to include in all outbound requests to the provider.
+ [JsonPropertyName("headers")]
+ public IDictionary? Headers { get; 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).
- [JsonPropertyName("manageScheduleEnabled")]
- public bool? ManageScheduleEnabled { get; set; }
+ /// Stable identifier referenced by BYOK model definitions. Must not contain '/'.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// 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.
- [JsonPropertyName("maxInlineBinaryBytes")]
- public long? MaxInlineBinaryBytes { get; set; }
+ /// Provider transport. Defaults to "http".
+ [JsonPropertyName("transport")]
+ public ProviderConfigTransport? Transport { get; set; }
- /// The model ID to use for assistant turns.
- [JsonPropertyName("model")]
- public string? Model { get; set; }
+ /// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs.
+ [JsonPropertyName("type")]
+ public ProviderConfigType? Type { get; set; }
- /// Per-property model capability overrides for the selected model.
- [JsonPropertyName("modelCapabilitiesOverrides")]
- public ModelCapabilitiesOverride? ModelCapabilitiesOverrides { get; set; }
+ /// Wire API format (openai/azure only). Defaults to "completions".
+ [JsonPropertyName("wireApi")]
+ public ProviderConfigWireApi? WireApi { get; set; }
+}
- /// Organization-level custom instructions to inject into the system prompt.
- [JsonPropertyName("organizationCustomInstructions")]
- public string? OrganizationCustomInstructions { get; set; }
+/// BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ProviderAddRequest
+{
+ /// BYOK model definitions to register. Each must reference a provider that is already registered or included in this same call. Selection ids (`provider/id`) must be unique across the registry.
+ [JsonPropertyName("models")]
+ public IList? Models { get; set; }
- /// Custom model-provider configuration (BYOK).
- [JsonPropertyName("provider")]
- public ProviderConfig? Provider { get; set; }
+ /// Named BYOK provider connections to register, additive to any providers already in the registry. Each name must be unique across the registry and must not contain '/'.
+ [JsonPropertyName("providers")]
+ public IList? Providers { get; set; }
- /// Reasoning effort for the selected model (model-defined enum).
- [JsonPropertyName("reasoningEffort")]
- public string? ReasoningEffort { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Reasoning summary mode for supported model clients.
+/// Indicates whether the session options patch was applied successfully.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionUpdateOptionsResult
+{
+ /// Number of hooks loaded from installed plugins, returned when installedPlugins is updated.
+ [JsonPropertyName("pluginHookCount")]
+ public long? PluginHookCount { get; set; }
+
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
+
+/// Source descriptor for a `session.options.update` content-exclusion rule, with source name and type.
+[Experimental(Diagnostics.Experimental)]
+public sealed class OptionsUpdateAdditionalContentExclusionPolicyRuleSource
+{
+ /// Gets or sets the name value.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Gets or sets the type value.
+ [JsonPropertyName("type")]
+ public string Type { get; set; } = string.Empty;
+}
+
+/// Single content-exclusion rule supplied to `session.options.update`, with paths, match conditions, and source.
+[Experimental(Diagnostics.Experimental)]
+public sealed class OptionsUpdateAdditionalContentExclusionPolicyRule
+{
+ /// Gets or sets the ifAnyMatch value.
+ [JsonPropertyName("ifAnyMatch")]
+ public IList? IfAnyMatch { get; set; }
+
+ /// Gets or sets the ifNoneMatch value.
+ [JsonPropertyName("ifNoneMatch")]
+ public IList? IfNoneMatch { get; set; }
+
+ /// Gets or sets the paths value.
+ [JsonPropertyName("paths")]
+ public IList Paths { get => field ??= []; set; }
+
+ /// Source descriptor for a `session.options.update` content-exclusion rule, with source name and type.
+ [JsonPropertyName("source")]
+ public OptionsUpdateAdditionalContentExclusionPolicyRuleSource Source { get => field ??= new(); set; }
+}
+
+/// Content-exclusion policy supplied to `session.options.update`, with rules, last-updated data, and scope.
+[Experimental(Diagnostics.Experimental)]
+public sealed class OptionsUpdateAdditionalContentExclusionPolicy
+{
+ /// Gets or sets the last_updated_at value.
+ [JsonPropertyName("last_updated_at")]
+ public JsonElement LastUpdatedAt { get; set; }
+
+ /// Gets or sets the rules value.
+ [JsonPropertyName("rules")]
+ public IList Rules { get => field ??= []; set; }
+
+ /// Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration.
+ [JsonPropertyName("scope")]
+ public OptionsUpdateAdditionalContentExclusionPolicyScope Scope { get; set; }
+}
+
+/// Options scoped to the built-in CAPI (Copilot API) provider.
+[Experimental(Diagnostics.Experimental)]
+public sealed class CapiSessionOptions
+{
+ /// Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable.
+ [JsonPropertyName("enableWebSocketResponses")]
+ public bool? EnableWebSocketResponses { get; set; }
+}
+
+/// Installed plugin record for a session, with marketplace, version, install time, enabled state, cache path, and source.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionInstalledPlugin
+{
+ /// Path where the plugin is cached locally.
+ [JsonPropertyName("cache_path")]
+ public string? CachePath { get; set; }
+
+ /// Whether the plugin is currently enabled.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
+
+ /// Installation timestamp (ISO-8601).
+ [JsonPropertyName("installed_at")]
+ public string InstalledAt { get; set; } = string.Empty;
+
+ /// Marketplace the plugin came from (empty string for direct repo installs).
+ [JsonPropertyName("marketplace")]
+ public string Marketplace { get; set; } = string.Empty;
+
+ /// Plugin name.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Source descriptor for direct repo installs (when marketplace is empty).
+ [JsonPropertyName("source")]
+ public JsonElement? Source { get; set; }
+
+ /// Installed version, if known.
+ [JsonPropertyName("version")]
+ public string? Version { get; set; }
+}
+
+/// Custom model-provider configuration (BYOK).
+[Experimental(Diagnostics.Experimental)]
+public sealed class ProviderConfig
+{
+ /// API key. Optional for local providers like Ollama.
+ [JsonPropertyName("apiKey")]
+ public string? ApiKey { get; set; }
+
+ /// Azure-specific provider options.
+ [JsonPropertyName("azure")]
+ public ProviderConfigAzure? Azure { get; set; }
+
+ /// API endpoint URL.
+ [JsonPropertyName("baseUrl")]
+ public string BaseUrl { get; set; } = string.Empty;
+
+ /// Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set.
+ [JsonPropertyName("bearerToken")]
+ public string? BearerToken { get; set; }
+
+ /// When true, the SDK client supplies bearer tokens on demand: the runtime calls the client-session `providerToken.getToken` callback before each request and applies the returned token as an `Authorization: Bearer <token>` header. This is the bearer/OAuth scheme used by Azure AD / managed-identity tokens and provider OAuth access tokens (including Anthropic's), not a provider-specific API-key header such as Anthropic's `x-api-key`. The token-acquiring function itself stays on the SDK side and is never serialized; only this flag crosses the wire. When set alongside `apiKey`/`bearerToken`, the callback takes precedence: the runtime applies the token returned by `providerToken.getToken` as the `Authorization: Bearer` header for each request and does not send the static credential.
+ [JsonPropertyName("hasBearerTokenProvider")]
+ public bool? HasBearerTokenProvider { get; set; }
+
+ /// Custom HTTP headers to include in all outbound requests to the provider.
+ [JsonPropertyName("headers")]
+ public IDictionary? Headers { get; set; }
+
+ /// Maximum context window tokens for the model.
+ [JsonPropertyName("maxContextWindowTokens")]
+ public double? MaxContextWindowTokens { get; set; }
+
+ /// Maximum output tokens for the model.
+ [JsonPropertyName("maxOutputTokens")]
+ public double? MaxOutputTokens { get; set; }
+
+ /// Maximum prompt/input tokens for the model.
+ [JsonPropertyName("maxPromptTokens")]
+ public double? MaxPromptTokens { get; set; }
+
+ /// Well-known model ID used for capability lookup. When set, agent behavior config and token limits are inferred from this model.
+ [JsonPropertyName("modelId")]
+ public string? ModelId { get; set; }
+
+ /// Provider transport. Defaults to "http".
+ [JsonPropertyName("transport")]
+ public ProviderConfigTransport? Transport { get; set; }
+
+ /// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs.
+ [JsonPropertyName("type")]
+ public ProviderConfigType? Type { get; set; }
+
+ /// Wire API format (openai/azure only). Defaults to "completions".
+ [JsonPropertyName("wireApi")]
+ public ProviderConfigWireApi? WireApi { get; set; }
+
+ /// The model identifier sent to the provider API for inference (the "wire" model), as opposed to modelId which is the well-known base.
+ [JsonPropertyName("wireModel")]
+ public string? WireModel { get; set; }
+}
+
+/// macOS seatbelt experimental options.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SandboxConfigUserPolicyExperimentalSeatbelt
+{
+ /// Whether the macOS seatbelt profile may access the keychain.
+ [JsonPropertyName("keychainAccess")]
+ public bool? KeychainAccess { get; set; }
+}
+
+/// Platform-specific experimental policy fields.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SandboxConfigUserPolicyExperimental
+{
+ /// macOS seatbelt experimental options.
+ [JsonPropertyName("seatbelt")]
+ public SandboxConfigUserPolicyExperimentalSeatbelt? Seatbelt { get; set; }
+}
+
+/// Filesystem rules to merge into the base policy.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SandboxConfigUserPolicyFilesystem
+{
+ /// Whether to clear the policy when the session exits.
+ [JsonPropertyName("clearPolicyOnExit")]
+ public bool? ClearPolicyOnExit { get; set; }
+
+ /// Paths explicitly denied.
+ [JsonPropertyName("deniedPaths")]
+ public IList? DeniedPaths { get; set; }
+
+ /// Paths granted read-only access.
+ [JsonPropertyName("readonlyPaths")]
+ public IList? ReadonlyPaths { get; set; }
+
+ /// Paths granted read/write access.
+ [JsonPropertyName("readwritePaths")]
+ public IList? ReadwritePaths { get; set; }
+}
+
+/// HTTP proxy configuration for sandboxed traffic.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SandboxConfigUserPolicyNetworkProxy
+{
+ /// Optional password for proxy authentication, combined with the URL at spawn time. The persisted value may be a literal password, a `${secret:…}` reference resolved from the OS keychain, or a `${VAR}`/`$VAR` environment reference; it is resolved just before the sandboxed process routes through the proxy. The /sandbox dialog stores a real password in the OS keychain and persists only a `${secret:…}` placeholder (never plaintext in settings.json); the field is masked in the dialog and redacted by /settings show.
+ [JsonPropertyName("password")]
+ public string? Password { get; set; }
+
+ /// Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is.
+ [JsonPropertyName("url")]
+ public string Url { get; set; } = string.Empty;
+
+ /// Optional username for proxy authentication. Combined with the URL (and `password`) into `user:pass@host` when the sandboxed process routes through the proxy.
+ [JsonPropertyName("username")]
+ public string? Username { get; set; }
+}
+
+/// Network rules to merge into the base policy.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SandboxConfigUserPolicyNetwork
+{
+ /// Whether traffic to local/loopback addresses is allowed.
+ [JsonPropertyName("allowLocalNetwork")]
+ public bool? AllowLocalNetwork { get; set; }
+
+ /// Whether outbound network traffic is allowed at all.
+ [JsonPropertyName("allowOutbound")]
+ public bool? AllowOutbound { get; set; }
+
+ /// HTTP proxy the sandboxed process routes traffic through. Enforced on Windows and cooperative (honored by well-behaved tools, not strictly enforced) on Linux and macOS. Credentials go in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; an https:// or authenticated loopback URL is used as-is.
+ [JsonPropertyName("proxy")]
+ public SandboxConfigUserPolicyNetworkProxy? Proxy { get; set; }
+}
+
+/// macOS seatbelt-specific options.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SandboxConfigUserPolicySeatbelt
+{
+ /// Whether the macOS seatbelt profile may access the keychain.
+ [JsonPropertyName("keychainAccess")]
+ public bool? KeychainAccess { get; set; }
+}
+
+/// User-managed sandbox policy fragment merged into the auto-discovered base policy.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SandboxConfigUserPolicy
+{
+ /// Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is absent.
+ [JsonPropertyName("experimental")]
+ public SandboxConfigUserPolicyExperimental? Experimental { get; set; }
+
+ /// Filesystem rules to merge into the base policy.
+ [JsonPropertyName("filesystem")]
+ public SandboxConfigUserPolicyFilesystem? Filesystem { get; set; }
+
+ /// Network rules to merge into the base policy.
+ [JsonPropertyName("network")]
+ public SandboxConfigUserPolicyNetwork? Network { get; set; }
+
+ /// macOS seatbelt options to merge into the base policy.
+ [JsonPropertyName("seatbelt")]
+ public SandboxConfigUserPolicySeatbelt? Seatbelt { get; set; }
+}
+
+/// Resolved sandbox configuration.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SandboxConfig
+{
+ /// Whether to auto-add the current working directory to readwritePaths. Default: true.
+ [JsonPropertyName("addCurrentWorkingDirectory")]
+ public bool? AddCurrentWorkingDirectory { get; set; }
+
+ /// Whether sandboxing is enabled for the session.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
+
+ /// Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the OS keyring the sandbox blocks. Default: false (opt-in).
+ [JsonPropertyName("ghAuth")]
+ public bool? GhAuth { get; set; }
+
+ /// Whether to inject the Copilot GitHub token as an `http.<host>.extraheader` so authenticated HTTPS git works inside the sandbox without the shell-based credential helper the sandbox blocks. Default: false (opt-in).
+ [JsonPropertyName("gitAuth")]
+ public bool? GitAuth { get; set; }
+
+ /// User-managed sandbox policy fragment merged into the auto-discovered base policy.
+ [JsonPropertyName("userPolicy")]
+ 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
+{
+ /// Additional content-exclusion policies to merge into the session's policy set.
+ [Experimental(Diagnostics.Experimental)]
+ [JsonPropertyName("additionalContentExclusionPolicies")]
+ public IList? AdditionalContentExclusionPolicies { get; set; }
+
+ /// Runtime context discriminator (e.g., `cli`, `actions`).
+ [JsonPropertyName("agentContext")]
+ public string? AgentContext { get; set; }
+
+ /// Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers.
+ [JsonPropertyName("allowAllMcpServerInstructions")]
+ public bool? AllowAllMcpServerInstructions { get; set; }
+
+ /// Whether to disable the `ask_user` tool (encourages autonomous behavior).
+ [JsonPropertyName("askUserDisabled")]
+ public bool? AskUserDisabled { get; set; }
+
+ /// Allowlist of tool names available to this session.
+ [JsonPropertyName("availableTools")]
+ public IList? AvailableTools { get; set; }
+
+ /// Options scoped to the built-in CAPI (Copilot API) provider.
+ [JsonPropertyName("capi")]
+ public CapiSessionOptions? Capi { get; set; }
+
+ /// Identifier of the client driving the session.
+ [JsonPropertyName("clientName")]
+ public string? ClientName { get; set; }
+
+ /// Whether to include the `Co-authored-by` trailer in commit messages.
+ [JsonPropertyName("coauthorEnabled")]
+ public bool? CoauthorEnabled { get; set; }
+
+ /// Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier.
+ [JsonPropertyName("contextTier")]
+ public OptionsUpdateContextTier? ContextTier { get; set; }
+
+ /// Whether to allow auto-mode continuation across turns.
+ [JsonPropertyName("continueOnAutoMode")]
+ public bool? ContinueOnAutoMode { get; set; }
+
+ /// Override URL for the Copilot API endpoint.
+ [JsonPropertyName("copilotUrl")]
+ public string? CopilotUrl { get; set; }
+
+ /// Whether to default custom agents to local-only execution.
+ [JsonPropertyName("customAgentsLocalOnly")]
+ public bool? CustomAgentsLocalOnly { get; set; }
+
+ /// Instruction source IDs to exclude from the system prompt.
+ [JsonPropertyName("disabledInstructionSources")]
+ public IList? DisabledInstructionSources { get; set; }
+
+ /// Skill IDs that should be excluded from this session.
+ [JsonPropertyName("disabledSkills")]
+ public IList? DisabledSkills { get; set; }
+
+ /// Whether to enable loading of `.github/hooks/` filesystem hooks. Separate from the SDK callback hook mechanism.
+ [JsonPropertyName("enableFileHooks")]
+ public bool? EnableFileHooks { get; set; }
+
+ /// Whether to enable host git operations (context resolution, child repo scanning, git info in system prompt).
+ [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`.
+ [JsonPropertyName("enableOnDemandInstructionDiscovery")]
+ public bool? EnableOnDemandInstructionDiscovery { get; set; }
+
+ /// Whether to surface reasoning-summary events from the model.
+ [JsonPropertyName("enableReasoningSummaries")]
+ public bool? EnableReasoningSummaries { get; set; }
+
+ /// Whether shell-script safety heuristics are enabled.
+ [JsonPropertyName("enableScriptSafety")]
+ public bool? EnableScriptSafety { get; set; }
+
+ /// Whether to enable cross-session store writes and reads.
+ [JsonPropertyName("enableSessionStore")]
+ public bool? EnableSessionStore { get; set; }
+
+ /// Whether to enable skill directory scanning and loading. Falls back to enableConfigDiscovery when unset.
+ [JsonPropertyName("enableSkills")]
+ public bool? EnableSkills { get; set; }
+
+ /// Whether to stream model responses.
+ [JsonPropertyName("enableStreaming")]
+ public bool? EnableStreaming { get; set; }
+
+ /// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch).
+ [JsonPropertyName("envValueMode")]
+ public OptionsUpdateEnvValueMode? EnvValueMode { get; set; }
+
+ /// Override directory for the session-events log. When unset, the runtime's default events log directory is used.
+ [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; }
+
+ /// Denylist of tool names for this session.
+ [JsonPropertyName("excludedTools")]
+ public IList? ExcludedTools { get; set; }
+
+ /// Map of feature-flag IDs to their boolean enabled state.
+ [JsonPropertyName("featureFlags")]
+ public IDictionary? FeatureFlags { get; set; }
+
+ /// Built-in subagent names to include in this session. When specified, only these built-ins are available, subject to runtime availability and exclusions. Custom agents with the same name remain available. Set to null to remove the allowlist restriction.
+ [JsonPropertyName("includedBuiltinAgents")]
+ public IList? IncludedBuiltinAgents { get; set; }
+
+ /// Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes.
+ [JsonPropertyName("installedPlugins")]
+ public IList? InstalledPlugins { get; set; }
+
+ /// Stable integration identifier used for analytics and rate-limit attribution.
+ [JsonPropertyName("integrationId")]
+ public string? IntegrationId { get; set; }
+
+ /// Whether experimental capabilities are enabled.
+ [JsonPropertyName("isExperimentalMode")]
+ public bool? IsExperimentalMode { get; set; }
+
+ /// Whether interactive shell sessions are logged.
+ [JsonPropertyName("logInteractiveShells")]
+ public bool? LogInteractiveShells { get; set; }
+
+ /// Identifier sent to LSP-style integrations.
+ [JsonPropertyName("lspClientName")]
+ public string? LspClientName { get; 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).
+ [JsonPropertyName("manageScheduleEnabled")]
+ public bool? ManageScheduleEnabled { get; set; }
+
+ /// 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.
+ [JsonPropertyName("maxInlineBinaryBytes")]
+ public long? MaxInlineBinaryBytes { get; set; }
+
+ /// The model ID to use for assistant turns.
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
+
+ /// Per-property model capability overrides for the selected model.
+ [JsonPropertyName("modelCapabilitiesOverrides")]
+ public ModelCapabilitiesOverride? ModelCapabilitiesOverrides { get; set; }
+
+ /// Organization-level custom instructions to inject into the system prompt.
+ [JsonPropertyName("organizationCustomInstructions")]
+ public string? OrganizationCustomInstructions { get; set; }
+
+ /// Custom model-provider configuration (BYOK).
+ [JsonPropertyName("provider")]
+ public ProviderConfig? Provider { get; set; }
+
+ /// Reasoning effort for the selected model (model-defined enum).
+ [JsonPropertyName("reasoningEffort")]
+ public string? ReasoningEffort { get; set; }
+
+ /// Reasoning summary mode for supported model clients.
[JsonPropertyName("reasoningSummary")]
public OptionsUpdateReasoningSummary? ReasoningSummary { get; set; }
- /// Whether the session is running in an interactive UI.
- [JsonPropertyName("runningInInteractiveMode")]
- public bool? RunningInInteractiveMode { get; set; }
+ /// Whether the session is running in an interactive UI.
+ [JsonPropertyName("runningInInteractiveMode")]
+ public bool? RunningInInteractiveMode { get; set; }
+
+ /// Resolved sandbox configuration.
+ [JsonPropertyName("sandboxConfig")]
+ public SandboxConfig? SandboxConfig { get; set; }
+
+ /// 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.
+ [JsonPropertyName("sessionCapabilities")]
+ public IList? SessionCapabilities { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// Optional session limits. Pass null to clear the session limits.
+ [JsonPropertyName("sessionLimits")]
+ public SessionLimitsConfig? SessionLimits { get; set; }
+
+ /// 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; }
+
+ /// PowerShell process flags applied to built-in and user-requested shell commands.
+ [JsonPropertyName("shellProcessFlags")]
+ public IList? ShellProcessFlags { get; set; }
+
+ /// Additional directories to search for skills.
+ [JsonPropertyName("skillDirectories")]
+ public IList? SkillDirectories { get; set; }
+
+ /// Whether to skip loading custom instruction sources.
+ [JsonPropertyName("skipCustomInstructions")]
+ public bool? SkipCustomInstructions { get; set; }
+
+ /// Whether to skip embedding retrieval pipeline initialization and execution.
+ [JsonPropertyName("skipEmbeddingRetrieval")]
+ public bool? SkipEmbeddingRetrieval { get; set; }
+
+ /// When true, the selected custom agent's prompt is not injected into the user message (skill context is still injected). Used by automation triggers where the agent prompt is already in the problem statement.
+ [JsonPropertyName("suppressCustomAgentPrompt")]
+ public bool? SuppressCustomAgentPrompt { get; set; }
+
+ /// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set.
+ [JsonPropertyName("toolFilterPrecedence")]
+ public OptionsUpdateToolFilterPrecedence? ToolFilterPrecedence { get; set; }
+
+ /// Optional path for trajectory output.
+ [JsonPropertyName("trajectoryFile")]
+ public string? TrajectoryFile { get; set; }
+
+ /// Output verbosity level for supported models.
+ [JsonPropertyName("verbosity")]
+ public Verbosity? Verbosity { get; set; }
+
+ /// Absolute working-directory path for shell tools.
+ [JsonPropertyName("workingDirectory")]
+ public string? WorkingDirectory { get; set; }
+}
+
+/// Parameters for (re)loading the merged LSP configuration set.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class LspInitializeRequest
+{
+ /// Force re-initialization even when LSP configs were already loaded for the working directory.
+ [JsonPropertyName("force")]
+ public bool? Force { get; set; }
+
+ /// Git root used as the boundary when traversing for project-level LSP configs (supports monorepos).
+ [JsonPropertyName("gitRoot")]
+ public string? GitRoot { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// Working directory used to load project-level LSP configs. Defaults to the session working directory when omitted.
+ [JsonPropertyName("workingDirectory")]
+ public string? WorkingDirectory { get; set; }
+}
+
+/// Discovered extension metadata, including source-qualified ID, name, discovery source, status, and optional process ID.
+[Experimental(Diagnostics.Experimental)]
+public sealed class Extension
+{
+ /// Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper', 'plugin:my-plugin:my-ext').
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Extension name (directory name).
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Process ID if the extension is running.
+ [JsonPropertyName("pid")]
+ public long? Pid { get; set; }
+
+ /// Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin (installed plugin), or session (session-state/<id>/extensions/).
+ [JsonPropertyName("source")]
+ public ExtensionSource Source { get; set; }
+
+ /// Current status: running, disabled, failed, or starting.
+ [JsonPropertyName("status")]
+ public ExtensionStatus Status { get; set; }
+}
+
+/// Extensions discovered for the session, with their current status.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ExtensionList
+{
+ /// Discovered extensions and their current status.
+ [JsonPropertyName("extensions")]
+ public IList Extensions { get => field ??= []; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionExtensionsListRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Source-qualified extension identifier to enable for the session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ExtensionsEnableRequest
+{
+ /// Source-qualified extension ID to enable.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Source-qualified extension identifier to disable for the session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ExtensionsDisableRequest
+{
+ /// Source-qualified extension ID to disable.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionExtensionsReloadRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Attachment union accepted by push input, covering files, directories, GitHub objects, blobs, snippets, and extension context.
+/// Polymorphic base type discriminated by type.
+[Experimental(Diagnostics.Experimental)]
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "type",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(PushAttachmentFile), "file")]
+[JsonDerivedType(typeof(PushAttachmentDirectory), "directory")]
+[JsonDerivedType(typeof(PushAttachmentSelection), "selection")]
+[JsonDerivedType(typeof(PushAttachmentGitHubReference), "github_reference")]
+[JsonDerivedType(typeof(PushAttachmentGitHubCommit), "github_commit")]
+[JsonDerivedType(typeof(PushAttachmentGitHubRelease), "github_release")]
+[JsonDerivedType(typeof(PushAttachmentGitHubActionsJob), "github_actions_job")]
+[JsonDerivedType(typeof(PushAttachmentGitHubRepository), "github_repository")]
+[JsonDerivedType(typeof(PushAttachmentGitHubFileDiff), "github_file_diff")]
+[JsonDerivedType(typeof(PushAttachmentGitHubTreeComparison), "github_tree_comparison")]
+[JsonDerivedType(typeof(PushAttachmentGitHubUrl), "github_url")]
+[JsonDerivedType(typeof(PushAttachmentGitHubFile), "github_file")]
+[JsonDerivedType(typeof(PushAttachmentGitHubSnippet), "github_snippet")]
+[JsonDerivedType(typeof(PushAttachmentBlob), "blob")]
+[JsonDerivedType(typeof(PushAttachmentExtensionContext), "extension_context")]
+public partial class PushAttachment
+{
+ /// The type discriminator.
+ [JsonPropertyName("type")]
+ public virtual string Type { get; set; } = string.Empty;
+}
+
+
+/// Optional line range to scope the attachment to a specific section of the file.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PushAttachmentFileLineRange
+{
+ /// End line number (1-based, inclusive).
+ [JsonPropertyName("end")]
+ public long End { get; set; }
+
+ /// Start line number (1-based).
+ [JsonPropertyName("start")]
+ public long Start { get; set; }
+}
+
+/// File attachment.
+/// The file variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentFile : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "file";
+
+ /// User-facing display name for the attachment.
+ [JsonPropertyName("displayName")]
+ public required string DisplayName { get; set; }
+
+ /// Optional line range to scope the attachment to a specific section of the file.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("lineRange")]
+ public PushAttachmentFileLineRange? LineRange { get; set; }
+
+ /// Absolute file path.
+ [JsonPropertyName("path")]
+ public required string Path { get; set; }
+}
+
+/// Directory attachment.
+/// The directory variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentDirectory : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "directory";
+
+ /// User-facing display name for the attachment.
+ [JsonPropertyName("displayName")]
+ public required string DisplayName { get; set; }
+
+ /// Absolute directory path.
+ [JsonPropertyName("path")]
+ public required string Path { get; set; }
+}
+
+/// End position of the selection.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PushAttachmentSelectionDetailsEnd
+{
+ /// End character offset within the line (0-based).
+ [JsonPropertyName("character")]
+ public long Character { get; set; }
+
+ /// End line number (0-based).
+ [JsonPropertyName("line")]
+ public long Line { get; set; }
+}
+
+/// Start position of the selection.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PushAttachmentSelectionDetailsStart
+{
+ /// Start character offset within the line (0-based).
+ [JsonPropertyName("character")]
+ public long Character { get; set; }
+
+ /// Start line number (0-based).
+ [JsonPropertyName("line")]
+ public long Line { get; set; }
+}
+
+/// Position range of the selection within the file.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PushAttachmentSelectionDetails
+{
+ /// End position of the selection.
+ [JsonPropertyName("end")]
+ public PushAttachmentSelectionDetailsEnd End { get => field ??= new(); set; }
+
+ /// Start position of the selection.
+ [JsonPropertyName("start")]
+ public PushAttachmentSelectionDetailsStart Start { get => field ??= new(); set; }
+}
+
+/// Code selection attachment from an editor.
+/// The selection variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentSelection : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "selection";
+
+ /// User-facing display name for the selection.
+ [JsonPropertyName("displayName")]
+ public required string DisplayName { get; set; }
+
+ /// Absolute path to the file containing the selection.
+ [JsonPropertyName("filePath")]
+ public required string FilePath { get; set; }
+
+ /// Position range of the selection within the file.
+ [JsonPropertyName("selection")]
+ public required PushAttachmentSelectionDetails Selection { get; set; }
+
+ /// The selected text content.
+ [JsonPropertyName("text")]
+ public required string Text { get; set; }
+}
+
+/// GitHub issue, pull request, or discussion reference.
+/// The github_reference variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentGitHubReference : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "github_reference";
+
+ /// Issue, pull request, or discussion number.
+ [JsonPropertyName("number")]
+ public required long Number { get; set; }
+
+ /// Type of GitHub reference.
+ [JsonPropertyName("referenceType")]
+ public required PushAttachmentGitHubReferenceType ReferenceType { get; set; }
+
+ /// Current state of the referenced item (e.g., open, closed, merged).
+ [JsonPropertyName("state")]
+ public required string State { get; set; }
+
+ /// Title of the referenced item.
+ [JsonPropertyName("title")]
+ public required string Title { get; set; }
+
+ /// URL to the referenced item on GitHub.
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
+}
+
+/// Pointer to a GitHub repository.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PushGitHubRepoRef
+{
+ /// Numeric GitHub repository id.
+ [JsonPropertyName("id")]
+ public long? Id { get; set; }
+
+ /// Repository name (without owner).
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Repository owner login (user or organization).
+ [JsonPropertyName("owner")]
+ public string Owner { get; set; } = string.Empty;
+}
+
+/// Pointer to a GitHub commit.
+/// The github_commit variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentGitHubCommit : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "github_commit";
+
+ /// First line of the commit message.
+ [JsonPropertyName("message")]
+ public required string Message { get; set; }
+
+ /// Full commit SHA.
+ [JsonPropertyName("oid")]
+ public required string Oid { get; set; }
+
+ /// Repository the commit belongs to.
+ [JsonPropertyName("repo")]
+ public required PushGitHubRepoRef Repo { get; set; }
+
+ /// URL to the commit on GitHub.
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
+}
+
+/// Pointer to a GitHub release.
+/// The github_release variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentGitHubRelease : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "github_release";
+
+ /// Human-readable release name.
+ [JsonPropertyName("name")]
+ public required string Name { get; set; }
+
+ /// Repository the release belongs to.
+ [JsonPropertyName("repo")]
+ public required PushGitHubRepoRef Repo { get; set; }
+
+ /// Git tag the release is anchored to.
+ [JsonPropertyName("tagName")]
+ public required string TagName { get; set; }
+
+ /// URL to the release on GitHub.
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
+}
+
+/// Pointer to a GitHub Actions job.
+/// The github_actions_job variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentGitHubActionsJob : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "github_actions_job";
+
+ /// Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("conclusion")]
+ public string? Conclusion { get; set; }
+
+ /// Job id within the workflow run.
+ [JsonPropertyName("jobId")]
+ public required long JobId { get; set; }
+
+ /// Display name of the job.
+ [JsonPropertyName("jobName")]
+ public required string JobName { get; set; }
+
+ /// Repository the workflow run belongs to.
+ [JsonPropertyName("repo")]
+ public required PushGitHubRepoRef Repo { get; set; }
+
+ /// URL to the job on GitHub.
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
+
+ /// Display name of the workflow the job ran in.
+ [JsonPropertyName("workflowName")]
+ public required string WorkflowName { get; set; }
+}
+
+/// Pointer to a GitHub repository.
+/// The github_repository variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentGitHubRepository : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "github_repository";
+
+ /// Short description of the repository.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
+
+ /// Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("ref")]
+ public string? Ref { get; set; }
+
+ /// Repository pointer.
+ [JsonPropertyName("repo")]
+ public required PushGitHubRepoRef Repo { get; set; }
+
+ /// URL to the repository on GitHub.
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
+}
+
+/// One side of a file diff (head or base).
+[Experimental(Diagnostics.Experimental)]
+public sealed class PushAttachmentGitHubFileDiffSide
+{
+ /// Repository-relative path to the file.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
+
+ /// Git ref (branch, tag, or commit SHA) the file is read at.
+ [JsonPropertyName("ref")]
+ public string Ref { get; set; } = string.Empty;
+
+ /// Repository the file lives in.
+ [JsonPropertyName("repo")]
+ public PushGitHubRepoRef Repo { get => field ??= new(); set; }
+}
+
+/// Pointer to a single-file diff. At least one of `head` and `base` must be present.
+/// The github_file_diff variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentGitHubFileDiff : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "github_file_diff";
+
+ /// File location on the base side of the diff. Absent for additions.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("base")]
+ public PushAttachmentGitHubFileDiffSide? Base { get; set; }
+
+ /// File location on the head side of the diff. Absent for deletions.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("head")]
+ public PushAttachmentGitHubFileDiffSide? Head { get; set; }
+
+ /// URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL).
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
+}
+
+/// One side of a tree comparison (head or base).
+[Experimental(Diagnostics.Experimental)]
+public sealed class PushAttachmentGitHubTreeComparisonSide
+{
+ /// Repository the revision belongs to.
+ [JsonPropertyName("repo")]
+ public PushGitHubRepoRef Repo { get => field ??= new(); set; }
+
+ /// Git revision (branch, tag, or commit SHA).
+ [JsonPropertyName("revision")]
+ public string Revision { get; set; } = string.Empty;
+}
+
+/// Pointer to a comparison between two git revisions.
+/// The github_tree_comparison variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentGitHubTreeComparison : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "github_tree_comparison";
+
+ /// Base side of the comparison.
+ [JsonPropertyName("base")]
+ public required PushAttachmentGitHubTreeComparisonSide Base { get; set; }
+
+ /// Head side of the comparison.
+ [JsonPropertyName("head")]
+ public required PushAttachmentGitHubTreeComparisonSide Head { get; set; }
+
+ /// URL to the comparison on GitHub.
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
+}
+
+/// Generic GitHub URL reference.
+/// The github_url variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentGitHubUrl : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "github_url";
+
+ /// URL to the GitHub resource.
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
+}
+
+/// Pointer to a file in a GitHub repository at a specific ref.
+/// The github_file variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentGitHubFile : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "github_file";
+
+ /// Repository-relative path to the file.
+ [JsonPropertyName("path")]
+ public required string Path { get; set; }
+
+ /// Git ref the file is read at (branch, tag, or commit SHA).
+ [JsonPropertyName("ref")]
+ public required string Ref { get; set; }
+
+ /// Repository the file lives in.
+ [JsonPropertyName("repo")]
+ public required PushGitHubRepoRef Repo { get; set; }
+
+ /// URL to the file on GitHub.
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
+}
+
+/// Pointer to a line range inside a file in a GitHub repository.
+/// The github_snippet variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentGitHubSnippet : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "github_snippet";
+
+ /// Line range the snippet covers.
+ [JsonPropertyName("lineRange")]
+ public required PushAttachmentFileLineRange LineRange { get; set; }
+
+ /// Repository-relative path to the file.
+ [JsonPropertyName("path")]
+ public required string Path { get; set; }
+
+ /// Git ref the file is read at (branch, tag, or commit SHA).
+ [JsonPropertyName("ref")]
+ public required string Ref { get; set; }
+
+ /// Repository the file lives in.
+ [JsonPropertyName("repo")]
+ public required PushGitHubRepoRef Repo { get; set; }
+
+ /// URL to the snippet on GitHub (with line anchor).
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
+}
+
+/// Blob attachment with inline base64-encoded data.
+/// The blob variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentBlob : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "blob";
+
+ /// Base64-encoded content.
+ [Base64String]
+ [JsonPropertyName("data")]
+ public required string Data { get; set; }
+
+ /// User-facing display name for the attachment.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("displayName")]
+ public string? DisplayName { get; set; }
+
+ /// MIME type of the inline data.
+ [JsonPropertyName("mimeType")]
+ public required string MimeType { get; set; }
+}
+
+/// Slim input shape for extension_context attachments; identity fields are runtime-derived.
+/// The extension_context variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PushAttachmentExtensionContext : PushAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "extension_context";
+
+ /// Caller-supplied JSON payload (required, may be null but not undefined).
+ [JsonPropertyName("payload")]
+ public required JsonElement Payload { get; set; }
+
+ /// Human-readable composer pill label.
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("title")]
+ public required string Title { get; set; }
+}
+
+/// Parameters for session.extensions.sendAttachmentsToMessage.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SendAttachmentsToMessageParams
+{
+ /// Attachments to push into the next user-message turn. extension_context entries take the slim shape; standard variants take their full AttachmentSchema shape.
+ [JsonPropertyName("attachments")]
+ public IList Attachments { get => field ??= []; set; }
+
+ /// Optional canvas instance binding the push for provenance. When supplied, the runtime resolves the canvas, verifies it is owned by the calling extension, and stamps canvasId/instanceId onto each extension_context entry. When omitted, no resolution runs and those fields stay unset on the attachment.
+ [JsonPropertyName("instanceId")]
+ public string? InstanceId { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Indicates whether the external tool call result was handled successfully.
+[Experimental(Diagnostics.Experimental)]
+public sealed class HandlePendingToolCallResult
+{
+ /// Whether the tool call result was handled successfully.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
+
+/// Pending external tool call request ID, with the tool result or an error describing why it failed.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class HandlePendingToolCallRequest
+{
+ /// Error message if the tool call failed.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+
+ /// Request ID of the pending tool call.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// Tool call result (string or expanded result object).
+ [JsonPropertyName("result")]
+ public JsonElement? Result { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ToolsInitializeAndValidateResult
+{
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionToolsInitializeAndValidateRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Lightweight metadata for a currently initialized session tool.
+[Experimental(Diagnostics.Experimental)]
+public sealed class CurrentToolMetadata
+{
+ /// Whether the tool is loaded on demand via tool search.
+ [JsonPropertyName("deferLoading")]
+ public bool? DeferLoading { get; set; }
+
+ /// Tool description.
+ [JsonPropertyName("description")]
+ public string Description { get; set; } = string.Empty;
+
+ /// JSON Schema for tool input.
+ [JsonPropertyName("input_schema")]
+ public IDictionary? InputSchema { get; set; }
+
+ /// MCP server name for MCP-backed tools.
+ [JsonPropertyName("mcpServerName")]
+ public string? McpServerName { get; set; }
+
+ /// Raw MCP tool name for MCP-backed tools.
+ [JsonPropertyName("mcpToolName")]
+ public string? McpToolName { get; set; }
+
+ /// Model-facing tool name.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Optional MCP/config namespaced tool name.
+ [JsonPropertyName("namespacedName")]
+ public string? NamespacedName { get; set; }
+}
+
+/// Current lightweight tool metadata snapshot for the session.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ToolsGetCurrentMetadataResult
+{
+ /// Current tool metadata, or null when tools have not been initialized yet.
+ [JsonPropertyName("tools")]
+ public IList? Tools { get; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionToolsGetCurrentMetadataRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Empty result after applying subagent settings.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ToolsUpdateSubagentSettingsResult
+{
+}
+
+/// Subagent model, reasoning effort, and context tier settings.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SubagentSettingsEntry
+{
+ /// Context tier override for matching subagents.
+ [JsonPropertyName("contextTier")]
+ public SubagentSettingsEntryContextTier? ContextTier { get; set; }
+
+ /// Reasoning effort override for matching subagents.
+ [JsonPropertyName("effortLevel")]
+ public string? EffortLevel { get; set; }
+
+ /// Model override for matching subagents.
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
+}
+
+/// Configured per-agent subagent overrides.
+public sealed class UpdateSubagentSettingsRequestSubagents
+{
+ /// Per-agent settings keyed by subagent agent_type.
+ [JsonPropertyName("agents")]
+ public IDictionary? Agents { get; set; }
+
+ /// Names of subagents the user has turned off; they cannot be dispatched.
+ [JsonPropertyName("disabledSubagents")]
+ public IList? DisabledSubagents { get; set; }
+
+ /// Maximum number of subagents that can run concurrently; applies to usage-based billing users only.
+ [JsonPropertyName("maxConcurrency")]
+ public int? MaxConcurrency { get; set; }
+
+ /// Maximum subagent nesting depth; applies to usage-based billing users only.
+ [JsonPropertyName("maxDepth")]
+ public int? MaxDepth { get; set; }
+}
+
+/// Subagent settings to apply to the current session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class UpdateSubagentSettingsRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// Subagent settings to apply, or null to clear the live session override.
+ [JsonPropertyName("subagents")]
+ public UpdateSubagentSettingsRequestSubagents? Subagents { get; set; }
+}
+
+/// RPC data type for SessionCommandsList operations.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionCommandsListRequest
+{
+ /// Include runtime built-in commands.
+ [JsonPropertyName("includeBuiltins")]
+ public bool? IncludeBuiltins { get; set; }
+
+ /// Include commands registered by protocol clients, including SDK clients and extensions.
+ [JsonPropertyName("includeClientCommands")]
+ public bool? IncludeClientCommands { get; set; }
+
+ /// Include enabled user-invocable skills and commands.
+ [JsonPropertyName("includeSkills")]
+ public bool? IncludeSkills { get; set; }
+}
+
+/// RPC data type for SessionCommandsListRequestWithSession operations.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionCommandsListRequestWithSession
+{
+ /// Include runtime built-in commands.
+ [JsonPropertyName("includeBuiltins")]
+ public bool? IncludeBuiltins { get; set; }
+
+ /// Include commands registered by protocol clients, including SDK clients and extensions.
+ [JsonPropertyName("includeClientCommands")]
+ public bool? IncludeClientCommands { get; set; }
+
+ /// Include enabled user-invocable skills and commands.
+ [JsonPropertyName("includeSkills")]
+ public bool? IncludeSkills { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection).
+/// Polymorphic base type discriminated by kind.
+[Experimental(Diagnostics.Experimental)]
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "kind",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(SlashCommandInvocationResultText), "text")]
+[JsonDerivedType(typeof(SlashCommandInvocationResultAgentPrompt), "agent-prompt")]
+[JsonDerivedType(typeof(SlashCommandInvocationResultCompleted), "completed")]
+[JsonDerivedType(typeof(SlashCommandInvocationResultSelectSubcommand), "select-subcommand")]
+public partial class SlashCommandInvocationResult
+{
+ /// The type discriminator.
+ [JsonPropertyName("kind")]
+ public virtual string Kind { get; set; } = string.Empty;
+}
+
+
+/// Slash-command invocation result containing text output plus Markdown/ANSI rendering flags.
+/// The text variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class SlashCommandInvocationResultText : SlashCommandInvocationResult
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "text";
+
+ /// Whether text contains Markdown.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("markdown")]
+ public bool? Markdown { get; set; }
+
+ /// Whether ANSI sequences should be preserved.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("preserveAnsi")]
+ public bool? PreserveAnsi { get; set; }
+
+ /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("runtimeSettingsChanged")]
+ public bool? RuntimeSettingsChanged { get; set; }
+
+ /// Text output for the client to render.
+ [JsonPropertyName("text")]
+ public required string Text { get; set; }
+}
+
+/// Slash-command invocation result that submits an agent prompt, with display prompt, optional mode, optional user-facing notice, and settings-change flag.
+/// The agent-prompt variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class SlashCommandInvocationResultAgentPrompt : SlashCommandInvocationResult
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "agent-prompt";
+
+ /// Prompt text to display to the user.
+ [JsonPropertyName("displayPrompt")]
+ public required string DisplayPrompt { get; set; }
+
+ /// Optional target session mode for the agent prompt.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("mode")]
+ public SessionMode? Mode { get; set; }
+
+ /// Optional user-facing notice to show before the prompt is submitted.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("notice")]
+ public string? Notice { get; set; }
+
+ /// Prompt to submit to the agent.
+ [JsonPropertyName("prompt")]
+ public required string Prompt { get; set; }
+
+ /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("runtimeSettingsChanged")]
+ public bool? RuntimeSettingsChanged { get; set; }
+}
+
+/// Slash-command invocation result indicating completion, with optional message and settings-change flag.
+/// The completed variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class SlashCommandInvocationResultCompleted : SlashCommandInvocationResult
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "completed";
+
+ /// Optional user-facing message describing the completed command.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("message")]
+ public string? Message { get; set; }
+
+ /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("runtimeSettingsChanged")]
+ public bool? RuntimeSettingsChanged { get; set; }
+}
+
+/// Selectable slash-command subcommand option with name, description, and optional group label.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SlashCommandSelectSubcommandOption
+{
+ /// Human-readable description of the subcommand.
+ [JsonPropertyName("description")]
+ public string Description { get; set; } = string.Empty;
+
+ /// Optional group label for organizing options.
+ [JsonPropertyName("group")]
+ public string? Group { get; set; }
+
+ /// Subcommand name to invoke.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+}
+
+/// Slash-command invocation result asking the client to present subcommand options for a parent command.
+/// The select-subcommand variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class SlashCommandInvocationResultSelectSubcommand : SlashCommandInvocationResult
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "select-subcommand";
+
+ /// Parent command name that requires subcommand selection.
+ [JsonPropertyName("command")]
+ public required string Command { get; set; }
+
+ /// Available subcommand options for the client to present.
+ [JsonPropertyName("options")]
+ public required IList Options { get; set; }
+
+ /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("runtimeSettingsChanged")]
+ public bool? RuntimeSettingsChanged { get; set; }
+
+ /// Human-readable title for the selection UI.
+ [JsonPropertyName("title")]
+ public required string Title { get; set; }
+}
+
+/// Slash command name and optional raw input string to invoke.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class CommandsInvokeRequest
+{
+ /// Raw input after the command name.
+ [JsonPropertyName("input")]
+ public string? Input { get; set; }
+
+ /// Command name. Leading slashes are stripped and the name is matched case-insensitively.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Indicates whether the pending client-handled command was completed successfully.
+[Experimental(Diagnostics.Experimental)]
+public sealed class CommandsHandlePendingCommandResult
+{
+ /// Whether the command was handled successfully.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
+
+/// Pending command request ID and an optional error if the client handler failed.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class CommandsHandlePendingCommandRequest
+{
+ /// Error message if the command handler failed.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+
+ /// Request ID from the command invocation event.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Error message produced while executing the command, if any.
+[Experimental(Diagnostics.Experimental)]
+public sealed class ExecuteCommandResult
+{
+ /// Error message produced while executing the command, if any. Omitted when the handler succeeded.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+}
+
+/// Slash command name and argument string to execute synchronously.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class ExecuteCommandParams
+{
+ /// Argument string to pass to the command (empty string if none).
+ [JsonPropertyName("args")]
+ public string Args { get; set; } = string.Empty;
+
+ /// Name of the slash command to invoke (without the leading '/').
+ [JsonPropertyName("commandName")]
+ public string CommandName { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Indicates whether the command was accepted into the local execution queue.
+[Experimental(Diagnostics.Experimental)]
+public sealed class EnqueueCommandResult
+{
+ /// True when the command was accepted into the local execution queue. False when the call targets a session that does not support local command queueing (e.g. remote sessions).
+ [JsonPropertyName("queued")]
+ public bool Queued { get; set; }
+}
+
+/// Slash-prefixed command string to enqueue for FIFO processing.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class EnqueueCommandParams
+{
+ /// Slash-prefixed command string to enqueue, e.g. '/compact' or '/model gpt-4'. Queued FIFO with any in-flight items; if the session is idle, processing kicks off immediately.
+ [JsonPropertyName("command")]
+ public string Command { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Indicates whether the queued-command response was matched to a pending request.
+[Experimental(Diagnostics.Experimental)]
+public sealed class CommandsRespondToQueuedCommandResult
+{
+ /// Whether a pending queued command with the given request ID was found and resolved. False when the request was already resolved, cancelled, or unknown.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
+
+/// Result of the queued command execution.
+/// Data type discriminated by handled.
+[Experimental(Diagnostics.Experimental)]
+public partial class QueuedCommandResult
+{
+ /// The boolean discriminator.
+ [JsonPropertyName("handled")]
+ public bool Handled { get; set; }
+
+ /// When true, the runtime will not process subsequent queued commands until a new request comes in.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("stopProcessingQueue")]
+ public bool? StopProcessingQueue { get; set; }
+}
+
+/// Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands).
+[Experimental(Diagnostics.Experimental)]
+internal sealed class CommandsRespondToQueuedCommandRequest
+{
+ /// Request ID from the `command.queued` event the host is responding to.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// Result of the queued command execution.
+ [JsonPropertyName("result")]
+ public QueuedCommandResult Result { get => field ??= new(); set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Telemetry engagement ID for the session, when available.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionTelemetryEngagement
+{
+ /// Current telemetry engagement ID, when available.
+ [JsonPropertyName("engagementId")]
+ public string? EngagementId { get; set; }
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionTelemetryGetEngagementIdRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Feature override key/value pairs to attach to subsequent telemetry events from this session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class TelemetrySetFeatureOverridesRequest
+{
+ /// Override key/value pairs to attach to subsequent telemetry events from this session. Replaces any previously-set overrides.
+ [JsonPropertyName("features")]
+ public IDictionary Features { get => field ??= new Dictionary(); set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Transient answer generated from current conversation context.
+[Experimental(Diagnostics.Experimental)]
+public sealed class UIEphemeralQueryResult
+{
+ /// Full assistant response text.
+ [JsonPropertyName("answer")]
+ public string Answer { get; set; } = string.Empty;
+}
+
+/// Transient question to answer without adding it to conversation history.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class UIEphemeralQueryRequest
+{
+ /// In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Marked internal: excluded from the public SDK surface. Replaced by an explicit cancellation token + cancel RPC in the SDK migration.
+ [JsonInclude]
+ [JsonPropertyName("abortSignal")]
+ internal JsonElement? AbortSignal { get; set; }
+
+ /// In-process streaming callback `(text) => void` invoked with each token as the model emits it. Marked internal: excluded from the public SDK surface. In a process-separated SDK this is replaced by a streaming RPC that yields chunks and a final answer.
+ [JsonInclude]
+ [JsonPropertyName("onChunk")]
+ internal JsonElement? OnChunk { get; set; }
+
+ /// Question to answer from the current conversation context.
+ [JsonPropertyName("question")]
+ public string Question { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// The elicitation response (accept with form values, decline, or cancel).
+[Experimental(Diagnostics.Experimental)]
+public sealed class UIElicitationResponse
+{
+ /// The user's response: accept (submitted), decline (rejected), or cancel (dismissed).
+ [JsonPropertyName("action")]
+ public UIElicitationResponseAction Action { get; set; }
+
+ /// The form values submitted by the user (present when action is 'accept').
+ [JsonPropertyName("content")]
+ public IDictionary? Content { get; set; }
+}
+
+/// JSON Schema describing the form fields to present to the user.
+[Experimental(Diagnostics.Experimental)]
+public sealed class UIElicitationSchema
+{
+ /// Form field definitions, keyed by field name.
+ [JsonPropertyName("properties")]
+ public IDictionary Properties { get => field ??= new Dictionary(); set; }
+
+ /// List of required field names.
+ [JsonPropertyName("required")]
+ public IList? Required { get; set; }
+
+ /// Schema type indicator (always 'object').
+ [JsonPropertyName("type")]
+ public string Type { get; set; } = string.Empty;
+}
+
+/// Prompt message and JSON schema describing the form fields to elicit from the user.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class UIElicitationRequest
+{
+ /// Message describing what information is needed from the user.
+ [JsonPropertyName("message")]
+ public string Message { get; set; } = string.Empty;
+
+ /// JSON Schema describing the form fields to present to the user.
+ [JsonPropertyName("requestedSchema")]
+ public UIElicitationSchema RequestedSchema { get => field ??= new(); set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
+[Experimental(Diagnostics.Experimental)]
+public sealed class UIElicitationResult
+{
+ /// Whether the response was accepted. False if the request was already resolved by another client.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
+
+/// Pending elicitation request ID and the user's response (accept/decline/cancel + form values).
+[Experimental(Diagnostics.Experimental)]
+internal sealed class UIHandlePendingElicitationRequest
+{
+ /// The unique request ID from the elicitation.requested event.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// The elicitation response (accept with form values, decline, or cancel).
+ [JsonPropertyName("result")]
+ public UIElicitationResponse Result { get => field ??= new(); set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Indicates whether the pending UI request was resolved by this call.
+[Experimental(Diagnostics.Experimental)]
+public sealed class UIHandlePendingResult
+{
+ /// True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
+
+/// User response for a pending user-input request, with answer text and whether it was typed freeform.
+[Experimental(Diagnostics.Experimental)]
+public sealed class UIUserInputResponse
+{
+ /// The user's answer text.
+ [JsonPropertyName("answer")]
+ public string Answer { get; set; } = string.Empty;
+
+ /// True if the user typed a freeform response, false if they selected a presented choice. Used by telemetry to differentiate between free text input and choice selection.
+ [JsonPropertyName("wasFreeform")]
+ public bool WasFreeform { get; set; }
+}
+
+/// Request ID of a pending `user_input.requested` event and the user's response.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class UIHandlePendingUserInputRequest
+{
+ /// The unique request ID from the user_input.requested event.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// User response for a pending user-input request, with answer text and whether it was typed freeform.
+ [JsonPropertyName("response")]
+ public UIUserInputResponse Response { get => field ??= new(); set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result.
+[Experimental(Diagnostics.Experimental)]
+public sealed class UIHandlePendingSamplingResponse
+{
+}
+
+/// Request ID of a pending `sampling.requested` event and an optional sampling result payload (omit to reject).
+[Experimental(Diagnostics.Experimental)]
+internal sealed class UIHandlePendingSamplingRequest
+{
+ /// The unique request ID from the sampling.requested event.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result.
+ [JsonPropertyName("response")]
+ public UIHandlePendingSamplingResponse? Response { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Request ID of a pending `auto_mode_switch.requested` event and the user's response.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class UIHandlePendingAutoModeSwitchRequest
+{
+ /// The unique request ID from the auto_mode_switch.requested event.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline).
+ [JsonPropertyName("response")]
+ public UIAutoModeSwitchResponse Response { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// The user's selected action for an exhausted session limit.
+[Experimental(Diagnostics.Experimental)]
+public sealed class UISessionLimitsExhaustedResponse
+{
+ /// Action selected by the user.
+ [JsonPropertyName("action")]
+ public UISessionLimitsExhaustedResponseAction Action { get; set; }
+
+ /// AI Credits to add to the current max when action is 'add'.
+ [JsonPropertyName("additionalAiCredits")]
+ public double? AdditionalAiCredits { get; set; }
+
+ /// New absolute max AI Credits when action is 'set'.
+ [JsonPropertyName("maxAiCredits")]
+ public double? MaxAiCredits { get; set; }
+}
+
+/// Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class UIHandlePendingSessionLimitsExhaustedRequest
+{
+ /// The unique request ID from the session_limits_exhausted.requested event.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// The selected session-limit action.
+ [JsonPropertyName("response")]
+ public UISessionLimitsExhaustedResponse Response { get => field ??= new(); set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// User response for a pending exit-plan-mode request, with approval state, selected action, auto-approve flag, and feedback.
+[Experimental(Diagnostics.Experimental)]
+public sealed class UIExitPlanModeResponse
+{
+ /// Whether the plan was approved.
+ [JsonPropertyName("approved")]
+ public bool Approved { get; set; }
+
+ /// Whether subsequent edits should be auto-approved without confirmation.
+ [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; }
+
+ /// The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'.
+ [JsonPropertyName("selectedAction")]
+ public UIExitPlanModeAction? SelectedAction { get; set; }
+}
+
+/// Request ID of a pending `exit_plan_mode.requested` event and the user's response.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class UIHandlePendingExitPlanModeRequest
+{
+ /// The unique request ID from the exit_plan_mode.requested event.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// User response for a pending exit-plan-mode request, with approval state, selected action, auto-approve flag, and feedback.
+ [JsonPropertyName("response")]
+ public UIExitPlanModeResponse Response { get => field ??= new(); set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Register an in-process handler for `auto_mode_switch.requested` events. The caller still attaches the actual listener via the standard event-subscription mechanism; this registration solely tells the server bridge to skip its own dispatch (so a remote client doesn't race the in-process handler for the same requestId).
+[Experimental(Diagnostics.Experimental)]
+public sealed class UIRegisterDirectAutoModeSwitchHandlerResult
+{
+ /// Opaque handle representing the registration. Pass this same handle to `unregisterDirectAutoModeSwitchHandler` when the in-process handler is no longer active. Multiple registrations are reference-counted; the server bridge will only dispatch auto-mode-switch requests when no handles are active.
+ [JsonPropertyName("handle")]
+ public string Handle { get; set; } = string.Empty;
+}
+
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionUiRegisterDirectAutoModeSwitchHandlerRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Indicates whether the handle was active and the registration count was decremented.
+[Experimental(Diagnostics.Experimental)]
+public sealed class UIUnregisterDirectAutoModeSwitchHandlerResult
+{
+ /// True if the handle was active and decremented the counter; false if the handle was unknown.
+ [JsonPropertyName("unregistered")]
+ public bool Unregistered { get; set; }
+}
+
+/// Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class UIUnregisterDirectAutoModeSwitchHandlerRequest
+{
+ /// Handle previously returned by `registerDirectAutoModeSwitchHandler`.
+ [JsonPropertyName("handle")]
+ public string Handle { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// Indicates whether the operation succeeded.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionsConfigureResult
+{
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
+
+/// Source descriptor for a `session.permissions.configure` content-exclusion rule, with source name and type.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionsConfigureAdditionalContentExclusionPolicyRuleSource
+{
+ /// Gets or sets the name value.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Gets or sets the type value.
+ [JsonPropertyName("type")]
+ public string Type { get; set; } = string.Empty;
+}
+
+/// Single content-exclusion rule supplied to `session.permissions.configure`, with paths, match conditions, and source.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionsConfigureAdditionalContentExclusionPolicyRule
+{
+ /// Gets or sets the ifAnyMatch value.
+ [JsonPropertyName("ifAnyMatch")]
+ public IList? IfAnyMatch { get; set; }
+
+ /// Gets or sets the ifNoneMatch value.
+ [JsonPropertyName("ifNoneMatch")]
+ public IList? IfNoneMatch { get; set; }
+
+ /// Gets or sets the paths value.
+ [JsonPropertyName("paths")]
+ public IList Paths { get => field ??= []; set; }
+
+ /// Source descriptor for a `session.permissions.configure` content-exclusion rule, with source name and type.
+ [JsonPropertyName("source")]
+ public PermissionsConfigureAdditionalContentExclusionPolicyRuleSource Source { get => field ??= new(); set; }
+}
+
+/// Content-exclusion policy supplied to `session.permissions.configure`, with rules, last-updated data, and scope.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionsConfigureAdditionalContentExclusionPolicy
+{
+ /// Gets or sets the last_updated_at value.
+ [JsonPropertyName("last_updated_at")]
+ public JsonElement LastUpdatedAt { get; set; }
+
+ /// Gets or sets the rules value.
+ [JsonPropertyName("rules")]
+ public IList Rules { get => field ??= []; set; }
+
+ /// Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration.
+ [JsonPropertyName("scope")]
+ public PermissionsConfigureAdditionalContentExclusionPolicyScope Scope { get; set; }
+}
+
+/// If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionPathsConfig
+{
+ /// Additional directories to allow tool access to (in addition to the session's working directory). When `unrestricted` is true, these are still pre-populated on the UnrestrictedPathManager so they remain visible via getDirectories() (e.g. for @-mention completion).
+ [JsonPropertyName("additionalDirectories")]
+ public IList? AdditionalDirectories { get; set; }
+
+ /// Whether to include the system temp directory in the allowed list (defaults to true). Ignored when `unrestricted` is true.
+ [JsonPropertyName("includeTempDirectory")]
+ public bool? IncludeTempDirectory { get; set; }
+
+ /// If true, the runtime allows access to all paths without prompting. Equivalent to constructing an UnrestrictedPathManager.
+ [JsonPropertyName("unrestricted")]
+ public bool? Unrestricted { get; set; }
+
+ /// Workspace root path (special-cased to be allowed even before the directory exists). Ignored when `unrestricted` is true.
+ [JsonPropertyName("workspacePath")]
+ public string? WorkspacePath { get; set; }
+}
+
+/// If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionRulesSet
+{
+ /// Rules that auto-approve matching requests.
+ [JsonPropertyName("approved")]
+ public IList Approved { get => field ??= []; set; }
+
+ /// Rules that auto-deny matching requests.
+ [JsonPropertyName("denied")]
+ public IList Denied { get => field ??= []; set; }
+}
+
+/// If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionUrlsConfig
+{
+ /// Initial list of allowed URL/domain patterns. Patterns may include path components. Ignored when `unrestricted` is true.
+ [JsonPropertyName("initialAllowed")]
+ public IList? InitialAllowed { get; set; }
+
+ /// If true, the runtime allows access to all URLs without prompting. Initial allow-list is ignored when this is true.
+ [JsonPropertyName("unrestricted")]
+ public bool? Unrestricted { get; set; }
+}
+
+/// Patch of permission policy fields to apply (omit a field to leave it unchanged).
+[Experimental(Diagnostics.Experimental)]
+internal sealed class PermissionsConfigureParams
+{
+ /// If specified, replaces the host-supplied GitHub Content Exclusion policies on the session (combined with natively-discovered policies when evaluating tool/file access). Omit to leave the current policies unchanged.
+ [JsonPropertyName("additionalContentExclusionPolicies")]
+ public IList? AdditionalContentExclusionPolicies { get; set; }
+
+ /// If specified, sets whether path/URL read permission requests are auto-approved. Omit to leave the current value unchanged.
+ [JsonPropertyName("approveAllReadPermissionRequests")]
+ public bool? ApproveAllReadPermissionRequests { get; set; }
+
+ /// If specified, sets whether tool permission requests are auto-approved without prompting. Omit to leave the current value unchanged.
+ [JsonPropertyName("approveAllToolPermissionRequests")]
+ public bool? ApproveAllToolPermissionRequests { get; set; }
+
+ /// If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged.
+ [JsonPropertyName("paths")]
+ public PermissionPathsConfig? Paths { get; set; }
+
+ /// If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged.
+ [JsonPropertyName("rules")]
+ public PermissionRulesSet? Rules { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged.
+ [JsonPropertyName("urls")]
+ public PermissionUrlsConfig? Urls { get; set; }
+}
+
+/// Indicates whether the permission decision was applied; false when the request was already resolved.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionRequestResult
+{
+ /// Whether the permission request was handled successfully.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
+
+/// The client's response to the pending permission prompt.
+/// Polymorphic base type discriminated by kind.
+[Experimental(Diagnostics.Experimental)]
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "kind",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(PermissionDecisionApproveOnce), "approve-once")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForSession), "approve-for-session")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForLocation), "approve-for-location")]
+[JsonDerivedType(typeof(PermissionDecisionApprovePermanently), "approve-permanently")]
+[JsonDerivedType(typeof(PermissionDecisionReject), "reject")]
+[JsonDerivedType(typeof(PermissionDecisionUserNotAvailable), "user-not-available")]
+[JsonDerivedType(typeof(PermissionDecisionApproved), "approved")]
+[JsonDerivedType(typeof(PermissionDecisionApprovedForSession), "approved-for-session")]
+[JsonDerivedType(typeof(PermissionDecisionApprovedForLocation), "approved-for-location")]
+[JsonDerivedType(typeof(PermissionDecisionCancelled), "cancelled")]
+[JsonDerivedType(typeof(PermissionDecisionDeniedByRules), "denied-by-rules")]
+[JsonDerivedType(typeof(PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser), "denied-no-approval-rule-and-could-not-request-from-user")]
+[JsonDerivedType(typeof(PermissionDecisionDeniedInteractivelyByUser), "denied-interactively-by-user")]
+[JsonDerivedType(typeof(PermissionDecisionDeniedByContentExclusionPolicy), "denied-by-content-exclusion-policy")]
+[JsonDerivedType(typeof(PermissionDecisionDeniedByPermissionRequestHook), "denied-by-permission-request-hook")]
+public partial class PermissionDecision
+{
+ /// The type discriminator.
+ [JsonPropertyName("kind")]
+ public virtual string Kind { get; set; } = string.Empty;
+}
+
+
+/// Permission-decision request variant to approve only the current permission request.
+/// The approve-once variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveOnce : PermissionDecision
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "approve-once";
+
+ /// True only when a host surfaced this request to a user who approved it.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("approvedInteractively")]
+ public bool? ApprovedInteractively { get; set; }
+}
+
+/// Session-scoped approval to remember (tool prompts only; omitted for path/url prompts).
+/// Polymorphic base type discriminated by kind.
+[Experimental(Diagnostics.Experimental)]
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "kind",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalCommands), "commands")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalRead), "read")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalWrite), "write")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMcp), "mcp")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMcpSampling), "mcp-sampling")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMemory), "memory")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalCustomTool), "custom-tool")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalExtensionManagement), "extension-management")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess), "extension-permission-access")]
+public partial class PermissionDecisionApproveForSessionApproval
+{
+ /// The type discriminator.
+ [JsonPropertyName("kind")]
+ public virtual string Kind { get; set; } = string.Empty;
+}
+
+
+/// Session-scoped approval details for specific command identifiers.
+/// The commands variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForSessionApprovalCommands : PermissionDecisionApproveForSessionApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "commands";
+
+ /// Command identifiers covered by this approval.
+ [JsonPropertyName("commandIdentifiers")]
+ public required IList CommandIdentifiers { get; set; }
+}
+
+/// Session-scoped approval details for read-only filesystem operations.
+/// The read variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForSessionApprovalRead : PermissionDecisionApproveForSessionApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "read";
+}
+
+/// Session-scoped approval details for filesystem write operations.
+/// The write variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForSessionApprovalWrite : PermissionDecisionApproveForSessionApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "write";
+}
+
+/// Session-scoped approval details for an MCP server tool, or all tools on the server when `toolName` is null.
+/// The mcp variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForSessionApprovalMcp : PermissionDecisionApproveForSessionApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "mcp";
+
+ /// MCP server name.
+ [JsonPropertyName("serverName")]
+ public required string ServerName { get; set; }
+
+ /// MCP tool name, or null to cover every tool on the server.
+ [JsonPropertyName("toolName")]
+ public string? ToolName { get; set; }
+}
+
+/// Session-scoped approval details for MCP sampling requests from a server.
+/// The mcp-sampling variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForSessionApprovalMcpSampling : PermissionDecisionApproveForSessionApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "mcp-sampling";
- /// Resolved sandbox configuration.
- [JsonPropertyName("sandboxConfig")]
- public SandboxConfig? SandboxConfig { get; set; }
+ /// MCP server name.
+ [JsonPropertyName("serverName")]
+ public required string ServerName { get; set; }
+}
- /// 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.
- [JsonPropertyName("sessionCapabilities")]
- public IList? SessionCapabilities { get; set; }
+/// Session-scoped approval details for writes to long-term memory.
+/// The memory variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForSessionApprovalMemory : PermissionDecisionApproveForSessionApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "memory";
+}
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+/// Session-scoped approval details for a custom tool, keyed by tool name.
+/// The custom-tool variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForSessionApprovalCustomTool : PermissionDecisionApproveForSessionApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "custom-tool";
- /// Optional session limits. Pass null to clear the session limits.
- [JsonPropertyName("sessionLimits")]
- public SessionLimitsConfig? SessionLimits { get; set; }
+ /// Custom tool name.
+ [JsonPropertyName("toolName")]
+ public required string ToolName { get; set; }
+}
- /// Shell init profile (`None` or `NonInteractive`).
- [JsonPropertyName("shellInitProfile")]
- public string? ShellInitProfile { get; set; }
+/// Session-scoped approval details for extension-management operations, optionally narrowed by operation.
+/// The extension-management variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForSessionApprovalExtensionManagement : PermissionDecisionApproveForSessionApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "extension-management";
- /// Per-shell process flags (e.g., `pwsh` arguments).
- [JsonPropertyName("shellProcessFlags")]
- public IList? ShellProcessFlags { get; set; }
+ /// Optional operation identifier; when omitted, the approval covers all extension management operations.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("operation")]
+ public string? Operation { get; set; }
+}
- /// Additional directories to search for skills.
- [JsonPropertyName("skillDirectories")]
- public IList? SkillDirectories { get; set; }
+/// Session-scoped approval details for an extension's permission-gated capability access, keyed by extension name.
+/// The extension-permission-access variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess : PermissionDecisionApproveForSessionApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "extension-permission-access";
- /// Whether to skip loading custom instruction sources.
- [JsonPropertyName("skipCustomInstructions")]
- public bool? SkipCustomInstructions { get; set; }
+ /// Extension name.
+ [JsonPropertyName("extensionName")]
+ public required string ExtensionName { get; set; }
+}
- /// Whether to skip embedding retrieval pipeline initialization and execution.
- [JsonPropertyName("skipEmbeddingRetrieval")]
- public bool? SkipEmbeddingRetrieval { get; set; }
+/// Permission-decision request variant to approve for the rest of the session, with optional tool approval or URL domain.
+/// The approve-for-session variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForSession : PermissionDecision
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "approve-for-session";
- /// When true, the selected custom agent's prompt is not injected into the user message (skill context is still injected). Used by automation triggers where the agent prompt is already in the problem statement.
- [JsonPropertyName("suppressCustomAgentPrompt")]
- public bool? SuppressCustomAgentPrompt { get; set; }
+ /// Session-scoped approval to remember (tool prompts only; omitted for path/url prompts).
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("approval")]
+ public PermissionDecisionApproveForSessionApproval? Approval { get; set; }
- /// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set.
- [JsonPropertyName("toolFilterPrecedence")]
- public OptionsUpdateToolFilterPrecedence? ToolFilterPrecedence { get; set; }
+ /// URL domain to approve for the rest of the session (URL prompts only).
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("domain")]
+ public string? Domain { get; set; }
+}
- /// Optional path for trajectory output.
- [JsonPropertyName("trajectoryFile")]
- public string? TrajectoryFile { get; set; }
+/// Approval to persist for this location.
+/// Polymorphic base type discriminated by kind.
+[Experimental(Diagnostics.Experimental)]
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "kind",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalCommands), "commands")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalRead), "read")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalWrite), "write")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMcp), "mcp")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMcpSampling), "mcp-sampling")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMemory), "memory")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalCustomTool), "custom-tool")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalExtensionManagement), "extension-management")]
+[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess), "extension-permission-access")]
+public partial class PermissionDecisionApproveForLocationApproval
+{
+ /// The type discriminator.
+ [JsonPropertyName("kind")]
+ public virtual string Kind { get; set; } = string.Empty;
+}
- /// Output verbosity level for supported models.
- [JsonPropertyName("verbosity")]
- public Verbosity? Verbosity { get; set; }
- /// Absolute working-directory path for shell tools.
- [JsonPropertyName("workingDirectory")]
- public string? WorkingDirectory { get; set; }
+/// Location-scoped approval details for specific command identifiers.
+/// The commands variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForLocationApprovalCommands : PermissionDecisionApproveForLocationApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "commands";
+
+ /// Command identifiers covered by this approval.
+ [JsonPropertyName("commandIdentifiers")]
+ public required IList CommandIdentifiers { get; set; }
}
-/// Parameters for (re)loading the merged LSP configuration set.
+/// Location-scoped approval details for read-only filesystem operations.
+/// The read variant of .
[Experimental(Diagnostics.Experimental)]
-internal sealed class LspInitializeRequest
+public partial class PermissionDecisionApproveForLocationApprovalRead : PermissionDecisionApproveForLocationApproval
{
- /// Force re-initialization even when LSP configs were already loaded for the working directory.
- [JsonPropertyName("force")]
- public bool? Force { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "read";
+}
- /// Git root used as the boundary when traversing for project-level LSP configs (supports monorepos).
- [JsonPropertyName("gitRoot")]
- public string? GitRoot { get; set; }
+/// Location-scoped approval details for filesystem write operations.
+/// The write variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForLocationApprovalWrite : PermissionDecisionApproveForLocationApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "write";
+}
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+/// Location-scoped approval details for an MCP server tool, or all tools on the server when `toolName` is null.
+/// The mcp variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForLocationApprovalMcp : PermissionDecisionApproveForLocationApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "mcp";
- /// Working directory used to load project-level LSP configs. Defaults to the session working directory when omitted.
- [JsonPropertyName("workingDirectory")]
- public string? WorkingDirectory { get; set; }
+ /// MCP server name.
+ [JsonPropertyName("serverName")]
+ public required string ServerName { get; set; }
+
+ /// MCP tool name, or null to cover every tool on the server.
+ [JsonPropertyName("toolName")]
+ public string? ToolName { get; set; }
}
-/// Discovered extension metadata, including source-qualified ID, name, discovery source, status, and optional process ID.
+/// Location-scoped approval details for MCP sampling requests from a server.
+/// The mcp-sampling variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class Extension
+public partial class PermissionDecisionApproveForLocationApprovalMcpSampling : PermissionDecisionApproveForLocationApproval
{
- /// Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper', 'plugin:my-plugin:my-ext').
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Kind => "mcp-sampling";
- /// Extension name (directory name).
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// MCP server name.
+ [JsonPropertyName("serverName")]
+ public required string ServerName { get; set; }
+}
- /// Process ID if the extension is running.
- [JsonPropertyName("pid")]
- public long? Pid { get; set; }
+/// Location-scoped approval details for writes to long-term memory.
+/// The memory variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForLocationApprovalMemory : PermissionDecisionApproveForLocationApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "memory";
+}
- /// Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin (installed plugin), or session (session-state/<id>/extensions/).
- [JsonPropertyName("source")]
- public ExtensionSource Source { get; set; }
+/// Location-scoped approval details for a custom tool, keyed by tool name.
+/// The custom-tool variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForLocationApprovalCustomTool : PermissionDecisionApproveForLocationApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "custom-tool";
- /// Current status: running, disabled, failed, or starting.
- [JsonPropertyName("status")]
- public ExtensionStatus Status { get; set; }
+ /// Custom tool name.
+ [JsonPropertyName("toolName")]
+ public required string ToolName { get; set; }
+}
+
+/// Location-scoped approval details for extension-management operations, optionally narrowed by operation.
+/// The extension-management variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionDecisionApproveForLocationApprovalExtensionManagement : PermissionDecisionApproveForLocationApproval
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "extension-management";
+
+ /// Optional operation identifier; when omitted, the approval covers all extension management operations.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("operation")]
+ public string? Operation { get; set; }
}
-/// Extensions discovered for the session, with their current status.
+/// Location-scoped approval details for an extension's permission-gated capability access, keyed by extension name.
+/// The extension-permission-access variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class ExtensionList
+public partial class PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess : PermissionDecisionApproveForLocationApproval
{
- /// Discovered extensions and their current status.
- [JsonPropertyName("extensions")]
- public IList Extensions { get => field ??= []; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "extension-permission-access";
+
+ /// Extension name.
+ [JsonPropertyName("extensionName")]
+ public required string ExtensionName { get; set; }
}
-/// Identifies the target session.
+/// Permission-decision request variant to approve and persist a permission for a project location, with approval details and location key.
+/// The approve-for-location variant of .
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionExtensionsListRequest
+public partial class PermissionDecisionApproveForLocation : PermissionDecision
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Kind => "approve-for-location";
+
+ /// Approval to persist for this location.
+ [JsonPropertyName("approval")]
+ public required PermissionDecisionApproveForLocationApproval Approval { get; set; }
+
+ /// Location key (git root or cwd) to persist the approval to.
+ [JsonPropertyName("locationKey")]
+ public required string LocationKey { get; set; }
}
-/// Source-qualified extension identifier to enable for the session.
+/// Permission-decision request variant to permanently approve a URL domain across sessions.
+/// The approve-permanently variant of .
[Experimental(Diagnostics.Experimental)]
-internal sealed class ExtensionsEnableRequest
+public partial class PermissionDecisionApprovePermanently : PermissionDecision
{
- /// Source-qualified extension ID to enable.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Kind => "approve-permanently";
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// URL domain to approve permanently.
+ [JsonPropertyName("domain")]
+ public required string Domain { get; set; }
}
-/// Source-qualified extension identifier to disable for the session.
+/// Permission-decision request variant to reject a pending permission request, with optional feedback.
+/// The reject variant of .
[Experimental(Diagnostics.Experimental)]
-internal sealed class ExtensionsDisableRequest
+public partial class PermissionDecisionReject : PermissionDecision
{
- /// Source-qualified extension ID to disable.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Kind => "reject";
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Optional feedback explaining the rejection.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("feedback")]
+ public string? Feedback { get; set; }
}
-/// Identifies the target session.
+/// Permission-decision variant indicating no user was available to confirm the request.
+/// The user-not-available variant of .
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionExtensionsReloadRequest
+public partial class PermissionDecisionUserNotAvailable : PermissionDecision
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Kind => "user-not-available";
}
-/// Attachment union accepted by push input, covering files, directories, GitHub objects, blobs, snippets, and extension context.
-/// Polymorphic base type discriminated by type.
+/// Permission-decision variant indicating the request was approved.
+/// The approved variant of .
[Experimental(Diagnostics.Experimental)]
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "type",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(PushAttachmentFile), "file")]
-[JsonDerivedType(typeof(PushAttachmentDirectory), "directory")]
-[JsonDerivedType(typeof(PushAttachmentSelection), "selection")]
-[JsonDerivedType(typeof(PushAttachmentGitHubReference), "github_reference")]
-[JsonDerivedType(typeof(PushAttachmentGitHubCommit), "github_commit")]
-[JsonDerivedType(typeof(PushAttachmentGitHubRelease), "github_release")]
-[JsonDerivedType(typeof(PushAttachmentGitHubActionsJob), "github_actions_job")]
-[JsonDerivedType(typeof(PushAttachmentGitHubRepository), "github_repository")]
-[JsonDerivedType(typeof(PushAttachmentGitHubFileDiff), "github_file_diff")]
-[JsonDerivedType(typeof(PushAttachmentGitHubTreeComparison), "github_tree_comparison")]
-[JsonDerivedType(typeof(PushAttachmentGitHubUrl), "github_url")]
-[JsonDerivedType(typeof(PushAttachmentGitHubFile), "github_file")]
-[JsonDerivedType(typeof(PushAttachmentGitHubSnippet), "github_snippet")]
-[JsonDerivedType(typeof(PushAttachmentBlob), "blob")]
-[JsonDerivedType(typeof(PushAttachmentExtensionContext), "extension_context")]
-public partial class PushAttachment
+public partial class PermissionDecisionApproved : PermissionDecision
{
- /// The type discriminator.
- [JsonPropertyName("type")]
- public virtual string Type { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Kind => "approved";
}
-
-/// Optional line range to scope the attachment to a specific section of the file.
+/// Permission-decision variant indicating approval was remembered for the session, with approval details.
+/// The approved-for-session variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class PushAttachmentFileLineRange
+public partial class PermissionDecisionApprovedForSession : PermissionDecision
{
- /// End line number (1-based, inclusive).
- [JsonPropertyName("end")]
- public long End { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "approved-for-session";
- /// Start line number (1-based).
- [JsonPropertyName("start")]
- public long Start { get; set; }
+ /// The approval to add as a session-scoped rule.
+ [JsonPropertyName("approval")]
+ public required UserToolSessionApproval Approval { get; set; }
}
-/// File attachment.
-/// The file variant of .
+/// Permission-decision variant indicating approval was persisted for a project location, with approval details and location key.
+/// The approved-for-location variant of .
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentFile : PushAttachment
+public partial class PermissionDecisionApprovedForLocation : PermissionDecision
{
///
[JsonIgnore]
- public override string Type => "file";
-
- /// User-facing display name for the attachment.
- [JsonPropertyName("displayName")]
- public required string DisplayName { get; set; }
+ public override string Kind => "approved-for-location";
- /// Optional line range to scope the attachment to a specific section of the file.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("lineRange")]
- public PushAttachmentFileLineRange? LineRange { get; set; }
+ /// The approval to persist for this location.
+ [JsonPropertyName("approval")]
+ public required UserToolSessionApproval Approval { get; set; }
- /// Absolute file path.
- [JsonPropertyName("path")]
- public required string Path { get; set; }
+ /// The location key (git root or cwd) to persist the approval to.
+ [JsonPropertyName("locationKey")]
+ public required string LocationKey { get; set; }
}
-/// Directory attachment.
-/// The directory variant of .
+/// Permission-decision variant indicating the request was cancelled before use, with an optional reason.
+/// The cancelled variant of .
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentDirectory : PushAttachment
+public partial class PermissionDecisionCancelled : PermissionDecision
{
///
[JsonIgnore]
- public override string Type => "directory";
-
- /// User-facing display name for the attachment.
- [JsonPropertyName("displayName")]
- public required string DisplayName { get; set; }
+ public override string Kind => "cancelled";
- /// Absolute directory path.
- [JsonPropertyName("path")]
- public required string Path { get; set; }
+ /// Optional explanation of why the request was cancelled.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("reason")]
+ public string? Reason { get; set; }
}
-/// End position of the selection.
+/// Permission-decision variant indicating explicit denial by permission rules, with the matching rules.
+/// The denied-by-rules variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class PushAttachmentSelectionDetailsEnd
+public partial class PermissionDecisionDeniedByRules : PermissionDecision
{
- /// End character offset within the line (0-based).
- [JsonPropertyName("character")]
- public long Character { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "denied-by-rules";
- /// End line number (0-based).
- [JsonPropertyName("line")]
- public long Line { get; set; }
+ /// Rules that denied the request.
+ [JsonPropertyName("rules")]
+ public required IList Rules { get; set; }
}
-/// Start position of the selection.
+/// Permission-decision variant indicating no approval rule matched and user confirmation was unavailable.
+/// The denied-no-approval-rule-and-could-not-request-from-user variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class PushAttachmentSelectionDetailsStart
+public partial class PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser : PermissionDecision
{
- /// Start character offset within the line (0-based).
- [JsonPropertyName("character")]
- public long Character { get; set; }
-
- /// Start line number (0-based).
- [JsonPropertyName("line")]
- public long Line { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "denied-no-approval-rule-and-could-not-request-from-user";
}
-/// Position range of the selection within the file.
+/// Permission-decision variant indicating the user denied an interactive prompt, with optional feedback and force-reject flag.
+/// The denied-interactively-by-user variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class PushAttachmentSelectionDetails
+public partial class PermissionDecisionDeniedInteractivelyByUser : PermissionDecision
{
- /// End position of the selection.
- [JsonPropertyName("end")]
- public PushAttachmentSelectionDetailsEnd End { get => field ??= new(); set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "denied-interactively-by-user";
- /// Start position of the selection.
- [JsonPropertyName("start")]
- public PushAttachmentSelectionDetailsStart Start { get => field ??= new(); set; }
+ /// Optional feedback from the user explaining the denial.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("feedback")]
+ public string? Feedback { get; set; }
+
+ /// Whether to force-reject the current agent turn.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("forceReject")]
+ public bool? ForceReject { get; set; }
}
-/// Code selection attachment from an editor.
-/// The selection variant of .
+/// Permission-decision variant indicating denial by content-exclusion policy, with path and message.
+/// The denied-by-content-exclusion-policy variant of .
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentSelection : PushAttachment
+public partial class PermissionDecisionDeniedByContentExclusionPolicy : PermissionDecision
{
///
[JsonIgnore]
- public override string Type => "selection";
-
- /// User-facing display name for the selection.
- [JsonPropertyName("displayName")]
- public required string DisplayName { get; set; }
-
- /// Absolute path to the file containing the selection.
- [JsonPropertyName("filePath")]
- public required string FilePath { get; set; }
-
- /// Position range of the selection within the file.
- [JsonPropertyName("selection")]
- public required PushAttachmentSelectionDetails Selection { get; set; }
+ public override string Kind => "denied-by-content-exclusion-policy";
- /// The selected text content.
- [JsonPropertyName("text")]
- public required string Text { get; set; }
+ /// Human-readable explanation of why the path was excluded.
+ [JsonPropertyName("message")]
+ public required string Message { get; set; }
+
+ /// File path that triggered the exclusion.
+ [JsonPropertyName("path")]
+ public required string Path { get; set; }
}
-/// GitHub issue, pull request, or discussion reference.
-/// The github_reference variant of .
+/// Permission-decision variant indicating denial by a permission request hook, with optional message and interrupt flag.
+/// The denied-by-permission-request-hook variant of .
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentGitHubReference : PushAttachment
+public partial class PermissionDecisionDeniedByPermissionRequestHook : PermissionDecision
{
///
[JsonIgnore]
- public override string Type => "github_reference";
+ public override string Kind => "denied-by-permission-request-hook";
- /// Issue, pull request, or discussion number.
- [JsonPropertyName("number")]
- public required long Number { get; set; }
+ /// Whether to interrupt the current agent turn.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("interrupt")]
+ public bool? Interrupt { get; set; }
- /// Type of GitHub reference.
- [JsonPropertyName("referenceType")]
- public required PushAttachmentGitHubReferenceType ReferenceType { get; set; }
+ /// Optional message from the hook explaining the denial.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("message")]
+ public string? Message { get; set; }
+}
- /// Current state of the referenced item (e.g., open, closed, merged).
- [JsonPropertyName("state")]
- public required string State { get; set; }
+/// Pending permission request ID and the decision to apply (approve/reject and scope).
+[Experimental(Diagnostics.Experimental)]
+internal sealed class PermissionDecisionRequest
+{
+ /// Request ID of the pending permission request.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
- /// Title of the referenced item.
- [JsonPropertyName("title")]
- public required string Title { get; set; }
+ /// The client's response to the pending permission prompt.
+ [JsonPropertyName("result")]
+ public PermissionDecision Result { get => field ??= new(); set; }
- /// URL to the referenced item on GitHub.
- [JsonPropertyName("url")]
- public required string Url { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Pointer to a GitHub repository.
+/// Pending permission prompt reconstructed from event history, with request ID and user-facing prompt details.
[Experimental(Diagnostics.Experimental)]
-public sealed class PushGitHubRepoRef
+public sealed class PendingPermissionRequest
{
- /// Numeric GitHub repository id.
- [JsonPropertyName("id")]
- public long? Id { get; set; }
+ /// The user-facing permission prompt details (commands, write, read, mcp, url, memory, custom-tool, path, hook).
+ [JsonPropertyName("request")]
+ public PermissionPromptRequest Request { get; set; } = null!;
- /// Repository name (without owner).
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Unique identifier for the pending permission request.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+}
- /// Repository owner login (user or organization).
- [JsonPropertyName("owner")]
- public string Owner { get; set; } = string.Empty;
+/// List of pending permission requests reconstructed from event history.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PendingPermissionRequestList
+{
+ /// Pending permission prompts reconstructed from the session's event history. Equivalent to the set of `permission.requested` events that have not yet been followed by a matching `permission.completed` event. Used by clients (e.g. the CLI) to hydrate UI for prompts that were emitted before the client attached to the session.
+ [JsonPropertyName("items")]
+ public IList Items { get => field ??= []; set; }
}
-/// Pointer to a GitHub commit.
-/// The github_commit variant of .
+/// No parameters; returns currently-pending permission requests for the session.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentGitHubCommit : PushAttachment
+internal sealed class PermissionsPendingRequestsRequest
{
- ///
- [JsonIgnore]
- public override string Type => "github_commit";
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// First line of the commit message.
- [JsonPropertyName("message")]
- public required string Message { get; set; }
+/// Indicates whether the operation succeeded.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionsSetApproveAllResult
+{
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
- /// Full commit SHA.
- [JsonPropertyName("oid")]
- public required string Oid { get; set; }
+/// Allow-all toggle for tool permission requests, with an optional telemetry source.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class PermissionsSetApproveAllRequest
+{
+ /// Whether to auto-approve all tool permission requests.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
- /// Repository the commit belongs to.
- [JsonPropertyName("repo")]
- public required PushGitHubRepoRef Repo { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
- /// URL to the commit on GitHub.
- [JsonPropertyName("url")]
- public required string Url { get; set; }
+ /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers.
+ [JsonPropertyName("source")]
+ public PermissionsSetApproveAllSource? Source { get; set; }
}
-/// Pointer to a GitHub release.
-/// The github_release variant of .
+/// Indicates whether the operation succeeded and reports the post-mutation state.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentGitHubRelease : PushAttachment
+public sealed class AllowAllPermissionSetResult
{
- ///
- [JsonIgnore]
- public override string Type => "github_release";
-
- /// Human-readable release name.
- [JsonPropertyName("name")]
- public required string Name { get; set; }
-
- /// Repository the release belongs to.
- [JsonPropertyName("repo")]
- public required PushGitHubRepoRef Repo { get; set; }
+ /// Authoritative full allow-all state after the mutation.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
- /// Git tag the release is anchored to.
- [JsonPropertyName("tagName")]
- public required string TagName { get; set; }
+ /// Authoritative allow-all mode after the mutation.
+ [JsonPropertyName("mode")]
+ public PermissionsAllowAllMode? Mode { get; set; }
- /// URL to the release on GitHub.
- [JsonPropertyName("url")]
- public required string Url { get; set; }
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
}
-/// Pointer to a GitHub Actions job.
-/// The github_actions_job variant of .
+/// Allow-all mode to apply for the session.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentGitHubActionsJob : PushAttachment
+internal sealed class PermissionsSetAllowAllRequest
{
- ///
- [JsonIgnore]
- public override string Type => "github_actions_job";
+ /// Legacy full allow-all toggle. Prefer `mode`; when `mode` is omitted, `enabled: true` is treated as `mode: "on"` and any other value is treated as `mode: "off"`.
+ [JsonPropertyName("enabled")]
+ public bool? Enabled { get; set; }
- /// Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("conclusion")]
- public string? Conclusion { get; set; }
+ /// Allow-all mode to apply. `on` enables full allow-all; `auto` enables advisory LLM auto-approval; `off` disables both.
+ [JsonPropertyName("mode")]
+ public PermissionsAllowAllMode? Mode { get; set; }
- /// Job id within the workflow run.
- [JsonPropertyName("jobId")]
- public required long JobId { get; set; }
+ /// Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session's active model is used.
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
- /// Display name of the job.
- [JsonPropertyName("jobName")]
- public required string JobName { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
- /// Repository the workflow run belongs to.
- [JsonPropertyName("repo")]
- public required PushGitHubRepoRef Repo { get; set; }
+ /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers.
+ [JsonPropertyName("source")]
+ public PermissionsSetAllowAllSource? Source { get; set; }
+}
- /// URL to the job on GitHub.
- [JsonPropertyName("url")]
- public required string Url { get; set; }
+/// Current allow-all permission mode.
+[Experimental(Diagnostics.Experimental)]
+public sealed class AllowAllPermissionState
+{
+ /// Whether full allow-all permissions are currently active.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
- /// Display name of the workflow the job ran in.
- [JsonPropertyName("workflowName")]
- public required string WorkflowName { get; set; }
+ /// Current allow-all mode.
+ [JsonPropertyName("mode")]
+ public PermissionsAllowAllMode? Mode { get; set; }
}
-/// Pointer to a GitHub repository.
-/// The github_repository variant of .
+/// No parameters.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentGitHubRepository : PushAttachment
+internal sealed class PermissionsGetAllowAllRequest
{
- ///
- [JsonIgnore]
- public override string Type => "github_repository";
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Short description of the repository.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("description")]
- public string? Description { get; set; }
+/// Indicates whether the operation succeeded.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionsModifyRulesResult
+{
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
- /// Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("ref")]
- public string? Ref { get; set; }
+/// Scope and add/remove instructions for modifying session- or location-scoped permission rules.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class PermissionsModifyRulesParams
+{
+ /// Rules to add to the scope. Applied before `remove`/`removeAll`.
+ [JsonPropertyName("add")]
+ public IList? Add { get; set; }
- /// Repository pointer.
- [JsonPropertyName("repo")]
- public required PushGitHubRepoRef Repo { get; set; }
+ /// Specific rules to remove from the scope. Ignored when `removeAll` is true.
+ [JsonPropertyName("remove")]
+ public IList? Remove { get; set; }
- /// URL to the repository on GitHub.
- [JsonPropertyName("url")]
- public required string Url { get; set; }
+ /// When true, removes every rule currently in the scope (after any `add` is applied). Useful for clearing the location scope wholesale.
+ [JsonPropertyName("removeAll")]
+ public bool? RemoveAll { get; set; }
+
+ /// Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file.
+ [JsonPropertyName("scope")]
+ public PermissionsModifyRulesScope Scope { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// One side of a file diff (head or base).
+/// Indicates whether the operation succeeded.
[Experimental(Diagnostics.Experimental)]
-public sealed class PushAttachmentGitHubFileDiffSide
+public sealed class PermissionsSetRequiredResult
{
- /// Repository-relative path to the file.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
- /// Git ref (branch, tag, or commit SHA) the file is read at.
- [JsonPropertyName("ref")]
- public string Ref { get; set; } = string.Empty;
+/// Toggles whether permission prompts should be bridged into session events for this client.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class PermissionsSetRequiredRequest
+{
+ /// Whether the client wants `permission.requested` events bridged from the session-owned permission service. CLI clients that render prompt UI set this to `true` for as long as their listener is mounted; headless callers leave it unset (the default is `false`).
+ [JsonPropertyName("required")]
+ public bool Required { get; set; }
- /// Repository the file lives in.
- [JsonPropertyName("repo")]
- public PushGitHubRepoRef Repo { get => field ??= new(); set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Pointer to a single-file diff. At least one of `head` and `base` must be present.
-/// The github_file_diff variant of .
+/// Indicates whether the operation succeeded.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentGitHubFileDiff : PushAttachment
+public sealed class PermissionsResetSessionApprovalsResult
{
- ///
- [JsonIgnore]
- public override string Type => "github_file_diff";
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
- /// File location on the base side of the diff. Absent for additions.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("base")]
- public PushAttachmentGitHubFileDiffSide? Base { get; set; }
+/// 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; }
- /// File location on the head side of the diff. Absent for deletions.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("head")]
- public PushAttachmentGitHubFileDiffSide? Head { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL).
- [JsonPropertyName("url")]
- public required string Url { get; set; }
+/// Indicates whether the operation succeeded.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionsNotifyPromptShownResult
+{
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
}
-/// One side of a tree comparison (head or base).
+/// Notification payload describing the permission prompt that the client just rendered.
[Experimental(Diagnostics.Experimental)]
-public sealed class PushAttachmentGitHubTreeComparisonSide
+internal sealed class PermissionPromptShownNotification
{
- /// Repository the revision belongs to.
- [JsonPropertyName("repo")]
- public PushGitHubRepoRef Repo { get => field ??= new(); set; }
+ /// Human-readable description of the prompt the user is being asked to approve. Used by the runtime to fire the registered `permission_prompt` notification hook (e.g. terminal bell, desktop notification).
+ [JsonPropertyName("message")]
+ public string Message { get; set; } = string.Empty;
- /// Git revision (branch, tag, or commit SHA).
- [JsonPropertyName("revision")]
- public string Revision { get; set; } = string.Empty;
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Pointer to a comparison between two git revisions.
-/// The github_tree_comparison variant of .
+/// Snapshot of the session's allow-listed directories and primary working directory.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentGitHubTreeComparison : PushAttachment
+public sealed class PermissionPathsList
{
- ///
- [JsonIgnore]
- public override string Type => "github_tree_comparison";
+ /// All directories currently allowed for tool access on this session.
+ [JsonPropertyName("directories")]
+ public IList Directories { get => field ??= []; set; }
- /// Base side of the comparison.
- [JsonPropertyName("base")]
- public required PushAttachmentGitHubTreeComparisonSide Base { get; set; }
+ /// The primary working directory for this session.
+ [JsonPropertyName("primary")]
+ public string Primary { get; set; } = string.Empty;
+}
- /// Head side of the comparison.
- [JsonPropertyName("head")]
- public required PushAttachmentGitHubTreeComparisonSide Head { get; set; }
+/// No parameters; returns the session's allow-listed directories.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class PermissionsPathsListRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// URL to the comparison on GitHub.
- [JsonPropertyName("url")]
- public required string Url { get; set; }
+/// Indicates whether the operation succeeded.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionsPathsAddResult
+{
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
}
-/// Generic GitHub URL reference.
-/// The github_url variant of .
+/// Directory path to add to the session's allowed directories.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentGitHubUrl : PushAttachment
+internal sealed class PermissionPathsAddParams
{
- ///
- [JsonIgnore]
- public override string Type => "github_url";
+ /// Directory to add to the allow-list. The runtime resolves and validates the path before adding.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
- /// URL to the GitHub resource.
- [JsonPropertyName("url")]
- public required string Url { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Pointer to a file in a GitHub repository at a specific ref.
-/// The github_file variant of .
+/// Indicates whether the operation succeeded.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentGitHubFile : PushAttachment
+public sealed class PermissionsPathsUpdatePrimaryResult
{
- ///
- [JsonIgnore]
- public override string Type => "github_file";
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
- /// Repository-relative path to the file.
+/// Directory path to set as the session's new primary working directory.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class PermissionPathsUpdatePrimaryParams
+{
+ /// Directory to set as the new primary working directory for the session's permission policy.
[JsonPropertyName("path")]
- public required string Path { get; set; }
-
- /// Git ref the file is read at (branch, tag, or commit SHA).
- [JsonPropertyName("ref")]
- public required string Ref { get; set; }
-
- /// Repository the file lives in.
- [JsonPropertyName("repo")]
- public required PushGitHubRepoRef Repo { get; set; }
+ public string Path { get; set; } = string.Empty;
- /// URL to the file on GitHub.
- [JsonPropertyName("url")]
- public required string Url { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Pointer to a line range inside a file in a GitHub repository.
-/// The github_snippet variant of .
+/// Indicates whether the supplied path is within the session's allowed directories.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentGitHubSnippet : PushAttachment
+public sealed class PermissionPathsAllowedCheckResult
{
- ///
- [JsonIgnore]
- public override string Type => "github_snippet";
-
- /// Line range the snippet covers.
- [JsonPropertyName("lineRange")]
- public required PushAttachmentFileLineRange LineRange { get; set; }
+ /// Whether the path is within the session's allowed directories.
+ [JsonPropertyName("allowed")]
+ public bool Allowed { get; set; }
+}
- /// Repository-relative path to the file.
+/// Path to evaluate against the session's allowed directories.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class PermissionPathsAllowedCheckParams
+{
+ /// Path to check against the session's allowed directories.
[JsonPropertyName("path")]
- public required string Path { get; set; }
-
- /// Git ref the file is read at (branch, tag, or commit SHA).
- [JsonPropertyName("ref")]
- public required string Ref { get; set; }
+ public string Path { get; set; } = string.Empty;
- /// Repository the file lives in.
- [JsonPropertyName("repo")]
- public required PushGitHubRepoRef Repo { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// URL to the snippet on GitHub (with line anchor).
- [JsonPropertyName("url")]
- public required string Url { get; set; }
+/// Indicates whether the supplied path is within the session's workspace directory.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionPathsWorkspaceCheckResult
+{
+ /// Whether the path is within the session workspace directory.
+ [JsonPropertyName("allowed")]
+ public bool Allowed { get; set; }
}
-/// Blob attachment with inline base64-encoded data.
-/// The blob variant of .
+/// Path to evaluate against the session's workspace (primary) directory.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentBlob : PushAttachment
+internal sealed class PermissionPathsWorkspaceCheckParams
{
- ///
- [JsonIgnore]
- public override string Type => "blob";
+ /// Path to check against the session workspace directory.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
- /// Base64-encoded content.
- [Base64String]
- [JsonPropertyName("data")]
- public required string Data { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// User-facing display name for the attachment.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("displayName")]
- public string? DisplayName { get; set; }
+/// Resolved location-permissions key and type.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PermissionLocationResolveResult
+{
+ /// Location key used in the location-permissions store.
+ [JsonPropertyName("locationKey")]
+ public string LocationKey { get; set; } = string.Empty;
- /// MIME type of the inline data.
- [JsonPropertyName("mimeType")]
- public required string MimeType { get; set; }
+ /// Whether the location is a git repo or directory.
+ [JsonPropertyName("locationType")]
+ public PermissionLocationType LocationType { get; set; }
}
-/// Slim input shape for extension_context attachments; identity fields are runtime-derived.
-/// The extension_context variant of .
+/// Working directory to resolve into a location-permissions key.
[Experimental(Diagnostics.Experimental)]
-public partial class PushAttachmentExtensionContext : PushAttachment
+internal sealed class PermissionLocationResolveParams
{
- ///
- [JsonIgnore]
- public override string Type => "extension_context";
-
- /// Caller-supplied JSON payload (required, may be null but not undefined).
- [JsonPropertyName("payload")]
- public required JsonElement Payload { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
- /// Human-readable composer pill label.
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("title")]
- public required string Title { get; set; }
+ /// Working directory whose permission location should be resolved.
+ [JsonPropertyName("workingDirectory")]
+ public string WorkingDirectory { get; set; } = string.Empty;
}
-/// Parameters for session.extensions.sendAttachmentsToMessage.
+/// Summary of persisted location permissions applied to the session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SendAttachmentsToMessageParams
+public sealed class PermissionLocationApplyResult
{
- /// Attachments to push into the next user-message turn. extension_context entries take the slim shape; standard variants take their full AttachmentSchema shape.
- [JsonPropertyName("attachments")]
- public IList Attachments { get => field ??= []; set; }
+ /// Number of persisted allowed directories added to the live path manager.
+ [JsonPropertyName("appliedDirectoryCount")]
+ public long AppliedDirectoryCount { get; set; }
- /// Optional canvas instance binding the push for provenance. When supplied, the runtime resolves the canvas, verifies it is owned by the calling extension, and stamps canvasId/instanceId onto each extension_context entry. When omitted, no resolution runs and those fields stay unset on the attachment.
- [JsonPropertyName("instanceId")]
- public string? InstanceId { get; set; }
+ /// Number of location-scoped rules added to the live permission service.
+ [JsonPropertyName("appliedRuleCount")]
+ public long AppliedRuleCount { get; set; }
+
+ /// Location-scoped rules applied to the live permission service.
+ [JsonPropertyName("appliedRules")]
+ public IList AppliedRules { get => field ??= []; set; }
+
+ /// Whether a different location was applied since the previous apply call.
+ [JsonPropertyName("changed")]
+ public bool Changed { get; set; }
+
+ /// Location key used in the location-permissions store.
+ [JsonPropertyName("locationKey")]
+ public string LocationKey { get; set; } = string.Empty;
+
+ /// Whether the location is a git repo or directory.
+ [JsonPropertyName("locationType")]
+ public PermissionLocationType LocationType { get; set; }
+}
+/// Working directory to load persisted location permissions for.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class PermissionLocationApplyParams
+{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
+
+ /// Working directory whose persisted location permissions should be applied.
+ [JsonPropertyName("workingDirectory")]
+ public string WorkingDirectory { get; set; } = string.Empty;
}
-/// Indicates whether the external tool call result was handled successfully.
+/// Indicates whether the operation succeeded.
[Experimental(Diagnostics.Experimental)]
-public sealed class HandlePendingToolCallResult
+public sealed class PermissionsLocationsAddToolApprovalResult
{
- /// Whether the tool call result was handled successfully.
+ /// Whether the operation succeeded.
[JsonPropertyName("success")]
public bool Success { get; set; }
}
-/// Pending external tool call request ID, with the tool result or an error describing why it failed.
+/// Tool approval to persist and apply.
+/// Polymorphic base type discriminated by kind.
[Experimental(Diagnostics.Experimental)]
-internal sealed class HandlePendingToolCallRequest
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "kind",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsCommands), "commands")]
+[JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsRead), "read")]
+[JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsWrite), "write")]
+[JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsMcp), "mcp")]
+[JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsMcpSampling), "mcp-sampling")]
+[JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsMemory), "memory")]
+[JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsCustomTool), "custom-tool")]
+[JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsExtensionManagement), "extension-management")]
+[JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess), "extension-permission-access")]
+public partial class PermissionsLocationsAddToolApprovalDetails
{
- /// Error message if the tool call failed.
- [JsonPropertyName("error")]
- public string? Error { get; set; }
+ /// The type discriminator.
+ [JsonPropertyName("kind")]
+ public virtual string Kind { get; set; } = string.Empty;
+}
- /// Request ID of the pending tool call.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
- /// Tool call result (string or expanded result object).
- [JsonPropertyName("result")]
- public JsonElement? Result { get; set; }
+/// Location-persisted tool approval details for specific command identifiers.
+/// The commands variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionsLocationsAddToolApprovalDetailsCommands : PermissionsLocationsAddToolApprovalDetails
+{
+ ///
+ [JsonIgnore]
+ public override string Kind => "commands";
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Command identifiers covered by this approval.
+ [JsonPropertyName("commandIdentifiers")]
+ public required IList CommandIdentifiers { get; set; }
}
-/// Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation.
+/// Location-persisted tool approval details for read-only filesystem operations.
+/// The read variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class ToolsInitializeAndValidateResult
+public partial class PermissionsLocationsAddToolApprovalDetailsRead : PermissionsLocationsAddToolApprovalDetails
{
+ ///
+ [JsonIgnore]
+ public override string Kind => "read";
}
-/// Identifies the target session.
+/// Location-persisted tool approval details for filesystem write operations.
+/// The write variant of .
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionToolsInitializeAndValidateRequest
+public partial class PermissionsLocationsAddToolApprovalDetailsWrite : PermissionsLocationsAddToolApprovalDetails
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Kind => "write";
}
-/// Lightweight metadata for a currently initialized session tool.
+/// Location-persisted tool approval details for an MCP server tool, or all tools when `toolName` is null.
+/// The mcp variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class CurrentToolMetadata
+public partial class PermissionsLocationsAddToolApprovalDetailsMcp : PermissionsLocationsAddToolApprovalDetails
{
- /// Whether the tool is loaded on demand via tool search.
- [JsonPropertyName("deferLoading")]
- public bool? DeferLoading { get; set; }
-
- /// Tool description.
- [JsonPropertyName("description")]
- public string Description { get; set; } = string.Empty;
-
- /// JSON Schema for tool input.
- [JsonPropertyName("input_schema")]
- public IDictionary? InputSchema { get; set; }
-
- /// MCP server name for MCP-backed tools.
- [JsonPropertyName("mcpServerName")]
- public string? McpServerName { get; set; }
-
- /// Raw MCP tool name for MCP-backed tools.
- [JsonPropertyName("mcpToolName")]
- public string? McpToolName { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "mcp";
- /// Model-facing tool name.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// MCP server name.
+ [JsonPropertyName("serverName")]
+ public required string ServerName { get; set; }
- /// Optional MCP/config namespaced tool name.
- [JsonPropertyName("namespacedName")]
- public string? NamespacedName { get; set; }
+ /// MCP tool name, or null to cover every tool on the server.
+ [JsonPropertyName("toolName")]
+ public string? ToolName { get; set; }
}
-/// Current lightweight tool metadata snapshot for the session.
+/// Location-persisted tool approval details for MCP sampling requests from a server.
+/// The mcp-sampling variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class ToolsGetCurrentMetadataResult
+public partial class PermissionsLocationsAddToolApprovalDetailsMcpSampling : PermissionsLocationsAddToolApprovalDetails
{
- /// Current tool metadata, or null when tools have not been initialized yet.
- [JsonPropertyName("tools")]
- public IList? Tools { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "mcp-sampling";
+
+ /// MCP server name.
+ [JsonPropertyName("serverName")]
+ public required string ServerName { get; set; }
}
-/// Identifies the target session.
+/// Location-persisted tool approval details for writes to long-term memory.
+/// The memory variant of .
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionToolsGetCurrentMetadataRequest
+public partial class PermissionsLocationsAddToolApprovalDetailsMemory : PermissionsLocationsAddToolApprovalDetails
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Kind => "memory";
}
-/// Empty result after applying subagent settings.
+/// Location-persisted tool approval details for a custom tool, keyed by tool name.
+/// The custom-tool variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class ToolsUpdateSubagentSettingsResult
+public partial class PermissionsLocationsAddToolApprovalDetailsCustomTool : PermissionsLocationsAddToolApprovalDetails
{
+ ///
+ [JsonIgnore]
+ public override string Kind => "custom-tool";
+
+ /// Custom tool name.
+ [JsonPropertyName("toolName")]
+ public required string ToolName { get; set; }
}
-/// Subagent model, reasoning effort, and context tier settings.
+/// Location-persisted tool approval details for extension-management operations, optionally narrowed by operation.
+/// The extension-management variant of .
[Experimental(Diagnostics.Experimental)]
-public sealed class SubagentSettingsEntry
+public partial class PermissionsLocationsAddToolApprovalDetailsExtensionManagement : PermissionsLocationsAddToolApprovalDetails
{
- /// Context tier override for matching subagents.
- [JsonPropertyName("contextTier")]
- public SubagentSettingsEntryContextTier? ContextTier { get; set; }
-
- /// Reasoning effort override for matching subagents.
- [JsonPropertyName("effortLevel")]
- public string? EffortLevel { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "extension-management";
- /// Model override for matching subagents.
- [JsonPropertyName("model")]
- public string? Model { get; set; }
+ /// Optional operation identifier; when omitted, the approval covers all extension management operations.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("operation")]
+ public string? Operation { get; set; }
}
-/// Configured per-agent subagent overrides.
-public sealed class UpdateSubagentSettingsRequestSubagents
+/// Location-persisted tool approval details for an extension's permission-gated capability access, keyed by extension name.
+/// The extension-permission-access variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess : PermissionsLocationsAddToolApprovalDetails
{
- /// Per-agent settings keyed by subagent agent_type.
- [JsonPropertyName("agents")]
- public IDictionary? Agents { get; set; }
-
- /// Names of subagents the user has turned off; they cannot be dispatched.
- [JsonPropertyName("disabledSubagents")]
- public IList? DisabledSubagents { get; set; }
-
- /// Maximum number of subagents that can run concurrently; applies to usage-based billing users only.
- [JsonPropertyName("maxConcurrency")]
- public int? MaxConcurrency { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Kind => "extension-permission-access";
- /// Maximum subagent nesting depth; applies to usage-based billing users only.
- [JsonPropertyName("maxDepth")]
- public int? MaxDepth { get; set; }
+ /// Extension name.
+ [JsonPropertyName("extensionName")]
+ public required string ExtensionName { get; set; }
}
-/// Subagent settings to apply to the current session.
+/// Location-scoped tool approval to persist.
[Experimental(Diagnostics.Experimental)]
-internal sealed class UpdateSubagentSettingsRequest
+internal sealed class PermissionLocationAddToolApprovalParams
{
+ /// Tool approval to persist and apply.
+ [JsonPropertyName("approval")]
+ public PermissionsLocationsAddToolApprovalDetails Approval { get => field ??= new(); set; }
+
+ /// Location key (git root or cwd) to persist the approval to.
+ [JsonPropertyName("locationKey")]
+ public string LocationKey { get; set; } = string.Empty;
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
-
- /// Subagent settings to apply, or null to clear the live session override.
- [JsonPropertyName("subagents")]
- public UpdateSubagentSettingsRequestSubagents? Subagents { get; set; }
}
-/// Optional filters controlling which command sources to include in the listing.
+/// Folder trust check result.
[Experimental(Diagnostics.Experimental)]
-public sealed class CommandsListRequest
+public sealed class FolderTrustCheckResult
{
- /// Include runtime built-in commands.
- [JsonPropertyName("includeBuiltins")]
- public bool? IncludeBuiltins { get; set; }
-
- /// Include commands registered by protocol clients, including SDK clients and extensions.
- [JsonPropertyName("includeClientCommands")]
- public bool? IncludeClientCommands { get; set; }
-
- /// Include enabled user-invocable skills and commands.
- [JsonPropertyName("includeSkills")]
- public bool? IncludeSkills { get; set; }
+ /// Whether the folder is trusted.
+ [JsonPropertyName("trusted")]
+ public bool Trusted { get; set; }
}
-/// Optional filters controlling which command sources to include in the listing.
+/// Folder path to check for trust.
[Experimental(Diagnostics.Experimental)]
-internal sealed class CommandsListRequestWithSession
+internal sealed class FolderTrustCheckParams
{
- /// Include runtime built-in commands.
- [JsonPropertyName("includeBuiltins")]
- public bool? IncludeBuiltins { get; set; }
-
- /// Include commands registered by protocol clients, including SDK clients and extensions.
- [JsonPropertyName("includeClientCommands")]
- public bool? IncludeClientCommands { get; set; }
-
- /// Include enabled user-invocable skills and commands.
- [JsonPropertyName("includeSkills")]
- public bool? IncludeSkills { get; set; }
+ /// Folder path to check.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection).
-/// Polymorphic base type discriminated by kind.
+/// Indicates whether the operation succeeded.
[Experimental(Diagnostics.Experimental)]
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "kind",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(SlashCommandInvocationResultText), "text")]
-[JsonDerivedType(typeof(SlashCommandInvocationResultAgentPrompt), "agent-prompt")]
-[JsonDerivedType(typeof(SlashCommandInvocationResultCompleted), "completed")]
-[JsonDerivedType(typeof(SlashCommandInvocationResultSelectSubcommand), "select-subcommand")]
-public partial class SlashCommandInvocationResult
+public sealed class PermissionsFolderTrustAddTrustedResult
{
- /// The type discriminator.
- [JsonPropertyName("kind")]
- public virtual string Kind { get; set; } = string.Empty;
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
}
-
-/// Slash-command invocation result containing text output plus Markdown/ANSI rendering flags.
-/// The text variant of .
+/// Folder path to add to trusted folders.
[Experimental(Diagnostics.Experimental)]
-public partial class SlashCommandInvocationResultText : SlashCommandInvocationResult
+internal sealed class FolderTrustAddParams
{
- ///
- [JsonIgnore]
- public override string Kind => "text";
-
- /// Whether text contains Markdown.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("markdown")]
- public bool? Markdown { get; set; }
-
- /// Whether ANSI sequences should be preserved.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("preserveAnsi")]
- public bool? PreserveAnsi { get; set; }
-
- /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("runtimeSettingsChanged")]
- public bool? RuntimeSettingsChanged { get; set; }
+ /// Folder path to mark as trusted.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
- /// Text output for the client to render.
- [JsonPropertyName("text")]
- public required string Text { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Slash-command invocation result that submits an agent prompt, with display prompt, optional mode, optional user-facing notice, and settings-change flag.
-/// The agent-prompt variant of .
+/// Indicates whether the operation succeeded.
[Experimental(Diagnostics.Experimental)]
-public partial class SlashCommandInvocationResultAgentPrompt : SlashCommandInvocationResult
+public sealed class PermissionsUrlsSetUnrestrictedModeResult
{
- ///
- [JsonIgnore]
- public override string Kind => "agent-prompt";
-
- /// Prompt text to display to the user.
- [JsonPropertyName("displayPrompt")]
- public required string DisplayPrompt { get; set; }
-
- /// Optional target session mode for the agent prompt.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("mode")]
- public SessionMode? Mode { get; set; }
-
- /// Optional user-facing notice to show before the prompt is submitted.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("notice")]
- public string? Notice { get; set; }
-
- /// Prompt to submit to the agent.
- [JsonPropertyName("prompt")]
- public required string Prompt { get; set; }
-
- /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("runtimeSettingsChanged")]
- public bool? RuntimeSettingsChanged { get; set; }
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
}
-/// Slash-command invocation result indicating completion, with optional message and settings-change flag.
-/// The completed variant of .
+/// Whether the URL-permission policy should run in unrestricted mode.
[Experimental(Diagnostics.Experimental)]
-public partial class SlashCommandInvocationResultCompleted : SlashCommandInvocationResult
+internal sealed class PermissionUrlsSetUnrestrictedModeParams
{
- ///
- [JsonIgnore]
- public override string Kind => "completed";
-
- /// Optional user-facing message describing the completed command.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("message")]
- public string? Message { get; set; }
+ /// Whether to allow access to all URLs without prompting. Toggles the runtime's URL-permission policy in place.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
- /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("runtimeSettingsChanged")]
- public bool? RuntimeSettingsChanged { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Selectable slash-command subcommand option with name, description, and optional group label.
+/// The repository the remote session targets.
[Experimental(Diagnostics.Experimental)]
-public sealed class SlashCommandSelectSubcommandOption
+public sealed class MetadataSnapshotRemoteMetadataRepository
{
- /// Human-readable description of the subcommand.
- [JsonPropertyName("description")]
- public string Description { get; set; } = string.Empty;
-
- /// Optional group label for organizing options.
- [JsonPropertyName("group")]
- public string? Group { get; set; }
+ /// The branch the remote session is operating on.
+ [JsonPropertyName("branch")]
+ public string Branch { get; set; } = string.Empty;
- /// Subcommand name to invoke.
+ /// The GitHub repository name (without owner).
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
+
+ /// The GitHub owner (user or organization) of the target repository.
+ [JsonPropertyName("owner")]
+ public string Owner { get; set; } = string.Empty;
}
-/// Slash-command invocation result asking the client to present subcommand options for a parent command.
-/// The select-subcommand variant of .
+/// Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session.
[Experimental(Diagnostics.Experimental)]
-public partial class SlashCommandInvocationResultSelectSubcommand : SlashCommandInvocationResult
+public sealed class MetadataSnapshotRemoteMetadata
{
- ///
- [JsonIgnore]
- public override string Kind => "select-subcommand";
-
- /// Parent command name that requires subcommand selection.
- [JsonPropertyName("command")]
- public required string Command { get; set; }
+ /// The pull request number the remote session is associated with, if any.
+ [JsonPropertyName("pullRequestNumber")]
+ public long? PullRequestNumber { get; set; }
- /// Available subcommand options for the client to present.
- [JsonPropertyName("options")]
- public required IList Options { get; set; }
+ /// The repository the remote session targets.
+ [JsonPropertyName("repository")]
+ public MetadataSnapshotRemoteMetadataRepository Repository { get => field ??= new(); set; }
- /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("runtimeSettingsChanged")]
- public bool? RuntimeSettingsChanged { get; set; }
+ /// The original resource identifier (task ID or PR node ID), preserved across event-replay reconstructions. Falls back to `sessionId` when absent.
+ [JsonPropertyName("resourceId")]
+ public string? ResourceId { get; set; }
- /// Human-readable title for the selection UI.
- [JsonPropertyName("title")]
- public required string Title { get; set; }
+ /// Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote` invocation.
+ [JsonPropertyName("taskType")]
+ public MetadataSnapshotRemoteMetadataTaskType? TaskType { get; set; }
}
-/// Slash command name and optional raw input string to invoke.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class CommandsInvokeRequest
+/// Public-facing projection of workspace metadata for SDK / TUI consumers.
+public sealed class SessionMetadataSnapshotWorkspace
{
- /// Raw input after the command name.
- [JsonPropertyName("input")]
- public string? Input { get; set; }
+ /// Branch checked out at session start, if any.
+ [JsonPropertyName("branch")]
+ public string? Branch { get; set; }
- /// Command name. Leading slashes are stripped and the name is matched case-insensitively.
+ /// ISO 8601 timestamp when the workspace was created.
+ [JsonPropertyName("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
+
+ /// Current working directory at session start.
+ [JsonPropertyName("cwd")]
+ public string? Cwd { get; set; }
+
+ /// Resolved git root for cwd, if any.
+ [JsonPropertyName("git_root")]
+ public string? GitRoot { get; set; }
+
+ /// Repository host type, if known.
+ [JsonPropertyName("host_type")]
+ public WorkspaceSummaryHostType? HostType { get; set; }
+
+ /// Workspace identifier (1:1 with sessionId).
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Display name for the session, if set.
[JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ public string? Name { get; set; }
+
+ /// Repository identifier in 'owner/repo' or 'org/project/repo' format, if any.
+ [JsonPropertyName("repository")]
+ public string? Repository { get; set; }
+
+ /// ISO 8601 timestamp when the workspace was last updated.
+ [JsonPropertyName("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Whether the display name was explicitly set by the user.
+ [JsonPropertyName("user_named")]
+ public bool? UserNamed { get; set; }
}
-/// Indicates whether the pending client-handled command was completed successfully.
+/// Point-in-time snapshot of slow-changing session identifier and state fields.
[Experimental(Diagnostics.Experimental)]
-public sealed class CommandsHandlePendingCommandResult
+public sealed class SessionMetadataSnapshot
{
- /// Whether the command was handled successfully.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
-}
+ /// True when the session was detected to be in use by another process at construction time. Local consumers may surface a confirmation prompt before fully attaching. Always false for new sessions.
+ [JsonPropertyName("alreadyInUse")]
+ public bool AlreadyInUse { get; set; }
-/// Pending command request ID and an optional error if the client handler failed.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class CommandsHandlePendingCommandRequest
-{
- /// Error message if the command handler failed.
- [JsonPropertyName("error")]
- public string? Error { get; set; }
+ /// Runtime client name associated with the session (telemetry identifier).
+ [JsonPropertyName("clientName")]
+ public string? ClientName { get; set; }
- /// Request ID from the command invocation event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
+ /// The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot').
+ [JsonPropertyName("currentMode")]
+ public MetadataSnapshotCurrentMode CurrentMode { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// User-provided name supplied at session construction (via `--name`), if any. Immutable after construction.
+ [JsonPropertyName("initialName")]
+ public string? InitialName { get; set; }
-/// Error message produced while executing the command, if any.
-[Experimental(Diagnostics.Experimental)]
-public sealed class ExecuteCommandResult
-{
- /// Error message produced while executing the command, if any. Omitted when the handler succeeded.
- [JsonPropertyName("error")]
- public string? Error { get; set; }
-}
+ /// Whether this is a remote session (i.e., one whose runtime executes elsewhere and is steered through this process).
+ [JsonPropertyName("isRemote")]
+ public bool IsRemote { get; set; }
-/// Slash command name and argument string to execute synchronously.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class ExecuteCommandParams
-{
- /// Argument string to pass to the command (empty string if none).
- [JsonPropertyName("args")]
- public string Args { get; set; } = string.Empty;
+ /// ISO 8601 timestamp of when the session's persisted state was last modified on disk. For new sessions, equals startTime. For resumed sessions, reflects the previous modification time at construction.
+ [JsonPropertyName("modifiedTime")]
+ public DateTimeOffset ModifiedTime { get; set; }
- /// Name of the slash command to invoke (without the leading '/').
- [JsonPropertyName("commandName")]
- public string CommandName { get; set; } = string.Empty;
+ /// Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session.
+ [JsonPropertyName("remoteMetadata")]
+ public MetadataSnapshotRemoteMetadata? RemoteMetadata { get; set; }
- /// Target session identifier.
+ /// Currently selected model identifier, if any.
+ [JsonPropertyName("selectedModel")]
+ public string? SelectedModel { get; set; }
+
+ /// The unique identifier of the session.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
-}
-/// Indicates whether the command was accepted into the local execution queue.
-[Experimental(Diagnostics.Experimental)]
-public sealed class EnqueueCommandResult
-{
- /// True when the command was accepted into the local execution queue. False when the call targets a session that does not support local command queueing (e.g. remote sessions).
- [JsonPropertyName("queued")]
- public bool Queued { get; set; }
-}
+ /// Current session limits, or null when no limits are active.
+ [JsonPropertyName("sessionLimits")]
+ public SessionLimitsConfig? SessionLimits { get; set; }
-/// Slash-prefixed command string to enqueue for FIFO processing.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class EnqueueCommandParams
-{
- /// Slash-prefixed command string to enqueue, e.g. '/compact' or '/model gpt-4'. Queued FIFO with any in-flight items; if the session is idle, processing kicks off immediately.
- [JsonPropertyName("command")]
- public string Command { get; set; } = string.Empty;
+ /// ISO 8601 timestamp of when the session started.
+ [JsonPropertyName("startTime")]
+ public DateTimeOffset StartTime { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Short human-readable summary of the session, if known. Omitted when no summary has been generated.
+ [JsonPropertyName("summary")]
+ public string? Summary { get; set; }
-/// Indicates whether the queued-command response was matched to a pending request.
-[Experimental(Diagnostics.Experimental)]
-public sealed class CommandsRespondToQueuedCommandResult
-{
- /// Whether a pending queued command with the given request ID was found and resolved. False when the request was already resolved, cancelled, or unknown.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
-}
+ /// Absolute path to the session's current working directory.
+ [JsonPropertyName("workingDirectory")]
+ public string WorkingDirectory { get; set; } = string.Empty;
-/// Result of the queued command execution.
-/// Data type discriminated by handled.
-[Experimental(Diagnostics.Experimental)]
-public partial class QueuedCommandResult
-{
- /// The boolean discriminator.
- [JsonPropertyName("handled")]
- public bool Handled { get; set; }
+ /// 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).
+ [JsonPropertyName("workspace")]
+ public SessionMetadataSnapshotWorkspace? Workspace { get; set; }
- /// When true, the runtime will not process subsequent queued commands until a new request comes in.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("stopProcessingQueue")]
- public bool? StopProcessingQueue { get; set; }
+ /// Absolute path to the session's workspace directory on disk, or null if the session has no associated workspace.
+ [JsonPropertyName("workspacePath")]
+ public string? WorkspacePath { get; set; }
}
-/// Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands).
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class CommandsRespondToQueuedCommandRequest
+internal sealed class SessionMetadataSnapshotRequest
{
- /// Request ID from the `command.queued` event the host is responding to.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
-
- /// Result of the queued command execution.
- [JsonPropertyName("result")]
- public QueuedCommandResult Result { get => field ??= new(); set; }
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Telemetry engagement ID for the session, when available.
+/// Indicates whether the local session is currently processing a turn or background continuation.
[Experimental(Diagnostics.Experimental)]
-public sealed class SessionTelemetryEngagement
+public sealed class MetadataIsProcessingResult
{
- /// Current telemetry engagement ID, when available.
- [JsonPropertyName("engagementId")]
- public string? EngagementId { get; set; }
+ /// Whether the session is currently processing user/agent messages. False for non-local sessions (which don't run a local agentic loop). Reflects an in-flight turn or background continuation.
+ [JsonPropertyName("processing")]
+ public bool Processing { get; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionTelemetryGetEngagementIdRequest
+internal sealed class SessionMetadataIsProcessingRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Feature override key/value pairs to attach to subsequent telemetry events from this session.
+/// Current activity flags for the session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class TelemetrySetFeatureOverridesRequest
+public sealed class SessionActivity
{
- /// Override key/value pairs to attach to subsequent telemetry events from this session. Replaces any previously-set overrides.
- [JsonPropertyName("features")]
- public IDictionary Features { get => field ??= new Dictionary(); set; }
-
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Whether an in-flight operation can currently be aborted.
+ [JsonPropertyName("abortable")]
+ public bool Abortable { get; set; }
-/// Transient answer generated from current conversation context.
-[Experimental(Diagnostics.Experimental)]
-public sealed class UIEphemeralQueryResult
-{
- /// Full assistant response text.
- [JsonPropertyName("answer")]
- public string Answer { get; set; } = string.Empty;
+ /// Whether the session currently has active work, including running turns or tasks.
+ [JsonPropertyName("hasActiveWork")]
+ public bool HasActiveWork { get; set; }
}
-/// Transient question to answer without adding it to conversation history.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class UIEphemeralQueryRequest
+internal sealed class SessionMetadataActivityRequest
{
- /// In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Marked internal: excluded from the public SDK surface. Replaced by an explicit cancellation token + cancel RPC in the SDK migration.
- [JsonInclude]
- [JsonPropertyName("abortSignal")]
- internal JsonElement? AbortSignal { get; set; }
-
- /// In-process streaming callback `(text) => void` invoked with each token as the model emits it. Marked internal: excluded from the public SDK surface. In a process-separated SDK this is replaced by a streaming RPC that yields chunks and a final answer.
- [JsonInclude]
- [JsonPropertyName("onChunk")]
- internal JsonElement? OnChunk { get; set; }
-
- /// Question to answer from the current conversation context.
- [JsonPropertyName("question")]
- public string Question { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// The elicitation response (accept with form values, decline, or cancel).
-[Experimental(Diagnostics.Experimental)]
-public sealed class UIElicitationResponse
+/// Token-usage breakdown for the session's current context window.
+public sealed class MetadataContextInfoResultContextInfo
{
- /// The user's response: accept (submitted), decline (rejected), or cancel (dismissed).
- [JsonPropertyName("action")]
- public UIElicitationResponseAction Action { get; set; }
+ /// Output reserve plus tokens after the buffer-exhaustion blocking threshold (default 95%).
+ [JsonPropertyName("bufferTokens")]
+ public long BufferTokens { get; set; }
- /// The form values submitted by the user (present when action is 'accept').
- [JsonPropertyName("content")]
- public IDictionary? Content { get; set; }
-}
+ /// Token count at which background compaction starts (configurable percentage of promptTokenLimit).
+ [JsonPropertyName("compactionThreshold")]
+ public long CompactionThreshold { get; set; }
-/// JSON Schema describing the form fields to present to the user.
-[Experimental(Diagnostics.Experimental)]
-public sealed class UIElicitationSchema
-{
- /// Form field definitions, keyed by field name.
- [JsonPropertyName("properties")]
- public IDictionary Properties { get => field ??= new Dictionary(); set; }
+ /// Tokens consumed by user/assistant/tool messages.
+ [JsonPropertyName("conversationTokens")]
+ public long ConversationTokens { get; set; }
- /// List of required field names.
- [JsonPropertyName("required")]
- public IList? Required { get; set; }
+ /// Prompt token limit plus the model's full output token limit.
+ [JsonPropertyName("limit")]
+ public long Limit { get; set; }
- /// Schema type indicator (always 'object').
- [JsonPropertyName("type")]
- public string Type { get; set; } = string.Empty;
-}
+ /// Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools).
+ [JsonPropertyName("mcpToolsTokens")]
+ public long McpToolsTokens { get; set; }
-/// Prompt message and JSON schema describing the form fields to elicit from the user.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class UIElicitationRequest
-{
- /// Message describing what information is needed from the user.
- [JsonPropertyName("message")]
- public string Message { get; set; } = string.Empty;
+ /// The model used for token counting.
+ [JsonPropertyName("modelName")]
+ public string ModelName { get; set; } = string.Empty;
+
+ /// Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified).
+ [JsonPropertyName("promptTokenLimit")]
+ public long PromptTokenLimit { get; set; }
+
+ /// Tokens consumed by the system prompt.
+ [JsonPropertyName("systemTokens")]
+ public long SystemTokens { get; set; }
- /// JSON Schema describing the form fields to present to the user.
- [JsonPropertyName("requestedSchema")]
- public UIElicitationSchema RequestedSchema { get => field ??= new(); set; }
+ /// Tokens consumed by tool definitions sent to the model (excludes deferred tools).
+ [JsonPropertyName("toolDefinitionsTokens")]
+ public long ToolDefinitionsTokens { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Sum of system, conversation and tool-definition tokens.
+ [JsonPropertyName("totalTokens")]
+ public long TotalTokens { get; set; }
}
-/// Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
+/// Token breakdown for the session's current context window, or null if uninitialized.
[Experimental(Diagnostics.Experimental)]
-public sealed class UIElicitationResult
+public sealed class MetadataContextInfoResult
{
- /// Whether the response was accepted. False if the request was already resolved by another client.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Token breakdown for the current context window, or null if the session has not yet been initialized (no system prompt or tool metadata cached).
+ [JsonPropertyName("contextInfo")]
+ public MetadataContextInfoResultContextInfo? ContextInfo { get; set; }
}
-/// Pending elicitation request ID and the user's response (accept/decline/cancel + form values).
+/// Model identifier and token limits used to compute the context-info breakdown.
[Experimental(Diagnostics.Experimental)]
-internal sealed class UIHandlePendingElicitationRequest
+internal sealed class MetadataContextInfoRequest
{
- /// The unique request ID from the elicitation.requested event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
+ /// Maximum output tokens allowed by the target model. Pass 0 if unknown.
+ [JsonPropertyName("outputTokenLimit")]
+ public long OutputTokenLimit { get; set; }
- /// The elicitation response (accept with form values, decline, or cancel).
- [JsonPropertyName("result")]
- public UIElicitationResponse Result { get => field ??= new(); set; }
+ /// Maximum prompt tokens allowed by the target model. Pass 0 to use the runtime default.
+ [JsonPropertyName("promptTokenLimit")]
+ public long PromptTokenLimit { get; set; }
+
+ /// Model identifier used for tokenization. Omit to use the session default. Used both for token counting and to compute display values.
+ [JsonPropertyName("selectedModel")]
+ public string? SelectedModel { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the pending UI request was resolved by this call.
-[Experimental(Diagnostics.Experimental)]
-public sealed class UIHandlePendingResult
+/// Successful compaction history for the session.
+public sealed class MetadataContextAttributionResultContextAttributionCompactions
{
- /// True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Number of successful compactions in this session.
+ [JsonPropertyName("count")]
+ public long Count { get; set; }
}
-/// User response for a pending user-input request, with answer text and whether it was typed freeform.
-[Experimental(Diagnostics.Experimental)]
-public sealed class UIUserInputResponse
+/// RPC data type for MetadataContextAttributionResultContextAttributionEntry operations.
+public sealed class MetadataContextAttributionResultContextAttributionEntry
{
- /// The user's answer text.
- [JsonPropertyName("answer")]
- public string Answer { get; set; } = string.Empty;
+ /// Supplementary per-entry metadata (e.g. `messageCount`, `role`, `evictable`, `pluginSource`). Values are stringified; parse as needed and ignore unrecognized keys.
+ [JsonPropertyName("attributes")]
+ public IDictionary? Attributes { get; set; }
- /// True if the user typed a freeform response, false if they selected a presented choice. Used by telemetry to differentiate between free text input and choice selection.
- [JsonPropertyName("wasFreeform")]
- public bool WasFreeform { get; set; }
+ /// Identifier for this entry, formed by joining its `kind` and source name (e.g. `tool:bash`, `skill:tmux`, `toolDefinition:bash`); unique within the snapshot. Use it to match the same entry across snapshots, to correlate with other APIs (skill/agent/MCP registries), and as the `parentId` target for nesting. Distinct from the human-facing `label`.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Source category for this entry. Not a closed set — tolerate unknown values. Known values today: `skill`, `subagent`, `mcpServer`, `tool`, `system`, `toolDefinition`, `plugin`.
+ [JsonPropertyName("kind")]
+ public string Kind { get; set; } = string.Empty;
+
+ /// Human-readable display label, e.g. `bash` or `skill: tmux`. Presentation-only; may be localized/reformatted without notice — do not key off it.
+ [JsonPropertyName("label")]
+ public string Label { get; set; } = string.Empty;
+
+ /// Optional `id` of the parent entry: e.g. a `plugin` entry parenting its `skill`/`mcpServer` entries, or the `system` entry parenting `toolDefinition` entries. Omitted for top-level entries.
+ [JsonPropertyName("parentId")]
+ public string? ParentId { get; set; }
+
+ /// Token count currently in context attributable to this entry.
+ [JsonPropertyName("tokens")]
+ public long Tokens { get; set; }
}
-/// Request ID of a pending `user_input.requested` event and the user's response.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class UIHandlePendingUserInputRequest
+/// Per-source token attribution snapshot for the current context window. The heaviest individual messages are available separately via `metadata.getContextHeaviestMessages`.
+public sealed class MetadataContextAttributionResultContextAttribution
{
- /// The unique request ID from the user_input.requested event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
+ /// Successful compaction history for the session.
+ [JsonPropertyName("compactions")]
+ public MetadataContextAttributionResultContextAttributionCompactions Compactions { get => field ??= new(); set; }
- /// User response for a pending user-input request, with answer text and whether it was typed freeform.
- [JsonPropertyName("response")]
- public UIUserInputResponse Response { get => field ??= new(); set; }
+ /// Flat list of per-source attribution entries. Group by `kind` and render unrecognized kinds generically. Nesting and rollups are expressed via `parentId`.
+ [JsonPropertyName("entries")]
+ public IList Entries { get => field ??= []; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Total token count of the current context window the entries are measured against (system message + conversation messages + tool definitions — the same total reported by /context). Divide an entry's `tokens` by this to derive its share.
+ [JsonPropertyName("totalTokens")]
+ public long TotalTokens { get; set; }
}
-/// Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result.
+/// Per-source attribution breakdown for the session's current context window, or null if uninitialized.
[Experimental(Diagnostics.Experimental)]
-public sealed class UIHandlePendingSamplingResponse
+public sealed class MetadataContextAttributionResult
{
+ /// Per-source context-window attribution, or null if the session has not yet been initialized (no system prompt or tool metadata cached).
+ [JsonPropertyName("contextAttribution")]
+ public MetadataContextAttributionResultContextAttribution? ContextAttribution { get; set; }
}
-/// Request ID of a pending `sampling.requested` event and an optional sampling result payload (omit to reject).
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class UIHandlePendingSamplingRequest
+internal sealed class SessionMetadataGetContextAttributionRequest
{
- /// The unique request ID from the sampling.requested event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
-
- /// Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result.
- [JsonPropertyName("response")]
- public UIHandlePendingSamplingResponse? Response { get; set; }
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Request ID of a pending `auto_mode_switch.requested` event and the user's response.
+/// A single large message currently in context.
[Experimental(Diagnostics.Experimental)]
-internal sealed class UIHandlePendingAutoModeSwitchRequest
+public sealed class ContextHeaviestMessage
{
- /// The unique request ID from the auto_mode_switch.requested event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
+ /// Stable identifier for this message within the snapshot.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
- /// User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline).
- [JsonPropertyName("response")]
- public UIAutoModeSwitchResponse Response { get; set; }
+ /// Human-readable source label, e.g. `tool: bash` or `skill: tmux`. Presentation-only.
+ [JsonPropertyName("label")]
+ public string Label { get; set; } = string.Empty;
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Role of the chat message (`user`, `assistant`, or `tool`).
+ [JsonPropertyName("role")]
+ public string Role { get; set; } = string.Empty;
+
+ /// Token count currently in context for this individual message.
+ [JsonPropertyName("tokens")]
+ public long Tokens { get; set; }
}
-/// The user's selected action for an exhausted session limit.
+/// The heaviest individual messages in the session's context window, most-expensive first.
[Experimental(Diagnostics.Experimental)]
-public sealed class UISessionLimitsExhaustedResponse
+public sealed class MetadataContextHeaviestMessagesResult
{
- /// Action selected by the user.
- [JsonPropertyName("action")]
- public UISessionLimitsExhaustedResponseAction Action { get; set; }
-
- /// AI Credits to add to the current max when action is 'add'.
- [JsonPropertyName("additionalAiCredits")]
- public double? AdditionalAiCredits { get; set; }
+ /// Heaviest messages, most-expensive first.
+ [JsonPropertyName("messages")]
+ public IList Messages { get => field ??= []; set; }
- /// New absolute max AI Credits when action is 'set'.
- [JsonPropertyName("maxAiCredits")]
- public double? MaxAiCredits { get; set; }
+ /// Total token count of the current context window, so callers can compute each message's share without a second call.
+ [JsonPropertyName("totalTokens")]
+ public long TotalTokens { get; set; }
}
-/// Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action.
+/// Parameters for the heaviest-messages query.
[Experimental(Diagnostics.Experimental)]
-internal sealed class UIHandlePendingSessionLimitsExhaustedRequest
+internal sealed class MetadataContextHeaviestMessagesRequest
{
- /// The unique request ID from the session_limits_exhausted.requested event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
-
- /// The selected session-limit action.
- [JsonPropertyName("response")]
- public UISessionLimitsExhaustedResponse Response { get => field ??= new(); set; }
+ /// Maximum number of messages to return, most-expensive first. Omit for the server default.
+ [JsonPropertyName("limit")]
+ public long? Limit { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// User response for a pending exit-plan-mode request, with approval state, selected action, auto-approve flag, and feedback.
+/// Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead.
[Experimental(Diagnostics.Experimental)]
-public sealed class UIExitPlanModeResponse
+public sealed class MetadataRecordContextChangeResult
{
- /// Whether the plan was approved.
- [JsonPropertyName("approved")]
- public bool Approved { get; set; }
-
- /// Whether subsequent edits should be auto-approved without confirmation.
- [JsonPropertyName("autoApproveEdits")]
- public bool? AutoApproveEdits { get; set; }
-
- /// Feedback from the user when they declined the plan or requested changes.
- [JsonPropertyName("feedback")]
- public string? Feedback { get; set; }
-
- /// The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'.
- [JsonPropertyName("selectedAction")]
- public UIExitPlanModeAction? SelectedAction { get; set; }
}
-/// Request ID of a pending `exit_plan_mode.requested` event and the user's response.
+/// Updated working directory and git context. Emitted as the new payload of `session.context_changed`.
[Experimental(Diagnostics.Experimental)]
-internal sealed class UIHandlePendingExitPlanModeRequest
+public sealed class SessionWorkingDirectoryContext
{
- /// The unique request ID from the exit_plan_mode.requested event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
+ /// Merge-base commit SHA (fork point from the remote default branch).
+ [JsonPropertyName("baseCommit")]
+ public string? BaseCommit { get; set; }
- /// User response for a pending exit-plan-mode request, with approval state, selected action, auto-approve flag, and feedback.
- [JsonPropertyName("response")]
- public UIExitPlanModeResponse Response { get => field ??= new(); set; }
+ /// Current git branch name.
+ [JsonPropertyName("branch")]
+ public string? Branch { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Current working directory path.
+ [JsonPropertyName("cwd")]
+ public string Cwd { get; set; } = string.Empty;
-/// Register an in-process handler for `auto_mode_switch.requested` events. The caller still attaches the actual listener via the standard event-subscription mechanism; this registration solely tells the server bridge to skip its own dispatch (so a remote client doesn't race the in-process handler for the same requestId).
-[Experimental(Diagnostics.Experimental)]
-public sealed class UIRegisterDirectAutoModeSwitchHandlerResult
-{
- /// Opaque handle representing the registration. Pass this same handle to `unregisterDirectAutoModeSwitchHandler` when the in-process handler is no longer active. Multiple registrations are reference-counted; the server bridge will only dispatch auto-mode-switch requests when no handles are active.
- [JsonPropertyName("handle")]
- public string Handle { get; set; } = string.Empty;
+ /// Root directory of the git repository, resolved via git rev-parse.
+ [JsonPropertyName("gitRoot")]
+ public string? GitRoot { get; set; }
+
+ /// Head commit of the current git branch.
+ [JsonPropertyName("headCommit")]
+ public string? HeadCommit { get; set; }
+
+ /// Hosting platform type of the repository.
+ [JsonPropertyName("hostType")]
+ public SessionWorkingDirectoryContextHostType? HostType { get; set; }
+
+ /// Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps).
+ [JsonPropertyName("repository")]
+ public string? Repository { get; set; }
+
+ /// Raw host string from the git remote URL (e.g. "github.com", "dev.azure.com").
+ [JsonPropertyName("repositoryHost")]
+ public string? RepositoryHost { get; set; }
}
-/// Identifies the target session.
+/// Updated working-directory/git context to record on the session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionUiRegisterDirectAutoModeSwitchHandlerRequest
+internal sealed class MetadataRecordContextChangeRequest
{
+ /// Updated working directory and git context. Emitted as the new payload of `session.context_changed`.
+ [JsonPropertyName("context")]
+ public SessionWorkingDirectoryContext Context { get => field ??= new(); set; }
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the handle was active and the registration count was decremented.
+/// Update the session's working directory. Used by the host when the user explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for any related side-effects (file index, etc.); it does NOT change the process working directory (a session's cwd is per-session, not process-global). For local sessions the runtime validates the target first (an absolute path that exists on disk) and re-bases the permission primary directory; a rejected validation fails the call before anything is mutated, persisted, or emitted. Location-scoped permission rules are then re-keyed to the new directory (best-effort). Remote sessions only record the path.
[Experimental(Diagnostics.Experimental)]
-public sealed class UIUnregisterDirectAutoModeSwitchHandlerResult
+public sealed class MetadataSetWorkingDirectoryResult
{
- /// True if the handle was active and decremented the counter; false if the handle was unknown.
- [JsonPropertyName("unregistered")]
- public bool Unregistered { get; set; }
+ /// Working directory after the update.
+ [JsonPropertyName("workingDirectory")]
+ public string WorkingDirectory { get; set; } = string.Empty;
}
-/// Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release.
+/// Absolute path to set as the session's new working directory. For local sessions the path must be absolute and exist on disk: it is validated before any session state changes, and a failing validation rejects the call with nothing mutated, persisted, or emitted. Remote sessions record the path as-is.
[Experimental(Diagnostics.Experimental)]
-internal sealed class UIUnregisterDirectAutoModeSwitchHandlerRequest
+internal sealed class MetadataSetWorkingDirectoryRequest
{
- /// Handle previously returned by `registerDirectAutoModeSwitchHandler`.
- [JsonPropertyName("handle")]
- public string Handle { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
+
+ /// Absolute path to set as the session's working directory. The runtime updates the session's recorded cwd so subsequent operations (shell tools, file lookups, telemetry) anchor to it.
+ [JsonPropertyName("workingDirectory")]
+ public string WorkingDirectory { get; set; } = string.Empty;
}
-/// Indicates whether the operation succeeded.
+/// Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.context_info_changed` events. Returns zeros for an empty session.
[Experimental(Diagnostics.Experimental)]
-public sealed class PermissionsConfigureResult
+public sealed class MetadataRecomputeContextTokensResult
{
- /// Whether the operation succeeded.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Tokens contributed by user/assistant/tool messages (excludes system/developer prompts).
+ [JsonPropertyName("messagesTokenCount")]
+ public long MessagesTokenCount { get; set; }
+
+ /// Tokens contributed by system/developer prompt snapshots.
+ [JsonPropertyName("systemTokenCount")]
+ public long SystemTokenCount { get; set; }
+
+ /// Sum of tokens across chat-context and system-context messages currently held by the session.
+ [JsonPropertyName("totalTokens")]
+ public long TotalTokens { get; set; }
}
-/// Source descriptor for a `session.permissions.configure` content-exclusion rule, with source name and type.
+/// Model identifier to use when re-tokenizing the session's existing messages.
[Experimental(Diagnostics.Experimental)]
-public sealed class PermissionsConfigureAdditionalContentExclusionPolicyRuleSource
+internal sealed class MetadataRecomputeContextTokensRequest
{
- /// Gets or sets the name value.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Model identifier used for tokenization. The runtime token-counts both chat-context and system-context messages against this model.
+ [JsonPropertyName("modelId")]
+ public string ModelId { get; set; } = string.Empty;
- /// Gets or sets the type value.
- [JsonPropertyName("type")]
- public string Type { get; set; } = string.Empty;
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Single content-exclusion rule supplied to `session.permissions.configure`, with paths, match conditions, and source.
+/// Availability of built-in job tools surfaced to boundary consumers.
[Experimental(Diagnostics.Experimental)]
-public sealed class PermissionsConfigureAdditionalContentExclusionPolicyRule
+public sealed class SessionSettingsBuiltInToolAvailabilitySnapshot
{
- /// Gets or sets the ifAnyMatch value.
- [JsonPropertyName("ifAnyMatch")]
- public IList? IfAnyMatch { get; set; }
-
- /// Gets or sets the ifNoneMatch value.
- [JsonPropertyName("ifNoneMatch")]
- public IList? IfNoneMatch { get; set; }
-
- /// Gets or sets the paths value.
- [JsonPropertyName("paths")]
- public IList Paths { get => field ??= []; set; }
+ /// Gets or sets the createPullRequest value.
+ [JsonPropertyName("createPullRequest")]
+ public bool? CreatePullRequest { get; set; }
- /// Source descriptor for a `session.permissions.configure` content-exclusion rule, with source name and type.
- [JsonPropertyName("source")]
- public PermissionsConfigureAdditionalContentExclusionPolicyRuleSource Source { get => field ??= new(); set; }
+ /// Gets or sets the reportProgress value.
+ [JsonPropertyName("reportProgress")]
+ public bool? ReportProgress { get; set; }
}
-/// Content-exclusion policy supplied to `session.permissions.configure`, with rules, last-updated data, and scope.
+/// Redacted job settings for a session. The job nonce is excluded.
[Experimental(Diagnostics.Experimental)]
-public sealed class PermissionsConfigureAdditionalContentExclusionPolicy
+public sealed class SessionSettingsJobSnapshot
{
- /// Gets or sets the last_updated_at value.
- [JsonPropertyName("last_updated_at")]
- public JsonElement LastUpdatedAt { get; set; }
+ /// Gets or sets the builtInToolAvailability value.
+ [JsonPropertyName("builtInToolAvailability")]
+ public SessionSettingsBuiltInToolAvailabilitySnapshot? BuiltInToolAvailability { get; set; }
- /// Gets or sets the rules value.
- [JsonPropertyName("rules")]
- public IList Rules { get => field ??= []; set; }
+ /// Gets or sets the eventType value.
+ [JsonPropertyName("eventType")]
+ public string? EventType { get; set; }
- /// Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration.
- [JsonPropertyName("scope")]
- public PermissionsConfigureAdditionalContentExclusionPolicyScope Scope { get; set; }
+ /// Gets or sets the isTriggerJob value.
+ [JsonPropertyName("isTriggerJob")]
+ public bool? IsTriggerJob { get; set; }
}
-/// If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged.
+/// Redacted model routing settings for a session.
[Experimental(Diagnostics.Experimental)]
-public sealed class PermissionPathsConfig
+public sealed class SessionSettingsModelSnapshot
{
- /// Additional directories to allow tool access to (in addition to the session's working directory). When `unrestricted` is true, these are still pre-populated on the UnrestrictedPathManager so they remain visible via getDirectories() (e.g. for @-mention completion).
- [JsonPropertyName("additionalDirectories")]
- public IList? AdditionalDirectories { get; set; }
+ /// Gets or sets the callbackUrl value.
+ [JsonPropertyName("callbackUrl")]
+ public string? CallbackUrl { get; set; }
- /// Whether to include the system temp directory in the allowed list (defaults to true). Ignored when `unrestricted` is true.
- [JsonPropertyName("includeTempDirectory")]
- public bool? IncludeTempDirectory { get; set; }
+ /// Gets or sets the defaultReasoningEffort value.
+ [JsonPropertyName("defaultReasoningEffort")]
+ public string? DefaultReasoningEffort { get; set; }
- /// If true, the runtime allows access to all paths without prompting. Equivalent to constructing an UnrestrictedPathManager.
- [JsonPropertyName("unrestricted")]
- public bool? Unrestricted { get; set; }
+ /// Gets or sets the instanceId value.
+ [JsonPropertyName("instanceId")]
+ public string? InstanceId { get; set; }
- /// Workspace root path (special-cased to be allowed even before the directory exists). Ignored when `unrestricted` is true.
- [JsonPropertyName("workspacePath")]
- public string? WorkspacePath { get; set; }
+ /// Gets or sets the model value.
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
}
-/// If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged.
+/// Online-evaluation settings safe to expose across the SDK boundary.
[Experimental(Diagnostics.Experimental)]
-public sealed class PermissionRulesSet
+public sealed class SessionSettingsOnlineEvaluationSnapshot
{
- /// Rules that auto-approve matching requests.
- [JsonPropertyName("approved")]
- public IList Approved { get => field ??= []; set; }
+ /// Gets or sets the disableOnlineEvaluation value.
+ [JsonPropertyName("disableOnlineEvaluation")]
+ public bool? DisableOnlineEvaluation { get; set; }
- /// Rules that auto-deny matching requests.
- [JsonPropertyName("denied")]
- public IList Denied { get => field ??= []; set; }
+ /// Gets or sets the enableOnlineEvaluationOutputFile value.
+ [JsonPropertyName("enableOnlineEvaluationOutputFile")]
+ public bool? EnableOnlineEvaluationOutputFile { get; set; }
}
-/// If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged.
+/// Redacted repository and GitHub host settings for a session.
[Experimental(Diagnostics.Experimental)]
-public sealed class PermissionUrlsConfig
+public sealed class SessionSettingsRepoSnapshot
{
- /// Initial list of allowed URL/domain patterns. Patterns may include path components. Ignored when `unrestricted` is true.
- [JsonPropertyName("initialAllowed")]
- public IList? InitialAllowed { get; set; }
-
- /// If true, the runtime allows access to all URLs without prompting. Initial allow-list is ignored when this is true.
- [JsonPropertyName("unrestricted")]
- public bool? Unrestricted { get; set; }
-}
+ /// Gets or sets the branch value.
+ [JsonPropertyName("branch")]
+ public string? Branch { get; set; }
-/// Patch of permission policy fields to apply (omit a field to leave it unchanged).
-[Experimental(Diagnostics.Experimental)]
-internal sealed class PermissionsConfigureParams
-{
- /// If specified, replaces the host-supplied GitHub Content Exclusion policies on the session (combined with natively-discovered policies when evaluating tool/file access). Omit to leave the current policies unchanged.
- [JsonPropertyName("additionalContentExclusionPolicies")]
- public IList? AdditionalContentExclusionPolicies { get; set; }
+ /// Gets or sets the commit value.
+ [JsonPropertyName("commit")]
+ public string? Commit { get; set; }
- /// If specified, sets whether path/URL read permission requests are auto-approved. Omit to leave the current value unchanged.
- [JsonPropertyName("approveAllReadPermissionRequests")]
- public bool? ApproveAllReadPermissionRequests { get; set; }
+ /// Gets or sets the host value.
+ [JsonPropertyName("host")]
+ public string? Host { get; set; }
- /// If specified, sets whether tool permission requests are auto-approved without prompting. Omit to leave the current value unchanged.
- [JsonPropertyName("approveAllToolPermissionRequests")]
- public bool? ApproveAllToolPermissionRequests { get; set; }
+ /// Gets or sets the hostProtocol value.
+ [JsonPropertyName("hostProtocol")]
+ public string? HostProtocol { get; set; }
- /// If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged.
- [JsonPropertyName("paths")]
- public PermissionPathsConfig? Paths { get; set; }
+ /// Gets or sets the id value.
+ [JsonPropertyName("id")]
+ public double? Id { get; set; }
- /// If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged.
- [JsonPropertyName("rules")]
- public PermissionRulesSet? Rules { get; set; }
+ /// Gets or sets the name value.
+ [JsonPropertyName("name")]
+ public string? Name { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Gets or sets the ownerId value.
+ [JsonPropertyName("ownerId")]
+ public double? OwnerId { get; set; }
- /// If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged.
- [JsonPropertyName("urls")]
- public PermissionUrlsConfig? Urls { get; set; }
-}
+ /// Gets or sets the ownerName value.
+ [JsonPropertyName("ownerName")]
+ public string? OwnerName { get; set; }
-/// Indicates whether the permission decision was applied; false when the request was already resolved.
-[Experimental(Diagnostics.Experimental)]
-public sealed class PermissionRequestResult
-{
- /// Whether the permission request was handled successfully.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
-}
+ /// Gets or sets the prCommitCount value.
+ [JsonPropertyName("prCommitCount")]
+ public double? PrCommitCount { get; set; }
-/// The client's response to the pending permission prompt.
-/// Polymorphic base type discriminated by kind.
-[Experimental(Diagnostics.Experimental)]
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "kind",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(PermissionDecisionApproveOnce), "approve-once")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSession), "approve-for-session")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocation), "approve-for-location")]
-[JsonDerivedType(typeof(PermissionDecisionApprovePermanently), "approve-permanently")]
-[JsonDerivedType(typeof(PermissionDecisionReject), "reject")]
-[JsonDerivedType(typeof(PermissionDecisionUserNotAvailable), "user-not-available")]
-[JsonDerivedType(typeof(PermissionDecisionApproved), "approved")]
-[JsonDerivedType(typeof(PermissionDecisionApprovedForSession), "approved-for-session")]
-[JsonDerivedType(typeof(PermissionDecisionApprovedForLocation), "approved-for-location")]
-[JsonDerivedType(typeof(PermissionDecisionCancelled), "cancelled")]
-[JsonDerivedType(typeof(PermissionDecisionDeniedByRules), "denied-by-rules")]
-[JsonDerivedType(typeof(PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser), "denied-no-approval-rule-and-could-not-request-from-user")]
-[JsonDerivedType(typeof(PermissionDecisionDeniedInteractivelyByUser), "denied-interactively-by-user")]
-[JsonDerivedType(typeof(PermissionDecisionDeniedByContentExclusionPolicy), "denied-by-content-exclusion-policy")]
-[JsonDerivedType(typeof(PermissionDecisionDeniedByPermissionRequestHook), "denied-by-permission-request-hook")]
-public partial class PermissionDecision
-{
- /// The type discriminator.
- [JsonPropertyName("kind")]
- public virtual string Kind { get; set; } = string.Empty;
-}
+ /// Gets or sets the readWrite value.
+ [JsonPropertyName("readWrite")]
+ public bool? ReadWrite { get; set; }
+ /// Gets or sets the secretScanningUrl value.
+ [JsonPropertyName("secretScanningUrl")]
+ public string? SecretScanningUrl { get; set; }
-/// Permission-decision request variant to approve only the current permission request.
-/// The approve-once variant of .
-[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveOnce : PermissionDecision
-{
- ///
- [JsonIgnore]
- public override string Kind => "approve-once";
+ /// Gets or sets the serverUrl value.
+ [JsonPropertyName("serverUrl")]
+ public string? ServerUrl { get; set; }
}
-/// Session-scoped approval to remember (tool prompts only; omitted for path/url prompts).
-/// Polymorphic base type discriminated by kind.
+/// Redacted validation and memory-tool settings for a session.
[Experimental(Diagnostics.Experimental)]
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "kind",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalCommands), "commands")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalRead), "read")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalWrite), "write")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMcp), "mcp")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMcpSampling), "mcp-sampling")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMemory), "memory")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalCustomTool), "custom-tool")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalExtensionManagement), "extension-management")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess), "extension-permission-access")]
-public partial class PermissionDecisionApproveForSessionApproval
+public sealed class SessionSettingsValidationSnapshot
{
- /// The type discriminator.
- [JsonPropertyName("kind")]
- public virtual string Kind { get; set; } = string.Empty;
-}
+ /// Gets or sets the advisoryEnabled value.
+ [JsonPropertyName("advisoryEnabled")]
+ public bool? AdvisoryEnabled { get; set; }
+ /// Gets or sets the codeqlEnabled value.
+ [JsonPropertyName("codeqlEnabled")]
+ public bool? CodeqlEnabled { get; set; }
-/// Session-scoped approval details for specific command identifiers.
-/// The commands variant of .
-[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForSessionApprovalCommands : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "commands";
+ /// Gets or sets the codeReviewEnabled value.
+ [JsonPropertyName("codeReviewEnabled")]
+ public bool? CodeReviewEnabled { get; set; }
- /// Command identifiers covered by this approval.
- [JsonPropertyName("commandIdentifiers")]
- public required IList CommandIdentifiers { get; set; }
-}
+ /// Gets or sets the codeReviewModel value.
+ [JsonPropertyName("codeReviewModel")]
+ public string? CodeReviewModel { get; set; }
-/// Session-scoped approval details for read-only filesystem operations.
-/// The read variant of .
-[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForSessionApprovalRead : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "read";
-}
+ /// Gets or sets the dependabotTimeout value.
+ [JsonPropertyName("dependabotTimeout")]
+ public double? DependabotTimeout { get; set; }
-/// Session-scoped approval details for filesystem write operations.
-/// The write variant of .
-[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForSessionApprovalWrite : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "write";
+ /// Gets or sets the memoryStoreEnabled value.
+ [JsonPropertyName("memoryStoreEnabled")]
+ public bool? MemoryStoreEnabled { get; set; }
+
+ /// Gets or sets the memoryVoteEnabled value.
+ [JsonPropertyName("memoryVoteEnabled")]
+ public bool? MemoryVoteEnabled { get; set; }
+
+ /// Gets or sets the secretScanningEnabled value.
+ [JsonPropertyName("secretScanningEnabled")]
+ public bool? SecretScanningEnabled { get; set; }
+
+ /// Gets or sets the timeout value.
+ [JsonPropertyName("timeout")]
+ public double? Timeout { get; set; }
}
-/// Session-scoped approval details for an MCP server tool, or all tools on the server when `toolName` is null.
-/// The mcp variant of .
+/// Redacted, serializable view of session runtime settings for SDK boundary consumers. Secrets and raw feature flags are intentionally excluded.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForSessionApprovalMcp : PermissionDecisionApproveForSessionApproval
+internal sealed class SessionSettingsSnapshot
{
- ///
- [JsonIgnore]
- public override string Kind => "mcp";
+ /// Gets or sets the clientName value.
+ [JsonPropertyName("clientName")]
+ public string? ClientName { get; set; }
- /// MCP server name.
- [JsonPropertyName("serverName")]
- public required string ServerName { get; set; }
+ /// Gets or sets the job value.
+ [JsonPropertyName("job")]
+ public SessionSettingsJobSnapshot Job { get => field ??= new(); set; }
- /// MCP tool name, or null to cover every tool on the server.
- [JsonPropertyName("toolName")]
- public string? ToolName { get; set; }
+ /// Gets or sets the model value.
+ [JsonPropertyName("model")]
+ public SessionSettingsModelSnapshot Model { get => field ??= new(); set; }
+
+ /// Gets or sets the onlineEvaluation value.
+ [JsonPropertyName("onlineEvaluation")]
+ public SessionSettingsOnlineEvaluationSnapshot OnlineEvaluation { get => field ??= new(); set; }
+
+ /// Gets or sets the repo value.
+ [JsonPropertyName("repo")]
+ public SessionSettingsRepoSnapshot Repo { get => field ??= new(); set; }
+
+ /// Gets or sets the startTimeMs value.
+ [JsonPropertyName("startTimeMs")]
+ public double? StartTimeMs { get; set; }
+
+ /// Gets or sets the timeoutMs value.
+ [JsonPropertyName("timeoutMs")]
+ public double? TimeoutMs { get; set; }
+
+ /// Gets or sets the validation value.
+ [JsonPropertyName("validation")]
+ public SessionSettingsValidationSnapshot Validation { get => field ??= new(); set; }
+
+ /// Gets or sets the version value.
+ [JsonPropertyName("version")]
+ public string? Version { get; set; }
}
-/// Session-scoped approval details for MCP sampling requests from a server.
-/// The mcp-sampling variant of .
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForSessionApprovalMcpSampling : PermissionDecisionApproveForSessionApproval
+internal sealed class SessionSettingsSnapshotRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "mcp-sampling";
-
- /// MCP server name.
- [JsonPropertyName("serverName")]
- public required string ServerName { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Session-scoped approval details for writes to long-term memory.
-/// The memory variant of .
+/// Result of evaluating a Rust-owned settings predicate.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForSessionApprovalMemory : PermissionDecisionApproveForSessionApproval
+internal sealed class SessionSettingsEvaluatePredicateResult
{
- ///
- [JsonIgnore]
- public override string Kind => "memory";
+ /// Gets or sets the enabled value.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
}
-/// Session-scoped approval details for a custom tool, keyed by tool name.
-/// The custom-tool variant of .
+/// Named Rust-owned settings predicate to evaluate for this session.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForSessionApprovalCustomTool : PermissionDecisionApproveForSessionApproval
+internal sealed class SessionSettingsEvaluatePredicateRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "custom-tool";
+ /// Predicate name. The runtime owns the raw feature-flag names and composition logic.
+ [JsonPropertyName("name")]
+ public SessionSettingsPredicateName Name { get; set; }
- /// Custom tool name.
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// Tool name for tool-scoped predicates such as trivial-change handling.
[JsonPropertyName("toolName")]
- public required string ToolName { get; set; }
+ public string? ToolName { get; set; }
}
-/// Session-scoped approval details for extension-management operations, optionally narrowed by operation.
-/// The extension-management variant of .
+/// Content-exclusion decision for one requested path.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForSessionApprovalExtensionManagement : PermissionDecisionApproveForSessionApproval
+public sealed class ContentExclusionPathCheck
{
- ///
- [JsonIgnore]
- public override string Kind => "extension-management";
+ /// Whether the session's complete content-exclusion policy excludes the path.
+ [JsonPropertyName("excluded")]
+ public bool Excluded { get; set; }
- /// Optional operation identifier; when omitted, the approval covers all extension management operations.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("operation")]
- public string? Operation { get; set; }
+ /// The path supplied by the caller.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
}
-/// Session-scoped approval details for an extension's permission-gated capability access, keyed by extension name.
-/// The extension-permission-access variant of .
+/// Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess : PermissionDecisionApproveForSessionApproval
+public sealed class ContentExclusionCheckPathsResult
{
- ///
- [JsonIgnore]
- public override string Kind => "extension-permission-access";
+ /// 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; }
- /// Extension name.
- [JsonPropertyName("extensionName")]
- public required string ExtensionName { get; set; }
+ /// Per-path decisions in request order. Empty when available is false.
+ [JsonPropertyName("checks")]
+ public IList Checks { get => field ??= []; set; }
}
-/// Permission-decision request variant to approve for the rest of the session, with optional tool approval or URL domain.
-/// The approve-for-session variant of .
+/// Local file system absolute paths within the session working directory to check against its content-exclusion policy.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForSession : PermissionDecision
+internal sealed class ContentExclusionCheckPathsRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "approve-for-session";
-
- /// Session-scoped approval to remember (tool prompts only; omitted for path/url prompts).
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("approval")]
- public PermissionDecisionApproveForSessionApproval? Approval { get; set; }
+ /// 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; }
- /// URL domain to approve for the rest of the session (URL prompts only).
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("domain")]
- public string? Domain { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Approval to persist for this location.
-/// Polymorphic base type discriminated by kind.
+/// Identifier of the spawned process, used to correlate streamed output and exit notifications.
[Experimental(Diagnostics.Experimental)]
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "kind",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalCommands), "commands")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalRead), "read")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalWrite), "write")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMcp), "mcp")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMcpSampling), "mcp-sampling")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMemory), "memory")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalCustomTool), "custom-tool")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalExtensionManagement), "extension-management")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess), "extension-permission-access")]
-public partial class PermissionDecisionApproveForLocationApproval
+public sealed class ShellExecResult
{
- /// The type discriminator.
- [JsonPropertyName("kind")]
- public virtual string Kind { get; set; } = string.Empty;
+ /// Unique identifier for tracking streamed output.
+ [JsonPropertyName("processId")]
+ public string ProcessId { get; set; } = string.Empty;
}
-
-/// Location-scoped approval details for specific command identifiers.
-/// The commands variant of .
+/// Shell command to run, with optional working directory and timeout in milliseconds.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForLocationApprovalCommands : PermissionDecisionApproveForLocationApproval
+internal sealed class ShellExecRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "commands";
+ /// Shell command to execute.
+ [JsonPropertyName("command")]
+ public string Command { get; set; } = string.Empty;
- /// Command identifiers covered by this approval.
- [JsonPropertyName("commandIdentifiers")]
- public required IList CommandIdentifiers { get; set; }
+ /// Working directory (defaults to session working directory).
+ [JsonPropertyName("cwd")]
+ public string? Cwd { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// Timeout in milliseconds (default: 30000).
+ [JsonConverter(typeof(MillisecondsTimeSpanConverter))]
+ [JsonPropertyName("timeout")]
+ public TimeSpan? Timeout { get; set; }
}
-/// Location-scoped approval details for read-only filesystem operations.
-/// The read variant of .
+/// Indicates whether the signal was delivered; false if the process was unknown or already exited.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForLocationApprovalRead : PermissionDecisionApproveForLocationApproval
+public sealed class ShellKillResult
{
- ///
- [JsonIgnore]
- public override string Kind => "read";
+ /// Whether the signal was sent successfully.
+ [JsonPropertyName("killed")]
+ public bool Killed { get; set; }
}
-/// Location-scoped approval details for filesystem write operations.
-/// The write variant of .
+/// Identifier of a process previously returned by "shell.exec" and the signal to send.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForLocationApprovalWrite : PermissionDecisionApproveForLocationApproval
+internal sealed class ShellKillRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "write";
+ /// Process identifier returned by shell.exec.
+ [JsonPropertyName("processId")]
+ public string ProcessId { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// Signal to send (default: SIGTERM).
+ [JsonPropertyName("signal")]
+ public ShellKillSignal? Signal { get; set; }
}
-/// Location-scoped approval details for an MCP server tool, or all tools on the server when `toolName` is null.
-/// The mcp variant of .
+/// Result of a user-requested shell command.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForLocationApprovalMcp : PermissionDecisionApproveForLocationApproval
+public sealed class UserRequestedShellCommandResult
{
- ///
- [JsonIgnore]
- public override string Kind => "mcp";
+ /// Error output when the execution failed.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
- /// MCP server name.
- [JsonPropertyName("serverName")]
- public required string ServerName { get; set; }
+ /// Process exit code, when available.
+ [JsonPropertyName("exitCode")]
+ public long? ExitCode { get; set; }
- /// MCP tool name, or null to cover every tool on the server.
- [JsonPropertyName("toolName")]
- public string? ToolName { get; set; }
+ /// Captured command output.
+ [JsonPropertyName("output")]
+ public string Output { get; set; } = string.Empty;
+
+ /// Whether the command completed successfully.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+
+ /// Tool call id emitted for the shell execution.
+ [JsonPropertyName("toolCallId")]
+ public string ToolCallId { get; set; } = string.Empty;
}
-/// Location-scoped approval details for MCP sampling requests from a server.
-/// The mcp-sampling variant of .
+/// User-requested shell command and cancellation handle.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForLocationApprovalMcpSampling : PermissionDecisionApproveForLocationApproval
+internal sealed class ShellExecuteUserRequestedRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "mcp-sampling";
+ /// Shell command to execute.
+ [JsonPropertyName("command")]
+ public string Command { get; set; } = string.Empty;
- /// MCP server name.
- [JsonPropertyName("serverName")]
- public required string ServerName { get; set; }
+ /// Caller-provided cancellation handle for this execution.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Location-scoped approval details for writes to long-term memory.
-/// The memory variant of .
+/// Cancellation result for a user-requested shell command.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForLocationApprovalMemory : PermissionDecisionApproveForLocationApproval
+public sealed class CancelUserRequestedShellCommandResult
{
- ///
- [JsonIgnore]
- public override string Kind => "memory";
+ /// Whether an in-flight execution was found and signalled to cancel.
+ [JsonPropertyName("cancelled")]
+ public bool Cancelled { get; set; }
}
-/// Location-scoped approval details for a custom tool, keyed by tool name.
-/// The custom-tool variant of .
+/// User-requested shell execution cancellation handle.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForLocationApprovalCustomTool : PermissionDecisionApproveForLocationApproval
+internal sealed class ShellCancelUserRequestedRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "custom-tool";
+ /// Request ID previously passed to executeUserRequested.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
- /// Custom tool name.
- [JsonPropertyName("toolName")]
- public required string ToolName { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Location-scoped approval details for extension-management operations, optionally narrowed by operation.
-/// The extension-management variant of .
+/// Post-compaction context window usage breakdown.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForLocationApprovalExtensionManagement : PermissionDecisionApproveForLocationApproval
+public sealed class HistoryCompactContextWindow
{
- ///
- [JsonIgnore]
- public override string Kind => "extension-management";
+ /// Token count from non-system messages (user, assistant, tool).
+ [JsonPropertyName("conversationTokens")]
+ public long? ConversationTokens { get; set; }
- /// Optional operation identifier; when omitted, the approval covers all extension management operations.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("operation")]
- public string? Operation { get; set; }
-}
+ /// Current total tokens in the context window (system + conversation + tool definitions).
+ [JsonPropertyName("currentTokens")]
+ public long CurrentTokens { get; set; }
-/// Location-scoped approval details for an extension's permission-gated capability access, keyed by extension name.
-/// The extension-permission-access variant of .
-[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess : PermissionDecisionApproveForLocationApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "extension-permission-access";
+ /// Current number of messages in the conversation.
+ [JsonPropertyName("messagesLength")]
+ public long MessagesLength { get; set; }
- /// Extension name.
- [JsonPropertyName("extensionName")]
- public required string ExtensionName { get; set; }
+ /// Token count from system message(s).
+ [JsonPropertyName("systemTokens")]
+ public long? SystemTokens { get; set; }
+
+ /// Maximum token count for the model's context window.
+ [JsonPropertyName("tokenLimit")]
+ public long TokenLimit { get; set; }
+
+ /// Token count from tool definitions.
+ [JsonPropertyName("toolDefinitionsTokens")]
+ public long? ToolDefinitionsTokens { get; set; }
}
-/// Permission-decision request variant to approve and persist a permission for a project location, with approval details and location key.
-/// The approve-for-location variant of .
+/// Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproveForLocation : PermissionDecision
+public sealed class HistoryCompactResult
{
- ///
- [JsonIgnore]
- public override string Kind => "approve-for-location";
+ /// Post-compaction context window usage breakdown.
+ [JsonPropertyName("contextWindow")]
+ public HistoryCompactContextWindow? ContextWindow { get; set; }
- /// Approval to persist for this location.
- [JsonPropertyName("approval")]
- public required PermissionDecisionApproveForLocationApproval Approval { get; set; }
+ /// Number of messages removed during compaction.
+ [JsonPropertyName("messagesRemoved")]
+ public long MessagesRemoved { get; set; }
- /// Location key (git root or cwd) to persist the approval to.
- [JsonPropertyName("locationKey")]
- public required string LocationKey { get; set; }
-}
+ /// Whether compaction completed successfully.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
-/// Permission-decision request variant to permanently approve a URL domain across sessions.
-/// The approve-permanently variant of .
-[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApprovePermanently : PermissionDecision
-{
- ///
- [JsonIgnore]
- public override string Kind => "approve-permanently";
+ /// Summary text produced by compaction. Omitted when compaction did not produce a summary (e.g. failure path).
+ [JsonPropertyName("summaryContent")]
+ public string? SummaryContent { get; set; }
- /// URL domain to approve permanently.
- [JsonPropertyName("domain")]
- public required string Domain { get; set; }
+ /// Number of tokens freed by compaction.
+ [JsonPropertyName("tokensRemoved")]
+ public long TokensRemoved { get; set; }
}
-/// Permission-decision request variant to reject a pending permission request, with optional feedback.
-/// The reject variant of .
+/// RPC data type for SessionHistoryCompact operations.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionReject : PermissionDecision
+public sealed class SessionHistoryCompactRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "reject";
+ /// Optional user-provided instructions to focus the compaction summary.
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MaxLength(4000)]
+ [JsonPropertyName("customInstructions")]
+ public string? CustomInstructions { get; set; }
- /// Optional feedback explaining the rejection.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("feedback")]
- public string? Feedback { get; set; }
+ /// Context window token limit this compaction is targeting, recorded as the `tokenLimit` on the persisted `session.compaction_start` / `session.compaction_complete` events. Set it when the compaction targets a window other than the compacting model's own, e.g. switching to a model with a smaller context window: the compaction still runs on the current model, so the limit that motivated it would otherwise be lost. When absent, the events record the compacting model's own resolved limit. Attribution metadata only - it does not change how much the compaction removes.
+ [JsonPropertyName("tokenLimit")]
+ public long? TokenLimit { get; set; }
+
+ /// What initiated this compaction request, recorded as the `trigger` on the persisted `session.compaction_start` / `session.compaction_complete` events. When absent, the compaction is persisted without trigger attribution (initiator unknown).
+ [JsonPropertyName("trigger")]
+ public SessionHistoryCompactRequestTrigger? Trigger { get; set; }
}
-/// Permission-decision variant indicating no user was available to confirm the request.
-/// The user-not-available variant of .
+/// RPC data type for SessionHistoryCompactRequestWithSession operations.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionUserNotAvailable : PermissionDecision
+internal sealed class SessionHistoryCompactRequestWithSession
{
- ///
- [JsonIgnore]
- public override string Kind => "user-not-available";
+ /// Optional user-provided instructions to focus the compaction summary.
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MaxLength(4000)]
+ [JsonPropertyName("customInstructions")]
+ public string? CustomInstructions { get; set; }
+
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+
+ /// Context window token limit this compaction is targeting, recorded as the `tokenLimit` on the persisted `session.compaction_start` / `session.compaction_complete` events. Set it when the compaction targets a window other than the compacting model's own, e.g. switching to a model with a smaller context window: the compaction still runs on the current model, so the limit that motivated it would otherwise be lost. When absent, the events record the compacting model's own resolved limit. Attribution metadata only - it does not change how much the compaction removes.
+ [JsonPropertyName("tokenLimit")]
+ public long? TokenLimit { get; set; }
+
+ /// What initiated this compaction request, recorded as the `trigger` on the persisted `session.compaction_start` / `session.compaction_complete` events. When absent, the compaction is persisted without trigger attribution (initiator unknown).
+ [JsonPropertyName("trigger")]
+ public SessionHistoryCompactRequestWithSessionTrigger? Trigger { get; set; }
}
-/// Permission-decision variant indicating the request was approved.
-/// The approved variant of .
+/// Number of events that were removed by the truncation.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApproved : PermissionDecision
+public sealed class HistoryTruncateResult
{
- ///
- [JsonIgnore]
- public override string Kind => "approved";
+ /// 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; }
}
-/// Permission-decision variant indicating approval was remembered for the session, with approval details.
-/// The approved-for-session variant of .
+/// Identifier of the event to truncate to; this event and all later events are removed.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApprovedForSession : PermissionDecision
+internal sealed class HistoryTruncateRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "approved-for-session";
+ /// 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;
- /// The approval to add as a session-scoped rule.
- [JsonPropertyName("approval")]
- public required UserToolSessionApproval Approval { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Permission-decision variant indicating approval was persisted for a project location, with approval details and location key.
-/// The approved-for-location variant of .
+/// A root user turn that the session can rewind to.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionApprovedForLocation : PermissionDecision
+public sealed class HistoryRewindPoint
{
- ///
- [JsonIgnore]
- public override string Kind => "approved-for-location";
+ /// Whether at least one file in this turn or a later turn can be restored.
+ [JsonPropertyName("canRestoreFiles")]
+ public bool CanRestoreFiles { get; set; }
- /// The approval to persist for this location.
- [JsonPropertyName("approval")]
- public required UserToolSessionApproval Approval { get; set; }
+ /// ID of the user.message event that begins the discarded suffix.
+ [JsonPropertyName("eventId")]
+ public string EventId { get; set; } = string.Empty;
- /// The location key (git root or cwd) to persist the approval to.
- [JsonPropertyName("locationKey")]
- public required string LocationKey { get; set; }
+ /// 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;
}
-/// Permission-decision variant indicating the request was cancelled before use, with an optional reason.
-/// The cancelled variant of .
+/// Rewind points and file-change-tracking availability for the session.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionCancelled : PermissionDecision
+public sealed class HistoryListRewindPointsResult
{
- ///
- [JsonIgnore]
- public override string Kind => "cancelled";
+ /// Whether this session captured file changes from its first turn.
+ [JsonPropertyName("fileChangeTrackingEnabled")]
+ public bool FileChangeTrackingEnabled { get; set; }
- /// Optional explanation of why the request was cancelled.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("reason")]
- public string? Reason { 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; }
}
-/// Permission-decision variant indicating explicit denial by permission rules, with the matching rules.
-/// The denied-by-rules variant of .
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionDeniedByRules : PermissionDecision
+internal sealed class SessionHistoryListRewindPointsRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "denied-by-rules";
-
- /// Rules that denied the request.
- [JsonPropertyName("rules")]
- public required IList Rules { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Permission-decision variant indicating no approval rule matched and user confirmation was unavailable.
-/// The denied-no-approval-rule-and-could-not-request-from-user variant of .
+/// A file that a conversation-and-files rewind would restore.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser : PermissionDecision
+public sealed class HistoryRewindFilePreview
{
- ///
- [JsonIgnore]
- public override string Kind => "denied-no-approval-rule-and-could-not-request-from-user";
+ /// 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;
}
-/// Permission-decision variant indicating the user denied an interactive prompt, with optional feedback and force-reject flag.
-/// The denied-interactively-by-user variant of .
+/// Files and aggregate changes for a prospective rewind.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionDeniedInteractivelyByUser : PermissionDecision
+public sealed class HistoryPreviewRewindResult
{
- ///
- [JsonIgnore]
- public override string Kind => "denied-interactively-by-user";
+ /// 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; }
- /// Optional feedback from the user explaining the denial.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("feedback")]
- public string? Feedback { get; set; }
+ /// Number of unique files in the preview.
+ [JsonPropertyName("fileCount")]
+ public long FileCount { get; set; }
- /// Whether to force-reject the current agent turn.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("forceReject")]
- public bool? ForceReject { 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; }
}
-/// Permission-decision variant indicating denial by content-exclusion policy, with path and message.
-/// The denied-by-content-exclusion-policy variant of .
+/// Event boundary to preview for conversation-and-files rewind.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionDeniedByContentExclusionPolicy : PermissionDecision
+internal sealed class HistoryPreviewRewindRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "denied-by-content-exclusion-policy";
+ /// ID of the user.message event that begins the discarded suffix.
+ [JsonPropertyName("eventId")]
+ public string EventId { get; set; } = string.Empty;
- /// Human-readable explanation of why the path was excluded.
- [JsonPropertyName("message")]
- public required string Message { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// File path that triggered the exclusion.
+/// A captured file that rewind intentionally left unchanged.
+[Experimental(Diagnostics.Experimental)]
+public sealed class HistorySkippedFileRestore
+{
+ /// Absolute path of the skipped file.
[JsonPropertyName("path")]
- public required string Path { get; set; }
+ public string Path { get; set; } = string.Empty;
+
+ /// Reason the file was not restored.
+ [JsonPropertyName("reason")]
+ public HistoryFileRestoreSkipReason Reason { get; set; }
}
-/// Permission-decision variant indicating denial by a permission request hook, with optional message and interrupt flag.
-/// The denied-by-permission-request-hook variant of .
+/// Structured outcome of a rewind request.
[Experimental(Diagnostics.Experimental)]
-public partial class PermissionDecisionDeniedByPermissionRequestHook : PermissionDecision
+public sealed class HistoryRewindResult
{
- ///
- [JsonIgnore]
- public override string Kind => "denied-by-permission-request-hook";
+ /// 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; }
- /// Whether to interrupt the current agent turn.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("interrupt")]
- public bool? Interrupt { 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; }
- /// Optional message from the hook explaining the denial.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("message")]
- public string? Message { 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; }
}
-/// Pending permission request ID and the decision to apply (approve/reject and scope).
+/// Boundary and mode for rewinding session history.
[Experimental(Diagnostics.Experimental)]
-internal sealed class PermissionDecisionRequest
+internal sealed class HistoryRewindRequest
{
- /// Request ID of the pending permission request.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
+ /// ID of the user.message event that begins the discarded suffix.
+ [JsonPropertyName("eventId")]
+ public string EventId { get; set; } = string.Empty;
- /// The client's response to the pending permission prompt.
- [JsonPropertyName("result")]
- public PermissionDecision Result { get => field ??= new(); set; }
+ /// 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;
}
-/// Pending permission prompt reconstructed from event history, with request ID and user-facing prompt details.
+/// Indicates whether an in-progress background compaction was cancelled.
[Experimental(Diagnostics.Experimental)]
-public sealed class PendingPermissionRequest
+public sealed class HistoryCancelBackgroundCompactionResult
{
- /// The user-facing permission prompt details (commands, write, read, mcp, url, memory, custom-tool, path, hook).
- [JsonPropertyName("request")]
- public PermissionPromptRequest Request { get; set; } = null!;
+ /// 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.
+ [JsonPropertyName("cancelled")]
+ public bool Cancelled { get; set; }
+}
- /// Unique identifier for the pending permission request.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionHistoryCancelBackgroundCompactionRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// List of pending permission requests reconstructed from event history.
+/// Indicates whether an in-progress manual compaction was aborted.
[Experimental(Diagnostics.Experimental)]
-public sealed class PendingPermissionRequestList
+public sealed class HistoryAbortManualCompactionResult
{
- /// Pending permission prompts reconstructed from the session's event history. Equivalent to the set of `permission.requested` events that have not yet been followed by a matching `permission.completed` event. Used by clients (e.g. the CLI) to hydrate UI for prompts that were emitted before the client attached to the session.
- [JsonPropertyName("items")]
- public IList Items { get => field ??= []; set; }
+ /// 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.
+ [JsonPropertyName("aborted")]
+ public bool Aborted { get; set; }
}
-/// No parameters; returns currently-pending permission requests for the session.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class PermissionsPendingRequestsRequest
+internal sealed class SessionHistoryAbortManualCompactionRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the operation succeeded.
+/// Markdown summary of the conversation context (empty when not available).
[Experimental(Diagnostics.Experimental)]
-public sealed class PermissionsSetApproveAllResult
+public sealed class HistorySummarizeForHandoffResult
{
- /// Whether the operation succeeded.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// 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.
+ [JsonPropertyName("summary")]
+ public string Summary { get; set; } = string.Empty;
}
-/// Allow-all toggle for tool permission requests, with an optional telemetry source.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class PermissionsSetApproveAllRequest
+internal sealed class SessionHistorySummarizeForHandoffRequest
{
- /// Whether to auto-approve all tool permission requests.
- [JsonPropertyName("enabled")]
- public bool Enabled { get; set; }
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
-
- /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers.
- [JsonPropertyName("source")]
- public PermissionsSetApproveAllSource? Source { get; set; }
}
-/// Indicates whether the operation succeeded and reports the post-mutation state.
+/// User-facing pending queue entry, with kind and display text for a queued message, slash command, or model change.
[Experimental(Diagnostics.Experimental)]
-public sealed class AllowAllPermissionSetResult
+public sealed class QueuePendingItems
{
- /// Authoritative full allow-all state after the mutation.
- [JsonPropertyName("enabled")]
- public bool Enabled { get; set; }
+ /// Agent mode stored on this queued entry, as stamped when it was enqueued. Items without an explicit mode report interactive. This is not necessarily the mode that will constrain the turn: a plan or autopilot session applies its own write gate, continuation loop and permission posture to every drained item regardless of the mode stored here.
+ [JsonPropertyName("agentMode")]
+ public SendAgentMode AgentMode { get; set; }
- /// Authoritative allow-all mode after the mutation.
- [JsonPropertyName("mode")]
- public PermissionsAllowAllMode? Mode { get; set; }
+ /// Human-readable text to display for this queue entry in the UI.
+ [JsonPropertyName("displayText")]
+ public string DisplayText { get; set; } = string.Empty;
- /// Whether the operation succeeded.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Stable opaque id for the canonical queued item. Batch rows share one id.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Whether this item is a queued user message or a queued slash command / model change.
+ [JsonPropertyName("kind")]
+ public QueuePendingItemsKind Kind { get; set; }
+}
+
+/// Snapshot of the session's pending queued items and immediate-steering messages.
+[Experimental(Diagnostics.Experimental)]
+public sealed class QueuePendingItemsResult
+{
+ /// Pending queued items in submission order. Includes user messages, queued slash commands, and queued model changes; omits internal system items.
+ [JsonPropertyName("items")]
+ public IList Items { get => field ??= []; set; }
+
+ /// Display text for messages currently in the immediate steering queue (interjections sent during a running turn).
+ [JsonPropertyName("steeringMessages")]
+ public IList SteeringMessages { get => field ??= []; set; }
}
-/// Allow-all mode to apply for the session.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class PermissionsSetAllowAllRequest
+internal sealed class SessionQueuePendingItemsRequest
{
- /// Legacy full allow-all toggle. Prefer `mode`; when `mode` is omitted, `enabled: true` is treated as `mode: "on"` and any other value is treated as `mode: "off"`.
- [JsonPropertyName("enabled")]
- public bool? Enabled { get; set; }
-
- /// Allow-all mode to apply. `on` enables full allow-all; `auto` enables advisory LLM auto-approval; `off` disables both.
- [JsonPropertyName("mode")]
- public PermissionsAllowAllMode? Mode { get; set; }
-
- /// Optional model id for the `auto` mode auto-approval LLM judging. Only meaningful when `mode` is `auto`; ignored otherwise. When omitted, the session's active model is used.
- [JsonPropertyName("model")]
- public string? Model { get; set; }
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
-
- /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers.
- [JsonPropertyName("source")]
- public PermissionsSetAllowAllSource? Source { get; set; }
}
-/// Current allow-all permission mode.
+/// Internal snapshot of native queue state for local session orchestration.
[Experimental(Diagnostics.Experimental)]
-public sealed class AllowAllPermissionState
+internal sealed class QueueSnapshotResult
{
- /// Whether full allow-all permissions are currently active.
- [JsonPropertyName("enabled")]
- public bool Enabled { get; set; }
+ /// Insertion orders for queued items, aligned with `items`.
+ [JsonPropertyName("itemOrders")]
+ public IList? ItemOrders { get; set; }
- /// Current allow-all mode.
- [JsonPropertyName("mode")]
- public PermissionsAllowAllMode? Mode { 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; }
}
-/// No parameters.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class PermissionsGetAllowAllRequest
+internal sealed class SessionQueueSnapshotRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the operation succeeded.
+/// Result of moving a queued item.
[Experimental(Diagnostics.Experimental)]
-public sealed class PermissionsModifyRulesResult
+public sealed class QueueMoveItemResult
{
- /// Whether the operation succeeded.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// True when the item changed position; false when it was already at the requested position.
+ [JsonPropertyName("changed")]
+ public bool Changed { get; set; }
}
-/// Scope and add/remove instructions for modifying session- or location-scoped permission rules.
+/// Parameters for moving a queued item by stable id.
[Experimental(Diagnostics.Experimental)]
-internal sealed class PermissionsModifyRulesParams
+internal sealed class QueueMoveItemRequest
{
- /// Rules to add to the scope. Applied before `remove`/`removeAll`.
- [JsonPropertyName("add")]
- public IList? Add { get; set; }
-
- /// Specific rules to remove from the scope. Ignored when `removeAll` is true.
- [JsonPropertyName("remove")]
- public IList? Remove { get; set; }
-
- ///