Documentation
¶
Index ¶
- func RegisterClientSessionAPIHandlers(client *jsonrpc2.Client, ...)
- type APIKeyAuthInfo
- type AbortData
- type AbortReason
- type AbortRequest
- type AbortResult
- type AccountGetQuotaRequest
- type AccountGetQuotaResult
- type AccountQuotaSnapshot
- type AgentAPI
- func (a *AgentAPI) Deselect(ctx context.Context) (*SessionAgentDeselectResult, error)
- func (a *AgentAPI) GetCurrent(ctx context.Context) (*AgentGetCurrentResult, error)
- func (a *AgentAPI) List(ctx context.Context) (*AgentList, error)
- func (a *AgentAPI) Reload(ctx context.Context) (*AgentReloadResult, error)
- func (a *AgentAPI) Select(ctx context.Context, params *AgentSelectRequest) (*AgentSelectResult, error)
- type AgentGetCurrentResult
- type AgentInfo
- type AgentInfoSource
- type AgentList
- type AgentRegistryLiveTargetEntry
- type AgentRegistryLiveTargetEntryAttentionKind
- type AgentRegistryLiveTargetEntryKind
- type AgentRegistryLiveTargetEntryLastTerminalEvent
- type AgentRegistryLiveTargetEntryStatus
- type AgentRegistryLogCapture
- type AgentRegistryLogCaptureOpenErrorReason
- type AgentRegistrySpawnError
- type AgentRegistrySpawnPermissionMode
- type AgentRegistrySpawnRegistryTimeout
- type AgentRegistrySpawnRequest
- type AgentRegistrySpawnResult
- type AgentRegistrySpawnResultKind
- type AgentRegistrySpawnSpawned
- type AgentRegistrySpawnValidationError
- type AgentRegistrySpawnValidationErrorField
- type AgentRegistrySpawnValidationErrorReason
- type AgentReloadResult
- type AgentSelectRequest
- type AgentSelectResult
- type AgentsDiscoverRequest
- type AllowAllPermissionSetResult
- type AllowAllPermissionState
- type AssistantIntentData
- type AssistantMessageData
- type AssistantMessageDeltaData
- type AssistantMessageStartData
- type AssistantMessageToolRequest
- type AssistantMessageToolRequestType
- type AssistantReasoningData
- type AssistantReasoningDeltaData
- type AssistantStreamingDeltaData
- type AssistantTurnEndData
- type AssistantTurnStartData
- type AssistantUsageAPIEndpoint
- type AssistantUsageCopilotUsage
- type AssistantUsageCopilotUsageTokenDetail
- type AssistantUsageData
- type AssistantUsageQuotaSnapshot
- type Attachment
- type AttachmentBlob
- type AttachmentDirectory
- type AttachmentExtensionContext
- type AttachmentFile
- type AttachmentFileLineRange
- type AttachmentGitHubReference
- type AttachmentGitHubReferenceType
- type AttachmentSelection
- type AttachmentSelectionDetails
- type AttachmentSelectionDetailsEnd
- type AttachmentSelectionDetailsStart
- type AttachmentType
- type AuthAPI
- type AuthInfo
- type AuthInfoType
- type AutoModeSwitchCompletedData
- type AutoModeSwitchRequestedData
- type AutoModeSwitchResponse
- type AutopilotObjectiveChangedOperation
- type AutopilotObjectiveChangedStatus
- type CancelUserRequestedShellCommandResult
- type CanvasAPI
- func (s *CanvasAPI) Action() *CanvasActionAPI
- func (a *CanvasAPI) Close(ctx context.Context, params *CanvasCloseRequest) (*SessionCanvasCloseResult, error)
- func (a *CanvasAPI) List(ctx context.Context) (*CanvasList, error)
- func (a *CanvasAPI) ListOpen(ctx context.Context) (*CanvasListOpenResult, error)
- func (a *CanvasAPI) Open(ctx context.Context, params *CanvasOpenRequest) (*OpenCanvasInstance, error)
- type CanvasAction
- type CanvasActionAPI
- type CanvasActionInvokeRequest
- type CanvasActionInvokeResult
- type CanvasCloseRequest
- type CanvasCloseResult
- type CanvasHandler
- type CanvasHostContext
- type CanvasHostContextCapabilities
- type CanvasInstanceAvailability
- type CanvasJSONSchema
- type CanvasList
- type CanvasListOpenResult
- type CanvasOpenRequest
- type CanvasOpenedAvailability
- type CanvasProviderCloseRequest
- type CanvasProviderInvokeActionRequest
- type CanvasProviderOpenRequest
- type CanvasProviderOpenResult
- type CanvasRegistryChangedCanvas
- type CanvasRegistryChangedCanvasAction
- type CanvasSessionContext
- type CapabilitiesChangedData
- type CapabilitiesChangedUI
- type ClientSessionAPIHandlers
- type CommandCompletedData
- type CommandExecuteData
- type CommandList
- type CommandQueuedData
- type CommandsAPI
- func (a *CommandsAPI) Enqueue(ctx context.Context, params *EnqueueCommandParams) (*EnqueueCommandResult, error)
- func (a *CommandsAPI) Execute(ctx context.Context, params *ExecuteCommandParams) (*ExecuteCommandResult, error)
- func (a *CommandsAPI) HandlePendingCommand(ctx context.Context, params *CommandsHandlePendingCommandRequest) (*CommandsHandlePendingCommandResult, error)
- func (a *CommandsAPI) Invoke(ctx context.Context, params *CommandsInvokeRequest) (SlashCommandInvocationResult, error)
- func (a *CommandsAPI) List(ctx context.Context, params ...*CommandsListRequest) (*CommandList, error)
- func (a *CommandsAPI) RespondToQueuedCommand(ctx context.Context, params *CommandsRespondToQueuedCommandRequest) (*CommandsRespondToQueuedCommandResult, error)
- type CommandsChangedCommand
- type CommandsChangedData
- type CommandsHandlePendingCommandRequest
- type CommandsHandlePendingCommandResult
- type CommandsInvokeRequest
- type CommandsListRequest
- type CommandsRespondToQueuedCommandRequest
- type CommandsRespondToQueuedCommandResult
- type CompactionCompleteCompactionTokensUsed
- type CompactionCompleteCompactionTokensUsedCopilotUsage
- type CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail
- type ConfigureSessionExtensionsParams
- type ConnectRemoteSessionParams
- type ConnectRequest
- type ConnectResult
- type ConnectedRemoteSessionMetadata
- type ConnectedRemoteSessionMetadataKind
- type ConnectedRemoteSessionMetadataRepository
- type ContentFilterMode
- type ContextTier
- type CopilotAPITokenAuthInfo
- type CopilotAPITokenAuthInfoHost
- type CopilotUserResponse
- type CopilotUserResponseEndpoints
- type CopilotUserResponseOrganizationListItem
- type CopilotUserResponseQuotaSnapshots
- type CopilotUserResponseQuotaSnapshotsChat
- type CopilotUserResponseQuotaSnapshotsCompletions
- type CopilotUserResponseQuotaSnapshotsPremiumInteractions
- type CurrentModel
- type CurrentToolMetadata
- type CustomAgentsUpdatedAgent
- type CustomNotificationPayload
- type DiscoveredCanvas
- type DiscoveredMCPServer
- type DiscoveredMCPServerType
- type ElicitationCompletedAction
- type ElicitationCompletedBooleanContent
- type ElicitationCompletedContent
- type ElicitationCompletedData
- type ElicitationCompletedNumberContent
- type ElicitationCompletedStringArrayContent
- type ElicitationCompletedStringContent
- type ElicitationRequestedData
- type ElicitationRequestedMode
- type ElicitationRequestedSchema
- type ElicitationRequestedSchemaType
- type EmbeddedBlobResourceContents
- type EmbeddedTextResourceContents
- type EnqueueCommandParams
- type EnqueueCommandResult
- type EnvAuthInfo
- type EventLogAPI
- func (a *EventLogAPI) Read(ctx context.Context, params *EventLogReadRequest) (*EventsReadResult, error)
- func (a *EventLogAPI) RegisterInterest(ctx context.Context, params *RegisterEventInterestParams) (*RegisterEventInterestResult, error)
- func (a *EventLogAPI) ReleaseInterest(ctx context.Context, params *ReleaseEventInterestParams) (*EventLogReleaseInterestResult, error)
- func (a *EventLogAPI) Tail(ctx context.Context) (*EventLogTailResult, error)
- type EventLogReadRequest
- type EventLogReleaseInterestResult
- type EventLogTailResult
- type EventLogTypes
- type EventLogTypesString
- type EventsAgentScope
- type EventsCursorStatus
- type EventsReadResult
- type ExecuteCommandParams
- type ExecuteCommandResult
- type ExitPlanModeAction
- type ExitPlanModeCompletedData
- type ExitPlanModeRequestedData
- type Extension
- type ExtensionContextPushInput
- type ExtensionList
- type ExtensionSource
- type ExtensionStatus
- type ExtensionsAPI
- func (a *ExtensionsAPI) Disable(ctx context.Context, params *ExtensionsDisableRequest) (*SessionExtensionsDisableResult, error)
- func (a *ExtensionsAPI) Enable(ctx context.Context, params *ExtensionsEnableRequest) (*SessionExtensionsEnableResult, error)
- func (a *ExtensionsAPI) List(ctx context.Context) (*ExtensionList, error)
- func (a *ExtensionsAPI) Reload(ctx context.Context) (*SessionExtensionsReloadResult, error)
- func (a *ExtensionsAPI) SendAttachmentsToMessage(ctx context.Context, params *SendAttachmentsToMessageParams) (*SessionExtensionsSendAttachmentsToMessageResult, error)
- type ExtensionsDisableRequest
- type ExtensionsEnableRequest
- type ExtensionsLoadedExtension
- type ExtensionsLoadedExtensionSource
- type ExtensionsLoadedExtensionStatus
- type ExternalToolCompletedData
- type ExternalToolRequestedData
- type ExternalToolResult
- type ExternalToolStringResult
- type ExternalToolTextResultForLlm
- type ExternalToolTextResultForLlmBinaryResultsForLlm
- type ExternalToolTextResultForLlmBinaryResultsForLlmType
- type ExternalToolTextResultForLlmContent
- type ExternalToolTextResultForLlmContentAudio
- type ExternalToolTextResultForLlmContentImage
- type ExternalToolTextResultForLlmContentResource
- type ExternalToolTextResultForLlmContentResourceDetails
- type ExternalToolTextResultForLlmContentResourceLink
- type ExternalToolTextResultForLlmContentResourceLinkIcon
- type ExternalToolTextResultForLlmContentResourceLinkIconTheme
- type ExternalToolTextResultForLlmContentTerminal
- type ExternalToolTextResultForLlmContentText
- type ExternalToolTextResultForLlmContentType
- type FilterMapping
- type FilterMappingEnumMap
- type FleetAPI
- type FleetStartRequest
- type FleetStartResult
- type FolderTrustAddParams
- type FolderTrustCheckParams
- type FolderTrustCheckResult
- type GhCLIAuthInfo
- type HMACAuthInfo
- type HMACAuthInfoHost
- type HandlePendingToolCallRequest
- type HandlePendingToolCallResult
- type HandoffRepository
- type HandoffSourceType
- type HistoryAPI
- func (a *HistoryAPI) AbortManualCompaction(ctx context.Context) (*HistoryAbortManualCompactionResult, error)
- func (a *HistoryAPI) CancelBackgroundCompaction(ctx context.Context) (*HistoryCancelBackgroundCompactionResult, error)
- func (a *HistoryAPI) Compact(ctx context.Context, params ...*HistoryCompactRequest) (*HistoryCompactResult, error)
- func (a *HistoryAPI) SummarizeForHandoff(ctx context.Context) (*HistorySummarizeForHandoffResult, error)
- func (a *HistoryAPI) Truncate(ctx context.Context, params *HistoryTruncateRequest) (*HistoryTruncateResult, error)
- type HistoryAbortManualCompactionResult
- type HistoryCancelBackgroundCompactionResult
- type HistoryCompactContextWindow
- type HistoryCompactRequest
- type HistoryCompactResult
- type HistorySummarizeForHandoffResult
- type HistoryTruncateRequest
- type HistoryTruncateResult
- type HookEndData
- type HookEndError
- type HookProgressData
- type HookStartData
- type InstalledPlugin
- type InstalledPluginInfo
- type InstalledPluginSource
- type InstalledPluginSourceGitHub
- type InstalledPluginSourceGitHubSource
- type InstalledPluginSourceLocal
- type InstalledPluginSourceLocalSource
- type InstalledPluginSourceURL
- type InstalledPluginSourceURLSource
- type InstructionSource
- type InstructionSourceLocation
- type InstructionSourceType
- type InstructionsAPI
- type InstructionsDiscoverRequest
- type InstructionsGetSourcesResult
- type InternalMCPAPI
- func (a *InternalMCPAPI) ConfigureGitHub(ctx context.Context, params *MCPConfigureGitHubRequest) (*MCPConfigureGitHubResult, error)
- func (s *InternalMCPAPI) Oauth() *InternalMCPOauthAPI
- func (a *InternalMCPAPI) RegisterExternalClient(ctx context.Context, params *MCPRegisterExternalClientRequest) (*SessionMCPRegisterExternalClientResult, error)
- func (a *InternalMCPAPI) ReloadWithConfig(ctx context.Context, params *MCPReloadWithConfigRequest) (*MCPStartServersResult, error)
- func (a *InternalMCPAPI) RestartServer(ctx context.Context, params *MCPRestartServerRequest) (*SessionMCPRestartServerResult, error)
- func (a *InternalMCPAPI) StartServer(ctx context.Context, params *MCPStartServerRequest) (*SessionMCPStartServerResult, error)
- func (a *InternalMCPAPI) UnregisterExternalClient(ctx context.Context, params *MCPUnregisterExternalClientRequest) (*SessionMCPUnregisterExternalClientResult, error)
- type InternalMCPOauthAPI
- type InternalServerRPC
- type InternalServerSessionsAPI
- func (a *InternalServerSessionsAPI) ConfigureSessionExtensions(ctx context.Context, params *ConfigureSessionExtensionsParams) (*SessionsConfigureSessionExtensionsResult, error)
- func (a *InternalServerSessionsAPI) GetBoardEntryCount(ctx context.Context, params *SessionsGetBoardEntryCountRequest) (*SessionsGetBoardEntryCountResult, error)
- func (a *InternalServerSessionsAPI) GetEventFilePath(ctx context.Context, params *SessionsGetEventFilePathRequest) (*SessionsGetEventFilePathResult, error)
- func (a *InternalServerSessionsAPI) GetPersistedRemoteSteerable(ctx context.Context, params *SessionsGetPersistedRemoteSteerableRequest) (*SessionsGetPersistedRemoteSteerableResult, error)
- func (a *InternalServerSessionsAPI) PollSpawnedSessions(ctx context.Context, params *SessionsPollSpawnedSessionsRequest) (*PollSpawnedSessionsResult, error)
- func (a *InternalServerSessionsAPI) RegisterExtensionToolsOnSession(ctx context.Context, params *RegisterExtensionToolsParams) (*RegisterExtensionToolsResult, error)
- type InternalSessionRPC
- type LocalSessionMetadataValue
- type LogRequest
- type LogResult
- type LspAPI
- type LspInitializeRequest
- type MCPAPI
- func (s *MCPAPI) Apps() *MCPAppsAPI
- func (a *MCPAPI) CancelSamplingExecution(ctx context.Context, params *MCPCancelSamplingExecutionParams) (*MCPCancelSamplingExecutionResult, error)
- func (a *MCPAPI) Disable(ctx context.Context, params *MCPDisableRequest) (*SessionMCPDisableResult, error)
- func (a *MCPAPI) Enable(ctx context.Context, params *MCPEnableRequest) (*SessionMCPEnableResult, error)
- func (a *MCPAPI) ExecuteSampling(ctx context.Context, params *MCPExecuteSamplingParams) (*MCPSamplingExecutionResult, error)
- func (a *MCPAPI) IsServerRunning(ctx context.Context, params *MCPIsServerRunningRequest) (*MCPIsServerRunningResult, error)
- func (a *MCPAPI) List(ctx context.Context) (*MCPServerList, error)
- func (a *MCPAPI) ListTools(ctx context.Context, params *MCPListToolsRequest) (*MCPListToolsResult, error)
- func (s *MCPAPI) Oauth() *MCPOauthAPI
- func (a *MCPAPI) Reload(ctx context.Context) (*SessionMCPReloadResult, error)
- func (a *MCPAPI) RemoveGitHub(ctx context.Context) (*MCPRemoveGitHubResult, error)
- func (a *MCPAPI) SetEnvValueMode(ctx context.Context, params *MCPSetEnvValueModeParams) (*MCPSetEnvValueModeResult, error)
- func (a *MCPAPI) StopServer(ctx context.Context, params *MCPStopServerRequest) (*SessionMCPStopServerResult, error)
- type MCPAllowedServer
- type MCPAppToolCallCompleteData
- type MCPAppToolCallCompleteError
- type MCPAppToolCallCompleteToolMeta
- type MCPAppToolCallCompleteToolMetaUI
- type MCPAppsAPI
- func (a *MCPAppsAPI) CallTool(ctx context.Context, params *MCPAppsCallToolRequest) (*SessionMCPAppsCallToolResult, error)
- func (a *MCPAppsAPI) Diagnose(ctx context.Context, params *MCPAppsDiagnoseRequest) (*MCPAppsDiagnoseResult, error)
- func (a *MCPAppsAPI) GetHostContext(ctx context.Context) (*MCPAppsHostContext, error)
- func (a *MCPAppsAPI) ListTools(ctx context.Context, params *MCPAppsListToolsRequest) (*MCPAppsListToolsResult, error)
- func (a *MCPAppsAPI) ReadResource(ctx context.Context, params *MCPAppsReadResourceRequest) (*MCPAppsReadResourceResult, error)
- func (a *MCPAppsAPI) SetHostContext(ctx context.Context, params *MCPAppsSetHostContextRequest) (*SessionMCPAppsSetHostContextResult, error)
- type MCPAppsCallToolRequest
- type MCPAppsDiagnoseCapability
- type MCPAppsDiagnoseRequest
- type MCPAppsDiagnoseResult
- type MCPAppsDiagnoseServer
- type MCPAppsHostContext
- type MCPAppsHostContextDetails
- type MCPAppsHostContextDetailsAvailableDisplayMode
- type MCPAppsHostContextDetailsDisplayMode
- type MCPAppsHostContextDetailsPlatform
- type MCPAppsHostContextDetailsTheme
- type MCPAppsListToolsRequest
- type MCPAppsListToolsResult
- type MCPAppsReadResourceRequest
- type MCPAppsReadResourceResult
- type MCPAppsResourceContent
- type MCPAppsSetHostContextDetails
- type MCPAppsSetHostContextDetailsAvailableDisplayMode
- type MCPAppsSetHostContextDetailsDisplayMode
- type MCPAppsSetHostContextDetailsPlatform
- type MCPAppsSetHostContextDetailsTheme
- type MCPAppsSetHostContextRequest
- type MCPCancelSamplingExecutionParams
- type MCPCancelSamplingExecutionResult
- type MCPConfigAddRequest
- type MCPConfigAddResult
- type MCPConfigDisableRequest
- type MCPConfigDisableResult
- type MCPConfigEnableRequest
- type MCPConfigEnableResult
- type MCPConfigList
- type MCPConfigReloadResult
- type MCPConfigRemoveRequest
- type MCPConfigRemoveResult
- type MCPConfigUpdateRequest
- type MCPConfigUpdateResult
- type MCPConfigureGitHubRequest
- type MCPConfigureGitHubResult
- type MCPDisableRequest
- type MCPDiscoverRequest
- type MCPDiscoverResult
- type MCPEnableRequest
- type MCPExecuteSamplingParams
- type MCPExecuteSamplingRequest
- type MCPExecuteSamplingResult
- type MCPFilteredServer
- type MCPHostState
- type MCPIsServerRunningRequest
- type MCPIsServerRunningResult
- type MCPListToolsRequest
- type MCPListToolsResult
- type MCPOauthAPI
- type MCPOauthCompletedData
- type MCPOauthLoginRequest
- type MCPOauthLoginResult
- type MCPOauthRequiredData
- type MCPOauthRequiredStaticClientConfig
- type MCPOauthRequiredStaticClientConfigGrantType
- type MCPOauthRespondRequest
- type MCPOauthRespondResult
- type MCPRegisterExternalClientRequest
- type MCPReloadWithConfigRequest
- type MCPRemoveGitHubResult
- type MCPRestartServerRequest
- type MCPSamplingExecutionAction
- type MCPSamplingExecutionResult
- type MCPServer
- type MCPServerAuthConfig
- type MCPServerAuthConfigBoolean
- type MCPServerAuthConfigRedirectPort
- type MCPServerConfig
- type MCPServerConfigHTTP
- type MCPServerConfigHTTPOauthGrantType
- type MCPServerConfigHTTPType
- type MCPServerConfigStdio
- type MCPServerFailureInfo
- type MCPServerList
- type MCPServerNeedsAuthInfo
- type MCPServerSource
- type MCPServerStatus
- type MCPServerTransport
- type MCPServersLoadedServer
- type MCPSetEnvValueModeDetails
- type MCPSetEnvValueModeParams
- type MCPSetEnvValueModeResult
- type MCPStartServerRequest
- type MCPStartServersResult
- type MCPStopServerRequest
- type MCPTools
- type MCPUnregisterExternalClientRequest
- type MarketplaceAddResult
- type MarketplaceBrowseResult
- type MarketplaceInfo
- type MarketplaceListResult
- type MarketplacePluginInfo
- type MarketplaceRefreshEntry
- type MarketplaceRefreshResult
- type MarketplaceRemoveResult
- type MetadataAPI
- func (a *MetadataAPI) Activity(ctx context.Context) (*SessionActivity, error)
- func (a *MetadataAPI) ContextInfo(ctx context.Context, params *MetadataContextInfoRequest) (*MetadataContextInfoResult, error)
- func (a *MetadataAPI) IsProcessing(ctx context.Context) (*MetadataIsProcessingResult, error)
- func (a *MetadataAPI) RecomputeContextTokens(ctx context.Context, params *MetadataRecomputeContextTokensRequest) (*MetadataRecomputeContextTokensResult, error)
- func (a *MetadataAPI) RecordContextChange(ctx context.Context, params *MetadataRecordContextChangeRequest) (*MetadataRecordContextChangeResult, error)
- func (a *MetadataAPI) SetWorkingDirectory(ctx context.Context, params *MetadataSetWorkingDirectoryRequest) (*MetadataSetWorkingDirectoryResult, error)
- func (a *MetadataAPI) Snapshot(ctx context.Context) (*SessionMetadataSnapshot, error)
- type MetadataContextInfoRequest
- type MetadataContextInfoResult
- type MetadataIsProcessingResult
- type MetadataRecomputeContextTokensRequest
- type MetadataRecomputeContextTokensResult
- type MetadataRecordContextChangeRequest
- type MetadataRecordContextChangeResult
- type MetadataSetWorkingDirectoryRequest
- type MetadataSetWorkingDirectoryResult
- type MetadataSnapshotCurrentMode
- type MetadataSnapshotRemoteMetadata
- type MetadataSnapshotRemoteMetadataRepository
- type MetadataSnapshotRemoteMetadataTaskType
- type ModeAPI
- type ModeSetRequest
- type Model
- type ModelAPI
- func (a *ModelAPI) GetCurrent(ctx context.Context) (*CurrentModel, error)
- func (a *ModelAPI) List(ctx context.Context, params ...*ModelListRequest) (*SessionModelList, error)
- func (a *ModelAPI) SetReasoningEffort(ctx context.Context, params *ModelSetReasoningEffortRequest) (*ModelSetReasoningEffortResult, error)
- func (a *ModelAPI) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) (*ModelSwitchToResult, error)
- type ModelBilling
- type ModelBillingTokenPrices
- type ModelBillingTokenPricesLongContext
- type ModelCallFailureData
- type ModelCallFailureSource
- type ModelCapabilities
- type ModelCapabilitiesLimits
- type ModelCapabilitiesLimitsVision
- type ModelCapabilitiesOverride
- type ModelCapabilitiesOverrideLimits
- type ModelCapabilitiesOverrideLimitsVision
- type ModelCapabilitiesOverrideSupports
- type ModelCapabilitiesSupports
- type ModelList
- type ModelListRequest
- type ModelPickerCategory
- type ModelPickerPriceCategory
- type ModelPolicy
- type ModelPolicyState
- type ModelSetReasoningEffortRequest
- type ModelSetReasoningEffortResult
- type ModelSwitchToRequest
- type ModelSwitchToResult
- type ModelsListRequest
- type NameAPI
- type NameGetResult
- type NameSetAutoRequest
- type NameSetAutoResult
- type NameSetRequest
- type OpenCanvasInstance
- type OptionsAPI
- type OptionsUpdateAdditionalContentExclusionPolicy
- type OptionsUpdateAdditionalContentExclusionPolicyRule
- type OptionsUpdateAdditionalContentExclusionPolicyRuleSource
- type OptionsUpdateAdditionalContentExclusionPolicyScope
- type OptionsUpdateContextTier
- type OptionsUpdateEnvValueMode
- type OptionsUpdateReasoningSummary
- type OptionsUpdateToolFilterPrecedence
- type PendingMessagesModifiedData
- type PendingPermissionRequest
- type PendingPermissionRequestList
- type PermissionApproved
- type PermissionApprovedForLocation
- type PermissionApprovedForSession
- type PermissionCancelled
- type PermissionCompletedData
- type PermissionDecision
- type PermissionDecisionApproveForLocation
- type PermissionDecisionApproveForLocationApproval
- type PermissionDecisionApproveForLocationApprovalCommands
- type PermissionDecisionApproveForLocationApprovalCustomTool
- type PermissionDecisionApproveForLocationApprovalExtensionManagement
- type PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess
- type PermissionDecisionApproveForLocationApprovalKind
- type PermissionDecisionApproveForLocationApprovalMCP
- type PermissionDecisionApproveForLocationApprovalMCPSampling
- type PermissionDecisionApproveForLocationApprovalMemory
- type PermissionDecisionApproveForLocationApprovalRead
- type PermissionDecisionApproveForLocationApprovalWrite
- type PermissionDecisionApproveForSession
- type PermissionDecisionApproveForSessionApproval
- type PermissionDecisionApproveForSessionApprovalCommands
- type PermissionDecisionApproveForSessionApprovalCustomTool
- type PermissionDecisionApproveForSessionApprovalExtensionManagement
- type PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess
- type PermissionDecisionApproveForSessionApprovalKind
- type PermissionDecisionApproveForSessionApprovalMCP
- type PermissionDecisionApproveForSessionApprovalMCPSampling
- type PermissionDecisionApproveForSessionApprovalMemory
- type PermissionDecisionApproveForSessionApprovalRead
- type PermissionDecisionApproveForSessionApprovalWrite
- type PermissionDecisionApproveOnce
- type PermissionDecisionApprovePermanently
- type PermissionDecisionApproved
- type PermissionDecisionApprovedForLocation
- type PermissionDecisionApprovedForSession
- type PermissionDecisionCancelled
- type PermissionDecisionDeniedByContentExclusionPolicy
- type PermissionDecisionDeniedByPermissionRequestHook
- type PermissionDecisionDeniedByRules
- type PermissionDecisionDeniedInteractivelyByUser
- type PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser
- type PermissionDecisionKind
- type PermissionDecisionNoResult
- type PermissionDecisionReject
- type PermissionDecisionRequest
- type PermissionDecisionUserNotAvailable
- type PermissionDeniedByContentExclusionPolicy
- type PermissionDeniedByPermissionRequestHook
- type PermissionDeniedByRules
- type PermissionDeniedInteractivelyByUser
- type PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser
- type PermissionLocationAddToolApprovalParams
- type PermissionLocationApplyParams
- type PermissionLocationApplyResult
- type PermissionLocationResolveParams
- type PermissionLocationResolveResult
- type PermissionLocationType
- type PermissionPathsAddParams
- type PermissionPathsAllowedCheckParams
- type PermissionPathsAllowedCheckResult
- type PermissionPathsConfig
- type PermissionPathsList
- type PermissionPathsUpdatePrimaryParams
- type PermissionPathsWorkspaceCheckParams
- type PermissionPathsWorkspaceCheckResult
- type PermissionPromptRequest
- type PermissionPromptRequestCommands
- type PermissionPromptRequestCustomTool
- type PermissionPromptRequestExtensionManagement
- type PermissionPromptRequestExtensionPermissionAccess
- type PermissionPromptRequestHook
- type PermissionPromptRequestKind
- type PermissionPromptRequestMCP
- type PermissionPromptRequestMemory
- type PermissionPromptRequestPath
- type PermissionPromptRequestPathAccessKind
- type PermissionPromptRequestRead
- type PermissionPromptRequestURL
- type PermissionPromptRequestWrite
- type PermissionPromptShownNotification
- type PermissionRequest
- type PermissionRequestCommand
- type PermissionRequestCustomTool
- type PermissionRequestExtensionManagement
- type PermissionRequestExtensionPermissionAccess
- type PermissionRequestHook
- type PermissionRequestKind
- type PermissionRequestMCP
- type PermissionRequestMemory
- type PermissionRequestMemoryAction
- type PermissionRequestMemoryDirection
- type PermissionRequestRead
- type PermissionRequestResult
- type PermissionRequestShell
- type PermissionRequestShellCommand
- type PermissionRequestShellPossibleURL
- type PermissionRequestURL
- type PermissionRequestWrite
- type PermissionRequestedData
- type PermissionResult
- type PermissionResultKind
- type PermissionRule
- type PermissionRulesSet
- type PermissionURLsConfig
- type PermissionURLsSetUnrestrictedModeParams
- type PermissionsAPI
- func (a *PermissionsAPI) Configure(ctx context.Context, params *PermissionsConfigureParams) (*PermissionsConfigureResult, error)
- func (s *PermissionsAPI) FolderTrust() *PermissionsFolderTrustAPI
- func (a *PermissionsAPI) GetAllowAll(ctx context.Context) (*AllowAllPermissionState, error)
- func (a *PermissionsAPI) HandlePendingPermissionRequest(ctx context.Context, params *PermissionDecisionRequest) (*PermissionRequestResult, error)
- func (s *PermissionsAPI) Locations() *PermissionsLocationsAPI
- func (a *PermissionsAPI) ModifyRules(ctx context.Context, params *PermissionsModifyRulesParams) (*PermissionsModifyRulesResult, error)
- func (a *PermissionsAPI) NotifyPromptShown(ctx context.Context, params *PermissionPromptShownNotification) (*PermissionsNotifyPromptShownResult, error)
- func (s *PermissionsAPI) Paths() *PermissionsPathsAPI
- func (a *PermissionsAPI) PendingRequests(ctx context.Context) (*PendingPermissionRequestList, error)
- func (a *PermissionsAPI) ResetSessionApprovals(ctx context.Context) (*PermissionsResetSessionApprovalsResult, error)
- func (a *PermissionsAPI) SetAllowAll(ctx context.Context, params *PermissionsSetAllowAllRequest) (*AllowAllPermissionSetResult, error)
- func (a *PermissionsAPI) SetApproveAll(ctx context.Context, params *PermissionsSetApproveAllRequest) (*PermissionsSetApproveAllResult, error)
- func (a *PermissionsAPI) SetRequired(ctx context.Context, params *PermissionsSetRequiredRequest) (*PermissionsSetRequiredResult, error)
- func (s *PermissionsAPI) URLs() *PermissionsURLsAPI
- type PermissionsConfigureAdditionalContentExclusionPolicy
- type PermissionsConfigureAdditionalContentExclusionPolicyRule
- type PermissionsConfigureAdditionalContentExclusionPolicyRuleSource
- type PermissionsConfigureAdditionalContentExclusionPolicyScope
- type PermissionsConfigureParams
- type PermissionsConfigureResult
- type PermissionsFolderTrustAPI
- type PermissionsFolderTrustAddTrustedResult
- type PermissionsGetAllowAllRequest
- type PermissionsLocationsAPI
- func (a *PermissionsLocationsAPI) AddToolApproval(ctx context.Context, params *PermissionLocationAddToolApprovalParams) (*PermissionsLocationsAddToolApprovalResult, error)
- func (a *PermissionsLocationsAPI) Apply(ctx context.Context, params *PermissionLocationApplyParams) (*PermissionLocationApplyResult, error)
- func (a *PermissionsLocationsAPI) Resolve(ctx context.Context, params *PermissionLocationResolveParams) (*PermissionLocationResolveResult, error)
- type PermissionsLocationsAddToolApprovalDetails
- type PermissionsLocationsAddToolApprovalDetailsCommands
- type PermissionsLocationsAddToolApprovalDetailsCustomTool
- type PermissionsLocationsAddToolApprovalDetailsExtensionManagement
- type PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess
- type PermissionsLocationsAddToolApprovalDetailsKind
- type PermissionsLocationsAddToolApprovalDetailsMCP
- type PermissionsLocationsAddToolApprovalDetailsMCPSampling
- type PermissionsLocationsAddToolApprovalDetailsMemory
- type PermissionsLocationsAddToolApprovalDetailsRead
- type PermissionsLocationsAddToolApprovalDetailsWrite
- type PermissionsLocationsAddToolApprovalResult
- type PermissionsModifyRulesParams
- type PermissionsModifyRulesResult
- type PermissionsModifyRulesScope
- type PermissionsNotifyPromptShownResult
- type PermissionsPathsAPI
- func (a *PermissionsPathsAPI) Add(ctx context.Context, params *PermissionPathsAddParams) (*PermissionsPathsAddResult, error)
- func (a *PermissionsPathsAPI) IsPathWithinAllowedDirectories(ctx context.Context, params *PermissionPathsAllowedCheckParams) (*PermissionPathsAllowedCheckResult, error)
- func (a *PermissionsPathsAPI) IsPathWithinWorkspace(ctx context.Context, params *PermissionPathsWorkspaceCheckParams) (*PermissionPathsWorkspaceCheckResult, error)
- func (a *PermissionsPathsAPI) List(ctx context.Context) (*PermissionPathsList, error)
- func (a *PermissionsPathsAPI) UpdatePrimary(ctx context.Context, params *PermissionPathsUpdatePrimaryParams) (*PermissionsPathsUpdatePrimaryResult, error)
- type PermissionsPathsAddResult
- type PermissionsPathsListRequest
- type PermissionsPathsUpdatePrimaryResult
- type PermissionsPendingRequestsRequest
- type PermissionsResetSessionApprovalsRequest
- type PermissionsResetSessionApprovalsResult
- type PermissionsSetAllowAllRequest
- type PermissionsSetAllowAllSource
- type PermissionsSetApproveAllRequest
- type PermissionsSetApproveAllResult
- type PermissionsSetApproveAllSource
- type PermissionsSetRequiredRequest
- type PermissionsSetRequiredResult
- type PermissionsURLsAPI
- type PermissionsURLsSetUnrestrictedModeResult
- type PingRequest
- type PingResult
- type PlanAPI
- func (a *PlanAPI) Delete(ctx context.Context) (*SessionPlanDeleteResult, error)
- func (a *PlanAPI) Read(ctx context.Context) (*PlanReadResult, error)
- func (a *PlanAPI) ReadSqlTodos(ctx context.Context) (*PlanReadSQLTodosResult, error)
- func (a *PlanAPI) Update(ctx context.Context, params *PlanUpdateRequest) (*SessionPlanUpdateResult, error)
- type PlanChangedOperation
- type PlanReadResult
- type PlanReadSQLTodosResult
- type PlanSQLTodosRow
- type PlanUpdateRequest
- type Plugin
- type PluginInstallResult
- type PluginList
- type PluginListResult
- type PluginUpdateAllEntry
- type PluginUpdateAllResult
- type PluginUpdateResult
- type PluginsAPI
- type PluginsDisableRequest
- type PluginsDisableResult
- type PluginsEnableRequest
- type PluginsEnableResult
- type PluginsInstallRequest
- type PluginsMarketplacesAddRequest
- type PluginsMarketplacesBrowseRequest
- type PluginsMarketplacesRefreshRequest
- type PluginsMarketplacesRemoveRequest
- type PluginsReloadRequest
- type PluginsUninstallRequest
- type PluginsUninstallResult
- type PluginsUpdateRequest
- type PollSpawnedSessionsResult
- type PossibleURL
- type ProviderConfig
- type ProviderConfigAzure
- type ProviderConfigType
- type ProviderConfigWireAPI
- type PushAttachment
- type PushAttachmentBlob
- type PushAttachmentDirectory
- type PushAttachmentFile
- type PushAttachmentFileLineRange
- type PushAttachmentGitHubReference
- type PushAttachmentGitHubReferenceType
- type PushAttachmentSelection
- type PushAttachmentSelectionDetails
- type PushAttachmentSelectionDetailsEnd
- type PushAttachmentSelectionDetailsStart
- type PushAttachmentType
- type QueueAPI
- type QueuePendingItems
- type QueuePendingItemsKind
- type QueuePendingItemsResult
- type QueueRemoveMostRecentResult
- type QueuedCommandHandled
- type QueuedCommandNotHandled
- type QueuedCommandResult
- type RawAgentRegistrySpawnResultData
- type RawAttachmentData
- type RawAuthInfoData
- type RawExternalToolTextResultForLlmContentData
- type RawExternalToolTextResultForLlmContentResourceDetailsData
- type RawMCPServerConfigData
- type RawPermissionDecisionApproveForLocationApprovalData
- type RawPermissionDecisionApproveForSessionApprovalData
- type RawPermissionDecisionData
- type RawPermissionPromptRequest
- type RawPermissionRequest
- type RawPermissionResult
- type RawPermissionsLocationsAddToolApprovalDetailsData
- type RawPushAttachmentData
- type RawRemoteControlStatusData
- type RawSessionEventData
- type RawSessionOpenParamsData
- type RawSlashCommandInvocationResultData
- type RawSystemNotification
- type RawTaskInfoData
- type RawTaskProgressData
- type RawToolExecutionCompleteContent
- type RawUIElicitationSchemaPropertyData
- type RawUserToolSessionApprovalData
- type ReasoningSummary
- type RegisterEventInterestParams
- type RegisterEventInterestResult
- type RegisterExtensionToolsParams
- type RegisterExtensionToolsResult
- type ReleaseEventInterestParams
- type RemoteAPI
- func (a *RemoteAPI) Disable(ctx context.Context) (*SessionRemoteDisableResult, error)
- func (a *RemoteAPI) Enable(ctx context.Context, params *RemoteEnableRequest) (*RemoteEnableResult, error)
- func (a *RemoteAPI) NotifySteerableChanged(ctx context.Context, params *RemoteNotifySteerableChangedRequest) (*RemoteNotifySteerableChangedResult, error)
- type RemoteControlConfig
- type RemoteControlConfigExistingMcSession
- type RemoteControlStatus
- type RemoteControlStatusActive
- type RemoteControlStatusConnecting
- type RemoteControlStatusError
- type RemoteControlStatusOff
- type RemoteControlStatusResult
- type RemoteControlStatusState
- type RemoteControlStopResult
- type RemoteControlTransferResult
- type RemoteEnableRequest
- type RemoteEnableResult
- type RemoteNotifySteerableChangedRequest
- type RemoteNotifySteerableChangedResult
- type RemoteSessionConnectionResult
- type RemoteSessionMetadataRepository
- type RemoteSessionMetadataTaskType
- type RemoteSessionMetadataValue
- type RemoteSessionMode
- type RemoteSessionRepository
- type RuntimeShutdownResult
- type SamplingCompletedData
- type SamplingRequestedData
- type SandboxConfig
- type SandboxConfigUserPolicy
- type SandboxConfigUserPolicyExperimental
- type SandboxConfigUserPolicyExperimentalSeatbelt
- type SandboxConfigUserPolicyFilesystem
- type SandboxConfigUserPolicyNetwork
- type ScheduleAPI
- type ScheduleEntry
- type ScheduleList
- type ScheduleStopRequest
- type ScheduleStopResult
- type SecretsAddFilterValuesRequest
- type SecretsAddFilterValuesResult
- type SendAgentMode
- type SendAttachmentsToMessageParams
- type SendMode
- type SendRequest
- type SendResult
- type ServerAccountAPI
- type ServerAgentList
- type ServerAgentRegistryAPI
- type ServerAgentsAPI
- type ServerInstructionSourceList
- type ServerInstructionsAPI
- type ServerMCPAPI
- type ServerMCPConfigAPI
- func (a *ServerMCPConfigAPI) Add(ctx context.Context, params *MCPConfigAddRequest) (*MCPConfigAddResult, error)
- func (a *ServerMCPConfigAPI) Disable(ctx context.Context, params *MCPConfigDisableRequest) (*MCPConfigDisableResult, error)
- func (a *ServerMCPConfigAPI) Enable(ctx context.Context, params *MCPConfigEnableRequest) (*MCPConfigEnableResult, error)
- func (a *ServerMCPConfigAPI) List(ctx context.Context) (*MCPConfigList, error)
- func (a *ServerMCPConfigAPI) Reload(ctx context.Context) (*MCPConfigReloadResult, error)
- func (a *ServerMCPConfigAPI) Remove(ctx context.Context, params *MCPConfigRemoveRequest) (*MCPConfigRemoveResult, error)
- func (a *ServerMCPConfigAPI) Update(ctx context.Context, params *MCPConfigUpdateRequest) (*MCPConfigUpdateResult, error)
- type ServerModelsAPI
- type ServerPluginsAPI
- func (a *ServerPluginsAPI) Disable(ctx context.Context, params *PluginsDisableRequest) (*PluginsDisableResult, error)
- func (a *ServerPluginsAPI) Enable(ctx context.Context, params *PluginsEnableRequest) (*PluginsEnableResult, error)
- func (a *ServerPluginsAPI) Install(ctx context.Context, params *PluginsInstallRequest) (*PluginInstallResult, error)
- func (a *ServerPluginsAPI) List(ctx context.Context) (*PluginListResult, error)
- func (s *ServerPluginsAPI) Marketplaces() *ServerPluginsMarketplacesAPI
- func (a *ServerPluginsAPI) Uninstall(ctx context.Context, params *PluginsUninstallRequest) (*PluginsUninstallResult, error)
- func (a *ServerPluginsAPI) Update(ctx context.Context, params *PluginsUpdateRequest) (*PluginUpdateResult, error)
- func (a *ServerPluginsAPI) UpdateAll(ctx context.Context) (*PluginUpdateAllResult, error)
- type ServerPluginsMarketplacesAPI
- func (a *ServerPluginsMarketplacesAPI) Add(ctx context.Context, params *PluginsMarketplacesAddRequest) (*MarketplaceAddResult, error)
- func (a *ServerPluginsMarketplacesAPI) Browse(ctx context.Context, params *PluginsMarketplacesBrowseRequest) (*MarketplaceBrowseResult, error)
- func (a *ServerPluginsMarketplacesAPI) List(ctx context.Context) (*MarketplaceListResult, error)
- func (a *ServerPluginsMarketplacesAPI) Refresh(ctx context.Context, params *PluginsMarketplacesRefreshRequest) (*MarketplaceRefreshResult, error)
- func (a *ServerPluginsMarketplacesAPI) Remove(ctx context.Context, params *PluginsMarketplacesRemoveRequest) (*MarketplaceRemoveResult, error)
- type ServerRPC
- type ServerRuntimeAPI
- type ServerSecretsAPI
- type ServerSessionFSAPI
- type ServerSessionsAPI
- func (a *ServerSessionsAPI) BulkDelete(ctx context.Context, params *SessionsBulkDeleteRequest) (*SessionBulkDeleteResult, error)
- func (a *ServerSessionsAPI) CheckInUse(ctx context.Context, params *SessionsCheckInUseRequest) (*SessionsCheckInUseResult, error)
- func (a *ServerSessionsAPI) Close(ctx context.Context, params *SessionsCloseRequest) (*SessionsCloseResult, error)
- func (a *ServerSessionsAPI) Connect(ctx context.Context, params *ConnectRemoteSessionParams) (*RemoteSessionConnectionResult, error)
- func (a *ServerSessionsAPI) EnrichMetadata(ctx context.Context, params *SessionsEnrichMetadataRequest) (*SessionEnrichMetadataResult, error)
- func (a *ServerSessionsAPI) FindByPrefix(ctx context.Context, params *SessionsFindByPrefixRequest) (*SessionsFindByPrefixResult, error)
- func (a *ServerSessionsAPI) FindByTaskId(ctx context.Context, params *SessionsFindByTaskIDRequest) (*SessionsFindByTaskIDResult, error)
- func (a *ServerSessionsAPI) Fork(ctx context.Context, params *SessionsForkRequest) (*SessionsForkResult, error)
- func (a *ServerSessionsAPI) GetLastForContext(ctx context.Context, params *SessionsGetLastForContextRequest) (*SessionsGetLastForContextResult, error)
- func (a *ServerSessionsAPI) GetRemoteControlStatus(ctx context.Context) (*RemoteControlStatusResult, error)
- func (a *ServerSessionsAPI) GetSizes(ctx context.Context) (*SessionSizes, error)
- func (a *ServerSessionsAPI) List(ctx context.Context, params *SessionsListRequest) (*SessionList, error)
- func (a *ServerSessionsAPI) LoadDeferredRepoHooks(ctx context.Context, params *SessionsLoadDeferredRepoHooksRequest) (*SessionLoadDeferredRepoHooksResult, error)
- func (a *ServerSessionsAPI) Open(ctx context.Context, params *SessionOpenParams) (*SessionOpenResult, error)
- func (a *ServerSessionsAPI) PruneOld(ctx context.Context, params *SessionsPruneOldRequest) (*SessionPruneResult, error)
- func (a *ServerSessionsAPI) ReleaseLock(ctx context.Context, params *SessionsReleaseLockRequest) (*SessionsReleaseLockResult, error)
- func (a *ServerSessionsAPI) ReloadPluginHooks(ctx context.Context, params *SessionsReloadPluginHooksRequest) (*SessionsReloadPluginHooksResult, error)
- func (a *ServerSessionsAPI) Save(ctx context.Context, params *SessionsSaveRequest) (*SessionsSaveResult, error)
- func (a *ServerSessionsAPI) SetAdditionalPlugins(ctx context.Context, params *SessionsSetAdditionalPluginsRequest) (*SessionsSetAdditionalPluginsResult, error)
- func (a *ServerSessionsAPI) SetRemoteControlSteering(ctx context.Context, params *SessionsSetRemoteControlSteeringRequest) (*RemoteControlStatusResult, error)
- func (a *ServerSessionsAPI) StartRemoteControl(ctx context.Context, params *SessionsStartRemoteControlRequest) (*RemoteControlStatusResult, error)
- func (a *ServerSessionsAPI) StopRemoteControl(ctx context.Context, params *SessionsStopRemoteControlRequest) (*RemoteControlStopResult, error)
- func (a *ServerSessionsAPI) TransferRemoteControl(ctx context.Context, params *SessionsTransferRemoteControlRequest) (*RemoteControlTransferResult, error)
- type ServerSkill
- type ServerSkillList
- type ServerSkillsAPI
- type ServerSkillsConfigAPI
- type ServerToolsAPI
- type ServerUserAPI
- type ServerUserSettingsAPI
- type SessionActivity
- type SessionAgentDeselectResult
- type SessionAuthStatus
- type SessionAutopilotObjectiveChangedData
- type SessionBackgroundTasksChangedData
- type SessionBulkDeleteResult
- type SessionCanvasCloseResult
- type SessionCanvasClosedData
- type SessionCanvasOpenedData
- type SessionCanvasRegistryChangedData
- type SessionCapability
- type SessionCompactionCompleteData
- type SessionCompactionStartData
- type SessionContext
- type SessionContextChangedData
- type SessionContextHostType
- type SessionContextInfo
- type SessionCustomAgentsUpdatedData
- type SessionCustomNotificationData
- type SessionEnrichMetadataResult
- type SessionErrorData
- type SessionEvent
- type SessionEventData
- type SessionEventType
- type SessionExtensionsAttachmentsPushedData
- type SessionExtensionsDisableResult
- type SessionExtensionsEnableResult
- type SessionExtensionsLoadedData
- type SessionExtensionsReloadResult
- type SessionExtensionsSendAttachmentsToMessageResult
- type SessionFSAppendFileRequest
- type SessionFSError
- type SessionFSErrorCode
- type SessionFSExistsRequest
- type SessionFSExistsResult
- type SessionFSHandler
- type SessionFSMkdirRequest
- type SessionFSReadFileRequest
- type SessionFSReadFileResult
- type SessionFSReaddirRequest
- type SessionFSReaddirResult
- type SessionFSReaddirWithTypesEntry
- type SessionFSReaddirWithTypesEntryType
- type SessionFSReaddirWithTypesRequest
- type SessionFSReaddirWithTypesResult
- type SessionFSRenameRequest
- type SessionFSRmRequest
- type SessionFSSetProviderCapabilities
- type SessionFSSetProviderConventions
- type SessionFSSetProviderRequest
- type SessionFSSetProviderResult
- type SessionFSSqliteExistsRequest
- type SessionFSSqliteExistsResult
- type SessionFSSqliteQueryRequest
- type SessionFSSqliteQueryResult
- type SessionFSSqliteQueryType
- type SessionFSStatRequest
- type SessionFSStatResult
- type SessionFSWriteFileRequest
- type SessionHandoffData
- type SessionIdleData
- type SessionInfoData
- type SessionInstalledPlugin
- type SessionInstalledPluginSource
- type SessionInstalledPluginSourceGitHub
- type SessionInstalledPluginSourceGitHubSource
- type SessionInstalledPluginSourceLocal
- type SessionInstalledPluginSourceLocalSource
- type SessionInstalledPluginSourceURL
- type SessionInstalledPluginSourceURLSource
- type SessionList
- type SessionListEntry
- type SessionListFilter
- type SessionLoadDeferredRepoHooksResult
- type SessionLogLevel
- type SessionLspInitializeResult
- type SessionMCPAppsCallToolResult
- type SessionMCPAppsSetHostContextResult
- type SessionMCPDisableResult
- type SessionMCPEnableResult
- type SessionMCPRegisterExternalClientResult
- type SessionMCPReloadResult
- type SessionMCPRestartServerResult
- type SessionMCPServerStatusChangedData
- type SessionMCPServersLoadedData
- type SessionMCPStartServerResult
- type SessionMCPStopServerResult
- type SessionMCPUnregisterExternalClientResult
- type SessionMetadataSnapshot
- type SessionMode
- type SessionModeChangedData
- type SessionModeSetResult
- type SessionModelChangeData
- type SessionModelList
- type SessionNameSetResult
- type SessionOpenOptions
- type SessionOpenOptionsAdditionalContentExclusionPolicy
- type SessionOpenOptionsAdditionalContentExclusionPolicyRule
- type SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource
- type SessionOpenOptionsAdditionalContentExclusionPolicyScope
- type SessionOpenOptionsEnvValueMode
- type SessionOpenOptionsReasoningSummary
- type SessionOpenParams
- type SessionOpenParamsKind
- type SessionOpenResult
- type SessionPermissionsChangedData
- type SessionPlanChangedData
- type SessionPlanDeleteResult
- type SessionPlanUpdateResult
- type SessionPluginsReloadResult
- type SessionPruneResult
- type SessionQueueClearResult
- type SessionRPC
- func (a *SessionRPC) Abort(ctx context.Context, params *AbortRequest) (*AbortResult, error)
- func (a *SessionRPC) Log(ctx context.Context, params *LogRequest) (*LogResult, error)
- func (a *SessionRPC) Send(ctx context.Context, params *SendRequest) (*SendResult, error)
- func (a *SessionRPC) Shutdown(ctx context.Context, params *ShutdownRequest) (*SessionShutdownResult, error)
- func (a *SessionRPC) Suspend(ctx context.Context) (*SessionSuspendResult, error)
- type SessionRemoteDisableResult
- type SessionRemoteSteerableChangedData
- type SessionResumeData
- type SessionScheduleCancelledData
- type SessionScheduleCreatedData
- type SessionSetCredentialsParams
- type SessionSetCredentialsResult
- type SessionShutdownData
- type SessionShutdownResult
- type SessionSizes
- type SessionSkillsDisableResult
- type SessionSkillsEnableResult
- type SessionSkillsEnsureLoadedResult
- type SessionSkillsLoadedData
- type SessionSnapshotRewindData
- type SessionSource
- type SessionStartData
- type SessionSuspendResult
- type SessionTaskCompleteData
- type SessionTelemetryEngagement
- type SessionTelemetrySetFeatureOverridesResult
- type SessionTitleChangedData
- type SessionToolsUpdatedData
- type SessionTruncationData
- type SessionUpdateOptionsParams
- type SessionUpdateOptionsResult
- type SessionUsageInfoData
- type SessionWarningData
- type SessionWorkingDirectoryContext
- type SessionWorkingDirectoryContextHostType
- type SessionWorkspaceFileChangedData
- type SessionWorkspacesCreateFileResult
- type SessionsBulkDeleteRequest
- type SessionsCheckInUseRequest
- type SessionsCheckInUseResult
- type SessionsCloseRequest
- type SessionsCloseResult
- type SessionsConfigureSessionExtensionsResult
- type SessionsEnrichMetadataRequest
- type SessionsFindByPrefixRequest
- type SessionsFindByPrefixResult
- type SessionsFindByTaskIDRequest
- type SessionsFindByTaskIDResult
- type SessionsForkRequest
- type SessionsForkResult
- type SessionsGetBoardEntryCountRequest
- type SessionsGetBoardEntryCountResult
- type SessionsGetEventFilePathRequest
- type SessionsGetEventFilePathResult
- type SessionsGetLastForContextRequest
- type SessionsGetLastForContextResult
- type SessionsGetPersistedRemoteSteerableRequest
- type SessionsGetPersistedRemoteSteerableResult
- type SessionsListRequest
- type SessionsLoadDeferredRepoHooksRequest
- type SessionsOpenAttach
- type SessionsOpenCloud
- type SessionsOpenCreate
- type SessionsOpenHandoff
- type SessionsOpenHandoffTaskType
- type SessionsOpenProgress
- type SessionsOpenProgressStatus
- type SessionsOpenProgressStep
- type SessionsOpenRemote
- type SessionsOpenResume
- type SessionsOpenResumeLast
- type SessionsOpenStatus
- type SessionsPollSpawnedSessionsEvent
- type SessionsPollSpawnedSessionsRequest
- type SessionsPruneOldRequest
- type SessionsRegisterExtensionToolsOnSessionOptions
- type SessionsReleaseLockRequest
- type SessionsReleaseLockResult
- type SessionsReloadPluginHooksRequest
- type SessionsReloadPluginHooksResult
- type SessionsSaveRequest
- type SessionsSaveResult
- type SessionsSetAdditionalPluginsRequest
- type SessionsSetAdditionalPluginsResult
- type SessionsSetRemoteControlSteeringRequest
- type SessionsStartRemoteControlRequest
- type SessionsStopRemoteControlRequest
- type SessionsTransferRemoteControlRequest
- type ShellAPI
- func (a *ShellAPI) CancelUserRequested(ctx context.Context, params *ShellCancelUserRequestedRequest) (*CancelUserRequestedShellCommandResult, error)
- func (a *ShellAPI) Exec(ctx context.Context, params *ShellExecRequest) (*ShellExecResult, error)
- func (a *ShellAPI) ExecuteUserRequested(ctx context.Context, params *ShellExecuteUserRequestedRequest) (*UserRequestedShellCommandResult, error)
- func (a *ShellAPI) Kill(ctx context.Context, params *ShellKillRequest) (*ShellKillResult, error)
- type ShellCancelUserRequestedRequest
- type ShellExecRequest
- type ShellExecResult
- type ShellExecuteUserRequestedRequest
- type ShellKillRequest
- type ShellKillResult
- type ShellKillSignal
- type ShutdownCodeChanges
- type ShutdownModelMetric
- type ShutdownModelMetricRequests
- type ShutdownModelMetricTokenDetail
- type ShutdownModelMetricUsage
- type ShutdownRequest
- type ShutdownTokenDetail
- type ShutdownType
- type Skill
- type SkillInvokedData
- type SkillInvokedTrigger
- type SkillList
- type SkillSource
- type SkillsAPI
- func (a *SkillsAPI) Disable(ctx context.Context, params *SkillsDisableRequest) (*SessionSkillsDisableResult, error)
- func (a *SkillsAPI) Enable(ctx context.Context, params *SkillsEnableRequest) (*SessionSkillsEnableResult, error)
- func (a *SkillsAPI) EnsureLoaded(ctx context.Context) (*SessionSkillsEnsureLoadedResult, error)
- func (a *SkillsAPI) GetInvoked(ctx context.Context) (*SkillsGetInvokedResult, error)
- func (a *SkillsAPI) List(ctx context.Context) (*SkillList, error)
- func (a *SkillsAPI) Reload(ctx context.Context) (*SkillsLoadDiagnostics, error)
- type SkillsConfigSetDisabledSkillsRequest
- type SkillsConfigSetDisabledSkillsResult
- type SkillsDisableRequest
- type SkillsDiscoverRequest
- type SkillsEnableRequest
- type SkillsGetInvokedResult
- type SkillsInvokedSkill
- type SkillsLoadDiagnostics
- type SkillsLoadedSkill
- type SlashCommandAgentPromptResult
- type SlashCommandCompletedResult
- type SlashCommandInfo
- type SlashCommandInput
- type SlashCommandInputCompletion
- type SlashCommandInvocationResult
- type SlashCommandInvocationResultKind
- type SlashCommandKind
- type SlashCommandSelectSubcommandOption
- type SlashCommandSelectSubcommandResult
- type SlashCommandTextResult
- type SubagentCompletedData
- type SubagentDeselectedData
- type SubagentFailedData
- type SubagentSelectedData
- type SubagentStartedData
- type SystemMessageData
- type SystemMessageMetadata
- type SystemMessageRole
- type SystemNotification
- type SystemNotificationAgentCompleted
- type SystemNotificationAgentCompletedStatus
- type SystemNotificationAgentIdle
- type SystemNotificationData
- type SystemNotificationInstructionDiscovered
- type SystemNotificationNewInboxMessage
- type SystemNotificationShellCompleted
- type SystemNotificationShellDetachedCompleted
- type SystemNotificationType
- type TaskAgentInfo
- type TaskAgentProgress
- type TaskExecutionMode
- type TaskInfo
- type TaskInfoType
- type TaskList
- type TaskProgress
- type TaskProgressLine
- type TaskProgressType
- type TaskShellInfo
- type TaskShellInfoAttachmentMode
- type TaskShellProgress
- type TaskStatus
- type TasksAPI
- func (a *TasksAPI) Cancel(ctx context.Context, params *TasksCancelRequest) (*TasksCancelResult, error)
- func (a *TasksAPI) GetCurrentPromotable(ctx context.Context) (*TasksGetCurrentPromotableResult, error)
- func (a *TasksAPI) GetProgress(ctx context.Context, params *TasksGetProgressRequest) (*TasksGetProgressResult, error)
- func (a *TasksAPI) List(ctx context.Context) (*TaskList, error)
- func (a *TasksAPI) PromoteCurrentToBackground(ctx context.Context) (*TasksPromoteCurrentToBackgroundResult, error)
- func (a *TasksAPI) PromoteToBackground(ctx context.Context, params *TasksPromoteToBackgroundRequest) (*TasksPromoteToBackgroundResult, error)
- func (a *TasksAPI) Refresh(ctx context.Context) (*TasksRefreshResult, error)
- func (a *TasksAPI) Remove(ctx context.Context, params *TasksRemoveRequest) (*TasksRemoveResult, error)
- func (a *TasksAPI) SendMessage(ctx context.Context, params *TasksSendMessageRequest) (*TasksSendMessageResult, error)
- func (a *TasksAPI) StartAgent(ctx context.Context, params *TasksStartAgentRequest) (*TasksStartAgentResult, error)
- func (a *TasksAPI) WaitForPending(ctx context.Context) (*TasksWaitForPendingResult, error)
- type TasksCancelRequest
- type TasksCancelResult
- type TasksGetCurrentPromotableResult
- type TasksGetProgressRequest
- type TasksGetProgressResult
- type TasksPromoteCurrentToBackgroundResult
- type TasksPromoteToBackgroundRequest
- type TasksPromoteToBackgroundResult
- type TasksRefreshResult
- type TasksRemoveRequest
- type TasksRemoveResult
- type TasksSendMessageRequest
- type TasksSendMessageResult
- type TasksStartAgentRequest
- type TasksStartAgentResult
- type TasksWaitForPendingResult
- type TelemetryAPI
- type TelemetrySetFeatureOverridesRequest
- type TokenAuthInfo
- type Tool
- type ToolExecutionCompleteContent
- type ToolExecutionCompleteContentAudio
- type ToolExecutionCompleteContentImage
- type ToolExecutionCompleteContentResource
- type ToolExecutionCompleteContentResourceDetails
- type ToolExecutionCompleteContentResourceLink
- type ToolExecutionCompleteContentResourceLinkIcon
- type ToolExecutionCompleteContentResourceLinkIconTheme
- type ToolExecutionCompleteContentTerminal
- type ToolExecutionCompleteContentText
- type ToolExecutionCompleteContentType
- type ToolExecutionCompleteData
- type ToolExecutionCompleteError
- type ToolExecutionCompleteResult
- type ToolExecutionCompleteToolDescription
- type ToolExecutionCompleteToolDescriptionMeta
- type ToolExecutionCompleteToolDescriptionMetaUI
- type ToolExecutionCompleteToolDescriptionMetaUIVisibility
- type ToolExecutionCompleteUIResource
- type ToolExecutionCompleteUIResourceMeta
- type ToolExecutionCompleteUIResourceMetaUI
- type ToolExecutionCompleteUIResourceMetaUICsp
- type ToolExecutionCompleteUIResourceMetaUIPermissions
- type ToolExecutionCompleteUIResourceMetaUIPermissionsCamera
- type ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite
- type ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation
- type ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone
- type ToolExecutionPartialResultData
- type ToolExecutionProgressData
- type ToolExecutionStartData
- type ToolList
- type ToolUserRequestedData
- type ToolsAPI
- func (a *ToolsAPI) GetCurrentMetadata(ctx context.Context) (*ToolsGetCurrentMetadataResult, error)
- func (a *ToolsAPI) HandlePendingToolCall(ctx context.Context, params *HandlePendingToolCallRequest) (*HandlePendingToolCallResult, error)
- func (a *ToolsAPI) InitializeAndValidate(ctx context.Context) (*ToolsInitializeAndValidateResult, error)
- type ToolsGetCurrentMetadataResult
- type ToolsInitializeAndValidateResult
- type ToolsListRequest
- type UIAPI
- func (a *UIAPI) Elicitation(ctx context.Context, params *UIElicitationRequest) (*UIElicitationResponse, error)
- func (a *UIAPI) EphemeralQuery(ctx context.Context, params *UIEphemeralQueryRequest) (*UIEphemeralQueryResult, error)
- func (a *UIAPI) HandlePendingAutoModeSwitch(ctx context.Context, params *UIHandlePendingAutoModeSwitchRequest) (*UIHandlePendingResult, error)
- func (a *UIAPI) HandlePendingElicitation(ctx context.Context, params *UIHandlePendingElicitationRequest) (*UIElicitationResult, error)
- func (a *UIAPI) HandlePendingExitPlanMode(ctx context.Context, params *UIHandlePendingExitPlanModeRequest) (*UIHandlePendingResult, error)
- func (a *UIAPI) HandlePendingSampling(ctx context.Context, params *UIHandlePendingSamplingRequest) (*UIHandlePendingResult, error)
- func (a *UIAPI) HandlePendingUserInput(ctx context.Context, params *UIHandlePendingUserInputRequest) (*UIHandlePendingResult, error)
- func (a *UIAPI) RegisterDirectAutoModeSwitchHandler(ctx context.Context) (*UIRegisterDirectAutoModeSwitchHandlerResult, error)
- func (a *UIAPI) UnregisterDirectAutoModeSwitchHandler(ctx context.Context, params *UIUnregisterDirectAutoModeSwitchHandlerRequest) (*UIUnregisterDirectAutoModeSwitchHandlerResult, error)
- type UIAutoModeSwitchResponse
- type UIElicitationArrayAnyOfField
- type UIElicitationArrayAnyOfFieldItems
- type UIElicitationArrayAnyOfFieldItemsAnyOf
- type UIElicitationArrayEnumField
- type UIElicitationArrayEnumFieldItems
- type UIElicitationArrayEnumFieldItemsType
- type UIElicitationBooleanValue
- type UIElicitationFieldValue
- type UIElicitationNumberValue
- type UIElicitationRequest
- type UIElicitationResponse
- type UIElicitationResponseAction
- type UIElicitationResponseContent
- type UIElicitationResult
- type UIElicitationSchema
- type UIElicitationSchemaProperty
- type UIElicitationSchemaPropertyBoolean
- type UIElicitationSchemaPropertyNumber
- type UIElicitationSchemaPropertyNumberType
- type UIElicitationSchemaPropertyString
- type UIElicitationSchemaPropertyStringFormat
- type UIElicitationSchemaPropertyType
- type UIElicitationSchemaType
- type UIElicitationStringArrayValue
- type UIElicitationStringEnumField
- type UIElicitationStringOneOfField
- type UIElicitationStringOneOfFieldOneOf
- type UIElicitationStringValue
- type UIEphemeralQueryRequest
- type UIEphemeralQueryResult
- type UIExitPlanModeAction
- type UIExitPlanModeResponse
- type UIHandlePendingAutoModeSwitchRequest
- type UIHandlePendingElicitationRequest
- type UIHandlePendingExitPlanModeRequest
- type UIHandlePendingResult
- type UIHandlePendingSamplingRequest
- type UIHandlePendingSamplingResponse
- type UIHandlePendingUserInputRequest
- type UIRegisterDirectAutoModeSwitchHandlerResult
- type UIUnregisterDirectAutoModeSwitchHandlerRequest
- type UIUnregisterDirectAutoModeSwitchHandlerResult
- type UIUserInputResponse
- type UsageAPI
- type UsageGetMetricsResult
- type UsageMetricsCodeChanges
- type UsageMetricsModelMetric
- type UsageMetricsModelMetricRequests
- type UsageMetricsModelMetricTokenDetail
- type UsageMetricsModelMetricUsage
- type UsageMetricsTokenDetail
- type UserAuthInfo
- type UserInputCompletedData
- type UserInputRequestedData
- type UserMessageAgentMode
- type UserMessageData
- type UserRequestedShellCommandResult
- type UserSettingsReloadResult
- type UserToolSessionApproval
- type UserToolSessionApprovalCommands
- type UserToolSessionApprovalCustomTool
- type UserToolSessionApprovalExtensionManagement
- type UserToolSessionApprovalExtensionPermissionAccess
- type UserToolSessionApprovalKind
- type UserToolSessionApprovalMCP
- type UserToolSessionApprovalMemory
- type UserToolSessionApprovalRead
- type UserToolSessionApprovalWrite
- type WorkingDirectoryContext
- type WorkingDirectoryContextHostType
- type WorkspaceDiffFileChange
- type WorkspaceDiffFileChangeType
- type WorkspaceDiffMode
- type WorkspaceDiffResult
- type WorkspaceFileChangedOperation
- type WorkspaceSummary
- type WorkspaceSummaryHostType
- type WorkspacesAPI
- func (a *WorkspacesAPI) CreateFile(ctx context.Context, params *WorkspacesCreateFileRequest) (*SessionWorkspacesCreateFileResult, error)
- func (a *WorkspacesAPI) Diff(ctx context.Context, params *WorkspacesDiffRequest) (*WorkspaceDiffResult, error)
- func (a *WorkspacesAPI) GetWorkspace(ctx context.Context) (*WorkspacesGetWorkspaceResult, error)
- func (a *WorkspacesAPI) ListCheckpoints(ctx context.Context) (*WorkspacesListCheckpointsResult, error)
- func (a *WorkspacesAPI) ListFiles(ctx context.Context) (*WorkspacesListFilesResult, error)
- func (a *WorkspacesAPI) ReadCheckpoint(ctx context.Context, params *WorkspacesReadCheckpointRequest) (*WorkspacesReadCheckpointResult, error)
- func (a *WorkspacesAPI) ReadFile(ctx context.Context, params *WorkspacesReadFileRequest) (*WorkspacesReadFileResult, error)
- func (a *WorkspacesAPI) SaveLargePaste(ctx context.Context, params *WorkspacesSaveLargePasteRequest) (*WorkspacesSaveLargePasteResult, error)
- type WorkspacesCheckpoints
- type WorkspacesCreateFileRequest
- type WorkspacesDiffRequest
- type WorkspacesGetWorkspaceResult
- type WorkspacesGetWorkspaceResultWorkspace
- type WorkspacesListCheckpointsResult
- type WorkspacesListFilesResult
- type WorkspacesReadCheckpointRequest
- type WorkspacesReadCheckpointResult
- type WorkspacesReadFileRequest
- type WorkspacesReadFileResult
- type WorkspacesSaveLargePasteRequest
- type WorkspacesSaveLargePasteResult
- type WorkspacesSaveLargePasteResultSaved
- type WorkspacesWorkspaceDetailsHostType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterClientSessionAPIHandlers ¶ added in v1.0.0
func RegisterClientSessionAPIHandlers(client *jsonrpc2.Client, getHandlers func(sessionID string) *ClientSessionAPIHandlers)
RegisterClientSessionAPIHandlers registers handlers for server-to-client session API calls.
Types ¶
type APIKeyAuthInfo ¶ added in v1.0.0
type APIKeyAuthInfo struct {
// The API key. Treat as a secret.
APIKey string `json:"apiKey"`
// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the
// GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this
// verbatim and does not re-fetch when set.
CopilotUser *CopilotUserResponse `json:"copilotUser,omitempty"`
// Authentication host.
Host string `json:"host"`
}
Schema for the `ApiKeyAuthInfo` type. Experimental: APIKeyAuthInfo is part of an experimental API and may change or be removed.
func (APIKeyAuthInfo) MarshalJSON ¶ added in v1.0.0
func (r APIKeyAuthInfo) MarshalJSON() ([]byte, error)
func (APIKeyAuthInfo) Type ¶ added in v1.0.0
func (APIKeyAuthInfo) Type() AuthInfoType
type AbortData ¶ added in v1.0.0
type AbortData struct {
// Finite reason code describing why the current turn was aborted
Reason AbortReason `json:"reason"`
}
Turn abort information including the reason for termination
func (*AbortData) Type ¶ added in v1.0.0
func (*AbortData) Type() SessionEventType
type AbortReason ¶ added in v1.0.0
type AbortReason string
Finite reason code describing why the current turn was aborted Experimental: AbortReason is part of an experimental API and may change or be removed.
const ( // A remote command requested the abort. AbortReasonRemoteCommand AbortReason = "remote_command" // An MCP server delivered a user.abort notification. AbortReasonUserAbort AbortReason = "user_abort" // The local user requested the abort, for example by pressing Ctrl+C in the CLI. AbortReasonUserInitiated AbortReason = "user_initiated" )
type AbortRequest ¶ added in v1.0.0
type AbortRequest struct {
// Finite reason code describing why the current turn was aborted
Reason *AbortReason `json:"reason,omitempty"`
}
Parameters for aborting the current turn Experimental: AbortRequest is part of an experimental API and may change or be removed.
type AbortResult ¶ added in v1.0.0
type AbortResult struct {
// Error message if the abort failed
Error *string `json:"error,omitempty"`
// Whether the abort completed successfully
Success bool `json:"success"`
}
Result of aborting the current turn Experimental: AbortResult is part of an experimental API and may change or be removed.
type AccountGetQuotaRequest ¶ added in v0.3.0
type AccountGetQuotaRequest struct {
// GitHub token for per-user quota lookup. When provided, resolves this token to determine
// the user's quota instead of using the global auth.
GitHubToken *string `json:"gitHubToken,omitempty"`
}
type AccountGetQuotaResult ¶
type AccountGetQuotaResult struct {
// Quota snapshots keyed by type (e.g., chat, completions, premium_interactions)
QuotaSnapshots map[string]AccountQuotaSnapshot `json:"quotaSnapshots"`
}
Quota usage snapshots for the resolved user, keyed by quota type.
type AccountQuotaSnapshot ¶ added in v0.3.0
type AccountQuotaSnapshot struct {
// Number of requests included in the entitlement, or -1 for unlimited entitlements
EntitlementRequests int64 `json:"entitlementRequests"`
// Whether the user has an unlimited usage entitlement
IsUnlimitedEntitlement bool `json:"isUnlimitedEntitlement"`
// Number of additional usage requests made this period
Overage float64 `json:"overage"`
// Whether additional usage is allowed when quota is exhausted
OverageAllowedWithExhaustedQuota bool `json:"overageAllowedWithExhaustedQuota"`
// Percentage of entitlement remaining
RemainingPercentage float64 `json:"remainingPercentage"`
// Date when the quota resets (ISO 8601 string)
ResetDate *time.Time `json:"resetDate,omitempty"`
// Whether usage is still permitted after quota exhaustion
UsageAllowedWithExhaustedQuota bool `json:"usageAllowedWithExhaustedQuota"`
// Number of requests used so far this period
UsedRequests int64 `json:"usedRequests"`
}
Schema for the `AccountQuotaSnapshot` type.
type AgentAPI ¶ added in v1.0.0
type AgentAPI sessionAPI
Experimental: AgentAPI contains experimental APIs that may change or be removed.
func (*AgentAPI) Deselect ¶ added in v1.0.0
func (a *AgentAPI) Deselect(ctx context.Context) (*SessionAgentDeselectResult, error)
Deselect clears the selected custom agent and returns the session to the default agent.
RPC method: session.agent.deselect.
func (*AgentAPI) GetCurrent ¶ added in v1.0.0
func (a *AgentAPI) GetCurrent(ctx context.Context) (*AgentGetCurrentResult, error)
GetCurrent gets the currently selected custom agent for the session.
RPC method: session.agent.getCurrent.
Returns: The currently selected custom agent, or null when using the default agent.
func (*AgentAPI) List ¶ added in v1.0.0
Lists custom agents available to the session.
RPC method: session.agent.list.
Returns: Custom agents available to the session.
func (*AgentAPI) Reload ¶ added in v1.0.0
func (a *AgentAPI) Reload(ctx context.Context) (*AgentReloadResult, error)
Reloads custom agent definitions and returns the refreshed list.
RPC method: session.agent.reload.
Returns: Custom agents available to the session after reloading definitions from disk.
func (*AgentAPI) Select ¶ added in v1.0.0
func (a *AgentAPI) Select(ctx context.Context, params *AgentSelectRequest) (*AgentSelectResult, error)
Selects a custom agent for subsequent turns in the session.
RPC method: session.agent.select.
Parameters: Name of the custom agent to select for subsequent turns.
Returns: The newly selected custom agent.
type AgentGetCurrentResult ¶ added in v0.3.0
type AgentGetCurrentResult struct {
// Currently selected custom agent, or null if using the default agent
Agent *AgentInfo `json:"agent,omitempty"`
}
The currently selected custom agent, or null when using the default agent. Experimental: AgentGetCurrentResult is part of an experimental API and may change or be removed.
type AgentInfo ¶ added in v0.3.0
type AgentInfo struct {
// Description of the agent's purpose
Description string `json:"description"`
// Human-readable display name
DisplayName string `json:"displayName"`
// Stable identifier for selection. For most agents this is the same as `name`; for
// plugin/builtin agents it may differ. Always populated; defaults to `name` when no
// distinct id was assigned.
ID string `json:"id"`
// MCP server configurations attached to this agent, keyed by server name. Server config
// shape mirrors the MCP `mcpServers` schema.
// Experimental: MCPServers is part of an experimental API and may change or be removed.
MCPServers map[string]any `json:"mcpServers,omitzero"`
// Preferred model id for this agent. When omitted, inherits the outer agent's model.
Model *string `json:"model,omitempty"`
// Unique identifier of the custom agent
Name string `json:"name"`
// Absolute local file path of the agent definition. Only set for file-based agents loaded
// from disk; remote agents do not have a path.
Path *string `json:"path,omitempty"`
// Skill names preloaded into this agent's context. Omitted means none.
Skills []string `json:"skills,omitzero"`
// Where the agent definition was loaded from
Source *AgentInfoSource `json:"source,omitempty"`
// Allowed tool names for this agent. Empty array means none; omitted means inherit defaults.
Tools []string `json:"tools,omitzero"`
// Whether the agent can be selected directly by the user. Agents marked `false` are
// subagent-only.
UserInvocable *bool `json:"userInvocable,omitempty"`
}
Schema for the `AgentInfo` type. Experimental: AgentInfo is part of an experimental API and may change or be removed.
type AgentInfoSource ¶ added in v1.0.0
type AgentInfoSource string
Where the agent definition was loaded from Experimental: AgentInfoSource is part of an experimental API and may change or be removed.
const ( // Agent built into the Copilot runtime. AgentInfoSourceBuiltin AgentInfoSource = "builtin" // Agent inherited from a parent project or workspace. AgentInfoSourceInherited AgentInfoSource = "inherited" // Agent contributed by an installed plugin. AgentInfoSourcePlugin AgentInfoSource = "plugin" // Agent loaded from the current project's repository configuration. AgentInfoSourceProject AgentInfoSource = "project" // Agent provided by a remote runtime or service. AgentInfoSourceRemote AgentInfoSource = "remote" // Agent loaded from the user's personal agent configuration. AgentInfoSourceUser AgentInfoSource = "user" )
type AgentList ¶ added in v0.3.0
type AgentList struct {
// Available custom agents
Agents []AgentInfo `json:"agents"`
}
Custom agents available to the session. Experimental: AgentList is part of an experimental API and may change or be removed.
type AgentRegistryLiveTargetEntry ¶ added in v1.0.0
type AgentRegistryLiveTargetEntry struct {
// Kind of attention required when status === "attention". Meaningful only when status ===
// "attention".
AttentionKind *AgentRegistryLiveTargetEntryAttentionKind `json:"attentionKind,omitempty"`
// Git branch of the session (when known)
Branch *string `json:"branch,omitempty"`
// Copilot CLI version that wrote the entry
CopilotVersion string `json:"copilotVersion"`
// Working directory of the session (when known)
Cwd *string `json:"cwd,omitempty"`
// Bind host for the entry's JSON-RPC server
Host string `json:"host"`
// Process kind tag for the registry entry
Kind AgentRegistryLiveTargetEntryKind `json:"kind"`
// Wall-clock milliseconds since the watcher last observed this entry (heartbeat freshness)
LastSeenMs int64 `json:"lastSeenMs"`
// How the most recent turn ended (clean vs aborted). Lets the renderer distinguish done
// from done_cancelled.
LastTerminalEvent *AgentRegistryLiveTargetEntryLastTerminalEvent `json:"lastTerminalEvent,omitempty"`
// Model identifier currently selected for the session
Model *string `json:"model,omitempty"`
// Operating-system pid of the process owning this entry
Pid int64 `json:"pid"`
// TCP port the entry's JSON-RPC server is listening on
Port int64 `json:"port"`
// Registry entry schema version (1 = ui-server, 2 = managed-server)
SchemaVersion int64 `json:"schemaVersion"`
// Session ID of the foreground session for this entry
SessionID *string `json:"sessionId,omitempty"`
// Friendly session name (when set)
SessionName *string `json:"sessionName,omitempty"`
// ISO 8601 timestamp captured at registration
StartedAt string `json:"startedAt"`
// Coarse lifecycle status of the foreground session
Status *AgentRegistryLiveTargetEntryStatus `json:"status,omitempty"`
// Monotonic per-publisher revision counter incremented on every status update. Lets
// watchers detect transient flips.
StatusRevision *int64 `json:"statusRevision,omitempty"`
// Connection token (null when the target is unauthenticated)
// Internal: Token is part of the SDK's internal API surface and is not intended for
// external use.
Token *string `json:"token,omitempty"`
}
Full registry entry for the spawned child. Lets the controller call `handleLiveTargetSelected(entry)` directly without re-reading the registry (avoids a TOCTOU window). Experimental: AgentRegistryLiveTargetEntry is part of an experimental API and may change or be removed.
type AgentRegistryLiveTargetEntryAttentionKind ¶ added in v1.0.0
type AgentRegistryLiveTargetEntryAttentionKind string
Kind of attention required when status === "attention". Meaningful only when status === "attention". Experimental: AgentRegistryLiveTargetEntryAttentionKind is part of an experimental API and may change or be removed.
const ( // Session is waiting on an elicitation prompt AgentRegistryLiveTargetEntryAttentionKindElicitation AgentRegistryLiveTargetEntryAttentionKind = "elicitation" // Session is blocked on an unrecoverable error AgentRegistryLiveTargetEntryAttentionKindError AgentRegistryLiveTargetEntryAttentionKind = "error" // Session is waiting for the user to approve or reject a plan AgentRegistryLiveTargetEntryAttentionKindExitPlan AgentRegistryLiveTargetEntryAttentionKind = "exit_plan" // Session is waiting for a tool-permission decision AgentRegistryLiveTargetEntryAttentionKindPermission AgentRegistryLiveTargetEntryAttentionKind = "permission" // Session is waiting for free-form user input AgentRegistryLiveTargetEntryAttentionKindUserInput AgentRegistryLiveTargetEntryAttentionKind = "user_input" )
type AgentRegistryLiveTargetEntryKind ¶ added in v1.0.0
type AgentRegistryLiveTargetEntryKind string
Process kind tag for the registry entry Experimental: AgentRegistryLiveTargetEntryKind is part of an experimental API and may change or be removed.
const ( // Headless `--server --managed-server` child spawned by a controller AgentRegistryLiveTargetEntryKindManagedServer AgentRegistryLiveTargetEntryKind = "managed-server" // Interactive Copilot CLI exposing a UI server (legacy/normal CLI process) AgentRegistryLiveTargetEntryKindUIServer AgentRegistryLiveTargetEntryKind = "ui-server" )
type AgentRegistryLiveTargetEntryLastTerminalEvent ¶ added in v1.0.0
type AgentRegistryLiveTargetEntryLastTerminalEvent string
How the most recent turn ended (clean vs aborted). Lets the renderer distinguish done from done_cancelled. Experimental: AgentRegistryLiveTargetEntryLastTerminalEvent is part of an experimental API and may change or be removed.
const ( // Last turn was aborted (e.g. user interrupted) AgentRegistryLiveTargetEntryLastTerminalEventAbort AgentRegistryLiveTargetEntryLastTerminalEvent = "abort" // Last turn ended cleanly (model returned a final assistant message) AgentRegistryLiveTargetEntryLastTerminalEventTurnEnd AgentRegistryLiveTargetEntryLastTerminalEvent = "turn_end" )
type AgentRegistryLiveTargetEntryStatus ¶ added in v1.0.0
type AgentRegistryLiveTargetEntryStatus string
Coarse lifecycle status of the foreground session Experimental: AgentRegistryLiveTargetEntryStatus is part of an experimental API and may change or be removed.
const ( // Session needs user attention (see attentionKind for the specific reason) AgentRegistryLiveTargetEntryStatusAttention AgentRegistryLiveTargetEntryStatus = "attention" // Last turn completed successfully AgentRegistryLiveTargetEntryStatusDone AgentRegistryLiveTargetEntryStatus = "done" // Session is idle, waiting for input AgentRegistryLiveTargetEntryStatusWaiting AgentRegistryLiveTargetEntryStatus = "waiting" // Session is actively processing a turn AgentRegistryLiveTargetEntryStatusWorking AgentRegistryLiveTargetEntryStatus = "working" )
type AgentRegistryLogCapture ¶ added in v1.0.0
type AgentRegistryLogCapture struct {
// Whether per-spawn log capture is on (false when env-disabled or open failed)
Enabled bool `json:"enabled"`
// Human-readable open failure message (only set when enabled === false AND the env-disable
// opt-out was NOT used)
OpenError *string `json:"openError,omitempty"`
// Categorized reason for log-open failure
OpenErrorReason *AgentRegistryLogCaptureOpenErrorReason `json:"openErrorReason,omitempty"`
// Absolute path to the per-spawn log file (only set when enabled)
Path *string `json:"path,omitempty"`
}
Per-spawn log-capture outcome; populated from spawnLiveTarget. Experimental: AgentRegistryLogCapture is part of an experimental API and may change or be removed.
type AgentRegistryLogCaptureOpenErrorReason ¶ added in v1.0.0
type AgentRegistryLogCaptureOpenErrorReason string
Categorized reason for log-open failure Experimental: AgentRegistryLogCaptureOpenErrorReason is part of an experimental API and may change or be removed.
const ( // No space left on device AgentRegistryLogCaptureOpenErrorReasonDiskFull AgentRegistryLogCaptureOpenErrorReason = "disk_full" // Other / uncategorized open failure AgentRegistryLogCaptureOpenErrorReasonOther AgentRegistryLogCaptureOpenErrorReason = "other" // Filesystem permission denied opening the log file AgentRegistryLogCaptureOpenErrorReasonPermission AgentRegistryLogCaptureOpenErrorReason = "permission" )
type AgentRegistrySpawnError ¶ added in v1.0.0
type AgentRegistrySpawnError struct {
// Underlying errno code (e.g. ENOENT, EACCES) when available
Code *string `json:"code,omitempty"`
// Human-readable error message
Message string `json:"message"`
}
`child_process.spawn` itself failed before the child entered the registry. Experimental: AgentRegistrySpawnError is part of an experimental API and may change or be removed.
func (AgentRegistrySpawnError) Kind ¶ added in v1.0.0
func (AgentRegistrySpawnError) Kind() AgentRegistrySpawnResultKind
func (AgentRegistrySpawnError) MarshalJSON ¶ added in v1.0.0
func (r AgentRegistrySpawnError) MarshalJSON() ([]byte, error)
type AgentRegistrySpawnPermissionMode ¶ added in v1.0.0
type AgentRegistrySpawnPermissionMode string
Permission posture for the new session. 'yolo' requires the controller-local session to currently be in allow-all mode. Experimental: AgentRegistrySpawnPermissionMode is part of an experimental API and may change or be removed.
const ( // Standard permission posture (prompts for each request) AgentRegistrySpawnPermissionModeDefault AgentRegistrySpawnPermissionMode = "default" // Full allow-all (requires the controller-local session to currently be in allow-all mode) AgentRegistrySpawnPermissionModeYolo AgentRegistrySpawnPermissionMode = "yolo" )
type AgentRegistrySpawnRegistryTimeout ¶ added in v1.0.0
type AgentRegistrySpawnRegistryTimeout struct {
// Process ID of the orphaned child (so the caller can offer 'kill the pid' guidance)
ChildPid int64 `json:"childPid"`
// Per-spawn log-capture outcome; populated from spawnLiveTarget.
LogCapture *AgentRegistryLogCapture `json:"logCapture,omitempty"`
}
Spawn succeeded but the child did not publish a matching managed-server entry within the timeout. Experimental: AgentRegistrySpawnRegistryTimeout is part of an experimental API and may change or be removed.
func (AgentRegistrySpawnRegistryTimeout) MarshalJSON ¶ added in v1.0.0
func (r AgentRegistrySpawnRegistryTimeout) MarshalJSON() ([]byte, error)
type AgentRegistrySpawnRequest ¶ added in v1.0.0
type AgentRegistrySpawnRequest struct {
// Custom or built-in agent name (e.g. 'explore'). When omitted, the child uses its own
// default.
AgentName *string `json:"agentName,omitempty"`
// Working directory for the spawned child (must be an existing directory)
Cwd string `json:"cwd"`
// Optional first user message. Forwarded to the caller (the CLI's spawn wrapper sends it
// post-attach via the standard LocalRpcSession.send path).
InitialPrompt *string `json:"initialPrompt,omitempty"`
// Model identifier to apply to the new session
Model *string `json:"model,omitempty"`
// Friendly session name. Must satisfy validateSessionName: non-empty, no leading/trailing
// whitespace, <=100 chars, no control chars, no double quotes.
Name *string `json:"name,omitempty"`
// Permission posture for the new session. 'yolo' requires the controller-local session to
// currently be in allow-all mode.
PermissionMode *AgentRegistrySpawnPermissionMode `json:"permissionMode,omitempty"`
}
Inputs to spawn a managed-server child via the controller's spawn delegate. Experimental: AgentRegistrySpawnRequest is part of an experimental API and may change or be removed.
type AgentRegistrySpawnResult ¶ added in v1.0.0
type AgentRegistrySpawnResult interface {
Kind() AgentRegistrySpawnResultKind
// contains filtered or unexported methods
}
Outcome of an agentRegistry.spawn call. Experimental: AgentRegistrySpawnResult is part of an experimental API and may change or be removed.
type AgentRegistrySpawnResultKind ¶ added in v1.0.0
type AgentRegistrySpawnResultKind string
Kind discriminator for AgentRegistrySpawnResult.
const ( AgentRegistrySpawnResultKindRegistryTimeout AgentRegistrySpawnResultKind = "registry-timeout" AgentRegistrySpawnResultKindSpawned AgentRegistrySpawnResultKind = "spawned" AgentRegistrySpawnResultKindSpawnError AgentRegistrySpawnResultKind = "spawn-error" AgentRegistrySpawnResultKindValidationError AgentRegistrySpawnResultKind = "validation-error" )
type AgentRegistrySpawnSpawned ¶ added in v1.0.0
type AgentRegistrySpawnSpawned struct {
// Full registry entry for the spawned child. Lets the controller call
// `handleLiveTargetSelected(entry)` directly without re-reading the registry (avoids a
// TOCTOU window).
Entry AgentRegistryLiveTargetEntry `json:"entry"`
// If the delegate attempted to send the initial prompt and failed, the categorized error
// message.
InitialPromptError *string `json:"initialPromptError,omitempty"`
// Whether the delegate already sent the initial prompt. Always omitted in the current
// wiring: the controller sends the prompt post-attach via the standard LocalRpcSession.send
// path.
InitialPromptSent *bool `json:"initialPromptSent,omitempty"`
// Per-spawn log-capture outcome; populated from spawnLiveTarget.
LogCapture *AgentRegistryLogCapture `json:"logCapture,omitempty"`
}
Managed-server child was spawned and registered successfully. Experimental: AgentRegistrySpawnSpawned is part of an experimental API and may change or be removed.
func (AgentRegistrySpawnSpawned) Kind ¶ added in v1.0.0
func (AgentRegistrySpawnSpawned) Kind() AgentRegistrySpawnResultKind
func (AgentRegistrySpawnSpawned) MarshalJSON ¶ added in v1.0.0
func (r AgentRegistrySpawnSpawned) MarshalJSON() ([]byte, error)
type AgentRegistrySpawnValidationError ¶ added in v1.0.0
type AgentRegistrySpawnValidationError struct {
// Which parameter field was invalid. Omitted when the rejection is not field-specific.
Field *AgentRegistrySpawnValidationErrorField `json:"field,omitempty"`
// Human-readable explanation; safe to surface in the UI banner. Never logged to
// unrestricted telemetry.
Message string `json:"message"`
// Categorized reason for the rejection. Low-cardinality enum so telemetry can aggregate by
// reason without leaking raw paths or agent/model names.
Reason AgentRegistrySpawnValidationErrorReason `json:"reason"`
}
Synchronous pre-validation rejected the spawn request. Experimental: AgentRegistrySpawnValidationError is part of an experimental API and may change or be removed.
func (AgentRegistrySpawnValidationError) MarshalJSON ¶ added in v1.0.0
func (r AgentRegistrySpawnValidationError) MarshalJSON() ([]byte, error)
type AgentRegistrySpawnValidationErrorField ¶ added in v1.0.0
type AgentRegistrySpawnValidationErrorField string
Which parameter field was invalid. Omitted when the rejection is not field-specific. Experimental: AgentRegistrySpawnValidationErrorField is part of an experimental API and may change or be removed.
const ( // The agentName parameter AgentRegistrySpawnValidationErrorFieldAgentName AgentRegistrySpawnValidationErrorField = "agentName" // The cwd parameter AgentRegistrySpawnValidationErrorFieldCwd AgentRegistrySpawnValidationErrorField = "cwd" // The model parameter AgentRegistrySpawnValidationErrorFieldModel AgentRegistrySpawnValidationErrorField = "model" // The session name parameter AgentRegistrySpawnValidationErrorFieldName AgentRegistrySpawnValidationErrorField = "name" // The permissionMode parameter AgentRegistrySpawnValidationErrorFieldPermissionMode AgentRegistrySpawnValidationErrorField = "permissionMode" )
type AgentRegistrySpawnValidationErrorReason ¶ added in v1.0.0
type AgentRegistrySpawnValidationErrorReason string
Categorized reason for the rejection. Low-cardinality enum so telemetry can aggregate by reason without leaking raw paths or agent/model names. Experimental: AgentRegistrySpawnValidationErrorReason is part of an experimental API and may change or be removed.
const ( // Provided cwd exists but is not a directory AgentRegistrySpawnValidationErrorReasonCwdNotDirectory AgentRegistrySpawnValidationErrorReason = "cwd-not-directory" // Provided cwd does not exist on disk AgentRegistrySpawnValidationErrorReasonCwdNotFound AgentRegistrySpawnValidationErrorReason = "cwd-not-found" // Session name failed validateSessionName AgentRegistrySpawnValidationErrorReasonInvalidName AgentRegistrySpawnValidationErrorReason = "invalid-name" // Requested agent name was not found in builtin or custom agents AgentRegistrySpawnValidationErrorReasonUnknownAgent AgentRegistrySpawnValidationErrorReason = "unknown-agent" // Requested model is not available to this session AgentRegistrySpawnValidationErrorReasonUnknownModel AgentRegistrySpawnValidationErrorReason = "unknown-model" // Caller asked for permissionMode='yolo' but the controller is not currently in allow-all // mode AgentRegistrySpawnValidationErrorReasonYoloNotAllowed AgentRegistrySpawnValidationErrorReason = "yolo-not-allowed" )
type AgentReloadResult ¶ added in v0.3.0
type AgentReloadResult struct {
// Reloaded custom agents
Agents []AgentInfo `json:"agents"`
}
Custom agents available to the session after reloading definitions from disk. Experimental: AgentReloadResult is part of an experimental API and may change or be removed.
type AgentSelectRequest ¶ added in v0.3.0
type AgentSelectRequest struct {
// Name of the custom agent to select
Name string `json:"name"`
}
Name of the custom agent to select for subsequent turns. Experimental: AgentSelectRequest is part of an experimental API and may change or be removed.
type AgentSelectResult ¶ added in v0.3.0
type AgentSelectResult struct {
// The newly selected custom agent
Agent AgentInfo `json:"agent"`
}
The newly selected custom agent. Experimental: AgentSelectResult is part of an experimental API and may change or be removed.
type AgentsDiscoverRequest ¶ added in v1.0.1
type AgentsDiscoverRequest struct {
// When true, omit the host's agents (the `<COPILOT_HOME>/agents` directory and all plugin
// agents), leaving only project and remote agents. For multitenant deployments.
ExcludeHostAgents *bool `json:"excludeHostAgents,omitempty"`
// Optional list of project directory paths to scan for project-scoped agents. When omitted
// or empty, only user/plugin/remote-independent agents are returned (no project scan).
ProjectPaths []string `json:"projectPaths,omitzero"`
}
Optional project paths to include in agent discovery. Experimental: AgentsDiscoverRequest is part of an experimental API and may change or be removed.
type AllowAllPermissionSetResult ¶ added in v1.0.0
type AllowAllPermissionSetResult struct {
// Authoritative allow-all state after the mutation
Enabled bool `json:"enabled"`
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded and reports the post-mutation state. Experimental: AllowAllPermissionSetResult is part of an experimental API and may change or be removed.
type AllowAllPermissionState ¶ added in v1.0.0
type AllowAllPermissionState struct {
// Whether full allow-all permissions are currently active
Enabled bool `json:"enabled"`
}
Current full allow-all permission state. Experimental: AllowAllPermissionState is part of an experimental API and may change or be removed.
type AssistantIntentData ¶ added in v1.0.0
type AssistantIntentData struct {
// Short description of what the agent is currently doing or planning to do
Intent string `json:"intent"`
}
Agent intent description for current activity or plan
func (*AssistantIntentData) Type ¶ added in v1.0.0
func (*AssistantIntentData) Type() SessionEventType
type AssistantMessageData ¶ added in v1.0.0
type AssistantMessageData struct {
// Raw Anthropic content array with advisor blocks (server_tool_use, advisor_tool_result) for verbatim round-tripping
// Experimental: AnthropicAdvisorBlocks is part of an experimental API and may change or be removed.
AnthropicAdvisorBlocks []any `json:"anthropicAdvisorBlocks,omitzero"`
// Anthropic advisor model ID used for this response, for timeline display on replay
// Experimental: AnthropicAdvisorModel is part of an experimental API and may change or be removed.
AnthropicAdvisorModel *string `json:"anthropicAdvisorModel,omitempty"`
// Provider's completion / response identifier; shared across all chunks of a single API call. Used to group multi-chunk assistant utterances.
APICallID *string `json:"apiCallId,omitempty"`
// The assistant's text response content
Content string `json:"content"`
// Encrypted reasoning content from OpenAI models. Session-bound and stripped on resume.
EncryptedContent *string `json:"encryptedContent,omitempty"`
// CAPI interaction ID for correlating this message with upstream telemetry
InteractionID *string `json:"interactionId,omitempty"`
// Unique identifier for this assistant message
MessageID string `json:"messageId"`
// Model that produced this assistant message, if known
Model *string `json:"model,omitempty"`
// Actual output token count from the API response (completion_tokens), used for accurate token accounting
OutputTokens *int64 `json:"outputTokens,omitempty"`
// Tool call ID of the parent tool invocation when this event originates from a sub-agent
// Deprecated: ParentToolCallID is deprecated.
ParentToolCallID *string `json:"parentToolCallId,omitempty"`
// Generation phase for phased-output models (e.g., thinking vs. response phases)
Phase *string `json:"phase,omitempty"`
// Opaque/encrypted extended thinking data from Anthropic models. Session-bound and stripped on resume.
ReasoningOpaque *string `json:"reasoningOpaque,omitempty"`
// Readable reasoning text from the model's extended thinking
ReasoningText *string `json:"reasoningText,omitempty"`
// GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
RequestID *string `json:"requestId,omitempty"`
// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
ServiceRequestID *string `json:"serviceRequestId,omitempty"`
// Tool invocations requested by the assistant in this message
ToolRequests []AssistantMessageToolRequest `json:"toolRequests,omitzero"`
// Identifier for the agent loop turn that produced this message, matching the corresponding assistant.turn_start event
TurnID *string `json:"turnId,omitempty"`
}
Assistant response containing text content, optional tool requests, and interaction metadata
func (*AssistantMessageData) Type ¶ added in v1.0.0
func (*AssistantMessageData) Type() SessionEventType
type AssistantMessageDeltaData ¶ added in v1.0.0
type AssistantMessageDeltaData struct {
// Incremental text chunk to append to the message content
DeltaContent string `json:"deltaContent"`
// Message ID this delta belongs to, matching the corresponding assistant.message event
MessageID string `json:"messageId"`
// Tool call ID of the parent tool invocation when this event originates from a sub-agent
// Deprecated: ParentToolCallID is deprecated.
ParentToolCallID *string `json:"parentToolCallId,omitempty"`
}
Streaming assistant message delta for incremental response updates
func (*AssistantMessageDeltaData) Type ¶ added in v1.0.0
func (*AssistantMessageDeltaData) Type() SessionEventType
type AssistantMessageStartData ¶ added in v1.0.0
type AssistantMessageStartData struct {
// Message ID this start event belongs to, matching subsequent deltas and assistant.message
MessageID string `json:"messageId"`
// Generation phase this message belongs to for phased-output models
Phase *string `json:"phase,omitempty"`
}
Streaming assistant message start metadata
func (*AssistantMessageStartData) Type ¶ added in v1.0.0
func (*AssistantMessageStartData) Type() SessionEventType
type AssistantMessageToolRequest ¶ added in v1.0.0
type AssistantMessageToolRequest struct {
// Arguments to pass to the tool, format depends on the tool
Arguments any `json:"arguments,omitempty"`
// Resolved intention summary describing what this specific call does
IntentionSummary *string `json:"intentionSummary,omitempty"`
// Name of the MCP server hosting this tool, when the tool is an MCP tool
MCPServerName *string `json:"mcpServerName,omitempty"`
// Original tool name on the MCP server, when the tool is an MCP tool
MCPToolName *string `json:"mcpToolName,omitempty"`
// Name of the tool being invoked
Name string `json:"name"`
// Unique identifier for this tool call
ToolCallID string `json:"toolCallId"`
// Human-readable display title for the tool
ToolTitle *string `json:"toolTitle,omitempty"`
// Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent.
Type *AssistantMessageToolRequestType `json:"type,omitempty"`
}
A tool invocation request from the assistant
type AssistantMessageToolRequestType ¶ added in v1.0.0
type AssistantMessageToolRequestType string
Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent.
const ( // Custom grammar-based tool call. AssistantMessageToolRequestTypeCustom AssistantMessageToolRequestType = "custom" // Standard function-style tool call. AssistantMessageToolRequestTypeFunction AssistantMessageToolRequestType = "function" )
type AssistantReasoningData ¶ added in v1.0.0
type AssistantReasoningData struct {
// The complete extended thinking text from the model
Content string `json:"content"`
// Unique identifier for this reasoning block
ReasoningID string `json:"reasoningId"`
}
Assistant reasoning content for timeline display with complete thinking text
func (*AssistantReasoningData) Type ¶ added in v1.0.0
func (*AssistantReasoningData) Type() SessionEventType
type AssistantReasoningDeltaData ¶ added in v1.0.0
type AssistantReasoningDeltaData struct {
// Incremental text chunk to append to the reasoning content
DeltaContent string `json:"deltaContent"`
// Reasoning block ID this delta belongs to, matching the corresponding assistant.reasoning event
ReasoningID string `json:"reasoningId"`
}
Streaming reasoning delta for incremental extended thinking updates
func (*AssistantReasoningDeltaData) Type ¶ added in v1.0.0
func (*AssistantReasoningDeltaData) Type() SessionEventType
type AssistantStreamingDeltaData ¶ added in v1.0.0
type AssistantStreamingDeltaData struct {
// Cumulative total bytes received from the streaming response so far
TotalResponseSizeBytes int64 `json:"totalResponseSizeBytes"`
}
Streaming response progress with cumulative byte count
func (*AssistantStreamingDeltaData) Type ¶ added in v1.0.0
func (*AssistantStreamingDeltaData) Type() SessionEventType
type AssistantTurnEndData ¶ added in v1.0.0
type AssistantTurnEndData struct {
// Identifier of the turn that has ended, matching the corresponding assistant.turn_start event
TurnID string `json:"turnId"`
}
Turn completion metadata including the turn identifier
func (*AssistantTurnEndData) Type ¶ added in v1.0.0
func (*AssistantTurnEndData) Type() SessionEventType
type AssistantTurnStartData ¶ added in v1.0.0
type AssistantTurnStartData struct {
// CAPI interaction ID for correlating this turn with upstream telemetry
InteractionID *string `json:"interactionId,omitempty"`
// Identifier for this turn within the agentic loop, typically a stringified turn number
TurnID string `json:"turnId"`
}
Turn initialization metadata including identifier and interaction tracking
func (*AssistantTurnStartData) Type ¶ added in v1.0.0
func (*AssistantTurnStartData) Type() SessionEventType
type AssistantUsageAPIEndpoint ¶ added in v1.0.0
type AssistantUsageAPIEndpoint string
API endpoint used for this model call, matching CAPI supported_endpoints vocabulary
const ( // Chat Completions API endpoint. AssistantUsageAPIEndpointChatCompletions AssistantUsageAPIEndpoint = "/chat/completions" // Responses API endpoint. AssistantUsageAPIEndpointResponses AssistantUsageAPIEndpoint = "/responses" // Anthropic Messages API endpoint. AssistantUsageAPIEndpointV1Messages AssistantUsageAPIEndpoint = "/v1/messages" // WebSocket Responses API endpoint. AssistantUsageAPIEndpointWsResponses AssistantUsageAPIEndpoint = "ws:/responses" )
type AssistantUsageCopilotUsage ¶ added in v1.0.0
type AssistantUsageCopilotUsage struct {
// Itemized token usage breakdown
TokenDetails []AssistantUsageCopilotUsageTokenDetail `json:"tokenDetails"`
// Total cost in nano-AI units for this request
TotalNanoAiu float64 `json:"totalNanoAiu"`
}
Per-request cost and usage data from the CAPI copilot_usage response field Internal: AssistantUsageCopilotUsage is an internal SDK API and is not part of the public surface.
type AssistantUsageCopilotUsageTokenDetail ¶ added in v1.0.0
type AssistantUsageCopilotUsageTokenDetail struct {
// Number of tokens in this billing batch
BatchSize int64 `json:"batchSize"`
// Cost per batch of tokens
CostPerBatch int64 `json:"costPerBatch"`
// Total token count for this entry
TokenCount int64 `json:"tokenCount"`
// Token category (e.g., "input", "output")
TokenType string `json:"tokenType"`
}
Token usage detail for a single billing category
type AssistantUsageData ¶ added in v1.0.0
type AssistantUsageData struct {
// Completion ID from the model provider (e.g., chatcmpl-abc123)
APICallID *string `json:"apiCallId,omitempty"`
// API endpoint used for this model call, matching CAPI supported_endpoints vocabulary
APIEndpoint *AssistantUsageAPIEndpoint `json:"apiEndpoint,omitempty"`
// Number of tokens read from prompt cache
CacheReadTokens *int64 `json:"cacheReadTokens,omitempty"`
// Number of tokens written to prompt cache
CacheWriteTokens *int64 `json:"cacheWriteTokens,omitempty"`
// Per-request cost and usage data from the CAPI copilot_usage response field
// Internal: CopilotUsage is part of the SDK's internal API surface and is not intended for external use.
CopilotUsage *AssistantUsageCopilotUsage `json:"copilotUsage,omitempty"`
// Model multiplier cost for billing purposes
// Experimental: Cost is part of an experimental API and may change or be removed.
Cost *float64 `json:"cost,omitempty"`
// Duration of the API call in milliseconds
Duration *int64 `json:"duration,omitempty"`
// What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls
Initiator *string `json:"initiator,omitempty"`
// Number of input tokens consumed
InputTokens *int64 `json:"inputTokens,omitempty"`
// Average inter-token latency in milliseconds. Only available for streaming requests
InterTokenLatencyMs *float64 `json:"interTokenLatencyMs,omitempty"`
// Model identifier used for this API call
Model string `json:"model"`
// Number of output tokens produced
OutputTokens *int64 `json:"outputTokens,omitempty"`
// Parent tool call ID when this usage originates from a sub-agent
// Deprecated: ParentToolCallID is deprecated.
ParentToolCallID *string `json:"parentToolCallId,omitempty"`
// GitHub request tracing ID (x-github-request-id header) for server-side log correlation
ProviderCallID *string `json:"providerCallId,omitempty"`
// Per-quota resource usage snapshots, keyed by quota identifier
// Internal: QuotaSnapshots is part of the SDK's internal API surface and is not intended for external use.
QuotaSnapshots map[string]AssistantUsageQuotaSnapshot `json:"quotaSnapshots,omitzero"`
// Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
// Number of output tokens used for reasoning (e.g., chain-of-thought)
ReasoningTokens *int64 `json:"reasoningTokens,omitempty"`
// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
ServiceRequestID *string `json:"serviceRequestId,omitempty"`
// Time to first token in milliseconds. Only available for streaming requests
TimeToFirstTokenMs *int64 `json:"timeToFirstTokenMs,omitempty"`
}
LLM API call usage metrics including tokens, costs, quotas, and billing information
func (*AssistantUsageData) Type ¶ added in v1.0.0
func (*AssistantUsageData) Type() SessionEventType
type AssistantUsageQuotaSnapshot ¶ added in v1.0.0
type AssistantUsageQuotaSnapshot struct {
// Total requests allowed by the entitlement
// Internal: EntitlementRequests is part of the SDK's internal API surface and is not intended for external use.
EntitlementRequests int64 `json:"entitlementRequests"`
// Whether the user has an unlimited usage entitlement
// Internal: IsUnlimitedEntitlement is part of the SDK's internal API surface and is not intended for external use.
IsUnlimitedEntitlement bool `json:"isUnlimitedEntitlement"`
// Number of additional usage requests made this period
// Internal: Overage is part of the SDK's internal API surface and is not intended for external use.
Overage float64 `json:"overage"`
// Whether additional usage is allowed when quota is exhausted
// Internal: OverageAllowedWithExhaustedQuota is part of the SDK's internal API surface and is not intended for external use.
OverageAllowedWithExhaustedQuota bool `json:"overageAllowedWithExhaustedQuota"`
// Percentage of quota remaining (0 to 100)
// Internal: RemainingPercentage is part of the SDK's internal API surface and is not intended for external use.
RemainingPercentage float64 `json:"remainingPercentage"`
// Date when the quota resets
// Internal: ResetDate is part of the SDK's internal API surface and is not intended for external use.
ResetDate *time.Time `json:"resetDate,omitempty"`
// Whether usage is still permitted after quota exhaustion
// Internal: UsageAllowedWithExhaustedQuota is part of the SDK's internal API surface and is not intended for external use.
UsageAllowedWithExhaustedQuota bool `json:"usageAllowedWithExhaustedQuota"`
// Number of requests already consumed
// Internal: UsedRequests is part of the SDK's internal API surface and is not intended for external use.
UsedRequests int64 `json:"usedRequests"`
}
Schema for the `AssistantUsageQuotaSnapshot` type. Internal: AssistantUsageQuotaSnapshot is an internal SDK API and is not part of the public surface.
type Attachment ¶ added in v1.0.0
type Attachment interface {
Type() AttachmentType
// contains filtered or unexported methods
}
A user message attachment — a file, directory, code selection, blob, GitHub reference, or extension-supplied context payload Experimental: Attachment is part of an experimental API and may change or be removed.
type AttachmentBlob ¶ added in v1.0.0
type AttachmentBlob struct {
// Base64-encoded content
Data string `json:"data"`
// User-facing display name for the attachment
DisplayName *string `json:"displayName,omitempty"`
// MIME type of the inline data
MIMEType string `json:"mimeType"`
}
Blob attachment with inline base64-encoded data Experimental: AttachmentBlob is part of an experimental API and may change or be removed.
func (AttachmentBlob) MarshalJSON ¶ added in v1.0.0
func (r AttachmentBlob) MarshalJSON() ([]byte, error)
func (AttachmentBlob) Type ¶ added in v1.0.0
func (AttachmentBlob) Type() AttachmentType
type AttachmentDirectory ¶ added in v1.0.0
type AttachmentDirectory struct {
// User-facing display name for the attachment
DisplayName string `json:"displayName"`
// Absolute directory path
Path string `json:"path"`
}
Directory attachment Experimental: AttachmentDirectory is part of an experimental API and may change or be removed.
func (AttachmentDirectory) MarshalJSON ¶ added in v1.0.0
func (r AttachmentDirectory) MarshalJSON() ([]byte, error)
func (AttachmentDirectory) Type ¶ added in v1.0.0
func (AttachmentDirectory) Type() AttachmentType
type AttachmentExtensionContext ¶ added in v1.0.0
type AttachmentExtensionContext struct {
// Provider-local canvas identifier when the push was bound to a canvas instance
CanvasID *string `json:"canvasId,omitempty"`
// ISO 8601 timestamp captured by the runtime when the push was accepted
CapturedAt time.Time `json:"capturedAt"`
// Owning extension identifier. Runtime-derived from the caller's connection when produced
// via session.extensions.sendAttachmentsToMessage; preserved verbatim on subsequent
// transports.
ExtensionID string `json:"extensionId"`
// Open canvas instance identifier when the push was bound to a canvas instance
InstanceID *string `json:"instanceId,omitempty"`
// Caller-supplied JSON payload
Payload any `json:"payload,omitempty"`
// Human-readable composer pill label
Title string `json:"title"`
}
Structured context contributed by an extension. Composer pills displayed in the host are forwarded back through session.send.attachments, then rendered into the model prompt as an <extension_context> XML block. Experimental: AttachmentExtensionContext is part of an experimental API and may change or be removed.
func (AttachmentExtensionContext) MarshalJSON ¶ added in v1.0.0
func (r AttachmentExtensionContext) MarshalJSON() ([]byte, error)
func (AttachmentExtensionContext) Type ¶ added in v1.0.0
func (AttachmentExtensionContext) Type() AttachmentType
type AttachmentFile ¶ added in v1.0.0
type AttachmentFile struct {
// User-facing display name for the attachment
DisplayName string `json:"displayName"`
// Optional line range to scope the attachment to a specific section of the file
LineRange *AttachmentFileLineRange `json:"lineRange,omitempty"`
// Absolute file path
Path string `json:"path"`
}
File attachment Experimental: AttachmentFile is part of an experimental API and may change or be removed.
func (AttachmentFile) MarshalJSON ¶ added in v1.0.0
func (r AttachmentFile) MarshalJSON() ([]byte, error)
func (AttachmentFile) Type ¶ added in v1.0.0
func (AttachmentFile) Type() AttachmentType
type AttachmentFileLineRange ¶ added in v1.0.0
type AttachmentFileLineRange struct {
// End line number (1-based, inclusive)
End int64 `json:"end"`
// Start line number (1-based)
Start int64 `json:"start"`
}
Optional line range to scope the attachment to a specific section of the file Experimental: AttachmentFileLineRange is part of an experimental API and may change or be removed.
type AttachmentGitHubReference ¶ added in v1.0.0
type AttachmentGitHubReference struct {
// Issue, pull request, or discussion number
Number int64 `json:"number"`
// Type of GitHub reference
ReferenceType AttachmentGitHubReferenceType `json:"referenceType"`
// Current state of the referenced item (e.g., open, closed, merged)
State string `json:"state"`
// Title of the referenced item
Title string `json:"title"`
// URL to the referenced item on GitHub
URL string `json:"url"`
}
GitHub issue, pull request, or discussion reference Experimental: AttachmentGitHubReference is part of an experimental API and may change or be removed.
func (AttachmentGitHubReference) MarshalJSON ¶ added in v1.0.0
func (r AttachmentGitHubReference) MarshalJSON() ([]byte, error)
func (AttachmentGitHubReference) Type ¶ added in v1.0.0
func (AttachmentGitHubReference) Type() AttachmentType
type AttachmentGitHubReferenceType ¶ added in v1.0.0
type AttachmentGitHubReferenceType string
Type of GitHub reference Experimental: AttachmentGitHubReferenceType is part of an experimental API and may change or be removed.
const ( // GitHub discussion reference. AttachmentGitHubReferenceTypeDiscussion AttachmentGitHubReferenceType = "discussion" // GitHub issue reference. AttachmentGitHubReferenceTypeIssue AttachmentGitHubReferenceType = "issue" // GitHub pull request reference. AttachmentGitHubReferenceTypePr AttachmentGitHubReferenceType = "pr" )
type AttachmentSelection ¶ added in v1.0.0
type AttachmentSelection struct {
// User-facing display name for the selection
DisplayName string `json:"displayName"`
// Absolute path to the file containing the selection
FilePath string `json:"filePath"`
// Position range of the selection within the file
Selection AttachmentSelectionDetails `json:"selection"`
// The selected text content
Text string `json:"text"`
}
Code selection attachment from an editor Experimental: AttachmentSelection is part of an experimental API and may change or be removed.
func (AttachmentSelection) MarshalJSON ¶ added in v1.0.0
func (r AttachmentSelection) MarshalJSON() ([]byte, error)
func (AttachmentSelection) Type ¶ added in v1.0.0
func (AttachmentSelection) Type() AttachmentType
type AttachmentSelectionDetails ¶ added in v1.0.0
type AttachmentSelectionDetails struct {
// End position of the selection
End AttachmentSelectionDetailsEnd `json:"end"`
// Start position of the selection
Start AttachmentSelectionDetailsStart `json:"start"`
}
Position range of the selection within the file Experimental: AttachmentSelectionDetails is part of an experimental API and may change or be removed.
type AttachmentSelectionDetailsEnd ¶ added in v1.0.0
type AttachmentSelectionDetailsEnd struct {
// End character offset within the line (0-based)
Character int64 `json:"character"`
// End line number (0-based)
Line int64 `json:"line"`
}
End position of the selection Experimental: AttachmentSelectionDetailsEnd is part of an experimental API and may change or be removed.
type AttachmentSelectionDetailsStart ¶ added in v1.0.0
type AttachmentSelectionDetailsStart struct {
// Start character offset within the line (0-based)
Character int64 `json:"character"`
// Start line number (0-based)
Line int64 `json:"line"`
}
Start position of the selection Experimental: AttachmentSelectionDetailsStart is part of an experimental API and may change or be removed.
type AttachmentType ¶ added in v1.0.0
type AttachmentType string
Type discriminator for Attachment.
const ( AttachmentTypeBlob AttachmentType = "blob" AttachmentTypeDirectory AttachmentType = "directory" AttachmentTypeExtensionContext AttachmentType = "extension_context" AttachmentTypeFile AttachmentType = "file" AttachmentTypeGitHubReference AttachmentType = "github_reference" AttachmentTypeSelection AttachmentType = "selection" )
type AuthAPI ¶ added in v1.0.0
type AuthAPI sessionAPI
Experimental: AuthAPI contains experimental APIs that may change or be removed.
func (*AuthAPI) GetStatus ¶ added in v1.0.0
func (a *AuthAPI) GetStatus(ctx context.Context) (*SessionAuthStatus, error)
GetStatus gets authentication status and account metadata for the session.
RPC method: session.auth.getStatus.
Returns: Authentication status and account metadata for the session.
func (*AuthAPI) SetCredentials ¶ added in v1.0.0
func (a *AuthAPI) SetCredentials(ctx context.Context, params *SessionSetCredentialsParams) (*SessionSetCredentialsResult, error)
SetCredentials updates the session's auth credentials used for outbound model and API requests.
RPC method: session.auth.setCredentials.
Parameters: New auth credentials to install on the session. Omit to leave credentials unchanged.
Returns: Indicates whether the credential update succeeded.
type AuthInfo ¶ added in v1.0.0
type AuthInfo interface {
Type() AuthInfoType
// contains filtered or unexported methods
}
Initial authentication info for the session. Experimental: AuthInfo is part of an experimental API and may change or be removed.
type AuthInfoType ¶ added in v0.3.0
type AuthInfoType string
Type discriminator for AuthInfo. Experimental: AuthInfoType is part of an experimental API and may change or be removed.
const ( AuthInfoTypeAPIKey AuthInfoType = "api-key" AuthInfoTypeCopilotAPIToken AuthInfoType = "copilot-api-token" AuthInfoTypeEnv AuthInfoType = "env" AuthInfoTypeGhCLI AuthInfoType = "gh-cli" AuthInfoTypeHMAC AuthInfoType = "hmac" AuthInfoTypeToken AuthInfoType = "token" AuthInfoTypeUser AuthInfoType = "user" )
type AutoModeSwitchCompletedData ¶ added in v1.0.0
type AutoModeSwitchCompletedData struct {
// Request ID of the resolved request; clients should dismiss any UI for this request
RequestID string `json:"requestId"`
// The user's auto-mode-switch choice
Response AutoModeSwitchResponse `json:"response"`
}
Auto mode switch completion notification
func (*AutoModeSwitchCompletedData) Type ¶ added in v1.0.0
func (*AutoModeSwitchCompletedData) Type() SessionEventType
type AutoModeSwitchRequestedData ¶ added in v1.0.0
type AutoModeSwitchRequestedData struct {
// The rate limit error code that triggered this request
ErrorCode *string `json:"errorCode,omitempty"`
// Unique identifier for this request; used to respond via session.respondToAutoModeSwitch()
RequestID string `json:"requestId"`
// Seconds until the rate limit resets, when known. Lets clients render a humanized reset time alongside the prompt.
RetryAfterSeconds *int64 `json:"retryAfterSeconds,omitempty"`
}
Auto mode switch request notification requiring user approval
func (*AutoModeSwitchRequestedData) Type ¶ added in v1.0.0
func (*AutoModeSwitchRequestedData) Type() SessionEventType
type AutoModeSwitchResponse ¶ added in v1.0.0
type AutoModeSwitchResponse string
The user's auto-mode-switch choice
const ( // Do not switch models. AutoModeSwitchResponseNo AutoModeSwitchResponse = "no" // Switch models for this request. AutoModeSwitchResponseYes AutoModeSwitchResponse = "yes" // Switch models now and keep using the replacement automatically. AutoModeSwitchResponseYesAlways AutoModeSwitchResponse = "yes_always" )
type AutopilotObjectiveChangedOperation ¶ added in v1.0.0
type AutopilotObjectiveChangedOperation string
The type of operation performed on the autopilot objective state file
const ( // Autopilot objective state file was created for a new objective. AutopilotObjectiveChangedOperationCreate AutopilotObjectiveChangedOperation = "create" // Autopilot objective state file was deleted or cleared. AutopilotObjectiveChangedOperationDelete AutopilotObjectiveChangedOperation = "delete" // Autopilot objective state file was updated for an existing objective. AutopilotObjectiveChangedOperationUpdate AutopilotObjectiveChangedOperation = "update" )
type AutopilotObjectiveChangedStatus ¶ added in v1.0.0
type AutopilotObjectiveChangedStatus string
Current autopilot objective status, if one exists
const ( // Objective is active and can drive autopilot continuations. AutopilotObjectiveChangedStatusActive AutopilotObjectiveChangedStatus = "active" // Legacy objective state indicating the previous continuation cap was reached. AutopilotObjectiveChangedStatusCapReached AutopilotObjectiveChangedStatus = "cap_reached" // Objective was completed by the agent. AutopilotObjectiveChangedStatusCompleted AutopilotObjectiveChangedStatus = "completed" // Objective is paused and will not drive autopilot continuations. AutopilotObjectiveChangedStatusPaused AutopilotObjectiveChangedStatus = "paused" )
type CancelUserRequestedShellCommandResult ¶ added in v1.0.1
type CancelUserRequestedShellCommandResult struct {
// Whether an in-flight execution was found and signalled to cancel
Cancelled bool `json:"cancelled"`
}
Cancellation result for a user-requested shell command. Experimental: CancelUserRequestedShellCommandResult is part of an experimental API and may change or be removed.
type CanvasAPI ¶ added in v1.0.0
type CanvasAPI sessionAPI
Experimental: CanvasAPI contains experimental APIs that may change or be removed.
func (*CanvasAPI) Action ¶ added in v1.0.0
func (s *CanvasAPI) Action() *CanvasActionAPI
Experimental: Action returns experimental APIs that may change or be removed.
func (*CanvasAPI) Close ¶ added in v1.0.0
func (a *CanvasAPI) Close(ctx context.Context, params *CanvasCloseRequest) (*SessionCanvasCloseResult, error)
Closes an open canvas instance.
RPC method: session.canvas.close.
Parameters: Canvas close parameters.
func (*CanvasAPI) List ¶ added in v1.0.0
func (a *CanvasAPI) List(ctx context.Context) (*CanvasList, error)
Lists canvases declared for the session.
RPC method: session.canvas.list.
Returns: Declared canvases available in this session.
func (*CanvasAPI) ListOpen ¶ added in v1.0.0
func (a *CanvasAPI) ListOpen(ctx context.Context) (*CanvasListOpenResult, error)
ListOpen lists currently open canvas instances for the live session.
RPC method: session.canvas.listOpen.
Returns: Live open-canvas snapshot.
func (*CanvasAPI) Open ¶ added in v1.0.0
func (a *CanvasAPI) Open(ctx context.Context, params *CanvasOpenRequest) (*OpenCanvasInstance, error)
Opens or focuses a canvas instance.
RPC method: session.canvas.open.
Parameters: Canvas open parameters.
Returns: Open canvas instance snapshot.
type CanvasAction ¶ added in v1.0.0
type CanvasAction struct {
// Description of the action
Description *string `json:"description,omitempty"`
// JSON Schema for the action input
InputSchema any `json:"inputSchema,omitempty"`
// Action name exposed by the canvas provider
Name string `json:"name"`
}
Canvas action that the agent or host can invoke. To discover the input schema for a particular action, call the list_canvas_capabilities tool. Experimental: CanvasAction is part of an experimental API and may change or be removed.
type CanvasActionAPI ¶ added in v1.0.0
type CanvasActionAPI sessionAPI
Experimental: CanvasActionAPI contains experimental APIs that may change or be removed.
func (*CanvasActionAPI) Invoke ¶ added in v1.0.0
func (a *CanvasActionAPI) Invoke(ctx context.Context, params *CanvasActionInvokeRequest) (*CanvasActionInvokeResult, error)
Invokes an action on an open canvas instance.
RPC method: session.canvas.action.invoke.
Parameters: Canvas action invocation parameters.
Returns: Canvas action invocation result.
type CanvasActionInvokeRequest ¶ added in v1.0.0
type CanvasActionInvokeRequest struct {
// Action name to invoke
ActionName string `json:"actionName"`
// Action input
Input any `json:"input,omitempty"`
// Open canvas instance identifier
InstanceID string `json:"instanceId"`
}
Canvas action invocation parameters. Experimental: CanvasActionInvokeRequest is part of an experimental API and may change or be removed.
type CanvasActionInvokeResult ¶ added in v1.0.0
type CanvasActionInvokeResult struct {
// Provider-supplied action result
Result any `json:"result,omitempty"`
}
Canvas action invocation result. Experimental: CanvasActionInvokeResult is part of an experimental API and may change or be removed.
type CanvasCloseRequest ¶ added in v1.0.0
type CanvasCloseRequest struct {
// Open canvas instance identifier
InstanceID string `json:"instanceId"`
}
Canvas close parameters. Experimental: CanvasCloseRequest is part of an experimental API and may change or be removed.
type CanvasCloseResult ¶ added in v1.0.0
type CanvasCloseResult struct {
}
Experimental: CanvasCloseResult is part of an experimental API and may change or be removed.
type CanvasHandler ¶ added in v1.0.0
type CanvasHandler interface {
// Closes a canvas instance on the provider.
//
// RPC method: canvas.close.
//
// Parameters: Canvas close parameters sent to the provider.
Close(request *CanvasProviderCloseRequest) (*CanvasCloseResult, error)
// Invokes an action on an open canvas instance via the provider.
//
// RPC method: canvas.action.invoke.
//
// Parameters: Canvas action invocation parameters sent to the provider.
//
// Returns: Provider-supplied action result.
Invoke(request *CanvasProviderInvokeActionRequest) (any, error)
// Opens a canvas instance on the provider.
//
// RPC method: canvas.open.
//
// Parameters: Canvas open parameters sent to the provider.
//
// Returns: Canvas open result returned by the provider.
Open(request *CanvasProviderOpenRequest) (*CanvasProviderOpenResult, error)
}
Experimental: CanvasHandler contains experimental APIs that may change or be removed.
type CanvasHostContext ¶ added in v1.0.0
type CanvasHostContext struct {
// Host capabilities
Capabilities *CanvasHostContextCapabilities `json:"capabilities,omitempty"`
}
Host context supplied by the runtime. Experimental: CanvasHostContext is part of an experimental API and may change or be removed.
type CanvasHostContextCapabilities ¶ added in v1.0.0
type CanvasHostContextCapabilities struct {
// Whether canvas rendering is supported
Canvases *bool `json:"canvases,omitempty"`
}
Host capabilities Experimental: CanvasHostContextCapabilities is part of an experimental API and may change or be removed.
type CanvasInstanceAvailability ¶ added in v1.0.0
type CanvasInstanceAvailability string
Runtime-controlled routing state for an open canvas instance. Experimental: CanvasInstanceAvailability is part of an experimental API and may change or be removed.
const ( // The owning provider is currently connected and routing calls will be dispatched normally. CanvasInstanceAvailabilityReady CanvasInstanceAvailability = "ready" // The owning provider is not currently connected. Routing calls fail with // canvas_provider_unavailable until the agent re-issues open_canvas (which rehydrates via a // fresh canvas.open) or the provider reconnects. CanvasInstanceAvailabilityStale CanvasInstanceAvailability = "stale" )
type CanvasJSONSchema ¶ added in v1.0.0
type CanvasJSONSchema any
JSON Schema for canvas open input Experimental: CanvasJSONSchema is part of an experimental API and may change or be removed.
type CanvasList ¶ added in v1.0.0
type CanvasList struct {
// Declared canvases available in this session
Canvases []DiscoveredCanvas `json:"canvases"`
}
Declared canvases available in this session. Experimental: CanvasList is part of an experimental API and may change or be removed.
type CanvasListOpenResult ¶ added in v1.0.0
type CanvasListOpenResult struct {
// Currently open canvas instances
OpenCanvases []OpenCanvasInstance `json:"openCanvases"`
}
Live open-canvas snapshot. Experimental: CanvasListOpenResult is part of an experimental API and may change or be removed.
type CanvasOpenRequest ¶ added in v1.0.0
type CanvasOpenRequest struct {
// Provider-local canvas identifier
CanvasID string `json:"canvasId"`
// Owning provider identifier. Optional when the canvasId is unique across providers;
// required to disambiguate when multiple providers register the same canvasId.
ExtensionID *string `json:"extensionId,omitempty"`
// Canvas open input
Input any `json:"input,omitempty"`
// Caller-supplied stable instance identifier
InstanceID string `json:"instanceId"`
}
Canvas open parameters. Experimental: CanvasOpenRequest is part of an experimental API and may change or be removed.
type CanvasOpenedAvailability ¶ added in v1.0.0
type CanvasOpenedAvailability string
Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding.
const ( // Provider connection is live; actions can be invoked. CanvasOpenedAvailabilityReady CanvasOpenedAvailability = "ready" // Provider has gone away; the instance is awaiting rebinding. CanvasOpenedAvailabilityStale CanvasOpenedAvailability = "stale" )
type CanvasProviderCloseRequest ¶ added in v1.0.0
type CanvasProviderCloseRequest struct {
// Provider-local canvas identifier
CanvasID string `json:"canvasId"`
// Owning provider identifier
ExtensionID string `json:"extensionId"`
// Host context supplied by the runtime.
Host *CanvasHostContext `json:"host,omitempty"`
// Canvas instance identifier
InstanceID string `json:"instanceId"`
// Session context supplied by the runtime.
Session *CanvasSessionContext `json:"session,omitempty"`
// Target session identifier
SessionID string `json:"sessionId"`
}
Canvas close parameters sent to the provider. Experimental: CanvasProviderCloseRequest is part of an experimental API and may change or be removed.
type CanvasProviderInvokeActionRequest ¶ added in v1.0.0
type CanvasProviderInvokeActionRequest struct {
// Action name to invoke
ActionName string `json:"actionName"`
// Provider-local canvas identifier
CanvasID string `json:"canvasId"`
// Owning provider identifier
ExtensionID string `json:"extensionId"`
// Host context supplied by the runtime.
Host *CanvasHostContext `json:"host,omitempty"`
// Action input
Input any `json:"input,omitempty"`
// Canvas instance identifier
InstanceID string `json:"instanceId"`
// Session context supplied by the runtime.
Session *CanvasSessionContext `json:"session,omitempty"`
// Target session identifier
SessionID string `json:"sessionId"`
}
Canvas action invocation parameters sent to the provider. Experimental: CanvasProviderInvokeActionRequest is part of an experimental API and may change or be removed.
type CanvasProviderOpenRequest ¶ added in v1.0.0
type CanvasProviderOpenRequest struct {
// Provider-local canvas identifier
CanvasID string `json:"canvasId"`
// Owning provider identifier
ExtensionID string `json:"extensionId"`
// Host context supplied by the runtime.
Host *CanvasHostContext `json:"host,omitempty"`
// Canvas open input
Input any `json:"input,omitempty"`
// Stable caller-supplied canvas instance identifier
InstanceID string `json:"instanceId"`
// Session context supplied by the runtime.
Session *CanvasSessionContext `json:"session,omitempty"`
// Target session identifier
SessionID string `json:"sessionId"`
}
Canvas open parameters sent to the provider. Experimental: CanvasProviderOpenRequest is part of an experimental API and may change or be removed.
type CanvasProviderOpenResult ¶ added in v1.0.0
type CanvasProviderOpenResult struct {
// Provider-supplied status text
Status *string `json:"status,omitempty"`
// Provider-supplied title
Title *string `json:"title,omitempty"`
// URL for web-rendered canvases
URL *string `json:"url,omitempty"`
}
Canvas open result returned by the provider. Experimental: CanvasProviderOpenResult is part of an experimental API and may change or be removed.
type CanvasRegistryChangedCanvas ¶ added in v1.0.0
type CanvasRegistryChangedCanvas struct {
// Actions the agent or host may invoke
Actions []CanvasRegistryChangedCanvasAction `json:"actions,omitzero"`
// Provider-local canvas identifier
CanvasID string `json:"canvasId"`
// Short, single-sentence description shown to the agent in canvas catalogs.
Description string `json:"description"`
// Human-readable canvas name
DisplayName string `json:"displayName"`
// Owning provider identifier
ExtensionID string `json:"extensionId"`
// Owning extension display name, when available
ExtensionName *string `json:"extensionName,omitempty"`
// JSON Schema for canvas open input
InputSchema map[string]any `json:"inputSchema,omitzero"`
}
Schema for the `CanvasRegistryChangedCanvas` type.
type CanvasRegistryChangedCanvasAction ¶ added in v1.0.0
type CanvasRegistryChangedCanvasAction struct {
// Action description
Description *string `json:"description,omitempty"`
// JSON Schema for action input
InputSchema map[string]any `json:"inputSchema,omitzero"`
// Action name
Name string `json:"name"`
}
Schema for the `CanvasRegistryChangedCanvasAction` type.
type CanvasSessionContext ¶ added in v1.0.0
type CanvasSessionContext struct {
// Active session working directory, when known.
WorkingDirectory *string `json:"workingDirectory,omitempty"`
}
Session context supplied by the runtime. Experimental: CanvasSessionContext is part of an experimental API and may change or be removed.
type CapabilitiesChangedData ¶ added in v1.0.0
type CapabilitiesChangedData struct {
// UI capability changes
UI *CapabilitiesChangedUI `json:"ui,omitempty"`
}
Session capability change notification
func (*CapabilitiesChangedData) Type ¶ added in v1.0.0
func (*CapabilitiesChangedData) Type() SessionEventType
type CapabilitiesChangedUI ¶ added in v1.0.0
type CapabilitiesChangedUI struct {
// Whether canvas rendering is now supported
Canvases *bool `json:"canvases,omitempty"`
// Whether elicitation is now supported
Elicitation *bool `json:"elicitation,omitempty"`
// Whether MCP Apps (SEP-1865) UI passthrough is now supported
MCPApps *bool `json:"mcpApps,omitempty"`
}
UI capability changes
type ClientSessionAPIHandlers ¶ added in v1.0.0
type ClientSessionAPIHandlers struct {
Canvas CanvasHandler
SessionFS SessionFSHandler
}
ClientSessionAPIHandlers provides all client session API handler groups for a session.
type CommandCompletedData ¶ added in v1.0.0
type CommandCompletedData struct {
// Request ID of the resolved command request; clients should dismiss any UI for this request
RequestID string `json:"requestId"`
}
Queued command completion notification signaling UI dismissal
func (*CommandCompletedData) Type ¶ added in v1.0.0
func (*CommandCompletedData) Type() SessionEventType
type CommandExecuteData ¶ added in v1.0.0
type CommandExecuteData struct {
// Raw argument string after the command name
Args string `json:"args"`
// The full command text (e.g., /deploy production)
Command string `json:"command"`
// Command name without leading /
CommandName string `json:"commandName"`
// Unique identifier; used to respond via session.commands.handlePendingCommand()
RequestID string `json:"requestId"`
}
Registered command dispatch request routed to the owning client
func (*CommandExecuteData) Type ¶ added in v1.0.0
func (*CommandExecuteData) Type() SessionEventType
type CommandList ¶ added in v1.0.0
type CommandList struct {
// Commands available in this session
Commands []SlashCommandInfo `json:"commands"`
}
Slash commands available in the session, after applying any include/exclude filters. Experimental: CommandList is part of an experimental API and may change or be removed.
type CommandQueuedData ¶ added in v1.0.0
type CommandQueuedData struct {
// The slash command text to be executed (e.g., /help, /clear)
Command string `json:"command"`
// Unique identifier for this request; used to respond via session.respondToQueuedCommand()
RequestID string `json:"requestId"`
}
Queued slash command dispatch request for client execution
func (*CommandQueuedData) Type ¶ added in v1.0.0
func (*CommandQueuedData) Type() SessionEventType
type CommandsAPI ¶ added in v1.0.0
type CommandsAPI sessionAPI
Experimental: CommandsAPI contains experimental APIs that may change or be removed.
func (*CommandsAPI) Enqueue ¶ added in v1.0.0
func (a *CommandsAPI) Enqueue(ctx context.Context, params *EnqueueCommandParams) (*EnqueueCommandResult, error)
Enqueues a slash command for FIFO processing on the local session.
RPC method: session.commands.enqueue.
Parameters: Slash-prefixed command string to enqueue for FIFO processing.
Returns: Indicates whether the command was accepted into the local execution queue.
func (*CommandsAPI) Execute ¶ added in v1.0.0
func (a *CommandsAPI) Execute(ctx context.Context, params *ExecuteCommandParams) (*ExecuteCommandResult, error)
Executes a slash command synchronously and returns any error.
RPC method: session.commands.execute.
Parameters: Slash command name and argument string to execute synchronously.
Returns: Error message produced while executing the command, if any.
func (*CommandsAPI) HandlePendingCommand ¶ added in v1.0.0
func (a *CommandsAPI) HandlePendingCommand(ctx context.Context, params *CommandsHandlePendingCommandRequest) (*CommandsHandlePendingCommandResult, error)
HandlePendingCommand reports completion of a pending client-handled slash command.
RPC method: session.commands.handlePendingCommand.
Parameters: Pending command request ID and an optional error if the client handler failed.
Returns: Indicates whether the pending client-handled command was completed successfully.
func (*CommandsAPI) Invoke ¶ added in v1.0.0
func (a *CommandsAPI) Invoke(ctx context.Context, params *CommandsInvokeRequest) (SlashCommandInvocationResult, error)
Invokes a slash command in the session.
RPC method: session.commands.invoke.
Parameters: Slash command name and optional raw input string to invoke.
Returns: Result of invoking the slash command (text output, prompt to send to the agent, or completion).
func (*CommandsAPI) List ¶ added in v1.0.0
func (a *CommandsAPI) List(ctx context.Context, params ...*CommandsListRequest) (*CommandList, error)
Lists slash commands available in the session.
RPC method: session.commands.list.
Parameters: Optional filters controlling which command sources to include in the listing.
Returns: Slash commands available in the session, after applying any include/exclude filters.
func (*CommandsAPI) RespondToQueuedCommand ¶ added in v1.0.0
func (a *CommandsAPI) RespondToQueuedCommand(ctx context.Context, params *CommandsRespondToQueuedCommandRequest) (*CommandsRespondToQueuedCommandResult, error)
RespondToQueuedCommand reports whether the host actually executed a queued command and whether to continue processing.
RPC method: session.commands.respondToQueuedCommand.
Parameters: Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands).
Returns: Indicates whether the queued-command response was matched to a pending request.
type CommandsChangedCommand ¶ added in v1.0.0
type CommandsChangedCommand struct {
// Optional human-readable command description.
Description *string `json:"description,omitempty"`
// Slash command name without the leading slash.
Name string `json:"name"`
}
Schema for the `CommandsChangedCommand` type.
type CommandsChangedData ¶ added in v1.0.0
type CommandsChangedData struct {
// Current list of registered SDK commands
Commands []CommandsChangedCommand `json:"commands"`
}
SDK command registration change notification
func (*CommandsChangedData) Type ¶ added in v1.0.0
func (*CommandsChangedData) Type() SessionEventType
type CommandsHandlePendingCommandRequest ¶ added in v0.3.0
type CommandsHandlePendingCommandRequest struct {
// Error message if the command handler failed
Error *string `json:"error,omitempty"`
// Request ID from the command invocation event
RequestID string `json:"requestId"`
}
Pending command request ID and an optional error if the client handler failed. Experimental: CommandsHandlePendingCommandRequest is part of an experimental API and may change or be removed.
type CommandsHandlePendingCommandResult ¶ added in v0.3.0
type CommandsHandlePendingCommandResult struct {
// Whether the command was handled successfully
Success bool `json:"success"`
}
Indicates whether the pending client-handled command was completed successfully. Experimental: CommandsHandlePendingCommandResult is part of an experimental API and may change or be removed.
type CommandsInvokeRequest ¶ added in v1.0.0
type CommandsInvokeRequest struct {
// Raw input after the command name
Input *string `json:"input,omitempty"`
// Command name. Leading slashes are stripped and the name is matched case-insensitively.
Name string `json:"name"`
}
Slash command name and optional raw input string to invoke. Experimental: CommandsInvokeRequest is part of an experimental API and may change or be removed.
type CommandsListRequest ¶ added in v1.0.0
type CommandsListRequest struct {
// Include runtime built-in commands
IncludeBuiltins *bool `json:"includeBuiltins,omitempty"`
// Include commands registered by protocol clients, including SDK clients and extensions
IncludeClientCommands *bool `json:"includeClientCommands,omitempty"`
// Include enabled user-invocable skills and commands
IncludeSkills *bool `json:"includeSkills,omitempty"`
}
Optional filters controlling which command sources to include in the listing. Experimental: CommandsListRequest is part of an experimental API and may change or be removed.
type CommandsRespondToQueuedCommandRequest ¶ added in v1.0.0
type CommandsRespondToQueuedCommandRequest struct {
// Request ID from the `command.queued` event the host is responding to.
RequestID string `json:"requestId"`
// Result of the queued command execution.
Result QueuedCommandResult `json:"result"`
}
Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands). Experimental: CommandsRespondToQueuedCommandRequest is part of an experimental API and may change or be removed.
func (*CommandsRespondToQueuedCommandRequest) UnmarshalJSON ¶ added in v1.0.0
func (r *CommandsRespondToQueuedCommandRequest) UnmarshalJSON(data []byte) error
type CommandsRespondToQueuedCommandResult ¶ added in v1.0.0
type CommandsRespondToQueuedCommandResult struct {
// Whether a pending queued command with the given request ID was found and resolved. False
// when the request was already resolved, cancelled, or unknown.
Success bool `json:"success"`
}
Indicates whether the queued-command response was matched to a pending request. Experimental: CommandsRespondToQueuedCommandResult is part of an experimental API and may change or be removed.
type CompactionCompleteCompactionTokensUsed ¶ added in v1.0.0
type CompactionCompleteCompactionTokensUsed struct {
// Cached input tokens reused in the compaction LLM call
CacheReadTokens *int64 `json:"cacheReadTokens,omitempty"`
// Tokens written to prompt cache in the compaction LLM call
CacheWriteTokens *int64 `json:"cacheWriteTokens,omitempty"`
// Per-request cost and usage data from the CAPI copilot_usage response field
// Internal: CopilotUsage is part of the SDK's internal API surface and is not intended for external use.
CopilotUsage *CompactionCompleteCompactionTokensUsedCopilotUsage `json:"copilotUsage,omitempty"`
// Duration of the compaction LLM call in milliseconds
Duration *int64 `json:"duration,omitempty"`
// Input tokens consumed by the compaction LLM call
InputTokens *int64 `json:"inputTokens,omitempty"`
// Model identifier used for the compaction LLM call
Model *string `json:"model,omitempty"`
// Output tokens produced by the compaction LLM call
OutputTokens *int64 `json:"outputTokens,omitempty"`
}
Token usage breakdown for the compaction LLM call (aligned with assistant.usage format)
type CompactionCompleteCompactionTokensUsedCopilotUsage ¶ added in v1.0.0
type CompactionCompleteCompactionTokensUsedCopilotUsage struct {
// Itemized token usage breakdown
TokenDetails []CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail `json:"tokenDetails"`
// Total cost in nano-AI units for this request
TotalNanoAiu float64 `json:"totalNanoAiu"`
}
Per-request cost and usage data from the CAPI copilot_usage response field Internal: CompactionCompleteCompactionTokensUsedCopilotUsage is an internal SDK API and is not part of the public surface.
type CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail ¶ added in v1.0.0
type CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail struct {
// Number of tokens in this billing batch
BatchSize int64 `json:"batchSize"`
// Cost per batch of tokens
CostPerBatch int64 `json:"costPerBatch"`
// Total token count for this entry
TokenCount int64 `json:"tokenCount"`
// Token category (e.g., "input", "output")
TokenType string `json:"tokenType"`
}
Token usage detail for a single billing category
type ConfigureSessionExtensionsParams ¶ added in v1.0.1
type ConfigureSessionExtensionsParams struct {
// In-process ExtensionController delegate (CLI-only optimization). Marked internal: this
// field is excluded from the public SDK surface. The post-SDK extension surface exposes
// list/enable/disable/reload via dedicated RPCs served by the runtime.
// Internal: Controller is part of the SDK's internal API surface and is not intended for
// external use.
Controller any `json:"controller,omitempty"`
// Session to attach the extension controller delegate to.
SessionID string `json:"sessionId"`
}
Params to attach or detach an in-process ExtensionController delegate. Experimental: ConfigureSessionExtensionsParams is part of an experimental API and may change or be removed. Internal: ConfigureSessionExtensionsParams is an internal SDK API and is not part of the public surface.
type ConnectRemoteSessionParams ¶ added in v1.0.0
type ConnectRemoteSessionParams struct {
// Session ID to connect to.
SessionID string `json:"sessionId"`
}
Remote session connection parameters. Experimental: ConnectRemoteSessionParams is part of an experimental API and may change or be removed.
type ConnectRequest ¶ added in v1.0.0
type ConnectRequest struct {
// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN
Token *string `json:"token,omitempty"`
}
Optional connection token presented by the SDK client during the handshake. Internal: ConnectRequest is an internal SDK API and is not part of the public surface.
type ConnectResult ¶ added in v1.0.0
type ConnectResult struct {
// Always true on success
Ok bool `json:"ok"`
// Server protocol version number
ProtocolVersion int64 `json:"protocolVersion"`
// Server package version
Version string `json:"version"`
}
Handshake result reporting the server's protocol version and package version on success. Internal: ConnectResult is an internal SDK API and is not part of the public surface.
type ConnectedRemoteSessionMetadata ¶ added in v1.0.0
type ConnectedRemoteSessionMetadata struct {
// Neutral SDK discriminator for the connected remote session kind.
Kind ConnectedRemoteSessionMetadataKind `json:"kind"`
// Last session update time as an ISO 8601 string.
ModifiedTime time.Time `json:"modifiedTime"`
// Optional friendly session name.
Name *string `json:"name,omitempty"`
// Pull request number associated with the session.
PullRequestNumber *int64 `json:"pullRequestNumber,omitempty"`
// Repository associated with the connected remote session.
Repository ConnectedRemoteSessionMetadataRepository `json:"repository"`
// Original remote resource identifier.
ResourceID *string `json:"resourceId,omitempty"`
// SDK session ID for the connected remote session.
SessionID string `json:"sessionId"`
// Remote session staleness deadline as an ISO 8601 string.
StaleAt *time.Time `json:"staleAt,omitempty"`
// Session start time as an ISO 8601 string.
StartTime time.Time `json:"startTime"`
// Remote session state returned by the backing service.
State *string `json:"state,omitempty"`
// Optional session summary.
Summary *string `json:"summary,omitempty"`
}
Metadata for a connected remote session. Experimental: ConnectedRemoteSessionMetadata is part of an experimental API and may change or be removed.
type ConnectedRemoteSessionMetadataKind ¶ added in v1.0.0
type ConnectedRemoteSessionMetadataKind string
Neutral SDK discriminator for the connected remote session kind. Experimental: ConnectedRemoteSessionMetadataKind is part of an experimental API and may change or be removed.
const ( // GitHub Copilot coding agent session. ConnectedRemoteSessionMetadataKindCodingAgent ConnectedRemoteSessionMetadataKind = "coding-agent" // Remote CLI session. ConnectedRemoteSessionMetadataKindRemoteSession ConnectedRemoteSessionMetadataKind = "remote-session" )
type ConnectedRemoteSessionMetadataRepository ¶ added in v1.0.0
type ConnectedRemoteSessionMetadataRepository struct {
// Branch associated with the remote session.
Branch string `json:"branch"`
// Repository name.
Name string `json:"name"`
// Repository owner or organization login.
Owner string `json:"owner"`
}
Repository associated with the connected remote session. Experimental: ConnectedRemoteSessionMetadataRepository is part of an experimental API and may change or be removed.
type ContentFilterMode ¶ added in v1.0.0
type ContentFilterMode string
Controls how MCP tool result content is filtered: none leaves content unchanged, markdown sanitizes HTML while preserving Markdown-friendly output, and hidden_characters removes characters that can hide directives.
const ( // Remove characters that can hide directives. ContentFilterModeHiddenCharacters ContentFilterMode = "hidden_characters" // Sanitize HTML while preserving Markdown-friendly output. ContentFilterModeMarkdown ContentFilterMode = "markdown" // Leave MCP tool result content unchanged. ContentFilterModeNone ContentFilterMode = "none" )
type ContextTier ¶ added in v1.0.0
type ContextTier string
Context tier for models that support multiple context-window sizes. Experimental: ContextTier is part of an experimental API and may change or be removed.
const ( // Use the model's default context window. ContextTierDefault ContextTier = "default" // Pin the session to the long-context tier when supported. ContextTierLongContext ContextTier = "long_context" )
type CopilotAPITokenAuthInfo ¶ added in v1.0.0
type CopilotAPITokenAuthInfo struct {
// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the
// GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this
// verbatim and does not re-fetch when set.
CopilotUser *CopilotUserResponse `json:"copilotUser,omitempty"`
// Authentication host (always the public GitHub host).
Host CopilotAPITokenAuthInfoHost `json:"host"`
}
Schema for the `CopilotApiTokenAuthInfo` type. Experimental: CopilotAPITokenAuthInfo is part of an experimental API and may change or be removed.
func (CopilotAPITokenAuthInfo) MarshalJSON ¶ added in v1.0.0
func (r CopilotAPITokenAuthInfo) MarshalJSON() ([]byte, error)
func (CopilotAPITokenAuthInfo) Type ¶ added in v1.0.0
func (CopilotAPITokenAuthInfo) Type() AuthInfoType
type CopilotAPITokenAuthInfoHost ¶ added in v1.0.0
type CopilotAPITokenAuthInfoHost string
Authentication host (always the public GitHub host).
const (
CopilotAPITokenAuthInfoHostHTTPSGitHubCom CopilotAPITokenAuthInfoHost = "https://github.com"
)
type CopilotUserResponse ¶ added in v1.0.0
type CopilotUserResponse struct {
AccessTypeSku *string `json:"access_type_sku,omitempty"`
AnalyticsTrackingID *string `json:"analytics_tracking_id,omitempty"`
AssignedDate *string `json:"assigned_date,omitempty"`
CanSignupForLimited *bool `json:"can_signup_for_limited,omitempty"`
ChatEnabled *bool `json:"chat_enabled,omitempty"`
CLIRemoteControlEnabled *bool `json:"cli_remote_control_enabled,omitempty"`
CloudSessionStorageEnabled *bool `json:"cloud_session_storage_enabled,omitempty"`
CodexAgentEnabled *bool `json:"codex_agent_enabled,omitempty"`
CopilotignoreEnabled *bool `json:"copilotignore_enabled,omitempty"`
CopilotPlan *string `json:"copilot_plan,omitempty"`
// Schema for the `CopilotUserResponseEndpoints` type.
Endpoints *CopilotUserResponseEndpoints `json:"endpoints,omitempty"`
IsMCPEnabled *bool `json:"is_mcp_enabled,omitempty"`
LimitedUserQuotas map[string]float64 `json:"limited_user_quotas,omitzero"`
LimitedUserResetDate *string `json:"limited_user_reset_date,omitempty"`
Login *string `json:"login,omitempty"`
MonthlyQuotas map[string]float64 `json:"monthly_quotas,omitzero"`
OrganizationList []CopilotUserResponseOrganizationListItem `json:"organization_list,omitzero"`
OrganizationLoginList []string `json:"organization_login_list,omitzero"`
QuotaResetDate *string `json:"quota_reset_date,omitempty"`
QuotaResetDateUTC *string `json:"quota_reset_date_utc,omitempty"`
// Schema for the `CopilotUserResponseQuotaSnapshots` type.
QuotaSnapshots *CopilotUserResponseQuotaSnapshots `json:"quota_snapshots,omitempty"`
RestrictedTelemetry *bool `json:"restricted_telemetry,omitempty"`
TokenBasedBilling *bool `json:"token_based_billing,omitempty"`
}
Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. Experimental: CopilotUserResponse is part of an experimental API and may change or be removed.
type CopilotUserResponseEndpoints ¶ added in v1.0.0
type CopilotUserResponseEndpoints struct {
API *string `json:"api,omitempty"`
OriginTracker *string `json:"origin-tracker,omitempty"`
Proxy *string `json:"proxy,omitempty"`
Telemetry *string `json:"telemetry,omitempty"`
}
Schema for the `CopilotUserResponseEndpoints` type. Experimental: CopilotUserResponseEndpoints is part of an experimental API and may change or be removed.
type CopilotUserResponseOrganizationListItem ¶ added in v1.0.0
type CopilotUserResponseQuotaSnapshots ¶ added in v1.0.0
type CopilotUserResponseQuotaSnapshots struct {
// Schema for the `CopilotUserResponseQuotaSnapshotsChat` type.
Chat *CopilotUserResponseQuotaSnapshotsChat `json:"chat,omitempty"`
// Schema for the `CopilotUserResponseQuotaSnapshotsCompletions` type.
Completions *CopilotUserResponseQuotaSnapshotsCompletions `json:"completions,omitempty"`
// Schema for the `CopilotUserResponseQuotaSnapshotsPremiumInteractions` type.
PremiumInteractions *CopilotUserResponseQuotaSnapshotsPremiumInteractions `json:"premium_interactions,omitempty"`
}
Schema for the `CopilotUserResponseQuotaSnapshots` type. Experimental: CopilotUserResponseQuotaSnapshots is part of an experimental API and may change or be removed.
type CopilotUserResponseQuotaSnapshotsChat ¶ added in v1.0.0
type CopilotUserResponseQuotaSnapshotsChat struct {
Entitlement *float64 `json:"entitlement,omitempty"`
HasQuota *bool `json:"has_quota,omitempty"`
OverageCount *float64 `json:"overage_count,omitempty"`
OveragePermitted *bool `json:"overage_permitted,omitempty"`
PercentRemaining *float64 `json:"percent_remaining,omitempty"`
QuotaID *string `json:"quota_id,omitempty"`
QuotaRemaining *float64 `json:"quota_remaining,omitempty"`
QuotaResetAt *float64 `json:"quota_reset_at,omitempty"`
Remaining *float64 `json:"remaining,omitempty"`
TimestampUTC *string `json:"timestamp_utc,omitempty"`
TokenBasedBilling *bool `json:"token_based_billing,omitempty"`
Unlimited *bool `json:"unlimited,omitempty"`
}
Schema for the `CopilotUserResponseQuotaSnapshotsChat` type. Experimental: CopilotUserResponseQuotaSnapshotsChat is part of an experimental API and may change or be removed.
type CopilotUserResponseQuotaSnapshotsCompletions ¶ added in v1.0.0
type CopilotUserResponseQuotaSnapshotsCompletions struct {
Entitlement *float64 `json:"entitlement,omitempty"`
HasQuota *bool `json:"has_quota,omitempty"`
OverageCount *float64 `json:"overage_count,omitempty"`
OveragePermitted *bool `json:"overage_permitted,omitempty"`
PercentRemaining *float64 `json:"percent_remaining,omitempty"`
QuotaID *string `json:"quota_id,omitempty"`
QuotaRemaining *float64 `json:"quota_remaining,omitempty"`
QuotaResetAt *float64 `json:"quota_reset_at,omitempty"`
Remaining *float64 `json:"remaining,omitempty"`
TimestampUTC *string `json:"timestamp_utc,omitempty"`
TokenBasedBilling *bool `json:"token_based_billing,omitempty"`
Unlimited *bool `json:"unlimited,omitempty"`
}
Schema for the `CopilotUserResponseQuotaSnapshotsCompletions` type. Experimental: CopilotUserResponseQuotaSnapshotsCompletions is part of an experimental API and may change or be removed.
type CopilotUserResponseQuotaSnapshotsPremiumInteractions ¶ added in v1.0.0
type CopilotUserResponseQuotaSnapshotsPremiumInteractions struct {
Entitlement *float64 `json:"entitlement,omitempty"`
HasQuota *bool `json:"has_quota,omitempty"`
OverageCount *float64 `json:"overage_count,omitempty"`
OveragePermitted *bool `json:"overage_permitted,omitempty"`
PercentRemaining *float64 `json:"percent_remaining,omitempty"`
QuotaID *string `json:"quota_id,omitempty"`
QuotaRemaining *float64 `json:"quota_remaining,omitempty"`
QuotaResetAt *float64 `json:"quota_reset_at,omitempty"`
Remaining *float64 `json:"remaining,omitempty"`
TimestampUTC *string `json:"timestamp_utc,omitempty"`
TokenBasedBilling *bool `json:"token_based_billing,omitempty"`
Unlimited *bool `json:"unlimited,omitempty"`
}
Schema for the `CopilotUserResponseQuotaSnapshotsPremiumInteractions` type. Experimental: CopilotUserResponseQuotaSnapshotsPremiumInteractions is part of an experimental API and may change or be removed.
type CurrentModel ¶ added in v0.3.0
type CurrentModel struct {
// Context tier for models that support multiple context-window sizes.
ContextTier *ContextTier `json:"contextTier,omitempty"`
// Currently active model identifier
ModelID *string `json:"modelId,omitempty"`
// 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.
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
}
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: CurrentModel is part of an experimental API and may change or be removed.
type CurrentToolMetadata ¶ added in v1.0.0
type CurrentToolMetadata struct {
// Whether the tool is loaded on demand via tool search
DeferLoading *bool `json:"deferLoading,omitempty"`
// Tool description
Description string `json:"description"`
// JSON Schema for tool input
InputSchema map[string]any `json:"input_schema,omitzero"`
// MCP server name for MCP-backed tools
MCPServerName *string `json:"mcpServerName,omitempty"`
// Raw MCP tool name for MCP-backed tools
MCPToolName *string `json:"mcpToolName,omitempty"`
// Model-facing tool name
Name string `json:"name"`
// Optional MCP/config namespaced tool name
NamespacedName *string `json:"namespacedName,omitempty"`
}
Lightweight metadata for a currently initialized session tool Experimental: CurrentToolMetadata is part of an experimental API and may change or be removed.
type CustomAgentsUpdatedAgent ¶ added in v1.0.0
type CustomAgentsUpdatedAgent struct {
// Description of what the agent does
Description string `json:"description"`
// Human-readable display name
DisplayName string `json:"displayName"`
// Unique identifier for the agent
ID string `json:"id"`
// Model override for this agent, if set
Model *string `json:"model,omitempty"`
// Internal name of the agent
Name string `json:"name"`
// Source location: user, project, inherited, remote, or plugin
Source string `json:"source"`
// List of tool names available to this agent, or null when all tools are available
Tools []string `json:"tools"`
// Whether the agent can be selected by the user
UserInvocable bool `json:"userInvocable"`
}
Schema for the `CustomAgentsUpdatedAgent` type.
type CustomNotificationPayload ¶ added in v1.0.0
type CustomNotificationPayload struct {
AnyArray []any
AnyMap map[string]any
Bool *bool
Double *float64
String *string
}
Source-defined JSON payload for the custom notification
func (CustomNotificationPayload) MarshalJSON ¶ added in v1.0.0
func (r CustomNotificationPayload) MarshalJSON() ([]byte, error)
func (*CustomNotificationPayload) UnmarshalJSON ¶ added in v1.0.0
func (r *CustomNotificationPayload) UnmarshalJSON(data []byte) error
type DiscoveredCanvas ¶ added in v1.0.0
type DiscoveredCanvas struct {
// Actions the agent or host may invoke on an open instance
Actions []CanvasAction `json:"actions,omitzero"`
// Provider-local canvas identifier
CanvasID string `json:"canvasId"`
// Short, single-sentence description shown to the agent in canvas catalogs.
Description string `json:"description"`
// Human-readable canvas name
DisplayName string `json:"displayName"`
// Owning provider identifier
ExtensionID string `json:"extensionId"`
// Owning extension display name, when available
ExtensionName *string `json:"extensionName,omitempty"`
// JSON Schema for canvas open input
InputSchema any `json:"inputSchema,omitempty"`
}
Canvas available in the current session. Experimental: DiscoveredCanvas is part of an experimental API and may change or be removed.
type DiscoveredMCPServer ¶ added in v0.3.0
type DiscoveredMCPServer struct {
// Whether the server is enabled (not in the disabled list)
Enabled bool `json:"enabled"`
// Server name (config key)
Name string `json:"name"`
// Configuration source: user, workspace, plugin, or builtin
Source MCPServerSource `json:"source"`
// Server transport type: stdio, http, sse (deprecated), or memory
Type *DiscoveredMCPServerType `json:"type,omitempty"`
}
Schema for the `DiscoveredMcpServer` type.
type DiscoveredMCPServerType ¶ added in v0.3.0
type DiscoveredMCPServerType string
Server transport type: stdio, http, sse (deprecated), or memory
const ( // Server communicates over streamable HTTP. DiscoveredMCPServerTypeHTTP DiscoveredMCPServerType = "http" // Server is backed by an in-memory runtime implementation. DiscoveredMCPServerTypeMemory DiscoveredMCPServerType = "memory" // Server communicates over Server-Sent Events (deprecated). DiscoveredMCPServerTypeSSE DiscoveredMCPServerType = "sse" // Server communicates over stdio with a local child process. DiscoveredMCPServerTypeStdio DiscoveredMCPServerType = "stdio" )
type ElicitationCompletedAction ¶ added in v1.0.0
type ElicitationCompletedAction string
The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed)
const ( // The user submitted the requested form. ElicitationCompletedActionAccept ElicitationCompletedAction = "accept" // The user dismissed the request. ElicitationCompletedActionCancel ElicitationCompletedAction = "cancel" // The user explicitly declined the request. ElicitationCompletedActionDecline ElicitationCompletedAction = "decline" )
type ElicitationCompletedBooleanContent ¶ added in v1.0.0
type ElicitationCompletedBooleanContent bool
type ElicitationCompletedContent ¶ added in v1.0.0
type ElicitationCompletedContent interface {
// contains filtered or unexported methods
}
Schema for the `ElicitationCompletedContent` type.
type ElicitationCompletedData ¶ added in v1.0.0
type ElicitationCompletedData struct {
// The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed)
Action *ElicitationCompletedAction `json:"action,omitempty"`
// The submitted form data when action is 'accept'; keys match the requested schema fields
Content map[string]ElicitationCompletedContent `json:"content,omitzero"`
// Request ID of the resolved elicitation request; clients should dismiss any UI for this request
RequestID string `json:"requestId"`
}
Elicitation request completion with the user's response
func (*ElicitationCompletedData) Type ¶ added in v1.0.0
func (*ElicitationCompletedData) Type() SessionEventType
func (*ElicitationCompletedData) UnmarshalJSON ¶ added in v1.0.0
func (r *ElicitationCompletedData) UnmarshalJSON(data []byte) error
type ElicitationCompletedNumberContent ¶ added in v1.0.0
type ElicitationCompletedNumberContent float64
type ElicitationCompletedStringArrayContent ¶ added in v1.0.0
type ElicitationCompletedStringArrayContent []string
type ElicitationCompletedStringContent ¶ added in v1.0.0
type ElicitationCompletedStringContent string
type ElicitationRequestedData ¶ added in v1.0.0
type ElicitationRequestedData struct {
// The source that initiated the request (MCP server name, or absent for agent-initiated)
ElicitationSource *string `json:"elicitationSource,omitempty"`
// Message describing what information is needed from the user
Message string `json:"message"`
// Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent.
Mode *ElicitationRequestedMode `json:"mode,omitempty"`
// JSON Schema describing the form fields to present to the user (form mode only)
RequestedSchema *ElicitationRequestedSchema `json:"requestedSchema,omitempty"`
// Unique identifier for this elicitation request; used to respond via session.respondToElicitation()
RequestID string `json:"requestId"`
// Tool call ID from the LLM completion; used to correlate with CompletionChunk.toolCall.id for remote UIs
ToolCallID *string `json:"toolCallId,omitempty"`
// URL to open in the user's browser (url mode only)
URL *string `json:"url,omitempty"`
}
Elicitation request; may be form-based (structured input) or URL-based (browser redirect)
func (*ElicitationRequestedData) Type ¶ added in v1.0.0
func (*ElicitationRequestedData) Type() SessionEventType
type ElicitationRequestedMode ¶ added in v1.0.0
type ElicitationRequestedMode string
Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent.
const ( // Structured form-based elicitation. ElicitationRequestedModeForm ElicitationRequestedMode = "form" // Browser URL-based elicitation. ElicitationRequestedModeURL ElicitationRequestedMode = "url" )
type ElicitationRequestedSchema ¶ added in v1.0.0
type ElicitationRequestedSchema struct {
// Form field definitions, keyed by field name
Properties map[string]any `json:"properties"`
// List of required field names
Required []string `json:"required,omitzero"`
// Schema type indicator (always 'object')
Type ElicitationRequestedSchemaType `json:"type"`
}
JSON Schema describing the form fields to present to the user (form mode only)
type ElicitationRequestedSchemaType ¶ added in v1.0.0
type ElicitationRequestedSchemaType string
Schema type indicator (always 'object')
const (
ElicitationRequestedSchemaTypeObject ElicitationRequestedSchemaType = "object"
)
type EmbeddedBlobResourceContents ¶ added in v1.0.0
type EmbeddedBlobResourceContents struct {
// Base64-encoded binary content of the resource
Blob string `json:"blob"`
// MIME type of the blob content
MIMEType *string `json:"mimeType,omitempty"`
// URI identifying the resource
URI string `json:"uri"`
}
Schema for the `EmbeddedBlobResourceContents` type. Experimental: EmbeddedBlobResourceContents is part of an experimental API and may change or be removed.
type EmbeddedTextResourceContents ¶ added in v1.0.0
type EmbeddedTextResourceContents struct {
// MIME type of the text content
MIMEType *string `json:"mimeType,omitempty"`
// Text content of the resource
Text string `json:"text"`
// URI identifying the resource
URI string `json:"uri"`
}
Schema for the `EmbeddedTextResourceContents` type. Experimental: EmbeddedTextResourceContents is part of an experimental API and may change or be removed.
type EnqueueCommandParams ¶ added in v1.0.0
type EnqueueCommandParams struct {
// 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.
Command string `json:"command"`
}
Slash-prefixed command string to enqueue for FIFO processing. Experimental: EnqueueCommandParams is part of an experimental API and may change or be removed.
type EnqueueCommandResult ¶ added in v1.0.0
type EnqueueCommandResult struct {
// 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).
Queued bool `json:"queued"`
}
Indicates whether the command was accepted into the local execution queue. Experimental: EnqueueCommandResult is part of an experimental API and may change or be removed.
type EnvAuthInfo ¶ added in v1.0.0
type EnvAuthInfo struct {
// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the
// GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this
// verbatim and does not re-fetch when set.
CopilotUser *CopilotUserResponse `json:"copilotUser,omitempty"`
// Name of the environment variable the token was sourced from.
EnvVar string `json:"envVar"`
// Authentication host (e.g. https://github.com or a GHES host).
Host string `json:"host"`
// User login associated with the token. Undefined for server-to-server tokens (those
// starting with `ghs_`).
Login *string `json:"login,omitempty"`
// The token value itself. Treat as a secret.
Token string `json:"token"`
}
Schema for the `EnvAuthInfo` type. Experimental: EnvAuthInfo is part of an experimental API and may change or be removed.
func (EnvAuthInfo) MarshalJSON ¶ added in v1.0.0
func (r EnvAuthInfo) MarshalJSON() ([]byte, error)
func (EnvAuthInfo) Type ¶ added in v1.0.0
func (EnvAuthInfo) Type() AuthInfoType
type EventLogAPI ¶ added in v1.0.0
type EventLogAPI sessionAPI
Experimental: EventLogAPI contains experimental APIs that may change or be removed.
func (*EventLogAPI) Read ¶ added in v1.0.0
func (a *EventLogAPI) Read(ctx context.Context, params *EventLogReadRequest) (*EventsReadResult, error)
Reads a batch of session events from a cursor, optionally waiting for new events.
RPC method: session.eventLog.read.
Parameters: Cursor, batch size, and optional long-poll/filter parameters for reading session events.
Returns: Batch of session events returned by a read, with cursor and continuation metadata.
func (*EventLogAPI) RegisterInterest ¶ added in v1.0.0
func (a *EventLogAPI) RegisterInterest(ctx context.Context, params *RegisterEventInterestParams) (*RegisterEventInterestResult, error)
RegisterInterest registers consumer interest in an event type for runtime gating purposes.
RPC method: session.eventLog.registerInterest.
Parameters: Event type to register consumer interest for, used by runtime gating logic.
Returns: Opaque handle representing an event-type interest registration.
func (*EventLogAPI) ReleaseInterest ¶ added in v1.0.0
func (a *EventLogAPI) ReleaseInterest(ctx context.Context, params *ReleaseEventInterestParams) (*EventLogReleaseInterestResult, error)
ReleaseInterest releases a consumer's previously-registered interest in an event type.
RPC method: session.eventLog.releaseInterest.
Parameters: Opaque handle previously returned by `registerInterest` to release.
Returns: Indicates whether the operation succeeded.
func (*EventLogAPI) Tail ¶ added in v1.0.0
func (a *EventLogAPI) Tail(ctx context.Context) (*EventLogTailResult, error)
Tail returns a snapshot of the current tail cursor without consuming events.
RPC method: session.eventLog.tail.
Returns: Snapshot of the current tail cursor without returning any events. Use this when a consumer wants to subscribe to live events going forward without first paginating through the entire persisted history (which would happen if `read` were called without a cursor on a long-lived session).
type EventLogReadRequest ¶ added in v1.0.0
type EventLogReadRequest struct {
// Agent-scope filter: 'primary' returns only main-agent events plus events whose type
// starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns
// events from all agents (matching wildcard-subscription behavior). Default is 'all' to
// preserve wildcard semantics for catch-up callers.
AgentScope *EventsAgentScope `json:"agentScope,omitempty"`
// Opaque cursor returned by a previous read. Omit on the first call to start from the
// beginning of the session's persisted history.
Cursor *string `json:"cursor,omitempty"`
// Maximum number of events to return in this batch (1–1000, default 200).
Max *int64 `json:"max,omitempty"`
// Either '*' to receive all event types, or a non-empty list of event types to receive
Types *EventLogTypes `json:"types,omitempty"`
// Milliseconds to wait for new events when the cursor is at the tail of history. 0
// (default) returns immediately even if no events are available. Capped at 30000ms.
// Ephemeral events that arrive during the wait are delivered in this batch but are NOT
// replayable on a subsequent read (use a non-zero waitMs in your next call to capture
// future ephemerals as they happen).
WaitMs *int32 `json:"waitMs,omitempty"`
}
Cursor, batch size, and optional long-poll/filter parameters for reading session events. Experimental: EventLogReadRequest is part of an experimental API and may change or be removed.
type EventLogReleaseInterestResult ¶ added in v1.0.0
type EventLogReleaseInterestResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: EventLogReleaseInterestResult is part of an experimental API and may change or be removed.
type EventLogTailResult ¶ added in v1.0.0
type EventLogTailResult struct {
// Opaque cursor pointing at the current tail of the session's persisted-events history.
// Pass back to `read` to receive only events that arrive AFTER this snapshot. When the
// session has no events, this returns the same sentinel as an unset cursor (i.e. equivalent
// to omitting the cursor on a first read).
Cursor string `json:"cursor"`
}
Snapshot of the current tail cursor without returning any events. Use this when a consumer wants to subscribe to live events going forward without first paginating through the entire persisted history (which would happen if `read` were called without a cursor on a long-lived session). Experimental: EventLogTailResult is part of an experimental API and may change or be removed.
type EventLogTypes ¶ added in v1.0.0
type EventLogTypes struct {
String *EventLogTypesString
StringArray []string
}
Either '*' to receive all event types, or a non-empty list of event types to receive Experimental: EventLogTypes is part of an experimental API and may change or be removed.
func (EventLogTypes) MarshalJSON ¶ added in v1.0.0
func (r EventLogTypes) MarshalJSON() ([]byte, error)
func (*EventLogTypes) UnmarshalJSON ¶ added in v1.0.0
func (r *EventLogTypes) UnmarshalJSON(data []byte) error
type EventLogTypesString ¶ added in v1.0.0
type EventLogTypesString string
const (
EventLogTypesStringValue EventLogTypesString = "*"
)
type EventsAgentScope ¶ added in v1.0.0
type EventsAgentScope string
Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers. Experimental: EventsAgentScope is part of an experimental API and may change or be removed.
const ( // Return events from all agents. EventsAgentScopeAll EventsAgentScope = "all" // Return main-agent events and typed subagent lifecycle events. EventsAgentScopePrimary EventsAgentScope = "primary" )
type EventsCursorStatus ¶ added in v1.0.0
type EventsCursorStatus string
Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. Experimental: EventsCursorStatus is part of an experimental API and may change or be removed.
const ( // The cursor referred to history that is no longer available. EventsCursorStatusExpired EventsCursorStatus = "expired" // The cursor was applied successfully. EventsCursorStatusOk EventsCursorStatus = "ok" )
type EventsReadResult ¶ added in v1.0.0
type EventsReadResult struct {
// Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue
// from where this read left off. Always present, even when no events were returned.
Cursor string `json:"cursor"`
// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor
// referred to an event that no longer exists in history (e.g. truncated or compacted away)
// and the read started from the beginning of the remaining history.
CursorStatus EventsCursorStatus `json:"cursorStatus"`
// Events are delivered in two batches per read: persisted events first (in append order),
// then ephemeral events (in seq order). When `waitMs > 0` and the catch-up batches were
// empty, post-wait events follow the same two-batch ordering. Persisted and ephemeral
// events do not interleave within a single read.
Events []SessionEvent `json:"events"`
// True when the read returned `max` events and more events are available immediately. When
// false, the next read with a non-zero `waitMs` will block until a new event arrives or the
// wait expires.
HasMore bool `json:"hasMore"`
}
Batch of session events returned by a read, with cursor and continuation metadata. Experimental: EventsReadResult is part of an experimental API and may change or be removed.
type ExecuteCommandParams ¶ added in v1.0.0
type ExecuteCommandParams struct {
// Argument string to pass to the command (empty string if none).
Args string `json:"args"`
// Name of the slash command to invoke (without the leading '/').
CommandName string `json:"commandName"`
}
Slash command name and argument string to execute synchronously. Experimental: ExecuteCommandParams is part of an experimental API and may change or be removed.
type ExecuteCommandResult ¶ added in v1.0.0
type ExecuteCommandResult struct {
// Error message produced while executing the command, if any. Omitted when the handler
// succeeded.
Error *string `json:"error,omitempty"`
}
Error message produced while executing the command, if any. Experimental: ExecuteCommandResult is part of an experimental API and may change or be removed.
type ExitPlanModeAction ¶ added in v1.0.0
type ExitPlanModeAction string
Exit plan mode action
const ( // Exit plan mode and continue autonomously. ExitPlanModeActionAutopilot ExitPlanModeAction = "autopilot" // Exit plan mode and continue with parallel autonomous workers. ExitPlanModeActionAutopilotFleet ExitPlanModeAction = "autopilot_fleet" // Exit plan mode without starting implementation. ExitPlanModeActionExitOnly ExitPlanModeAction = "exit_only" // Exit plan mode and continue in interactive mode. ExitPlanModeActionInteractive ExitPlanModeAction = "interactive" )
type ExitPlanModeCompletedData ¶ added in v1.0.0
type ExitPlanModeCompletedData struct {
// Whether the plan was approved by the user
Approved *bool `json:"approved,omitempty"`
// Whether edits should be auto-approved without confirmation
AutoApproveEdits *bool `json:"autoApproveEdits,omitempty"`
// Free-form feedback from the user if they requested changes to the plan
Feedback *string `json:"feedback,omitempty"`
// Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request
RequestID string `json:"requestId"`
// Action selected by the user
SelectedAction *ExitPlanModeAction `json:"selectedAction,omitempty"`
}
Plan mode exit completion with the user's approval decision and optional feedback
func (*ExitPlanModeCompletedData) Type ¶ added in v1.0.0
func (*ExitPlanModeCompletedData) Type() SessionEventType
type ExitPlanModeRequestedData ¶ added in v1.0.0
type ExitPlanModeRequestedData struct {
// Available actions the user can take
Actions []ExitPlanModeAction `json:"actions"`
// Full content of the plan file
PlanContent string `json:"planContent"`
// Recommended action to preselect for the user
RecommendedAction ExitPlanModeAction `json:"recommendedAction"`
// Unique identifier for this request; used to respond via session.respondToExitPlanMode()
RequestID string `json:"requestId"`
// Summary of the plan that was created
Summary string `json:"summary"`
}
Plan approval request with plan content and available user actions
func (*ExitPlanModeRequestedData) Type ¶ added in v1.0.0
func (*ExitPlanModeRequestedData) Type() SessionEventType
type Extension ¶ added in v0.2.0
type Extension struct {
// Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper')
ID string `json:"id"`
// Extension name (directory name)
Name string `json:"name"`
// Process ID if the extension is running
Pid *int64 `json:"pid,omitempty"`
// Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/)
Source ExtensionSource `json:"source"`
// Current status: running, disabled, failed, or starting
Status ExtensionStatus `json:"status"`
}
Schema for the `Extension` type. Experimental: Extension is part of an experimental API and may change or be removed.
type ExtensionContextPushInput ¶ added in v1.0.0
type ExtensionContextPushInput struct {
// Caller-supplied JSON payload (required, may be null but not undefined)
Payload any `json:"payload"`
// Human-readable composer pill label
Title string `json:"title"`
}
Slim input shape for extension_context attachments; identity fields are runtime-derived. Experimental: ExtensionContextPushInput is part of an experimental API and may change or be removed.
func (ExtensionContextPushInput) MarshalJSON ¶ added in v1.0.0
func (r ExtensionContextPushInput) MarshalJSON() ([]byte, error)
func (ExtensionContextPushInput) Type ¶ added in v1.0.0
func (ExtensionContextPushInput) Type() PushAttachmentType
type ExtensionList ¶ added in v0.3.0
type ExtensionList struct {
// Discovered extensions and their current status
Extensions []Extension `json:"extensions"`
}
Extensions discovered for the session, with their current status. Experimental: ExtensionList is part of an experimental API and may change or be removed.
type ExtensionSource ¶ added in v0.3.0
type ExtensionSource string
Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/) Experimental: ExtensionSource is part of an experimental API and may change or be removed.
const ( // Extension discovered from the current project's .github/extensions directory. ExtensionSourceProject ExtensionSource = "project" // Extension discovered from the user's ~/.copilot/extensions directory. ExtensionSourceUser ExtensionSource = "user" )
type ExtensionStatus ¶ added in v0.2.0
type ExtensionStatus string
Current status: running, disabled, failed, or starting Experimental: ExtensionStatus is part of an experimental API and may change or be removed.
const ( // The extension is installed but disabled. ExtensionStatusDisabled ExtensionStatus = "disabled" // The extension failed to start or crashed. ExtensionStatusFailed ExtensionStatus = "failed" // The extension process is running. ExtensionStatusRunning ExtensionStatus = "running" // The extension process is starting. ExtensionStatusStarting ExtensionStatus = "starting" )
type ExtensionsAPI ¶ added in v1.0.0
type ExtensionsAPI sessionAPI
Experimental: ExtensionsAPI contains experimental APIs that may change or be removed.
func (*ExtensionsAPI) Disable ¶ added in v1.0.0
func (a *ExtensionsAPI) Disable(ctx context.Context, params *ExtensionsDisableRequest) (*SessionExtensionsDisableResult, error)
Disables an extension for the session.
RPC method: session.extensions.disable.
Parameters: Source-qualified extension identifier to disable for the session.
func (*ExtensionsAPI) Enable ¶ added in v1.0.0
func (a *ExtensionsAPI) Enable(ctx context.Context, params *ExtensionsEnableRequest) (*SessionExtensionsEnableResult, error)
Enables an extension for the session.
RPC method: session.extensions.enable.
Parameters: Source-qualified extension identifier to enable for the session.
func (*ExtensionsAPI) List ¶ added in v1.0.0
func (a *ExtensionsAPI) List(ctx context.Context) (*ExtensionList, error)
Lists extensions discovered for the session and their current status.
RPC method: session.extensions.list.
Returns: Extensions discovered for the session, with their current status.
func (*ExtensionsAPI) Reload ¶ added in v1.0.0
func (a *ExtensionsAPI) Reload(ctx context.Context) (*SessionExtensionsReloadResult, error)
Reloads extension definitions and processes for the session.
RPC method: session.extensions.reload.
func (*ExtensionsAPI) SendAttachmentsToMessage ¶ added in v1.0.0
func (a *ExtensionsAPI) SendAttachmentsToMessage(ctx context.Context, params *SendAttachmentsToMessageParams) (*SessionExtensionsSendAttachmentsToMessageResult, error)
SendAttachmentsToMessage push attachments into the next user-message turn from an extension. The host should surface them as composer pills and forward them via the next session.send call. Callable only by extension-owned connections.
RPC method: session.extensions.sendAttachmentsToMessage.
Parameters: Parameters for session.extensions.sendAttachmentsToMessage.
type ExtensionsDisableRequest ¶ added in v0.3.0
type ExtensionsDisableRequest struct {
// Source-qualified extension ID to disable
ID string `json:"id"`
}
Source-qualified extension identifier to disable for the session. Experimental: ExtensionsDisableRequest is part of an experimental API and may change or be removed.
type ExtensionsEnableRequest ¶ added in v0.3.0
type ExtensionsEnableRequest struct {
// Source-qualified extension ID to enable
ID string `json:"id"`
}
Source-qualified extension identifier to enable for the session. Experimental: ExtensionsEnableRequest is part of an experimental API and may change or be removed.
type ExtensionsLoadedExtension ¶ added in v1.0.0
type ExtensionsLoadedExtension struct {
// Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper')
ID string `json:"id"`
// Extension name (directory name)
Name string `json:"name"`
// Discovery source
Source ExtensionsLoadedExtensionSource `json:"source"`
// Current status: running, disabled, failed, or starting
Status ExtensionsLoadedExtensionStatus `json:"status"`
}
Schema for the `ExtensionsLoadedExtension` type.
type ExtensionsLoadedExtensionSource ¶ added in v1.0.0
type ExtensionsLoadedExtensionSource string
Discovery source
const ( // Extension discovered from the current project. ExtensionsLoadedExtensionSourceProject ExtensionsLoadedExtensionSource = "project" // Extension discovered from the user's extension directory. ExtensionsLoadedExtensionSourceUser ExtensionsLoadedExtensionSource = "user" )
type ExtensionsLoadedExtensionStatus ¶ added in v1.0.0
type ExtensionsLoadedExtensionStatus string
Current status: running, disabled, failed, or starting
const ( // The extension is installed but disabled. ExtensionsLoadedExtensionStatusDisabled ExtensionsLoadedExtensionStatus = "disabled" // The extension failed to start or crashed. ExtensionsLoadedExtensionStatusFailed ExtensionsLoadedExtensionStatus = "failed" // The extension process is running. ExtensionsLoadedExtensionStatusRunning ExtensionsLoadedExtensionStatus = "running" // The extension process is starting. ExtensionsLoadedExtensionStatusStarting ExtensionsLoadedExtensionStatus = "starting" )
type ExternalToolCompletedData ¶ added in v1.0.0
type ExternalToolCompletedData struct {
// Request ID of the resolved external tool request; clients should dismiss any UI for this request
RequestID string `json:"requestId"`
}
External tool completion notification signaling UI dismissal
func (*ExternalToolCompletedData) Type ¶ added in v1.0.0
func (*ExternalToolCompletedData) Type() SessionEventType
type ExternalToolRequestedData ¶ added in v1.0.0
type ExternalToolRequestedData struct {
// Arguments to pass to the external tool
Arguments any `json:"arguments,omitempty"`
// Unique identifier for this request; used to respond via session.respondToExternalTool()
RequestID string `json:"requestId"`
// Session ID that this external tool request belongs to
SessionID string `json:"sessionId"`
// Tool call ID assigned to this external tool invocation
ToolCallID string `json:"toolCallId"`
// Name of the external tool to invoke
ToolName string `json:"toolName"`
// W3C Trace Context traceparent header for the execute_tool span
Traceparent *string `json:"traceparent,omitempty"`
// W3C Trace Context tracestate header for the execute_tool span
Tracestate *string `json:"tracestate,omitempty"`
// Active session working directory, when known.
WorkingDirectory *string `json:"workingDirectory,omitempty"`
}
External tool invocation request for client-side tool execution
func (*ExternalToolRequestedData) Type ¶ added in v1.0.0
func (*ExternalToolRequestedData) Type() SessionEventType
type ExternalToolResult ¶ added in v1.0.0
type ExternalToolResult interface {
// contains filtered or unexported methods
}
Tool call result (string or expanded result object) Experimental: ExternalToolResult is part of an experimental API and may change or be removed.
type ExternalToolStringResult ¶ added in v1.0.0
type ExternalToolStringResult string
type ExternalToolTextResultForLlm ¶ added in v1.0.0
type ExternalToolTextResultForLlm struct {
// Base64-encoded binary results returned to the model
BinaryResultsForLlm []ExternalToolTextResultForLlmBinaryResultsForLlm `json:"binaryResultsForLlm,omitzero"`
// Structured content blocks from the tool
Contents []ExternalToolTextResultForLlmContent `json:"contents,omitzero"`
// Optional error message for failed executions
Error *string `json:"error,omitempty"`
// Execution outcome classification. Optional for back-compat; normalized to 'success' (or
// 'failure' when error is present) when missing or unrecognized.
ResultType *string `json:"resultType,omitempty"`
// Detailed log content for timeline display
SessionLog *string `json:"sessionLog,omitempty"`
// Text result returned to the model
TextResultForLlm string `json:"textResultForLlm"`
// Optional tool-specific telemetry
ToolTelemetry map[string]any `json:"toolTelemetry,omitzero"`
}
Expanded external tool result payload Experimental: ExternalToolTextResultForLlm is part of an experimental API and may change or be removed.
func (*ExternalToolTextResultForLlm) UnmarshalJSON ¶ added in v1.0.0
func (r *ExternalToolTextResultForLlm) UnmarshalJSON(data []byte) error
type ExternalToolTextResultForLlmBinaryResultsForLlm ¶ added in v1.0.0
type ExternalToolTextResultForLlmBinaryResultsForLlm struct {
// Base64-encoded binary data
Data string `json:"data"`
// Human-readable description of the binary data
Description *string `json:"description,omitempty"`
// Optional metadata from the producing tool.
Metadata map[string]any `json:"metadata,omitzero"`
// MIME type of the binary data
MIMEType string `json:"mimeType"`
// Binary result type discriminator. Use "image" for images and "resource" for other binary
// data.
Type ExternalToolTextResultForLlmBinaryResultsForLlmType `json:"type"`
}
Binary result returned by a tool for the model Experimental: ExternalToolTextResultForLlmBinaryResultsForLlm is part of an experimental API and may change or be removed.
type ExternalToolTextResultForLlmBinaryResultsForLlmType ¶ added in v1.0.0
type ExternalToolTextResultForLlmBinaryResultsForLlmType string
Binary result type discriminator. Use "image" for images and "resource" for other binary data. Experimental: ExternalToolTextResultForLlmBinaryResultsForLlmType is part of an experimental API and may change or be removed.
const ( // Binary image data. ExternalToolTextResultForLlmBinaryResultsForLlmTypeImage ExternalToolTextResultForLlmBinaryResultsForLlmType = "image" // Other binary resource data. ExternalToolTextResultForLlmBinaryResultsForLlmTypeResource ExternalToolTextResultForLlmBinaryResultsForLlmType = "resource" )
type ExternalToolTextResultForLlmContent ¶ added in v1.0.0
type ExternalToolTextResultForLlmContent interface {
Type() ExternalToolTextResultForLlmContentType
// contains filtered or unexported methods
}
A content block within a tool result, which may be text, terminal output, image, audio, or a resource Experimental: ExternalToolTextResultForLlmContent is part of an experimental API and may change or be removed.
type ExternalToolTextResultForLlmContentAudio ¶ added in v1.0.0
type ExternalToolTextResultForLlmContentAudio struct {
// Base64-encoded audio data
Data string `json:"data"`
// MIME type of the audio (e.g., audio/wav, audio/mpeg)
MIMEType string `json:"mimeType"`
}
Audio content block with base64-encoded data Experimental: ExternalToolTextResultForLlmContentAudio is part of an experimental API and may change or be removed.
func (ExternalToolTextResultForLlmContentAudio) MarshalJSON ¶ added in v1.0.0
func (r ExternalToolTextResultForLlmContentAudio) MarshalJSON() ([]byte, error)
type ExternalToolTextResultForLlmContentImage ¶ added in v1.0.0
type ExternalToolTextResultForLlmContentImage struct {
// Base64-encoded image data
Data string `json:"data"`
// MIME type of the image (e.g., image/png, image/jpeg)
MIMEType string `json:"mimeType"`
}
Image content block with base64-encoded data Experimental: ExternalToolTextResultForLlmContentImage is part of an experimental API and may change or be removed.
func (ExternalToolTextResultForLlmContentImage) MarshalJSON ¶ added in v1.0.0
func (r ExternalToolTextResultForLlmContentImage) MarshalJSON() ([]byte, error)
type ExternalToolTextResultForLlmContentResource ¶ added in v1.0.0
type ExternalToolTextResultForLlmContentResource struct {
// The embedded resource contents, either text or base64-encoded binary
Resource ExternalToolTextResultForLlmContentResourceDetails `json:"resource"`
}
Embedded resource content block with inline text or binary data Experimental: ExternalToolTextResultForLlmContentResource is part of an experimental API and may change or be removed.
func (ExternalToolTextResultForLlmContentResource) MarshalJSON ¶ added in v1.0.0
func (r ExternalToolTextResultForLlmContentResource) MarshalJSON() ([]byte, error)
func (*ExternalToolTextResultForLlmContentResource) UnmarshalJSON ¶ added in v1.0.0
func (r *ExternalToolTextResultForLlmContentResource) UnmarshalJSON(data []byte) error
type ExternalToolTextResultForLlmContentResourceDetails ¶ added in v1.0.0
type ExternalToolTextResultForLlmContentResourceDetails interface {
// contains filtered or unexported methods
}
The embedded resource contents, either text or base64-encoded binary Experimental: ExternalToolTextResultForLlmContentResourceDetails is part of an experimental API and may change or be removed.
type ExternalToolTextResultForLlmContentResourceLink ¶ added in v1.0.0
type ExternalToolTextResultForLlmContentResourceLink struct {
// Human-readable description of the resource
Description *string `json:"description,omitempty"`
// Icons associated with this resource
Icons []ExternalToolTextResultForLlmContentResourceLinkIcon `json:"icons,omitzero"`
// MIME type of the resource content
MIMEType *string `json:"mimeType,omitempty"`
// Resource name identifier
Name string `json:"name"`
// Size of the resource in bytes
Size *int64 `json:"size,omitempty"`
// Human-readable display title for the resource
Title *string `json:"title,omitempty"`
// URI identifying the resource
URI string `json:"uri"`
}
Resource link content block referencing an external resource Experimental: ExternalToolTextResultForLlmContentResourceLink is part of an experimental API and may change or be removed.
func (ExternalToolTextResultForLlmContentResourceLink) MarshalJSON ¶ added in v1.0.0
func (r ExternalToolTextResultForLlmContentResourceLink) MarshalJSON() ([]byte, error)
type ExternalToolTextResultForLlmContentResourceLinkIcon ¶ added in v1.0.0
type ExternalToolTextResultForLlmContentResourceLinkIcon struct {
// MIME type of the icon image
MIMEType *string `json:"mimeType,omitempty"`
// Available icon sizes (e.g., ['16x16', '32x32'])
Sizes []string `json:"sizes,omitzero"`
// URL or path to the icon image
Src string `json:"src"`
// Theme variant this icon is intended for
Theme *ExternalToolTextResultForLlmContentResourceLinkIconTheme `json:"theme,omitempty"`
}
Icon image for a resource Experimental: ExternalToolTextResultForLlmContentResourceLinkIcon is part of an experimental API and may change or be removed.
type ExternalToolTextResultForLlmContentResourceLinkIconTheme ¶ added in v1.0.0
type ExternalToolTextResultForLlmContentResourceLinkIconTheme string
Theme variant this icon is intended for Experimental: ExternalToolTextResultForLlmContentResourceLinkIconTheme is part of an experimental API and may change or be removed.
const ( // Icon intended for dark themes. ExternalToolTextResultForLlmContentResourceLinkIconThemeDark ExternalToolTextResultForLlmContentResourceLinkIconTheme = "dark" // Icon intended for light themes. ExternalToolTextResultForLlmContentResourceLinkIconThemeLight ExternalToolTextResultForLlmContentResourceLinkIconTheme = "light" )
type ExternalToolTextResultForLlmContentTerminal ¶ added in v1.0.0
type ExternalToolTextResultForLlmContentTerminal struct {
// Working directory where the command was executed
Cwd *string `json:"cwd,omitempty"`
// Process exit code, if the command has completed
ExitCode *int64 `json:"exitCode,omitempty"`
// Terminal/shell output text
Text string `json:"text"`
}
Terminal/shell output content block with optional exit code and working directory Experimental: ExternalToolTextResultForLlmContentTerminal is part of an experimental API and may change or be removed.
func (ExternalToolTextResultForLlmContentTerminal) MarshalJSON ¶ added in v1.0.0
func (r ExternalToolTextResultForLlmContentTerminal) MarshalJSON() ([]byte, error)
type ExternalToolTextResultForLlmContentText ¶ added in v1.0.0
type ExternalToolTextResultForLlmContentText struct {
// The text content
Text string `json:"text"`
}
Plain text content block Experimental: ExternalToolTextResultForLlmContentText is part of an experimental API and may change or be removed.
func (ExternalToolTextResultForLlmContentText) MarshalJSON ¶ added in v1.0.0
func (r ExternalToolTextResultForLlmContentText) MarshalJSON() ([]byte, error)
type ExternalToolTextResultForLlmContentType ¶ added in v1.0.0
type ExternalToolTextResultForLlmContentType string
Type discriminator for ExternalToolTextResultForLlmContent.
const ( ExternalToolTextResultForLlmContentTypeAudio ExternalToolTextResultForLlmContentType = "audio" ExternalToolTextResultForLlmContentTypeImage ExternalToolTextResultForLlmContentType = "image" ExternalToolTextResultForLlmContentTypeResource ExternalToolTextResultForLlmContentType = "resource" ExternalToolTextResultForLlmContentTypeResourceLink ExternalToolTextResultForLlmContentType = "resource_link" ExternalToolTextResultForLlmContentTypeTerminal ExternalToolTextResultForLlmContentType = "terminal" ExternalToolTextResultForLlmContentTypeText ExternalToolTextResultForLlmContentType = "text" )
type FilterMapping ¶ added in v0.3.0
type FilterMapping interface {
// contains filtered or unexported methods
}
Content filtering mode to apply to all tools, or a map of tool name to content filtering mode.
type FilterMappingEnumMap ¶ added in v1.0.0
type FilterMappingEnumMap map[string]ContentFilterMode
type FleetAPI ¶ added in v1.0.0
type FleetAPI sessionAPI
Experimental: FleetAPI contains experimental APIs that may change or be removed.
func (*FleetAPI) Start ¶ added in v1.0.0
func (a *FleetAPI) Start(ctx context.Context, params *FleetStartRequest) (*FleetStartResult, error)
Starts fleet mode by submitting the fleet orchestration prompt to the session.
RPC method: session.fleet.start.
Parameters: Optional user prompt to combine with the fleet orchestration instructions.
Returns: Indicates whether fleet mode was successfully activated.
type FleetStartRequest ¶ added in v0.3.0
type FleetStartRequest struct {
// Optional user prompt to combine with fleet instructions
Prompt *string `json:"prompt,omitempty"`
}
Optional user prompt to combine with the fleet orchestration instructions. Experimental: FleetStartRequest is part of an experimental API and may change or be removed.
type FleetStartResult ¶ added in v0.3.0
type FleetStartResult struct {
// Whether fleet mode was successfully activated
Started bool `json:"started"`
}
Indicates whether fleet mode was successfully activated. Experimental: FleetStartResult is part of an experimental API and may change or be removed.
type FolderTrustAddParams ¶ added in v1.0.0
type FolderTrustAddParams struct {
// Folder path to mark as trusted
Path string `json:"path"`
}
Folder path to add to trusted folders. Experimental: FolderTrustAddParams is part of an experimental API and may change or be removed.
type FolderTrustCheckParams ¶ added in v1.0.0
type FolderTrustCheckParams struct {
// Folder path to check
Path string `json:"path"`
}
Folder path to check for trust. Experimental: FolderTrustCheckParams is part of an experimental API and may change or be removed.
type FolderTrustCheckResult ¶ added in v1.0.0
type FolderTrustCheckResult struct {
// Whether the folder is trusted
Trusted bool `json:"trusted"`
}
Folder trust check result. Experimental: FolderTrustCheckResult is part of an experimental API and may change or be removed.
type GhCLIAuthInfo ¶ added in v1.0.0
type GhCLIAuthInfo struct {
// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the
// GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this
// verbatim and does not re-fetch when set.
CopilotUser *CopilotUserResponse `json:"copilotUser,omitempty"`
// Authentication host.
Host string `json:"host"`
// User login as reported by `gh auth status`.
Login string `json:"login"`
// The token returned by `gh auth token`. Treat as a secret.
Token string `json:"token"`
}
Schema for the `GhCliAuthInfo` type. Experimental: GhCLIAuthInfo is part of an experimental API and may change or be removed.
func (GhCLIAuthInfo) MarshalJSON ¶ added in v1.0.0
func (r GhCLIAuthInfo) MarshalJSON() ([]byte, error)
func (GhCLIAuthInfo) Type ¶ added in v1.0.0
func (GhCLIAuthInfo) Type() AuthInfoType
type HMACAuthInfo ¶ added in v1.0.0
type HMACAuthInfo struct {
// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the
// GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this
// verbatim and does not re-fetch when set.
CopilotUser *CopilotUserResponse `json:"copilotUser,omitempty"`
// HMAC secret used to sign requests.
HMAC string `json:"hmac"`
// Authentication host. HMAC auth always targets the public GitHub host.
Host HMACAuthInfoHost `json:"host"`
}
Schema for the `HMACAuthInfo` type. Experimental: HMACAuthInfo is part of an experimental API and may change or be removed.
func (HMACAuthInfo) MarshalJSON ¶ added in v1.0.0
func (r HMACAuthInfo) MarshalJSON() ([]byte, error)
func (HMACAuthInfo) Type ¶ added in v1.0.0
func (HMACAuthInfo) Type() AuthInfoType
type HMACAuthInfoHost ¶ added in v1.0.0
type HMACAuthInfoHost string
Authentication host. HMAC auth always targets the public GitHub host.
const (
HMACAuthInfoHostHTTPSGitHubCom HMACAuthInfoHost = "https://github.com"
)
type HandlePendingToolCallRequest ¶ added in v1.0.0
type HandlePendingToolCallRequest struct {
// Error message if the tool call failed
Error *string `json:"error,omitempty"`
// Request ID of the pending tool call
RequestID string `json:"requestId"`
// Tool call result (string or expanded result object)
Result ExternalToolResult `json:"result,omitempty"`
}
Pending external tool call request ID, with the tool result or an error describing why it failed. Experimental: HandlePendingToolCallRequest is part of an experimental API and may change or be removed.
func (*HandlePendingToolCallRequest) UnmarshalJSON ¶ added in v1.0.0
func (r *HandlePendingToolCallRequest) UnmarshalJSON(data []byte) error
type HandlePendingToolCallResult ¶ added in v1.0.0
type HandlePendingToolCallResult struct {
// Whether the tool call result was handled successfully
Success bool `json:"success"`
}
Indicates whether the external tool call result was handled successfully. Experimental: HandlePendingToolCallResult is part of an experimental API and may change or be removed.
type HandoffRepository ¶ added in v1.0.0
type HandoffRepository struct {
// Git branch name, if applicable
Branch *string `json:"branch,omitempty"`
// Repository name
Name string `json:"name"`
// Repository owner (user or organization)
Owner string `json:"owner"`
}
Repository context for the handed-off session
type HandoffSourceType ¶ added in v1.0.0
type HandoffSourceType string
Origin type of the session being handed off
const ( // The handoff originated from a local session. HandoffSourceTypeLocal HandoffSourceType = "local" // The handoff originated from a remote session. HandoffSourceTypeRemote HandoffSourceType = "remote" )
type HistoryAPI ¶ added in v1.0.0
type HistoryAPI sessionAPI
Experimental: HistoryAPI contains experimental APIs that may change or be removed.
func (*HistoryAPI) AbortManualCompaction ¶ added in v1.0.0
func (a *HistoryAPI) AbortManualCompaction(ctx context.Context) (*HistoryAbortManualCompactionResult, error)
AbortManualCompaction aborts any in-progress manual compaction on a local session.
RPC method: session.history.abortManualCompaction.
Returns: Indicates whether an in-progress manual compaction was aborted.
func (*HistoryAPI) CancelBackgroundCompaction ¶ added in v1.0.0
func (a *HistoryAPI) CancelBackgroundCompaction(ctx context.Context) (*HistoryCancelBackgroundCompactionResult, error)
CancelBackgroundCompaction cancels any in-progress background compaction on a local session.
RPC method: session.history.cancelBackgroundCompaction.
Returns: Indicates whether an in-progress background compaction was cancelled.
func (*HistoryAPI) Compact ¶ added in v1.0.0
func (a *HistoryAPI) Compact(ctx context.Context, params ...*HistoryCompactRequest) (*HistoryCompactResult, error)
Compacts the session history to reduce context usage.
RPC method: session.history.compact.
Parameters: Optional compaction parameters.
Returns: Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.
func (*HistoryAPI) SummarizeForHandoff ¶ added in v1.0.0
func (a *HistoryAPI) SummarizeForHandoff(ctx context.Context) (*HistorySummarizeForHandoffResult, error)
SummarizeForHandoff produces a markdown summary of the session's conversation context for hand-off scenarios.
RPC method: session.history.summarizeForHandoff.
Returns: Markdown summary of the conversation context (empty when not available).
func (*HistoryAPI) Truncate ¶ added in v1.0.0
func (a *HistoryAPI) Truncate(ctx context.Context, params *HistoryTruncateRequest) (*HistoryTruncateResult, error)
Truncates persisted session history to a specific event.
RPC method: session.history.truncate.
Parameters: Identifier of the event to truncate to; this event and all later events are removed.
Returns: Number of events that were removed by the truncation.
type HistoryAbortManualCompactionResult ¶ added in v1.0.0
type HistoryAbortManualCompactionResult struct {
// 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.
Aborted bool `json:"aborted"`
}
Indicates whether an in-progress manual compaction was aborted. Experimental: HistoryAbortManualCompactionResult is part of an experimental API and may change or be removed.
type HistoryCancelBackgroundCompactionResult ¶ added in v1.0.0
type HistoryCancelBackgroundCompactionResult struct {
// 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.
Cancelled bool `json:"cancelled"`
}
Indicates whether an in-progress background compaction was cancelled. Experimental: HistoryCancelBackgroundCompactionResult is part of an experimental API and may change or be removed.
type HistoryCompactContextWindow ¶ added in v0.3.0
type HistoryCompactContextWindow struct {
// Token count from non-system messages (user, assistant, tool)
ConversationTokens *int64 `json:"conversationTokens,omitempty"`
// Current total tokens in the context window (system + conversation + tool definitions)
CurrentTokens int64 `json:"currentTokens"`
// Current number of messages in the conversation
MessagesLength int64 `json:"messagesLength"`
// Token count from system message(s)
SystemTokens *int64 `json:"systemTokens,omitempty"`
// Maximum token count for the model's context window
TokenLimit int64 `json:"tokenLimit"`
// Token count from tool definitions
ToolDefinitionsTokens *int64 `json:"toolDefinitionsTokens,omitempty"`
}
Post-compaction context window usage breakdown Experimental: HistoryCompactContextWindow is part of an experimental API and may change or be removed.
type HistoryCompactRequest ¶ added in v1.0.0
type HistoryCompactRequest struct {
// Optional user-provided instructions to focus the compaction summary
CustomInstructions *string `json:"customInstructions,omitempty"`
}
Optional compaction parameters. Experimental: HistoryCompactRequest is part of an experimental API and may change or be removed.
type HistoryCompactResult ¶ added in v0.3.0
type HistoryCompactResult struct {
// Post-compaction context window usage breakdown
ContextWindow *HistoryCompactContextWindow `json:"contextWindow,omitempty"`
// Number of messages removed during compaction
MessagesRemoved int64 `json:"messagesRemoved"`
// Whether compaction completed successfully
Success bool `json:"success"`
// Summary text produced by compaction. Omitted when compaction did not produce a summary
// (e.g. failure path).
SummaryContent *string `json:"summaryContent,omitempty"`
// Number of tokens freed by compaction
TokensRemoved int64 `json:"tokensRemoved"`
}
Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown. Experimental: HistoryCompactResult is part of an experimental API and may change or be removed.
type HistorySummarizeForHandoffResult ¶ added in v1.0.0
type HistorySummarizeForHandoffResult struct {
// 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.
Summary string `json:"summary"`
}
Markdown summary of the conversation context (empty when not available). Experimental: HistorySummarizeForHandoffResult is part of an experimental API and may change or be removed.
type HistoryTruncateRequest ¶ added in v0.3.0
type HistoryTruncateRequest struct {
// Event ID to truncate to. This event and all events after it are removed from the session.
EventID string `json:"eventId"`
}
Identifier of the event to truncate to; this event and all later events are removed. Experimental: HistoryTruncateRequest is part of an experimental API and may change or be removed.
type HistoryTruncateResult ¶ added in v0.3.0
type HistoryTruncateResult struct {
// Number of events that were removed
EventsRemoved int64 `json:"eventsRemoved"`
}
Number of events that were removed by the truncation. Experimental: HistoryTruncateResult is part of an experimental API and may change or be removed.
type HookEndData ¶ added in v1.0.0
type HookEndData struct {
// Error details when the hook failed
Error *HookEndError `json:"error,omitempty"`
// Identifier matching the corresponding hook.start event
HookInvocationID string `json:"hookInvocationId"`
// Type of hook that was invoked (e.g., "preToolUse", "postToolUse", "sessionStart")
HookType string `json:"hookType"`
// Output data produced by the hook
Output any `json:"output,omitempty"`
// Whether the hook completed successfully
Success bool `json:"success"`
}
Hook invocation completion details including output, success status, and error information
func (*HookEndData) Type ¶ added in v1.0.0
func (*HookEndData) Type() SessionEventType
type HookEndError ¶ added in v1.0.0
type HookEndError struct {
// Human-readable error message
Message string `json:"message"`
// Source label of the hook that errored (e.g. the plugin it was loaded from), when known
Source *string `json:"source,omitempty"`
// Error stack trace, when available
Stack *string `json:"stack,omitempty"`
}
Error details when the hook failed
type HookProgressData ¶ added in v1.0.0
type HookProgressData struct {
// Human-readable progress message from the hook process
Message string `json:"message"`
// When true, this status message replaces the previous temporary one instead of accumulating
Temporary *bool `json:"temporary,omitempty"`
}
Ephemeral progress update from a running hook process
func (*HookProgressData) Type ¶ added in v1.0.0
func (*HookProgressData) Type() SessionEventType
type HookStartData ¶ added in v1.0.0
type HookStartData struct {
// Unique identifier for this hook invocation
HookInvocationID string `json:"hookInvocationId"`
// Type of hook being invoked (e.g., "preToolUse", "postToolUse", "sessionStart")
HookType string `json:"hookType"`
// Input data passed to the hook
Input any `json:"input,omitempty"`
}
Hook invocation start details including type and input data
func (*HookStartData) Type ¶ added in v1.0.0
func (*HookStartData) Type() SessionEventType
type InstalledPlugin ¶ added in v1.0.0
type InstalledPlugin struct {
// Path where the plugin is cached locally
CachePath *string `json:"cache_path,omitempty"`
// Whether the plugin is currently enabled
Enabled bool `json:"enabled"`
// Installation timestamp
InstalledAt string `json:"installed_at"`
// Marketplace the plugin came from (empty string for direct repo installs)
Marketplace string `json:"marketplace"`
// Plugin name
Name string `json:"name"`
// Source for direct repo installs (when marketplace is empty)
Source *InstalledPluginSource `json:"source,omitempty"`
// Version installed (if available)
Version *string `json:"version,omitempty"`
}
Schema for the `InstalledPlugin` type. Experimental: InstalledPlugin is part of an experimental API and may change or be removed.
type InstalledPluginInfo ¶ added in v1.0.1
type InstalledPluginInfo struct {
// Whether the plugin is currently enabled for new sessions
Enabled bool `json:"enabled"`
// Marketplace the plugin came from. Empty string ("") for direct repo / URL / local
// installs.
Marketplace string `json:"marketplace"`
// Plugin name
Name string `json:"name"`
// Installed version (when reported by the plugin manifest)
Version *string `json:"version,omitempty"`
}
Information about an installed plugin tracked in global state. Experimental: InstalledPluginInfo is part of an experimental API and may change or be removed.
type InstalledPluginSource ¶ added in v1.0.0
type InstalledPluginSource struct {
InstalledPluginSourceGitHub *InstalledPluginSourceGitHub
InstalledPluginSourceLocal *InstalledPluginSourceLocal
InstalledPluginSourceURL *InstalledPluginSourceURL
String *string
}
Source for direct repo installs (when marketplace is empty) Experimental: InstalledPluginSource is part of an experimental API and may change or be removed.
func (InstalledPluginSource) MarshalJSON ¶ added in v1.0.0
func (r InstalledPluginSource) MarshalJSON() ([]byte, error)
func (*InstalledPluginSource) UnmarshalJSON ¶ added in v1.0.0
func (r *InstalledPluginSource) UnmarshalJSON(data []byte) error
type InstalledPluginSourceGitHub ¶ added in v1.0.0
type InstalledPluginSourceGitHub struct {
Path *string `json:"path,omitempty"`
Ref *string `json:"ref,omitempty"`
Repo string `json:"repo"`
// Constant value. Always "github".
Source InstalledPluginSourceGitHubSource `json:"source"`
}
Schema for the `InstalledPluginSourceGitHub` type. Experimental: InstalledPluginSourceGitHub is part of an experimental API and may change or be removed.
type InstalledPluginSourceGitHubSource ¶ added in v1.0.0
type InstalledPluginSourceGitHubSource string
Constant value. Always "github".
const (
InstalledPluginSourceGitHubSourceGitHub InstalledPluginSourceGitHubSource = "github"
)
type InstalledPluginSourceLocal ¶ added in v1.0.0
type InstalledPluginSourceLocal struct {
Path string `json:"path"`
// Constant value. Always "local".
Source InstalledPluginSourceLocalSource `json:"source"`
}
Schema for the `InstalledPluginSourceLocal` type. Experimental: InstalledPluginSourceLocal is part of an experimental API and may change or be removed.
type InstalledPluginSourceLocalSource ¶ added in v1.0.0
type InstalledPluginSourceLocalSource string
Constant value. Always "local".
const (
InstalledPluginSourceLocalSourceLocal InstalledPluginSourceLocalSource = "local"
)
type InstalledPluginSourceURL ¶ added in v1.0.0
type InstalledPluginSourceURL struct {
Path *string `json:"path,omitempty"`
Ref *string `json:"ref,omitempty"`
// Constant value. Always "url".
Source InstalledPluginSourceURLSource `json:"source"`
URL string `json:"url"`
}
Schema for the `InstalledPluginSourceUrl` type. Experimental: InstalledPluginSourceURL is part of an experimental API and may change or be removed.
type InstalledPluginSourceURLSource ¶ added in v1.0.0
type InstalledPluginSourceURLSource string
Constant value. Always "url".
const (
InstalledPluginSourceURLSourceURL InstalledPluginSourceURLSource = "url"
)
type InstructionSource ¶ added in v1.0.1
type InstructionSource struct {
// Glob pattern(s) from frontmatter — when set, this instruction applies only to matching
// files
ApplyTo []string `json:"applyTo,omitzero"`
// Raw content of the instruction file
Content string `json:"content"`
// When true, this source starts disabled and must be toggled on by the user
DefaultDisabled *bool `json:"defaultDisabled,omitempty"`
// Short description (body after frontmatter) for use in instruction tables
Description *string `json:"description,omitempty"`
// Unique identifier for this source (used for toggling)
ID string `json:"id"`
// Human-readable label
Label string `json:"label"`
// Where this source lives — used for UI grouping
Location InstructionSourceLocation `json:"location"`
// 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.
ProjectPath *string `json:"projectPath,omitempty"`
// File path relative to repo or absolute for home
SourcePath string `json:"sourcePath"`
// Category of instruction source — used for merge logic
Type InstructionSourceType `json:"type"`
}
Schema for the `InstructionSource` type. Experimental: InstructionSource is part of an experimental API and may change or be removed.
type InstructionSourceLocation ¶ added in v1.0.1
type InstructionSourceLocation string
Where this source lives — used for UI grouping Experimental: InstructionSourceLocation is part of an experimental API and may change or be removed.
const ( // Instructions live in plugin-provided configuration. InstructionSourceLocationPlugin InstructionSourceLocation = "plugin" // Instructions live in repository-level configuration. InstructionSourceLocationRepository InstructionSourceLocation = "repository" // Instructions live in user-level configuration. InstructionSourceLocationUser InstructionSourceLocation = "user" // Instructions live under the current working directory. InstructionSourceLocationWorkingDirectory InstructionSourceLocation = "working-directory" )
type InstructionSourceType ¶ added in v1.0.1
type InstructionSourceType string
Category of instruction source — used for merge logic Experimental: InstructionSourceType is part of an experimental API and may change or be removed.
const ( // Instructions inherited from child instruction files. InstructionSourceTypeChildInstructions InstructionSourceType = "child-instructions" // Instructions loaded from the user's home configuration. InstructionSourceTypeHome InstructionSourceType = "home" // Instructions loaded from model-specific files. InstructionSourceTypeModel InstructionSourceType = "model" // Instructions discovered from nested agent files. InstructionSourceTypeNestedAgents InstructionSourceType = "nested-agents" // Instructions supplied by an installed plugin. InstructionSourceTypePlugin InstructionSourceType = "plugin" // Instructions loaded from repository-scoped files. InstructionSourceTypeRepo InstructionSourceType = "repo" // Instructions loaded from VS Code instruction files. InstructionSourceTypeVscode InstructionSourceType = "vscode" )
type InstructionsAPI ¶ added in v1.0.0
type InstructionsAPI sessionAPI
Experimental: InstructionsAPI contains experimental APIs that may change or be removed.
func (*InstructionsAPI) GetSources ¶ added in v1.0.0
func (a *InstructionsAPI) GetSources(ctx context.Context) (*InstructionsGetSourcesResult, error)
GetSources gets instruction sources loaded for the session.
RPC method: session.instructions.getSources.
Returns: Instruction sources loaded for the session, in merge order.
type InstructionsDiscoverRequest ¶ added in v1.0.1
type InstructionsDiscoverRequest struct {
// When true, omit the host's instruction sources (user/home-level files and plugin rules),
// leaving only repository and working-directory sources. For multitenant deployments.
ExcludeHostInstructions *bool `json:"excludeHostInstructions,omitempty"`
// Optional list of project directory paths to scan for repository/working-directory
// instruction sources. When omitted or empty, only user-level and plugin instruction
// sources are returned (no project scan).
ProjectPaths []string `json:"projectPaths,omitzero"`
}
Optional project paths to include in instruction discovery. Experimental: InstructionsDiscoverRequest is part of an experimental API and may change or be removed.
type InstructionsGetSourcesResult ¶ added in v0.3.0
type InstructionsGetSourcesResult struct {
// Instruction sources for the session
Sources []InstructionSource `json:"sources"`
}
Instruction sources loaded for the session, in merge order. Experimental: InstructionsGetSourcesResult is part of an experimental API and may change or be removed.
type InternalMCPAPI ¶ added in v1.0.1
type InternalMCPAPI internalSessionAPI
Experimental: InternalMCPAPI contains experimental APIs that may change or be removed.
func (*InternalMCPAPI) ConfigureGitHub ¶ added in v1.0.1
func (a *InternalMCPAPI) ConfigureGitHub(ctx context.Context, params *MCPConfigureGitHubRequest) (*MCPConfigureGitHubResult, error)
ConfigureGitHub configures the built-in GitHub MCP server for the session's current auth context.
RPC method: session.mcp.configureGitHub.
Parameters: Opaque auth info used to configure GitHub MCP.
Returns: Result of configuring GitHub MCP. Internal: ConfigureGitHub is part of the SDK's internal handshake/plumbing; external callers should not use it.
func (*InternalMCPAPI) Oauth ¶ added in v1.0.1
func (s *InternalMCPAPI) Oauth() *InternalMCPOauthAPI
Experimental: Oauth returns experimental APIs that may change or be removed.
func (*InternalMCPAPI) RegisterExternalClient ¶ added in v1.0.1
func (a *InternalMCPAPI) RegisterExternalClient(ctx context.Context, params *MCPRegisterExternalClientRequest) (*SessionMCPRegisterExternalClientResult, error)
RegisterExternalClient registers a pre-connected external MCP client (e.g. IDE) on the session's host. The caller retains lifecycle ownership of the client and transport. Marked internal because the `client` and `transport` arguments are in-process MCP SDK instances that cannot be serialized across the JSON-RPC boundary; once the CLI moves on top of the SDK, external clients will be expressed as transport configs the runtime can construct itself.
RPC method: session.mcp.registerExternalClient.
Parameters: Registration parameters for an external MCP client. Internal: RegisterExternalClient is part of the SDK's internal handshake/plumbing; external callers should not use it.
func (*InternalMCPAPI) ReloadWithConfig ¶ added in v1.0.1
func (a *InternalMCPAPI) ReloadWithConfig(ctx context.Context, params *MCPReloadWithConfigRequest) (*MCPStartServersResult, error)
ReloadWithConfig reloads MCP server connections for the session with an explicit host-provided configuration.
RPC method: session.mcp.reloadWithConfig.
Parameters: Opaque MCP reload configuration.
Returns: MCP server startup filtering result. Internal: ReloadWithConfig is part of the SDK's internal handshake/plumbing; external callers should not use it.
func (*InternalMCPAPI) RestartServer ¶ added in v1.0.1
func (a *InternalMCPAPI) RestartServer(ctx context.Context, params *MCPRestartServerRequest) (*SessionMCPRestartServerResult, error)
RestartServer restarts an individual MCP server on the session's host (stops then starts).
RPC method: session.mcp.restartServer.
Parameters: Server name and opaque configuration for an individual MCP server restart. Internal: RestartServer is part of the SDK's internal handshake/plumbing; external callers should not use it.
func (*InternalMCPAPI) StartServer ¶ added in v1.0.1
func (a *InternalMCPAPI) StartServer(ctx context.Context, params *MCPStartServerRequest) (*SessionMCPStartServerResult, error)
StartServer starts an individual MCP server on the session's host.
RPC method: session.mcp.startServer.
Parameters: Server name and opaque configuration for an individual MCP server start. Internal: StartServer is part of the SDK's internal handshake/plumbing; external callers should not use it.
func (*InternalMCPAPI) UnregisterExternalClient ¶ added in v1.0.1
func (a *InternalMCPAPI) UnregisterExternalClient(ctx context.Context, params *MCPUnregisterExternalClientRequest) (*SessionMCPUnregisterExternalClientResult, error)
UnregisterExternalClient unregisters a previously registered external MCP client by server name. Marked internal as the paired companion of `registerExternalClient`: only in-process callers that registered a client this way can meaningfully unregister it. Disappears alongside `registerExternalClient`: once external clients are described to the runtime as config rather than handed in as instances, lifecycle (including deregistration) is owned entirely by the runtime.
RPC method: session.mcp.unregisterExternalClient.
Parameters: Server name identifying the external client to remove. Internal: UnregisterExternalClient is part of the SDK's internal handshake/plumbing; external callers should not use it.
type InternalMCPOauthAPI ¶ added in v1.0.1
type InternalMCPOauthAPI internalSessionAPI
Experimental: InternalMCPOauthAPI contains experimental APIs that may change or be removed.
func (*InternalMCPOauthAPI) Respond ¶ added in v1.0.1
func (a *InternalMCPOauthAPI) Respond(ctx context.Context, params *MCPOauthRespondRequest) (*MCPOauthRespondResult, error)
Responds to a pending MCP OAuth provider request. Marked internal because the `provider` argument is an in-process OAuthClientProvider instance that cannot be carried over the wire; the public OAuth surface will route the response through a wire-clean handshake once the CLI moves on top of the SDK.
RPC method: session.mcp.oauth.respond.
Parameters: MCP OAuth request id and optional provider response.
Returns: Empty result after recording the MCP OAuth response. Internal: Respond is part of the SDK's internal handshake/plumbing; external callers should not use it.
type InternalServerRPC ¶ added in v1.0.0
type InternalServerRPC struct {
Sessions *InternalServerSessionsAPI
// contains filtered or unexported fields
}
InternalServerRPC provides internal SDK server-scoped RPC methods (handshake helpers etc.). Not part of the public API.
func NewInternalServerRPC ¶ added in v1.0.0
func NewInternalServerRPC(client *jsonrpc2.Client) *InternalServerRPC
func (*InternalServerRPC) Connect ¶ added in v1.0.0
func (a *InternalServerRPC) Connect(ctx context.Context, params *ConnectRequest) (*ConnectResult, error)
Connect performs the SDK server connection handshake and validates the optional connection token. Marked internal because this is JSON-RPC transport plumbing invoked automatically by an SDK client's own `connect()` wrapper, not a user-facing method. Stays internal as long as the SDK client owns the handshake; would only become public if the SDK ever exposed the raw schema surface to consumers without a connection wrapper.
RPC method: connect.
Parameters: Optional connection token presented by the SDK client during the handshake.
Returns: Handshake result reporting the server's protocol version and package version on success. Internal: Connect is part of the SDK's internal handshake/plumbing; external callers should not use it.
type InternalServerSessionsAPI ¶ added in v1.0.1
type InternalServerSessionsAPI internalServerAPI
Experimental: InternalServerSessionsAPI contains experimental APIs that may change or be removed.
func (*InternalServerSessionsAPI) ConfigureSessionExtensions ¶ added in v1.0.1
func (a *InternalServerSessionsAPI) ConfigureSessionExtensions(ctx context.Context, params *ConfigureSessionExtensionsParams) (*SessionsConfigureSessionExtensionsResult, error)
ConfigureSessionExtensions attaches (or detaches) an in-process ExtensionController delegate for the given session, used by shared-API surfaces that need to query or modify the session's extension state. Pass `controller: undefined` to detach. Marked internal because the controller is an in-process object that cannot cross the JSON-RPC boundary. Disappears alongside `registerExtensionToolsOnSession`: once the runtime owns extension management, the public surface exposes list/enable/disable/reload as dedicated RPCs served by the runtime.
RPC method: sessions.configureSessionExtensions.
Parameters: Params to attach or detach an in-process ExtensionController delegate. Internal: ConfigureSessionExtensions is part of the SDK's internal handshake/plumbing; external callers should not use it.
func (*InternalServerSessionsAPI) GetBoardEntryCount ¶ added in v1.0.1
func (a *InternalServerSessionsAPI) GetBoardEntryCount(ctx context.Context, params *SessionsGetBoardEntryCountRequest) (*SessionsGetBoardEntryCountResult, error)
GetBoardEntryCount gets the dynamic-context board entry count associated with a session, when available. Internal: this exists solely so CLI telemetry events (`rem_spawn_gate`, `rem_consolidation_complete`) can pair START / END board counts around the detached rem-agent spawn. "Dynamic context board" is a runtime-internal concept that is not part of the public SDK contract; the long-term plan is to relocate the telemetry emission into the runtime so this method can be deleted entirely.
RPC method: sessions.getBoardEntryCount.
Parameters: Session ID whose board entry count should be returned.
Returns: Dynamic-context board entry count, when available. Internal: GetBoardEntryCount is part of the SDK's internal handshake/plumbing; external callers should not use it.
func (*InternalServerSessionsAPI) GetEventFilePath ¶ added in v1.0.1
func (a *InternalServerSessionsAPI) GetEventFilePath(ctx context.Context, params *SessionsGetEventFilePathRequest) (*SessionsGetEventFilePathResult, error)
GetEventFilePath computes the absolute path to a session's persisted events.jsonl file. Internal: filesystem paths are only meaningful in-process (CLI and runtime share a filesystem). Currently used by the CLI's contribution-graph feature to read historical events directly. Remote SDK consumers must not depend on this; a proper event-query API would replace it if the contribution graph ever needed to work over the wire.
RPC method: sessions.getEventFilePath.
Parameters: Session ID whose event-log file path to compute.
Returns: Absolute path to the session's events.jsonl file on disk. Internal: GetEventFilePath is part of the SDK's internal handshake/plumbing; external callers should not use it.
func (*InternalServerSessionsAPI) GetPersistedRemoteSteerable ¶ added in v1.0.1
func (a *InternalServerSessionsAPI) GetPersistedRemoteSteerable(ctx context.Context, params *SessionsGetPersistedRemoteSteerableRequest) (*SessionsGetPersistedRemoteSteerableResult, error)
GetPersistedRemoteSteerable returns a session's persisted remote-steerable flag, if any has been recorded. Internal: this is CLI-specific book-keeping used by `--continue` / `--resume` to inherit the prior session's remote-steerable preference. SDK consumers that want similar behavior should manage their own persistence around start/stop calls rather than relying on this runtime-side flag.
RPC method: sessions.getPersistedRemoteSteerable.
Parameters: Session ID to look up the persisted remote-steerable flag for.
Returns: The session's persisted remote-steerable flag, or omitted when no value has been persisted. Internal: GetPersistedRemoteSteerable is part of the SDK's internal handshake/plumbing; external callers should not use it.
func (*InternalServerSessionsAPI) PollSpawnedSessions ¶ added in v1.0.1
func (a *InternalServerSessionsAPI) PollSpawnedSessions(ctx context.Context, params *SessionsPollSpawnedSessionsRequest) (*PollSpawnedSessionsResult, error)
PollSpawnedSessions cursor-based long-poll for sessions spawned by the runtime (e.g. in response to a Mission Control `start_session` command). The cursor is an opaque token; pass it back to receive only spawn events that occurred AFTER the cursor was issued. Omit the cursor on the first call to receive any events buffered since the runtime started. Internal: this is a CLI background-daemon plumbing primitive. SDK consumers that need to react to runtime-spawned sessions should subscribe to a higher-level event stream rather than driving a long-poll loop.
RPC method: sessions.pollSpawnedSessions.
Parameters: Cursor and optional long-poll wait for polling runtime-spawned sessions.
Returns: Batch of spawn events plus a cursor for follow-up polls. Internal: PollSpawnedSessions is part of the SDK's internal handshake/plumbing; external callers should not use it.
func (*InternalServerSessionsAPI) RegisterExtensionToolsOnSession ¶ added in v1.0.1
func (a *InternalServerSessionsAPI) RegisterExtensionToolsOnSession(ctx context.Context, params *RegisterExtensionToolsParams) (*RegisterExtensionToolsResult, error)
RegisterExtensionToolsOnSession registers extension-provided tools on the given session, gated by an optional `enabled` callback. Returns an opaque unsubscribe function the caller must invoke to deregister the tools when the extension is torn down. Marked internal because `loader`, `enabled`, and the returned `unsubscribe` are in-process handles that cannot cross the JSON-RPC boundary. Disappears once extension discovery / launch / tool registration are owned by the runtime: SDK consumers will pass pure config (search paths, disabled ids) via `SessionOptions` and the runtime will resolve, launch, register, and tear down extensions itself.
RPC method: sessions.registerExtensionToolsOnSession.
Parameters: Params to attach an extension loader's tools to a session.
Returns: Handle for releasing the extension tool registration. Internal: RegisterExtensionToolsOnSession is part of the SDK's internal handshake/plumbing; external callers should not use it.
type InternalSessionRPC ¶ added in v1.0.1
type InternalSessionRPC struct {
MCP *InternalMCPAPI
// contains filtered or unexported fields
}
InternalSessionRPC provides internal SDK session-scoped RPC methods (handshake helpers etc.). Not part of the public API.
func NewInternalSessionRPC ¶ added in v1.0.1
func NewInternalSessionRPC(client *jsonrpc2.Client, sessionID string) *InternalSessionRPC
type LocalSessionMetadataValue ¶ added in v1.0.1
type LocalSessionMetadataValue struct {
// Runtime client name that created/last resumed this session
ClientName *string `json:"clientName,omitempty"`
// Pre-resolved working-directory context for session startup.
Context *SessionContext `json:"context,omitempty"`
// True for detached maintenance sessions that should be hidden from normal resume lists.
IsDetached *bool `json:"isDetached,omitempty"`
// Always false for local sessions.
IsRemote bool `json:"isRemote"`
// GitHub task ID, when this local session is bound to one. Only present for local sessions
// exported to remote control.
McTaskID *string `json:"mcTaskId,omitempty"`
// Last-modified time of the session's persisted state, as ISO 8601
ModifiedTime string `json:"modifiedTime"`
// Optional human-friendly name set via /rename
Name *string `json:"name,omitempty"`
// Stable session identifier
SessionID string `json:"sessionId"`
// Session creation time as an ISO 8601 timestamp
StartTime string `json:"startTime"`
// Short summary of the session, when one has been derived
Summary *string `json:"summary,omitempty"`
}
Schema for the `LocalSessionMetadataValue` type. Experimental: LocalSessionMetadataValue is part of an experimental API and may change or be removed.
func (LocalSessionMetadataValue) MarshalJSON ¶ added in v1.0.1
func (r LocalSessionMetadataValue) MarshalJSON() ([]byte, error)
type LogRequest ¶ added in v0.3.0
type LogRequest struct {
// When true, the message is transient and not persisted to the session event log on disk
Ephemeral *bool `json:"ephemeral,omitempty"`
// Log severity level. Determines how the message is displayed in the timeline. Defaults to
// "info".
Level *SessionLogLevel `json:"level,omitempty"`
// Human-readable message
Message string `json:"message"`
// Optional actionable tip displayed alongside the message. Only honored on `level: "info"`.
Tip *string `json:"tip,omitempty"`
// Domain category for this log entry (e.g., "mcp", "subscription", "policy", "model"). Maps
// to `infoType`/`warningType`/`errorType` on the emitted event. Defaults to "notification".
Type *string `json:"type,omitempty"`
// Optional URL the user can open in their browser for more details
URL *string `json:"url,omitempty"`
}
Message text, optional severity level, persistence flag, optional follow-up URL, and optional tip. Experimental: LogRequest is part of an experimental API and may change or be removed.
type LogResult ¶ added in v0.3.0
type LogResult struct {
// The unique identifier of the emitted session event
EventID string `json:"eventId"`
}
Identifier of the session event that was emitted for the log message. Experimental: LogResult is part of an experimental API and may change or be removed.
type LspAPI ¶ added in v1.0.0
type LspAPI sessionAPI
Experimental: LspAPI contains experimental APIs that may change or be removed.
func (*LspAPI) Initialize ¶ added in v1.0.0
func (a *LspAPI) Initialize(ctx context.Context, params *LspInitializeRequest) (*SessionLspInitializeResult, error)
Initialize loads the merged LSP configuration set for the session's working directory.
RPC method: session.lsp.initialize.
Parameters: Parameters for (re)loading the merged LSP configuration set.
type LspInitializeRequest ¶ added in v1.0.0
type LspInitializeRequest struct {
// Force re-initialization even when LSP configs were already loaded for the working
// directory.
Force *bool `json:"force,omitempty"`
// Git root used as the boundary when traversing for project-level LSP configs (supports
// monorepos).
GitRoot *string `json:"gitRoot,omitempty"`
// Working directory used to load project-level LSP configs. Defaults to the session working
// directory when omitted.
WorkingDirectory *string `json:"workingDirectory,omitempty"`
}
Parameters for (re)loading the merged LSP configuration set. Experimental: LspInitializeRequest is part of an experimental API and may change or be removed.
type MCPAPI ¶ added in v1.0.0
type MCPAPI sessionAPI
Experimental: MCPAPI contains experimental APIs that may change or be removed.
func (*MCPAPI) Apps ¶ added in v1.0.0
func (s *MCPAPI) Apps() *MCPAppsAPI
Experimental: Apps returns experimental APIs that may change or be removed.
func (*MCPAPI) CancelSamplingExecution ¶ added in v1.0.0
func (a *MCPAPI) CancelSamplingExecution(ctx context.Context, params *MCPCancelSamplingExecutionParams) (*MCPCancelSamplingExecutionResult, error)
CancelSamplingExecution cancels an in-flight MCP sampling execution by request ID.
RPC method: session.mcp.cancelSamplingExecution.
Parameters: The requestId previously passed to executeSampling that should be cancelled.
Returns: Indicates whether an in-flight sampling execution with the given requestId was found and cancelled.
func (*MCPAPI) Disable ¶ added in v1.0.0
func (a *MCPAPI) Disable(ctx context.Context, params *MCPDisableRequest) (*SessionMCPDisableResult, error)
Disables an MCP server for the session.
RPC method: session.mcp.disable.
Parameters: Name of the MCP server to disable for the session.
func (*MCPAPI) Enable ¶ added in v1.0.0
func (a *MCPAPI) Enable(ctx context.Context, params *MCPEnableRequest) (*SessionMCPEnableResult, error)
Enables an MCP server for the session.
RPC method: session.mcp.enable.
Parameters: Name of the MCP server to enable for the session.
func (*MCPAPI) ExecuteSampling ¶ added in v1.0.0
func (a *MCPAPI) ExecuteSampling(ctx context.Context, params *MCPExecuteSamplingParams) (*MCPSamplingExecutionResult, error)
ExecuteSampling runs an MCP sampling inference on behalf of an MCP server.
RPC method: session.mcp.executeSampling.
Parameters: Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference.
Returns: Outcome of an MCP sampling execution: success result, failure error, or cancellation.
func (*MCPAPI) IsServerRunning ¶ added in v1.0.1
func (a *MCPAPI) IsServerRunning(ctx context.Context, params *MCPIsServerRunningRequest) (*MCPIsServerRunningResult, error)
IsServerRunning checks whether a named MCP server is currently running on the session's host.
RPC method: session.mcp.isServerRunning.
Parameters: Server name to check running status for.
Returns: Whether the named MCP server is running.
func (*MCPAPI) List ¶ added in v1.0.0
func (a *MCPAPI) List(ctx context.Context) (*MCPServerList, error)
Lists MCP servers configured for the session, their connection status, and host-level state. The host-level state (disabled/filtered servers, failed/needs-auth/pending connections, mcp3p policy, full config) is empty/zero when no MCP host has been initialized for the session.
RPC method: session.mcp.list.
Returns: MCP servers configured for the session, with their connection status and host-level state.
func (*MCPAPI) ListTools ¶ added in v1.0.1
func (a *MCPAPI) ListTools(ctx context.Context, params *MCPListToolsRequest) (*MCPListToolsResult, error)
ListTools lists the tools exposed by a connected MCP server on this session's host.
RPC method: session.mcp.listTools.
Parameters: Server name whose tool list should be returned.
Returns: Tools exposed by the connected MCP server. Throws when the server is not connected.
func (*MCPAPI) Oauth ¶ added in v1.0.0
func (s *MCPAPI) Oauth() *MCPOauthAPI
Experimental: Oauth returns experimental APIs that may change or be removed.
func (*MCPAPI) Reload ¶ added in v1.0.0
func (a *MCPAPI) Reload(ctx context.Context) (*SessionMCPReloadResult, error)
Reloads MCP server connections for the session.
RPC method: session.mcp.reload.
func (*MCPAPI) RemoveGitHub ¶ added in v1.0.0
func (a *MCPAPI) RemoveGitHub(ctx context.Context) (*MCPRemoveGitHubResult, error)
RemoveGitHub removes the auto-managed `github` MCP server when present.
RPC method: session.mcp.removeGitHub.
Returns: Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove).
func (*MCPAPI) SetEnvValueMode ¶ added in v1.0.0
func (a *MCPAPI) SetEnvValueMode(ctx context.Context, params *MCPSetEnvValueModeParams) (*MCPSetEnvValueModeResult, error)
SetEnvValueMode sets how environment-variable values supplied to MCP servers are resolved (direct or indirect).
RPC method: session.mcp.setEnvValueMode.
Parameters: Mode controlling how MCP server env values are resolved (`direct` or `indirect`).
Returns: Env-value mode recorded on the session after the update.
func (*MCPAPI) StopServer ¶ added in v1.0.1
func (a *MCPAPI) StopServer(ctx context.Context, params *MCPStopServerRequest) (*SessionMCPStopServerResult, error)
StopServer stops an individual MCP server on the session's host.
RPC method: session.mcp.stopServer.
Parameters: Server name for an individual MCP server stop.
type MCPAllowedServer ¶ added in v1.0.1
type MCPAllowedServer struct {
// Allowed server name
Name string `json:"name"`
// PII-free note explaining why the server was allowed
RedactedNote *string `json:"redactedNote,omitempty"`
}
Schema for the `McpAllowedServer` type. Experimental: MCPAllowedServer is part of an experimental API and may change or be removed.
type MCPAppToolCallCompleteData ¶ added in v1.0.0
type MCPAppToolCallCompleteData struct {
// Arguments passed to the tool by the app view, if any
Arguments map[string]any `json:"arguments,omitzero"`
// Wall-clock duration of the underlying tools/call in milliseconds
DurationMs float64 `json:"durationMs"`
// Set when the underlying tools/call threw an error before returning a CallToolResult
Error *MCPAppToolCallCompleteError `json:"error,omitempty"`
// Standard MCP CallToolResult returned by the server. Present whether or not the call set isError.
Result map[string]any `json:"result,omitzero"`
// Name of the MCP server hosting the tool
ServerName string `json:"serverName"`
// True when the call completed without throwing AND the MCP CallToolResult did not set isError
Success bool `json:"success"`
// The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools.
ToolMeta *MCPAppToolCallCompleteToolMeta `json:"toolMeta,omitempty"`
// MCP tool name that was invoked
ToolName string `json:"toolName"`
}
MCP App view called a tool on a connected MCP server (SEP-1865)
func (*MCPAppToolCallCompleteData) Type ¶ added in v1.0.0
func (*MCPAppToolCallCompleteData) Type() SessionEventType
type MCPAppToolCallCompleteError ¶ added in v1.0.0
type MCPAppToolCallCompleteError struct {
// Human-readable error message
Message string `json:"message"`
}
Set when the underlying tools/call threw an error before returning a CallToolResult
type MCPAppToolCallCompleteToolMeta ¶ added in v1.0.0
type MCPAppToolCallCompleteToolMeta struct {
// Schema for the `McpAppToolCallCompleteToolMetaUI` type.
UI *MCPAppToolCallCompleteToolMetaUI `json:"ui,omitempty"`
}
The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools.
type MCPAppToolCallCompleteToolMetaUI ¶ added in v1.0.0
type MCPAppToolCallCompleteToolMetaUI struct {
// `ui://` URI declared by the tool's `_meta.ui.resourceUri`
ResourceURI *string `json:"resourceUri,omitempty"`
// Tool visibility per SEP-1865 (typically a subset of `["model","app"]`)
Visibility []string `json:"visibility,omitzero"`
}
Schema for the `McpAppToolCallCompleteToolMetaUI` type.
type MCPAppsAPI ¶ added in v1.0.0
type MCPAppsAPI sessionAPI
Experimental: MCPAppsAPI contains experimental APIs that may change or be removed.
func (*MCPAppsAPI) CallTool ¶ added in v1.0.0
func (a *MCPAppsAPI) CallTool(ctx context.Context, params *MCPAppsCallToolRequest) (*SessionMCPAppsCallToolResult, error)
CallTool call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`.
RPC method: session.mcp.apps.callTool.
Parameters: MCP server, tool name, and arguments to invoke from an MCP App view.
Returns: Standard MCP CallToolResult
func (*MCPAppsAPI) Diagnose ¶ added in v1.0.0
func (a *MCPAppsAPI) Diagnose(ctx context.Context, params *MCPAppsDiagnoseRequest) (*MCPAppsDiagnoseResult, error)
Diagnose MCP Apps wiring for a specific MCP server. Reports the session capability, feature-flag state, advertised extension, and how many tools have `_meta.ui` populated.
RPC method: session.mcp.apps.diagnose.
Parameters: MCP server to diagnose MCP Apps wiring for.
Returns: Diagnostic snapshot of MCP Apps wiring for the named server.
func (*MCPAppsAPI) GetHostContext ¶ added in v1.0.0
func (a *MCPAppsAPI) GetHostContext(ctx context.Context) (*MCPAppsHostContext, error)
GetHostContext read the current host context advertised to MCP App guests.
RPC method: session.mcp.apps.getHostContext.
Returns: Current host context advertised to MCP App guests.
func (*MCPAppsAPI) ListTools ¶ added in v1.0.0
func (a *MCPAppsAPI) ListTools(ctx context.Context, params *MCPAppsListToolsRequest) (*MCPAppsListToolsResult, error)
ListTools list tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `["model","app"]`) or includes `"app"`.
RPC method: session.mcp.apps.listTools.
Parameters: MCP server to list app-callable tools for.
Returns: App-callable tools from the named MCP server.
func (*MCPAppsAPI) ReadResource ¶ added in v1.0.0
func (a *MCPAppsAPI) ReadResource(ctx context.Context, params *MCPAppsReadResourceRequest) (*MCPAppsReadResourceResult, error)
ReadResource fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) from a connected server. Requires the `mcp-apps` session capability.
RPC method: session.mcp.apps.readResource.
Parameters: MCP server and resource URI to fetch.
Returns: Resource contents returned by the MCP server.
func (*MCPAppsAPI) SetHostContext ¶ added in v1.0.0
func (a *MCPAppsAPI) SetHostContext(ctx context.Context, params *MCPAppsSetHostContextRequest) (*SessionMCPAppsSetHostContextResult, error)
SetHostContext replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI.
RPC method: session.mcp.apps.setHostContext.
Parameters: Host context to advertise to MCP App guests.
type MCPAppsCallToolRequest ¶ added in v1.0.0
type MCPAppsCallToolRequest struct {
// Tool arguments
Arguments map[string]any `json:"arguments,omitzero"`
// **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.
OriginServerName string `json:"originServerName"`
// MCP server hosting the tool
ServerName string `json:"serverName"`
// MCP tool name
ToolName string `json:"toolName"`
}
MCP server, tool name, and arguments to invoke from an MCP App view. Experimental: MCPAppsCallToolRequest is part of an experimental API and may change or be removed.
type MCPAppsDiagnoseCapability ¶ added in v1.0.0
type MCPAppsDiagnoseCapability struct {
// Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers
Advertised bool `json:"advertised"`
// Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on
FeatureFlagEnabled bool `json:"featureFlagEnabled"`
// Whether the session has the `mcp-apps` capability
SessionHasMCPApps bool `json:"sessionHasMcpApps"`
}
Capability negotiation snapshot Experimental: MCPAppsDiagnoseCapability is part of an experimental API and may change or be removed.
type MCPAppsDiagnoseRequest ¶ added in v1.0.0
type MCPAppsDiagnoseRequest struct {
// MCP server to probe
ServerName string `json:"serverName"`
}
MCP server to diagnose MCP Apps wiring for. Experimental: MCPAppsDiagnoseRequest is part of an experimental API and may change or be removed.
type MCPAppsDiagnoseResult ¶ added in v1.0.0
type MCPAppsDiagnoseResult struct {
// Capability negotiation snapshot
Capability MCPAppsDiagnoseCapability `json:"capability"`
// What the server returned for this session
Server MCPAppsDiagnoseServer `json:"server"`
}
Diagnostic snapshot of MCP Apps wiring for the named server. Experimental: MCPAppsDiagnoseResult is part of an experimental API and may change or be removed.
type MCPAppsDiagnoseServer ¶ added in v1.0.0
type MCPAppsDiagnoseServer struct {
// Whether the named server is currently connected
Connected bool `json:"connected"`
// Up to 5 tool names with `_meta.ui` for quick inspection
SampleToolNames []string `json:"sampleToolNames"`
// Total tools returned by the server's tools/list
ToolCount float64 `json:"toolCount"`
// Tools whose `_meta.ui` is populated (resourceUri and/or visibility set)
ToolsWithUIMeta float64 `json:"toolsWithUiMeta"`
}
What the server returned for this session Experimental: MCPAppsDiagnoseServer is part of an experimental API and may change or be removed.
type MCPAppsHostContext ¶ added in v1.0.0
type MCPAppsHostContext struct {
// Current host context
Context MCPAppsHostContextDetails `json:"context"`
}
Current host context advertised to MCP App guests. Experimental: MCPAppsHostContext is part of an experimental API and may change or be removed.
type MCPAppsHostContextDetails ¶ added in v1.0.0
type MCPAppsHostContextDetails struct {
// Display modes the host supports
AvailableDisplayModes []MCPAppsHostContextDetailsAvailableDisplayMode `json:"availableDisplayModes,omitzero"`
// Current display mode (SEP-1865)
DisplayMode *MCPAppsHostContextDetailsDisplayMode `json:"displayMode,omitempty"`
// BCP-47 locale, e.g. 'en-US'
Locale *string `json:"locale,omitempty"`
// Platform type for responsive design
Platform *MCPAppsHostContextDetailsPlatform `json:"platform,omitempty"`
// UI theme preference per SEP-1865
Theme *MCPAppsHostContextDetailsTheme `json:"theme,omitempty"`
// IANA timezone, e.g. 'America/New_York'
TimeZone *string `json:"timeZone,omitempty"`
// Host application identifier
UserAgent *string `json:"userAgent,omitempty"`
}
Current host context Experimental: MCPAppsHostContextDetails is part of an experimental API and may change or be removed.
type MCPAppsHostContextDetailsAvailableDisplayMode ¶ added in v1.0.0
type MCPAppsHostContextDetailsAvailableDisplayMode string
Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration. Experimental: MCPAppsHostContextDetailsAvailableDisplayMode is part of an experimental API and may change or be removed.
const ( // Rendered as a fullscreen overlay MCPAppsHostContextDetailsAvailableDisplayModeFullscreen MCPAppsHostContextDetailsAvailableDisplayMode = "fullscreen" // Rendered inline within the host conversation surface MCPAppsHostContextDetailsAvailableDisplayModeInline MCPAppsHostContextDetailsAvailableDisplayMode = "inline" // Rendered as a picture-in-picture floating panel MCPAppsHostContextDetailsAvailableDisplayModePip MCPAppsHostContextDetailsAvailableDisplayMode = "pip" )
type MCPAppsHostContextDetailsDisplayMode ¶ added in v1.0.0
type MCPAppsHostContextDetailsDisplayMode string
Current display mode (SEP-1865) Experimental: MCPAppsHostContextDetailsDisplayMode is part of an experimental API and may change or be removed.
const ( // Rendered as a fullscreen overlay MCPAppsHostContextDetailsDisplayModeFullscreen MCPAppsHostContextDetailsDisplayMode = "fullscreen" // Rendered inline within the host conversation surface MCPAppsHostContextDetailsDisplayModeInline MCPAppsHostContextDetailsDisplayMode = "inline" // Rendered as a picture-in-picture floating panel MCPAppsHostContextDetailsDisplayModePip MCPAppsHostContextDetailsDisplayMode = "pip" )
type MCPAppsHostContextDetailsPlatform ¶ added in v1.0.0
type MCPAppsHostContextDetailsPlatform string
Platform type for responsive design Experimental: MCPAppsHostContextDetailsPlatform is part of an experimental API and may change or be removed.
const ( // Host runs as a desktop application MCPAppsHostContextDetailsPlatformDesktop MCPAppsHostContextDetailsPlatform = "desktop" // Host runs on a mobile device MCPAppsHostContextDetailsPlatformMobile MCPAppsHostContextDetailsPlatform = "mobile" // Host runs in a web browser MCPAppsHostContextDetailsPlatformWeb MCPAppsHostContextDetailsPlatform = "web" )
type MCPAppsHostContextDetailsTheme ¶ added in v1.0.0
type MCPAppsHostContextDetailsTheme string
UI theme preference per SEP-1865 Experimental: MCPAppsHostContextDetailsTheme is part of an experimental API and may change or be removed.
const ( // Dark UI theme MCPAppsHostContextDetailsThemeDark MCPAppsHostContextDetailsTheme = "dark" // Light UI theme MCPAppsHostContextDetailsThemeLight MCPAppsHostContextDetailsTheme = "light" )
type MCPAppsListToolsRequest ¶ added in v1.0.0
type MCPAppsListToolsRequest struct {
// **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.
OriginServerName string `json:"originServerName"`
// MCP server hosting the app
ServerName string `json:"serverName"`
}
MCP server to list app-callable tools for. Experimental: MCPAppsListToolsRequest is part of an experimental API and may change or be removed.
type MCPAppsListToolsResult ¶ added in v1.0.0
type MCPAppsListToolsResult struct {
// App-callable tools from the server
Tools []map[string]any `json:"tools"`
}
App-callable tools from the named MCP server. Experimental: MCPAppsListToolsResult is part of an experimental API and may change or be removed.
type MCPAppsReadResourceRequest ¶ added in v1.0.0
type MCPAppsReadResourceRequest struct {
// Name of the MCP server hosting the resource
ServerName string `json:"serverName"`
// Resource URI (typically ui://...)
URI string `json:"uri"`
}
MCP server and resource URI to fetch. Experimental: MCPAppsReadResourceRequest is part of an experimental API and may change or be removed.
type MCPAppsReadResourceResult ¶ added in v1.0.0
type MCPAppsReadResourceResult struct {
// Resource contents returned by the server
Contents []MCPAppsResourceContent `json:"contents"`
}
Resource contents returned by the MCP server. Experimental: MCPAppsReadResourceResult is part of an experimental API and may change or be removed.
type MCPAppsResourceContent ¶ added in v1.0.0
type MCPAppsResourceContent struct {
// Base64-encoded binary content
Blob *string `json:"blob,omitempty"`
// Resource-level metadata (CSP, permissions, etc.)
Meta map[string]any `json:"_meta,omitzero"`
// MIME type of the content
MIMEType *string `json:"mimeType,omitempty"`
// Text content (e.g. HTML)
Text *string `json:"text,omitempty"`
// The resource URI (typically ui://...)
URI string `json:"uri"`
}
Schema for the `McpAppsResourceContent` type. Experimental: MCPAppsResourceContent is part of an experimental API and may change or be removed.
type MCPAppsSetHostContextDetails ¶ added in v1.0.0
type MCPAppsSetHostContextDetails struct {
// Display modes the host supports
AvailableDisplayModes []MCPAppsSetHostContextDetailsAvailableDisplayMode `json:"availableDisplayModes,omitzero"`
// Current display mode (SEP-1865)
DisplayMode *MCPAppsSetHostContextDetailsDisplayMode `json:"displayMode,omitempty"`
// BCP-47 locale, e.g. 'en-US'
Locale *string `json:"locale,omitempty"`
// Platform type for responsive design
Platform *MCPAppsSetHostContextDetailsPlatform `json:"platform,omitempty"`
// UI theme preference per SEP-1865
Theme *MCPAppsSetHostContextDetailsTheme `json:"theme,omitempty"`
// IANA timezone, e.g. 'America/New_York'
TimeZone *string `json:"timeZone,omitempty"`
// Host application identifier
UserAgent *string `json:"userAgent,omitempty"`
}
Host context advertised to MCP App guests Experimental: MCPAppsSetHostContextDetails is part of an experimental API and may change or be removed.
type MCPAppsSetHostContextDetailsAvailableDisplayMode ¶ added in v1.0.0
type MCPAppsSetHostContextDetailsAvailableDisplayMode string
Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration. Experimental: MCPAppsSetHostContextDetailsAvailableDisplayMode is part of an experimental API and may change or be removed.
const ( // Rendered as a fullscreen overlay MCPAppsSetHostContextDetailsAvailableDisplayModeFullscreen MCPAppsSetHostContextDetailsAvailableDisplayMode = "fullscreen" // Rendered inline within the host conversation surface MCPAppsSetHostContextDetailsAvailableDisplayModeInline MCPAppsSetHostContextDetailsAvailableDisplayMode = "inline" // Rendered as a picture-in-picture floating panel MCPAppsSetHostContextDetailsAvailableDisplayModePip MCPAppsSetHostContextDetailsAvailableDisplayMode = "pip" )
type MCPAppsSetHostContextDetailsDisplayMode ¶ added in v1.0.0
type MCPAppsSetHostContextDetailsDisplayMode string
Current display mode (SEP-1865) Experimental: MCPAppsSetHostContextDetailsDisplayMode is part of an experimental API and may change or be removed.
const ( // Rendered as a fullscreen overlay MCPAppsSetHostContextDetailsDisplayModeFullscreen MCPAppsSetHostContextDetailsDisplayMode = "fullscreen" // Rendered inline within the host conversation surface MCPAppsSetHostContextDetailsDisplayModeInline MCPAppsSetHostContextDetailsDisplayMode = "inline" // Rendered as a picture-in-picture floating panel MCPAppsSetHostContextDetailsDisplayModePip MCPAppsSetHostContextDetailsDisplayMode = "pip" )
type MCPAppsSetHostContextDetailsPlatform ¶ added in v1.0.0
type MCPAppsSetHostContextDetailsPlatform string
Platform type for responsive design Experimental: MCPAppsSetHostContextDetailsPlatform is part of an experimental API and may change or be removed.
const ( // Host runs as a desktop application MCPAppsSetHostContextDetailsPlatformDesktop MCPAppsSetHostContextDetailsPlatform = "desktop" // Host runs on a mobile device MCPAppsSetHostContextDetailsPlatformMobile MCPAppsSetHostContextDetailsPlatform = "mobile" // Host runs in a web browser MCPAppsSetHostContextDetailsPlatformWeb MCPAppsSetHostContextDetailsPlatform = "web" )
type MCPAppsSetHostContextDetailsTheme ¶ added in v1.0.0
type MCPAppsSetHostContextDetailsTheme string
UI theme preference per SEP-1865 Experimental: MCPAppsSetHostContextDetailsTheme is part of an experimental API and may change or be removed.
const ( // Dark UI theme MCPAppsSetHostContextDetailsThemeDark MCPAppsSetHostContextDetailsTheme = "dark" // Light UI theme MCPAppsSetHostContextDetailsThemeLight MCPAppsSetHostContextDetailsTheme = "light" )
type MCPAppsSetHostContextRequest ¶ added in v1.0.0
type MCPAppsSetHostContextRequest struct {
// Host context advertised to MCP App guests
Context MCPAppsSetHostContextDetails `json:"context"`
}
Host context to advertise to MCP App guests. Experimental: MCPAppsSetHostContextRequest is part of an experimental API and may change or be removed.
type MCPCancelSamplingExecutionParams ¶ added in v1.0.0
type MCPCancelSamplingExecutionParams struct {
// The requestId previously passed to executeSampling that should be cancelled
RequestID string `json:"requestId"`
}
The requestId previously passed to executeSampling that should be cancelled. Experimental: MCPCancelSamplingExecutionParams is part of an experimental API and may change or be removed.
type MCPCancelSamplingExecutionResult ¶ added in v1.0.0
type MCPCancelSamplingExecutionResult struct {
// 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).
Cancelled bool `json:"cancelled"`
}
Indicates whether an in-flight sampling execution with the given requestId was found and cancelled. Experimental: MCPCancelSamplingExecutionResult is part of an experimental API and may change or be removed.
type MCPConfigAddRequest ¶ added in v0.3.0
type MCPConfigAddRequest struct {
// MCP server configuration (stdio process or remote HTTP/SSE)
Config MCPServerConfig `json:"config"`
// Unique name for the MCP server
Name string `json:"name"`
}
MCP server name and configuration to add to user configuration.
func (*MCPConfigAddRequest) UnmarshalJSON ¶ added in v1.0.0
func (r *MCPConfigAddRequest) UnmarshalJSON(data []byte) error
type MCPConfigAddResult ¶ added in v0.3.0
type MCPConfigAddResult struct {
}
type MCPConfigDisableRequest ¶ added in v0.3.0
type MCPConfigDisableRequest struct {
// Names of MCP servers to disable. Each server is added to the persisted disabled list so
// new sessions skip it. Already-disabled names are ignored. Active sessions keep their
// current connections until they end.
Names []string `json:"names"`
}
MCP server names to disable for new sessions.
type MCPConfigDisableResult ¶ added in v0.3.0
type MCPConfigDisableResult struct {
}
type MCPConfigEnableRequest ¶ added in v0.3.0
type MCPConfigEnableRequest struct {
// Names of MCP servers to enable. Each server is removed from the persisted disabled list
// so new sessions spawn it. Unknown or already-enabled names are ignored.
Names []string `json:"names"`
}
MCP server names to enable for new sessions.
type MCPConfigEnableResult ¶ added in v0.3.0
type MCPConfigEnableResult struct {
}
type MCPConfigList ¶ added in v0.3.0
type MCPConfigList struct {
// All MCP servers from user config, keyed by name
Servers map[string]MCPServerConfig `json:"servers"`
}
User-configured MCP servers, keyed by server name.
func (*MCPConfigList) UnmarshalJSON ¶ added in v1.0.0
func (r *MCPConfigList) UnmarshalJSON(data []byte) error
type MCPConfigReloadResult ¶ added in v1.0.0
type MCPConfigReloadResult struct {
}
type MCPConfigRemoveRequest ¶ added in v0.3.0
type MCPConfigRemoveRequest struct {
// Name of the MCP server to remove
Name string `json:"name"`
}
MCP server name to remove from user configuration.
type MCPConfigRemoveResult ¶ added in v0.3.0
type MCPConfigRemoveResult struct {
}
type MCPConfigUpdateRequest ¶ added in v0.3.0
type MCPConfigUpdateRequest struct {
// MCP server configuration (stdio process or remote HTTP/SSE)
Config MCPServerConfig `json:"config"`
// Name of the MCP server to update
Name string `json:"name"`
}
MCP server name and replacement configuration to write to user configuration.
func (*MCPConfigUpdateRequest) UnmarshalJSON ¶ added in v1.0.0
func (r *MCPConfigUpdateRequest) UnmarshalJSON(data []byte) error
type MCPConfigUpdateResult ¶ added in v0.3.0
type MCPConfigUpdateResult struct {
}
type MCPConfigureGitHubRequest ¶ added in v1.0.1
type MCPConfigureGitHubRequest struct {
// Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process
// runtime shape (configureGitHubMcp is a no-op over the wire).
// Internal: AuthInfo is part of the SDK's internal API surface and is not intended for
// external use.
AuthInfo any `json:"authInfo"`
}
Opaque auth info used to configure GitHub MCP. Experimental: MCPConfigureGitHubRequest is part of an experimental API and may change or be removed.
type MCPConfigureGitHubResult ¶ added in v1.0.1
type MCPConfigureGitHubResult struct {
// Whether GitHub MCP configuration changed.
Changed bool `json:"changed"`
}
Result of configuring GitHub MCP. Experimental: MCPConfigureGitHubResult is part of an experimental API and may change or be removed.
type MCPDisableRequest ¶ added in v0.3.0
type MCPDisableRequest struct {
// Name of the MCP server to disable
ServerName string `json:"serverName"`
}
Name of the MCP server to disable for the session. Experimental: MCPDisableRequest is part of an experimental API and may change or be removed.
type MCPDiscoverRequest ¶ added in v0.3.0
type MCPDiscoverRequest struct {
// Working directory used as context for discovery (e.g., plugin resolution)
WorkingDirectory *string `json:"workingDirectory,omitempty"`
}
Optional working directory used as context for MCP server discovery.
type MCPDiscoverResult ¶ added in v0.3.0
type MCPDiscoverResult struct {
// MCP servers discovered from all sources
Servers []DiscoveredMCPServer `json:"servers"`
}
MCP servers discovered from user, workspace, plugin, and built-in sources.
type MCPEnableRequest ¶ added in v0.3.0
type MCPEnableRequest struct {
// Name of the MCP server to enable
ServerName string `json:"serverName"`
}
Name of the MCP server to enable for the session. Experimental: MCPEnableRequest is part of an experimental API and may change or be removed.
type MCPExecuteSamplingParams ¶ added in v1.0.0
type MCPExecuteSamplingParams struct {
// The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate
// the inference with the originating MCP request for telemetry; this is distinct from
// `requestId` (which is the schema-level cancellation handle).
MCPRequestID any `json:"mcpRequestId"`
// 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.
Request MCPExecuteSamplingRequest `json:"request"`
// 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.
RequestID string `json:"requestId"`
// Name of the MCP server that initiated the sampling request
ServerName string `json:"serverName"`
}
Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference. Experimental: MCPExecuteSamplingParams is part of an experimental API and may change or be removed.
type MCPExecuteSamplingRequest ¶ added in v1.0.0
type MCPExecuteSamplingRequest struct {
}
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: MCPExecuteSamplingRequest is part of an experimental API and may change or be removed.
type MCPExecuteSamplingResult ¶ added in v1.0.0
type MCPExecuteSamplingResult struct {
}
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: MCPExecuteSamplingResult is part of an experimental API and may change or be removed.
type MCPFilteredServer ¶ added in v1.0.1
type MCPFilteredServer struct {
// Enterprise login associated with an allowlist policy
EnterpriseName *string `json:"enterpriseName,omitempty"`
// Filtered server name
Name string `json:"name"`
// Human-readable filter reason
Reason string `json:"reason"`
// PII-free filter reason
RedactedReason *string `json:"redactedReason,omitempty"`
}
Schema for the `McpFilteredServer` type. Experimental: MCPFilteredServer is part of an experimental API and may change or be removed.
type MCPHostState ¶ added in v1.0.1
type MCPHostState struct {
// Names of currently-connected MCP clients.
Clients []string `json:"clients"`
// Configured servers that are explicitly disabled.
DisabledServers []string `json:"disabledServers"`
// Map of server name to recorded connection failure.
FailedServers map[string]MCPServerFailureInfo `json:"failedServers"`
// Configured servers filtered out by enterprise allowlist policy.
FilteredServers []string `json:"filteredServers"`
// Whether third-party MCP servers are policy-enabled for this session.
Mcp3pEnabled bool `json:"mcp3pEnabled"`
// Map of server name to recorded pending-auth state.
NeedsAuthServers map[string]MCPServerNeedsAuthInfo `json:"needsAuthServers"`
// Names of servers with in-flight connection attempts.
PendingConnections []string `json:"pendingConnections"`
}
Host-level state, omitted when no MCP host is initialized. Experimental: MCPHostState is part of an experimental API and may change or be removed.
type MCPIsServerRunningRequest ¶ added in v1.0.1
type MCPIsServerRunningRequest struct {
// Name of the MCP server to check
ServerName string `json:"serverName"`
}
Server name to check running status for. Experimental: MCPIsServerRunningRequest is part of an experimental API and may change or be removed.
type MCPIsServerRunningResult ¶ added in v1.0.1
type MCPIsServerRunningResult struct {
// True if the server has an active client and transport.
Running bool `json:"running"`
}
Whether the named MCP server is running. Experimental: MCPIsServerRunningResult is part of an experimental API and may change or be removed.
type MCPListToolsRequest ¶ added in v1.0.1
type MCPListToolsRequest struct {
// Name of the connected MCP server whose tools to list.
ServerName string `json:"serverName"`
}
Server name whose tool list should be returned. Experimental: MCPListToolsRequest is part of an experimental API and may change or be removed.
type MCPListToolsResult ¶ added in v1.0.1
type MCPListToolsResult struct {
// Tools exposed by the server.
Tools []MCPTools `json:"tools"`
}
Tools exposed by the connected MCP server. Throws when the server is not connected. Experimental: MCPListToolsResult is part of an experimental API and may change or be removed.
type MCPOauthAPI ¶ added in v1.0.0
type MCPOauthAPI sessionAPI
Experimental: MCPOauthAPI contains experimental APIs that may change or be removed.
func (*MCPOauthAPI) Login ¶ added in v1.0.0
func (a *MCPOauthAPI) Login(ctx context.Context, params *MCPOauthLoginRequest) (*MCPOauthLoginResult, error)
Login starts OAuth authentication for a remote MCP server.
RPC method: session.mcp.oauth.login.
Parameters: Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy.
Returns: OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
type MCPOauthCompletedData ¶ added in v1.0.0
type MCPOauthCompletedData struct {
// Request ID of the resolved OAuth request
RequestID string `json:"requestId"`
}
MCP OAuth request completion notification
func (*MCPOauthCompletedData) Type ¶ added in v1.0.0
func (*MCPOauthCompletedData) Type() SessionEventType
type MCPOauthLoginRequest ¶ added in v0.3.0
type MCPOauthLoginRequest struct {
// 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.
CallbackSuccessMessage *string `json:"callbackSuccessMessage,omitempty"`
// 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.
ClientName *string `json:"clientName,omitempty"`
// 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.
ForceReauth *bool `json:"forceReauth,omitempty"`
// Name of the remote MCP server to authenticate
ServerName string `json:"serverName"`
}
Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. Experimental: MCPOauthLoginRequest is part of an experimental API and may change or be removed.
type MCPOauthLoginResult ¶ added in v0.3.0
type MCPOauthLoginResult struct {
// 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.
AuthorizationURL *string `json:"authorizationUrl,omitempty"`
}
OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server. Experimental: MCPOauthLoginResult is part of an experimental API and may change or be removed.
type MCPOauthRequiredData ¶ added in v1.0.0
type MCPOauthRequiredData struct {
// Unique identifier for this OAuth request; used to respond via session.respondToMcpOAuth()
RequestID string `json:"requestId"`
// Display name of the MCP server that requires OAuth
ServerName string `json:"serverName"`
// URL of the MCP server that requires OAuth
ServerURL string `json:"serverUrl"`
// Static OAuth client configuration, if the server specifies one
StaticClientConfig *MCPOauthRequiredStaticClientConfig `json:"staticClientConfig,omitempty"`
}
OAuth authentication request for an MCP server
func (*MCPOauthRequiredData) Type ¶ added in v1.0.0
func (*MCPOauthRequiredData) Type() SessionEventType
type MCPOauthRequiredStaticClientConfig ¶ added in v1.0.0
type MCPOauthRequiredStaticClientConfig struct {
// OAuth client ID for the server
ClientID string `json:"clientId"`
// Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server).
GrantType *MCPOauthRequiredStaticClientConfigGrantType `json:"grantType,omitempty"`
// Whether this is a public OAuth client
PublicClient *bool `json:"publicClient,omitempty"`
}
Static OAuth client configuration, if the server specifies one
type MCPOauthRequiredStaticClientConfigGrantType ¶ added in v1.0.0
type MCPOauthRequiredStaticClientConfigGrantType string
Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server).
const (
MCPOauthRequiredStaticClientConfigGrantTypeClientCredentials MCPOauthRequiredStaticClientConfigGrantType = "client_credentials"
)
type MCPOauthRespondRequest ¶ added in v1.0.1
type MCPOauthRespondRequest struct {
// In-process OAuthClientProvider instance, or omitted to deny. Marked internal: cannot be
// serialized across the JSON-RPC boundary.
// Internal: Provider is part of the SDK's internal API surface and is not intended for
// external use.
Provider any `json:"provider,omitempty"`
// OAuth request identifier from mcp.oauth_required
RequestID string `json:"requestId"`
}
MCP OAuth request id and optional provider response. Experimental: MCPOauthRespondRequest is part of an experimental API and may change or be removed.
type MCPOauthRespondResult ¶ added in v1.0.1
type MCPOauthRespondResult struct {
}
Empty result after recording the MCP OAuth response. Experimental: MCPOauthRespondResult is part of an experimental API and may change or be removed.
type MCPRegisterExternalClientRequest ¶ added in v1.0.1
type MCPRegisterExternalClientRequest struct {
// In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC
// boundary.
// Internal: Client is part of the SDK's internal API surface and is not intended for
// external use.
Client any `json:"client"`
// In-process server config (MCPServerConfig) paired with the in-process client/transport.
// Marked internal alongside its companions.
// Internal: Config is part of the SDK's internal API surface and is not intended for
// external use.
Config any `json:"config"`
// Logical server name for the external client
ServerName string `json:"serverName"`
// In-process MCP Transport instance. Marked internal: cannot be serialized across the
// JSON-RPC boundary.
// Internal: Transport is part of the SDK's internal API surface and is not intended for
// external use.
Transport any `json:"transport"`
}
Registration parameters for an external MCP client. Experimental: MCPRegisterExternalClientRequest is part of an experimental API and may change or be removed.
type MCPReloadWithConfigRequest ¶ added in v1.0.1
type MCPReloadWithConfigRequest struct {
// Opaque runtime MCP reload configuration. Marked internal: an in-process runtime shape
// (reloadMcpServers throws over the wire).
// Internal: Config is part of the SDK's internal API surface and is not intended for
// external use.
Config any `json:"config"`
}
Opaque MCP reload configuration. Experimental: MCPReloadWithConfigRequest is part of an experimental API and may change or be removed.
type MCPRemoveGitHubResult ¶ added in v1.0.0
type MCPRemoveGitHubResult struct {
// 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).
Removed bool `json:"removed"`
}
Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove). Experimental: MCPRemoveGitHubResult is part of an experimental API and may change or be removed.
type MCPRestartServerRequest ¶ added in v1.0.1
type MCPRestartServerRequest struct {
// Opaque server configuration (MCPServerConfig). Marked internal: an in-process runtime
// shape supplied only by in-process CLI callers.
// Internal: Config is part of the SDK's internal API surface and is not intended for
// external use.
Config any `json:"config"`
// Name of the MCP server to restart
ServerName string `json:"serverName"`
}
Server name and opaque configuration for an individual MCP server restart. Experimental: MCPRestartServerRequest is part of an experimental API and may change or be removed.
type MCPSamplingExecutionAction ¶ added in v1.0.0
type MCPSamplingExecutionAction string
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. Experimental: MCPSamplingExecutionAction is part of an experimental API and may change or be removed.
const ( // The sampling inference was cancelled before completion. MCPSamplingExecutionActionCancelled MCPSamplingExecutionAction = "cancelled" // The sampling inference failed or was rejected. MCPSamplingExecutionActionFailure MCPSamplingExecutionAction = "failure" // The sampling inference completed and produced a result. MCPSamplingExecutionActionSuccess MCPSamplingExecutionAction = "success" )
type MCPSamplingExecutionResult ¶ added in v1.0.0
type MCPSamplingExecutionResult struct {
// 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.
Action MCPSamplingExecutionAction `json:"action"`
// Error description, present when action='failure'.
Error *string `json:"error,omitempty"`
// 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.
Result *MCPExecuteSamplingResult `json:"result,omitempty"`
}
Outcome of an MCP sampling execution: success result, failure error, or cancellation. Experimental: MCPSamplingExecutionResult is part of an experimental API and may change or be removed.
type MCPServer ¶ added in v0.3.0
type MCPServer struct {
// Error message if the server failed to connect
Error *string `json:"error,omitempty"`
// Server name (config key)
Name string `json:"name"`
// Configuration source: user, workspace, plugin, or builtin
Source *MCPServerSource `json:"source,omitempty"`
// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
Status MCPServerStatus `json:"status"`
}
Schema for the `McpServer` type. Experimental: MCPServer is part of an experimental API and may change or be removed.
type MCPServerAuthConfig ¶ added in v1.0.0
type MCPServerAuthConfig interface {
// contains filtered or unexported methods
}
Set to `true` to use defaults, or provide an object with additional auth or OIDC settings.
type MCPServerAuthConfigBoolean ¶ added in v1.0.0
type MCPServerAuthConfigBoolean bool
type MCPServerAuthConfigRedirectPort ¶ added in v1.0.0
type MCPServerAuthConfigRedirectPort struct {
// Fixed port for the OAuth redirect callback server.
RedirectPort *int32 `json:"redirectPort,omitempty"`
}
Authentication settings with optional redirect port configuration.
type MCPServerConfig ¶ added in v0.3.0
type MCPServerConfig interface {
// contains filtered or unexported methods
}
MCP server configuration (stdio process or remote HTTP/SSE)
type MCPServerConfigHTTP ¶ added in v0.3.0
type MCPServerConfigHTTP struct {
// Set to `true` to use defaults, or provide an object with additional auth or OIDC settings.
Auth MCPServerAuthConfig `json:"auth,omitempty"`
// Content filtering mode to apply to all tools, or a map of tool name to content filtering
// mode.
FilterMapping FilterMapping `json:"filterMapping,omitempty"`
// HTTP headers to include in requests to the remote MCP server.
Headers map[string]string `json:"headers,omitzero"`
// Whether this server is a built-in fallback used when the user has not configured their
// own server.
IsDefaultServer *bool `json:"isDefaultServer,omitempty"`
// OAuth client ID for a pre-registered remote MCP OAuth client.
OauthClientID *string `json:"oauthClientId,omitempty"`
// OAuth grant type to use when authenticating to the remote MCP server.
OauthGrantType *MCPServerConfigHTTPOauthGrantType `json:"oauthGrantType,omitempty"`
// Whether the configured OAuth client is public and does not require a client secret.
OauthPublicClient *bool `json:"oauthPublicClient,omitempty"`
// Set to `true` to use defaults, or provide an object with additional auth or OIDC settings.
Oidc MCPServerAuthConfig `json:"oidc,omitempty"`
// Timeout in milliseconds for tool calls to this server.
Timeout *int64 `json:"timeout,omitempty"`
// Tools to include. Defaults to all tools if not specified.
Tools []string `json:"tools,omitzero"`
// Remote transport type. Defaults to "http" when omitted.
Type *MCPServerConfigHTTPType `json:"type,omitempty"`
// URL of the remote MCP server endpoint.
URL string `json:"url"`
}
Remote MCP server configuration accessed over HTTP or SSE.
func (*MCPServerConfigHTTP) UnmarshalJSON ¶ added in v1.0.0
func (r *MCPServerConfigHTTP) UnmarshalJSON(data []byte) error
type MCPServerConfigHTTPOauthGrantType ¶ added in v1.0.0
type MCPServerConfigHTTPOauthGrantType string
OAuth grant type to use when authenticating to the remote MCP server.
const ( // Interactive browser-based authorization code flow with PKCE. MCPServerConfigHTTPOauthGrantTypeAuthorizationCode MCPServerConfigHTTPOauthGrantType = "authorization_code" // Headless client credentials flow using the configured OAuth client. MCPServerConfigHTTPOauthGrantTypeClientCredentials MCPServerConfigHTTPOauthGrantType = "client_credentials" )
type MCPServerConfigHTTPType ¶ added in v0.3.0
type MCPServerConfigHTTPType string
Remote transport type. Defaults to "http" when omitted.
const ( // Streamable HTTP transport. MCPServerConfigHTTPTypeHTTP MCPServerConfigHTTPType = "http" // Server-Sent Events transport. MCPServerConfigHTTPTypeSSE MCPServerConfigHTTPType = "sse" )
type MCPServerConfigStdio ¶ added in v1.0.0
type MCPServerConfigStdio struct {
// Command-line arguments passed to the Stdio MCP server process.
Args []string `json:"args,omitzero"`
// Set to `true` to use defaults, or provide an object with additional auth or OIDC settings.
Auth MCPServerAuthConfig `json:"auth,omitempty"`
// Executable command used to start the Stdio MCP server process.
Command string `json:"command"`
// Working directory for the Stdio MCP server process.
Cwd *string `json:"cwd,omitempty"`
// Environment variables to pass to the Stdio MCP server process.
Env map[string]string `json:"env,omitzero"`
// Content filtering mode to apply to all tools, or a map of tool name to content filtering
// mode.
FilterMapping FilterMapping `json:"filterMapping,omitempty"`
// Whether this server is a built-in fallback used when the user has not configured their
// own server.
IsDefaultServer *bool `json:"isDefaultServer,omitempty"`
// Set to `true` to use defaults, or provide an object with additional auth or OIDC settings.
Oidc MCPServerAuthConfig `json:"oidc,omitempty"`
// Timeout in milliseconds for tool calls to this server.
Timeout *int64 `json:"timeout,omitempty"`
// Tools to include. Defaults to all tools if not specified.
Tools []string `json:"tools,omitzero"`
}
Stdio MCP server configuration launched as a child process.
func (*MCPServerConfigStdio) UnmarshalJSON ¶ added in v1.0.0
func (r *MCPServerConfigStdio) UnmarshalJSON(data []byte) error
type MCPServerFailureInfo ¶ added in v1.0.1
type MCPServerFailureInfo struct {
// Failure message produced when the MCP server connection failed.
Message string `json:"message"`
// epoch-ms timestamp at which the failure was recorded.
Timestamp int64 `json:"timestamp"`
}
Recorded MCP server connection failure. Experimental: MCPServerFailureInfo is part of an experimental API and may change or be removed.
type MCPServerList ¶ added in v0.3.0
type MCPServerList struct {
// Host-level state, omitted when no MCP host is initialized.
Host *MCPHostState `json:"host,omitempty"`
// Configured MCP servers
Servers []MCPServer `json:"servers"`
}
MCP servers configured for the session, with their connection status and host-level state. Experimental: MCPServerList is part of an experimental API and may change or be removed.
type MCPServerNeedsAuthInfo ¶ added in v1.0.1
type MCPServerNeedsAuthInfo struct {
// epoch-ms timestamp at which the server signalled it needs authentication.
Timestamp int64 `json:"timestamp"`
}
Recorded MCP server pending-auth state. Experimental: MCPServerNeedsAuthInfo is part of an experimental API and may change or be removed.
type MCPServerSource ¶ added in v0.3.0
type MCPServerSource string
Configuration source: user, workspace, plugin, or builtin
const ( // Server bundled with the runtime. MCPServerSourceBuiltin MCPServerSource = "builtin" // Server contributed by an installed plugin. MCPServerSourcePlugin MCPServerSource = "plugin" // Server configured in the user's global MCP configuration. MCPServerSourceUser MCPServerSource = "user" // Server configured by the current workspace. MCPServerSourceWorkspace MCPServerSource = "workspace" )
type MCPServerStatus ¶ added in v0.3.0
type MCPServerStatus string
Connection status: connected, failed, needs-auth, pending, disabled, or not_configured Experimental: MCPServerStatus is part of an experimental API and may change or be removed.
const ( // The server is connected and available. MCPServerStatusConnected MCPServerStatus = "connected" // The server is configured but disabled. MCPServerStatusDisabled MCPServerStatus = "disabled" // The server failed to connect or initialize. MCPServerStatusFailed MCPServerStatus = "failed" // The server requires authentication before it can connect. MCPServerStatusNeedsAuth MCPServerStatus = "needs-auth" // The server is not configured for this session. MCPServerStatusNotConfigured MCPServerStatus = "not_configured" // The server connection is still being established. MCPServerStatusPending MCPServerStatus = "pending" )
type MCPServerTransport ¶ added in v1.0.0
type MCPServerTransport string
Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)
const ( // Server communicates over streamable HTTP. MCPServerTransportHTTP MCPServerTransport = "http" // Server is backed by an in-memory runtime implementation. MCPServerTransportMemory MCPServerTransport = "memory" // Server communicates over Server-Sent Events (deprecated). MCPServerTransportSSE MCPServerTransport = "sse" // Server communicates over stdio with a local child process. MCPServerTransportStdio MCPServerTransport = "stdio" )
type MCPServersLoadedServer ¶ added in v1.0.0
type MCPServersLoadedServer struct {
// Error message if the server failed to connect
Error *string `json:"error,omitempty"`
// Server name (config key)
Name string `json:"name"`
// Name of the plugin that supplied the effective MCP server config, only when source is plugin
PluginName *string `json:"pluginName,omitempty"`
// Version of the plugin that supplied the effective MCP server config, only when source is plugin
PluginVersion *string `json:"pluginVersion,omitempty"`
// Configuration source: user, workspace, plugin, or builtin
Source *MCPServerSource `json:"source,omitempty"`
// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
Status MCPServerStatus `json:"status"`
// Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)
Transport *MCPServerTransport `json:"transport,omitempty"`
}
Schema for the `McpServersLoadedServer` type.
type MCPSetEnvValueModeDetails ¶ added in v1.0.0
type MCPSetEnvValueModeDetails string
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". Experimental: MCPSetEnvValueModeDetails is part of an experimental API and may change or be removed.
const ( // Treat MCP server environment values as literal strings. MCPSetEnvValueModeDetailsDirect MCPSetEnvValueModeDetails = "direct" // Treat MCP server environment values as host-side references to resolve before launch. MCPSetEnvValueModeDetailsIndirect MCPSetEnvValueModeDetails = "indirect" )
type MCPSetEnvValueModeParams ¶ added in v1.0.0
type MCPSetEnvValueModeParams struct {
// 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".
Mode MCPSetEnvValueModeDetails `json:"mode"`
}
Mode controlling how MCP server env values are resolved (`direct` or `indirect`). Experimental: MCPSetEnvValueModeParams is part of an experimental API and may change or be removed.
type MCPSetEnvValueModeResult ¶ added in v1.0.0
type MCPSetEnvValueModeResult struct {
// Mode recorded on the session after the update
Mode MCPSetEnvValueModeDetails `json:"mode"`
}
Env-value mode recorded on the session after the update. Experimental: MCPSetEnvValueModeResult is part of an experimental API and may change or be removed.
type MCPStartServerRequest ¶ added in v1.0.1
type MCPStartServerRequest struct {
// Opaque server configuration (MCPServerConfig). Marked internal: an in-process runtime
// shape supplied only by in-process CLI callers.
// Internal: Config is part of the SDK's internal API surface and is not intended for
// external use.
Config any `json:"config"`
// Name of the MCP server to start
ServerName string `json:"serverName"`
}
Server name and opaque configuration for an individual MCP server start. Experimental: MCPStartServerRequest is part of an experimental API and may change or be removed.
type MCPStartServersResult ¶ added in v1.0.1
type MCPStartServersResult struct {
// Non-default servers allowed by policy
AllowedServers []MCPAllowedServer `json:"allowedServers,omitzero"`
// Servers filtered out before startup
FilteredServers []MCPFilteredServer `json:"filteredServers"`
}
MCP server startup filtering result. Experimental: MCPStartServersResult is part of an experimental API and may change or be removed.
type MCPStopServerRequest ¶ added in v1.0.1
type MCPStopServerRequest struct {
// Name of the MCP server to stop
ServerName string `json:"serverName"`
}
Server name for an individual MCP server stop. Experimental: MCPStopServerRequest is part of an experimental API and may change or be removed.
type MCPTools ¶ added in v1.0.1
type MCPTools struct {
// Tool description, when provided.
Description *string `json:"description,omitempty"`
// Tool name.
Name string `json:"name"`
}
Schema for the `McpTools` type. Experimental: MCPTools is part of an experimental API and may change or be removed.
type MCPUnregisterExternalClientRequest ¶ added in v1.0.1
type MCPUnregisterExternalClientRequest struct {
// Server name of the external client to unregister
ServerName string `json:"serverName"`
}
Server name identifying the external client to remove. Experimental: MCPUnregisterExternalClientRequest is part of an experimental API and may change or be removed.
type MarketplaceAddResult ¶ added in v1.0.1
type MarketplaceAddResult struct {
// Final name of the marketplace as resolved from its manifest
Name string `json:"name"`
}
Result of registering a new marketplace. Experimental: MarketplaceAddResult is part of an experimental API and may change or be removed.
type MarketplaceBrowseResult ¶ added in v1.0.1
type MarketplaceBrowseResult struct {
// Plugins advertised by the marketplace
Plugins []MarketplacePluginInfo `json:"plugins"`
}
Plugins advertised by the marketplace. Experimental: MarketplaceBrowseResult is part of an experimental API and may change or be removed.
type MarketplaceInfo ¶ added in v1.0.1
type MarketplaceInfo struct {
// True when this is a default marketplace shipped with the runtime. Defaults are not
// removable.
IsDefault *bool `json:"isDefault,omitempty"`
// Marketplace name (matches the @marketplace suffix in plugin specs)
Name string `json:"name"`
// Human-readable description of where the marketplace data is fetched from (e.g. "GitHub:
// owner/repo").
Source string `json:"source"`
}
Registered marketplace summary. Experimental: MarketplaceInfo is part of an experimental API and may change or be removed.
type MarketplaceListResult ¶ added in v1.0.1
type MarketplaceListResult struct {
// Registered marketplaces
Marketplaces []MarketplaceInfo `json:"marketplaces"`
}
All registered marketplaces, including built-in defaults. Experimental: MarketplaceListResult is part of an experimental API and may change or be removed.
type MarketplacePluginInfo ¶ added in v1.0.1
type MarketplacePluginInfo struct {
// Short description from the marketplace catalog, when present
Description *string `json:"description,omitempty"`
// Plugin name as listed in the marketplace catalog
Name string `json:"name"`
}
Plugin entry advertised by a marketplace. Experimental: MarketplacePluginInfo is part of an experimental API and may change or be removed.
type MarketplaceRefreshEntry ¶ added in v1.0.1
type MarketplaceRefreshEntry struct {
// Error message (failure only)
Error *string `json:"error,omitempty"`
// Marketplace name that was refreshed
Name string `json:"name"`
// Whether the refresh succeeded
Success bool `json:"success"`
}
Schema for the `MarketplaceRefreshEntry` type. Experimental: MarketplaceRefreshEntry is part of an experimental API and may change or be removed.
type MarketplaceRefreshResult ¶ added in v1.0.1
type MarketplaceRefreshResult struct {
// Per-marketplace refresh results in deterministic order.
Results []MarketplaceRefreshEntry `json:"results"`
}
Result of refreshing one or more marketplace catalogs. Experimental: MarketplaceRefreshResult is part of an experimental API and may change or be removed.
type MarketplaceRemoveResult ¶ added in v1.0.1
type MarketplaceRemoveResult struct {
// Names of installed plugins that prevented removal. Populated only when `removed=false`.
DependentPlugins []string `json:"dependentPlugins,omitzero"`
// True when the marketplace was actually removed. False when removal was skipped because
// the marketplace has dependent plugins and `force` was not set.
Removed bool `json:"removed"`
}
Outcome of the remove attempt, including dependent-plugin info when applicable. Experimental: MarketplaceRemoveResult is part of an experimental API and may change or be removed.
type MetadataAPI ¶ added in v1.0.0
type MetadataAPI sessionAPI
Experimental: MetadataAPI contains experimental APIs that may change or be removed.
func (*MetadataAPI) Activity ¶ added in v1.0.1
func (a *MetadataAPI) Activity(ctx context.Context) (*SessionActivity, error)
Activity returns a snapshot of activity flags for the session.
RPC method: session.metadata.activity.
Returns: Current activity flags for the session.
func (*MetadataAPI) ContextInfo ¶ added in v1.0.0
func (a *MetadataAPI) ContextInfo(ctx context.Context, params *MetadataContextInfoRequest) (*MetadataContextInfoResult, error)
ContextInfo returns the token breakdown for the session's current context window for a given model.
RPC method: session.metadata.contextInfo.
Parameters: Model identifier and token limits used to compute the context-info breakdown.
Returns: Token breakdown for the session's current context window, or null if uninitialized.
func (*MetadataAPI) IsProcessing ¶ added in v1.0.0
func (a *MetadataAPI) IsProcessing(ctx context.Context) (*MetadataIsProcessingResult, error)
IsProcessing reports whether the local session is currently processing user/agent messages.
RPC method: session.metadata.isProcessing.
Returns: Indicates whether the local session is currently processing a turn or background continuation.
func (*MetadataAPI) RecomputeContextTokens ¶ added in v1.0.0
func (a *MetadataAPI) RecomputeContextTokens(ctx context.Context, params *MetadataRecomputeContextTokensRequest) (*MetadataRecomputeContextTokensResult, error)
RecomputeContextTokens re-tokenizes the session's existing messages against a model and returns aggregate token totals.
RPC method: session.metadata.recomputeContextTokens.
Parameters: Model identifier to use when re-tokenizing the session's existing messages.
Returns: 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.
func (*MetadataAPI) RecordContextChange ¶ added in v1.0.0
func (a *MetadataAPI) RecordContextChange(ctx context.Context, params *MetadataRecordContextChangeRequest) (*MetadataRecordContextChangeResult, error)
RecordContextChange records a working-directory/git context change and emits a `session.context_changed` event.
RPC method: session.metadata.recordContextChange.
Parameters: Updated working-directory/git context to record on the session.
Returns: 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).
func (*MetadataAPI) SetWorkingDirectory ¶ added in v1.0.0
func (a *MetadataAPI) SetWorkingDirectory(ctx context.Context, params *MetadataSetWorkingDirectoryRequest) (*MetadataSetWorkingDirectoryResult, error)
SetWorkingDirectory updates the session's recorded working directory.
RPC method: session.metadata.setWorkingDirectory.
Parameters: Absolute path to set as the session's new working directory.
Returns: 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 `process.chdir` and any related side-effects (file index, etc.); this method only updates the session's own recorded path.
func (*MetadataAPI) Snapshot ¶ added in v1.0.0
func (a *MetadataAPI) Snapshot(ctx context.Context) (*SessionMetadataSnapshot, error)
Snapshot returns a snapshot of the session's identifying metadata, mode, agent, and remote info.
RPC method: session.metadata.snapshot.
Returns: Point-in-time snapshot of slow-changing session identifier and state fields
type MetadataContextInfoRequest ¶ added in v1.0.0
type MetadataContextInfoRequest struct {
// Maximum output tokens allowed by the target model. Pass 0 if unknown.
OutputTokenLimit int64 `json:"outputTokenLimit"`
// Maximum prompt tokens allowed by the target model. Pass 0 to use the runtime default.
PromptTokenLimit int64 `json:"promptTokenLimit"`
// Model identifier used for tokenization. Omit to use the session default. Used both for
// token counting and to compute display values.
SelectedModel *string `json:"selectedModel,omitempty"`
}
Model identifier and token limits used to compute the context-info breakdown. Experimental: MetadataContextInfoRequest is part of an experimental API and may change or be removed.
type MetadataContextInfoResult ¶ added in v1.0.0
type MetadataContextInfoResult struct {
// Token breakdown for the current context window, or null if the session has not yet been
// initialized (no system prompt or tool metadata cached).
ContextInfo *SessionContextInfo `json:"contextInfo,omitempty"`
}
Token breakdown for the session's current context window, or null if uninitialized. Experimental: MetadataContextInfoResult is part of an experimental API and may change or be removed.
type MetadataIsProcessingResult ¶ added in v1.0.0
type MetadataIsProcessingResult struct {
// 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.
Processing bool `json:"processing"`
}
Indicates whether the local session is currently processing a turn or background continuation. Experimental: MetadataIsProcessingResult is part of an experimental API and may change or be removed.
type MetadataRecomputeContextTokensRequest ¶ added in v1.0.0
type MetadataRecomputeContextTokensRequest struct {
// Model identifier used for tokenization. The runtime token-counts both chat-context and
// system-context messages against this model.
ModelID string `json:"modelId"`
}
Model identifier to use when re-tokenizing the session's existing messages. Experimental: MetadataRecomputeContextTokensRequest is part of an experimental API and may change or be removed.
type MetadataRecomputeContextTokensResult ¶ added in v1.0.0
type MetadataRecomputeContextTokensResult struct {
// Tokens contributed by user/assistant/tool messages (excludes system/developer prompts).
MessagesTokenCount int64 `json:"messagesTokenCount"`
// Tokens contributed by system/developer prompt snapshots.
SystemTokenCount int64 `json:"systemTokenCount"`
// Sum of tokens across chat-context and system-context messages currently held by the
// session.
TotalTokens int64 `json:"totalTokens"`
}
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: MetadataRecomputeContextTokensResult is part of an experimental API and may change or be removed.
type MetadataRecordContextChangeRequest ¶ added in v1.0.0
type MetadataRecordContextChangeRequest struct {
// Updated working directory and git context. Emitted as the new payload of
// `session.context_changed`.
Context SessionWorkingDirectoryContext `json:"context"`
}
Updated working-directory/git context to record on the session. Experimental: MetadataRecordContextChangeRequest is part of an experimental API and may change or be removed.
type MetadataRecordContextChangeResult ¶ added in v1.0.0
type MetadataRecordContextChangeResult struct {
}
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). Experimental: MetadataRecordContextChangeResult is part of an experimental API and may change or be removed.
type MetadataSetWorkingDirectoryRequest ¶ added in v1.0.0
type MetadataSetWorkingDirectoryRequest struct {
// 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.
WorkingDirectory string `json:"workingDirectory"`
}
Absolute path to set as the session's new working directory. Experimental: MetadataSetWorkingDirectoryRequest is part of an experimental API and may change or be removed.
type MetadataSetWorkingDirectoryResult ¶ added in v1.0.0
type MetadataSetWorkingDirectoryResult struct {
// Working directory after the update
WorkingDirectory string `json:"workingDirectory"`
}
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 `process.chdir` and any related side-effects (file index, etc.); this method only updates the session's own recorded path. Experimental: MetadataSetWorkingDirectoryResult is part of an experimental API and may change or be removed.
type MetadataSnapshotCurrentMode ¶ added in v1.0.0
type MetadataSnapshotCurrentMode string
The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot') Experimental: MetadataSnapshotCurrentMode is part of an experimental API and may change or be removed.
const ( // The agent is working autonomously toward task completion. MetadataSnapshotCurrentModeAutopilot MetadataSnapshotCurrentMode = "autopilot" // The agent is responding interactively to the user. MetadataSnapshotCurrentModeInteractive MetadataSnapshotCurrentMode = "interactive" // The agent is preparing a plan before making changes. MetadataSnapshotCurrentModePlan MetadataSnapshotCurrentMode = "plan" )
type MetadataSnapshotRemoteMetadata ¶ added in v1.0.0
type MetadataSnapshotRemoteMetadata struct {
// The pull request number the remote session is associated with, if any.
PullRequestNumber *int64 `json:"pullRequestNumber,omitempty"`
// The repository the remote session targets.
Repository MetadataSnapshotRemoteMetadataRepository `json:"repository"`
// The original resource identifier (task ID or PR node ID), preserved across event-replay
// reconstructions. Falls back to `sessionId` when absent.
ResourceID *string `json:"resourceId,omitempty"`
// Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote`
// invocation.
TaskType *MetadataSnapshotRemoteMetadataTaskType `json:"taskType,omitempty"`
}
Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session. Experimental: MetadataSnapshotRemoteMetadata is part of an experimental API and may change or be removed.
type MetadataSnapshotRemoteMetadataRepository ¶ added in v1.0.0
type MetadataSnapshotRemoteMetadataRepository struct {
// The branch the remote session is operating on.
Branch string `json:"branch"`
// The GitHub repository name (without owner).
Name string `json:"name"`
// The GitHub owner (user or organization) of the target repository.
Owner string `json:"owner"`
}
The repository the remote session targets. Experimental: MetadataSnapshotRemoteMetadataRepository is part of an experimental API and may change or be removed.
type MetadataSnapshotRemoteMetadataTaskType ¶ added in v1.0.0
type MetadataSnapshotRemoteMetadataTaskType string
Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote` invocation. Experimental: MetadataSnapshotRemoteMetadataTaskType is part of an experimental API and may change or be removed.
const ( // Remote task originated from Copilot Coding Agent. MetadataSnapshotRemoteMetadataTaskTypeCca MetadataSnapshotRemoteMetadataTaskType = "cca" // Remote task originated from a CLI remote-session invocation. MetadataSnapshotRemoteMetadataTaskTypeCLI MetadataSnapshotRemoteMetadataTaskType = "cli" )
type ModeAPI ¶ added in v1.0.0
type ModeAPI sessionAPI
Experimental: ModeAPI contains experimental APIs that may change or be removed.
func (*ModeAPI) Get ¶ added in v1.0.0
func (a *ModeAPI) Get(ctx context.Context) (*SessionMode, error)
Gets the current agent interaction mode.
RPC method: session.mode.get.
Returns: The session mode the agent is operating in
func (*ModeAPI) Set ¶ added in v1.0.0
func (a *ModeAPI) Set(ctx context.Context, params *ModeSetRequest) (*SessionModeSetResult, error)
Sets the current agent interaction mode.
RPC method: session.mode.set.
Parameters: Agent interaction mode to apply to the session.
type ModeSetRequest ¶ added in v0.3.0
type ModeSetRequest struct {
// The session mode the agent is operating in
Mode SessionMode `json:"mode"`
}
Agent interaction mode to apply to the session. Experimental: ModeSetRequest is part of an experimental API and may change or be removed.
type Model ¶
type Model struct {
// Billing information
Billing *ModelBilling `json:"billing,omitempty"`
// Model capabilities and limits
Capabilities ModelCapabilities `json:"capabilities"`
// Default reasoning effort level (only present if model supports reasoning effort)
DefaultReasoningEffort *string `json:"defaultReasoningEffort,omitempty"`
// Model identifier (e.g., "claude-sonnet-4.5")
ID string `json:"id"`
// Model capability category for grouping in the model picker
ModelPickerCategory *ModelPickerCategory `json:"modelPickerCategory,omitempty"`
// Relative cost tier for token-based billing users
ModelPickerPriceCategory *ModelPickerPriceCategory `json:"modelPickerPriceCategory,omitempty"`
// Display name
Name string `json:"name"`
// Policy state (if applicable)
Policy *ModelPolicy `json:"policy,omitempty"`
// Supported reasoning effort levels (only present if model supports reasoning effort)
SupportedReasoningEfforts []string `json:"supportedReasoningEfforts,omitzero"`
}
Schema for the `Model` type.
type ModelAPI ¶ added in v1.0.0
type ModelAPI sessionAPI
Experimental: ModelAPI contains experimental APIs that may change or be removed.
func (*ModelAPI) GetCurrent ¶ added in v1.0.0
func (a *ModelAPI) GetCurrent(ctx context.Context) (*CurrentModel, error)
GetCurrent gets the currently selected model for the session.
RPC method: session.model.getCurrent.
Returns: 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.
func (*ModelAPI) List ¶ added in v1.0.0
func (a *ModelAPI) List(ctx context.Context, params ...*ModelListRequest) (*SessionModelList, error)
Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's.
RPC method: session.model.list.
Parameters: Optional listing options.
Returns: The list of models available to this session.
func (*ModelAPI) SetReasoningEffort ¶ added in v1.0.0
func (a *ModelAPI) SetReasoningEffort(ctx context.Context, params *ModelSetReasoningEffortRequest) (*ModelSetReasoningEffortResult, error)
SetReasoningEffort updates the session's reasoning effort without changing the selected model.
RPC method: session.model.setReasoningEffort.
Parameters: Reasoning effort level to apply to the currently selected model.
Returns: 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.
func (*ModelAPI) SwitchTo ¶ added in v1.0.0
func (a *ModelAPI) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) (*ModelSwitchToResult, error)
SwitchTo switches the session to a model and optional reasoning configuration.
RPC method: session.model.switchTo.
Parameters: Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.
Returns: The model identifier active on the session after the switch.
type ModelBilling ¶ added in v0.3.0
type ModelBilling struct {
// Billing cost multiplier relative to the base rate
Multiplier *float64 `json:"multiplier,omitempty"`
// Token-level pricing information for this model
TokenPrices *ModelBillingTokenPrices `json:"tokenPrices,omitempty"`
}
Billing information
type ModelBillingTokenPrices ¶ added in v1.0.0
type ModelBillingTokenPrices struct {
// Number of tokens per standard billing batch
BatchSize *int64 `json:"batchSize,omitempty"`
// AI Credits cost per billing batch of cached tokens
CachePrice *float64 `json:"cachePrice,omitempty"`
// Prompt token budget (max_prompt_tokens) for the default tier. The total context window is
// this value plus the model's max_output_tokens.
ContextMax *int64 `json:"contextMax,omitempty"`
// AI Credits cost per billing batch of input tokens
InputPrice *float64 `json:"inputPrice,omitempty"`
// Long context tier pricing (available for models with extended context windows)
LongContext *ModelBillingTokenPricesLongContext `json:"longContext,omitempty"`
// AI Credits cost per billing batch of output tokens
OutputPrice *float64 `json:"outputPrice,omitempty"`
}
Token-level pricing information for this model
type ModelBillingTokenPricesLongContext ¶ added in v1.0.0
type ModelBillingTokenPricesLongContext struct {
// AI Credits cost per billing batch of cached tokens
CachePrice *float64 `json:"cachePrice,omitempty"`
// Prompt token budget (max_prompt_tokens) for the long context tier. The total context
// window is this value plus the model's max_output_tokens.
ContextMax *int64 `json:"contextMax,omitempty"`
// AI Credits cost per billing batch of input tokens
InputPrice *float64 `json:"inputPrice,omitempty"`
// AI Credits cost per billing batch of output tokens
OutputPrice *float64 `json:"outputPrice,omitempty"`
}
Long context tier pricing (available for models with extended context windows)
type ModelCallFailureData ¶ added in v1.0.0
type ModelCallFailureData struct {
// Completion ID from the model provider (e.g., chatcmpl-abc123)
APICallID *string `json:"apiCallId,omitempty"`
// Duration of the failed API call in milliseconds
DurationMs *int64 `json:"durationMs,omitempty"`
// Raw provider/runtime error message for restricted telemetry
ErrorMessage *string `json:"errorMessage,omitempty"`
// What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls
Initiator *string `json:"initiator,omitempty"`
// Model identifier used for the failed API call
Model *string `json:"model,omitempty"`
// GitHub request tracing ID (x-github-request-id header) for server-side log correlation
ProviderCallID *string `json:"providerCallId,omitempty"`
// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
ServiceRequestID *string `json:"serviceRequestId,omitempty"`
// Where the failed model call originated
Source ModelCallFailureSource `json:"source"`
// HTTP status code from the failed request
StatusCode *int32 `json:"statusCode,omitempty"`
}
Failed LLM API call metadata for telemetry
func (*ModelCallFailureData) Type ¶ added in v1.0.0
func (*ModelCallFailureData) Type() SessionEventType
type ModelCallFailureSource ¶ added in v1.0.0
type ModelCallFailureSource string
Where the failed model call originated
const ( // Model call from MCP sampling. ModelCallFailureSourceMCPSampling ModelCallFailureSource = "mcp_sampling" // Model call from a sub-agent. ModelCallFailureSourceSubagent ModelCallFailureSource = "subagent" // Model call from the top-level agent. ModelCallFailureSourceTopLevel ModelCallFailureSource = "top_level" )
type ModelCapabilities ¶ added in v0.2.2
type ModelCapabilities struct {
// Token limits for prompts, outputs, and context window
Limits *ModelCapabilitiesLimits `json:"limits,omitempty"`
// Feature flags indicating what the model supports
Supports *ModelCapabilitiesSupports `json:"supports,omitempty"`
}
Model capabilities and limits
type ModelCapabilitiesLimits ¶ added in v0.2.2
type ModelCapabilitiesLimits struct {
// Maximum total context window size in tokens
MaxContextWindowTokens *int64 `json:"max_context_window_tokens,omitempty"`
// Maximum number of output/completion tokens
MaxOutputTokens *int64 `json:"max_output_tokens,omitempty"`
// Maximum number of prompt/input tokens
MaxPromptTokens *int64 `json:"max_prompt_tokens,omitempty"`
// Vision-specific limits
Vision *ModelCapabilitiesLimitsVision `json:"vision,omitempty"`
}
Token limits for prompts, outputs, and context window
type ModelCapabilitiesLimitsVision ¶ added in v0.2.2
type ModelCapabilitiesLimitsVision struct {
// Maximum number of images per prompt
MaxPromptImages int64 `json:"max_prompt_images"`
// Maximum image size in bytes
MaxPromptImageSize int64 `json:"max_prompt_image_size"`
// MIME types the model accepts
SupportedMediaTypes []string `json:"supported_media_types"`
}
Vision-specific limits
type ModelCapabilitiesOverride ¶ added in v0.2.2
type ModelCapabilitiesOverride struct {
// Token limits for prompts, outputs, and context window
Limits *ModelCapabilitiesOverrideLimits `json:"limits,omitempty"`
// Feature flags indicating what the model supports
Supports *ModelCapabilitiesOverrideSupports `json:"supports,omitempty"`
}
Initial model capability overrides. Experimental: ModelCapabilitiesOverride is part of an experimental API and may change or be removed.
type ModelCapabilitiesOverrideLimits ¶ added in v0.2.2
type ModelCapabilitiesOverrideLimits struct {
// Maximum total context window size in tokens
MaxContextWindowTokens *int64 `json:"max_context_window_tokens,omitempty"`
// Maximum number of output/completion tokens
MaxOutputTokens *int64 `json:"max_output_tokens,omitempty"`
// Maximum number of prompt/input tokens
MaxPromptTokens *int64 `json:"max_prompt_tokens,omitempty"`
// Vision-specific limits
Vision *ModelCapabilitiesOverrideLimitsVision `json:"vision,omitempty"`
}
Token limits for prompts, outputs, and context window Experimental: ModelCapabilitiesOverrideLimits is part of an experimental API and may change or be removed.
type ModelCapabilitiesOverrideLimitsVision ¶ added in v0.2.2
type ModelCapabilitiesOverrideLimitsVision struct {
// Maximum number of images per prompt
MaxPromptImages *int64 `json:"max_prompt_images,omitempty"`
// Maximum image size in bytes
MaxPromptImageSize *int64 `json:"max_prompt_image_size,omitempty"`
// MIME types the model accepts
SupportedMediaTypes []string `json:"supported_media_types,omitzero"`
}
Vision-specific limits Experimental: ModelCapabilitiesOverrideLimitsVision is part of an experimental API and may change or be removed.
type ModelCapabilitiesOverrideSupports ¶ added in v0.2.2
type ModelCapabilitiesOverrideSupports struct {
// Whether this model supports reasoning effort configuration
ReasoningEffort *bool `json:"reasoningEffort,omitempty"`
// Whether this model supports vision/image input
Vision *bool `json:"vision,omitempty"`
}
Feature flags indicating what the model supports Experimental: ModelCapabilitiesOverrideSupports is part of an experimental API and may change or be removed.
type ModelCapabilitiesSupports ¶ added in v0.2.2
type ModelCapabilitiesSupports struct {
// Whether this model supports reasoning effort configuration
ReasoningEffort *bool `json:"reasoningEffort,omitempty"`
// Whether this model supports vision/image input
Vision *bool `json:"vision,omitempty"`
}
Feature flags indicating what the model supports
type ModelList ¶ added in v0.3.0
type ModelList struct {
// List of available models with full metadata
Models []Model `json:"models"`
}
List of Copilot models available to the resolved user, including capabilities and billing metadata.
type ModelListRequest ¶ added in v1.0.0
type ModelListRequest struct {
// If true, bypasses the per-session model list cache and re-fetches from CAPI.
SkipCache *bool `json:"skipCache,omitempty"`
}
Optional listing options. Experimental: ModelListRequest is part of an experimental API and may change or be removed.
type ModelPickerCategory ¶ added in v1.0.0
type ModelPickerCategory string
Model capability category for grouping in the model picker
const ( // Lightweight model category optimized for faster, lower-cost interactions. ModelPickerCategoryLightweight ModelPickerCategory = "lightweight" // Powerful model category optimized for complex tasks. ModelPickerCategoryPowerful ModelPickerCategory = "powerful" // Versatile model category suitable for a broad range of tasks. ModelPickerCategoryVersatile ModelPickerCategory = "versatile" )
type ModelPickerPriceCategory ¶ added in v1.0.0
type ModelPickerPriceCategory string
Relative cost tier for token-based billing users
const ( // High relative token cost tier. ModelPickerPriceCategoryHigh ModelPickerPriceCategory = "high" // Lowest relative token cost tier. ModelPickerPriceCategoryLow ModelPickerPriceCategory = "low" // Medium relative token cost tier. ModelPickerPriceCategoryMedium ModelPickerPriceCategory = "medium" // Highest relative token cost tier. ModelPickerPriceCategoryVeryHigh ModelPickerPriceCategory = "very_high" )
type ModelPolicy ¶ added in v0.3.0
type ModelPolicy struct {
// Current policy state for this model
State ModelPolicyState `json:"state"`
// Usage terms or conditions for this model
Terms *string `json:"terms,omitempty"`
}
Policy state (if applicable)
type ModelPolicyState ¶ added in v1.0.0
type ModelPolicyState string
Current policy state for this model
const ( // The model is disabled by policy. ModelPolicyStateDisabled ModelPolicyState = "disabled" // The model is enabled by policy. ModelPolicyStateEnabled ModelPolicyState = "enabled" // No explicit policy is configured for the model. ModelPolicyStateUnconfigured ModelPolicyState = "unconfigured" )
type ModelSetReasoningEffortRequest ¶ added in v1.0.0
type ModelSetReasoningEffortRequest struct {
// 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.
ReasoningEffort string `json:"reasoningEffort"`
}
Reasoning effort level to apply to the currently selected model. Experimental: ModelSetReasoningEffortRequest is part of an experimental API and may change or be removed.
type ModelSetReasoningEffortResult ¶ added in v1.0.0
type ModelSetReasoningEffortResult struct {
// Reasoning effort level recorded on the session after the update
ReasoningEffort string `json:"reasoningEffort"`
}
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: ModelSetReasoningEffortResult is part of an experimental API and may change or be removed.
type ModelSwitchToRequest ¶ added in v0.3.0
type ModelSwitchToRequest struct {
// 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.
ContextTier *ContextTier `json:"contextTier,omitempty"`
// Override individual model capabilities resolved by the runtime
ModelCapabilities *ModelCapabilitiesOverride `json:"modelCapabilities,omitempty"`
// Model identifier to switch to
ModelID string `json:"modelId"`
// Reasoning effort level to use for the model. "none" disables reasoning.
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
// Reasoning summary mode to request for supported model clients
ReasoningSummary *ReasoningSummary `json:"reasoningSummary,omitempty"`
}
Target model identifier and optional reasoning effort, summary, capability overrides, and context tier. Experimental: ModelSwitchToRequest is part of an experimental API and may change or be removed.
type ModelSwitchToResult ¶ added in v0.3.0
type ModelSwitchToResult struct {
// Currently active model identifier after the switch
ModelID *string `json:"modelId,omitempty"`
}
The model identifier active on the session after the switch. Experimental: ModelSwitchToResult is part of an experimental API and may change or be removed.
type ModelsListRequest ¶ added in v0.3.0
type ModelsListRequest struct {
// GitHub token for per-user model listing. When provided, resolves this token to determine
// the user's Copilot plan and available models instead of using the global auth.
GitHubToken *string `json:"gitHubToken,omitempty"`
}
type NameAPI ¶ added in v1.0.0
type NameAPI sessionAPI
Experimental: NameAPI contains experimental APIs that may change or be removed.
func (*NameAPI) Get ¶ added in v1.0.0
func (a *NameAPI) Get(ctx context.Context) (*NameGetResult, error)
Gets the session's friendly name.
RPC method: session.name.get.
Returns: The session's friendly name, or null when not yet set.
func (*NameAPI) Set ¶ added in v1.0.0
func (a *NameAPI) Set(ctx context.Context, params *NameSetRequest) (*SessionNameSetResult, error)
Sets the session's friendly name.
RPC method: session.name.set.
Parameters: New friendly name to apply to the session.
func (*NameAPI) SetAuto ¶ added in v1.0.0
func (a *NameAPI) SetAuto(ctx context.Context, params *NameSetAutoRequest) (*NameSetAutoResult, error)
SetAuto persists an auto-generated session summary as the session's name when no user-set name exists.
RPC method: session.name.setAuto.
Parameters: Auto-generated session summary to apply as the session's name when no user-set name exists.
Returns: Indicates whether the auto-generated summary was applied as the session's name.
type NameGetResult ¶ added in v0.3.0
type NameGetResult struct {
// The session name (user-set or auto-generated), or null if not yet set
Name *string `json:"name"`
}
The session's friendly name, or null when not yet set. Experimental: NameGetResult is part of an experimental API and may change or be removed.
type NameSetAutoRequest ¶ added in v1.0.0
type NameSetAutoRequest struct {
// Auto-generated session summary. Empty/whitespace-only values are ignored; values are
// trimmed before persisting.
Summary string `json:"summary"`
}
Auto-generated session summary to apply as the session's name when no user-set name exists. Experimental: NameSetAutoRequest is part of an experimental API and may change or be removed.
type NameSetAutoResult ¶ added in v1.0.0
type NameSetAutoResult struct {
// 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.
Applied bool `json:"applied"`
}
Indicates whether the auto-generated summary was applied as the session's name. Experimental: NameSetAutoResult is part of an experimental API and may change or be removed.
type NameSetRequest ¶ added in v0.3.0
type NameSetRequest struct {
// New session name (1–100 characters, trimmed of leading/trailing whitespace)
Name string `json:"name"`
}
New friendly name to apply to the session. Experimental: NameSetRequest is part of an experimental API and may change or be removed.
type OpenCanvasInstance ¶ added in v1.0.0
type OpenCanvasInstance struct {
// Runtime-controlled routing state for an open canvas instance.
Availability CanvasInstanceAvailability `json:"availability"`
// Provider-local canvas identifier
CanvasID string `json:"canvasId"`
// Owning provider identifier
ExtensionID string `json:"extensionId"`
// Owning extension display name, when available
ExtensionName *string `json:"extensionName,omitempty"`
// Input supplied when the instance was opened
Input any `json:"input,omitempty"`
// Stable caller-supplied canvas instance identifier
InstanceID string `json:"instanceId"`
// Whether this snapshot came from an idempotent reopen
Reopen bool `json:"reopen"`
// Provider-supplied status text
Status *string `json:"status,omitempty"`
// Rendered title
Title *string `json:"title,omitempty"`
// URL for web-rendered canvases
URL *string `json:"url,omitempty"`
}
Open canvas instance snapshot. Experimental: OpenCanvasInstance is part of an experimental API and may change or be removed.
type OptionsAPI ¶ added in v1.0.0
type OptionsAPI sessionAPI
Experimental: OptionsAPI contains experimental APIs that may change or be removed.
func (*OptionsAPI) Update ¶ added in v1.0.0
func (a *OptionsAPI) Update(ctx context.Context, params *SessionUpdateOptionsParams) (*SessionUpdateOptionsResult, error)
Update patches the genuinely-mutable subset of session options.
RPC method: session.options.update.
Parameters: Patch of mutable session options to apply to the running session.
Returns: Indicates whether the session options patch was applied successfully.
type OptionsUpdateAdditionalContentExclusionPolicy ¶ added in v1.0.1
type OptionsUpdateAdditionalContentExclusionPolicy struct {
LastUpdatedAt any `json:"last_updated_at"`
Rules []OptionsUpdateAdditionalContentExclusionPolicyRule `json:"rules"`
// Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration.
Scope OptionsUpdateAdditionalContentExclusionPolicyScope `json:"scope"`
}
Schema for the `OptionsUpdateAdditionalContentExclusionPolicy` type. Experimental: OptionsUpdateAdditionalContentExclusionPolicy is part of an experimental API and may change or be removed.
type OptionsUpdateAdditionalContentExclusionPolicyRule ¶ added in v1.0.1
type OptionsUpdateAdditionalContentExclusionPolicyRule struct {
IfAnyMatch []string `json:"ifAnyMatch,omitzero"`
IfNoneMatch []string `json:"ifNoneMatch,omitzero"`
Paths []string `json:"paths"`
// Schema for the `OptionsUpdateAdditionalContentExclusionPolicyRuleSource` type.
Source OptionsUpdateAdditionalContentExclusionPolicyRuleSource `json:"source"`
}
Schema for the `OptionsUpdateAdditionalContentExclusionPolicyRule` type. Experimental: OptionsUpdateAdditionalContentExclusionPolicyRule is part of an experimental API and may change or be removed.
type OptionsUpdateAdditionalContentExclusionPolicyRuleSource ¶ added in v1.0.1
type OptionsUpdateAdditionalContentExclusionPolicyRuleSource struct {
Name string `json:"name"`
Type string `json:"type"`
}
Schema for the `OptionsUpdateAdditionalContentExclusionPolicyRuleSource` type. Experimental: OptionsUpdateAdditionalContentExclusionPolicyRuleSource is part of an experimental API and may change or be removed.
type OptionsUpdateAdditionalContentExclusionPolicyScope ¶ added in v1.0.1
type OptionsUpdateAdditionalContentExclusionPolicyScope string
Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration. Experimental: OptionsUpdateAdditionalContentExclusionPolicyScope is part of an experimental API and may change or be removed.
const ( // The content exclusion policy applies across all repositories. OptionsUpdateAdditionalContentExclusionPolicyScopeAll OptionsUpdateAdditionalContentExclusionPolicyScope = "all" // The content exclusion policy applies to the current repository. OptionsUpdateAdditionalContentExclusionPolicyScopeRepo OptionsUpdateAdditionalContentExclusionPolicyScope = "repo" )
type OptionsUpdateContextTier ¶ added in v1.0.1
type OptionsUpdateContextTier string
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. Experimental: OptionsUpdateContextTier is part of an experimental API and may change or be removed.
const ( // Use the model's default context tier and its standard token limits / pricing. OptionsUpdateContextTierDefault OptionsUpdateContextTier = "default" // Use the model's long-context tier (when available) so larger inputs are accepted and // tier-specific pricing applies. OptionsUpdateContextTierLongContext OptionsUpdateContextTier = "long_context" )
type OptionsUpdateEnvValueMode ¶ added in v1.0.0
type OptionsUpdateEnvValueMode string
How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). Experimental: OptionsUpdateEnvValueMode is part of an experimental API and may change or be removed.
const ( // Pass MCP server environment values as literal strings. OptionsUpdateEnvValueModeDirect OptionsUpdateEnvValueMode = "direct" // Resolve MCP server environment values from host-side references. OptionsUpdateEnvValueModeIndirect OptionsUpdateEnvValueMode = "indirect" )
type OptionsUpdateReasoningSummary ¶ added in v1.0.1
type OptionsUpdateReasoningSummary string
Reasoning summary mode for supported model clients. Experimental: OptionsUpdateReasoningSummary is part of an experimental API and may change or be removed.
const ( // Request a concise summary of model reasoning. OptionsUpdateReasoningSummaryConcise OptionsUpdateReasoningSummary = "concise" // Request a detailed summary of model reasoning. OptionsUpdateReasoningSummaryDetailed OptionsUpdateReasoningSummary = "detailed" // Do not request reasoning summaries from the model. OptionsUpdateReasoningSummaryNone OptionsUpdateReasoningSummary = "none" )
type OptionsUpdateToolFilterPrecedence ¶ added in v1.0.0
type OptionsUpdateToolFilterPrecedence string
Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set. Experimental: OptionsUpdateToolFilterPrecedence is part of an experimental API and may change or be removed.
const ( // If availableTools is set, it is the only constraint that applies (excludedTools is // ignored). Preserves CLI / pre-existing client behavior. Default. OptionsUpdateToolFilterPrecedenceAvailable OptionsUpdateToolFilterPrecedence = "available" // A tool is enabled if and only if it matches the allowlist (or the allowlist is unset) AND // it does not match the denylist. Makes 'all except X' expressible by combining the two // lists. OptionsUpdateToolFilterPrecedenceExcluded OptionsUpdateToolFilterPrecedence = "excluded" )
type PendingMessagesModifiedData ¶ added in v1.0.0
type PendingMessagesModifiedData struct {
}
Empty payload; the event signals that the pending message queue has changed
func (*PendingMessagesModifiedData) Type ¶ added in v1.0.0
func (*PendingMessagesModifiedData) Type() SessionEventType
type PendingPermissionRequest ¶ added in v1.0.0
type PendingPermissionRequest struct {
// The user-facing permission prompt details (commands, write, read, mcp, url, memory,
// custom-tool, path, hook)
Request PermissionPromptRequest `json:"request"`
// Unique identifier for the pending permission request
RequestID string `json:"requestId"`
}
Schema for the `PendingPermissionRequest` type. Experimental: PendingPermissionRequest is part of an experimental API and may change or be removed.
type PendingPermissionRequestList ¶ added in v1.0.0
type PendingPermissionRequestList struct {
// 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.
Items []PendingPermissionRequest `json:"items"`
}
List of pending permission requests reconstructed from event history. Experimental: PendingPermissionRequestList is part of an experimental API and may change or be removed.
type PermissionApproved ¶ added in v1.0.0
type PermissionApproved struct {
}
Schema for the `PermissionApproved` type.
func (PermissionApproved) Kind ¶ added in v1.0.0
func (PermissionApproved) Kind() PermissionResultKind
func (PermissionApproved) MarshalJSON ¶ added in v1.0.0
func (r PermissionApproved) MarshalJSON() ([]byte, error)
type PermissionApprovedForLocation ¶ added in v1.0.0
type PermissionApprovedForLocation struct {
// The approval to persist for this location
Approval UserToolSessionApproval `json:"approval"`
// The location key (git root or cwd) to persist the approval to
LocationKey string `json:"locationKey"`
}
Schema for the `PermissionApprovedForLocation` type.
func (PermissionApprovedForLocation) Kind ¶ added in v1.0.0
func (PermissionApprovedForLocation) Kind() PermissionResultKind
func (PermissionApprovedForLocation) MarshalJSON ¶ added in v1.0.0
func (r PermissionApprovedForLocation) MarshalJSON() ([]byte, error)
func (*PermissionApprovedForLocation) UnmarshalJSON ¶ added in v1.0.0
func (r *PermissionApprovedForLocation) UnmarshalJSON(data []byte) error
type PermissionApprovedForSession ¶ added in v1.0.0
type PermissionApprovedForSession struct {
// The approval to add as a session-scoped rule
Approval UserToolSessionApproval `json:"approval"`
}
Schema for the `PermissionApprovedForSession` type.
func (PermissionApprovedForSession) Kind ¶ added in v1.0.0
func (PermissionApprovedForSession) Kind() PermissionResultKind
func (PermissionApprovedForSession) MarshalJSON ¶ added in v1.0.0
func (r PermissionApprovedForSession) MarshalJSON() ([]byte, error)
func (*PermissionApprovedForSession) UnmarshalJSON ¶ added in v1.0.0
func (r *PermissionApprovedForSession) UnmarshalJSON(data []byte) error
type PermissionCancelled ¶ added in v1.0.0
type PermissionCancelled struct {
// Optional explanation of why the request was cancelled
Reason *string `json:"reason,omitempty"`
}
Schema for the `PermissionCancelled` type.
func (PermissionCancelled) Kind ¶ added in v1.0.0
func (PermissionCancelled) Kind() PermissionResultKind
func (PermissionCancelled) MarshalJSON ¶ added in v1.0.0
func (r PermissionCancelled) MarshalJSON() ([]byte, error)
type PermissionCompletedData ¶ added in v1.0.0
type PermissionCompletedData struct {
// Request ID of the resolved permission request; clients should dismiss any UI for this request
RequestID string `json:"requestId"`
// The result of the permission request
Result PermissionResult `json:"result"`
// Optional tool call ID associated with this permission prompt; clients may use it to correlate UI created from tool-scoped prompts
ToolCallID *string `json:"toolCallId,omitempty"`
}
Permission request completion notification signaling UI dismissal
func (*PermissionCompletedData) Type ¶ added in v1.0.0
func (*PermissionCompletedData) Type() SessionEventType
func (*PermissionCompletedData) UnmarshalJSON ¶ added in v1.0.0
func (r *PermissionCompletedData) UnmarshalJSON(data []byte) error
type PermissionDecision ¶ added in v0.3.0
type PermissionDecision interface {
Kind() PermissionDecisionKind
// contains filtered or unexported methods
}
The client's response to the pending permission prompt Experimental: PermissionDecision is part of an experimental API and may change or be removed.
type PermissionDecisionApproveForLocation ¶ added in v0.3.0
type PermissionDecisionApproveForLocation struct {
// Approval to persist for this location
Approval PermissionDecisionApproveForLocationApproval `json:"approval"`
// Location key (git root or cwd) to persist the approval to
LocationKey string `json:"locationKey"`
}
Schema for the `PermissionDecisionApproveForLocation` type. Experimental: PermissionDecisionApproveForLocation is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForLocation) Kind ¶ added in v0.3.0
func (PermissionDecisionApproveForLocation) Kind() PermissionDecisionKind
func (PermissionDecisionApproveForLocation) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForLocation) MarshalJSON() ([]byte, error)
func (*PermissionDecisionApproveForLocation) UnmarshalJSON ¶ added in v1.0.0
func (r *PermissionDecisionApproveForLocation) UnmarshalJSON(data []byte) error
type PermissionDecisionApproveForLocationApproval ¶ added in v0.3.0
type PermissionDecisionApproveForLocationApproval interface {
Kind() PermissionDecisionApproveForLocationApprovalKind
// contains filtered or unexported methods
}
Approval to persist for this location Experimental: PermissionDecisionApproveForLocationApproval is part of an experimental API and may change or be removed.
type PermissionDecisionApproveForLocationApprovalCommands ¶ added in v0.3.0
type PermissionDecisionApproveForLocationApprovalCommands struct {
// Command identifiers covered by this approval.
CommandIdentifiers []string `json:"commandIdentifiers"`
}
Schema for the `PermissionDecisionApproveForLocationApprovalCommands` type. Experimental: PermissionDecisionApproveForLocationApprovalCommands is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForLocationApprovalCommands) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForLocationApprovalCommands) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForLocationApprovalCustomTool ¶ added in v0.3.0
type PermissionDecisionApproveForLocationApprovalCustomTool struct {
// Custom tool name.
ToolName string `json:"toolName"`
}
Schema for the `PermissionDecisionApproveForLocationApprovalCustomTool` type. Experimental: PermissionDecisionApproveForLocationApprovalCustomTool is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForLocationApprovalCustomTool) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForLocationApprovalCustomTool) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForLocationApprovalExtensionManagement ¶ added in v1.0.0
type PermissionDecisionApproveForLocationApprovalExtensionManagement struct {
// Optional operation identifier; when omitted, the approval covers all extension management
// operations.
Operation *string `json:"operation,omitempty"`
}
Schema for the `PermissionDecisionApproveForLocationApprovalExtensionManagement` type. Experimental: PermissionDecisionApproveForLocationApprovalExtensionManagement is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForLocationApprovalExtensionManagement) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForLocationApprovalExtensionManagement) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess ¶ added in v1.0.0
type PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess struct {
// Extension name.
ExtensionName string `json:"extensionName"`
}
Schema for the `PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess` type. Experimental: PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForLocationApprovalKind ¶ added in v1.0.0
type PermissionDecisionApproveForLocationApprovalKind string
Kind discriminator for PermissionDecisionApproveForLocationApproval.
const ( PermissionDecisionApproveForLocationApprovalKindCommands PermissionDecisionApproveForLocationApprovalKind = "commands" PermissionDecisionApproveForLocationApprovalKindCustomTool PermissionDecisionApproveForLocationApprovalKind = "custom-tool" PermissionDecisionApproveForLocationApprovalKindExtensionManagement PermissionDecisionApproveForLocationApprovalKind = "extension-management" PermissionDecisionApproveForLocationApprovalKindExtensionPermissionAccess PermissionDecisionApproveForLocationApprovalKind = "extension-permission-access" PermissionDecisionApproveForLocationApprovalKindMCP PermissionDecisionApproveForLocationApprovalKind = "mcp" PermissionDecisionApproveForLocationApprovalKindMCPSampling PermissionDecisionApproveForLocationApprovalKind = "mcp-sampling" PermissionDecisionApproveForLocationApprovalKindMemory PermissionDecisionApproveForLocationApprovalKind = "memory" PermissionDecisionApproveForLocationApprovalKindRead PermissionDecisionApproveForLocationApprovalKind = "read" PermissionDecisionApproveForLocationApprovalKindWrite PermissionDecisionApproveForLocationApprovalKind = "write" )
type PermissionDecisionApproveForLocationApprovalMCP ¶ added in v0.3.0
type PermissionDecisionApproveForLocationApprovalMCP struct {
// MCP server name.
ServerName string `json:"serverName"`
// MCP tool name, or null to cover every tool on the server.
ToolName *string `json:"toolName"`
}
Schema for the `PermissionDecisionApproveForLocationApprovalMcp` type. Experimental: PermissionDecisionApproveForLocationApprovalMCP is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForLocationApprovalMCP) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForLocationApprovalMCP) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForLocationApprovalMCPSampling ¶ added in v0.3.0
type PermissionDecisionApproveForLocationApprovalMCPSampling struct {
// MCP server name.
ServerName string `json:"serverName"`
}
Schema for the `PermissionDecisionApproveForLocationApprovalMcpSampling` type. Experimental: PermissionDecisionApproveForLocationApprovalMCPSampling is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForLocationApprovalMCPSampling) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForLocationApprovalMCPSampling) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForLocationApprovalMemory ¶ added in v0.3.0
type PermissionDecisionApproveForLocationApprovalMemory struct {
}
Schema for the `PermissionDecisionApproveForLocationApprovalMemory` type. Experimental: PermissionDecisionApproveForLocationApprovalMemory is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForLocationApprovalMemory) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForLocationApprovalMemory) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForLocationApprovalRead ¶ added in v0.3.0
type PermissionDecisionApproveForLocationApprovalRead struct {
}
Schema for the `PermissionDecisionApproveForLocationApprovalRead` type. Experimental: PermissionDecisionApproveForLocationApprovalRead is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForLocationApprovalRead) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForLocationApprovalRead) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForLocationApprovalWrite ¶ added in v0.3.0
type PermissionDecisionApproveForLocationApprovalWrite struct {
}
Schema for the `PermissionDecisionApproveForLocationApprovalWrite` type. Experimental: PermissionDecisionApproveForLocationApprovalWrite is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForLocationApprovalWrite) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForLocationApprovalWrite) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForSession ¶ added in v0.3.0
type PermissionDecisionApproveForSession struct {
// Session-scoped approval to remember (tool prompts only; omitted for path/url prompts)
Approval PermissionDecisionApproveForSessionApproval `json:"approval,omitempty"`
// URL domain to approve for the rest of the session (URL prompts only)
Domain *string `json:"domain,omitempty"`
}
Schema for the `PermissionDecisionApproveForSession` type. Experimental: PermissionDecisionApproveForSession is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForSession) Kind ¶ added in v0.3.0
func (PermissionDecisionApproveForSession) Kind() PermissionDecisionKind
func (PermissionDecisionApproveForSession) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForSession) MarshalJSON() ([]byte, error)
func (*PermissionDecisionApproveForSession) UnmarshalJSON ¶ added in v1.0.0
func (r *PermissionDecisionApproveForSession) UnmarshalJSON(data []byte) error
type PermissionDecisionApproveForSessionApproval ¶ added in v0.3.0
type PermissionDecisionApproveForSessionApproval interface {
Kind() PermissionDecisionApproveForSessionApprovalKind
// contains filtered or unexported methods
}
Session-scoped approval to remember (tool prompts only; omitted for path/url prompts) Experimental: PermissionDecisionApproveForSessionApproval is part of an experimental API and may change or be removed.
type PermissionDecisionApproveForSessionApprovalCommands ¶ added in v0.3.0
type PermissionDecisionApproveForSessionApprovalCommands struct {
// Command identifiers covered by this approval.
CommandIdentifiers []string `json:"commandIdentifiers"`
}
Schema for the `PermissionDecisionApproveForSessionApprovalCommands` type. Experimental: PermissionDecisionApproveForSessionApprovalCommands is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForSessionApprovalCommands) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForSessionApprovalCommands) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForSessionApprovalCustomTool ¶ added in v0.3.0
type PermissionDecisionApproveForSessionApprovalCustomTool struct {
// Custom tool name.
ToolName string `json:"toolName"`
}
Schema for the `PermissionDecisionApproveForSessionApprovalCustomTool` type. Experimental: PermissionDecisionApproveForSessionApprovalCustomTool is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForSessionApprovalCustomTool) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForSessionApprovalCustomTool) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForSessionApprovalExtensionManagement ¶ added in v1.0.0
type PermissionDecisionApproveForSessionApprovalExtensionManagement struct {
// Optional operation identifier; when omitted, the approval covers all extension management
// operations.
Operation *string `json:"operation,omitempty"`
}
Schema for the `PermissionDecisionApproveForSessionApprovalExtensionManagement` type. Experimental: PermissionDecisionApproveForSessionApprovalExtensionManagement is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForSessionApprovalExtensionManagement) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForSessionApprovalExtensionManagement) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess ¶ added in v1.0.0
type PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess struct {
// Extension name.
ExtensionName string `json:"extensionName"`
}
Schema for the `PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess` type. Experimental: PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForSessionApprovalKind ¶ added in v1.0.0
type PermissionDecisionApproveForSessionApprovalKind string
Kind discriminator for PermissionDecisionApproveForSessionApproval.
const ( PermissionDecisionApproveForSessionApprovalKindCommands PermissionDecisionApproveForSessionApprovalKind = "commands" PermissionDecisionApproveForSessionApprovalKindCustomTool PermissionDecisionApproveForSessionApprovalKind = "custom-tool" PermissionDecisionApproveForSessionApprovalKindExtensionManagement PermissionDecisionApproveForSessionApprovalKind = "extension-management" PermissionDecisionApproveForSessionApprovalKindExtensionPermissionAccess PermissionDecisionApproveForSessionApprovalKind = "extension-permission-access" PermissionDecisionApproveForSessionApprovalKindMCP PermissionDecisionApproveForSessionApprovalKind = "mcp" PermissionDecisionApproveForSessionApprovalKindMCPSampling PermissionDecisionApproveForSessionApprovalKind = "mcp-sampling" PermissionDecisionApproveForSessionApprovalKindMemory PermissionDecisionApproveForSessionApprovalKind = "memory" PermissionDecisionApproveForSessionApprovalKindRead PermissionDecisionApproveForSessionApprovalKind = "read" PermissionDecisionApproveForSessionApprovalKindWrite PermissionDecisionApproveForSessionApprovalKind = "write" )
type PermissionDecisionApproveForSessionApprovalMCP ¶ added in v0.3.0
type PermissionDecisionApproveForSessionApprovalMCP struct {
// MCP server name.
ServerName string `json:"serverName"`
// MCP tool name, or null to cover every tool on the server.
ToolName *string `json:"toolName"`
}
Schema for the `PermissionDecisionApproveForSessionApprovalMcp` type. Experimental: PermissionDecisionApproveForSessionApprovalMCP is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForSessionApprovalMCP) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForSessionApprovalMCP) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForSessionApprovalMCPSampling ¶ added in v0.3.0
type PermissionDecisionApproveForSessionApprovalMCPSampling struct {
// MCP server name.
ServerName string `json:"serverName"`
}
Schema for the `PermissionDecisionApproveForSessionApprovalMcpSampling` type. Experimental: PermissionDecisionApproveForSessionApprovalMCPSampling is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForSessionApprovalMCPSampling) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForSessionApprovalMCPSampling) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForSessionApprovalMemory ¶ added in v0.3.0
type PermissionDecisionApproveForSessionApprovalMemory struct {
}
Schema for the `PermissionDecisionApproveForSessionApprovalMemory` type. Experimental: PermissionDecisionApproveForSessionApprovalMemory is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForSessionApprovalMemory) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForSessionApprovalMemory) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForSessionApprovalRead ¶ added in v0.3.0
type PermissionDecisionApproveForSessionApprovalRead struct {
}
Schema for the `PermissionDecisionApproveForSessionApprovalRead` type. Experimental: PermissionDecisionApproveForSessionApprovalRead is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForSessionApprovalRead) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForSessionApprovalRead) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveForSessionApprovalWrite ¶ added in v0.3.0
type PermissionDecisionApproveForSessionApprovalWrite struct {
}
Schema for the `PermissionDecisionApproveForSessionApprovalWrite` type. Experimental: PermissionDecisionApproveForSessionApprovalWrite is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveForSessionApprovalWrite) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveForSessionApprovalWrite) MarshalJSON() ([]byte, error)
type PermissionDecisionApproveOnce ¶ added in v0.3.0
type PermissionDecisionApproveOnce struct {
}
Schema for the `PermissionDecisionApproveOnce` type. Experimental: PermissionDecisionApproveOnce is part of an experimental API and may change or be removed.
func (PermissionDecisionApproveOnce) Kind ¶ added in v0.3.0
func (PermissionDecisionApproveOnce) Kind() PermissionDecisionKind
func (PermissionDecisionApproveOnce) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproveOnce) MarshalJSON() ([]byte, error)
type PermissionDecisionApprovePermanently ¶ added in v1.0.0
type PermissionDecisionApprovePermanently struct {
// URL domain to approve permanently
Domain string `json:"domain"`
}
Schema for the `PermissionDecisionApprovePermanently` type. Experimental: PermissionDecisionApprovePermanently is part of an experimental API and may change or be removed.
func (PermissionDecisionApprovePermanently) Kind ¶ added in v1.0.0
func (PermissionDecisionApprovePermanently) Kind() PermissionDecisionKind
func (PermissionDecisionApprovePermanently) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApprovePermanently) MarshalJSON() ([]byte, error)
type PermissionDecisionApproved ¶ added in v1.0.0
type PermissionDecisionApproved struct {
}
Schema for the `PermissionDecisionApproved` type. Experimental: PermissionDecisionApproved is part of an experimental API and may change or be removed.
func (PermissionDecisionApproved) Kind ¶ added in v1.0.0
func (PermissionDecisionApproved) Kind() PermissionDecisionKind
func (PermissionDecisionApproved) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApproved) MarshalJSON() ([]byte, error)
type PermissionDecisionApprovedForLocation ¶ added in v1.0.0
type PermissionDecisionApprovedForLocation struct {
// The approval to persist for this location
Approval UserToolSessionApproval `json:"approval"`
// The location key (git root or cwd) to persist the approval to
LocationKey string `json:"locationKey"`
}
Schema for the `PermissionDecisionApprovedForLocation` type. Experimental: PermissionDecisionApprovedForLocation is part of an experimental API and may change or be removed.
func (PermissionDecisionApprovedForLocation) Kind ¶ added in v1.0.0
func (PermissionDecisionApprovedForLocation) Kind() PermissionDecisionKind
func (PermissionDecisionApprovedForLocation) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApprovedForLocation) MarshalJSON() ([]byte, error)
func (*PermissionDecisionApprovedForLocation) UnmarshalJSON ¶ added in v1.0.0
func (r *PermissionDecisionApprovedForLocation) UnmarshalJSON(data []byte) error
type PermissionDecisionApprovedForSession ¶ added in v1.0.0
type PermissionDecisionApprovedForSession struct {
// The approval to add as a session-scoped rule
Approval UserToolSessionApproval `json:"approval"`
}
Schema for the `PermissionDecisionApprovedForSession` type. Experimental: PermissionDecisionApprovedForSession is part of an experimental API and may change or be removed.
func (PermissionDecisionApprovedForSession) Kind ¶ added in v1.0.0
func (PermissionDecisionApprovedForSession) Kind() PermissionDecisionKind
func (PermissionDecisionApprovedForSession) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionApprovedForSession) MarshalJSON() ([]byte, error)
func (*PermissionDecisionApprovedForSession) UnmarshalJSON ¶ added in v1.0.0
func (r *PermissionDecisionApprovedForSession) UnmarshalJSON(data []byte) error
type PermissionDecisionCancelled ¶ added in v1.0.0
type PermissionDecisionCancelled struct {
// Optional explanation of why the request was cancelled
Reason *string `json:"reason,omitempty"`
}
Schema for the `PermissionDecisionCancelled` type. Experimental: PermissionDecisionCancelled is part of an experimental API and may change or be removed.
func (PermissionDecisionCancelled) Kind ¶ added in v1.0.0
func (PermissionDecisionCancelled) Kind() PermissionDecisionKind
func (PermissionDecisionCancelled) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionCancelled) MarshalJSON() ([]byte, error)
type PermissionDecisionDeniedByContentExclusionPolicy ¶ added in v1.0.0
type PermissionDecisionDeniedByContentExclusionPolicy struct {
// Human-readable explanation of why the path was excluded
Message string `json:"message"`
// File path that triggered the exclusion
Path string `json:"path"`
}
Schema for the `PermissionDecisionDeniedByContentExclusionPolicy` type. Experimental: PermissionDecisionDeniedByContentExclusionPolicy is part of an experimental API and may change or be removed.
func (PermissionDecisionDeniedByContentExclusionPolicy) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionDeniedByContentExclusionPolicy) MarshalJSON() ([]byte, error)
type PermissionDecisionDeniedByPermissionRequestHook ¶ added in v1.0.0
type PermissionDecisionDeniedByPermissionRequestHook struct {
// Whether to interrupt the current agent turn
Interrupt *bool `json:"interrupt,omitempty"`
// Optional message from the hook explaining the denial
Message *string `json:"message,omitempty"`
}
Schema for the `PermissionDecisionDeniedByPermissionRequestHook` type. Experimental: PermissionDecisionDeniedByPermissionRequestHook is part of an experimental API and may change or be removed.
func (PermissionDecisionDeniedByPermissionRequestHook) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionDeniedByPermissionRequestHook) MarshalJSON() ([]byte, error)
type PermissionDecisionDeniedByRules ¶ added in v1.0.0
type PermissionDecisionDeniedByRules struct {
// Rules that denied the request
Rules []PermissionRule `json:"rules"`
}
Schema for the `PermissionDecisionDeniedByRules` type. Experimental: PermissionDecisionDeniedByRules is part of an experimental API and may change or be removed.
func (PermissionDecisionDeniedByRules) Kind ¶ added in v1.0.0
func (PermissionDecisionDeniedByRules) Kind() PermissionDecisionKind
func (PermissionDecisionDeniedByRules) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionDeniedByRules) MarshalJSON() ([]byte, error)
type PermissionDecisionDeniedInteractivelyByUser ¶ added in v1.0.0
type PermissionDecisionDeniedInteractivelyByUser struct {
// Optional feedback from the user explaining the denial
Feedback *string `json:"feedback,omitempty"`
// Whether to force-reject the current agent turn
ForceReject *bool `json:"forceReject,omitempty"`
}
Schema for the `PermissionDecisionDeniedInteractivelyByUser` type. Experimental: PermissionDecisionDeniedInteractivelyByUser is part of an experimental API and may change or be removed.
func (PermissionDecisionDeniedInteractivelyByUser) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionDeniedInteractivelyByUser) MarshalJSON() ([]byte, error)
type PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser ¶ added in v1.0.0
type PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser struct {
}
Schema for the `PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type. Experimental: PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser is part of an experimental API and may change or be removed.
func (PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser) MarshalJSON() ([]byte, error)
type PermissionDecisionKind ¶ added in v0.3.0
type PermissionDecisionKind string
Kind discriminator for PermissionDecision.
const ( PermissionDecisionKindApproved PermissionDecisionKind = "approved" PermissionDecisionKindApprovedForLocation PermissionDecisionKind = "approved-for-location" PermissionDecisionKindApprovedForSession PermissionDecisionKind = "approved-for-session" PermissionDecisionKindApproveForLocation PermissionDecisionKind = "approve-for-location" PermissionDecisionKindApproveForSession PermissionDecisionKind = "approve-for-session" PermissionDecisionKindApproveOnce PermissionDecisionKind = "approve-once" PermissionDecisionKindApprovePermanently PermissionDecisionKind = "approve-permanently" PermissionDecisionKindCancelled PermissionDecisionKind = "cancelled" PermissionDecisionKindDeniedByContentExclusionPolicy PermissionDecisionKind = "denied-by-content-exclusion-policy" PermissionDecisionKindDeniedByPermissionRequestHook PermissionDecisionKind = "denied-by-permission-request-hook" PermissionDecisionKindDeniedByRules PermissionDecisionKind = "denied-by-rules" PermissionDecisionKindDeniedInteractivelyByUser PermissionDecisionKind = "denied-interactively-by-user" PermissionDecisionKindDeniedNoApprovalRuleAndCouldNotRequestFromUser PermissionDecisionKind = "denied-no-approval-rule-and-could-not-request-from-user" PermissionDecisionKindReject PermissionDecisionKind = "reject" PermissionDecisionKindUserNotAvailable PermissionDecisionKind = "user-not-available" )
type PermissionDecisionNoResult ¶ added in v1.0.0
type PermissionDecisionNoResult struct{}
PermissionDecisionNoResult is an SDK-only PermissionDecision value returned by a permission handler when it declines to respond to a request, allowing another connected client to answer instead. The SDK suppresses the response on the wire when it sees this variant.
func (PermissionDecisionNoResult) Kind ¶ added in v1.0.0
func (PermissionDecisionNoResult) Kind() PermissionDecisionKind
func (PermissionDecisionNoResult) MarshalJSON ¶ added in v1.0.0
func (PermissionDecisionNoResult) MarshalJSON() ([]byte, error)
MarshalJSON emits {"kind":"no-result"} for serialization symmetry with the other PermissionDecision variants. The SDK normally suppresses this value before it reaches the wire, but a stable representation is useful for tests and logging.
type PermissionDecisionReject ¶ added in v0.3.0
type PermissionDecisionReject struct {
// Optional feedback explaining the rejection
Feedback *string `json:"feedback,omitempty"`
}
Schema for the `PermissionDecisionReject` type. Experimental: PermissionDecisionReject is part of an experimental API and may change or be removed.
func (PermissionDecisionReject) Kind ¶ added in v0.3.0
func (PermissionDecisionReject) Kind() PermissionDecisionKind
func (PermissionDecisionReject) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionReject) MarshalJSON() ([]byte, error)
type PermissionDecisionRequest ¶ added in v0.3.0
type PermissionDecisionRequest struct {
// Request ID of the pending permission request
RequestID string `json:"requestId"`
// The client's response to the pending permission prompt
Result PermissionDecision `json:"result"`
}
Pending permission request ID and the decision to apply (approve/reject and scope). Experimental: PermissionDecisionRequest is part of an experimental API and may change or be removed.
func (*PermissionDecisionRequest) UnmarshalJSON ¶ added in v1.0.0
func (r *PermissionDecisionRequest) UnmarshalJSON(data []byte) error
type PermissionDecisionUserNotAvailable ¶ added in v0.3.0
type PermissionDecisionUserNotAvailable struct {
}
Schema for the `PermissionDecisionUserNotAvailable` type. Experimental: PermissionDecisionUserNotAvailable is part of an experimental API and may change or be removed.
func (PermissionDecisionUserNotAvailable) Kind ¶ added in v0.3.0
func (PermissionDecisionUserNotAvailable) Kind() PermissionDecisionKind
func (PermissionDecisionUserNotAvailable) MarshalJSON ¶ added in v1.0.0
func (r PermissionDecisionUserNotAvailable) MarshalJSON() ([]byte, error)
type PermissionDeniedByContentExclusionPolicy ¶ added in v1.0.0
type PermissionDeniedByContentExclusionPolicy struct {
// Human-readable explanation of why the path was excluded
Message string `json:"message"`
// File path that triggered the exclusion
Path string `json:"path"`
}
Schema for the `PermissionDeniedByContentExclusionPolicy` type.
func (PermissionDeniedByContentExclusionPolicy) Kind ¶ added in v1.0.0
func (PermissionDeniedByContentExclusionPolicy) Kind() PermissionResultKind
func (PermissionDeniedByContentExclusionPolicy) MarshalJSON ¶ added in v1.0.0
func (r PermissionDeniedByContentExclusionPolicy) MarshalJSON() ([]byte, error)
type PermissionDeniedByPermissionRequestHook ¶ added in v1.0.0
type PermissionDeniedByPermissionRequestHook struct {
// Whether to interrupt the current agent turn
Interrupt *bool `json:"interrupt,omitempty"`
// Optional message from the hook explaining the denial
Message *string `json:"message,omitempty"`
}
Schema for the `PermissionDeniedByPermissionRequestHook` type.
func (PermissionDeniedByPermissionRequestHook) Kind ¶ added in v1.0.0
func (PermissionDeniedByPermissionRequestHook) Kind() PermissionResultKind
func (PermissionDeniedByPermissionRequestHook) MarshalJSON ¶ added in v1.0.0
func (r PermissionDeniedByPermissionRequestHook) MarshalJSON() ([]byte, error)
type PermissionDeniedByRules ¶ added in v1.0.0
type PermissionDeniedByRules struct {
// Rules that denied the request
Rules []PermissionRule `json:"rules"`
}
Schema for the `PermissionDeniedByRules` type.
func (PermissionDeniedByRules) Kind ¶ added in v1.0.0
func (PermissionDeniedByRules) Kind() PermissionResultKind
func (PermissionDeniedByRules) MarshalJSON ¶ added in v1.0.0
func (r PermissionDeniedByRules) MarshalJSON() ([]byte, error)
type PermissionDeniedInteractivelyByUser ¶ added in v1.0.0
type PermissionDeniedInteractivelyByUser struct {
// Optional feedback from the user explaining the denial
Feedback *string `json:"feedback,omitempty"`
// Whether to force-reject the current agent turn
ForceReject *bool `json:"forceReject,omitempty"`
}
Schema for the `PermissionDeniedInteractivelyByUser` type.
func (PermissionDeniedInteractivelyByUser) Kind ¶ added in v1.0.0
func (PermissionDeniedInteractivelyByUser) Kind() PermissionResultKind
func (PermissionDeniedInteractivelyByUser) MarshalJSON ¶ added in v1.0.0
func (r PermissionDeniedInteractivelyByUser) MarshalJSON() ([]byte, error)
type PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser ¶ added in v1.0.0
type PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser struct {
}
Schema for the `PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type.
func (PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser) MarshalJSON ¶ added in v1.0.0
func (r PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser) MarshalJSON() ([]byte, error)
type PermissionLocationAddToolApprovalParams ¶ added in v1.0.0
type PermissionLocationAddToolApprovalParams struct {
// Tool approval to persist and apply
Approval PermissionsLocationsAddToolApprovalDetails `json:"approval"`
// Location key (git root or cwd) to persist the approval to
LocationKey string `json:"locationKey"`
}
Location-scoped tool approval to persist. Experimental: PermissionLocationAddToolApprovalParams is part of an experimental API and may change or be removed.
func (*PermissionLocationAddToolApprovalParams) UnmarshalJSON ¶ added in v1.0.0
func (r *PermissionLocationAddToolApprovalParams) UnmarshalJSON(data []byte) error
type PermissionLocationApplyParams ¶ added in v1.0.0
type PermissionLocationApplyParams struct {
// Working directory whose persisted location permissions should be applied
WorkingDirectory string `json:"workingDirectory"`
}
Working directory to load persisted location permissions for. Experimental: PermissionLocationApplyParams is part of an experimental API and may change or be removed.
type PermissionLocationApplyResult ¶ added in v1.0.0
type PermissionLocationApplyResult struct {
// Number of persisted allowed directories added to the live path manager
AppliedDirectoryCount int64 `json:"appliedDirectoryCount"`
// Number of location-scoped rules added to the live permission service
AppliedRuleCount int64 `json:"appliedRuleCount"`
// Location-scoped rules applied to the live permission service
AppliedRules []PermissionRule `json:"appliedRules"`
// Whether a different location was applied since the previous apply call
Changed bool `json:"changed"`
// Location key used in the location-permissions store
LocationKey string `json:"locationKey"`
// Whether the location is a git repo or directory
LocationType PermissionLocationType `json:"locationType"`
}
Summary of persisted location permissions applied to the session. Experimental: PermissionLocationApplyResult is part of an experimental API and may change or be removed.
type PermissionLocationResolveParams ¶ added in v1.0.0
type PermissionLocationResolveParams struct {
// Working directory whose permission location should be resolved
WorkingDirectory string `json:"workingDirectory"`
}
Working directory to resolve into a location-permissions key. Experimental: PermissionLocationResolveParams is part of an experimental API and may change or be removed.
type PermissionLocationResolveResult ¶ added in v1.0.0
type PermissionLocationResolveResult struct {
// Location key used in the location-permissions store
LocationKey string `json:"locationKey"`
// Whether the location is a git repo or directory
LocationType PermissionLocationType `json:"locationType"`
}
Resolved location-permissions key and type. Experimental: PermissionLocationResolveResult is part of an experimental API and may change or be removed.
type PermissionLocationType ¶ added in v1.0.0
type PermissionLocationType string
Whether the location is a git repo or directory Experimental: PermissionLocationType is part of an experimental API and may change or be removed.
const ( // The permission location is persisted at the working directory. PermissionLocationTypeDir PermissionLocationType = "dir" // The permission location is persisted at the git repository root. PermissionLocationTypeRepo PermissionLocationType = "repo" )
type PermissionPathsAddParams ¶ added in v1.0.0
type PermissionPathsAddParams struct {
// Directory to add to the allow-list. The runtime resolves and validates the path before
// adding.
Path string `json:"path"`
}
Directory path to add to the session's allowed directories. Experimental: PermissionPathsAddParams is part of an experimental API and may change or be removed.
type PermissionPathsAllowedCheckParams ¶ added in v1.0.0
type PermissionPathsAllowedCheckParams struct {
// Path to check against the session's allowed directories
Path string `json:"path"`
}
Path to evaluate against the session's allowed directories. Experimental: PermissionPathsAllowedCheckParams is part of an experimental API and may change or be removed.
type PermissionPathsAllowedCheckResult ¶ added in v1.0.0
type PermissionPathsAllowedCheckResult struct {
// Whether the path is within the session's allowed directories
Allowed bool `json:"allowed"`
}
Indicates whether the supplied path is within the session's allowed directories. Experimental: PermissionPathsAllowedCheckResult is part of an experimental API and may change or be removed.
type PermissionPathsConfig ¶ added in v1.0.0
type PermissionPathsConfig struct {
// 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).
AdditionalDirectories []string `json:"additionalDirectories,omitzero"`
// Whether to include the system temp directory in the allowed list (defaults to true).
// Ignored when `unrestricted` is true.
IncludeTempDirectory *bool `json:"includeTempDirectory,omitempty"`
// If true, the runtime allows access to all paths without prompting. Equivalent to
// constructing an UnrestrictedPathManager.
Unrestricted *bool `json:"unrestricted,omitempty"`
// Workspace root path (special-cased to be allowed even before the directory exists).
// Ignored when `unrestricted` is true.
WorkspacePath *string `json:"workspacePath,omitempty"`
}
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: PermissionPathsConfig is part of an experimental API and may change or be removed.
type PermissionPathsList ¶ added in v1.0.0
type PermissionPathsList struct {
// All directories currently allowed for tool access on this session.
Directories []string `json:"directories"`
// The primary working directory for this session.
Primary string `json:"primary"`
}
Snapshot of the session's allow-listed directories and primary working directory. Experimental: PermissionPathsList is part of an experimental API and may change or be removed.
type PermissionPathsUpdatePrimaryParams ¶ added in v1.0.0
type PermissionPathsUpdatePrimaryParams struct {
// Directory to set as the new primary working directory for the session's permission policy.
Path string `json:"path"`
}
Directory path to set as the session's new primary working directory. Experimental: PermissionPathsUpdatePrimaryParams is part of an experimental API and may change or be removed.
type PermissionPathsWorkspaceCheckParams ¶ added in v1.0.0
type PermissionPathsWorkspaceCheckParams struct {
// Path to check against the session workspace directory
Path string `json:"path"`
}
Path to evaluate against the session's workspace (primary) directory. Experimental: PermissionPathsWorkspaceCheckParams is part of an experimental API and may change or be removed.
type PermissionPathsWorkspaceCheckResult ¶ added in v1.0.0
type PermissionPathsWorkspaceCheckResult struct {
// Whether the path is within the session workspace directory
Allowed bool `json:"allowed"`
}
Indicates whether the supplied path is within the session's workspace directory. Experimental: PermissionPathsWorkspaceCheckResult is part of an experimental API and may change or be removed.
type PermissionPromptRequest ¶ added in v1.0.0
type PermissionPromptRequest interface {
Kind() PermissionPromptRequestKind
// contains filtered or unexported methods
}
Derived user-facing permission prompt details for UI consumers
type PermissionPromptRequestCommands ¶ added in v1.0.0
type PermissionPromptRequestCommands struct {
// Whether the UI can offer session-wide approval for this command pattern
CanOfferSessionApproval bool `json:"canOfferSessionApproval"`
// Command identifiers covered by this approval prompt
CommandIdentifiers []string `json:"commandIdentifiers"`
// The complete shell command text to be executed
FullCommandText string `json:"fullCommandText"`
// Human-readable description of what the command intends to do
Intention string `json:"intention"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
// Optional warning message about risks of running this command
Warning *string `json:"warning,omitempty"`
}
Shell command permission prompt
func (PermissionPromptRequestCommands) Kind ¶ added in v1.0.0
func (PermissionPromptRequestCommands) Kind() PermissionPromptRequestKind
func (PermissionPromptRequestCommands) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestCommands) MarshalJSON() ([]byte, error)
type PermissionPromptRequestCustomTool ¶ added in v1.0.0
type PermissionPromptRequestCustomTool struct {
// Arguments to pass to the custom tool
Args any `json:"args,omitempty"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
// Description of what the custom tool does
ToolDescription string `json:"toolDescription"`
// Name of the custom tool
ToolName string `json:"toolName"`
}
Custom tool invocation permission prompt
func (PermissionPromptRequestCustomTool) Kind ¶ added in v1.0.0
func (PermissionPromptRequestCustomTool) Kind() PermissionPromptRequestKind
func (PermissionPromptRequestCustomTool) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestCustomTool) MarshalJSON() ([]byte, error)
type PermissionPromptRequestExtensionManagement ¶ added in v1.0.0
type PermissionPromptRequestExtensionManagement struct {
// Name of the extension being managed
ExtensionName *string `json:"extensionName,omitempty"`
// The extension management operation (scaffold, reload)
Operation string `json:"operation"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
Extension management permission prompt
func (PermissionPromptRequestExtensionManagement) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestExtensionManagement) MarshalJSON() ([]byte, error)
type PermissionPromptRequestExtensionPermissionAccess ¶ added in v1.0.0
type PermissionPromptRequestExtensionPermissionAccess struct {
// Capabilities the extension is requesting
Capabilities []string `json:"capabilities"`
// Name of the extension requesting permission access
ExtensionName string `json:"extensionName"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
Extension permission access prompt
func (PermissionPromptRequestExtensionPermissionAccess) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestExtensionPermissionAccess) MarshalJSON() ([]byte, error)
type PermissionPromptRequestHook ¶ added in v1.0.0
type PermissionPromptRequestHook struct {
// Optional message from the hook explaining why confirmation is needed
HookMessage *string `json:"hookMessage,omitempty"`
// Arguments of the tool call being gated
ToolArgs any `json:"toolArgs,omitempty"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
// Name of the tool the hook is gating
ToolName string `json:"toolName"`
}
Hook confirmation permission prompt
func (PermissionPromptRequestHook) Kind ¶ added in v1.0.0
func (PermissionPromptRequestHook) Kind() PermissionPromptRequestKind
func (PermissionPromptRequestHook) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestHook) MarshalJSON() ([]byte, error)
type PermissionPromptRequestKind ¶ added in v1.0.0
type PermissionPromptRequestKind string
Kind discriminator for PermissionPromptRequest.
const ( PermissionPromptRequestKindCommands PermissionPromptRequestKind = "commands" PermissionPromptRequestKindCustomTool PermissionPromptRequestKind = "custom-tool" PermissionPromptRequestKindExtensionManagement PermissionPromptRequestKind = "extension-management" PermissionPromptRequestKindExtensionPermissionAccess PermissionPromptRequestKind = "extension-permission-access" PermissionPromptRequestKindHook PermissionPromptRequestKind = "hook" PermissionPromptRequestKindMCP PermissionPromptRequestKind = "mcp" PermissionPromptRequestKindMemory PermissionPromptRequestKind = "memory" PermissionPromptRequestKindPath PermissionPromptRequestKind = "path" PermissionPromptRequestKindRead PermissionPromptRequestKind = "read" PermissionPromptRequestKindURL PermissionPromptRequestKind = "url" PermissionPromptRequestKindWrite PermissionPromptRequestKind = "write" )
type PermissionPromptRequestMCP ¶ added in v1.0.0
type PermissionPromptRequestMCP struct {
// Arguments to pass to the MCP tool
Args *any `json:"args,omitempty"`
// Name of the MCP server providing the tool
ServerName string `json:"serverName"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
// Internal name of the MCP tool
ToolName string `json:"toolName"`
// Human-readable title of the MCP tool
ToolTitle string `json:"toolTitle"`
}
MCP tool invocation permission prompt
func (PermissionPromptRequestMCP) Kind ¶ added in v1.0.0
func (PermissionPromptRequestMCP) Kind() PermissionPromptRequestKind
func (PermissionPromptRequestMCP) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestMCP) MarshalJSON() ([]byte, error)
type PermissionPromptRequestMemory ¶ added in v1.0.0
type PermissionPromptRequestMemory struct {
// Whether this is a store or vote memory operation
Action *PermissionRequestMemoryAction `json:"action,omitempty"`
// Source references for the stored fact (store only)
Citations *string `json:"citations,omitempty"`
// Vote direction (vote only)
Direction *PermissionRequestMemoryDirection `json:"direction,omitempty"`
// The fact being stored or voted on
Fact string `json:"fact"`
// Reason for the vote (vote only)
Reason *string `json:"reason,omitempty"`
// Topic or subject of the memory (store only)
Subject *string `json:"subject,omitempty"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
Memory operation permission prompt
func (PermissionPromptRequestMemory) Kind ¶ added in v1.0.0
func (PermissionPromptRequestMemory) Kind() PermissionPromptRequestKind
func (PermissionPromptRequestMemory) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestMemory) MarshalJSON() ([]byte, error)
type PermissionPromptRequestPath ¶ added in v1.0.0
type PermissionPromptRequestPath struct {
// Underlying permission kind that needs path approval
AccessKind PermissionPromptRequestPathAccessKind `json:"accessKind"`
// File paths that require explicit approval
Paths []string `json:"paths"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
Path access permission prompt
func (PermissionPromptRequestPath) Kind ¶ added in v1.0.0
func (PermissionPromptRequestPath) Kind() PermissionPromptRequestKind
func (PermissionPromptRequestPath) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestPath) MarshalJSON() ([]byte, error)
type PermissionPromptRequestPathAccessKind ¶ added in v1.0.0
type PermissionPromptRequestPathAccessKind string
Underlying permission kind that needs path approval
const ( // Read access to a filesystem path. PermissionPromptRequestPathAccessKindRead PermissionPromptRequestPathAccessKind = "read" // Shell command access involving a filesystem path. PermissionPromptRequestPathAccessKindShell PermissionPromptRequestPathAccessKind = "shell" // Write access to a filesystem path. PermissionPromptRequestPathAccessKindWrite PermissionPromptRequestPathAccessKind = "write" )
type PermissionPromptRequestRead ¶ added in v1.0.0
type PermissionPromptRequestRead struct {
// Human-readable description of why the file is being read
Intention string `json:"intention"`
// Path of the file or directory being read
Path string `json:"path"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
File read permission prompt
func (PermissionPromptRequestRead) Kind ¶ added in v1.0.0
func (PermissionPromptRequestRead) Kind() PermissionPromptRequestKind
func (PermissionPromptRequestRead) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestRead) MarshalJSON() ([]byte, error)
type PermissionPromptRequestURL ¶ added in v1.0.0
type PermissionPromptRequestURL struct {
// Human-readable description of why the URL is being accessed
Intention string `json:"intention"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
// URL to be fetched
URL string `json:"url"`
}
URL access permission prompt
func (PermissionPromptRequestURL) Kind ¶ added in v1.0.0
func (PermissionPromptRequestURL) Kind() PermissionPromptRequestKind
func (PermissionPromptRequestURL) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestURL) MarshalJSON() ([]byte, error)
type PermissionPromptRequestWrite ¶ added in v1.0.0
type PermissionPromptRequestWrite struct {
// Whether the UI can offer session-wide approval for file write operations
CanOfferSessionApproval bool `json:"canOfferSessionApproval"`
// Unified diff showing the proposed changes
Diff string `json:"diff"`
// Path of the file being written to
FileName string `json:"fileName"`
// Human-readable description of the intended file change
Intention string `json:"intention"`
// Complete new file contents for newly created files
NewFileContents *string `json:"newFileContents,omitempty"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
File write permission prompt
func (PermissionPromptRequestWrite) Kind ¶ added in v1.0.0
func (PermissionPromptRequestWrite) Kind() PermissionPromptRequestKind
func (PermissionPromptRequestWrite) MarshalJSON ¶ added in v1.0.0
func (r PermissionPromptRequestWrite) MarshalJSON() ([]byte, error)
type PermissionPromptShownNotification ¶ added in v1.0.0
type PermissionPromptShownNotification struct {
// 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).
Message string `json:"message"`
}
Notification payload describing the permission prompt that the client just rendered. Experimental: PermissionPromptShownNotification is part of an experimental API and may change or be removed.
type PermissionRequest ¶ added in v1.0.0
type PermissionRequest interface {
Kind() PermissionRequestKind
// contains filtered or unexported methods
}
Details of the permission being requested
type PermissionRequestCommand ¶ added in v1.0.0
type PermissionRequestCommand = PermissionRequestShellCommand
Type aliases for convenience.
type PermissionRequestCustomTool ¶ added in v1.0.0
type PermissionRequestCustomTool struct {
// Arguments to pass to the custom tool
Args any `json:"args,omitempty"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
// Description of what the custom tool does
ToolDescription string `json:"toolDescription"`
// Name of the custom tool
ToolName string `json:"toolName"`
}
Custom tool invocation permission request
func (PermissionRequestCustomTool) Kind ¶ added in v1.0.0
func (PermissionRequestCustomTool) Kind() PermissionRequestKind
func (PermissionRequestCustomTool) MarshalJSON ¶ added in v1.0.0
func (r PermissionRequestCustomTool) MarshalJSON() ([]byte, error)
type PermissionRequestExtensionManagement ¶ added in v1.0.0
type PermissionRequestExtensionManagement struct {
// Name of the extension being managed
ExtensionName *string `json:"extensionName,omitempty"`
// The extension management operation (scaffold, reload)
Operation string `json:"operation"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
Extension management permission request
func (PermissionRequestExtensionManagement) Kind ¶ added in v1.0.0
func (PermissionRequestExtensionManagement) Kind() PermissionRequestKind
func (PermissionRequestExtensionManagement) MarshalJSON ¶ added in v1.0.0
func (r PermissionRequestExtensionManagement) MarshalJSON() ([]byte, error)
type PermissionRequestExtensionPermissionAccess ¶ added in v1.0.0
type PermissionRequestExtensionPermissionAccess struct {
// Capabilities the extension is requesting
Capabilities []string `json:"capabilities"`
// Name of the extension requesting permission access
ExtensionName string `json:"extensionName"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
Extension permission access request
func (PermissionRequestExtensionPermissionAccess) MarshalJSON ¶ added in v1.0.0
func (r PermissionRequestExtensionPermissionAccess) MarshalJSON() ([]byte, error)
type PermissionRequestHook ¶ added in v1.0.0
type PermissionRequestHook struct {
// Optional message from the hook explaining why confirmation is needed
HookMessage *string `json:"hookMessage,omitempty"`
// Arguments of the tool call being gated
ToolArgs any `json:"toolArgs,omitempty"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
// Name of the tool the hook is gating
ToolName string `json:"toolName"`
}
Hook confirmation permission request
func (PermissionRequestHook) Kind ¶ added in v1.0.0
func (PermissionRequestHook) Kind() PermissionRequestKind
func (PermissionRequestHook) MarshalJSON ¶ added in v1.0.0
func (r PermissionRequestHook) MarshalJSON() ([]byte, error)
type PermissionRequestKind ¶ added in v1.0.0
type PermissionRequestKind string
Kind discriminator for PermissionRequest.
const ( PermissionRequestKindCustomTool PermissionRequestKind = "custom-tool" PermissionRequestKindExtensionManagement PermissionRequestKind = "extension-management" PermissionRequestKindExtensionPermissionAccess PermissionRequestKind = "extension-permission-access" PermissionRequestKindHook PermissionRequestKind = "hook" PermissionRequestKindMCP PermissionRequestKind = "mcp" PermissionRequestKindMemory PermissionRequestKind = "memory" PermissionRequestKindRead PermissionRequestKind = "read" PermissionRequestKindShell PermissionRequestKind = "shell" PermissionRequestKindURL PermissionRequestKind = "url" PermissionRequestKindWrite PermissionRequestKind = "write" )
type PermissionRequestMCP ¶ added in v1.0.0
type PermissionRequestMCP struct {
// Arguments to pass to the MCP tool
Args any `json:"args,omitempty"`
// Whether this MCP tool is read-only (no side effects)
ReadOnly bool `json:"readOnly"`
// Name of the MCP server providing the tool
ServerName string `json:"serverName"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
// Internal name of the MCP tool
ToolName string `json:"toolName"`
// Human-readable title of the MCP tool
ToolTitle string `json:"toolTitle"`
}
MCP tool invocation permission request
func (PermissionRequestMCP) Kind ¶ added in v1.0.0
func (PermissionRequestMCP) Kind() PermissionRequestKind
func (PermissionRequestMCP) MarshalJSON ¶ added in v1.0.0
func (r PermissionRequestMCP) MarshalJSON() ([]byte, error)
type PermissionRequestMemory ¶ added in v1.0.0
type PermissionRequestMemory struct {
// Whether this is a store or vote memory operation
Action *PermissionRequestMemoryAction `json:"action,omitempty"`
// Source references for the stored fact (store only)
Citations *string `json:"citations,omitempty"`
// Vote direction (vote only)
Direction *PermissionRequestMemoryDirection `json:"direction,omitempty"`
// The fact being stored or voted on
Fact string `json:"fact"`
// Reason for the vote (vote only)
Reason *string `json:"reason,omitempty"`
// Topic or subject of the memory (store only)
Subject *string `json:"subject,omitempty"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
Memory operation permission request
func (PermissionRequestMemory) Kind ¶ added in v1.0.0
func (PermissionRequestMemory) Kind() PermissionRequestKind
func (PermissionRequestMemory) MarshalJSON ¶ added in v1.0.0
func (r PermissionRequestMemory) MarshalJSON() ([]byte, error)
type PermissionRequestMemoryAction ¶ added in v1.0.0
type PermissionRequestMemoryAction string
Whether this is a store or vote memory operation
const ( // Store a new memory. PermissionRequestMemoryActionStore PermissionRequestMemoryAction = "store" // Vote on an existing memory. PermissionRequestMemoryActionVote PermissionRequestMemoryAction = "vote" )
type PermissionRequestMemoryDirection ¶ added in v1.0.0
type PermissionRequestMemoryDirection string
Vote direction (vote only)
const ( // Vote that the memory is incorrect or outdated. PermissionRequestMemoryDirectionDownvote PermissionRequestMemoryDirection = "downvote" // Vote that the memory is useful or accurate. PermissionRequestMemoryDirectionUpvote PermissionRequestMemoryDirection = "upvote" )
type PermissionRequestRead ¶ added in v1.0.0
type PermissionRequestRead struct {
// Human-readable description of why the file is being read
Intention string `json:"intention"`
// Path of the file or directory being read
Path string `json:"path"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
File or directory read permission request
func (PermissionRequestRead) Kind ¶ added in v1.0.0
func (PermissionRequestRead) Kind() PermissionRequestKind
func (PermissionRequestRead) MarshalJSON ¶ added in v1.0.0
func (r PermissionRequestRead) MarshalJSON() ([]byte, error)
type PermissionRequestResult ¶ added in v0.3.0
type PermissionRequestResult struct {
// Whether the permission request was handled successfully
Success bool `json:"success"`
}
Indicates whether the permission decision was applied; false when the request was already resolved. Experimental: PermissionRequestResult is part of an experimental API and may change or be removed.
type PermissionRequestShell ¶ added in v1.0.0
type PermissionRequestShell struct {
// Whether the UI can offer session-wide approval for this command pattern
CanOfferSessionApproval bool `json:"canOfferSessionApproval"`
// Parsed command identifiers found in the command text
Commands []PermissionRequestShellCommand `json:"commands"`
// The complete shell command text to be executed
FullCommandText string `json:"fullCommandText"`
// Whether the command includes a file write redirection (e.g., > or >>)
HasWriteFileRedirection bool `json:"hasWriteFileRedirection"`
// Human-readable description of what the command intends to do
Intention string `json:"intention"`
// File paths that may be read or written by the command
PossiblePaths []string `json:"possiblePaths"`
// URLs that may be accessed by the command
PossibleURLs []PermissionRequestShellPossibleURL `json:"possibleUrls"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
// Optional warning message about risks of running this command
Warning *string `json:"warning,omitempty"`
}
Shell command permission request
func (PermissionRequestShell) Kind ¶ added in v1.0.0
func (PermissionRequestShell) Kind() PermissionRequestKind
func (PermissionRequestShell) MarshalJSON ¶ added in v1.0.0
func (r PermissionRequestShell) MarshalJSON() ([]byte, error)
type PermissionRequestShellCommand ¶ added in v1.0.0
type PermissionRequestShellCommand struct {
// Command identifier (e.g., executable name)
Identifier string `json:"identifier"`
// Whether this command is read-only (no side effects)
ReadOnly bool `json:"readOnly"`
}
Schema for the `PermissionRequestShellCommand` type.
type PermissionRequestShellPossibleURL ¶ added in v1.0.0
type PermissionRequestShellPossibleURL struct {
// URL that may be accessed by the command
URL string `json:"url"`
}
Schema for the `PermissionRequestShellPossibleUrl` type.
type PermissionRequestURL ¶ added in v1.0.0
type PermissionRequestURL struct {
// Human-readable description of why the URL is being accessed
Intention string `json:"intention"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
// URL to be fetched
URL string `json:"url"`
}
URL access permission request
func (PermissionRequestURL) Kind ¶ added in v1.0.0
func (PermissionRequestURL) Kind() PermissionRequestKind
func (PermissionRequestURL) MarshalJSON ¶ added in v1.0.0
func (r PermissionRequestURL) MarshalJSON() ([]byte, error)
type PermissionRequestWrite ¶ added in v1.0.0
type PermissionRequestWrite struct {
// Whether the UI can offer session-wide approval for file write operations
CanOfferSessionApproval bool `json:"canOfferSessionApproval"`
// Unified diff showing the proposed changes
Diff string `json:"diff"`
// Path of the file being written to
FileName string `json:"fileName"`
// Human-readable description of the intended file change
Intention string `json:"intention"`
// Complete new file contents for newly created files
NewFileContents *string `json:"newFileContents,omitempty"`
// Tool call ID that triggered this permission request
ToolCallID *string `json:"toolCallId,omitempty"`
}
File write permission request
func (PermissionRequestWrite) Kind ¶ added in v1.0.0
func (PermissionRequestWrite) Kind() PermissionRequestKind
func (PermissionRequestWrite) MarshalJSON ¶ added in v1.0.0
func (r PermissionRequestWrite) MarshalJSON() ([]byte, error)
type PermissionRequestedData ¶ added in v1.0.0
type PermissionRequestedData struct {
// Details of the permission being requested
PermissionRequest PermissionRequest `json:"permissionRequest"`
// Derived user-facing permission prompt details for UI consumers
PromptRequest PermissionPromptRequest `json:"promptRequest,omitempty"`
// Unique identifier for this permission request; used to respond via session.respondToPermission()
RequestID string `json:"requestId"`
// When true, this permission was already resolved by a permissionRequest hook and requires no client action
ResolvedByHook *bool `json:"resolvedByHook,omitempty"`
}
Permission request notification requiring client approval with request details
func (*PermissionRequestedData) Type ¶ added in v1.0.0
func (*PermissionRequestedData) Type() SessionEventType
func (*PermissionRequestedData) UnmarshalJSON ¶ added in v1.0.0
func (r *PermissionRequestedData) UnmarshalJSON(data []byte) error
type PermissionResult ¶ added in v1.0.0
type PermissionResult interface {
Kind() PermissionResultKind
// contains filtered or unexported methods
}
The result of the permission request
type PermissionResultKind ¶ added in v1.0.0
type PermissionResultKind string
Kind discriminator for PermissionResult.
const ( PermissionResultKindApproved PermissionResultKind = "approved" PermissionResultKindApprovedForLocation PermissionResultKind = "approved-for-location" PermissionResultKindApprovedForSession PermissionResultKind = "approved-for-session" PermissionResultKindCancelled PermissionResultKind = "cancelled" PermissionResultKindDeniedByContentExclusionPolicy PermissionResultKind = "denied-by-content-exclusion-policy" PermissionResultKindDeniedByPermissionRequestHook PermissionResultKind = "denied-by-permission-request-hook" PermissionResultKindDeniedByRules PermissionResultKind = "denied-by-rules" PermissionResultKindDeniedInteractivelyByUser PermissionResultKind = "denied-interactively-by-user" PermissionResultKindDeniedNoApprovalRuleAndCouldNotRequestFromUser PermissionResultKind = "denied-no-approval-rule-and-could-not-request-from-user" )
type PermissionRule ¶ added in v1.0.0
type PermissionRule struct {
// Argument value matched against the request, or null when the rule kind has no argument
// (e.g. 'read', 'write', 'memory').
Argument *string `json:"argument"`
// The rule kind, such as Shell or GitHubMCP
Kind string `json:"kind"`
}
Schema for the `PermissionRule` type. Experimental: PermissionRule is part of an experimental API and may change or be removed.
type PermissionRulesSet ¶ added in v1.0.0
type PermissionRulesSet struct {
// Rules that auto-approve matching requests
Approved []PermissionRule `json:"approved"`
// Rules that auto-deny matching requests
Denied []PermissionRule `json:"denied"`
}
If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged. Experimental: PermissionRulesSet is part of an experimental API and may change or be removed.
type PermissionURLsConfig ¶ added in v1.0.0
type PermissionURLsConfig struct {
// Initial list of allowed URL/domain patterns. Patterns may include path components.
// Ignored when `unrestricted` is true.
InitialAllowed []string `json:"initialAllowed,omitzero"`
// If true, the runtime allows access to all URLs without prompting. Initial allow-list is
// ignored when this is true.
Unrestricted *bool `json:"unrestricted,omitempty"`
}
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: PermissionURLsConfig is part of an experimental API and may change or be removed.
type PermissionURLsSetUnrestrictedModeParams ¶ added in v1.0.0
type PermissionURLsSetUnrestrictedModeParams struct {
// Whether to allow access to all URLs without prompting. Toggles the runtime's
// URL-permission policy in place.
Enabled bool `json:"enabled"`
}
Whether the URL-permission policy should run in unrestricted mode. Experimental: PermissionURLsSetUnrestrictedModeParams is part of an experimental API and may change or be removed.
type PermissionsAPI ¶ added in v1.0.0
type PermissionsAPI sessionAPI
Experimental: PermissionsAPI contains experimental APIs that may change or be removed.
func (*PermissionsAPI) Configure ¶ added in v1.0.0
func (a *PermissionsAPI) Configure(ctx context.Context, params *PermissionsConfigureParams) (*PermissionsConfigureResult, error)
Configure replaces selected permission policy fields (rules, paths, URLs, exclusions, allow-all flags) on the session.
RPC method: session.permissions.configure.
Parameters: Patch of permission policy fields to apply (omit a field to leave it unchanged).
Returns: Indicates whether the operation succeeded.
func (*PermissionsAPI) FolderTrust ¶ added in v1.0.0
func (s *PermissionsAPI) FolderTrust() *PermissionsFolderTrustAPI
Experimental: FolderTrust returns experimental APIs that may change or be removed.
func (*PermissionsAPI) GetAllowAll ¶ added in v1.0.0
func (a *PermissionsAPI) GetAllowAll(ctx context.Context) (*AllowAllPermissionState, error)
GetAllowAll returns whether full allow-all permissions are currently active for the session.
RPC method: session.permissions.getAllowAll.
Returns: Current full allow-all permission state.
func (*PermissionsAPI) HandlePendingPermissionRequest ¶ added in v1.0.0
func (a *PermissionsAPI) HandlePendingPermissionRequest(ctx context.Context, params *PermissionDecisionRequest) (*PermissionRequestResult, error)
HandlePendingPermissionRequest provides a decision for a pending tool permission request.
RPC method: session.permissions.handlePendingPermissionRequest.
Parameters: Pending permission request ID and the decision to apply (approve/reject and scope).
Returns: Indicates whether the permission decision was applied; false when the request was already resolved.
func (*PermissionsAPI) Locations ¶ added in v1.0.0
func (s *PermissionsAPI) Locations() *PermissionsLocationsAPI
Experimental: Locations returns experimental APIs that may change or be removed.
func (*PermissionsAPI) ModifyRules ¶ added in v1.0.0
func (a *PermissionsAPI) ModifyRules(ctx context.Context, params *PermissionsModifyRulesParams) (*PermissionsModifyRulesResult, error)
ModifyRules adds or removes session-scoped or location-scoped permission rules.
RPC method: session.permissions.modifyRules.
Parameters: Scope and add/remove instructions for modifying session- or location-scoped permission rules.
Returns: Indicates whether the operation succeeded.
func (*PermissionsAPI) NotifyPromptShown ¶ added in v1.0.0
func (a *PermissionsAPI) NotifyPromptShown(ctx context.Context, params *PermissionPromptShownNotification) (*PermissionsNotifyPromptShownResult, error)
NotifyPromptShown notifies the runtime that a permission prompt UI has been shown to the user.
RPC method: session.permissions.notifyPromptShown.
Parameters: Notification payload describing the permission prompt that the client just rendered.
Returns: Indicates whether the operation succeeded.
func (*PermissionsAPI) Paths ¶ added in v1.0.0
func (s *PermissionsAPI) Paths() *PermissionsPathsAPI
Experimental: Paths returns experimental APIs that may change or be removed.
func (*PermissionsAPI) PendingRequests ¶ added in v1.0.0
func (a *PermissionsAPI) PendingRequests(ctx context.Context) (*PendingPermissionRequestList, error)
PendingRequests reconstructs the set of pending tool permission requests from the session's event history.
RPC method: session.permissions.pendingRequests.
Returns: List of pending permission requests reconstructed from event history.
func (*PermissionsAPI) ResetSessionApprovals ¶ added in v1.0.0
func (a *PermissionsAPI) ResetSessionApprovals(ctx context.Context) (*PermissionsResetSessionApprovalsResult, error)
ResetSessionApprovals clears session-scoped tool permission approvals.
RPC method: session.permissions.resetSessionApprovals.
Returns: Indicates whether the operation succeeded.
func (*PermissionsAPI) SetAllowAll ¶ added in v1.0.0
func (a *PermissionsAPI) SetAllowAll(ctx context.Context, params *PermissionsSetAllowAllRequest) (*AllowAllPermissionSetResult, error)
SetAllowAll enables or disables full allow-all permissions (tools, paths, and URLs) for the session. Used by attach-mode clients (e.g. LocalRpcSession's `/allow-all` forwarder) to flip the target session's permission state. Unlike `setApproveAll`, this swaps in the unrestricted path and URL managers and emits `session.permissions_changed` on transition. The result returns the authoritative post-mutation state so callers can update their local mirrors without racing the `session.permissions_changed` notification on the same wire.
RPC method: session.permissions.setAllowAll.
Parameters: Whether to enable full allow-all permissions for the session.
Returns: Indicates whether the operation succeeded and reports the post-mutation state.
func (*PermissionsAPI) SetApproveAll ¶ added in v1.0.0
func (a *PermissionsAPI) SetApproveAll(ctx context.Context, params *PermissionsSetApproveAllRequest) (*PermissionsSetApproveAllResult, error)
SetApproveAll enables or disables automatic approval of tool permission requests for the session.
RPC method: session.permissions.setApproveAll.
Parameters: Allow-all toggle for tool permission requests, with an optional telemetry source.
Returns: Indicates whether the operation succeeded.
func (*PermissionsAPI) SetRequired ¶ added in v1.0.0
func (a *PermissionsAPI) SetRequired(ctx context.Context, params *PermissionsSetRequiredRequest) (*PermissionsSetRequiredResult, error)
SetRequired sets whether the client wants permission prompts bridged into session events.
RPC method: session.permissions.setRequired.
Parameters: Toggles whether permission prompts should be bridged into session events for this client.
Returns: Indicates whether the operation succeeded.
func (*PermissionsAPI) URLs ¶ added in v1.0.0
func (s *PermissionsAPI) URLs() *PermissionsURLsAPI
Experimental: URLs returns experimental APIs that may change or be removed.
type PermissionsConfigureAdditionalContentExclusionPolicy ¶ added in v1.0.0
type PermissionsConfigureAdditionalContentExclusionPolicy struct {
LastUpdatedAt any `json:"last_updated_at"`
Rules []PermissionsConfigureAdditionalContentExclusionPolicyRule `json:"rules"`
// Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope`
// enumeration.
Scope PermissionsConfigureAdditionalContentExclusionPolicyScope `json:"scope"`
}
Schema for the `PermissionsConfigureAdditionalContentExclusionPolicy` type. Experimental: PermissionsConfigureAdditionalContentExclusionPolicy is part of an experimental API and may change or be removed.
type PermissionsConfigureAdditionalContentExclusionPolicyRule ¶ added in v1.0.0
type PermissionsConfigureAdditionalContentExclusionPolicyRule struct {
IfAnyMatch []string `json:"ifAnyMatch,omitzero"`
IfNoneMatch []string `json:"ifNoneMatch,omitzero"`
Paths []string `json:"paths"`
// Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRuleSource` type.
Source PermissionsConfigureAdditionalContentExclusionPolicyRuleSource `json:"source"`
}
Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRule` type. Experimental: PermissionsConfigureAdditionalContentExclusionPolicyRule is part of an experimental API and may change or be removed.
type PermissionsConfigureAdditionalContentExclusionPolicyRuleSource ¶ added in v1.0.0
type PermissionsConfigureAdditionalContentExclusionPolicyRuleSource struct {
Name string `json:"name"`
Type string `json:"type"`
}
Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRuleSource` type. Experimental: PermissionsConfigureAdditionalContentExclusionPolicyRuleSource is part of an experimental API and may change or be removed.
type PermissionsConfigureAdditionalContentExclusionPolicyScope ¶ added in v1.0.0
type PermissionsConfigureAdditionalContentExclusionPolicyScope string
Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration. Experimental: PermissionsConfigureAdditionalContentExclusionPolicyScope is part of an experimental API and may change or be removed.
const ( // The content exclusion policy applies across all repositories. PermissionsConfigureAdditionalContentExclusionPolicyScopeAll PermissionsConfigureAdditionalContentExclusionPolicyScope = "all" // The content exclusion policy applies to the current repository. PermissionsConfigureAdditionalContentExclusionPolicyScopeRepo PermissionsConfigureAdditionalContentExclusionPolicyScope = "repo" )
type PermissionsConfigureParams ¶ added in v1.0.0
type PermissionsConfigureParams struct {
// 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.
AdditionalContentExclusionPolicies []PermissionsConfigureAdditionalContentExclusionPolicy `json:"additionalContentExclusionPolicies,omitzero"`
// If specified, sets whether path/URL read permission requests are auto-approved. Omit to
// leave the current value unchanged.
ApproveAllReadPermissionRequests *bool `json:"approveAllReadPermissionRequests,omitempty"`
// If specified, sets whether tool permission requests are auto-approved without prompting.
// Omit to leave the current value unchanged.
ApproveAllToolPermissionRequests *bool `json:"approveAllToolPermissionRequests,omitempty"`
// 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.
Paths *PermissionPathsConfig `json:"paths,omitempty"`
// If specified, replaces the session's approved/denied permission rules. Omit to leave the
// current rules unchanged.
Rules *PermissionRulesSet `json:"rules,omitempty"`
// 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.
URLs *PermissionURLsConfig `json:"urls,omitempty"`
}
Patch of permission policy fields to apply (omit a field to leave it unchanged). Experimental: PermissionsConfigureParams is part of an experimental API and may change or be removed.
type PermissionsConfigureResult ¶ added in v1.0.0
type PermissionsConfigureResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsConfigureResult is part of an experimental API and may change or be removed.
type PermissionsFolderTrustAPI ¶ added in v1.0.0
type PermissionsFolderTrustAPI sessionAPI
Experimental: PermissionsFolderTrustAPI contains experimental APIs that may change or be removed.
func (*PermissionsFolderTrustAPI) AddTrusted ¶ added in v1.0.0
func (a *PermissionsFolderTrustAPI) AddTrusted(ctx context.Context, params *FolderTrustAddParams) (*PermissionsFolderTrustAddTrustedResult, error)
AddTrusted adds a folder to the user's trusted folders list.
RPC method: session.permissions.folderTrust.addTrusted.
Parameters: Folder path to add to trusted folders.
Returns: Indicates whether the operation succeeded.
func (*PermissionsFolderTrustAPI) IsTrusted ¶ added in v1.0.0
func (a *PermissionsFolderTrustAPI) IsTrusted(ctx context.Context, params *FolderTrustCheckParams) (*FolderTrustCheckResult, error)
IsTrusted reports whether a folder is trusted according to the user's folder trust state.
RPC method: session.permissions.folderTrust.isTrusted.
Parameters: Folder path to check for trust.
Returns: Folder trust check result.
type PermissionsFolderTrustAddTrustedResult ¶ added in v1.0.0
type PermissionsFolderTrustAddTrustedResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsFolderTrustAddTrustedResult is part of an experimental API and may change or be removed.
type PermissionsGetAllowAllRequest ¶ added in v1.0.0
type PermissionsGetAllowAllRequest struct {
}
No parameters. Experimental: PermissionsGetAllowAllRequest is part of an experimental API and may change or be removed.
type PermissionsLocationsAPI ¶ added in v1.0.0
type PermissionsLocationsAPI sessionAPI
Experimental: PermissionsLocationsAPI contains experimental APIs that may change or be removed.
func (*PermissionsLocationsAPI) AddToolApproval ¶ added in v1.0.0
func (a *PermissionsLocationsAPI) AddToolApproval(ctx context.Context, params *PermissionLocationAddToolApprovalParams) (*PermissionsLocationsAddToolApprovalResult, error)
AddToolApproval persists a tool approval for a permission location and applies its rules to this session's live permission service.
RPC method: session.permissions.locations.addToolApproval.
Parameters: Location-scoped tool approval to persist.
Returns: Indicates whether the operation succeeded.
func (*PermissionsLocationsAPI) Apply ¶ added in v1.0.0
func (a *PermissionsLocationsAPI) Apply(ctx context.Context, params *PermissionLocationApplyParams) (*PermissionLocationApplyResult, error)
Apply applies persisted location-scoped tool approvals and allowed directories for a working directory to this session's permission service.
RPC method: session.permissions.locations.apply.
Parameters: Working directory to load persisted location permissions for.
Returns: Summary of persisted location permissions applied to the session.
func (*PermissionsLocationsAPI) Resolve ¶ added in v1.0.0
func (a *PermissionsLocationsAPI) Resolve(ctx context.Context, params *PermissionLocationResolveParams) (*PermissionLocationResolveResult, error)
Resolves the permission location key and type for a working directory.
RPC method: session.permissions.locations.resolve.
Parameters: Working directory to resolve into a location-permissions key.
Returns: Resolved location-permissions key and type.
type PermissionsLocationsAddToolApprovalDetails ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetails interface {
Kind() PermissionsLocationsAddToolApprovalDetailsKind
// contains filtered or unexported methods
}
Tool approval to persist and apply Experimental: PermissionsLocationsAddToolApprovalDetails is part of an experimental API and may change or be removed.
type PermissionsLocationsAddToolApprovalDetailsCommands ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetailsCommands struct {
// Command identifiers covered by this approval.
CommandIdentifiers []string `json:"commandIdentifiers"`
}
Schema for the `PermissionsLocationsAddToolApprovalDetailsCommands` type. Experimental: PermissionsLocationsAddToolApprovalDetailsCommands is part of an experimental API and may change or be removed.
func (PermissionsLocationsAddToolApprovalDetailsCommands) MarshalJSON ¶ added in v1.0.0
func (r PermissionsLocationsAddToolApprovalDetailsCommands) MarshalJSON() ([]byte, error)
type PermissionsLocationsAddToolApprovalDetailsCustomTool ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetailsCustomTool struct {
// Custom tool name.
ToolName string `json:"toolName"`
}
Schema for the `PermissionsLocationsAddToolApprovalDetailsCustomTool` type. Experimental: PermissionsLocationsAddToolApprovalDetailsCustomTool is part of an experimental API and may change or be removed.
func (PermissionsLocationsAddToolApprovalDetailsCustomTool) MarshalJSON ¶ added in v1.0.0
func (r PermissionsLocationsAddToolApprovalDetailsCustomTool) MarshalJSON() ([]byte, error)
type PermissionsLocationsAddToolApprovalDetailsExtensionManagement ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetailsExtensionManagement struct {
// Optional operation identifier; when omitted, the approval covers all extension management
// operations.
Operation *string `json:"operation,omitempty"`
}
Schema for the `PermissionsLocationsAddToolApprovalDetailsExtensionManagement` type. Experimental: PermissionsLocationsAddToolApprovalDetailsExtensionManagement is part of an experimental API and may change or be removed.
func (PermissionsLocationsAddToolApprovalDetailsExtensionManagement) MarshalJSON ¶ added in v1.0.0
func (r PermissionsLocationsAddToolApprovalDetailsExtensionManagement) MarshalJSON() ([]byte, error)
type PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess struct {
// Extension name.
ExtensionName string `json:"extensionName"`
}
Schema for the `PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess` type. Experimental: PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess is part of an experimental API and may change or be removed.
func (PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess) MarshalJSON ¶ added in v1.0.0
func (r PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess) MarshalJSON() ([]byte, error)
type PermissionsLocationsAddToolApprovalDetailsKind ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetailsKind string
Kind discriminator for PermissionsLocationsAddToolApprovalDetails.
const ( PermissionsLocationsAddToolApprovalDetailsKindCommands PermissionsLocationsAddToolApprovalDetailsKind = "commands" PermissionsLocationsAddToolApprovalDetailsKindCustomTool PermissionsLocationsAddToolApprovalDetailsKind = "custom-tool" PermissionsLocationsAddToolApprovalDetailsKindExtensionManagement PermissionsLocationsAddToolApprovalDetailsKind = "extension-management" PermissionsLocationsAddToolApprovalDetailsKindExtensionPermissionAccess PermissionsLocationsAddToolApprovalDetailsKind = "extension-permission-access" PermissionsLocationsAddToolApprovalDetailsKindMCP PermissionsLocationsAddToolApprovalDetailsKind = "mcp" PermissionsLocationsAddToolApprovalDetailsKindMCPSampling PermissionsLocationsAddToolApprovalDetailsKind = "mcp-sampling" PermissionsLocationsAddToolApprovalDetailsKindMemory PermissionsLocationsAddToolApprovalDetailsKind = "memory" PermissionsLocationsAddToolApprovalDetailsKindRead PermissionsLocationsAddToolApprovalDetailsKind = "read" PermissionsLocationsAddToolApprovalDetailsKindWrite PermissionsLocationsAddToolApprovalDetailsKind = "write" )
type PermissionsLocationsAddToolApprovalDetailsMCP ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetailsMCP struct {
// MCP server name.
ServerName string `json:"serverName"`
// MCP tool name, or null to cover every tool on the server.
ToolName *string `json:"toolName"`
}
Schema for the `PermissionsLocationsAddToolApprovalDetailsMcp` type. Experimental: PermissionsLocationsAddToolApprovalDetailsMCP is part of an experimental API and may change or be removed.
func (PermissionsLocationsAddToolApprovalDetailsMCP) MarshalJSON ¶ added in v1.0.0
func (r PermissionsLocationsAddToolApprovalDetailsMCP) MarshalJSON() ([]byte, error)
type PermissionsLocationsAddToolApprovalDetailsMCPSampling ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetailsMCPSampling struct {
// MCP server name.
ServerName string `json:"serverName"`
}
Schema for the `PermissionsLocationsAddToolApprovalDetailsMcpSampling` type. Experimental: PermissionsLocationsAddToolApprovalDetailsMCPSampling is part of an experimental API and may change or be removed.
func (PermissionsLocationsAddToolApprovalDetailsMCPSampling) MarshalJSON ¶ added in v1.0.0
func (r PermissionsLocationsAddToolApprovalDetailsMCPSampling) MarshalJSON() ([]byte, error)
type PermissionsLocationsAddToolApprovalDetailsMemory ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetailsMemory struct {
}
Schema for the `PermissionsLocationsAddToolApprovalDetailsMemory` type. Experimental: PermissionsLocationsAddToolApprovalDetailsMemory is part of an experimental API and may change or be removed.
func (PermissionsLocationsAddToolApprovalDetailsMemory) MarshalJSON ¶ added in v1.0.0
func (r PermissionsLocationsAddToolApprovalDetailsMemory) MarshalJSON() ([]byte, error)
type PermissionsLocationsAddToolApprovalDetailsRead ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetailsRead struct {
}
Schema for the `PermissionsLocationsAddToolApprovalDetailsRead` type. Experimental: PermissionsLocationsAddToolApprovalDetailsRead is part of an experimental API and may change or be removed.
func (PermissionsLocationsAddToolApprovalDetailsRead) MarshalJSON ¶ added in v1.0.0
func (r PermissionsLocationsAddToolApprovalDetailsRead) MarshalJSON() ([]byte, error)
type PermissionsLocationsAddToolApprovalDetailsWrite ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalDetailsWrite struct {
}
Schema for the `PermissionsLocationsAddToolApprovalDetailsWrite` type. Experimental: PermissionsLocationsAddToolApprovalDetailsWrite is part of an experimental API and may change or be removed.
func (PermissionsLocationsAddToolApprovalDetailsWrite) MarshalJSON ¶ added in v1.0.0
func (r PermissionsLocationsAddToolApprovalDetailsWrite) MarshalJSON() ([]byte, error)
type PermissionsLocationsAddToolApprovalResult ¶ added in v1.0.0
type PermissionsLocationsAddToolApprovalResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsLocationsAddToolApprovalResult is part of an experimental API and may change or be removed.
type PermissionsModifyRulesParams ¶ added in v1.0.0
type PermissionsModifyRulesParams struct {
// Rules to add to the scope. Applied before `remove`/`removeAll`.
Add []PermissionRule `json:"add,omitzero"`
// Specific rules to remove from the scope. Ignored when `removeAll` is true.
Remove []PermissionRule `json:"remove,omitzero"`
// When true, removes every rule currently in the scope (after any `add` is applied). Useful
// for clearing the location scope wholesale.
RemoveAll *bool `json:"removeAll,omitempty"`
// 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.
Scope PermissionsModifyRulesScope `json:"scope"`
}
Scope and add/remove instructions for modifying session- or location-scoped permission rules. Experimental: PermissionsModifyRulesParams is part of an experimental API and may change or be removed.
type PermissionsModifyRulesResult ¶ added in v1.0.0
type PermissionsModifyRulesResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsModifyRulesResult is part of an experimental API and may change or be removed.
type PermissionsModifyRulesScope ¶ added in v1.0.0
type PermissionsModifyRulesScope string
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. Experimental: PermissionsModifyRulesScope is part of an experimental API and may change or be removed.
const ( // Persist the rule change for this project location. PermissionsModifyRulesScopeLocation PermissionsModifyRulesScope = "location" // Apply the rule change only to this session. PermissionsModifyRulesScopeSession PermissionsModifyRulesScope = "session" )
type PermissionsNotifyPromptShownResult ¶ added in v1.0.0
type PermissionsNotifyPromptShownResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsNotifyPromptShownResult is part of an experimental API and may change or be removed.
type PermissionsPathsAPI ¶ added in v1.0.0
type PermissionsPathsAPI sessionAPI
Experimental: PermissionsPathsAPI contains experimental APIs that may change or be removed.
func (*PermissionsPathsAPI) Add ¶ added in v1.0.0
func (a *PermissionsPathsAPI) Add(ctx context.Context, params *PermissionPathsAddParams) (*PermissionsPathsAddResult, error)
Adds a directory to the session's allow-list.
RPC method: session.permissions.paths.add.
Parameters: Directory path to add to the session's allowed directories.
Returns: Indicates whether the operation succeeded.
func (*PermissionsPathsAPI) IsPathWithinAllowedDirectories ¶ added in v1.0.0
func (a *PermissionsPathsAPI) IsPathWithinAllowedDirectories(ctx context.Context, params *PermissionPathsAllowedCheckParams) (*PermissionPathsAllowedCheckResult, error)
IsPathWithinAllowedDirectories reports whether a path falls within any of the session's allowed directories.
RPC method: session.permissions.paths.isPathWithinAllowedDirectories.
Parameters: Path to evaluate against the session's allowed directories.
Returns: Indicates whether the supplied path is within the session's allowed directories.
func (*PermissionsPathsAPI) IsPathWithinWorkspace ¶ added in v1.0.0
func (a *PermissionsPathsAPI) IsPathWithinWorkspace(ctx context.Context, params *PermissionPathsWorkspaceCheckParams) (*PermissionPathsWorkspaceCheckResult, error)
IsPathWithinWorkspace reports whether a path falls within the session's workspace (primary) directory.
RPC method: session.permissions.paths.isPathWithinWorkspace.
Parameters: Path to evaluate against the session's workspace (primary) directory.
Returns: Indicates whether the supplied path is within the session's workspace directory.
func (*PermissionsPathsAPI) List ¶ added in v1.0.0
func (a *PermissionsPathsAPI) List(ctx context.Context) (*PermissionPathsList, error)
List returns the session's allowed directories and primary working directory.
RPC method: session.permissions.paths.list.
Returns: Snapshot of the session's allow-listed directories and primary working directory.
func (*PermissionsPathsAPI) UpdatePrimary ¶ added in v1.0.0
func (a *PermissionsPathsAPI) UpdatePrimary(ctx context.Context, params *PermissionPathsUpdatePrimaryParams) (*PermissionsPathsUpdatePrimaryResult, error)
UpdatePrimary updates the session's primary working directory used by the permission policy.
RPC method: session.permissions.paths.updatePrimary.
Parameters: Directory path to set as the session's new primary working directory.
Returns: Indicates whether the operation succeeded.
type PermissionsPathsAddResult ¶ added in v1.0.0
type PermissionsPathsAddResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsPathsAddResult is part of an experimental API and may change or be removed.
type PermissionsPathsListRequest ¶ added in v1.0.0
type PermissionsPathsListRequest struct {
}
No parameters; returns the session's allow-listed directories. Experimental: PermissionsPathsListRequest is part of an experimental API and may change or be removed.
type PermissionsPathsUpdatePrimaryResult ¶ added in v1.0.0
type PermissionsPathsUpdatePrimaryResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsPathsUpdatePrimaryResult is part of an experimental API and may change or be removed.
type PermissionsPendingRequestsRequest ¶ added in v1.0.0
type PermissionsPendingRequestsRequest struct {
}
No parameters; returns currently-pending permission requests for the session. Experimental: PermissionsPendingRequestsRequest is part of an experimental API and may change or be removed.
type PermissionsResetSessionApprovalsRequest ¶ added in v0.3.0
type PermissionsResetSessionApprovalsRequest struct {
}
No parameters; clears all session-scoped tool permission approvals. Experimental: PermissionsResetSessionApprovalsRequest is part of an experimental API and may change or be removed.
type PermissionsResetSessionApprovalsResult ¶ added in v0.3.0
type PermissionsResetSessionApprovalsResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsResetSessionApprovalsResult is part of an experimental API and may change or be removed.
type PermissionsSetAllowAllRequest ¶ added in v1.0.0
type PermissionsSetAllowAllRequest struct {
// Whether to enable full allow-all permissions
Enabled bool `json:"enabled"`
// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers.
Source *PermissionsSetAllowAllSource `json:"source,omitempty"`
}
Whether to enable full allow-all permissions for the session. Experimental: PermissionsSetAllowAllRequest is part of an experimental API and may change or be removed.
type PermissionsSetAllowAllSource ¶ added in v1.0.0
type PermissionsSetAllowAllSource string
Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. Experimental: PermissionsSetAllowAllSource is part of an experimental API and may change or be removed.
const ( // Allow-all was enabled by confirming autopilot behavior. PermissionsSetAllowAllSourceAutopilotConfirmation PermissionsSetAllowAllSource = "autopilot_confirmation" // Allow-all was enabled from a CLI command-line flag. PermissionsSetAllowAllSourceCLIFlag PermissionsSetAllowAllSource = "cli_flag" // Allow-all was enabled through an RPC caller. PermissionsSetAllowAllSourceRPC PermissionsSetAllowAllSource = "rpc" // Allow-all was enabled by a slash command. PermissionsSetAllowAllSourceSlashCommand PermissionsSetAllowAllSource = "slash_command" )
type PermissionsSetApproveAllRequest ¶ added in v0.3.0
type PermissionsSetApproveAllRequest struct {
// Whether to auto-approve all tool permission requests
Enabled bool `json:"enabled"`
// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers.
Source *PermissionsSetApproveAllSource `json:"source,omitempty"`
}
Allow-all toggle for tool permission requests, with an optional telemetry source. Experimental: PermissionsSetApproveAllRequest is part of an experimental API and may change or be removed.
type PermissionsSetApproveAllResult ¶ added in v0.3.0
type PermissionsSetApproveAllResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsSetApproveAllResult is part of an experimental API and may change or be removed.
type PermissionsSetApproveAllSource ¶ added in v1.0.0
type PermissionsSetApproveAllSource string
Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. Experimental: PermissionsSetApproveAllSource is part of an experimental API and may change or be removed.
const ( // Allow-all was enabled by confirming autopilot behavior. PermissionsSetApproveAllSourceAutopilotConfirmation PermissionsSetApproveAllSource = "autopilot_confirmation" // Allow-all was enabled from a CLI command-line flag. PermissionsSetApproveAllSourceCLIFlag PermissionsSetApproveAllSource = "cli_flag" // Allow-all was enabled through an RPC caller. PermissionsSetApproveAllSourceRPC PermissionsSetApproveAllSource = "rpc" // Allow-all was enabled by a slash command. PermissionsSetApproveAllSourceSlashCommand PermissionsSetApproveAllSource = "slash_command" )
type PermissionsSetRequiredRequest ¶ added in v1.0.0
type PermissionsSetRequiredRequest struct {
// 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`).
Required bool `json:"required"`
}
Toggles whether permission prompts should be bridged into session events for this client. Experimental: PermissionsSetRequiredRequest is part of an experimental API and may change or be removed.
type PermissionsSetRequiredResult ¶ added in v1.0.0
type PermissionsSetRequiredResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsSetRequiredResult is part of an experimental API and may change or be removed.
type PermissionsURLsAPI ¶ added in v1.0.0
type PermissionsURLsAPI sessionAPI
Experimental: PermissionsURLsAPI contains experimental APIs that may change or be removed.
func (*PermissionsURLsAPI) SetUnrestrictedMode ¶ added in v1.0.0
func (a *PermissionsURLsAPI) SetUnrestrictedMode(ctx context.Context, params *PermissionURLsSetUnrestrictedModeParams) (*PermissionsURLsSetUnrestrictedModeResult, error)
SetUnrestrictedMode toggles the runtime's URL-permission policy between unrestricted and restricted modes.
RPC method: session.permissions.urls.setUnrestrictedMode.
Parameters: Whether the URL-permission policy should run in unrestricted mode.
Returns: Indicates whether the operation succeeded.
type PermissionsURLsSetUnrestrictedModeResult ¶ added in v1.0.0
type PermissionsURLsSetUnrestrictedModeResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the operation succeeded. Experimental: PermissionsURLsSetUnrestrictedModeResult is part of an experimental API and may change or be removed.
type PingRequest ¶ added in v0.3.0
type PingRequest struct {
// Optional message to echo back
Message *string `json:"message,omitempty"`
}
Optional message to echo back to the caller.
type PingResult ¶
type PingResult struct {
// Echoed message (or default greeting)
Message string `json:"message"`
// Server protocol version number
ProtocolVersion int64 `json:"protocolVersion"`
// ISO 8601 timestamp when the server handled the ping
Timestamp time.Time `json:"timestamp"`
}
Server liveness response, including the echoed message, current server timestamp, and protocol version.
type PlanAPI ¶ added in v1.0.0
type PlanAPI sessionAPI
Experimental: PlanAPI contains experimental APIs that may change or be removed.
func (*PlanAPI) Delete ¶ added in v1.0.0
func (a *PlanAPI) Delete(ctx context.Context) (*SessionPlanDeleteResult, error)
Deletes the session plan file from the workspace.
RPC method: session.plan.delete.
func (*PlanAPI) Read ¶ added in v1.0.0
func (a *PlanAPI) Read(ctx context.Context) (*PlanReadResult, error)
Reads the session plan file from the workspace.
RPC method: session.plan.read.
Returns: Existence, contents, and resolved path of the session plan file.
func (*PlanAPI) ReadSqlTodos ¶ added in v1.0.1
func (a *PlanAPI) ReadSqlTodos(ctx context.Context) (*PlanReadSQLTodosResult, error)
ReadSqlTodos reads todo rows from the session SQL database for plan rendering.
RPC method: session.plan.readSqlTodos.
Returns: Todo rows read from the session SQL database. Empty when no session database is available.
func (*PlanAPI) Update ¶ added in v1.0.0
func (a *PlanAPI) Update(ctx context.Context, params *PlanUpdateRequest) (*SessionPlanUpdateResult, error)
Update writes new content to the session plan file.
RPC method: session.plan.update.
Parameters: Replacement contents to write to the session plan file.
type PlanChangedOperation ¶ added in v1.0.0
type PlanChangedOperation string
The type of operation performed on the plan file
const ( // The plan file was created. PlanChangedOperationCreate PlanChangedOperation = "create" // The plan file was deleted. PlanChangedOperationDelete PlanChangedOperation = "delete" // The plan file was updated. PlanChangedOperationUpdate PlanChangedOperation = "update" )
type PlanReadResult ¶ added in v0.3.0
type PlanReadResult struct {
// The content of the plan file, or null if it does not exist
Content *string `json:"content"`
// Whether the plan file exists in the workspace
Exists bool `json:"exists"`
// Absolute file path of the plan file, or null if workspace is not enabled
Path *string `json:"path"`
}
Existence, contents, and resolved path of the session plan file. Experimental: PlanReadResult is part of an experimental API and may change or be removed.
type PlanReadSQLTodosResult ¶ added in v1.0.1
type PlanReadSQLTodosResult struct {
// Rows from the session SQL todos table, ordered by creation time and id.
Rows []PlanSQLTodosRow `json:"rows"`
}
Todo rows read from the session SQL database. Empty when no session database is available. Experimental: PlanReadSQLTodosResult is part of an experimental API and may change or be removed.
type PlanSQLTodosRow ¶ added in v1.0.1
type PlanSQLTodosRow struct {
// Todo description.
Description *string `json:"description,omitempty"`
// Todo identifier.
ID *string `json:"id,omitempty"`
// Todo status.
Status *string `json:"status,omitempty"`
// Todo title.
Title *string `json:"title,omitempty"`
}
Schema for the `PlanSqlTodosRow` type. Experimental: PlanSQLTodosRow is part of an experimental API and may change or be removed.
type PlanUpdateRequest ¶ added in v0.3.0
type PlanUpdateRequest struct {
// The new content for the plan file
Content string `json:"content"`
}
Replacement contents to write to the session plan file. Experimental: PlanUpdateRequest is part of an experimental API and may change or be removed.
type Plugin ¶ added in v0.2.0
type Plugin struct {
// Whether the plugin is currently enabled
Enabled bool `json:"enabled"`
// Marketplace the plugin came from
Marketplace string `json:"marketplace"`
// Plugin name
Name string `json:"name"`
// Installed version
Version *string `json:"version,omitempty"`
}
Schema for the `Plugin` type. Experimental: Plugin is part of an experimental API and may change or be removed.
type PluginInstallResult ¶ added in v1.0.1
type PluginInstallResult struct {
// Set when the install path is deprecated (e.g. direct repo / URL / local installs).
// Callers should surface this to end users.
DeprecationWarning *string `json:"deprecationWarning,omitempty"`
// The newly installed plugin's metadata
Plugin InstalledPluginInfo `json:"plugin"`
// Optional post-install message provided by the plugin (e.g. setup instructions)
PostInstallMessage *string `json:"postInstallMessage,omitempty"`
// Number of skills discovered and installed from the plugin
SkillsInstalled int64 `json:"skillsInstalled"`
}
Result of installing a plugin. Experimental: PluginInstallResult is part of an experimental API and may change or be removed.
type PluginList ¶ added in v0.3.0
type PluginList struct {
// Installed plugins
Plugins []Plugin `json:"plugins"`
}
Plugins installed for the session, with their enabled state and version metadata. Experimental: PluginList is part of an experimental API and may change or be removed.
type PluginListResult ¶ added in v1.0.1
type PluginListResult struct {
// Installed plugins
Plugins []InstalledPluginInfo `json:"plugins"`
}
Plugins installed in user/global state. Experimental: PluginListResult is part of an experimental API and may change or be removed.
type PluginUpdateAllEntry ¶ added in v1.0.1
type PluginUpdateAllEntry struct {
// Error message (failure only)
Error *string `json:"error,omitempty"`
// Marketplace the plugin came from. Empty string ("") for direct installs.
Marketplace string `json:"marketplace"`
// Plugin name that was updated
Name string `json:"name"`
// Version after the update, when available
NewVersion *string `json:"newVersion,omitempty"`
// Previously installed version, when available
PreviousVersion *string `json:"previousVersion,omitempty"`
// Number of skills installed after the update (success only)
SkillsInstalled *int64 `json:"skillsInstalled,omitempty"`
// Whether the update succeeded for this plugin
Success bool `json:"success"`
}
Schema for the `PluginUpdateAllEntry` type. Experimental: PluginUpdateAllEntry is part of an experimental API and may change or be removed.
type PluginUpdateAllResult ¶ added in v1.0.1
type PluginUpdateAllResult struct {
// Per-plugin update results in deterministic order.
Results []PluginUpdateAllEntry `json:"results"`
}
Result of updating all installed plugins. Experimental: PluginUpdateAllResult is part of an experimental API and may change or be removed.
type PluginUpdateResult ¶ added in v1.0.1
type PluginUpdateResult struct {
// Version after the update, when reported by the plugin manifest
NewVersion *string `json:"newVersion,omitempty"`
// Version that was previously installed, when available
PreviousVersion *string `json:"previousVersion,omitempty"`
// Number of skills discovered and installed after the update
SkillsInstalled int64 `json:"skillsInstalled"`
}
Result of updating a single plugin. Experimental: PluginUpdateResult is part of an experimental API and may change or be removed.
type PluginsAPI ¶ added in v1.0.0
type PluginsAPI sessionAPI
Experimental: PluginsAPI contains experimental APIs that may change or be removed.
func (*PluginsAPI) List ¶ added in v1.0.0
func (a *PluginsAPI) List(ctx context.Context) (*PluginList, error)
Lists plugins installed for the session.
RPC method: session.plugins.list.
Returns: Plugins installed for the session, with their enabled state and version metadata.
func (*PluginsAPI) Reload ¶ added in v1.0.1
func (a *PluginsAPI) Reload(ctx context.Context, params ...*PluginsReloadRequest) (*SessionPluginsReloadResult, error)
Reloads the session's plugin set, refreshing MCP servers, custom agents, hooks, and skills cache so SDK-driven changes via `server.plugins.*` take effect immediately.
RPC method: session.plugins.reload.
Parameters: Optional flags controlling which side effects the reload performs.
type PluginsDisableRequest ¶ added in v1.0.1
type PluginsDisableRequest struct {
// Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored.
// Non-marketplace direct installs cannot be disabled via this API; uninstall them instead.
// Plugin-owned MCP servers are stopped in active sessions immediately; other plugin
// contributions remain available until each session reloads plugins.
Names []string `json:"names"`
}
Plugin names (or specs) to disable. Experimental: PluginsDisableRequest is part of an experimental API and may change or be removed.
type PluginsDisableResult ¶ added in v1.0.1
type PluginsDisableResult struct {
}
Experimental: PluginsDisableResult is part of an experimental API and may change or be removed.
type PluginsEnableRequest ¶ added in v1.0.1
type PluginsEnableRequest struct {
// Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored.
// Non-marketplace direct installs are always enabled and cannot be toggled via this API.
Names []string `json:"names"`
}
Plugin names (or specs) to enable. Experimental: PluginsEnableRequest is part of an experimental API and may change or be removed.
type PluginsEnableResult ¶ added in v1.0.1
type PluginsEnableResult struct {
}
Experimental: PluginsEnableResult is part of an experimental API and may change or be removed.
type PluginsInstallRequest ¶ added in v1.0.1
type PluginsInstallRequest struct {
// Plugin install spec. Accepts the same forms as the CLI: "plugin@marketplace" (marketplace
// install), "owner/repo" or "owner/repo:subpath" (GitHub direct), an http/https/ssh URL, or
// a local path. Direct (non-marketplace) installs are deprecated and will produce a
// deprecationWarning in the result.
Source string `json:"source"`
// Working directory used to resolve relative local paths in `source`. Defaults to the
// server's current working directory.
WorkingDirectory *string `json:"workingDirectory,omitempty"`
}
Plugin source and optional working directory for relative-path resolution. Experimental: PluginsInstallRequest is part of an experimental API and may change or be removed.
type PluginsMarketplacesAddRequest ¶ added in v1.0.1
type PluginsMarketplacesAddRequest struct {
// Marketplace source. Accepts the same forms as the CLI: "owner/repo" or "owner/repo#ref"
// (GitHub), an http/https/ssh URL (optionally with #ref), a git scp-style URL
// (user@host:path), or a local path. The marketplace's own name (from its manifest) is used
// as the registration key.
Source string `json:"source"`
}
Marketplace source to register. Experimental: PluginsMarketplacesAddRequest is part of an experimental API and may change or be removed.
type PluginsMarketplacesBrowseRequest ¶ added in v1.0.1
type PluginsMarketplacesBrowseRequest struct {
// Marketplace name to browse
Name string `json:"name"`
}
Name of the marketplace whose plugin catalog to fetch. Experimental: PluginsMarketplacesBrowseRequest is part of an experimental API and may change or be removed.
type PluginsMarketplacesRefreshRequest ¶ added in v1.0.1
type PluginsMarketplacesRefreshRequest struct {
// Marketplace name to refresh. When omitted, every registered marketplace is refreshed.
Name *string `json:"name,omitempty"`
}
Experimental: PluginsMarketplacesRefreshRequest is part of an experimental API and may change or be removed.
type PluginsMarketplacesRemoveRequest ¶ added in v1.0.1
type PluginsMarketplacesRemoveRequest struct {
// When true, also uninstall every plugin sourced from this marketplace. When false
// (default), removal is a no-op if any plugin from this marketplace is installed and the
// dependent plugin names are returned in the result.
Force *bool `json:"force,omitempty"`
// Marketplace name to remove
Name string `json:"name"`
}
Name of the marketplace to remove and an optional force flag. Experimental: PluginsMarketplacesRemoveRequest is part of an experimental API and may change or be removed.
type PluginsReloadRequest ¶ added in v1.0.1
type PluginsReloadRequest struct {
// When true, skip repo-level hooks during the hook reload. Use before folder trust is
// confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`.
DeferRepoHooks *bool `json:"deferRepoHooks,omitempty"`
// Re-run custom-agent discovery after refreshing plugins. Defaults to true.
ReloadCustomAgents *bool `json:"reloadCustomAgents,omitempty"`
// 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).
ReloadHooks *bool `json:"reloadHooks,omitempty"`
// Reload MCP server connections after refreshing plugins. Defaults to true.
ReloadMCP *bool `json:"reloadMcp,omitempty"`
}
Optional flags controlling which side effects the reload performs. Experimental: PluginsReloadRequest is part of an experimental API and may change or be removed.
type PluginsUninstallRequest ¶ added in v1.0.1
type PluginsUninstallRequest struct {
// Plugin name or "plugin@marketplace" spec to uninstall. When ambiguous, prefer the
// fully-qualified spec.
Name string `json:"name"`
}
Name (or spec) of the plugin to uninstall. Experimental: PluginsUninstallRequest is part of an experimental API and may change or be removed.
type PluginsUninstallResult ¶ added in v1.0.1
type PluginsUninstallResult struct {
}
Experimental: PluginsUninstallResult is part of an experimental API and may change or be removed.
type PluginsUpdateRequest ¶ added in v1.0.1
type PluginsUpdateRequest struct {
// Plugin name or "plugin@marketplace" spec to update.
Name string `json:"name"`
}
Name (or spec) of the plugin to update. Experimental: PluginsUpdateRequest is part of an experimental API and may change or be removed.
type PollSpawnedSessionsResult ¶ added in v1.0.1
type PollSpawnedSessionsResult struct {
// Opaque cursor to pass back to receive only events after this batch.
Cursor string `json:"cursor"`
// Spawn events emitted since the supplied cursor.
Events []SessionsPollSpawnedSessionsEvent `json:"events"`
}
Batch of spawn events plus a cursor for follow-up polls. Experimental: PollSpawnedSessionsResult is part of an experimental API and may change or be removed.
type PossibleURL ¶ added in v1.0.0
type PossibleURL = PermissionRequestShellPossibleURL
Type aliases for convenience.
type ProviderConfig ¶ added in v1.0.1
type ProviderConfig struct {
// API key. Optional for local providers like Ollama.
APIKey *string `json:"apiKey,omitempty"`
// Azure-specific provider options.
Azure *ProviderConfigAzure `json:"azure,omitempty"`
// API endpoint URL.
BaseURL string `json:"baseUrl"`
// Bearer token for authentication. Sets the Authorization header directly. Takes precedence
// over apiKey when both are set.
BearerToken *string `json:"bearerToken,omitempty"`
// Custom HTTP headers to include in all outbound requests to the provider.
Headers map[string]string `json:"headers,omitzero"`
// Maximum context window tokens for the model.
MaxContextWindowTokens *float64 `json:"maxContextWindowTokens,omitempty"`
// Maximum output tokens for the model.
MaxOutputTokens *float64 `json:"maxOutputTokens,omitempty"`
// Maximum prompt/input tokens for the model.
MaxPromptTokens *float64 `json:"maxPromptTokens,omitempty"`
// Well-known model ID used for capability lookup. When set, agent behavior config and token
// limits are inferred from this model.
ModelID *string `json:"modelId,omitempty"`
// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs.
Type *ProviderConfigType `json:"type,omitempty"`
// Wire API format (openai/azure only). Defaults to "completions".
WireAPI *ProviderConfigWireAPI `json:"wireApi,omitempty"`
// The model identifier sent to the provider API for inference (the "wire" model), as
// opposed to modelId which is the well-known base.
WireModel *string `json:"wireModel,omitempty"`
}
Custom model-provider configuration (BYOK). Experimental: ProviderConfig is part of an experimental API and may change or be removed.
type ProviderConfigAzure ¶ added in v1.0.1
type ProviderConfigAzure struct {
// API version. When set, uses the versioned deployment route. When omitted, uses the GA
// versionless v1 route.
APIVersion *string `json:"apiVersion,omitempty"`
}
Azure-specific provider options. Experimental: ProviderConfigAzure is part of an experimental API and may change or be removed.
type ProviderConfigType ¶ added in v1.0.1
type ProviderConfigType string
Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. Experimental: ProviderConfigType is part of an experimental API and may change or be removed.
const ( // Anthropic API endpoint. ProviderConfigTypeAnthropic ProviderConfigType = "anthropic" // Azure OpenAI Service endpoint. ProviderConfigTypeAzure ProviderConfigType = "azure" // Generic OpenAI-compatible API. ProviderConfigTypeOpenai ProviderConfigType = "openai" )
type ProviderConfigWireAPI ¶ added in v1.0.1
type ProviderConfigWireAPI string
Wire API format (openai/azure only). Defaults to "completions". Experimental: ProviderConfigWireAPI is part of an experimental API and may change or be removed.
const ( // OpenAI Chat Completions wire format. ProviderConfigWireAPICompletions ProviderConfigWireAPI = "completions" // OpenAI Responses API wire format. ProviderConfigWireAPIResponses ProviderConfigWireAPI = "responses" )
type PushAttachment ¶ added in v1.0.0
type PushAttachment interface {
Type() PushAttachmentType
// contains filtered or unexported methods
}
Schema for the `PushAttachment` type. Experimental: PushAttachment is part of an experimental API and may change or be removed.
type PushAttachmentBlob ¶ added in v1.0.0
type PushAttachmentBlob struct {
// Base64-encoded content
Data string `json:"data"`
// User-facing display name for the attachment
DisplayName *string `json:"displayName,omitempty"`
// MIME type of the inline data
MIMEType string `json:"mimeType"`
}
Blob attachment with inline base64-encoded data Experimental: PushAttachmentBlob is part of an experimental API and may change or be removed.
func (PushAttachmentBlob) MarshalJSON ¶ added in v1.0.0
func (r PushAttachmentBlob) MarshalJSON() ([]byte, error)
func (PushAttachmentBlob) Type ¶ added in v1.0.0
func (PushAttachmentBlob) Type() PushAttachmentType
type PushAttachmentDirectory ¶ added in v1.0.0
type PushAttachmentDirectory struct {
// User-facing display name for the attachment
DisplayName string `json:"displayName"`
// Absolute directory path
Path string `json:"path"`
}
Directory attachment Experimental: PushAttachmentDirectory is part of an experimental API and may change or be removed.
func (PushAttachmentDirectory) MarshalJSON ¶ added in v1.0.0
func (r PushAttachmentDirectory) MarshalJSON() ([]byte, error)
func (PushAttachmentDirectory) Type ¶ added in v1.0.0
func (PushAttachmentDirectory) Type() PushAttachmentType
type PushAttachmentFile ¶ added in v1.0.0
type PushAttachmentFile struct {
// User-facing display name for the attachment
DisplayName string `json:"displayName"`
// Optional line range to scope the attachment to a specific section of the file
LineRange *PushAttachmentFileLineRange `json:"lineRange,omitempty"`
// Absolute file path
Path string `json:"path"`
}
File attachment Experimental: PushAttachmentFile is part of an experimental API and may change or be removed.
func (PushAttachmentFile) MarshalJSON ¶ added in v1.0.0
func (r PushAttachmentFile) MarshalJSON() ([]byte, error)
func (PushAttachmentFile) Type ¶ added in v1.0.0
func (PushAttachmentFile) Type() PushAttachmentType
type PushAttachmentFileLineRange ¶ added in v1.0.0
type PushAttachmentFileLineRange struct {
// End line number (1-based, inclusive)
End int64 `json:"end"`
// Start line number (1-based)
Start int64 `json:"start"`
}
Optional line range to scope the attachment to a specific section of the file Experimental: PushAttachmentFileLineRange is part of an experimental API and may change or be removed.
type PushAttachmentGitHubReference ¶ added in v1.0.0
type PushAttachmentGitHubReference struct {
// Issue, pull request, or discussion number
Number int64 `json:"number"`
// Type of GitHub reference
ReferenceType PushAttachmentGitHubReferenceType `json:"referenceType"`
// Current state of the referenced item (e.g., open, closed, merged)
State string `json:"state"`
// Title of the referenced item
Title string `json:"title"`
// URL to the referenced item on GitHub
URL string `json:"url"`
}
GitHub issue, pull request, or discussion reference Experimental: PushAttachmentGitHubReference is part of an experimental API and may change or be removed.
func (PushAttachmentGitHubReference) MarshalJSON ¶ added in v1.0.0
func (r PushAttachmentGitHubReference) MarshalJSON() ([]byte, error)
func (PushAttachmentGitHubReference) Type ¶ added in v1.0.0
func (PushAttachmentGitHubReference) Type() PushAttachmentType
type PushAttachmentGitHubReferenceType ¶ added in v1.0.0
type PushAttachmentGitHubReferenceType string
Type of GitHub reference Experimental: PushAttachmentGitHubReferenceType is part of an experimental API and may change or be removed.
const ( // GitHub discussion reference. PushAttachmentGitHubReferenceTypeDiscussion PushAttachmentGitHubReferenceType = "discussion" // GitHub issue reference. PushAttachmentGitHubReferenceTypeIssue PushAttachmentGitHubReferenceType = "issue" // GitHub pull request reference. PushAttachmentGitHubReferenceTypePr PushAttachmentGitHubReferenceType = "pr" )
type PushAttachmentSelection ¶ added in v1.0.0
type PushAttachmentSelection struct {
// User-facing display name for the selection
DisplayName string `json:"displayName"`
// Absolute path to the file containing the selection
FilePath string `json:"filePath"`
// Position range of the selection within the file
Selection PushAttachmentSelectionDetails `json:"selection"`
// The selected text content
Text string `json:"text"`
}
Code selection attachment from an editor Experimental: PushAttachmentSelection is part of an experimental API and may change or be removed.
func (PushAttachmentSelection) MarshalJSON ¶ added in v1.0.0
func (r PushAttachmentSelection) MarshalJSON() ([]byte, error)
func (PushAttachmentSelection) Type ¶ added in v1.0.0
func (PushAttachmentSelection) Type() PushAttachmentType
type PushAttachmentSelectionDetails ¶ added in v1.0.0
type PushAttachmentSelectionDetails struct {
// End position of the selection
End PushAttachmentSelectionDetailsEnd `json:"end"`
// Start position of the selection
Start PushAttachmentSelectionDetailsStart `json:"start"`
}
Position range of the selection within the file Experimental: PushAttachmentSelectionDetails is part of an experimental API and may change or be removed.
type PushAttachmentSelectionDetailsEnd ¶ added in v1.0.0
type PushAttachmentSelectionDetailsEnd struct {
// End character offset within the line (0-based)
Character int64 `json:"character"`
// End line number (0-based)
Line int64 `json:"line"`
}
End position of the selection Experimental: PushAttachmentSelectionDetailsEnd is part of an experimental API and may change or be removed.
type PushAttachmentSelectionDetailsStart ¶ added in v1.0.0
type PushAttachmentSelectionDetailsStart struct {
// Start character offset within the line (0-based)
Character int64 `json:"character"`
// Start line number (0-based)
Line int64 `json:"line"`
}
Start position of the selection Experimental: PushAttachmentSelectionDetailsStart is part of an experimental API and may change or be removed.
type PushAttachmentType ¶ added in v1.0.0
type PushAttachmentType string
Type discriminator for PushAttachment.
const ( PushAttachmentTypeBlob PushAttachmentType = "blob" PushAttachmentTypeDirectory PushAttachmentType = "directory" PushAttachmentTypeExtensionContext PushAttachmentType = "extension_context" PushAttachmentTypeFile PushAttachmentType = "file" PushAttachmentTypeGitHubReference PushAttachmentType = "github_reference" PushAttachmentTypeSelection PushAttachmentType = "selection" )
type QueueAPI ¶ added in v1.0.0
type QueueAPI sessionAPI
Experimental: QueueAPI contains experimental APIs that may change or be removed.
func (*QueueAPI) Clear ¶ added in v1.0.0
func (a *QueueAPI) Clear(ctx context.Context) (*SessionQueueClearResult, error)
Clears all pending queued items on the local session.
RPC method: session.queue.clear.
func (*QueueAPI) PendingItems ¶ added in v1.0.0
func (a *QueueAPI) PendingItems(ctx context.Context) (*QueuePendingItemsResult, error)
PendingItems returns the local session's pending user-facing queued items and steering messages.
RPC method: session.queue.pendingItems.
Returns: Snapshot of the session's pending queued items and immediate-steering messages.
func (*QueueAPI) RemoveMostRecent ¶ added in v1.0.0
func (a *QueueAPI) RemoveMostRecent(ctx context.Context) (*QueueRemoveMostRecentResult, error)
RemoveMostRecent removes the most recently queued user-facing item (LIFO).
RPC method: session.queue.removeMostRecent.
Returns: Indicates whether a user-facing pending item was removed.
type QueuePendingItems ¶ added in v1.0.0
type QueuePendingItems struct {
// Human-readable text to display for this queue entry in the UI
DisplayText string `json:"displayText"`
// Whether this item is a queued user message or a queued slash command / model change
Kind QueuePendingItemsKind `json:"kind"`
}
Schema for the `QueuePendingItems` type. Experimental: QueuePendingItems is part of an experimental API and may change or be removed.
type QueuePendingItemsKind ¶ added in v1.0.0
type QueuePendingItemsKind string
Whether this item is a queued user message or a queued slash command / model change Experimental: QueuePendingItemsKind is part of an experimental API and may change or be removed.
const ( // A queued slash command or model-change command. QueuePendingItemsKindCommand QueuePendingItemsKind = "command" // A queued user message. QueuePendingItemsKindMessage QueuePendingItemsKind = "message" )
type QueuePendingItemsResult ¶ added in v1.0.0
type QueuePendingItemsResult struct {
// Pending queued items in submission order. Includes user messages, queued slash commands,
// and queued model changes; omits internal system items.
Items []QueuePendingItems `json:"items"`
// Display text for messages currently in the immediate steering queue (interjections sent
// during a running turn).
SteeringMessages []string `json:"steeringMessages"`
}
Snapshot of the session's pending queued items and immediate-steering messages. Experimental: QueuePendingItemsResult is part of an experimental API and may change or be removed.
type QueueRemoveMostRecentResult ¶ added in v1.0.0
type QueueRemoveMostRecentResult struct {
// True if a user-facing pending item was removed (LIFO across both queues); false when no
// removable items remained.
Removed bool `json:"removed"`
}
Indicates whether a user-facing pending item was removed. Experimental: QueueRemoveMostRecentResult is part of an experimental API and may change or be removed.
type QueuedCommandHandled ¶ added in v1.0.0
type QueuedCommandHandled struct {
// When true, the runtime will not process subsequent queued commands until a new request
// comes in.
StopProcessingQueue *bool `json:"stopProcessingQueue,omitempty"`
}
Schema for the `QueuedCommandHandled` type. Experimental: QueuedCommandHandled is part of an experimental API and may change or be removed.
func (QueuedCommandHandled) Handled ¶ added in v1.0.0
func (QueuedCommandHandled) Handled() bool
func (QueuedCommandHandled) MarshalJSON ¶ added in v1.0.0
func (r QueuedCommandHandled) MarshalJSON() ([]byte, error)
type QueuedCommandNotHandled ¶ added in v1.0.0
type QueuedCommandNotHandled struct {
}
Schema for the `QueuedCommandNotHandled` type. Experimental: QueuedCommandNotHandled is part of an experimental API and may change or be removed.
func (QueuedCommandNotHandled) Handled ¶ added in v1.0.0
func (QueuedCommandNotHandled) Handled() bool
func (QueuedCommandNotHandled) MarshalJSON ¶ added in v1.0.0
func (r QueuedCommandNotHandled) MarshalJSON() ([]byte, error)
type QueuedCommandResult ¶ added in v1.0.0
type QueuedCommandResult interface {
Handled() bool
// contains filtered or unexported methods
}
Result of the queued command execution. Experimental: QueuedCommandResult is part of an experimental API and may change or be removed.
type RawAgentRegistrySpawnResultData ¶ added in v1.0.0
type RawAgentRegistrySpawnResultData struct {
Discriminator AgentRegistrySpawnResultKind
Raw json.RawMessage
}
func (RawAgentRegistrySpawnResultData) Kind ¶ added in v1.0.0
func (r RawAgentRegistrySpawnResultData) Kind() AgentRegistrySpawnResultKind
func (RawAgentRegistrySpawnResultData) MarshalJSON ¶ added in v1.0.0
func (r RawAgentRegistrySpawnResultData) MarshalJSON() ([]byte, error)
type RawAttachmentData ¶ added in v1.0.0
type RawAttachmentData struct {
Discriminator AttachmentType
Raw json.RawMessage
}
func (RawAttachmentData) MarshalJSON ¶ added in v1.0.0
func (r RawAttachmentData) MarshalJSON() ([]byte, error)
func (RawAttachmentData) Type ¶ added in v1.0.0
func (r RawAttachmentData) Type() AttachmentType
type RawAuthInfoData ¶ added in v1.0.0
type RawAuthInfoData struct {
Discriminator AuthInfoType
Raw json.RawMessage
}
func (RawAuthInfoData) MarshalJSON ¶ added in v1.0.0
func (r RawAuthInfoData) MarshalJSON() ([]byte, error)
func (RawAuthInfoData) Type ¶ added in v1.0.0
func (r RawAuthInfoData) Type() AuthInfoType
type RawExternalToolTextResultForLlmContentData ¶ added in v1.0.0
type RawExternalToolTextResultForLlmContentData struct {
Discriminator ExternalToolTextResultForLlmContentType
Raw json.RawMessage
}
func (RawExternalToolTextResultForLlmContentData) MarshalJSON ¶ added in v1.0.0
func (r RawExternalToolTextResultForLlmContentData) MarshalJSON() ([]byte, error)
type RawExternalToolTextResultForLlmContentResourceDetailsData ¶ added in v1.0.0
type RawExternalToolTextResultForLlmContentResourceDetailsData struct {
Raw json.RawMessage
}
func (RawExternalToolTextResultForLlmContentResourceDetailsData) MarshalJSON ¶ added in v1.0.0
func (r RawExternalToolTextResultForLlmContentResourceDetailsData) MarshalJSON() ([]byte, error)
type RawMCPServerConfigData ¶ added in v1.0.0
type RawMCPServerConfigData struct {
Raw json.RawMessage
}
func (RawMCPServerConfigData) MarshalJSON ¶ added in v1.0.0
func (r RawMCPServerConfigData) MarshalJSON() ([]byte, error)
type RawPermissionDecisionApproveForLocationApprovalData ¶ added in v1.0.0
type RawPermissionDecisionApproveForLocationApprovalData struct {
Discriminator PermissionDecisionApproveForLocationApprovalKind
Raw json.RawMessage
}
func (RawPermissionDecisionApproveForLocationApprovalData) MarshalJSON ¶ added in v1.0.0
func (r RawPermissionDecisionApproveForLocationApprovalData) MarshalJSON() ([]byte, error)
type RawPermissionDecisionApproveForSessionApprovalData ¶ added in v1.0.0
type RawPermissionDecisionApproveForSessionApprovalData struct {
Discriminator PermissionDecisionApproveForSessionApprovalKind
Raw json.RawMessage
}
func (RawPermissionDecisionApproveForSessionApprovalData) MarshalJSON ¶ added in v1.0.0
func (r RawPermissionDecisionApproveForSessionApprovalData) MarshalJSON() ([]byte, error)
type RawPermissionDecisionData ¶ added in v1.0.0
type RawPermissionDecisionData struct {
Discriminator PermissionDecisionKind
Raw json.RawMessage
}
func (RawPermissionDecisionData) Kind ¶ added in v1.0.0
func (r RawPermissionDecisionData) Kind() PermissionDecisionKind
func (RawPermissionDecisionData) MarshalJSON ¶ added in v1.0.0
func (r RawPermissionDecisionData) MarshalJSON() ([]byte, error)
type RawPermissionPromptRequest ¶ added in v1.0.0
type RawPermissionPromptRequest struct {
Discriminator PermissionPromptRequestKind
Raw json.RawMessage
}
func (RawPermissionPromptRequest) Kind ¶ added in v1.0.0
func (r RawPermissionPromptRequest) Kind() PermissionPromptRequestKind
func (RawPermissionPromptRequest) MarshalJSON ¶ added in v1.0.0
func (r RawPermissionPromptRequest) MarshalJSON() ([]byte, error)
type RawPermissionRequest ¶ added in v1.0.0
type RawPermissionRequest struct {
Discriminator PermissionRequestKind
Raw json.RawMessage
}
func (RawPermissionRequest) Kind ¶ added in v1.0.0
func (r RawPermissionRequest) Kind() PermissionRequestKind
func (RawPermissionRequest) MarshalJSON ¶ added in v1.0.0
func (r RawPermissionRequest) MarshalJSON() ([]byte, error)
type RawPermissionResult ¶ added in v1.0.0
type RawPermissionResult struct {
Discriminator PermissionResultKind
Raw json.RawMessage
}
func (RawPermissionResult) Kind ¶ added in v1.0.0
func (r RawPermissionResult) Kind() PermissionResultKind
func (RawPermissionResult) MarshalJSON ¶ added in v1.0.0
func (r RawPermissionResult) MarshalJSON() ([]byte, error)
type RawPermissionsLocationsAddToolApprovalDetailsData ¶ added in v1.0.0
type RawPermissionsLocationsAddToolApprovalDetailsData struct {
Discriminator PermissionsLocationsAddToolApprovalDetailsKind
Raw json.RawMessage
}
func (RawPermissionsLocationsAddToolApprovalDetailsData) MarshalJSON ¶ added in v1.0.0
func (r RawPermissionsLocationsAddToolApprovalDetailsData) MarshalJSON() ([]byte, error)
type RawPushAttachmentData ¶ added in v1.0.0
type RawPushAttachmentData struct {
Discriminator PushAttachmentType
Raw json.RawMessage
}
func (RawPushAttachmentData) MarshalJSON ¶ added in v1.0.0
func (r RawPushAttachmentData) MarshalJSON() ([]byte, error)
func (RawPushAttachmentData) Type ¶ added in v1.0.0
func (r RawPushAttachmentData) Type() PushAttachmentType
type RawRemoteControlStatusData ¶ added in v1.0.1
type RawRemoteControlStatusData struct {
Discriminator RemoteControlStatusState
Raw json.RawMessage
}
func (RawRemoteControlStatusData) MarshalJSON ¶ added in v1.0.1
func (r RawRemoteControlStatusData) MarshalJSON() ([]byte, error)
func (RawRemoteControlStatusData) State ¶ added in v1.0.1
func (r RawRemoteControlStatusData) State() RemoteControlStatusState
type RawSessionEventData ¶ added in v1.0.0
type RawSessionEventData struct {
EventType SessionEventType
Raw json.RawMessage
}
RawSessionEventData holds unparsed JSON data for unrecognized event types.
func (RawSessionEventData) MarshalJSON ¶ added in v1.0.0
func (r RawSessionEventData) MarshalJSON() ([]byte, error)
MarshalJSON returns the original raw JSON so round-tripping preserves the payload.
func (RawSessionEventData) Type ¶ added in v1.0.0
func (r RawSessionEventData) Type() SessionEventType
type RawSessionOpenParamsData ¶ added in v1.0.1
type RawSessionOpenParamsData struct {
Discriminator SessionOpenParamsKind
Raw json.RawMessage
}
func (RawSessionOpenParamsData) Kind ¶ added in v1.0.1
func (r RawSessionOpenParamsData) Kind() SessionOpenParamsKind
func (RawSessionOpenParamsData) MarshalJSON ¶ added in v1.0.1
func (r RawSessionOpenParamsData) MarshalJSON() ([]byte, error)
type RawSlashCommandInvocationResultData ¶ added in v1.0.0
type RawSlashCommandInvocationResultData struct {
Discriminator SlashCommandInvocationResultKind
Raw json.RawMessage
}
func (RawSlashCommandInvocationResultData) Kind ¶ added in v1.0.0
func (r RawSlashCommandInvocationResultData) Kind() SlashCommandInvocationResultKind
func (RawSlashCommandInvocationResultData) MarshalJSON ¶ added in v1.0.0
func (r RawSlashCommandInvocationResultData) MarshalJSON() ([]byte, error)
type RawSystemNotification ¶ added in v1.0.0
type RawSystemNotification struct {
Discriminator SystemNotificationType
Raw json.RawMessage
}
func (RawSystemNotification) MarshalJSON ¶ added in v1.0.0
func (r RawSystemNotification) MarshalJSON() ([]byte, error)
func (RawSystemNotification) Type ¶ added in v1.0.0
func (r RawSystemNotification) Type() SystemNotificationType
type RawTaskInfoData ¶ added in v1.0.0
type RawTaskInfoData struct {
Discriminator TaskInfoType
Raw json.RawMessage
}
func (RawTaskInfoData) MarshalJSON ¶ added in v1.0.0
func (r RawTaskInfoData) MarshalJSON() ([]byte, error)
func (RawTaskInfoData) Type ¶ added in v1.0.0
func (r RawTaskInfoData) Type() TaskInfoType
type RawTaskProgressData ¶ added in v1.0.0
type RawTaskProgressData struct {
Discriminator TaskProgressType
Raw json.RawMessage
}
func (RawTaskProgressData) MarshalJSON ¶ added in v1.0.0
func (r RawTaskProgressData) MarshalJSON() ([]byte, error)
func (RawTaskProgressData) Type ¶ added in v1.0.0
func (r RawTaskProgressData) Type() TaskProgressType
type RawToolExecutionCompleteContent ¶ added in v1.0.0
type RawToolExecutionCompleteContent struct {
Discriminator ToolExecutionCompleteContentType
Raw json.RawMessage
}
func (RawToolExecutionCompleteContent) MarshalJSON ¶ added in v1.0.0
func (r RawToolExecutionCompleteContent) MarshalJSON() ([]byte, error)
func (RawToolExecutionCompleteContent) Type ¶ added in v1.0.0
func (r RawToolExecutionCompleteContent) Type() ToolExecutionCompleteContentType
type RawUIElicitationSchemaPropertyData ¶ added in v1.0.0
type RawUIElicitationSchemaPropertyData struct {
Discriminator UIElicitationSchemaPropertyType
Raw json.RawMessage
}
func (RawUIElicitationSchemaPropertyData) MarshalJSON ¶ added in v1.0.0
func (r RawUIElicitationSchemaPropertyData) MarshalJSON() ([]byte, error)
func (RawUIElicitationSchemaPropertyData) Type ¶ added in v1.0.0
func (r RawUIElicitationSchemaPropertyData) Type() UIElicitationSchemaPropertyType
type RawUserToolSessionApprovalData ¶ added in v1.0.0
type RawUserToolSessionApprovalData struct {
Discriminator UserToolSessionApprovalKind
Raw json.RawMessage
}
func (RawUserToolSessionApprovalData) Kind ¶ added in v1.0.0
func (r RawUserToolSessionApprovalData) Kind() UserToolSessionApprovalKind
func (RawUserToolSessionApprovalData) MarshalJSON ¶ added in v1.0.0
func (r RawUserToolSessionApprovalData) MarshalJSON() ([]byte, error)
type ReasoningSummary ¶ added in v1.0.0
type ReasoningSummary string
Reasoning summary mode to request for supported model clients Experimental: ReasoningSummary is part of an experimental API and may change or be removed.
const ( // Request a concise summary of the model's reasoning. ReasoningSummaryConcise ReasoningSummary = "concise" // Request a detailed summary of the model's reasoning. ReasoningSummaryDetailed ReasoningSummary = "detailed" // Do not request reasoning summaries from the model. ReasoningSummaryNone ReasoningSummary = "none" )
type RegisterEventInterestParams ¶ added in v1.0.0
type RegisterEventInterestParams struct {
// The event type the consumer wants the runtime to treat as 'observed' for
// behavior-switching gating. Some runtime code paths inspect whether any consumer is
// interested in a specific event type and choose a different implementation accordingly
// (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full
// interactive OAuth flow to the consumer; when no interest is registered the runtime
// installs a browserless fallback that silently reuses cached tokens). SDK clients that
// long-poll events do NOT automatically appear as listeners to these gating checks — they
// must explicitly call `registerInterest` for each event type they want the runtime to
// count as having a consumer. Multiple registrations for the same event type from the same
// or different consumers are tracked independently and must each be released. See:
// `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`,
// `user_input.requested`, `elicitation.requested`, `command.queued`,
// `exit_plan_mode.requested`.
EventType string `json:"eventType"`
}
Event type to register consumer interest for, used by runtime gating logic. Experimental: RegisterEventInterestParams is part of an experimental API and may change or be removed.
type RegisterEventInterestResult ¶ added in v1.0.0
type RegisterEventInterestResult struct {
// Opaque handle for this registration. Pass to releaseInterest to release. Each call to
// registerInterest produces a fresh handle, even when the same eventType is registered
// multiple times.
Handle string `json:"handle"`
}
Opaque handle representing an event-type interest registration. Experimental: RegisterEventInterestResult is part of an experimental API and may change or be removed.
type RegisterExtensionToolsParams ¶ added in v1.0.1
type RegisterExtensionToolsParams struct {
// In-process ExtensionLoader handle (CLI-only optimization). Marked internal: this field is
// excluded from the public SDK surface. When the CLI migrates to a process-separated SDK,
// extension discovery/launch moves entirely into the runtime — the CLI passes pure config
// (search paths, disabled ids) via SessionOptions instead.
// Internal: Loader is part of the SDK's internal API surface and is not intended for
// external use.
Loader any `json:"loader"`
// Optional registration options.
Options *SessionsRegisterExtensionToolsOnSessionOptions `json:"options,omitempty"`
// Session to register extension tools on.
SessionID string `json:"sessionId"`
}
Params to attach an extension loader's tools to a session. Experimental: RegisterExtensionToolsParams is part of an experimental API and may change or be removed. Internal: RegisterExtensionToolsParams is an internal SDK API and is not part of the public surface.
type RegisterExtensionToolsResult ¶ added in v1.0.1
type RegisterExtensionToolsResult struct {
// In-process unsubscribe function (CLI-only optimization). Marked internal: replaced by an
// explicit `extensions.unregister` RPC in the SDK migration.
// Internal: Unsubscribe is part of the SDK's internal API surface and is not intended for
// external use.
Unsubscribe any `json:"unsubscribe"`
}
Handle for releasing the extension tool registration. Experimental: RegisterExtensionToolsResult is part of an experimental API and may change or be removed. Internal: RegisterExtensionToolsResult is an internal SDK API and is not part of the public surface.
type ReleaseEventInterestParams ¶ added in v1.0.0
type ReleaseEventInterestParams struct {
// Handle returned by a previous `registerInterest` call. Idempotent: releasing an unknown
// or already-released handle is a no-op (returns success). When the last outstanding handle
// for an event type is released, the runtime reverts to its 'no consumer' code path for
// that event type.
Handle string `json:"handle"`
}
Opaque handle previously returned by `registerInterest` to release. Experimental: ReleaseEventInterestParams is part of an experimental API and may change or be removed.
type RemoteAPI ¶ added in v1.0.0
type RemoteAPI sessionAPI
Experimental: RemoteAPI contains experimental APIs that may change or be removed.
func (*RemoteAPI) Disable ¶ added in v1.0.0
func (a *RemoteAPI) Disable(ctx context.Context) (*SessionRemoteDisableResult, error)
Disables remote session export and steering.
RPC method: session.remote.disable.
func (*RemoteAPI) Enable ¶ added in v1.0.0
func (a *RemoteAPI) Enable(ctx context.Context, params *RemoteEnableRequest) (*RemoteEnableResult, error)
Enables remote session export or steering.
RPC method: session.remote.enable.
Parameters: Optional remote session mode ("off", "export", or "on"); defaults to enabling both export and remote steering.
Returns: GitHub URL for the session and a flag indicating whether remote steering is enabled.
func (*RemoteAPI) NotifySteerableChanged ¶ added in v1.0.0
func (a *RemoteAPI) NotifySteerableChanged(ctx context.Context, params *RemoteNotifySteerableChangedRequest) (*RemoteNotifySteerableChangedResult, error)
NotifySteerableChanged persists a remote-steerability change emitted by the host as a session event.
RPC method: session.remote.notifySteerableChanged.
Parameters: New remote-steerability state to persist as a `session.remote_steerable_changed` event.
Returns: Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own.
type RemoteControlConfig ¶ added in v1.0.1
type RemoteControlConfig struct {
// Reattach to an existing MC session without creating a new one.
ExistingMcSession *RemoteControlConfigExistingMcSession `json:"existingMcSession,omitempty"`
// Whether the user explicitly requested remote (vs. implicit session-sync). Controls
// warning surfacing for missing-repo cases.
Explicit bool `json:"explicit"`
// Whether remote export should be enabled.
Remote bool `json:"remote"`
// When true, suppresses timeline messages on successful setup.
Silent bool `json:"silent"`
// Whether the MC session may steer the local session (write mode).
Steerable bool `json:"steerable"`
// Existing Mission Control task ID to attach the exported session to.
TaskID *string `json:"taskId,omitempty"`
}
Configuration for the runtime-managed remote-control singleton. Experimental: RemoteControlConfig is part of an experimental API and may change or be removed.
type RemoteControlConfigExistingMcSession ¶ added in v1.0.1
type RemoteControlConfigExistingMcSession struct {
// Existing MC session ID to reattach to.
McSessionID string `json:"mcSessionId"`
// Existing MC task ID for the reattached session.
McTaskID string `json:"mcTaskId"`
}
Reattach to an existing MC session without creating a new one. Experimental: RemoteControlConfigExistingMcSession is part of an experimental API and may change or be removed.
type RemoteControlStatus ¶ added in v1.0.1
type RemoteControlStatus interface {
State() RemoteControlStatusState
// contains filtered or unexported methods
}
State of the runtime-managed remote-control singleton. Experimental: RemoteControlStatus is part of an experimental API and may change or be removed.
type RemoteControlStatusActive ¶ added in v1.0.1
type RemoteControlStatusActive struct {
// Session id remote control is pointed at.
AttachedSessionID string `json:"attachedSessionId"`
// MC frontend URL for this session, when known.
FrontendURL *string `json:"frontendUrl,omitempty"`
// Whether the MC session may steer this session.
IsSteerable bool `json:"isSteerable"`
// In-process prompt-manager handle (CLI-only optimization). Marked internal: this field is
// excluded from the public SDK surface. When the CLI migrates to a process-separated SDK,
// the same bidirectional prompt-routing handshake is expressed via dedicated remote-control
// RPCs (register/resolve) rather than a shared in-process object.
// Internal: PromptManager is part of the SDK's internal API surface and is not intended for
// external use.
PromptManager any `json:"promptManager,omitempty"`
}
Remote control is connected to a local session. Experimental: RemoteControlStatusActive is part of an experimental API and may change or be removed.
func (RemoteControlStatusActive) MarshalJSON ¶ added in v1.0.1
func (r RemoteControlStatusActive) MarshalJSON() ([]byte, error)
func (RemoteControlStatusActive) State ¶ added in v1.0.1
func (RemoteControlStatusActive) State() RemoteControlStatusState
type RemoteControlStatusConnecting ¶ added in v1.0.1
type RemoteControlStatusConnecting struct {
// Session id the connection is attaching to.
AttachedSessionID string `json:"attachedSessionId"`
}
Remote control is in the middle of initial setup. Experimental: RemoteControlStatusConnecting is part of an experimental API and may change or be removed.
func (RemoteControlStatusConnecting) MarshalJSON ¶ added in v1.0.1
func (r RemoteControlStatusConnecting) MarshalJSON() ([]byte, error)
func (RemoteControlStatusConnecting) State ¶ added in v1.0.1
func (RemoteControlStatusConnecting) State() RemoteControlStatusState
type RemoteControlStatusError ¶ added in v1.0.1
type RemoteControlStatusError struct {
// Session id the failing setup attempt targeted, when known.
AttachedSessionID *string `json:"attachedSessionId,omitempty"`
// Human-readable error message from the last setup attempt.
Error string `json:"error"`
}
The last setup attempt failed. The singleton is otherwise off. Experimental: RemoteControlStatusError is part of an experimental API and may change or be removed.
func (RemoteControlStatusError) MarshalJSON ¶ added in v1.0.1
func (r RemoteControlStatusError) MarshalJSON() ([]byte, error)
func (RemoteControlStatusError) State ¶ added in v1.0.1
func (RemoteControlStatusError) State() RemoteControlStatusState
type RemoteControlStatusOff ¶ added in v1.0.1
type RemoteControlStatusOff struct {
}
Remote control is not connected. Experimental: RemoteControlStatusOff is part of an experimental API and may change or be removed.
func (RemoteControlStatusOff) MarshalJSON ¶ added in v1.0.1
func (r RemoteControlStatusOff) MarshalJSON() ([]byte, error)
func (RemoteControlStatusOff) State ¶ added in v1.0.1
func (RemoteControlStatusOff) State() RemoteControlStatusState
type RemoteControlStatusResult ¶ added in v1.0.1
type RemoteControlStatusResult struct {
// State of the runtime-managed remote-control singleton.
Status RemoteControlStatus `json:"status"`
}
Wrapper for the singleton's current status. Experimental: RemoteControlStatusResult is part of an experimental API and may change or be removed.
func (*RemoteControlStatusResult) UnmarshalJSON ¶ added in v1.0.1
func (r *RemoteControlStatusResult) UnmarshalJSON(data []byte) error
type RemoteControlStatusState ¶ added in v1.0.1
type RemoteControlStatusState string
State discriminator for RemoteControlStatus.
const ( RemoteControlStatusStateActive RemoteControlStatusState = "active" RemoteControlStatusStateConnecting RemoteControlStatusState = "connecting" RemoteControlStatusStateError RemoteControlStatusState = "error" RemoteControlStatusStateOff RemoteControlStatusState = "off" )
type RemoteControlStopResult ¶ added in v1.0.1
type RemoteControlStopResult struct {
// State of the runtime-managed remote-control singleton.
Status RemoteControlStatus `json:"status"`
// Whether the singleton was actually torn down by this call.
Stopped bool `json:"stopped"`
}
Outcome of a stopRemoteControl call. Experimental: RemoteControlStopResult is part of an experimental API and may change or be removed.
func (*RemoteControlStopResult) UnmarshalJSON ¶ added in v1.0.1
func (r *RemoteControlStopResult) UnmarshalJSON(data []byte) error
type RemoteControlTransferResult ¶ added in v1.0.1
type RemoteControlTransferResult struct {
// State of the runtime-managed remote-control singleton.
Status RemoteControlStatus `json:"status"`
// Whether the rebinding actually happened.
Transferred bool `json:"transferred"`
}
Outcome of a transferRemoteControl call. Experimental: RemoteControlTransferResult is part of an experimental API and may change or be removed.
func (*RemoteControlTransferResult) UnmarshalJSON ¶ added in v1.0.1
func (r *RemoteControlTransferResult) UnmarshalJSON(data []byte) error
type RemoteEnableRequest ¶ added in v1.0.0
type RemoteEnableRequest struct {
// Per-session remote mode. "off" disables remote, "export" exports session events to GitHub
// without enabling remote steering, "on" enables both export and remote steering.
Mode *RemoteSessionMode `json:"mode,omitempty"`
}
Optional remote session mode ("off", "export", or "on"); defaults to enabling both export and remote steering. Experimental: RemoteEnableRequest is part of an experimental API and may change or be removed.
type RemoteEnableResult ¶ added in v1.0.0
type RemoteEnableResult struct {
// Whether remote steering is enabled
RemoteSteerable bool `json:"remoteSteerable"`
// GitHub frontend URL for this session
URL *string `json:"url,omitempty"`
}
GitHub URL for the session and a flag indicating whether remote steering is enabled. Experimental: RemoteEnableResult is part of an experimental API and may change or be removed.
type RemoteNotifySteerableChangedRequest ¶ added in v1.0.0
type RemoteNotifySteerableChangedRequest struct {
// Whether the session now supports remote steering via GitHub. The runtime persists this as
// a `session.remote_steerable_changed` event so resume/replay sees the up-to-date
// capability.
RemoteSteerable bool `json:"remoteSteerable"`
}
New remote-steerability state to persist as a `session.remote_steerable_changed` event. Experimental: RemoteNotifySteerableChangedRequest is part of an experimental API and may change or be removed.
type RemoteNotifySteerableChangedResult ¶ added in v1.0.0
type RemoteNotifySteerableChangedResult struct {
}
Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own. Experimental: RemoteNotifySteerableChangedResult is part of an experimental API and may change or be removed.
type RemoteSessionConnectionResult ¶ added in v1.0.0
type RemoteSessionConnectionResult struct {
// Metadata for a connected remote session.
Metadata ConnectedRemoteSessionMetadata `json:"metadata"`
// SDK session ID for the connected remote session.
SessionID string `json:"sessionId"`
}
Remote session connection result. Experimental: RemoteSessionConnectionResult is part of an experimental API and may change or be removed.
type RemoteSessionMetadataRepository ¶ added in v1.0.1
type RemoteSessionMetadataRepository struct {
// Branch associated with the remote session.
Branch string `json:"branch"`
// Repository name.
Name string `json:"name"`
// Repository owner.
Owner string `json:"owner"`
}
GitHub repository the remote session belongs to. Experimental: RemoteSessionMetadataRepository is part of an experimental API and may change or be removed.
type RemoteSessionMetadataTaskType ¶ added in v1.0.1
type RemoteSessionMetadataTaskType string
Whether the remote task originated from CCA or CLI `--remote`. Experimental: RemoteSessionMetadataTaskType is part of an experimental API and may change or be removed.
const ( // GitHub Copilot coding agent task. RemoteSessionMetadataTaskTypeCca RemoteSessionMetadataTaskType = "cca" // CLI remote task. RemoteSessionMetadataTaskTypeCLI RemoteSessionMetadataTaskType = "cli" )
type RemoteSessionMetadataValue ¶ added in v1.0.1
type RemoteSessionMetadataValue struct {
// Most recent working directory context.
Context *SessionContext `json:"context,omitempty"`
// Last-modified time as an ISO 8601 timestamp.
ModifiedTime string `json:"modifiedTime"`
// Optional human-friendly name set via /rename.
Name *string `json:"name,omitempty"`
// Pull request number associated with the session.
PullRequestNumber *int64 `json:"pullRequestNumber,omitempty"`
// Backing remote session IDs (most recent first).
RemoteSessionIDs []string `json:"remoteSessionIds"`
// GitHub repository the remote session belongs to.
Repository RemoteSessionMetadataRepository `json:"repository"`
// Original remote resource identifier (task ID or PR node ID).
ResourceID *string `json:"resourceId,omitempty"`
// Stable session identifier.
SessionID string `json:"sessionId"`
// Deadline (ISO 8601) at which a CLI remote session becomes stale without further
// heartbeats.
StaleAt *string `json:"staleAt,omitempty"`
// Session creation time as an ISO 8601 timestamp.
StartTime string `json:"startTime"`
// Server-side task state returned by GitHub.
State *string `json:"state,omitempty"`
// Short summary of the session, when one has been derived.
Summary *string `json:"summary,omitempty"`
// Whether the remote task originated from CCA or CLI `--remote`.
TaskType *RemoteSessionMetadataTaskType `json:"taskType,omitempty"`
}
Remote session metadata for the session to hand off (typically obtained from `sessions.list` with `source: "remote"`). Experimental: RemoteSessionMetadataValue is part of an experimental API and may change or be removed.
func (RemoteSessionMetadataValue) MarshalJSON ¶ added in v1.0.1
func (r RemoteSessionMetadataValue) MarshalJSON() ([]byte, error)
type RemoteSessionMode ¶ added in v1.0.0
type RemoteSessionMode string
Per-session remote mode. "off" disables remote, "export" exports session events to GitHub without enabling remote steering, "on" enables both export and remote steering. Experimental: RemoteSessionMode is part of an experimental API and may change or be removed.
const ( // Export session events to GitHub without enabling remote steering. RemoteSessionModeExport RemoteSessionMode = "export" // Disable remote session export and steering. RemoteSessionModeOff RemoteSessionMode = "off" // Enable both remote session export and remote steering. RemoteSessionModeOn RemoteSessionMode = "on" )
type RemoteSessionRepository ¶ added in v1.0.1
type RemoteSessionRepository struct {
// Optional branch associated with the remote session.
Branch *string `json:"branch,omitempty"`
// Repository name.
Name string `json:"name"`
// Repository owner or organization login.
Owner string `json:"owner"`
}
Repository context for the remote session. Experimental: RemoteSessionRepository is part of an experimental API and may change or be removed.
type RuntimeShutdownResult ¶ added in v1.0.0
type RuntimeShutdownResult struct {
}
type SamplingCompletedData ¶ added in v1.0.0
type SamplingCompletedData struct {
// Request ID of the resolved sampling request; clients should dismiss any UI for this request
RequestID string `json:"requestId"`
}
Sampling request completion notification signaling UI dismissal
func (*SamplingCompletedData) Type ¶ added in v1.0.0
func (*SamplingCompletedData) Type() SessionEventType
type SamplingRequestedData ¶ added in v1.0.0
type SamplingRequestedData struct {
// The JSON-RPC request ID from the MCP protocol
MCPRequestID any `json:"mcpRequestId"`
// Unique identifier for this sampling request; used to respond via session.respondToSampling()
RequestID string `json:"requestId"`
// Name of the MCP server that initiated the sampling request
ServerName string `json:"serverName"`
}
Sampling request from an MCP server; contains the server name and a requestId for correlation
func (*SamplingRequestedData) Type ¶ added in v1.0.0
func (*SamplingRequestedData) Type() SessionEventType
type SandboxConfig ¶ added in v1.0.1
type SandboxConfig struct {
// Whether to auto-add the current working directory to readwritePaths. Default: true.
AddCurrentWorkingDirectory *bool `json:"addCurrentWorkingDirectory,omitempty"`
// Raw `ContainerConfig` (per `@microsoft/mxc-sdk`) passed directly to
// `spawnSandboxFromConfig`, bypassing policy merging.
Config map[string]any `json:"config,omitzero"`
// Whether sandboxing is enabled for the session.
Enabled bool `json:"enabled"`
// User-managed sandbox policy fragment merged into the auto-discovered base policy.
UserPolicy *SandboxConfigUserPolicy `json:"userPolicy,omitempty"`
}
Resolved sandbox configuration. Experimental: SandboxConfig is part of an experimental API and may change or be removed.
type SandboxConfigUserPolicy ¶ added in v1.0.1
type SandboxConfigUserPolicy struct {
// Platform-specific experimental policy fields.
Experimental *SandboxConfigUserPolicyExperimental `json:"experimental,omitempty"`
// Filesystem rules to merge into the base policy.
Filesystem *SandboxConfigUserPolicyFilesystem `json:"filesystem,omitempty"`
// Network rules to merge into the base policy.
Network *SandboxConfigUserPolicyNetwork `json:"network,omitempty"`
}
User-managed sandbox policy fragment merged into the auto-discovered base policy. Experimental: SandboxConfigUserPolicy is part of an experimental API and may change or be removed.
type SandboxConfigUserPolicyExperimental ¶ added in v1.0.1
type SandboxConfigUserPolicyExperimental struct {
// macOS seatbelt experimental options.
Seatbelt *SandboxConfigUserPolicyExperimentalSeatbelt `json:"seatbelt,omitempty"`
}
Platform-specific experimental policy fields. Experimental: SandboxConfigUserPolicyExperimental is part of an experimental API and may change or be removed.
type SandboxConfigUserPolicyExperimentalSeatbelt ¶ added in v1.0.1
type SandboxConfigUserPolicyExperimentalSeatbelt struct {
// Whether the macOS seatbelt profile may access the keychain.
KeychainAccess *bool `json:"keychainAccess,omitempty"`
}
macOS seatbelt experimental options. Experimental: SandboxConfigUserPolicyExperimentalSeatbelt is part of an experimental API and may change or be removed.
type SandboxConfigUserPolicyFilesystem ¶ added in v1.0.1
type SandboxConfigUserPolicyFilesystem struct {
// Whether to clear the policy when the session exits.
ClearPolicyOnExit *bool `json:"clearPolicyOnExit,omitempty"`
// Paths explicitly denied.
DeniedPaths []string `json:"deniedPaths,omitzero"`
// Paths granted read-only access.
ReadonlyPaths []string `json:"readonlyPaths,omitzero"`
// Paths granted read/write access.
ReadwritePaths []string `json:"readwritePaths,omitzero"`
}
Filesystem rules to merge into the base policy. Experimental: SandboxConfigUserPolicyFilesystem is part of an experimental API and may change or be removed.
type SandboxConfigUserPolicyNetwork ¶ added in v1.0.1
type SandboxConfigUserPolicyNetwork struct {
// Hosts allowed in addition to the base policy.
AllowedHosts []string `json:"allowedHosts,omitzero"`
// Whether traffic to local/loopback addresses is allowed.
AllowLocalNetwork *bool `json:"allowLocalNetwork,omitempty"`
// Whether outbound network traffic is allowed at all.
AllowOutbound *bool `json:"allowOutbound,omitempty"`
// Hosts explicitly blocked.
BlockedHosts []string `json:"blockedHosts,omitzero"`
}
Network rules to merge into the base policy. Experimental: SandboxConfigUserPolicyNetwork is part of an experimental API and may change or be removed.
type ScheduleAPI ¶ added in v1.0.0
type ScheduleAPI sessionAPI
Experimental: ScheduleAPI contains experimental APIs that may change or be removed.
func (*ScheduleAPI) List ¶ added in v1.0.0
func (a *ScheduleAPI) List(ctx context.Context) (*ScheduleList, error)
Lists the session's currently active scheduled prompts.
RPC method: session.schedule.list.
Returns: Snapshot of the currently active recurring prompts for this session.
func (*ScheduleAPI) Stop ¶ added in v1.0.0
func (a *ScheduleAPI) Stop(ctx context.Context, params *ScheduleStopRequest) (*ScheduleStopResult, error)
Stop removes a scheduled prompt by id.
RPC method: session.schedule.stop.
Parameters: Identifier of the scheduled prompt to remove.
Returns: Remove a scheduled prompt by id. The result entry is omitted if the id was unknown.
type ScheduleEntry ¶ added in v1.0.0
type ScheduleEntry struct {
// Absolute fire time (epoch milliseconds) for a one-shot calendar schedule.
At *int64 `json:"at,omitempty"`
// 5-field cron expression for a recurring calendar schedule, evaluated in `tz`.
Cron *string `json:"cron,omitempty"`
// Display-only label for the prompt as shown in the UI (e.g. `/skill-name` for a
// skill-invocation schedule). The actual enqueued prompt is `prompt`.
DisplayPrompt *string `json:"displayPrompt,omitempty"`
// Sequential id assigned by the runtime within the session. Stable across resumes (rebuilt
// from the event log).
ID int64 `json:"id"`
// Interval between scheduled ticks, in milliseconds (relative-interval schedules).
IntervalMs *int64 `json:"intervalMs,omitempty"`
// ISO 8601 timestamp when the next tick is scheduled to fire.
NextRunAt time.Time `json:"nextRunAt"`
// Prompt text that gets enqueued on every tick.
Prompt string `json:"prompt"`
// Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`).
Recurring bool `json:"recurring"`
// IANA timezone the `cron` expression is evaluated in.
Tz *string `json:"tz,omitempty"`
}
Schema for the `ScheduleEntry` type. Experimental: ScheduleEntry is part of an experimental API and may change or be removed.
type ScheduleList ¶ added in v1.0.0
type ScheduleList struct {
// Active scheduled prompts, ordered by id.
Entries []ScheduleEntry `json:"entries"`
}
Snapshot of the currently active recurring prompts for this session. Experimental: ScheduleList is part of an experimental API and may change or be removed.
type ScheduleStopRequest ¶ added in v1.0.0
type ScheduleStopRequest struct {
// Id of the scheduled prompt to remove.
ID int64 `json:"id"`
}
Identifier of the scheduled prompt to remove. Experimental: ScheduleStopRequest is part of an experimental API and may change or be removed.
type ScheduleStopResult ¶ added in v1.0.0
type ScheduleStopResult struct {
// The removed entry, or omitted if no entry matched.
Entry *ScheduleEntry `json:"entry,omitempty"`
}
Remove a scheduled prompt by id. The result entry is omitted if the id was unknown. Experimental: ScheduleStopResult is part of an experimental API and may change or be removed.
type SecretsAddFilterValuesRequest ¶ added in v1.0.0
type SecretsAddFilterValuesRequest struct {
// Raw secret values to register for redaction
Values []string `json:"values"`
}
Secret values to add to the redaction filter.
type SecretsAddFilterValuesResult ¶ added in v1.0.0
type SecretsAddFilterValuesResult struct {
// Whether the values were successfully registered
Ok bool `json:"ok"`
}
Confirmation that the secret values were registered.
type SendAgentMode ¶ added in v1.0.0
type SendAgentMode string
The UI mode the agent was in when this message was sent. Defaults to the session's current mode. Experimental: SendAgentMode is part of an experimental API and may change or be removed.
const ( // The agent is working autonomously toward task completion. SendAgentModeAutopilot SendAgentMode = "autopilot" // The agent is responding interactively to the user. SendAgentModeInteractive SendAgentMode = "interactive" // The agent is preparing a plan before making changes. SendAgentModePlan SendAgentMode = "plan" // The agent is in shell-focused UI mode. SendAgentModeShell SendAgentMode = "shell" )
type SendAttachmentsToMessageParams ¶ added in v1.0.0
type SendAttachmentsToMessageParams struct {
// Attachments to push into the next user-message turn. extension_context entries take the
// slim shape; standard variants take their full AttachmentSchema shape.
Attachments []PushAttachment `json:"attachments"`
// 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.
InstanceID *string `json:"instanceId,omitempty"`
}
Parameters for session.extensions.sendAttachmentsToMessage. Experimental: SendAttachmentsToMessageParams is part of an experimental API and may change or be removed.
func (*SendAttachmentsToMessageParams) UnmarshalJSON ¶ added in v1.0.0
func (r *SendAttachmentsToMessageParams) UnmarshalJSON(data []byte) error
type SendMode ¶ added in v1.0.0
type SendMode string
How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn. Experimental: SendMode is part of an experimental API and may change or be removed.
type SendRequest ¶ added in v1.0.0
type SendRequest struct {
// The UI mode the agent was in when this message was sent. Defaults to the session's
// current mode.
AgentMode *SendAgentMode `json:"agentMode,omitempty"`
// Optional attachments (files, directories, selections, blobs, GitHub references) to
// include with the message
Attachments []Attachment `json:"attachments,omitzero"`
// If false, this message will not trigger a Premium Request Unit charge. User messages
// default to billable.
Billable *bool `json:"billable,omitempty"`
// If provided, this is shown in the timeline instead of `prompt`
DisplayPrompt *string `json:"displayPrompt,omitempty"`
// How to deliver the message. `enqueue` (default) appends to the message queue. `immediate`
// interjects during an in-progress turn.
Mode *SendMode `json:"mode,omitempty"`
// If true, adds the message to the front of the queue instead of the end
Prepend *bool `json:"prepend,omitempty"`
// The user message text
Prompt string `json:"prompt"`
// Custom HTTP headers to include in outbound model requests for this turn. Merged with
// session-level provider headers; per-turn headers augment and overwrite session-level
// headers with the same key.
RequestHeaders map[string]string `json:"requestHeaders,omitzero"`
// If set, the request will fail if the named tool is not available when this message is
// among the user messages at the start of the current exchange
RequiredTool *string `json:"requiredTool,omitempty"`
// Optional provenance tag copied to the resulting user.message event. Must match one of
// three forms: the literal `system`, `command-<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.
// Internal: Source is part of the SDK's internal API surface and is not intended for
// external use.
Source *string `json:"source,omitempty"`
// W3C Trace Context traceparent header for distributed tracing of this agent turn
Traceparent *string `json:"traceparent,omitempty"`
// W3C Trace Context tracestate header for distributed tracing
Tracestate *string `json:"tracestate,omitempty"`
// 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.
Wait *bool `json:"wait,omitempty"`
}
Parameters for sending a user message to the session Experimental: SendRequest is part of an experimental API and may change or be removed.
func (*SendRequest) UnmarshalJSON ¶ added in v1.0.0
func (r *SendRequest) UnmarshalJSON(data []byte) error
type SendResult ¶ added in v1.0.0
type SendResult struct {
// Unique identifier assigned to the message
MessageID string `json:"messageId"`
}
Result of sending a user message Experimental: SendResult is part of an experimental API and may change or be removed.
type ServerAccountAPI ¶ added in v1.0.0
type ServerAccountAPI serverAPI
func (*ServerAccountAPI) GetQuota ¶ added in v1.0.0
func (a *ServerAccountAPI) GetQuota(ctx context.Context, params *AccountGetQuotaRequest) (*AccountGetQuotaResult, error)
GetQuota gets Copilot quota usage for the authenticated user or supplied GitHub token.
RPC method: account.getQuota.
Parameters: Optional GitHub token used to look up quota for a specific user instead of the global auth context.
Returns: Quota usage snapshots for the resolved user, keyed by quota type.
type ServerAgentList ¶ added in v1.0.1
type ServerAgentList struct {
// All discovered agents across all sources
Agents []AgentInfo `json:"agents"`
}
Agents discovered across user, project, plugin, and remote sources. Experimental: ServerAgentList is part of an experimental API and may change or be removed.
type ServerAgentRegistryAPI ¶ added in v1.0.0
type ServerAgentRegistryAPI serverAPI
Experimental: ServerAgentRegistryAPI contains experimental APIs that may change or be removed.
func (*ServerAgentRegistryAPI) Spawn ¶ added in v1.0.0
func (a *ServerAgentRegistryAPI) Spawn(ctx context.Context, params *AgentRegistrySpawnRequest) (AgentRegistrySpawnResult, error)
Spawns a managed-server child with the supplied configuration and returns a discriminated-union result. The caller (typically the CLI controller) is responsible for attaching to the spawned child and sending any follow-up prompt. When the controller-local spawn gate is closed the server returns JSON-RPC MethodNotFound.
RPC method: agentRegistry.spawn.
Parameters: Inputs to spawn a managed-server child via the controller's spawn delegate.
Returns: Outcome of an agentRegistry.spawn call.
type ServerAgentsAPI ¶ added in v1.0.1
type ServerAgentsAPI serverAPI
Experimental: ServerAgentsAPI contains experimental APIs that may change or be removed.
func (*ServerAgentsAPI) Discover ¶ added in v1.0.1
func (a *ServerAgentsAPI) Discover(ctx context.Context, params *AgentsDiscoverRequest) (*ServerAgentList, error)
Discovers custom agents across user, project, plugin, and remote sources.
RPC method: agents.discover.
Parameters: Optional project paths to include in agent discovery.
Returns: Agents discovered across user, project, plugin, and remote sources.
type ServerInstructionSourceList ¶ added in v1.0.1
type ServerInstructionSourceList struct {
// All discovered instruction sources
Sources []InstructionSource `json:"sources"`
}
Instruction sources discovered across user, repository, and plugin sources. Experimental: ServerInstructionSourceList is part of an experimental API and may change or be removed.
type ServerInstructionsAPI ¶ added in v1.0.1
type ServerInstructionsAPI serverAPI
Experimental: ServerInstructionsAPI contains experimental APIs that may change or be removed.
func (*ServerInstructionsAPI) Discover ¶ added in v1.0.1
func (a *ServerInstructionsAPI) Discover(ctx context.Context, params *InstructionsDiscoverRequest) (*ServerInstructionSourceList, error)
Discovers instruction sources across user, repository, and plugin sources.
RPC method: instructions.discover.
Parameters: Optional project paths to include in instruction discovery.
Returns: Instruction sources discovered across user, repository, and plugin sources.
type ServerMCPAPI ¶ added in v1.0.0
type ServerMCPAPI serverAPI
func (*ServerMCPAPI) Config ¶ added in v1.0.0
func (s *ServerMCPAPI) Config() *ServerMCPConfigAPI
func (*ServerMCPAPI) Discover ¶ added in v1.0.0
func (a *ServerMCPAPI) Discover(ctx context.Context, params *MCPDiscoverRequest) (*MCPDiscoverResult, error)
Discovers MCP servers from user, workspace, plugin, and builtin sources.
RPC method: mcp.discover.
Parameters: Optional working directory used as context for MCP server discovery.
Returns: MCP servers discovered from user, workspace, plugin, and built-in sources.
type ServerMCPConfigAPI ¶ added in v1.0.0
type ServerMCPConfigAPI serverAPI
func (*ServerMCPConfigAPI) Add ¶ added in v1.0.0
func (a *ServerMCPConfigAPI) Add(ctx context.Context, params *MCPConfigAddRequest) (*MCPConfigAddResult, error)
Adds an MCP server to user configuration.
RPC method: mcp.config.add.
Parameters: MCP server name and configuration to add to user configuration.
func (*ServerMCPConfigAPI) Disable ¶ added in v1.0.0
func (a *ServerMCPConfigAPI) Disable(ctx context.Context, params *MCPConfigDisableRequest) (*MCPConfigDisableResult, error)
Disables MCP servers in user configuration for new sessions.
RPC method: mcp.config.disable.
Parameters: MCP server names to disable for new sessions.
func (*ServerMCPConfigAPI) Enable ¶ added in v1.0.0
func (a *ServerMCPConfigAPI) Enable(ctx context.Context, params *MCPConfigEnableRequest) (*MCPConfigEnableResult, error)
Enables MCP servers in user configuration for new sessions.
RPC method: mcp.config.enable.
Parameters: MCP server names to enable for new sessions.
func (*ServerMCPConfigAPI) List ¶ added in v1.0.0
func (a *ServerMCPConfigAPI) List(ctx context.Context) (*MCPConfigList, error)
Lists MCP servers from user configuration.
RPC method: mcp.config.list.
Returns: User-configured MCP servers, keyed by server name.
func (*ServerMCPConfigAPI) Reload ¶ added in v1.0.0
func (a *ServerMCPConfigAPI) Reload(ctx context.Context) (*MCPConfigReloadResult, error)
Reload drops this runtime process's in-memory MCP server-definition cache so the next MCP config read observes disk.
RPC method: mcp.config.reload.
func (*ServerMCPConfigAPI) Remove ¶ added in v1.0.0
func (a *ServerMCPConfigAPI) Remove(ctx context.Context, params *MCPConfigRemoveRequest) (*MCPConfigRemoveResult, error)
Removes an MCP server from user configuration.
RPC method: mcp.config.remove.
Parameters: MCP server name to remove from user configuration.
func (*ServerMCPConfigAPI) Update ¶ added in v1.0.0
func (a *ServerMCPConfigAPI) Update(ctx context.Context, params *MCPConfigUpdateRequest) (*MCPConfigUpdateResult, error)
Updates an MCP server in user configuration.
RPC method: mcp.config.update.
Parameters: MCP server name and replacement configuration to write to user configuration.
type ServerModelsAPI ¶ added in v1.0.0
type ServerModelsAPI serverAPI
func (*ServerModelsAPI) List ¶ added in v1.0.0
func (a *ServerModelsAPI) List(ctx context.Context, params *ModelsListRequest) (*ModelList, error)
Lists Copilot models available to the authenticated user.
RPC method: models.list.
Parameters: Optional GitHub token used to list models for a specific user instead of the global auth context.
Returns: List of Copilot models available to the resolved user, including capabilities and billing metadata.
type ServerPluginsAPI ¶ added in v1.0.1
type ServerPluginsAPI serverAPI
Experimental: ServerPluginsAPI contains experimental APIs that may change or be removed.
func (*ServerPluginsAPI) Disable ¶ added in v1.0.1
func (a *ServerPluginsAPI) Disable(ctx context.Context, params *PluginsDisableRequest) (*PluginsDisableResult, error)
Disables installed plugins for new sessions.
RPC method: plugins.disable.
Parameters: Plugin names (or specs) to disable.
func (*ServerPluginsAPI) Enable ¶ added in v1.0.1
func (a *ServerPluginsAPI) Enable(ctx context.Context, params *PluginsEnableRequest) (*PluginsEnableResult, error)
Enables installed plugins for new sessions.
RPC method: plugins.enable.
Parameters: Plugin names (or specs) to enable.
func (*ServerPluginsAPI) Install ¶ added in v1.0.1
func (a *ServerPluginsAPI) Install(ctx context.Context, params *PluginsInstallRequest) (*PluginInstallResult, error)
Installs a plugin from a marketplace, GitHub repo, URL, or local path.
RPC method: plugins.install.
Parameters: Plugin source and optional working directory for relative-path resolution.
Returns: Result of installing a plugin.
func (*ServerPluginsAPI) List ¶ added in v1.0.1
func (a *ServerPluginsAPI) List(ctx context.Context) (*PluginListResult, error)
Lists plugins installed in user/global state.
RPC method: plugins.list.
Returns: Plugins installed in user/global state.
func (*ServerPluginsAPI) Marketplaces ¶ added in v1.0.1
func (s *ServerPluginsAPI) Marketplaces() *ServerPluginsMarketplacesAPI
Experimental: Marketplaces returns experimental APIs that may change or be removed.
func (*ServerPluginsAPI) Uninstall ¶ added in v1.0.1
func (a *ServerPluginsAPI) Uninstall(ctx context.Context, params *PluginsUninstallRequest) (*PluginsUninstallResult, error)
Uninstalls an installed plugin.
RPC method: plugins.uninstall.
Parameters: Name (or spec) of the plugin to uninstall.
func (*ServerPluginsAPI) Update ¶ added in v1.0.1
func (a *ServerPluginsAPI) Update(ctx context.Context, params *PluginsUpdateRequest) (*PluginUpdateResult, error)
Updates an installed plugin to its latest published version.
RPC method: plugins.update.
Parameters: Name (or spec) of the plugin to update.
Returns: Result of updating a single plugin.
func (*ServerPluginsAPI) UpdateAll ¶ added in v1.0.1
func (a *ServerPluginsAPI) UpdateAll(ctx context.Context) (*PluginUpdateAllResult, error)
UpdateAll updates every installed plugin to its latest published version.
RPC method: plugins.updateAll.
Returns: Result of updating all installed plugins.
type ServerPluginsMarketplacesAPI ¶ added in v1.0.1
type ServerPluginsMarketplacesAPI serverAPI
Experimental: ServerPluginsMarketplacesAPI contains experimental APIs that may change or be removed.
func (*ServerPluginsMarketplacesAPI) Add ¶ added in v1.0.1
func (a *ServerPluginsMarketplacesAPI) Add(ctx context.Context, params *PluginsMarketplacesAddRequest) (*MarketplaceAddResult, error)
Add registers a new marketplace from a source (owner/repo, URL, or local path).
RPC method: plugins.marketplaces.add.
Parameters: Marketplace source to register.
Returns: Result of registering a new marketplace.
func (*ServerPluginsMarketplacesAPI) Browse ¶ added in v1.0.1
func (a *ServerPluginsMarketplacesAPI) Browse(ctx context.Context, params *PluginsMarketplacesBrowseRequest) (*MarketplaceBrowseResult, error)
Browse lists plugins advertised by a registered marketplace.
RPC method: plugins.marketplaces.browse.
Parameters: Name of the marketplace whose plugin catalog to fetch.
Returns: Plugins advertised by the marketplace.
func (*ServerPluginsMarketplacesAPI) List ¶ added in v1.0.1
func (a *ServerPluginsMarketplacesAPI) List(ctx context.Context) (*MarketplaceListResult, error)
Lists all registered marketplaces (defaults + user-added).
RPC method: plugins.marketplaces.list.
Returns: All registered marketplaces, including built-in defaults.
func (*ServerPluginsMarketplacesAPI) Refresh ¶ added in v1.0.1
func (a *ServerPluginsMarketplacesAPI) Refresh(ctx context.Context, params *PluginsMarketplacesRefreshRequest) (*MarketplaceRefreshResult, error)
Refresh re-fetches one or all registered marketplace catalogs.
RPC method: plugins.marketplaces.refresh.
Parameters: Optional marketplace name; omit to refresh all.
Returns: Result of refreshing one or more marketplace catalogs.
func (*ServerPluginsMarketplacesAPI) Remove ¶ added in v1.0.1
func (a *ServerPluginsMarketplacesAPI) Remove(ctx context.Context, params *PluginsMarketplacesRemoveRequest) (*MarketplaceRemoveResult, error)
Removes a previously-registered marketplace. When the marketplace has dependent plugins and `force` is not set, the marketplace is left intact and the result lists the dependents so the caller can decide whether to retry with `force=true`.
RPC method: plugins.marketplaces.remove.
Parameters: Name of the marketplace to remove and an optional force flag.
Returns: Outcome of the remove attempt, including dependent-plugin info when applicable.
type ServerRPC ¶ added in v1.0.0
type ServerRPC struct {
Account *ServerAccountAPI
AgentRegistry *ServerAgentRegistryAPI
Agents *ServerAgentsAPI
Instructions *ServerInstructionsAPI
MCP *ServerMCPAPI
Models *ServerModelsAPI
Plugins *ServerPluginsAPI
Runtime *ServerRuntimeAPI
Secrets *ServerSecretsAPI
SessionFS *ServerSessionFSAPI
Sessions *ServerSessionsAPI
Skills *ServerSkillsAPI
Tools *ServerToolsAPI
User *ServerUserAPI
// contains filtered or unexported fields
}
ServerRPC provides typed server-scoped RPC methods.
func NewServerRPC ¶ added in v1.0.0
func (*ServerRPC) Ping ¶ added in v1.0.0
func (a *ServerRPC) Ping(ctx context.Context, params *PingRequest) (*PingResult, error)
Ping checks server responsiveness and returns protocol information.
RPC method: ping.
Parameters: Optional message to echo back to the caller.
Returns: Server liveness response, including the echoed message, current server timestamp, and protocol version.
type ServerRuntimeAPI ¶ added in v1.0.0
type ServerRuntimeAPI serverAPI
func (*ServerRuntimeAPI) Shutdown ¶ added in v1.0.0
func (a *ServerRuntimeAPI) Shutdown(ctx context.Context) (*RuntimeShutdownResult, error)
Shutdown gracefully shuts down an SDK-owned runtime. The response is sent only after cleanup completes; callers may then terminate the owned runtime process.
RPC method: runtime.shutdown.
type ServerSecretsAPI ¶ added in v1.0.0
type ServerSecretsAPI serverAPI
func (*ServerSecretsAPI) AddFilterValues ¶ added in v1.0.0
func (a *ServerSecretsAPI) AddFilterValues(ctx context.Context, params *SecretsAddFilterValuesRequest) (*SecretsAddFilterValuesResult, error)
AddFilterValues registers secret values for redaction in session logs and exports. The SDK calls this to inject dynamically generated secret values (e.g., OIDC tokens).
RPC method: secrets.addFilterValues.
Parameters: Secret values to add to the redaction filter.
Returns: Confirmation that the secret values were registered.
type ServerSessionFSAPI ¶ added in v1.0.0
type ServerSessionFSAPI serverAPI
func (*ServerSessionFSAPI) SetProvider ¶ added in v1.0.0
func (a *ServerSessionFSAPI) SetProvider(ctx context.Context, params *SessionFSSetProviderRequest) (*SessionFSSetProviderResult, error)
SetProvider registers an SDK client as the session filesystem provider.
RPC method: sessionFs.setProvider.
Parameters: Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider.
Returns: Indicates whether the calling client was registered as the session filesystem provider.
type ServerSessionsAPI ¶ added in v1.0.0
type ServerSessionsAPI serverAPI
Experimental: ServerSessionsAPI contains experimental APIs that may change or be removed.
func (*ServerSessionsAPI) BulkDelete ¶ added in v1.0.0
func (a *ServerSessionsAPI) BulkDelete(ctx context.Context, params *SessionsBulkDeleteRequest) (*SessionBulkDeleteResult, error)
BulkDelete closes, deactivates, and deletes a set of sessions, returning the bytes freed per session.
RPC method: sessions.bulkDelete.
Parameters: Session IDs to close, deactivate, and delete from disk.
Returns: Map of sessionId -> bytes freed by removing the session's workspace directory.
func (*ServerSessionsAPI) CheckInUse ¶ added in v1.0.0
func (a *ServerSessionsAPI) CheckInUse(ctx context.Context, params *SessionsCheckInUseRequest) (*SessionsCheckInUseResult, error)
CheckInUse returns the subset of the supplied session IDs that are currently held by another running process.
RPC method: sessions.checkInUse.
Parameters: Session IDs to test for live in-use locks.
Returns: Session IDs from the input set that are currently in use by another process.
func (*ServerSessionsAPI) Close ¶ added in v1.0.0
func (a *ServerSessionsAPI) Close(ctx context.Context, params *SessionsCloseRequest) (*SessionsCloseResult, error)
Closes a session: emits shutdown, flushes pending events, releases the in-use lock, and disposes the active session.
RPC method: sessions.close.
Parameters: Session ID to close.
Returns: Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active.
func (*ServerSessionsAPI) Connect ¶ added in v1.0.0
func (a *ServerSessionsAPI) Connect(ctx context.Context, params *ConnectRemoteSessionParams) (*RemoteSessionConnectionResult, error)
Connects to an existing remote session and exposes it as an SDK session.
RPC method: sessions.connect.
Parameters: Remote session connection parameters.
Returns: Remote session connection result.
func (*ServerSessionsAPI) EnrichMetadata ¶ added in v1.0.0
func (a *ServerSessionsAPI) EnrichMetadata(ctx context.Context, params *SessionsEnrichMetadataRequest) (*SessionEnrichMetadataResult, error)
EnrichMetadata backfills missing summary and context fields on the supplied session metadata records.
RPC method: sessions.enrichMetadata.
Parameters: Session metadata records to enrich with summary and context information.
Returns: The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted.
func (*ServerSessionsAPI) FindByPrefix ¶ added in v1.0.0
func (a *ServerSessionsAPI) FindByPrefix(ctx context.Context, params *SessionsFindByPrefixRequest) (*SessionsFindByPrefixResult, error)
FindByPrefix resolves a UUID prefix to a unique session ID, if exactly one session matches.
RPC method: sessions.findByPrefix.
Parameters: UUID prefix to resolve to a unique session ID.
Returns: Session ID matching the prefix, omitted when no unique match exists.
func (*ServerSessionsAPI) FindByTaskId ¶ added in v1.0.0
func (a *ServerSessionsAPI) FindByTaskId(ctx context.Context, params *SessionsFindByTaskIDRequest) (*SessionsFindByTaskIDResult, error)
FindByTaskId finds the local session bound to a GitHub task ID, if any.
RPC method: sessions.findByTaskId.
Parameters: GitHub task ID to look up.
Returns: ID of the local session bound to the given GitHub task, or omitted when none.
func (*ServerSessionsAPI) Fork ¶ added in v1.0.0
func (a *ServerSessionsAPI) Fork(ctx context.Context, params *SessionsForkRequest) (*SessionsForkResult, error)
Fork creates a new session by forking persisted history from an existing session.
RPC method: sessions.fork.
Parameters: Source session identifier to fork from, optional event-ID boundary, and optional friendly name for the new session.
Returns: Identifier and optional friendly name assigned to the newly forked session.
func (*ServerSessionsAPI) GetLastForContext ¶ added in v1.0.0
func (a *ServerSessionsAPI) GetLastForContext(ctx context.Context, params *SessionsGetLastForContextRequest) (*SessionsGetLastForContextResult, error)
GetLastForContext returns the most-relevant prior session for a given working-directory context.
RPC method: sessions.getLastForContext.
Parameters: Optional working-directory context used to score session relevance.
Returns: Most-relevant session ID for the supplied context, or omitted when no sessions exist.
func (*ServerSessionsAPI) GetRemoteControlStatus ¶ added in v1.0.1
func (a *ServerSessionsAPI) GetRemoteControlStatus(ctx context.Context) (*RemoteControlStatusResult, error)
GetRemoteControlStatus returns the current state of the remote-control singleton, including the attached session id and frontend URL when active.
RPC method: sessions.getRemoteControlStatus.
Returns: Wrapper for the singleton's current status.
func (*ServerSessionsAPI) GetSizes ¶ added in v1.0.0
func (a *ServerSessionsAPI) GetSizes(ctx context.Context) (*SessionSizes, error)
GetSizes returns the on-disk byte size of each session's workspace directory.
RPC method: sessions.getSizes.
Returns: Map of sessionId -> on-disk size in bytes for each session's workspace directory.
func (*ServerSessionsAPI) List ¶ added in v1.0.0
func (a *ServerSessionsAPI) List(ctx context.Context, params *SessionsListRequest) (*SessionList, error)
Lists sessions, optionally filtered by source and working-directory context. Returned entries are discriminated by `isRemote`: local entries carry only the lightweight `LocalSessionMetadataValue` shape; remote entries carry the full `RemoteSessionMetadataValue` shape (repository, PR number, taskType, etc.).
RPC method: sessions.list.
Parameters: Optional source filter, metadata-load limit, and context filter applied to the returned sessions.
Returns: Sessions matching the filter, ordered most-recently-modified first.
func (*ServerSessionsAPI) LoadDeferredRepoHooks ¶ added in v1.0.0
func (a *ServerSessionsAPI) LoadDeferredRepoHooks(ctx context.Context, params *SessionsLoadDeferredRepoHooksRequest) (*SessionLoadDeferredRepoHooksResult, error)
LoadDeferredRepoHooks loads previously-deferred repo-level hooks on the active session, returning queued startup prompts.
RPC method: sessions.loadDeferredRepoHooks.
Parameters: Active session ID whose deferred repo-level hooks should be loaded.
Returns: Queued repo-level startup prompts and the total hook command count after loading.
func (*ServerSessionsAPI) Open ¶ added in v1.0.1
func (a *ServerSessionsAPI) Open(ctx context.Context, params *SessionOpenParams) (*SessionOpenResult, error)
Open creates or resumes a local session and returns the opened session ID.
RPC method: sessions.open.
Parameters: Open a session by creating, resuming, attaching, connecting to a remote, or handing off.
Returns: Result of opening a session.
func (*ServerSessionsAPI) PruneOld ¶ added in v1.0.0
func (a *ServerSessionsAPI) PruneOld(ctx context.Context, params *SessionsPruneOldRequest) (*SessionPruneResult, error)
PruneOld deletes sessions older than the given threshold, with optional dry-run and exclusion list.
RPC method: sessions.pruneOld.
Parameters: Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true).
Returns: Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag.
func (*ServerSessionsAPI) ReleaseLock ¶ added in v1.0.0
func (a *ServerSessionsAPI) ReleaseLock(ctx context.Context, params *SessionsReleaseLockRequest) (*SessionsReleaseLockResult, error)
ReleaseLock releases the in-use lock held by this process for a session.
RPC method: sessions.releaseLock.
Parameters: Session ID whose in-use lock should be released.
Returns: Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session.
func (*ServerSessionsAPI) ReloadPluginHooks ¶ added in v1.0.0
func (a *ServerSessionsAPI) ReloadPluginHooks(ctx context.Context, params *SessionsReloadPluginHooksRequest) (*SessionsReloadPluginHooksResult, error)
ReloadPluginHooks reloads user, plugin, and (optionally) repo hooks on the active session.
RPC method: sessions.reloadPluginHooks.
Parameters: Active session ID and an optional flag for deferring repo-level hooks until folder trust.
Returns: Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId.
func (*ServerSessionsAPI) Save ¶ added in v1.0.0
func (a *ServerSessionsAPI) Save(ctx context.Context, params *SessionsSaveRequest) (*SessionsSaveResult, error)
Save flushes a session's pending events to disk.
RPC method: sessions.save.
Parameters: Session ID whose pending events should be flushed to disk.
Returns: Flush a session's pending events to disk. No-op when no writer exists for the session (e.g., already closed).
func (*ServerSessionsAPI) SetAdditionalPlugins ¶ added in v1.0.0
func (a *ServerSessionsAPI) SetAdditionalPlugins(ctx context.Context, params *SessionsSetAdditionalPluginsRequest) (*SessionsSetAdditionalPluginsResult, error)
SetAdditionalPlugins replaces the manager-wide additional plugins registered with the session manager.
RPC method: sessions.setAdditionalPlugins.
Parameters: Manager-wide additional plugins to register; replaces any previously-configured set.
Returns: Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload.
func (*ServerSessionsAPI) SetRemoteControlSteering ¶ added in v1.0.1
func (a *ServerSessionsAPI) SetRemoteControlSteering(ctx context.Context, params *SessionsSetRemoteControlSteeringRequest) (*RemoteControlStatusResult, error)
SetRemoteControlSteering patches the steering state of the active remote-control singleton. When remote control is off, this is a no-op and the off status is returned. Today only `enabled: true` is actionable on the underlying exporter; passing `false` is reserved for future use.
RPC method: sessions.setRemoteControlSteering.
Parameters: Patch for the singleton's steering state.
Returns: Wrapper for the singleton's current status.
func (*ServerSessionsAPI) StartRemoteControl ¶ added in v1.0.1
func (a *ServerSessionsAPI) StartRemoteControl(ctx context.Context, params *SessionsStartRemoteControlRequest) (*RemoteControlStatusResult, error)
StartRemoteControl attaches the runtime-managed remote-control singleton to a session, awaiting initial setup. If remote control is already attached to a different session, the singleton is transferred (preserving the underlying Mission Control connection). Returns the final status.
RPC method: sessions.startRemoteControl.
Parameters: Parameters for attaching the remote-control singleton to a session.
Returns: Wrapper for the singleton's current status.
func (*ServerSessionsAPI) StopRemoteControl ¶ added in v1.0.1
func (a *ServerSessionsAPI) StopRemoteControl(ctx context.Context, params *SessionsStopRemoteControlRequest) (*RemoteControlStopResult, error)
StopRemoteControl stops the remote-control singleton. When `expectedSessionId` is provided and does not match the singleton's current `attachedSessionId`, the stop is rejected with `stopped: false` and the current status is returned unchanged (unless `force` is set, in which case the singleton is unconditionally torn down).
RPC method: sessions.stopRemoteControl.
Parameters: Parameters for stopping the remote-control singleton.
Returns: Outcome of a stopRemoteControl call.
func (*ServerSessionsAPI) TransferRemoteControl ¶ added in v1.0.1
func (a *ServerSessionsAPI) TransferRemoteControl(ctx context.Context, params *SessionsTransferRemoteControlRequest) (*RemoteControlTransferResult, error)
TransferRemoteControl atomically rebinds the remote-control singleton to a different session, preserving the underlying Mission Control connection. When `expectedFromSessionId` is provided and does not match the singleton's current `attachedSessionId`, the transfer is rejected with `transferred: false` and the current status is returned unchanged.
RPC method: sessions.transferRemoteControl.
Parameters: Parameters for atomically rebinding the remote-control singleton.
Returns: Outcome of a transferRemoteControl call.
type ServerSkill ¶ added in v0.3.0
type ServerSkill struct {
// Description of what the skill does
Description string `json:"description"`
// Whether the skill is currently enabled (based on global config)
Enabled bool `json:"enabled"`
// Unique identifier for the skill
Name string `json:"name"`
// Absolute path to the skill file
Path *string `json:"path,omitempty"`
// The project path this skill belongs to (only for project/inherited skills)
ProjectPath *string `json:"projectPath,omitempty"`
// Source location type (e.g., project, personal-copilot, plugin, builtin)
Source SkillSource `json:"source"`
// Whether the skill can be invoked by the user as a slash command
UserInvocable bool `json:"userInvocable"`
}
Schema for the `ServerSkill` type.
type ServerSkillList ¶ added in v0.3.0
type ServerSkillList struct {
// All discovered skills across all sources
Skills []ServerSkill `json:"skills"`
}
Skills discovered across global and project sources.
type ServerSkillsAPI ¶ added in v1.0.0
type ServerSkillsAPI serverAPI
func (*ServerSkillsAPI) Config ¶ added in v1.0.0
func (s *ServerSkillsAPI) Config() *ServerSkillsConfigAPI
func (*ServerSkillsAPI) Discover ¶ added in v1.0.0
func (a *ServerSkillsAPI) Discover(ctx context.Context, params *SkillsDiscoverRequest) (*ServerSkillList, error)
Discovers skills across global and project sources.
RPC method: skills.discover.
Parameters: Optional project paths and additional skill directories to include in discovery.
Returns: Skills discovered across global and project sources.
type ServerSkillsConfigAPI ¶ added in v1.0.0
type ServerSkillsConfigAPI serverAPI
func (*ServerSkillsConfigAPI) SetDisabledSkills ¶ added in v1.0.0
func (a *ServerSkillsConfigAPI) SetDisabledSkills(ctx context.Context, params *SkillsConfigSetDisabledSkillsRequest) (*SkillsConfigSetDisabledSkillsResult, error)
SetDisabledSkills replaces the global list of disabled skills.
RPC method: skills.config.setDisabledSkills.
Parameters: Skill names to mark as disabled in global configuration, replacing any previous list.
type ServerToolsAPI ¶ added in v1.0.0
type ServerToolsAPI serverAPI
func (*ServerToolsAPI) List ¶ added in v1.0.0
func (a *ServerToolsAPI) List(ctx context.Context, params *ToolsListRequest) (*ToolList, error)
Lists built-in tools available for a model.
RPC method: tools.list.
Parameters: Optional model identifier whose tool overrides should be applied to the listing.
Returns: Built-in tools available for the requested model, with their parameters and instructions.
type ServerUserAPI ¶ added in v1.0.0
type ServerUserAPI serverAPI
func (*ServerUserAPI) Settings ¶ added in v1.0.0
func (s *ServerUserAPI) Settings() *ServerUserSettingsAPI
type ServerUserSettingsAPI ¶ added in v1.0.0
type ServerUserSettingsAPI serverAPI
func (*ServerUserSettingsAPI) Reload ¶ added in v1.0.0
func (a *ServerUserSettingsAPI) Reload(ctx context.Context) (*UserSettingsReloadResult, error)
Reload drops this runtime process's in-memory user settings cache so the next settings read observes disk.
RPC method: user.settings.reload.
type SessionActivity ¶ added in v1.0.1
type SessionActivity struct {
// Whether an in-flight operation can currently be aborted.
Abortable bool `json:"abortable"`
// Whether the session currently has active work, including running turns or tasks.
HasActiveWork bool `json:"hasActiveWork"`
}
Current activity flags for the session. Experimental: SessionActivity is part of an experimental API and may change or be removed.
type SessionAgentDeselectResult ¶ added in v0.1.28
type SessionAgentDeselectResult struct {
}
Experimental: SessionAgentDeselectResult is part of an experimental API and may change or be removed.
type SessionAuthStatus ¶ added in v0.3.0
type SessionAuthStatus struct {
// Authentication type
AuthType *AuthInfoType `json:"authType,omitempty"`
// Copilot plan tier (e.g., individual_pro, business)
CopilotPlan *string `json:"copilotPlan,omitempty"`
// Authentication host URL
Host *string `json:"host,omitempty"`
// Whether the session has resolved authentication
IsAuthenticated bool `json:"isAuthenticated"`
// Authenticated login/username, if available
Login *string `json:"login,omitempty"`
// Human-readable authentication status description
StatusMessage *string `json:"statusMessage,omitempty"`
}
Authentication status and account metadata for the session. Experimental: SessionAuthStatus is part of an experimental API and may change or be removed.
type SessionAutopilotObjectiveChangedData ¶ added in v1.0.0
type SessionAutopilotObjectiveChangedData struct {
// Current autopilot objective id, if one exists
ID *int64 `json:"id,omitempty"`
// The type of operation performed on the autopilot objective state file
Operation AutopilotObjectiveChangedOperation `json:"operation"`
// Current autopilot objective status, if one exists
Status *AutopilotObjectiveChangedStatus `json:"status,omitempty"`
}
Autopilot objective state file operation details indicating what changed
func (*SessionAutopilotObjectiveChangedData) Type ¶ added in v1.0.0
func (*SessionAutopilotObjectiveChangedData) Type() SessionEventType
type SessionBackgroundTasksChangedData ¶ added in v1.0.0
type SessionBackgroundTasksChangedData struct {
}
Schema for the `BackgroundTasksChangedData` type.
func (*SessionBackgroundTasksChangedData) Type ¶ added in v1.0.0
func (*SessionBackgroundTasksChangedData) Type() SessionEventType
type SessionBulkDeleteResult ¶ added in v1.0.0
type SessionBulkDeleteResult struct {
// Map of sessionId -> bytes freed by removing the session's workspace directory. Sessions
// whose deletion failed are omitted from this map (failures are logged on the server but
// not surfaced per-id; check the map for absent IDs to detect them).
FreedBytes map[string]int64 `json:"freedBytes"`
}
Map of sessionId -> bytes freed by removing the session's workspace directory. Experimental: SessionBulkDeleteResult is part of an experimental API and may change or be removed.
type SessionCanvasCloseResult ¶ added in v1.0.0
type SessionCanvasCloseResult struct {
}
Experimental: SessionCanvasCloseResult is part of an experimental API and may change or be removed.
type SessionCanvasClosedData ¶ added in v1.0.1
type SessionCanvasClosedData struct {
// Provider-local canvas identifier
CanvasID string `json:"canvasId"`
// Owning provider identifier
ExtensionID string `json:"extensionId"`
// Stable caller-supplied identifier of the canvas instance that was closed
InstanceID string `json:"instanceId"`
}
Schema for the `CanvasClosedData` type.
func (*SessionCanvasClosedData) Type ¶ added in v1.0.1
func (*SessionCanvasClosedData) Type() SessionEventType
type SessionCanvasOpenedData ¶ added in v1.0.0
type SessionCanvasOpenedData struct {
// Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding.
Availability CanvasOpenedAvailability `json:"availability"`
// Provider-local canvas identifier
CanvasID string `json:"canvasId"`
// Owning provider identifier
ExtensionID string `json:"extensionId"`
// Owning extension display name, when available
ExtensionName *string `json:"extensionName,omitempty"`
// Input supplied when the instance was opened
Input any `json:"input,omitempty"`
// Stable caller-supplied canvas instance identifier
InstanceID string `json:"instanceId"`
// Whether this notification represents an idempotent reopen
Reopen bool `json:"reopen"`
// Provider-supplied status text
Status *string `json:"status,omitempty"`
// Rendered title
Title *string `json:"title,omitempty"`
// URL for web-rendered canvases
URL *string `json:"url,omitempty"`
}
Schema for the `CanvasOpenedData` type.
func (*SessionCanvasOpenedData) Type ¶ added in v1.0.0
func (*SessionCanvasOpenedData) Type() SessionEventType
type SessionCanvasRegistryChangedData ¶ added in v1.0.0
type SessionCanvasRegistryChangedData struct {
// Canvas declarations currently available
Canvases []CanvasRegistryChangedCanvas `json:"canvases"`
}
Schema for the `CanvasRegistryChangedData` type.
func (*SessionCanvasRegistryChangedData) Type ¶ added in v1.0.0
func (*SessionCanvasRegistryChangedData) Type() SessionEventType
type SessionCapability ¶ added in v1.0.1
type SessionCapability string
Session capability enabled for this session Experimental: SessionCapability is part of an experimental API and may change or be removed.
const ( // Interactive ask_user tool support. SessionCapabilityAskUser SessionCapability = "ask-user" // Host-provided canvas rendering support. SessionCapabilityCanvasRenderer SessionCapability = "canvas-renderer" // Copilot CLI documentation tool and prompt section. SessionCapabilityCLIDocumentation SessionCapability = "cli-documentation" // SDK elicitation support. SessionCapabilityElicitation SessionCapability = "elicitation" // Interactive CLI identity and behavior. SessionCapabilityInteractiveMode SessionCapability = "interactive-mode" // MCP Apps UI passthrough. SessionCapabilityMCPApps SessionCapability = "mcp-apps" // Memory tool and memories prompt section. SessionCapabilityMemory SessionCapability = "memory" // Plan-mode handling and instructions. SessionCapabilityPlanMode SessionCapability = "plan-mode" // Cross-session history tools and session-store SQL prompt/tool metadata. SessionCapabilitySessionStore SessionCapability = "session-store" // Automatic hidden system notifications. SessionCapabilitySystemNotifications SessionCapability = "system-notifications" // TUI-specific prompt hints such as keyboard shortcuts. SessionCapabilityTuiHints SessionCapability = "tui-hints" )
type SessionCompactionCompleteData ¶ added in v1.0.0
type SessionCompactionCompleteData struct {
// Checkpoint snapshot number created for recovery
CheckpointNumber *int64 `json:"checkpointNumber,omitempty"`
// File path where the checkpoint was stored
CheckpointPath *string `json:"checkpointPath,omitempty"`
// Token usage breakdown for the compaction LLM call (aligned with assistant.usage format)
CompactionTokensUsed *CompactionCompleteCompactionTokensUsed `json:"compactionTokensUsed,omitempty"`
// Token count from non-system messages (user, assistant, tool) after compaction
ConversationTokens *int64 `json:"conversationTokens,omitempty"`
// User-supplied focus instructions provided to a manual `/compact` invocation. Omitted for automatic compaction and for manual compaction with no focus text.
CustomInstructions *string `json:"customInstructions,omitempty"`
// Error message if compaction failed
Error *string `json:"error,omitempty"`
// Number of messages removed during compaction
MessagesRemoved *int64 `json:"messagesRemoved,omitempty"`
// Total tokens in conversation after compaction
PostCompactionTokens *int64 `json:"postCompactionTokens,omitempty"`
// Number of messages before compaction
PreCompactionMessagesLength *int64 `json:"preCompactionMessagesLength,omitempty"`
// Total tokens in conversation before compaction
PreCompactionTokens *int64 `json:"preCompactionTokens,omitempty"`
// GitHub request tracing ID (x-github-request-id header) for the compaction LLM call
RequestID *string `json:"requestId,omitempty"`
// Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call
ServiceRequestID *string `json:"serviceRequestId,omitempty"`
// Whether compaction completed successfully
Success bool `json:"success"`
// LLM-generated summary of the compacted conversation history
SummaryContent *string `json:"summaryContent,omitempty"`
// Token count from system message(s) after compaction
SystemTokens *int64 `json:"systemTokens,omitempty"`
// Number of tokens removed during compaction
TokensRemoved *int64 `json:"tokensRemoved,omitempty"`
// Token count from tool definitions after compaction
ToolDefinitionsTokens *int64 `json:"toolDefinitionsTokens,omitempty"`
}
Conversation compaction results including success status, metrics, and optional error details
func (*SessionCompactionCompleteData) Type ¶ added in v1.0.0
func (*SessionCompactionCompleteData) Type() SessionEventType
type SessionCompactionStartData ¶ added in v1.0.0
type SessionCompactionStartData struct {
// Token count from non-system messages (user, assistant, tool) at compaction start
ConversationTokens *int64 `json:"conversationTokens,omitempty"`
// Token count from system message(s) at compaction start
SystemTokens *int64 `json:"systemTokens,omitempty"`
// Token count from tool definitions at compaction start
ToolDefinitionsTokens *int64 `json:"toolDefinitionsTokens,omitempty"`
}
Context window breakdown at the start of LLM-powered conversation compaction
func (*SessionCompactionStartData) Type ¶ added in v1.0.0
func (*SessionCompactionStartData) Type() SessionEventType
type SessionContext ¶ added in v1.0.0
type SessionContext struct {
// Active git branch
Branch *string `json:"branch,omitempty"`
// Most recent working directory for this session
Cwd string `json:"cwd"`
// Git repository root, if the cwd was inside a git repo
GitRoot *string `json:"gitRoot,omitempty"`
// Repository host type
HostType *SessionContextHostType `json:"hostType,omitempty"`
// Repository slug in `owner/name` form, when known
Repository *string `json:"repository,omitempty"`
}
Pre-resolved working-directory context for session startup. Experimental: SessionContext is part of an experimental API and may change or be removed.
type SessionContextChangedData ¶ added in v1.0.0
type SessionContextChangedData struct {
// Base commit of current git branch at session start time
BaseCommit *string `json:"baseCommit,omitempty"`
// Current git branch name
Branch *string `json:"branch,omitempty"`
// Current working directory path
Cwd string `json:"cwd"`
// Root directory of the git repository, resolved via git rev-parse
GitRoot *string `json:"gitRoot,omitempty"`
// Head commit of current git branch at session start time
HeadCommit *string `json:"headCommit,omitempty"`
// Hosting platform type of the repository (github or ado)
HostType *WorkingDirectoryContextHostType `json:"hostType,omitempty"`
// Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps)
Repository *string `json:"repository,omitempty"`
// Raw host string from the git remote URL (e.g. "github.com", "mycompany.ghe.com", "dev.azure.com")
RepositoryHost *string `json:"repositoryHost,omitempty"`
}
Working directory and git context at session start
func (*SessionContextChangedData) Type ¶ added in v1.0.0
func (*SessionContextChangedData) Type() SessionEventType
type SessionContextHostType ¶ added in v1.0.0
type SessionContextHostType string
Repository host type Experimental: SessionContextHostType is part of an experimental API and may change or be removed.
const ( // Session repository is hosted on Azure DevOps. SessionContextHostTypeADO SessionContextHostType = "ado" // Session repository is hosted on GitHub. SessionContextHostTypeGitHub SessionContextHostType = "github" )
type SessionContextInfo ¶ added in v1.0.0
type SessionContextInfo struct {
// Output reserve plus tokens after the buffer-exhaustion blocking threshold (default 95%)
BufferTokens int64 `json:"bufferTokens"`
// Token count at which background compaction starts (configurable percentage of
// promptTokenLimit)
CompactionThreshold int64 `json:"compactionThreshold"`
// Tokens consumed by user/assistant/tool messages
ConversationTokens int64 `json:"conversationTokens"`
// Prompt token limit plus the model's full output token limit.
Limit int64 `json:"limit"`
// Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes
// deferred tools)
MCPToolsTokens int64 `json:"mcpToolsTokens"`
// The model used for token counting
ModelName string `json:"modelName"`
// Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified)
PromptTokenLimit int64 `json:"promptTokenLimit"`
// Tokens consumed by the system prompt
SystemTokens int64 `json:"systemTokens"`
// Tokens consumed by tool definitions sent to the model (excludes deferred tools)
ToolDefinitionsTokens int64 `json:"toolDefinitionsTokens"`
// Sum of system, conversation and tool-definition tokens
TotalTokens int64 `json:"totalTokens"`
}
Token-usage breakdown for the session's current context window Experimental: SessionContextInfo is part of an experimental API and may change or be removed.
type SessionCustomAgentsUpdatedData ¶ added in v1.0.0
type SessionCustomAgentsUpdatedData struct {
// Array of loaded custom agent metadata
Agents []CustomAgentsUpdatedAgent `json:"agents"`
// Fatal errors from agent loading
Errors []string `json:"errors"`
// Non-fatal warnings from agent loading
Warnings []string `json:"warnings"`
}
Schema for the `CustomAgentsUpdatedData` type.
func (*SessionCustomAgentsUpdatedData) Type ¶ added in v1.0.0
func (*SessionCustomAgentsUpdatedData) Type() SessionEventType
type SessionCustomNotificationData ¶ added in v1.0.0
type SessionCustomNotificationData struct {
// Source-defined custom notification name
Name string `json:"name"`
// Source-defined JSON payload for the custom notification
Payload CustomNotificationPayload `json:"payload"`
// Namespace for the custom notification producer
Source string `json:"source"`
// Optional source-defined string identifiers describing the payload subject
Subject map[string]string `json:"subject,omitzero"`
// Optional source-defined payload schema version
Version *int64 `json:"version,omitempty"`
}
Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.
func (*SessionCustomNotificationData) Type ¶ added in v1.0.0
func (*SessionCustomNotificationData) Type() SessionEventType
type SessionEnrichMetadataResult ¶ added in v1.0.0
type SessionEnrichMetadataResult struct {
// Enriched records, with summary and context backfilled. Sessions confirmed empty and
// unnamed may be omitted.
Sessions []LocalSessionMetadataValue `json:"sessions"`
}
The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted. Experimental: SessionEnrichMetadataResult is part of an experimental API and may change or be removed.
type SessionErrorData ¶ added in v1.0.0
type SessionErrorData struct {
// Only set on `errorType: "rate_limit"`. When `true`, the runtime will follow this error with an `auto_mode_switch.requested` event (or silently switch if `continueOnAutoMode` is enabled). UI clients can use this flag to suppress duplicate rendering of the rate-limit error when they show their own auto-mode-switch prompt.
EligibleForAutoSwitch *bool `json:"eligibleForAutoSwitch,omitempty"`
// Fine-grained error code from the upstream provider, when available. For `errorType: "rate_limit"`, this is one of the `RateLimitErrorCode` values (e.g., `"user_weekly_rate_limited"`, `"user_global_rate_limited"`, `"rate_limited"`, `"user_model_rate_limited"`, `"integration_rate_limited"`). For `errorType: "quota"`, this is the CAPI quota error code (e.g., `"quota_exceeded"`, `"session_quota_exceeded"`, `"billing_not_configured"`).
ErrorCode *string `json:"errorCode,omitempty"`
// Category of error (e.g., "authentication", "authorization", "quota", "rate_limit", "context_limit", "query")
ErrorType string `json:"errorType"`
// Human-readable error message
Message string `json:"message"`
// GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
ProviderCallID *string `json:"providerCallId,omitempty"`
// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
ServiceRequestID *string `json:"serviceRequestId,omitempty"`
// Error stack trace, when available
Stack *string `json:"stack,omitempty"`
// HTTP status code from the upstream request, if applicable
StatusCode *int32 `json:"statusCode,omitempty"`
// Optional URL associated with this error that the user can open in a browser
URL *string `json:"url,omitempty"`
}
Error details for timeline display including message and optional diagnostic information
func (*SessionErrorData) Type ¶ added in v1.0.0
func (*SessionErrorData) Type() SessionEventType
type SessionEvent ¶ added in v1.0.0
type SessionEvent struct {
// Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
AgentID *string `json:"agentId,omitempty"`
// Typed event payload. Use a type switch to access per-event fields.
Data SessionEventData `json:"-"`
// When true, the event is transient and not persisted to the session event log on disk
Ephemeral *bool `json:"ephemeral,omitempty"`
// Unique event identifier (UUID v4), generated when the event is emitted
ID string `json:"id"`
// ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
ParentID *string `json:"parentId"`
// ISO 8601 timestamp when the event was created
Timestamp time.Time `json:"timestamp"`
}
SessionEvent represents a single session event with a typed data payload.
func (*SessionEvent) Marshal ¶ added in v1.0.0
func (r *SessionEvent) Marshal() ([]byte, error)
Marshal serializes the SessionEvent to JSON.
func (SessionEvent) MarshalJSON ¶ added in v1.0.0
func (e SessionEvent) MarshalJSON() ([]byte, error)
func (SessionEvent) Type ¶ added in v1.0.0
func (e SessionEvent) Type() SessionEventType
Type returns the event type discriminator derived from Data.
func (*SessionEvent) UnmarshalJSON ¶ added in v1.0.0
func (e *SessionEvent) UnmarshalJSON(data []byte) error
type SessionEventData ¶ added in v1.0.0
type SessionEventData interface {
Type() SessionEventType
// contains filtered or unexported methods
}
SessionEventData is the interface implemented by all per-event data types.
type SessionEventType ¶ added in v1.0.0
type SessionEventType string
SessionEventType identifies the kind of session event.
const ( SessionEventTypeAbort SessionEventType = "abort" SessionEventTypeAssistantIntent SessionEventType = "assistant.intent" SessionEventTypeAssistantMessage SessionEventType = "assistant.message" SessionEventTypeAssistantMessageDelta SessionEventType = "assistant.message_delta" SessionEventTypeAssistantMessageStart SessionEventType = "assistant.message_start" SessionEventTypeAssistantReasoning SessionEventType = "assistant.reasoning" SessionEventTypeAssistantReasoningDelta SessionEventType = "assistant.reasoning_delta" SessionEventTypeAssistantStreamingDelta SessionEventType = "assistant.streaming_delta" SessionEventTypeAssistantTurnEnd SessionEventType = "assistant.turn_end" SessionEventTypeAssistantTurnStart SessionEventType = "assistant.turn_start" SessionEventTypeAssistantUsage SessionEventType = "assistant.usage" SessionEventTypeAutoModeSwitchCompleted SessionEventType = "auto_mode_switch.completed" SessionEventTypeAutoModeSwitchRequested SessionEventType = "auto_mode_switch.requested" SessionEventTypeCapabilitiesChanged SessionEventType = "capabilities.changed" SessionEventTypeCommandCompleted SessionEventType = "command.completed" SessionEventTypeCommandExecute SessionEventType = "command.execute" SessionEventTypeCommandQueued SessionEventType = "command.queued" SessionEventTypeCommandsChanged SessionEventType = "commands.changed" SessionEventTypeElicitationCompleted SessionEventType = "elicitation.completed" SessionEventTypeElicitationRequested SessionEventType = "elicitation.requested" SessionEventTypeExitPlanModeCompleted SessionEventType = "exit_plan_mode.completed" SessionEventTypeExitPlanModeRequested SessionEventType = "exit_plan_mode.requested" SessionEventTypeExternalToolCompleted SessionEventType = "external_tool.completed" SessionEventTypeExternalToolRequested SessionEventType = "external_tool.requested" SessionEventTypeHookEnd SessionEventType = "hook.end" SessionEventTypeHookProgress SessionEventType = "hook.progress" SessionEventTypeHookStart SessionEventType = "hook.start" SessionEventTypeMCPAppToolCallComplete SessionEventType = "mcp_app.tool_call_complete" SessionEventTypeMCPOauthCompleted SessionEventType = "mcp.oauth_completed" SessionEventTypeMCPOauthRequired SessionEventType = "mcp.oauth_required" SessionEventTypeModelCallFailure SessionEventType = "model.call_failure" SessionEventTypePendingMessagesModified SessionEventType = "pending_messages.modified" SessionEventTypePermissionCompleted SessionEventType = "permission.completed" SessionEventTypePermissionRequested SessionEventType = "permission.requested" SessionEventTypeSamplingCompleted SessionEventType = "sampling.completed" SessionEventTypeSamplingRequested SessionEventType = "sampling.requested" SessionEventTypeSessionAutopilotObjectiveChanged SessionEventType = "session.autopilot_objective_changed" SessionEventTypeSessionBackgroundTasksChanged SessionEventType = "session.background_tasks_changed" SessionEventTypeSessionCanvasClosed SessionEventType = "session.canvas.closed" SessionEventTypeSessionCanvasOpened SessionEventType = "session.canvas.opened" SessionEventTypeSessionCanvasRegistryChanged SessionEventType = "session.canvas.registry_changed" SessionEventTypeSessionCompactionComplete SessionEventType = "session.compaction_complete" SessionEventTypeSessionCompactionStart SessionEventType = "session.compaction_start" SessionEventTypeSessionContextChanged SessionEventType = "session.context_changed" SessionEventTypeSessionCustomAgentsUpdated SessionEventType = "session.custom_agents_updated" SessionEventTypeSessionCustomNotification SessionEventType = "session.custom_notification" SessionEventTypeSessionError SessionEventType = "session.error" SessionEventTypeSessionExtensionsAttachmentsPushed SessionEventType = "session.extensions.attachments_pushed" SessionEventTypeSessionExtensionsLoaded SessionEventType = "session.extensions_loaded" SessionEventTypeSessionHandoff SessionEventType = "session.handoff" SessionEventTypeSessionIdle SessionEventType = "session.idle" SessionEventTypeSessionInfo SessionEventType = "session.info" SessionEventTypeSessionMCPServersLoaded SessionEventType = "session.mcp_servers_loaded" SessionEventTypeSessionMCPServerStatusChanged SessionEventType = "session.mcp_server_status_changed" SessionEventTypeSessionModeChanged SessionEventType = "session.mode_changed" SessionEventTypeSessionModelChange SessionEventType = "session.model_change" SessionEventTypeSessionPermissionsChanged SessionEventType = "session.permissions_changed" SessionEventTypeSessionPlanChanged SessionEventType = "session.plan_changed" SessionEventTypeSessionRemoteSteerableChanged SessionEventType = "session.remote_steerable_changed" SessionEventTypeSessionResume SessionEventType = "session.resume" SessionEventTypeSessionScheduleCancelled SessionEventType = "session.schedule_cancelled" SessionEventTypeSessionScheduleCreated SessionEventType = "session.schedule_created" SessionEventTypeSessionShutdown SessionEventType = "session.shutdown" SessionEventTypeSessionSkillsLoaded SessionEventType = "session.skills_loaded" SessionEventTypeSessionSnapshotRewind SessionEventType = "session.snapshot_rewind" SessionEventTypeSessionStart SessionEventType = "session.start" SessionEventTypeSessionTaskComplete SessionEventType = "session.task_complete" SessionEventTypeSessionTitleChanged SessionEventType = "session.title_changed" SessionEventTypeSessionToolsUpdated SessionEventType = "session.tools_updated" SessionEventTypeSessionTruncation SessionEventType = "session.truncation" SessionEventTypeSessionUsageInfo SessionEventType = "session.usage_info" SessionEventTypeSessionWarning SessionEventType = "session.warning" SessionEventTypeSessionWorkspaceFileChanged SessionEventType = "session.workspace_file_changed" SessionEventTypeSkillInvoked SessionEventType = "skill.invoked" SessionEventTypeSubagentCompleted SessionEventType = "subagent.completed" SessionEventTypeSubagentDeselected SessionEventType = "subagent.deselected" SessionEventTypeSubagentFailed SessionEventType = "subagent.failed" SessionEventTypeSubagentSelected SessionEventType = "subagent.selected" SessionEventTypeSubagentStarted SessionEventType = "subagent.started" SessionEventTypeSystemMessage SessionEventType = "system.message" SessionEventTypeSystemNotification SessionEventType = "system.notification" SessionEventTypeToolExecutionComplete SessionEventType = "tool.execution_complete" SessionEventTypeToolExecutionPartialResult SessionEventType = "tool.execution_partial_result" SessionEventTypeToolExecutionProgress SessionEventType = "tool.execution_progress" SessionEventTypeToolExecutionStart SessionEventType = "tool.execution_start" SessionEventTypeToolUserRequested SessionEventType = "tool.user_requested" SessionEventTypeUserInputCompleted SessionEventType = "user_input.completed" SessionEventTypeUserInputRequested SessionEventType = "user_input.requested" SessionEventTypeUserMessage SessionEventType = "user.message" )
type SessionExtensionsAttachmentsPushedData ¶ added in v1.0.0
type SessionExtensionsAttachmentsPushedData struct {
// Attachments contributed by an extension; the host should surface these as composer pills and forward them via the next session.send call.
Attachments []Attachment `json:"attachments"`
}
Schema for the `ExtensionsAttachmentsPushedData` type.
func (*SessionExtensionsAttachmentsPushedData) Type ¶ added in v1.0.0
func (*SessionExtensionsAttachmentsPushedData) Type() SessionEventType
func (*SessionExtensionsAttachmentsPushedData) UnmarshalJSON ¶ added in v1.0.0
func (r *SessionExtensionsAttachmentsPushedData) UnmarshalJSON(data []byte) error
type SessionExtensionsDisableResult ¶ added in v0.2.0
type SessionExtensionsDisableResult struct {
}
Experimental: SessionExtensionsDisableResult is part of an experimental API and may change or be removed.
type SessionExtensionsEnableResult ¶ added in v0.2.0
type SessionExtensionsEnableResult struct {
}
Experimental: SessionExtensionsEnableResult is part of an experimental API and may change or be removed.
type SessionExtensionsLoadedData ¶ added in v1.0.0
type SessionExtensionsLoadedData struct {
// Array of discovered extensions and their status
Extensions []ExtensionsLoadedExtension `json:"extensions"`
}
Schema for the `ExtensionsLoadedData` type.
func (*SessionExtensionsLoadedData) Type ¶ added in v1.0.0
func (*SessionExtensionsLoadedData) Type() SessionEventType
type SessionExtensionsReloadResult ¶ added in v0.2.0
type SessionExtensionsReloadResult struct {
}
Experimental: SessionExtensionsReloadResult is part of an experimental API and may change or be removed.
type SessionExtensionsSendAttachmentsToMessageResult ¶ added in v1.0.0
type SessionExtensionsSendAttachmentsToMessageResult struct {
}
Experimental: SessionExtensionsSendAttachmentsToMessageResult is part of an experimental API and may change or be removed.
type SessionFSAppendFileRequest ¶ added in v0.3.0
type SessionFSAppendFileRequest struct {
// Content to append
Content string `json:"content"`
// Optional POSIX-style mode for newly created files
Mode *int64 `json:"mode,omitempty"`
// Path using SessionFs conventions
Path string `json:"path"`
// Target session identifier
SessionID string `json:"sessionId"`
}
File path, content to append, and optional mode for the client-provided session filesystem. Experimental: SessionFSAppendFileRequest is part of an experimental API and may change or be removed.
type SessionFSError ¶ added in v0.3.0
type SessionFSError struct {
// Error classification
Code SessionFSErrorCode `json:"code"`
// Free-form detail about the error, for logging/diagnostics
Message *string `json:"message,omitempty"`
}
Describes a filesystem error. Experimental: SessionFSError is part of an experimental API and may change or be removed.
type SessionFSErrorCode ¶ added in v0.3.0
type SessionFSErrorCode string
Error classification Experimental: SessionFSErrorCode is part of an experimental API and may change or be removed.
const ( // The requested path does not exist. SessionFSErrorCodeENOENT SessionFSErrorCode = "ENOENT" // The filesystem operation failed for an unspecified reason. SessionFSErrorCodeUNKNOWN SessionFSErrorCode = "UNKNOWN" )
type SessionFSExistsRequest ¶ added in v0.3.0
type SessionFSExistsRequest struct {
// Path using SessionFs conventions
Path string `json:"path"`
// Target session identifier
SessionID string `json:"sessionId"`
}
Path to test for existence in the client-provided session filesystem. Experimental: SessionFSExistsRequest is part of an experimental API and may change or be removed.
type SessionFSExistsResult ¶ added in v0.2.2
type SessionFSExistsResult struct {
// Whether the path exists
Exists bool `json:"exists"`
}
Indicates whether the requested path exists in the client-provided session filesystem. Experimental: SessionFSExistsResult is part of an experimental API and may change or be removed.
type SessionFSHandler ¶ added in v1.0.0
type SessionFSHandler interface {
// AppendFile appends content to a file in the client-provided session filesystem.
//
// RPC method: sessionFs.appendFile.
//
// Parameters: File path, content to append, and optional mode for the client-provided
// session filesystem.
//
// Returns: Describes a filesystem error.
AppendFile(request *SessionFSAppendFileRequest) (*SessionFSError, error)
// Exists checks whether a path exists in the client-provided session filesystem.
//
// RPC method: sessionFs.exists.
//
// Parameters: Path to test for existence in the client-provided session filesystem.
//
// Returns: Indicates whether the requested path exists in the client-provided session
// filesystem.
Exists(request *SessionFSExistsRequest) (*SessionFSExistsResult, error)
// Mkdir creates a directory in the client-provided session filesystem.
//
// RPC method: sessionFs.mkdir.
//
// Parameters: Directory path to create in the client-provided session filesystem, with
// options for recursive creation and POSIX mode.
//
// Returns: Describes a filesystem error.
Mkdir(request *SessionFSMkdirRequest) (*SessionFSError, error)
// Readdir lists entry names in a directory from the client-provided session filesystem.
//
// RPC method: sessionFs.readdir.
//
// Parameters: Directory path whose entries should be listed from the client-provided
// session filesystem.
//
// Returns: Names of entries in the requested directory, or a filesystem error if the read
// failed.
Readdir(request *SessionFSReaddirRequest) (*SessionFSReaddirResult, error)
// ReaddirWithTypes lists directory entries with type information from the client-provided
// session filesystem.
//
// RPC method: sessionFs.readdirWithTypes.
//
// Parameters: Directory path whose entries (with type information) should be listed from
// the client-provided session filesystem.
//
// Returns: Entries in the requested directory paired with file/directory type information,
// or a filesystem error if the read failed.
ReaddirWithTypes(request *SessionFSReaddirWithTypesRequest) (*SessionFSReaddirWithTypesResult, error)
// ReadFile reads a file from the client-provided session filesystem.
//
// RPC method: sessionFs.readFile.
//
// Parameters: Path of the file to read from the client-provided session filesystem.
//
// Returns: File content as a UTF-8 string, or a filesystem error if the read failed.
ReadFile(request *SessionFSReadFileRequest) (*SessionFSReadFileResult, error)
// Renames or moves a path in the client-provided session filesystem.
//
// RPC method: sessionFs.rename.
//
// Parameters: Source and destination paths for renaming or moving an entry in the
// client-provided session filesystem.
//
// Returns: Describes a filesystem error.
Rename(request *SessionFSRenameRequest) (*SessionFSError, error)
// Rm removes a file or directory from the client-provided session filesystem.
//
// RPC method: sessionFs.rm.
//
// Parameters: Path to remove from the client-provided session filesystem, with options for
// recursive removal and force.
//
// Returns: Describes a filesystem error.
Rm(request *SessionFSRmRequest) (*SessionFSError, error)
// SqliteExists checks whether the per-session SQLite database already exists, without
// creating it.
//
// RPC method: sessionFs.sqliteExists.
//
// Parameters: Identifies the target session.
//
// Returns: Indicates whether the per-session SQLite database already exists.
SqliteExists(request *SessionFSSqliteExistsRequest) (*SessionFSSqliteExistsResult, error)
// SqliteQuery executes a SQLite query against the per-session database.
//
// RPC method: sessionFs.sqliteQuery.
//
// Parameters: SQL query, query type, and optional bind parameters for executing a SQLite
// query against the per-session database.
//
// Returns: Query results including rows, columns, and rows affected, or a filesystem error
// if execution failed.
SqliteQuery(request *SessionFSSqliteQueryRequest) (*SessionFSSqliteQueryResult, error)
// Stat gets metadata for a path in the client-provided session filesystem.
//
// RPC method: sessionFs.stat.
//
// Parameters: Path whose metadata should be returned from the client-provided session
// filesystem.
//
// Returns: Filesystem metadata for the requested path, or a filesystem error if the stat
// failed.
Stat(request *SessionFSStatRequest) (*SessionFSStatResult, error)
// WriteFile writes a file in the client-provided session filesystem.
//
// RPC method: sessionFs.writeFile.
//
// Parameters: File path, content to write, and optional mode for the client-provided
// session filesystem.
//
// Returns: Describes a filesystem error.
WriteFile(request *SessionFSWriteFileRequest) (*SessionFSError, error)
}
Experimental: SessionFSHandler contains experimental APIs that may change or be removed.
type SessionFSMkdirRequest ¶ added in v0.3.0
type SessionFSMkdirRequest struct {
// Optional POSIX-style mode for newly created directories
Mode *int64 `json:"mode,omitempty"`
// Path using SessionFs conventions
Path string `json:"path"`
// Create parent directories as needed
Recursive *bool `json:"recursive,omitempty"`
// Target session identifier
SessionID string `json:"sessionId"`
}
Directory path to create in the client-provided session filesystem, with options for recursive creation and POSIX mode. Experimental: SessionFSMkdirRequest is part of an experimental API and may change or be removed.
type SessionFSReadFileRequest ¶ added in v0.3.0
type SessionFSReadFileRequest struct {
// Path using SessionFs conventions
Path string `json:"path"`
// Target session identifier
SessionID string `json:"sessionId"`
}
Path of the file to read from the client-provided session filesystem. Experimental: SessionFSReadFileRequest is part of an experimental API and may change or be removed.
type SessionFSReadFileResult ¶ added in v0.2.2
type SessionFSReadFileResult struct {
// File content as UTF-8 string
Content string `json:"content"`
// Describes a filesystem error.
Error *SessionFSError `json:"error,omitempty"`
}
File content as a UTF-8 string, or a filesystem error if the read failed. Experimental: SessionFSReadFileResult is part of an experimental API and may change or be removed.
type SessionFSReaddirRequest ¶ added in v0.3.0
type SessionFSReaddirRequest struct {
// Path using SessionFs conventions
Path string `json:"path"`
// Target session identifier
SessionID string `json:"sessionId"`
}
Directory path whose entries should be listed from the client-provided session filesystem. Experimental: SessionFSReaddirRequest is part of an experimental API and may change or be removed.
type SessionFSReaddirResult ¶ added in v0.2.2
type SessionFSReaddirResult struct {
// Entry names in the directory
Entries []string `json:"entries"`
// Describes a filesystem error.
Error *SessionFSError `json:"error,omitempty"`
}
Names of entries in the requested directory, or a filesystem error if the read failed. Experimental: SessionFSReaddirResult is part of an experimental API and may change or be removed.
type SessionFSReaddirWithTypesEntry ¶ added in v0.3.0
type SessionFSReaddirWithTypesEntry struct {
// Entry name
Name string `json:"name"`
// Entry type
Type SessionFSReaddirWithTypesEntryType `json:"type"`
}
Schema for the `SessionFsReaddirWithTypesEntry` type. Experimental: SessionFSReaddirWithTypesEntry is part of an experimental API and may change or be removed.
type SessionFSReaddirWithTypesEntryType ¶ added in v0.3.0
type SessionFSReaddirWithTypesEntryType string
Entry type Experimental: SessionFSReaddirWithTypesEntryType is part of an experimental API and may change or be removed.
const ( // The entry is a directory. SessionFSReaddirWithTypesEntryTypeDirectory SessionFSReaddirWithTypesEntryType = "directory" // The entry is a file. SessionFSReaddirWithTypesEntryTypeFile SessionFSReaddirWithTypesEntryType = "file" )
type SessionFSReaddirWithTypesRequest ¶ added in v0.3.0
type SessionFSReaddirWithTypesRequest struct {
// Path using SessionFs conventions
Path string `json:"path"`
// Target session identifier
SessionID string `json:"sessionId"`
}
Directory path whose entries (with type information) should be listed from the client-provided session filesystem. Experimental: SessionFSReaddirWithTypesRequest is part of an experimental API and may change or be removed.
type SessionFSReaddirWithTypesResult ¶ added in v0.2.2
type SessionFSReaddirWithTypesResult struct {
// Directory entries with type information
Entries []SessionFSReaddirWithTypesEntry `json:"entries"`
// Describes a filesystem error.
Error *SessionFSError `json:"error,omitempty"`
}
Entries in the requested directory paired with file/directory type information, or a filesystem error if the read failed. Experimental: SessionFSReaddirWithTypesResult is part of an experimental API and may change or be removed.
type SessionFSRenameRequest ¶ added in v0.3.0
type SessionFSRenameRequest struct {
// Destination path using SessionFs conventions
Dest string `json:"dest"`
// Target session identifier
SessionID string `json:"sessionId"`
// Source path using SessionFs conventions
Src string `json:"src"`
}
Source and destination paths for renaming or moving an entry in the client-provided session filesystem. Experimental: SessionFSRenameRequest is part of an experimental API and may change or be removed.
type SessionFSRmRequest ¶ added in v0.3.0
type SessionFSRmRequest struct {
// Ignore errors if the path does not exist
Force *bool `json:"force,omitempty"`
// Path using SessionFs conventions
Path string `json:"path"`
// Remove directories and their contents recursively
Recursive *bool `json:"recursive,omitempty"`
// Target session identifier
SessionID string `json:"sessionId"`
}
Path to remove from the client-provided session filesystem, with options for recursive removal and force. Experimental: SessionFSRmRequest is part of an experimental API and may change or be removed.
type SessionFSSetProviderCapabilities ¶ added in v1.0.0
type SessionFSSetProviderCapabilities struct {
// Whether the provider supports SQLite query/exists operations
Sqlite *bool `json:"sqlite,omitempty"`
}
Optional capabilities declared by the provider
type SessionFSSetProviderConventions ¶ added in v0.3.0
type SessionFSSetProviderConventions string
Path conventions used by this filesystem
const ( // Paths use POSIX path conventions. SessionFSSetProviderConventionsPosix SessionFSSetProviderConventions = "posix" // Paths use Windows path conventions. SessionFSSetProviderConventionsWindows SessionFSSetProviderConventions = "windows" )
type SessionFSSetProviderRequest ¶ added in v0.3.0
type SessionFSSetProviderRequest struct {
// Optional capabilities declared by the provider
Capabilities *SessionFSSetProviderCapabilities `json:"capabilities,omitempty"`
// Path conventions used by this filesystem
Conventions SessionFSSetProviderConventions `json:"conventions"`
// Initial working directory for sessions
InitialCwd string `json:"initialCwd"`
// Path within each session's SessionFs where the runtime stores files for that session
SessionStatePath string `json:"sessionStatePath"`
}
Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider.
type SessionFSSetProviderResult ¶ added in v0.2.1
type SessionFSSetProviderResult struct {
// Whether the provider was set successfully
Success bool `json:"success"`
}
Indicates whether the calling client was registered as the session filesystem provider.
type SessionFSSqliteExistsRequest ¶ added in v1.0.0
type SessionFSSqliteExistsRequest struct {
// Target session identifier
SessionID string `json:"sessionId"`
}
Identifies the target session. Experimental: SessionFSSqliteExistsRequest is part of an experimental API and may change or be removed.
type SessionFSSqliteExistsResult ¶ added in v1.0.0
type SessionFSSqliteExistsResult struct {
// Whether the session database already exists
Exists bool `json:"exists"`
}
Indicates whether the per-session SQLite database already exists. Experimental: SessionFSSqliteExistsResult is part of an experimental API and may change or be removed.
type SessionFSSqliteQueryRequest ¶ added in v1.0.0
type SessionFSSqliteQueryRequest struct {
// Optional named bind parameters
Params map[string]any `json:"params,omitzero"`
// SQL query to execute
Query string `json:"query"`
// How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT
// (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected)
QueryType SessionFSSqliteQueryType `json:"queryType"`
// Target session identifier
SessionID string `json:"sessionId"`
}
SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. Experimental: SessionFSSqliteQueryRequest is part of an experimental API and may change or be removed.
type SessionFSSqliteQueryResult ¶ added in v1.0.0
type SessionFSSqliteQueryResult struct {
// Column names from the result set
Columns []string `json:"columns"`
// Describes a filesystem error.
Error *SessionFSError `json:"error,omitempty"`
// SQLite last_insert_rowid() value for INSERT.
LastInsertRowid *int64 `json:"lastInsertRowid,omitempty"`
// For SELECT: array of row objects. For others: empty array.
Rows []map[string]any `json:"rows"`
// Number of rows affected (for INSERT/UPDATE/DELETE)
RowsAffected int64 `json:"rowsAffected"`
}
Query results including rows, columns, and rows affected, or a filesystem error if execution failed. Experimental: SessionFSSqliteQueryResult is part of an experimental API and may change or be removed.
type SessionFSSqliteQueryType ¶ added in v1.0.0
type SessionFSSqliteQueryType string
How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected) Experimental: SessionFSSqliteQueryType is part of an experimental API and may change or be removed.
const ( // Execute DDL or multi-statement SQL without returning rows. SessionFSSqliteQueryTypeExec SessionFSSqliteQueryType = "exec" // Execute a SELECT-style query and return rows. SessionFSSqliteQueryTypeQuery SessionFSSqliteQueryType = "query" // Execute INSERT, UPDATE, or DELETE SQL and return affected-row metadata. SessionFSSqliteQueryTypeRun SessionFSSqliteQueryType = "run" )
type SessionFSStatRequest ¶ added in v0.3.0
type SessionFSStatRequest struct {
// Path using SessionFs conventions
Path string `json:"path"`
// Target session identifier
SessionID string `json:"sessionId"`
}
Path whose metadata should be returned from the client-provided session filesystem. Experimental: SessionFSStatRequest is part of an experimental API and may change or be removed.
type SessionFSStatResult ¶ added in v0.2.2
type SessionFSStatResult struct {
// ISO 8601 timestamp of creation
Birthtime time.Time `json:"birthtime"`
// Describes a filesystem error.
Error *SessionFSError `json:"error,omitempty"`
// Whether the path is a directory
IsDirectory bool `json:"isDirectory"`
// Whether the path is a file
IsFile bool `json:"isFile"`
// ISO 8601 timestamp of last modification
Mtime time.Time `json:"mtime"`
// File size in bytes
Size int64 `json:"size"`
}
Filesystem metadata for the requested path, or a filesystem error if the stat failed. Experimental: SessionFSStatResult is part of an experimental API and may change or be removed.
type SessionFSWriteFileRequest ¶ added in v0.3.0
type SessionFSWriteFileRequest struct {
// Content to write
Content string `json:"content"`
// Optional POSIX-style mode for newly created files
Mode *int64 `json:"mode,omitempty"`
// Path using SessionFs conventions
Path string `json:"path"`
// Target session identifier
SessionID string `json:"sessionId"`
}
File path, content to write, and optional mode for the client-provided session filesystem. Experimental: SessionFSWriteFileRequest is part of an experimental API and may change or be removed.
type SessionHandoffData ¶ added in v1.0.0
type SessionHandoffData struct {
// Additional context information for the handoff
Context *string `json:"context,omitempty"`
// ISO 8601 timestamp when the handoff occurred
HandoffTime time.Time `json:"handoffTime"`
// GitHub host URL for the source session (e.g., https://github.com or https://tenant.ghe.com)
Host *string `json:"host,omitempty"`
// Session ID of the remote session being handed off
RemoteSessionID *string `json:"remoteSessionId,omitempty"`
// Repository context for the handed-off session
Repository *HandoffRepository `json:"repository,omitempty"`
// Origin type of the session being handed off
SourceType HandoffSourceType `json:"sourceType"`
// Summary of the work done in the source session
Summary *string `json:"summary,omitempty"`
}
Session handoff metadata including source, context, and repository information
func (*SessionHandoffData) Type ¶ added in v1.0.0
func (*SessionHandoffData) Type() SessionEventType
type SessionIdleData ¶ added in v1.0.0
type SessionIdleData struct {
// True when the preceding agentic loop was cancelled via abort signal
Aborted *bool `json:"aborted,omitempty"`
}
Payload indicating the session is idle with no background agents or attached shell commands in flight
func (*SessionIdleData) Type ¶ added in v1.0.0
func (*SessionIdleData) Type() SessionEventType
type SessionInfoData ¶ added in v1.0.0
type SessionInfoData struct {
// Category of informational message (e.g., "notification", "timing", "context_window", "mcp", "snapshot", "configuration", "authentication", "model")
InfoType string `json:"infoType"`
// Human-readable informational message for display in the timeline
Message string `json:"message"`
// Optional actionable tip displayed with this message
Tip *string `json:"tip,omitempty"`
// Optional URL associated with this message that the user can open in a browser
URL *string `json:"url,omitempty"`
}
Informational message for timeline display with categorization
func (*SessionInfoData) Type ¶ added in v1.0.0
func (*SessionInfoData) Type() SessionEventType
type SessionInstalledPlugin ¶ added in v1.0.0
type SessionInstalledPlugin struct {
// Path where the plugin is cached locally
CachePath *string `json:"cache_path,omitempty"`
// Whether the plugin is currently enabled
Enabled bool `json:"enabled"`
// Installation timestamp (ISO-8601)
InstalledAt string `json:"installed_at"`
// Marketplace the plugin came from (empty string for direct repo installs)
Marketplace string `json:"marketplace"`
// Plugin name
Name string `json:"name"`
// Source descriptor for direct repo installs (when marketplace is empty)
Source *SessionInstalledPluginSource `json:"source,omitempty"`
// Installed version, if known
Version *string `json:"version,omitempty"`
}
Schema for the `SessionInstalledPlugin` type. Experimental: SessionInstalledPlugin is part of an experimental API and may change or be removed.
type SessionInstalledPluginSource ¶ added in v1.0.0
type SessionInstalledPluginSource struct {
SessionInstalledPluginSourceGitHub *SessionInstalledPluginSourceGitHub
SessionInstalledPluginSourceLocal *SessionInstalledPluginSourceLocal
SessionInstalledPluginSourceURL *SessionInstalledPluginSourceURL
String *string
}
Source descriptor for direct repo installs (when marketplace is empty) Experimental: SessionInstalledPluginSource is part of an experimental API and may change or be removed.
func (SessionInstalledPluginSource) MarshalJSON ¶ added in v1.0.0
func (r SessionInstalledPluginSource) MarshalJSON() ([]byte, error)
func (*SessionInstalledPluginSource) UnmarshalJSON ¶ added in v1.0.0
func (r *SessionInstalledPluginSource) UnmarshalJSON(data []byte) error
type SessionInstalledPluginSourceGitHub ¶ added in v1.0.0
type SessionInstalledPluginSourceGitHub struct {
Path *string `json:"path,omitempty"`
Ref *string `json:"ref,omitempty"`
Repo string `json:"repo"`
// Constant value. Always "github".
Source SessionInstalledPluginSourceGitHubSource `json:"source"`
}
Schema for the `SessionInstalledPluginSourceGitHub` type. Experimental: SessionInstalledPluginSourceGitHub is part of an experimental API and may change or be removed.
type SessionInstalledPluginSourceGitHubSource ¶ added in v1.0.0
type SessionInstalledPluginSourceGitHubSource string
Constant value. Always "github".
const (
SessionInstalledPluginSourceGitHubSourceGitHub SessionInstalledPluginSourceGitHubSource = "github"
)
type SessionInstalledPluginSourceLocal ¶ added in v1.0.0
type SessionInstalledPluginSourceLocal struct {
Path string `json:"path"`
// Constant value. Always "local".
Source SessionInstalledPluginSourceLocalSource `json:"source"`
}
Schema for the `SessionInstalledPluginSourceLocal` type. Experimental: SessionInstalledPluginSourceLocal is part of an experimental API and may change or be removed.
type SessionInstalledPluginSourceLocalSource ¶ added in v1.0.0
type SessionInstalledPluginSourceLocalSource string
Constant value. Always "local".
const (
SessionInstalledPluginSourceLocalSourceLocal SessionInstalledPluginSourceLocalSource = "local"
)
type SessionInstalledPluginSourceURL ¶ added in v1.0.0
type SessionInstalledPluginSourceURL struct {
Path *string `json:"path,omitempty"`
Ref *string `json:"ref,omitempty"`
// Constant value. Always "url".
Source SessionInstalledPluginSourceURLSource `json:"source"`
URL string `json:"url"`
}
Schema for the `SessionInstalledPluginSourceUrl` type. Experimental: SessionInstalledPluginSourceURL is part of an experimental API and may change or be removed.
type SessionInstalledPluginSourceURLSource ¶ added in v1.0.0
type SessionInstalledPluginSourceURLSource string
Constant value. Always "url".
const (
SessionInstalledPluginSourceURLSourceURL SessionInstalledPluginSourceURLSource = "url"
)
type SessionList ¶ added in v1.0.0
type SessionList struct {
// Sessions ordered most-recently-modified first. Discriminated by `isRemote`.
Sessions []SessionListEntry `json:"sessions"`
}
Sessions matching the filter, ordered most-recently-modified first. Experimental: SessionList is part of an experimental API and may change or be removed.
func (*SessionList) UnmarshalJSON ¶ added in v1.0.1
func (r *SessionList) UnmarshalJSON(data []byte) error
type SessionListEntry ¶ added in v1.0.1
type SessionListEntry interface {
// contains filtered or unexported methods
}
Local or remote session metadata entry. Narrow on `isRemote` to access source-specific fields. Experimental: SessionListEntry is part of an experimental API and may change or be removed.
type SessionListFilter ¶ added in v1.0.0
type SessionListFilter struct {
// Match sessions whose context.branch equals this value
Branch *string `json:"branch,omitempty"`
// Match sessions whose context.cwd equals this value
Cwd *string `json:"cwd,omitempty"`
// Match sessions whose context.gitRoot equals this value
GitRoot *string `json:"gitRoot,omitempty"`
// Match sessions whose context.repository equals this value
Repository *string `json:"repository,omitempty"`
}
Optional filter applied to the returned sessions Experimental: SessionListFilter is part of an experimental API and may change or be removed.
type SessionLoadDeferredRepoHooksResult ¶ added in v1.0.0
type SessionLoadDeferredRepoHooksResult struct {
// Total hook command count (user + plugin + repo) loaded for the session by this call.
// Captured atomically with startupPrompts so callers don't need to read a separate counter.
HookCount int64 `json:"hookCount"`
// Repo-level startup prompts queued from repo hook configs. Empty on resume, when no repo
// configs were pending, or when disableAllHooks is set.
StartupPrompts []string `json:"startupPrompts"`
}
Queued repo-level startup prompts and the total hook command count after loading. Experimental: SessionLoadDeferredRepoHooksResult is part of an experimental API and may change or be removed.
type SessionLogLevel ¶ added in v0.3.0
type SessionLogLevel string
Log severity level. Determines how the message is displayed in the timeline. Defaults to "info". Experimental: SessionLogLevel is part of an experimental API and may change or be removed.
const ( // Error message describing a failure. SessionLogLevelError SessionLogLevel = "error" // Informational message. SessionLogLevelInfo SessionLogLevel = "info" // Warning message that may require attention. SessionLogLevelWarning SessionLogLevel = "warning" )
type SessionLspInitializeResult ¶ added in v1.0.0
type SessionLspInitializeResult struct {
}
Experimental: SessionLspInitializeResult is part of an experimental API and may change or be removed.
type SessionMCPAppsCallToolResult ¶ added in v1.0.0
Standard MCP CallToolResult Experimental: SessionMCPAppsCallToolResult is part of an experimental API and may change or be removed.
type SessionMCPAppsSetHostContextResult ¶ added in v1.0.0
type SessionMCPAppsSetHostContextResult struct {
}
Experimental: SessionMCPAppsSetHostContextResult is part of an experimental API and may change or be removed.
type SessionMCPDisableResult ¶ added in v0.2.0
type SessionMCPDisableResult struct {
}
Experimental: SessionMCPDisableResult is part of an experimental API and may change or be removed.
type SessionMCPEnableResult ¶ added in v0.2.0
type SessionMCPEnableResult struct {
}
Experimental: SessionMCPEnableResult is part of an experimental API and may change or be removed.
type SessionMCPRegisterExternalClientResult ¶ added in v1.0.1
type SessionMCPRegisterExternalClientResult struct {
}
Experimental: SessionMCPRegisterExternalClientResult is part of an experimental API and may change or be removed.
type SessionMCPReloadResult ¶ added in v0.2.0
type SessionMCPReloadResult struct {
}
Experimental: SessionMCPReloadResult is part of an experimental API and may change or be removed.
type SessionMCPRestartServerResult ¶ added in v1.0.1
type SessionMCPRestartServerResult struct {
}
Experimental: SessionMCPRestartServerResult is part of an experimental API and may change or be removed.
type SessionMCPServerStatusChangedData ¶ added in v1.0.0
type SessionMCPServerStatusChangedData struct {
// Error message if the server entered a failed state
Error *string `json:"error,omitempty"`
// Name of the MCP server whose status changed
ServerName string `json:"serverName"`
// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
Status MCPServerStatus `json:"status"`
}
Schema for the `McpServerStatusChangedData` type.
func (*SessionMCPServerStatusChangedData) Type ¶ added in v1.0.0
func (*SessionMCPServerStatusChangedData) Type() SessionEventType
type SessionMCPServersLoadedData ¶ added in v1.0.0
type SessionMCPServersLoadedData struct {
// Array of MCP server status summaries
Servers []MCPServersLoadedServer `json:"servers"`
}
Schema for the `McpServersLoadedData` type.
func (*SessionMCPServersLoadedData) Type ¶ added in v1.0.0
func (*SessionMCPServersLoadedData) Type() SessionEventType
type SessionMCPStartServerResult ¶ added in v1.0.1
type SessionMCPStartServerResult struct {
}
Experimental: SessionMCPStartServerResult is part of an experimental API and may change or be removed.
type SessionMCPStopServerResult ¶ added in v1.0.1
type SessionMCPStopServerResult struct {
}
Experimental: SessionMCPStopServerResult is part of an experimental API and may change or be removed.
type SessionMCPUnregisterExternalClientResult ¶ added in v1.0.1
type SessionMCPUnregisterExternalClientResult struct {
}
Experimental: SessionMCPUnregisterExternalClientResult is part of an experimental API and may change or be removed.
type SessionMetadataSnapshot ¶ added in v1.0.0
type SessionMetadataSnapshot struct {
// 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.
AlreadyInUse bool `json:"alreadyInUse"`
// Runtime client name associated with the session (telemetry identifier).
ClientName *string `json:"clientName,omitempty"`
// The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot')
CurrentMode MetadataSnapshotCurrentMode `json:"currentMode"`
// User-provided name supplied at session construction (via `--name`), if any. Immutable
// after construction.
InitialName *string `json:"initialName,omitempty"`
// Whether this is a remote session (i.e., one whose runtime executes elsewhere and is
// steered through this process)
IsRemote bool `json:"isRemote"`
// 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.
ModifiedTime time.Time `json:"modifiedTime"`
// Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are
// immutable for the lifetime of the session.
RemoteMetadata *MetadataSnapshotRemoteMetadata `json:"remoteMetadata,omitempty"`
// Currently selected model identifier, if any
SelectedModel *string `json:"selectedModel,omitempty"`
// The unique identifier of the session
SessionID string `json:"sessionId"`
// ISO 8601 timestamp of when the session started
StartTime time.Time `json:"startTime"`
// Short human-readable summary of the session, if known. Omitted when no summary has been
// generated.
Summary *string `json:"summary,omitempty"`
// Absolute path to the session's current working directory
WorkingDirectory string `json:"workingDirectory"`
// 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).
Workspace *WorkspaceSummary `json:"workspace,omitempty"`
// Absolute path to the session's workspace directory on disk, or null if the session has no
// associated workspace
WorkspacePath *string `json:"workspacePath"`
}
Point-in-time snapshot of slow-changing session identifier and state fields Experimental: SessionMetadataSnapshot is part of an experimental API and may change or be removed.
type SessionMode ¶ added in v0.3.0
type SessionMode string
The session mode the agent is operating in Experimental: SessionMode is part of an experimental API and may change or be removed.
const ( // The agent is working autonomously toward task completion. SessionModeAutopilot SessionMode = "autopilot" // The agent is responding interactively to the user. SessionModeInteractive SessionMode = "interactive" // The agent is preparing a plan before making changes. SessionModePlan SessionMode = "plan" )
type SessionModeChangedData ¶ added in v1.0.0
type SessionModeChangedData struct {
// The session mode the agent is operating in
NewMode SessionMode `json:"newMode"`
// The session mode the agent is operating in
PreviousMode SessionMode `json:"previousMode"`
}
Agent mode change details including previous and new modes
func (*SessionModeChangedData) Type ¶ added in v1.0.0
func (*SessionModeChangedData) Type() SessionEventType
type SessionModeSetResult ¶ added in v0.1.25
type SessionModeSetResult struct {
}
Experimental: SessionModeSetResult is part of an experimental API and may change or be removed.
type SessionModelChangeData ¶ added in v1.0.0
type SessionModelChangeData struct {
// Reason the change happened, when not user-initiated. Currently `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path. UI clients can use this to render contextual copy.
Cause *string `json:"cause,omitempty"`
// Context tier after the model change; null explicitly clears a previously selected tier
ContextTier *ContextTier `json:"contextTier,omitempty"`
// Newly selected model identifier
NewModel string `json:"newModel"`
// Model that was previously selected, if any
PreviousModel *string `json:"previousModel,omitempty"`
// Reasoning effort level before the model change, if applicable
PreviousReasoningEffort *string `json:"previousReasoningEffort,omitempty"`
// Reasoning summary mode before the model change, if applicable
PreviousReasoningSummary *ReasoningSummary `json:"previousReasoningSummary,omitempty"`
// Reasoning effort level after the model change, if applicable
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
// Reasoning summary mode after the model change, if applicable
ReasoningSummary *ReasoningSummary `json:"reasoningSummary,omitempty"`
}
Model change details including previous and new model identifiers
func (*SessionModelChangeData) Type ¶ added in v1.0.0
func (*SessionModelChangeData) Type() SessionEventType
type SessionModelList ¶ added in v1.0.0
type SessionModelList struct {
// Available models, ordered with the most preferred default first.
List []any `json:"list"`
// Per-quota snapshots returned alongside the model list, keyed by quota type.
QuotaSnapshots map[string]any `json:"quotaSnapshots,omitzero"`
}
The list of models available to this session. Experimental: SessionModelList is part of an experimental API and may change or be removed.
type SessionNameSetResult ¶ added in v1.0.0
type SessionNameSetResult struct {
}
Experimental: SessionNameSetResult is part of an experimental API and may change or be removed.
type SessionOpenOptions ¶ added in v1.0.1
type SessionOpenOptions struct {
// Additional content-exclusion policies to merge into the session policy set.
// Experimental: AdditionalContentExclusionPolicies is part of an experimental API and may
// change or be removed.
AdditionalContentExclusionPolicies []SessionOpenOptionsAdditionalContentExclusionPolicy `json:"additionalContentExclusionPolicies,omitzero"`
// Runtime context discriminator for agent filtering.
AgentContext *string `json:"agentContext,omitempty"`
// Whether ask_user is explicitly disabled.
AskUserDisabled *bool `json:"askUserDisabled,omitempty"`
// Initial authentication info for the session.
AuthInfo AuthInfo `json:"authInfo,omitempty"`
// Allowlist of available tool names.
AvailableTools []string `json:"availableTools,omitzero"`
// Structured client kind used for runtime behavior gates.
ClientKind *string `json:"clientKind,omitempty"`
// Identifier of the client driving the session.
ClientName *string `json:"clientName,omitempty"`
CoauthorEnabled *bool `json:"coauthorEnabled,omitempty"`
// Override Copilot configuration directory.
ConfigDir *string `json:"configDir,omitempty"`
// Whether auto-mode continuation is enabled.
ContinueOnAutoMode *bool `json:"continueOnAutoMode,omitempty"`
// Override URL for the Copilot API endpoint.
CopilotURL *string `json:"copilotUrl,omitempty"`
// Whether custom agents default to local-only execution.
CustomAgentsLocalOnly *bool `json:"customAgentsLocalOnly,omitempty"`
// Parent engagement ID for detached child telemetry rollup.
DetachedFromSpawningParentEngagementID *string `json:"detachedFromSpawningParentEngagementId,omitempty"`
// Parent session ID for detached child telemetry rollup.
DetachedFromSpawningParentSessionID *string `json:"detachedFromSpawningParentSessionId,omitempty"`
// Instruction source IDs disabled for this session.
DisabledInstructionSources []string `json:"disabledInstructionSources,omitzero"`
// Skill IDs disabled for this session.
DisabledSkills []string `json:"disabledSkills,omitzero"`
// Whether on-demand custom instruction discovery is enabled.
EnableOnDemandInstructionDiscovery *bool `json:"enableOnDemandInstructionDiscovery,omitempty"`
// Whether shell-script safety heuristics are enabled.
EnableScriptSafety *bool `json:"enableScriptSafety,omitempty"`
// Whether model responses stream as delta events.
EnableStreaming *bool `json:"enableStreaming,omitempty"`
// How MCP server environment values are interpreted.
EnvValueMode *SessionOpenOptionsEnvValueMode `json:"envValueMode,omitempty"`
// Override directory for session event logs.
EventsLogDirectory *string `json:"eventsLogDirectory,omitempty"`
// Denylist of tool names.
ExcludedTools []string `json:"excludedTools,omitzero"`
// Feature-flag values resolved by the host.
FeatureFlags map[string]bool `json:"featureFlags,omitzero"`
// Installed plugins visible to the session.
InstalledPlugins []InstalledPlugin `json:"installedPlugins,omitzero"`
// Stable integration identifier for analytics.
IntegrationID *string `json:"integrationId,omitempty"`
// Whether experimental behavior is enabled.
IsExperimentalMode *bool `json:"isExperimentalMode,omitempty"`
// Whether interactive shell sessions are logged.
LogInteractiveShells *bool `json:"logInteractiveShells,omitempty"`
// Identifier sent to LSP-style integrations.
LspClientName *string `json:"lspClientName,omitempty"`
// Initial model identifier.
Model *string `json:"model,omitempty"`
// Initial model capability overrides.
ModelCapabilitiesOverrides *ModelCapabilitiesOverride `json:"modelCapabilitiesOverrides,omitempty"`
// Optional human-friendly session name.
Name *string `json:"name,omitempty"`
// Custom model-provider configuration (BYOK).
Provider *ProviderConfig `json:"provider,omitempty"`
// Initial reasoning effort level.
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
// Initial reasoning summary mode for supported model clients.
ReasoningSummary *SessionOpenOptionsReasoningSummary `json:"reasoningSummary,omitempty"`
// Telemetry-only remote-defaulted flag.
RemoteDefaultedOn *bool `json:"remoteDefaultedOn,omitempty"`
// Telemetry-only remote exporting flag.
RemoteExporting *bool `json:"remoteExporting,omitempty"`
// Whether this session supports remote steering.
RemoteSteerable *bool `json:"remoteSteerable,omitempty"`
// Whether the host is an interactive UI.
RunningInInteractiveMode *bool `json:"runningInInteractiveMode,omitempty"`
// Resolved sandbox configuration.
SandboxConfig *SandboxConfig `json:"sandboxConfig,omitempty"`
// Capabilities enabled for this session.
SessionCapabilities []SessionCapability `json:"sessionCapabilities,omitzero"`
// Optional stable session identifier to use for a new session.
SessionID *string `json:"sessionId,omitempty"`
// Shell init profile.
ShellInitProfile *string `json:"shellInitProfile,omitempty"`
// Per-shell process flags.
ShellProcessFlags []string `json:"shellProcessFlags,omitzero"`
// Additional directories to search for skills.
SkillDirectories []string `json:"skillDirectories,omitzero"`
// Whether to skip custom instruction sources.
SkipCustomInstructions *bool `json:"skipCustomInstructions,omitempty"`
// Optional trajectory output file path.
TrajectoryFile *string `json:"trajectoryFile,omitempty"`
// Working directory to anchor the session.
WorkingDirectory *string `json:"workingDirectory,omitempty"`
// Pre-resolved working-directory context for session startup.
WorkingDirectoryContext *SessionContext `json:"workingDirectoryContext,omitempty"`
}
Session construction options. Experimental: SessionOpenOptions is part of an experimental API and may change or be removed.
func (*SessionOpenOptions) UnmarshalJSON ¶ added in v1.0.1
func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error
type SessionOpenOptionsAdditionalContentExclusionPolicy ¶ added in v1.0.1
type SessionOpenOptionsAdditionalContentExclusionPolicy struct {
LastUpdatedAt any `json:"last_updated_at"`
Rules []SessionOpenOptionsAdditionalContentExclusionPolicyRule `json:"rules"`
// Allowed values for the `SessionOpenOptionsAdditionalContentExclusionPolicyScope`
// enumeration.
Scope SessionOpenOptionsAdditionalContentExclusionPolicyScope `json:"scope"`
}
Schema for the `SessionOpenOptionsAdditionalContentExclusionPolicy` type. Experimental: SessionOpenOptionsAdditionalContentExclusionPolicy is part of an experimental API and may change or be removed.
type SessionOpenOptionsAdditionalContentExclusionPolicyRule ¶ added in v1.0.1
type SessionOpenOptionsAdditionalContentExclusionPolicyRule struct {
IfAnyMatch []string `json:"ifAnyMatch,omitzero"`
IfNoneMatch []string `json:"ifNoneMatch,omitzero"`
Paths []string `json:"paths"`
// Schema for the `SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource` type.
Source SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource `json:"source"`
}
Schema for the `SessionOpenOptionsAdditionalContentExclusionPolicyRule` type. Experimental: SessionOpenOptionsAdditionalContentExclusionPolicyRule is part of an experimental API and may change or be removed.
type SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource ¶ added in v1.0.1
type SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource struct {
Name string `json:"name"`
Type string `json:"type"`
}
Schema for the `SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource` type. Experimental: SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource is part of an experimental API and may change or be removed.
type SessionOpenOptionsAdditionalContentExclusionPolicyScope ¶ added in v1.0.1
type SessionOpenOptionsAdditionalContentExclusionPolicyScope string
Allowed values for the `SessionOpenOptionsAdditionalContentExclusionPolicyScope` enumeration. Experimental: SessionOpenOptionsAdditionalContentExclusionPolicyScope is part of an experimental API and may change or be removed.
const ( // The content exclusion policy applies across all repositories. SessionOpenOptionsAdditionalContentExclusionPolicyScopeAll SessionOpenOptionsAdditionalContentExclusionPolicyScope = "all" // The content exclusion policy applies to the current repository. SessionOpenOptionsAdditionalContentExclusionPolicyScopeRepo SessionOpenOptionsAdditionalContentExclusionPolicyScope = "repo" )
type SessionOpenOptionsEnvValueMode ¶ added in v1.0.1
type SessionOpenOptionsEnvValueMode string
How MCP server environment values are interpreted. Experimental: SessionOpenOptionsEnvValueMode is part of an experimental API and may change or be removed.
const ( // Pass MCP server environment values as literal strings. SessionOpenOptionsEnvValueModeDirect SessionOpenOptionsEnvValueMode = "direct" // Resolve MCP server environment values from host-side references. SessionOpenOptionsEnvValueModeIndirect SessionOpenOptionsEnvValueMode = "indirect" )
type SessionOpenOptionsReasoningSummary ¶ added in v1.0.1
type SessionOpenOptionsReasoningSummary string
Initial reasoning summary mode for supported model clients. Experimental: SessionOpenOptionsReasoningSummary is part of an experimental API and may change or be removed.
const ( // Request a concise summary of model reasoning. SessionOpenOptionsReasoningSummaryConcise SessionOpenOptionsReasoningSummary = "concise" // Request a detailed summary of model reasoning. SessionOpenOptionsReasoningSummaryDetailed SessionOpenOptionsReasoningSummary = "detailed" // Do not request reasoning summaries from the model. SessionOpenOptionsReasoningSummaryNone SessionOpenOptionsReasoningSummary = "none" )
type SessionOpenParams ¶ added in v1.0.1
type SessionOpenParams interface {
Kind() SessionOpenParamsKind
// contains filtered or unexported methods
}
Open a session by creating, resuming, attaching, connecting to a remote, or handing off. Experimental: SessionOpenParams is part of an experimental API and may change or be removed.
type SessionOpenParamsKind ¶ added in v1.0.1
type SessionOpenParamsKind string
Kind discriminator for SessionOpenParams.
const ( SessionOpenParamsKindAttach SessionOpenParamsKind = "attach" SessionOpenParamsKindCloud SessionOpenParamsKind = "cloud" SessionOpenParamsKindCreate SessionOpenParamsKind = "create" SessionOpenParamsKindHandoff SessionOpenParamsKind = "handoff" SessionOpenParamsKindRemote SessionOpenParamsKind = "remote" SessionOpenParamsKindResume SessionOpenParamsKind = "resume" SessionOpenParamsKindResumeLast SessionOpenParamsKind = "resumeLast" )
type SessionOpenResult ¶ added in v1.0.1
type SessionOpenResult struct {
// Remote session metadata, present when status is `connected`.
Metadata *RemoteSessionMetadataValue `json:"metadata,omitempty"`
// Handoff progress steps, present when status is `handed_off`.
Progress []SessionsOpenProgress `json:"progress,omitzero"`
// Remote session ID, present when status is `connected`.
RemoteSessionID *string `json:"remoteSessionId,omitempty"`
// In-process SessionClientApi handle for the opened session, returned to CLI callers as a
// transitional shortcut. Marked internal so the public SDK surface does not expose it; SDK
// consumers should construct per-session clients from `sessionId` instead.
// Internal: SessionAPI is part of the SDK's internal API surface and is not intended for
// external use.
SessionAPI any `json:"sessionApi,omitempty"`
// Opened session ID. Omitted when status is `not_found`.
SessionID *string `json:"sessionId,omitempty"`
// Startup prompts queued by user-level hook configs at session creation. Only populated
// when status is `created`; resumed sessions return an empty array.
StartupPrompts []string `json:"startupPrompts,omitzero"`
// Outcome of the open request.
Status SessionsOpenStatus `json:"status"`
}
Result of opening a session. Experimental: SessionOpenResult is part of an experimental API and may change or be removed.
type SessionPermissionsChangedData ¶ added in v1.0.0
type SessionPermissionsChangedData struct {
// Aggregate allow-all flag after the change
AllowAllPermissions bool `json:"allowAllPermissions"`
// Aggregate allow-all flag before the change
PreviousAllowAllPermissions bool `json:"previousAllowAllPermissions"`
}
Permissions change details carrying the aggregate allow-all boolean transition.
func (*SessionPermissionsChangedData) Type ¶ added in v1.0.0
func (*SessionPermissionsChangedData) Type() SessionEventType
type SessionPlanChangedData ¶ added in v1.0.0
type SessionPlanChangedData struct {
// The type of operation performed on the plan file
Operation PlanChangedOperation `json:"operation"`
}
Plan file operation details indicating what changed
func (*SessionPlanChangedData) Type ¶ added in v1.0.0
func (*SessionPlanChangedData) Type() SessionEventType
type SessionPlanDeleteResult ¶ added in v0.1.25
type SessionPlanDeleteResult struct {
}
Experimental: SessionPlanDeleteResult is part of an experimental API and may change or be removed.
type SessionPlanUpdateResult ¶ added in v0.1.25
type SessionPlanUpdateResult struct {
}
Experimental: SessionPlanUpdateResult is part of an experimental API and may change or be removed.
type SessionPluginsReloadResult ¶ added in v1.0.1
type SessionPluginsReloadResult struct {
}
Experimental: SessionPluginsReloadResult is part of an experimental API and may change or be removed.
type SessionPruneResult ¶ added in v1.0.0
type SessionPruneResult struct {
// Session IDs that would be deleted in dry-run mode (always empty otherwise)
Candidates []string `json:"candidates"`
// Session IDs that were deleted (always empty in dry-run mode)
Deleted []string `json:"deleted"`
// True when no deletions were actually performed
DryRun bool `json:"dryRun"`
// Total bytes freed (actual when not dry-run, projected when dry-run)
FreedBytes int64 `json:"freedBytes"`
// Session IDs that were skipped (e.g., named sessions)
Skipped []string `json:"skipped"`
}
Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag. Experimental: SessionPruneResult is part of an experimental API and may change or be removed.
type SessionQueueClearResult ¶ added in v1.0.0
type SessionQueueClearResult struct {
}
Experimental: SessionQueueClearResult is part of an experimental API and may change or be removed.
type SessionRPC ¶ added in v1.0.0
type SessionRPC struct {
Agent *AgentAPI
Auth *AuthAPI
Canvas *CanvasAPI
Commands *CommandsAPI
EventLog *EventLogAPI
Extensions *ExtensionsAPI
Fleet *FleetAPI
History *HistoryAPI
Instructions *InstructionsAPI
Lsp *LspAPI
MCP *MCPAPI
Metadata *MetadataAPI
Mode *ModeAPI
Model *ModelAPI
Name *NameAPI
Options *OptionsAPI
Permissions *PermissionsAPI
Plan *PlanAPI
Plugins *PluginsAPI
Queue *QueueAPI
Remote *RemoteAPI
Schedule *ScheduleAPI
Shell *ShellAPI
Skills *SkillsAPI
Tasks *TasksAPI
Telemetry *TelemetryAPI
Tools *ToolsAPI
UI *UIAPI
Usage *UsageAPI
Workspaces *WorkspacesAPI
// contains filtered or unexported fields
}
SessionRPC provides typed session-scoped RPC methods.
func NewSessionRPC ¶ added in v1.0.0
func NewSessionRPC(client *jsonrpc2.Client, sessionID string) *SessionRPC
func (*SessionRPC) Abort ¶ added in v1.0.0
func (a *SessionRPC) Abort(ctx context.Context, params *AbortRequest) (*AbortResult, error)
Aborts the current agent turn.
RPC method: session.abort.
Parameters: Parameters for aborting the current turn
Returns: Result of aborting the current turn Experimental: Abort is an experimental API and may change or be removed in future versions.
func (*SessionRPC) Log ¶ added in v1.0.0
func (a *SessionRPC) Log(ctx context.Context, params *LogRequest) (*LogResult, error)
Log emits a user-visible session log event.
RPC method: session.log.
Parameters: Message text, optional severity level, persistence flag, optional follow-up URL, and optional tip.
Returns: Identifier of the session event that was emitted for the log message. Experimental: Log is an experimental API and may change or be removed in future versions.
func (*SessionRPC) Send ¶ added in v1.0.0
func (a *SessionRPC) Send(ctx context.Context, params *SendRequest) (*SendResult, error)
Sends a user message to the session and returns its message ID.
RPC method: session.send.
Parameters: Parameters for sending a user message to the session
Returns: Result of sending a user message Experimental: Send is an experimental API and may change or be removed in future versions.
func (*SessionRPC) Shutdown ¶ added in v1.0.0
func (a *SessionRPC) Shutdown(ctx context.Context, params *ShutdownRequest) (*SessionShutdownResult, error)
Shutdown shuts down the session and persists its final state. Awaits any deferred sessionEnd hooks before resolving so user-supplied hook scripts complete before the runtime tears down.
RPC method: session.shutdown.
Parameters: Parameters for shutting down the session Experimental: Shutdown is an experimental API and may change or be removed in future versions.
func (*SessionRPC) Suspend ¶ added in v1.0.0
func (a *SessionRPC) Suspend(ctx context.Context) (*SessionSuspendResult, error)
Suspends the session while preserving persisted state for later resume.
RPC method: session.suspend. Experimental: Suspend is an experimental API and may change or be removed in future versions.
type SessionRemoteDisableResult ¶ added in v1.0.0
type SessionRemoteDisableResult struct {
}
Experimental: SessionRemoteDisableResult is part of an experimental API and may change or be removed.
type SessionRemoteSteerableChangedData ¶ added in v1.0.0
type SessionRemoteSteerableChangedData struct {
// Whether this session now supports remote steering via GitHub
RemoteSteerable bool `json:"remoteSteerable"`
}
Notifies that the session's remote steering capability has changed
func (*SessionRemoteSteerableChangedData) Type ¶ added in v1.0.0
func (*SessionRemoteSteerableChangedData) Type() SessionEventType
type SessionResumeData ¶ added in v1.0.0
type SessionResumeData struct {
// Whether the session was already in use by another client at resume time
AlreadyInUse *bool `json:"alreadyInUse,omitempty"`
// Updated working directory and git context at resume time
Context *WorkingDirectoryContext `json:"context,omitempty"`
// Context tier currently selected at resume time; null when no tier is active
ContextTier *ContextTier `json:"contextTier,omitempty"`
// When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume.
ContinuePendingWork *bool `json:"continuePendingWork,omitempty"`
// Total number of persisted events in the session at the time of resume
EventCount int64 `json:"eventCount"`
// On-disk byte size of the session's persisted events.jsonl file at resume time; omitted when the file does not exist or cannot be stat'd
EventsFileSizeBytes *int64 `json:"eventsFileSizeBytes,omitempty"`
// Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
// Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed")
ReasoningSummary *ReasoningSummary `json:"reasoningSummary,omitempty"`
// Whether this session supports remote steering via GitHub
RemoteSteerable *bool `json:"remoteSteerable,omitempty"`
// ISO 8601 timestamp when the session was resumed
ResumeTime time.Time `json:"resumeTime"`
// Model currently selected at resume time
SelectedModel *string `json:"selectedModel,omitempty"`
// True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log.
SessionWasActive *bool `json:"sessionWasActive,omitempty"`
}
Session resume metadata including current context and event count
func (*SessionResumeData) Type ¶ added in v1.0.0
func (*SessionResumeData) Type() SessionEventType
type SessionScheduleCancelledData ¶ added in v1.0.0
type SessionScheduleCancelledData struct {
// Id of the scheduled prompt that was cancelled
ID int64 `json:"id"`
}
Scheduled prompt cancelled from the schedule manager dialog
func (*SessionScheduleCancelledData) Type ¶ added in v1.0.0
func (*SessionScheduleCancelledData) Type() SessionEventType
type SessionScheduleCreatedData ¶ added in v1.0.0
type SessionScheduleCreatedData struct {
// Absolute fire time (epoch milliseconds) for a one-shot calendar schedule
At *int64 `json:"at,omitempty"`
// 5-field cron expression for a recurring calendar schedule, evaluated in `tz`
Cron *string `json:"cron,omitempty"`
// Optional user-facing label shown in the timeline instead of the actual prompt (e.g. `/skill-name args` when the prompt is a skill invocation expansion)
DisplayPrompt *string `json:"displayPrompt,omitempty"`
// Sequential id assigned to the scheduled prompt within the session
ID int64 `json:"id"`
// Interval between ticks in milliseconds (relative-interval schedules)
IntervalMs *int64 `json:"intervalMs,omitempty"`
// Prompt text that gets enqueued on every tick
Prompt string `json:"prompt"`
// Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`)
Recurring *bool `json:"recurring,omitempty"`
// IANA timezone the `cron` expression is evaluated in
Tz *string `json:"tz,omitempty"`
}
Scheduled prompt registered via /every or /after
func (*SessionScheduleCreatedData) Type ¶ added in v1.0.0
func (*SessionScheduleCreatedData) Type() SessionEventType
type SessionSetCredentialsParams ¶ added in v1.0.0
type SessionSetCredentialsParams struct {
// The new auth credentials to install on the session. When omitted or `undefined`, the call
// is a no-op and the session's existing credentials are preserved. The runtime stores the
// value verbatim and uses it for outbound model/API requests; it does NOT re-validate or
// re-fetch the associated Copilot user response. Several variants carry secret material;
// treat this method's params as containing secrets at rest and in transit.
Credentials AuthInfo `json:"credentials,omitempty"`
}
New auth credentials to install on the session. Omit to leave credentials unchanged. Experimental: SessionSetCredentialsParams is part of an experimental API and may change or be removed.
func (*SessionSetCredentialsParams) UnmarshalJSON ¶ added in v1.0.0
func (r *SessionSetCredentialsParams) UnmarshalJSON(data []byte) error
type SessionSetCredentialsResult ¶ added in v1.0.0
type SessionSetCredentialsResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the credential update succeeded. Experimental: SessionSetCredentialsResult is part of an experimental API and may change or be removed.
type SessionShutdownData ¶ added in v1.0.0
type SessionShutdownData struct {
// Aggregate code change metrics for the session
CodeChanges ShutdownCodeChanges `json:"codeChanges"`
// Non-system message token count at shutdown
ConversationTokens *int64 `json:"conversationTokens,omitempty"`
// Model that was selected at the time of shutdown
CurrentModel *string `json:"currentModel,omitempty"`
// Total tokens in context window at shutdown
CurrentTokens *int64 `json:"currentTokens,omitempty"`
// Error description when shutdownType is "error"
ErrorReason *string `json:"errorReason,omitempty"`
// On-disk byte size of the session's persisted events.jsonl file at shutdown time; omitted when the file does not exist or cannot be stat'd
EventsFileSizeBytes *int64 `json:"eventsFileSizeBytes,omitempty"`
// Per-model usage breakdown, keyed by model identifier
ModelMetrics map[string]ShutdownModelMetric `json:"modelMetrics"`
// Unix timestamp (milliseconds) when the session started
SessionStartTime int64 `json:"sessionStartTime"`
// Whether the session ended normally ("routine") or due to a crash/fatal error ("error")
ShutdownType ShutdownType `json:"shutdownType"`
// System message token count at shutdown
SystemTokens *int64 `json:"systemTokens,omitempty"`
// Session-wide per-token-type accumulated token counts
TokenDetails map[string]ShutdownTokenDetail `json:"tokenDetails,omitzero"`
// Tool definitions token count at shutdown
ToolDefinitionsTokens *int64 `json:"toolDefinitionsTokens,omitempty"`
// Cumulative time spent in API calls during the session, in milliseconds
TotalAPIDurationMs int64 `json:"totalApiDurationMs"`
// Session-wide accumulated nano-AI units cost
// Experimental: TotalNanoAiu is part of an experimental API and may change or be removed.
TotalNanoAiu *float64 `json:"totalNanoAiu,omitempty"`
// Total number of premium API requests used during the session
// Internal: TotalPremiumRequests is part of the SDK's internal API surface and is not intended for external use.
TotalPremiumRequests *float64 `json:"totalPremiumRequests,omitempty"`
}
Session termination metrics including usage statistics, code changes, and shutdown reason
func (*SessionShutdownData) Type ¶ added in v1.0.0
func (*SessionShutdownData) Type() SessionEventType
type SessionShutdownResult ¶ added in v1.0.0
type SessionShutdownResult struct {
}
Experimental: SessionShutdownResult is part of an experimental API and may change or be removed.
type SessionSizes ¶ added in v1.0.0
type SessionSizes struct {
// Map of sessionId -> on-disk size in bytes for the session's workspace directory
Sizes map[string]int64 `json:"sizes"`
}
Map of sessionId -> on-disk size in bytes for each session's workspace directory. Experimental: SessionSizes is part of an experimental API and may change or be removed.
type SessionSkillsDisableResult ¶ added in v0.2.0
type SessionSkillsDisableResult struct {
}
Experimental: SessionSkillsDisableResult is part of an experimental API and may change or be removed.
type SessionSkillsEnableResult ¶ added in v0.2.0
type SessionSkillsEnableResult struct {
}
Experimental: SessionSkillsEnableResult is part of an experimental API and may change or be removed.
type SessionSkillsEnsureLoadedResult ¶ added in v1.0.0
type SessionSkillsEnsureLoadedResult struct {
}
Experimental: SessionSkillsEnsureLoadedResult is part of an experimental API and may change or be removed.
type SessionSkillsLoadedData ¶ added in v1.0.0
type SessionSkillsLoadedData struct {
// Array of resolved skill metadata
Skills []SkillsLoadedSkill `json:"skills"`
}
Schema for the `SkillsLoadedData` type.
func (*SessionSkillsLoadedData) Type ¶ added in v1.0.0
func (*SessionSkillsLoadedData) Type() SessionEventType
type SessionSnapshotRewindData ¶ added in v1.0.0
type SessionSnapshotRewindData struct {
// Number of events that were removed by the rewind
EventsRemoved int64 `json:"eventsRemoved"`
// Event ID that was rewound to; this event and all after it were removed
UpToEventID string `json:"upToEventId"`
}
Session rewind details including target event and count of removed events
func (*SessionSnapshotRewindData) Type ¶ added in v1.0.0
func (*SessionSnapshotRewindData) Type() SessionEventType
type SessionSource ¶ added in v1.0.1
type SessionSource string
Which session sources to include. Defaults to `local` for backward compatibility. Experimental: SessionSource is part of an experimental API and may change or be removed.
const ( // Return both local and remote sessions. SessionSourceAll SessionSource = "all" // Return only local sessions. SessionSourceLocal SessionSource = "local" // Return only remote sessions. SessionSourceRemote SessionSource = "remote" )
type SessionStartData ¶ added in v1.0.0
type SessionStartData struct {
// Whether the session was already in use by another client at start time
AlreadyInUse *bool `json:"alreadyInUse,omitempty"`
// Working directory and git context at session start
Context *WorkingDirectoryContext `json:"context,omitempty"`
// Context tier selected at session creation time for models with tiered context pricing; null when no tier is selected (e.g., non-tiered model)
ContextTier *ContextTier `json:"contextTier,omitempty"`
// Version string of the Copilot application
CopilotVersion string `json:"copilotVersion"`
// When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id.
DetachedFromSpawningParentSessionID *string `json:"detachedFromSpawningParentSessionId,omitempty"`
// Identifier of the software producing the events (e.g., "copilot-agent")
Producer string `json:"producer"`
// Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
// Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed")
ReasoningSummary *ReasoningSummary `json:"reasoningSummary,omitempty"`
// Whether this session supports remote steering via GitHub
RemoteSteerable *bool `json:"remoteSteerable,omitempty"`
// Model selected at session creation time, if any
SelectedModel *string `json:"selectedModel,omitempty"`
// Unique identifier for the session
SessionID string `json:"sessionId"`
// ISO 8601 timestamp when the session was created
StartTime time.Time `json:"startTime"`
// Schema version number for the session event format
Version int64 `json:"version"`
}
Session initialization metadata including context and configuration
func (*SessionStartData) Type ¶ added in v1.0.0
func (*SessionStartData) Type() SessionEventType
type SessionSuspendResult ¶ added in v1.0.0
type SessionSuspendResult struct {
}
Experimental: SessionSuspendResult is part of an experimental API and may change or be removed.
type SessionTaskCompleteData ¶ added in v1.0.0
type SessionTaskCompleteData struct {
// Whether the tool call succeeded. False when validation failed (e.g., invalid arguments)
Success *bool `json:"success,omitempty"`
// Summary of the completed task, provided by the agent
Summary *string `json:"summary,omitempty"`
}
Task completion notification with summary from the agent
func (*SessionTaskCompleteData) Type ¶ added in v1.0.0
func (*SessionTaskCompleteData) Type() SessionEventType
type SessionTelemetryEngagement ¶ added in v1.0.1
type SessionTelemetryEngagement struct {
// Current telemetry engagement ID, when available.
EngagementID *string `json:"engagementId,omitempty"`
}
Telemetry engagement ID for the session, when available. Experimental: SessionTelemetryEngagement is part of an experimental API and may change or be removed.
type SessionTelemetrySetFeatureOverridesResult ¶ added in v1.0.0
type SessionTelemetrySetFeatureOverridesResult struct {
}
Experimental: SessionTelemetrySetFeatureOverridesResult is part of an experimental API and may change or be removed.
type SessionTitleChangedData ¶ added in v1.0.0
type SessionTitleChangedData struct {
// The new display title for the session
Title string `json:"title"`
}
Session title change payload containing the new display title
func (*SessionTitleChangedData) Type ¶ added in v1.0.0
func (*SessionTitleChangedData) Type() SessionEventType
type SessionToolsUpdatedData ¶ added in v1.0.0
type SessionToolsUpdatedData struct {
// Identifier of the model the resolved tools apply to.
Model string `json:"model"`
}
Schema for the `ToolsUpdatedData` type.
func (*SessionToolsUpdatedData) Type ¶ added in v1.0.0
func (*SessionToolsUpdatedData) Type() SessionEventType
type SessionTruncationData ¶ added in v1.0.0
type SessionTruncationData struct {
// Number of messages removed by truncation
MessagesRemovedDuringTruncation int64 `json:"messagesRemovedDuringTruncation"`
// Identifier of the component that performed truncation (e.g., "BasicTruncator")
PerformedBy string `json:"performedBy"`
// Number of conversation messages after truncation
PostTruncationMessagesLength int64 `json:"postTruncationMessagesLength"`
// Total tokens in conversation messages after truncation
PostTruncationTokensInMessages int64 `json:"postTruncationTokensInMessages"`
// Number of conversation messages before truncation
PreTruncationMessagesLength int64 `json:"preTruncationMessagesLength"`
// Total tokens in conversation messages before truncation
PreTruncationTokensInMessages int64 `json:"preTruncationTokensInMessages"`
// Maximum token count for the model's context window
TokenLimit int64 `json:"tokenLimit"`
// Number of tokens removed by truncation
TokensRemovedDuringTruncation int64 `json:"tokensRemovedDuringTruncation"`
}
Conversation truncation statistics including token counts and removed content metrics
func (*SessionTruncationData) Type ¶ added in v1.0.0
func (*SessionTruncationData) Type() SessionEventType
type SessionUpdateOptionsParams ¶ added in v1.0.0
type SessionUpdateOptionsParams struct {
// Additional content-exclusion policies to merge into the session's policy set.
// Experimental: AdditionalContentExclusionPolicies is part of an experimental API and may
// change or be removed.
AdditionalContentExclusionPolicies []OptionsUpdateAdditionalContentExclusionPolicy `json:"additionalContentExclusionPolicies,omitzero"`
// Runtime context discriminator (e.g., `cli`, `actions`).
AgentContext *string `json:"agentContext,omitempty"`
// Whether to disable the `ask_user` tool (encourages autonomous behavior).
AskUserDisabled *bool `json:"askUserDisabled,omitempty"`
// Allowlist of tool names available to this session.
AvailableTools []string `json:"availableTools,omitzero"`
// Identifier of the client driving the session.
ClientName *string `json:"clientName,omitempty"`
CoauthorEnabled *bool `json:"coauthorEnabled,omitempty"`
// 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.
ContextTier *OptionsUpdateContextTier `json:"contextTier,omitempty"`
// Whether to allow auto-mode continuation across turns.
ContinueOnAutoMode *bool `json:"continueOnAutoMode,omitempty"`
// Override URL for the Copilot API endpoint.
CopilotURL *string `json:"copilotUrl,omitempty"`
// Whether to default custom agents to local-only execution.
CustomAgentsLocalOnly *bool `json:"customAgentsLocalOnly,omitempty"`
// Instruction source IDs to exclude from the system prompt.
DisabledInstructionSources []string `json:"disabledInstructionSources,omitzero"`
// Skill IDs that should be excluded from this session.
DisabledSkills []string `json:"disabledSkills,omitzero"`
// Whether to enable loading of `.github/hooks/` filesystem hooks. Separate from the SDK
// callback hook mechanism.
EnableFileHooks *bool `json:"enableFileHooks,omitempty"`
// Whether to enable host git operations (context resolution, child repo scanning, git info
// in system prompt).
EnableHostGitOperations *bool `json:"enableHostGitOperations,omitempty"`
// Whether to discover custom instructions on demand after successful file views (AGENTS.md
// / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with
// `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag.
EnableOnDemandInstructionDiscovery *bool `json:"enableOnDemandInstructionDiscovery,omitempty"`
// Whether to surface reasoning-summary events from the model.
EnableReasoningSummaries *bool `json:"enableReasoningSummaries,omitempty"`
// Whether shell-script safety heuristics are enabled.
EnableScriptSafety *bool `json:"enableScriptSafety,omitempty"`
// Whether to enable cross-session store writes and reads.
EnableSessionStore *bool `json:"enableSessionStore,omitempty"`
// Whether to enable skill directory scanning and loading. Falls back to
// enableConfigDiscovery when unset.
EnableSkills *bool `json:"enableSkills,omitempty"`
// Whether to stream model responses.
EnableStreaming *bool `json:"enableStreaming,omitempty"`
// How env values are passed to MCP servers (`direct` inlines literal values; `indirect`
// resolves at launch).
EnvValueMode *OptionsUpdateEnvValueMode `json:"envValueMode,omitempty"`
// Override directory for the session-events log. When unset, the runtime's default events
// log directory is used.
EventsLogDirectory *string `json:"eventsLogDirectory,omitempty"`
// Denylist of tool names for this session.
ExcludedTools []string `json:"excludedTools,omitzero"`
// Map of feature-flag IDs to their boolean enabled state.
FeatureFlags map[string]bool `json:"featureFlags,omitzero"`
// Full set of installed plugins for the session. Replaces the existing list; the runtime
// invalidates the skills cache only when the list materially changes.
InstalledPlugins []SessionInstalledPlugin `json:"installedPlugins,omitzero"`
// Stable integration identifier used for analytics and rate-limit attribution.
IntegrationID *string `json:"integrationId,omitempty"`
// Whether experimental capabilities are enabled.
IsExperimentalMode *bool `json:"isExperimentalMode,omitempty"`
// Whether interactive shell sessions are logged.
LogInteractiveShells *bool `json:"logInteractiveShells,omitempty"`
// Identifier sent to LSP-style integrations.
LspClientName *string `json:"lspClientName,omitempty"`
// 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).
ManageScheduleEnabled *bool `json:"manageScheduleEnabled,omitempty"`
// The model ID to use for assistant turns.
Model *string `json:"model,omitempty"`
// Per-property model capability overrides for the selected model.
ModelCapabilitiesOverrides *ModelCapabilitiesOverride `json:"modelCapabilitiesOverrides,omitempty"`
// Organization-level custom instructions to inject into the system prompt.
OrganizationCustomInstructions *string `json:"organizationCustomInstructions,omitempty"`
// Custom model-provider configuration (BYOK).
Provider *ProviderConfig `json:"provider,omitempty"`
// Reasoning effort for the selected model (model-defined enum).
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
// Reasoning summary mode for supported model clients.
ReasoningSummary *OptionsUpdateReasoningSummary `json:"reasoningSummary,omitempty"`
// Whether the session is running in an interactive UI.
RunningInInteractiveMode *bool `json:"runningInInteractiveMode,omitempty"`
// Resolved sandbox configuration.
SandboxConfig *SandboxConfig `json:"sandboxConfig,omitempty"`
// 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.
SessionCapabilities []SessionCapability `json:"sessionCapabilities,omitzero"`
// Shell init profile (`None` or `NonInteractive`).
ShellInitProfile *string `json:"shellInitProfile,omitempty"`
// Per-shell process flags (e.g., `pwsh` arguments).
ShellProcessFlags []string `json:"shellProcessFlags,omitzero"`
// Additional directories to search for skills.
SkillDirectories []string `json:"skillDirectories,omitzero"`
// Whether to skip loading custom instruction sources.
SkipCustomInstructions *bool `json:"skipCustomInstructions,omitempty"`
// Whether to skip embedding retrieval pipeline initialization and execution.
SkipEmbeddingRetrieval *bool `json:"skipEmbeddingRetrieval,omitempty"`
// 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.
SuppressCustomAgentPrompt *bool `json:"suppressCustomAgentPrompt,omitempty"`
// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both
// are set.
ToolFilterPrecedence *OptionsUpdateToolFilterPrecedence `json:"toolFilterPrecedence,omitempty"`
// Optional path for trajectory output.
TrajectoryFile *string `json:"trajectoryFile,omitempty"`
// Absolute working-directory path for shell tools.
WorkingDirectory *string `json:"workingDirectory,omitempty"`
}
Patch of mutable session options to apply to the running session. Experimental: SessionUpdateOptionsParams is part of an experimental API and may change or be removed.
type SessionUpdateOptionsResult ¶ added in v1.0.0
type SessionUpdateOptionsResult struct {
// Whether the operation succeeded
Success bool `json:"success"`
}
Indicates whether the session options patch was applied successfully. Experimental: SessionUpdateOptionsResult is part of an experimental API and may change or be removed.
type SessionUsageInfoData ¶ added in v1.0.0
type SessionUsageInfoData struct {
// Token count from non-system messages (user, assistant, tool)
ConversationTokens *int64 `json:"conversationTokens,omitempty"`
// Current number of tokens in the context window
CurrentTokens int64 `json:"currentTokens"`
// Whether this is the first usage_info event emitted in this session
IsInitial *bool `json:"isInitial,omitempty"`
// Current number of messages in the conversation
MessagesLength int64 `json:"messagesLength"`
// Token count from system message(s)
SystemTokens *int64 `json:"systemTokens,omitempty"`
// Maximum token count for the model's context window
TokenLimit int64 `json:"tokenLimit"`
// Token count from tool definitions
ToolDefinitionsTokens *int64 `json:"toolDefinitionsTokens,omitempty"`
}
Current context window usage statistics including token and message counts
func (*SessionUsageInfoData) Type ¶ added in v1.0.0
func (*SessionUsageInfoData) Type() SessionEventType
type SessionWarningData ¶ added in v1.0.0
type SessionWarningData struct {
// Human-readable warning message for display in the timeline
Message string `json:"message"`
// Optional URL associated with this warning that the user can open in a browser
URL *string `json:"url,omitempty"`
// Category of warning (e.g., "subscription", "policy", "mcp")
WarningType string `json:"warningType"`
}
Warning message for timeline display with categorization
func (*SessionWarningData) Type ¶ added in v1.0.0
func (*SessionWarningData) Type() SessionEventType
type SessionWorkingDirectoryContext ¶ added in v1.0.0
type SessionWorkingDirectoryContext struct {
// Merge-base commit SHA (fork point from the remote default branch)
BaseCommit *string `json:"baseCommit,omitempty"`
// Current git branch name
Branch *string `json:"branch,omitempty"`
// Current working directory path
Cwd string `json:"cwd"`
// Root directory of the git repository, resolved via git rev-parse
GitRoot *string `json:"gitRoot,omitempty"`
// Head commit of the current git branch
HeadCommit *string `json:"headCommit,omitempty"`
// Hosting platform type of the repository
HostType *SessionWorkingDirectoryContextHostType `json:"hostType,omitempty"`
// Repository identifier derived from the git remote URL ("owner/name" for GitHub,
// "org/project/repo" for Azure DevOps)
Repository *string `json:"repository,omitempty"`
// Raw host string from the git remote URL (e.g. "github.com", "dev.azure.com")
RepositoryHost *string `json:"repositoryHost,omitempty"`
}
Updated working directory and git context. Emitted as the new payload of `session.context_changed`. Experimental: SessionWorkingDirectoryContext is part of an experimental API and may change or be removed.
type SessionWorkingDirectoryContextHostType ¶ added in v1.0.0
type SessionWorkingDirectoryContextHostType string
Hosting platform type of the repository Experimental: SessionWorkingDirectoryContextHostType is part of an experimental API and may change or be removed.
const ( // The working directory repository is hosted on Azure DevOps. SessionWorkingDirectoryContextHostTypeADO SessionWorkingDirectoryContextHostType = "ado" // The working directory repository is hosted on GitHub. SessionWorkingDirectoryContextHostTypeGitHub SessionWorkingDirectoryContextHostType = "github" )
type SessionWorkspaceFileChangedData ¶ added in v1.0.0
type SessionWorkspaceFileChangedData struct {
// Whether the file was newly created or updated
Operation WorkspaceFileChangedOperation `json:"operation"`
// Relative path within the session workspace files directory
Path string `json:"path"`
}
Workspace file change details including path and operation type
func (*SessionWorkspaceFileChangedData) Type ¶ added in v1.0.0
func (*SessionWorkspaceFileChangedData) Type() SessionEventType
type SessionWorkspacesCreateFileResult ¶ added in v1.0.0
type SessionWorkspacesCreateFileResult struct {
}
Experimental: SessionWorkspacesCreateFileResult is part of an experimental API and may change or be removed.
type SessionsBulkDeleteRequest ¶ added in v1.0.0
type SessionsBulkDeleteRequest struct {
// Session IDs to close, deactivate, and delete from disk
SessionIDs []string `json:"sessionIds"`
}
Session IDs to close, deactivate, and delete from disk. Experimental: SessionsBulkDeleteRequest is part of an experimental API and may change or be removed.
type SessionsCheckInUseRequest ¶ added in v1.0.0
type SessionsCheckInUseRequest struct {
// Session IDs to test for live in-use locks
SessionIDs []string `json:"sessionIds"`
}
Session IDs to test for live in-use locks. Experimental: SessionsCheckInUseRequest is part of an experimental API and may change or be removed.
type SessionsCheckInUseResult ¶ added in v1.0.0
type SessionsCheckInUseResult struct {
// Session IDs from the input set that are currently held by another running process via an
// alive lock file
InUse []string `json:"inUse"`
}
Session IDs from the input set that are currently in use by another process. Experimental: SessionsCheckInUseResult is part of an experimental API and may change or be removed.
type SessionsCloseRequest ¶ added in v1.0.0
type SessionsCloseRequest struct {
// Session ID to close
SessionID string `json:"sessionId"`
}
Session ID to close. Experimental: SessionsCloseRequest is part of an experimental API and may change or be removed.
type SessionsCloseResult ¶ added in v1.0.0
type SessionsCloseResult struct {
}
Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active. Experimental: SessionsCloseResult is part of an experimental API and may change or be removed.
type SessionsConfigureSessionExtensionsResult ¶ added in v1.0.1
type SessionsConfigureSessionExtensionsResult struct {
}
Experimental: SessionsConfigureSessionExtensionsResult is part of an experimental API and may change or be removed.
type SessionsEnrichMetadataRequest ¶ added in v1.0.0
type SessionsEnrichMetadataRequest struct {
// Session metadata records to enrich. Records that already have summary and context are
// returned unchanged.
Sessions []LocalSessionMetadataValue `json:"sessions"`
}
Session metadata records to enrich with summary and context information. Experimental: SessionsEnrichMetadataRequest is part of an experimental API and may change or be removed.
type SessionsFindByPrefixRequest ¶ added in v1.0.0
type SessionsFindByPrefixRequest struct {
// UUID prefix (>=7 hex chars, <36 chars). Returns the unique session ID, or undefined when
// there is no match or the prefix matches multiple sessions.
Prefix string `json:"prefix"`
}
UUID prefix to resolve to a unique session ID. Experimental: SessionsFindByPrefixRequest is part of an experimental API and may change or be removed.
type SessionsFindByPrefixResult ¶ added in v1.0.0
type SessionsFindByPrefixResult struct {
// Omitted when no unique session matches the prefix (no match or ambiguous)
SessionID *string `json:"sessionId,omitempty"`
}
Session ID matching the prefix, omitted when no unique match exists. Experimental: SessionsFindByPrefixResult is part of an experimental API and may change or be removed.
type SessionsFindByTaskIDRequest ¶ added in v1.0.0
type SessionsFindByTaskIDRequest struct {
// GitHub task ID to look up
TaskID string `json:"taskId"`
}
GitHub task ID to look up. Experimental: SessionsFindByTaskIDRequest is part of an experimental API and may change or be removed.
type SessionsFindByTaskIDResult ¶ added in v1.0.0
type SessionsFindByTaskIDResult struct {
// Omitted when no local session is bound to that GitHub task
SessionID *string `json:"sessionId,omitempty"`
}
ID of the local session bound to the given GitHub task, or omitted when none. Experimental: SessionsFindByTaskIDResult is part of an experimental API and may change or be removed.
type SessionsForkRequest ¶ added in v0.3.0
type SessionsForkRequest struct {
// Optional friendly name to assign to the forked session.
Name *string `json:"name,omitempty"`
// Source session ID to fork from
SessionID string `json:"sessionId"`
// Optional event ID boundary. When provided, the fork includes only events before this ID
// (exclusive). When omitted, all events are included.
ToEventID *string `json:"toEventId,omitempty"`
}
Source session identifier to fork from, optional event-ID boundary, and optional friendly name for the new session. Experimental: SessionsForkRequest is part of an experimental API and may change or be removed.
type SessionsForkResult ¶ added in v0.2.2
type SessionsForkResult struct {
// Friendly name assigned to the forked session, if any.
Name *string `json:"name,omitempty"`
// The new forked session's ID
SessionID string `json:"sessionId"`
}
Identifier and optional friendly name assigned to the newly forked session. Experimental: SessionsForkResult is part of an experimental API and may change or be removed.
type SessionsGetBoardEntryCountRequest ¶ added in v1.0.1
type SessionsGetBoardEntryCountRequest struct {
// Session ID whose board entry count should be returned.
SessionID string `json:"sessionId"`
}
Session ID whose board entry count should be returned. Experimental: SessionsGetBoardEntryCountRequest is part of an experimental API and may change or be removed.
type SessionsGetBoardEntryCountResult ¶ added in v1.0.1
type SessionsGetBoardEntryCountResult struct {
// Board entry count, when available.
Count *int64 `json:"count,omitempty"`
}
Dynamic-context board entry count, when available. Experimental: SessionsGetBoardEntryCountResult is part of an experimental API and may change or be removed.
type SessionsGetEventFilePathRequest ¶ added in v1.0.0
type SessionsGetEventFilePathRequest struct {
// Session ID whose event-log file path to compute
SessionID string `json:"sessionId"`
}
Session ID whose event-log file path to compute. Experimental: SessionsGetEventFilePathRequest is part of an experimental API and may change or be removed.
type SessionsGetEventFilePathResult ¶ added in v1.0.0
type SessionsGetEventFilePathResult struct {
// Absolute path to the session's events.jsonl file
FilePath string `json:"filePath"`
}
Absolute path to the session's events.jsonl file on disk. Experimental: SessionsGetEventFilePathResult is part of an experimental API and may change or be removed.
type SessionsGetLastForContextRequest ¶ added in v1.0.0
type SessionsGetLastForContextRequest struct {
// Optional working-directory context used to score session relevance. When omitted the
// most-recently-modified session wins.
Context *SessionContext `json:"context,omitempty"`
}
Optional working-directory context used to score session relevance. Experimental: SessionsGetLastForContextRequest is part of an experimental API and may change or be removed.
type SessionsGetLastForContextResult ¶ added in v1.0.0
type SessionsGetLastForContextResult struct {
// Most-relevant session ID for the supplied context, or omitted when no sessions exist
SessionID *string `json:"sessionId,omitempty"`
}
Most-relevant session ID for the supplied context, or omitted when no sessions exist. Experimental: SessionsGetLastForContextResult is part of an experimental API and may change or be removed.
type SessionsGetPersistedRemoteSteerableRequest ¶ added in v1.0.0
type SessionsGetPersistedRemoteSteerableRequest struct {
// Session ID to look up the persisted remote-steerable flag for
SessionID string `json:"sessionId"`
}
Session ID to look up the persisted remote-steerable flag for. Experimental: SessionsGetPersistedRemoteSteerableRequest is part of an experimental API and may change or be removed.
type SessionsGetPersistedRemoteSteerableResult ¶ added in v1.0.0
type SessionsGetPersistedRemoteSteerableResult struct {
// The session's persisted remote-steerable flag if recorded; omitted when no value has been
// persisted
RemoteSteerable *bool `json:"remoteSteerable,omitempty"`
}
The session's persisted remote-steerable flag, or omitted when no value has been persisted. Experimental: SessionsGetPersistedRemoteSteerableResult is part of an experimental API and may change or be removed.
type SessionsListRequest ¶ added in v1.0.0
type SessionsListRequest struct {
// Optional filter applied to the returned sessions
Filter *SessionListFilter `json:"filter,omitempty"`
// When true, include detached maintenance sessions. Defaults to false for user-facing
// session lists.
IncludeDetached *bool `json:"includeDetached,omitempty"`
// When provided, only the first N local sessions (sorted by modification time, newest
// first) load full metadata; remaining sessions return basic info only. Use 0 to return
// only basic info for every local session. Has no effect on remote entries (which always
// carry their full shape).
MetadataLimit *int64 `json:"metadataLimit,omitempty"`
// Which session sources to include. Defaults to `local` for backward compatibility.
Source *SessionSource `json:"source,omitempty"`
// Only meaningful when `source` includes remote. When true, propagates errors from the
// remote service instead of silently returning an empty remote list. Defaults to false.
ThrowOnError *bool `json:"throwOnError,omitempty"`
}
Optional source filter, metadata-load limit, and context filter applied to the returned sessions. Experimental: SessionsListRequest is part of an experimental API and may change or be removed.
type SessionsLoadDeferredRepoHooksRequest ¶ added in v1.0.0
type SessionsLoadDeferredRepoHooksRequest struct {
// Active session ID whose deferred repo-level hooks should be loaded
SessionID string `json:"sessionId"`
}
Active session ID whose deferred repo-level hooks should be loaded. Experimental: SessionsLoadDeferredRepoHooksRequest is part of an experimental API and may change or be removed.
type SessionsOpenAttach ¶ added in v1.0.1
type SessionsOpenAttach struct {
// Session ID to attach to.
SessionID string `json:"sessionId"`
}
Parameters for attaching to an already-active session by ID. Experimental: SessionsOpenAttach is part of an experimental API and may change or be removed.
func (SessionsOpenAttach) Kind ¶ added in v1.0.1
func (SessionsOpenAttach) Kind() SessionOpenParamsKind
func (SessionsOpenAttach) MarshalJSON ¶ added in v1.0.1
func (r SessionsOpenAttach) MarshalJSON() ([]byte, error)
type SessionsOpenCloud ¶ added in v1.0.1
type SessionsOpenCloud struct {
// In-process callback invoked when the cloud task is created (before connection). Marked
// internal because a function reference cannot cross the JSON-RPC boundary. Disappears in
// the SDK migration: the field is purely cosmetic (it flips a single CLI phase label from
// 'creating' to 'connecting') and the wire-clean version just drops the intermediate phase.
// Internal: OnTaskCreated is part of the SDK's internal API surface and is not intended for
// external use.
OnTaskCreated any `json:"onTaskCreated,omitempty"`
// Session options for cloud session creation.
Options *SessionOpenOptions `json:"options,omitempty"`
// Optional owner (user or organization login) to associate with the cloud session when no
// repository is provided. Ignored when `repository` is set (the repo's owner takes
// precedence).
Owner *string `json:"owner,omitempty"`
// Repository for the cloud session.
Repository *RemoteSessionRepository `json:"repository,omitempty"`
}
Parameters for creating a new cloud session. Experimental: SessionsOpenCloud is part of an experimental API and may change or be removed.
func (SessionsOpenCloud) Kind ¶ added in v1.0.1
func (SessionsOpenCloud) Kind() SessionOpenParamsKind
func (SessionsOpenCloud) MarshalJSON ¶ added in v1.0.1
func (r SessionsOpenCloud) MarshalJSON() ([]byte, error)
type SessionsOpenCreate ¶ added in v1.0.1
type SessionsOpenCreate struct {
// Whether to emit session.start during creation. Defaults to true.
EmitStart *bool `json:"emitStart,omitempty"`
// Session construction options.
Options *SessionOpenOptions `json:"options,omitempty"`
}
Parameters for creating a new local session. Experimental: SessionsOpenCreate is part of an experimental API and may change or be removed.
func (SessionsOpenCreate) Kind ¶ added in v1.0.1
func (SessionsOpenCreate) Kind() SessionOpenParamsKind
func (SessionsOpenCreate) MarshalJSON ¶ added in v1.0.1
func (r SessionsOpenCreate) MarshalJSON() ([]byte, error)
type SessionsOpenHandoff ¶ added in v1.0.1
type SessionsOpenHandoff struct {
// Remote session metadata for the session to hand off (typically obtained from
// `sessions.list` with `source: "remote"`).
Metadata RemoteSessionMetadataValue `json:"metadata"`
// In-process progress callback `(update) => void` invoked for each handoff step. Marked
// internal because a function reference cannot cross the JSON-RPC boundary. The host-side
// `handoffSession` is already declared as `AsyncGenerator<HandoffProgress, HandoffResult>`;
// the schema layer flattens it because it does not yet support streaming methods. The
// wire-clean replacement is to expose the AsyncGenerator directly (or use vscode-jsonrpc
// `$/progress` notifications) once the schema/transport layer supports it.
// Internal: OnProgress is part of the SDK's internal API surface and is not intended for
// external use.
OnProgress any `json:"onProgress,omitempty"`
// Session construction options for the new local session.
Options *SessionOpenOptions `json:"options,omitempty"`
// Task type determines the handoff strategy (CCA fetches events; CLI prepares a transient
// session).
TaskType *SessionsOpenHandoffTaskType `json:"taskType,omitempty"`
}
Parameters for fetching a remote session and handing it off to a new local session. Experimental: SessionsOpenHandoff is part of an experimental API and may change or be removed.
func (SessionsOpenHandoff) Kind ¶ added in v1.0.1
func (SessionsOpenHandoff) Kind() SessionOpenParamsKind
func (SessionsOpenHandoff) MarshalJSON ¶ added in v1.0.1
func (r SessionsOpenHandoff) MarshalJSON() ([]byte, error)
type SessionsOpenHandoffTaskType ¶ added in v1.0.1
type SessionsOpenHandoffTaskType string
Task type determines the handoff strategy (CCA fetches events; CLI prepares a transient session). Experimental: SessionsOpenHandoffTaskType is part of an experimental API and may change or be removed.
const ( // GitHub Copilot coding agent task. SessionsOpenHandoffTaskTypeCca SessionsOpenHandoffTaskType = "cca" // CLI remote task. SessionsOpenHandoffTaskTypeCLI SessionsOpenHandoffTaskType = "cli" )
type SessionsOpenProgress ¶ added in v1.0.1
type SessionsOpenProgress struct {
// Optional step message.
Message *string `json:"message,omitempty"`
// Step status.
Status SessionsOpenProgressStatus `json:"status"`
// Handoff step.
Step SessionsOpenProgressStep `json:"step"`
}
Schema for the `SessionsOpenProgress` type. Experimental: SessionsOpenProgress is part of an experimental API and may change or be removed.
type SessionsOpenProgressStatus ¶ added in v1.0.1
type SessionsOpenProgressStatus string
Step status. Experimental: SessionsOpenProgressStatus is part of an experimental API and may change or be removed.
const ( // The step has completed successfully. SessionsOpenProgressStatusComplete SessionsOpenProgressStatus = "complete" // The step has started and has not yet finished. SessionsOpenProgressStatusInProgress SessionsOpenProgressStatus = "in-progress" )
type SessionsOpenProgressStep ¶ added in v1.0.1
type SessionsOpenProgressStep string
Handoff step. Experimental: SessionsOpenProgressStep is part of an experimental API and may change or be removed.
const ( // Checking the local working tree for uncommitted changes that would block the handoff. SessionsOpenProgressStepCheckChanges SessionsOpenProgressStep = "check-changes" // Checking out the branch associated with the remote session in the local working tree. SessionsOpenProgressStepCheckoutBranch SessionsOpenProgressStep = "checkout-branch" // Creating the new local session and seeding it with the source session's events. SessionsOpenProgressStepCreateSession SessionsOpenProgressStep = "create-session" // Loading the source session's events from the remote service. SessionsOpenProgressStepLoadSession SessionsOpenProgressStep = "load-session" // Persisting the newly-created local session to disk. SessionsOpenProgressStepSaveSession SessionsOpenProgressStep = "save-session" // Validating that the local repository matches the remote session's repository. SessionsOpenProgressStepValidateRepo SessionsOpenProgressStep = "validate-repo" )
type SessionsOpenRemote ¶ added in v1.0.1
type SessionsOpenRemote struct {
// Session options for the connection.
Options *SessionOpenOptions `json:"options,omitempty"`
// Remote session identifier to connect to.
RemoteSessionID string `json:"remoteSessionId"`
// Repository context for the remote session.
Repository *RemoteSessionRepository `json:"repository,omitempty"`
}
Parameters for connecting to a live remote session. Experimental: SessionsOpenRemote is part of an experimental API and may change or be removed.
func (SessionsOpenRemote) Kind ¶ added in v1.0.1
func (SessionsOpenRemote) Kind() SessionOpenParamsKind
func (SessionsOpenRemote) MarshalJSON ¶ added in v1.0.1
func (r SessionsOpenRemote) MarshalJSON() ([]byte, error)
type SessionsOpenResume ¶ added in v1.0.1
type SessionsOpenResume struct {
// Session resume options.
Options *SessionOpenOptions `json:"options,omitempty"`
// Whether to emit session.resume after loading. Defaults to true.
Resume *bool `json:"resume,omitempty"`
// Session ID or unique prefix to resume.
SessionID string `json:"sessionId"`
// Suppress workspace.yaml metadata writeback when resuming from an incidental cwd.
SuppressResumeWorkspaceMetadataWriteback *bool `json:"suppressResumeWorkspaceMetadataWriteback,omitempty"`
}
Parameters for resuming a specific local session. Experimental: SessionsOpenResume is part of an experimental API and may change or be removed.
func (SessionsOpenResume) Kind ¶ added in v1.0.1
func (SessionsOpenResume) Kind() SessionOpenParamsKind
func (SessionsOpenResume) MarshalJSON ¶ added in v1.0.1
func (r SessionsOpenResume) MarshalJSON() ([]byte, error)
type SessionsOpenResumeLast ¶ added in v1.0.1
type SessionsOpenResumeLast struct {
// Working-directory context used to choose the most relevant session.
Context *SessionContext `json:"context,omitempty"`
// Session resume options.
Options *SessionOpenOptions `json:"options,omitempty"`
// Suppress workspace.yaml metadata writeback when resuming from an incidental cwd.
SuppressResumeWorkspaceMetadataWriteback *bool `json:"suppressResumeWorkspaceMetadataWriteback,omitempty"`
}
Parameters for resuming the most relevant local session. Experimental: SessionsOpenResumeLast is part of an experimental API and may change or be removed.
func (SessionsOpenResumeLast) Kind ¶ added in v1.0.1
func (SessionsOpenResumeLast) Kind() SessionOpenParamsKind
func (SessionsOpenResumeLast) MarshalJSON ¶ added in v1.0.1
func (r SessionsOpenResumeLast) MarshalJSON() ([]byte, error)
type SessionsOpenStatus ¶ added in v1.0.1
type SessionsOpenStatus string
Outcome of the open request. Experimental: SessionsOpenStatus is part of an experimental API and may change or be removed.
const ( // Connected to an existing remote session. SessionsOpenStatusConnected SessionsOpenStatus = "connected" // A new session was created. SessionsOpenStatusCreated SessionsOpenStatus = "created" // Remote session was handed off to a new local session. SessionsOpenStatusHandedOff SessionsOpenStatus = "handed_off" // No matching persisted session was found. SessionsOpenStatusNotFound SessionsOpenStatus = "not_found" // An existing session was loaded or reattached. SessionsOpenStatusResumed SessionsOpenStatus = "resumed" )
type SessionsPollSpawnedSessionsEvent ¶ added in v1.0.1
type SessionsPollSpawnedSessionsEvent struct {
// Session id of the newly-spawned session.
SessionID string `json:"sessionId"`
}
Schema for the `SessionsPollSpawnedSessionsEvent` type. Experimental: SessionsPollSpawnedSessionsEvent is part of an experimental API and may change or be removed.
type SessionsPollSpawnedSessionsRequest ¶ added in v1.0.1
type SessionsPollSpawnedSessionsRequest struct {
// Opaque cursor returned by a previous poll. Omit on the first call to receive any spawn
// events buffered since the runtime started.
Cursor *string `json:"cursor,omitempty"`
// Milliseconds to wait for new spawn events when the cursor is at the tail. 0 (default)
// returns immediately even if no events are buffered. Capped at 60000ms.
WaitMs *int32 `json:"waitMs,omitempty"`
}
Experimental: SessionsPollSpawnedSessionsRequest is part of an experimental API and may change or be removed.
type SessionsPruneOldRequest ¶ added in v1.0.0
type SessionsPruneOldRequest struct {
// When true, only report what would be deleted without performing any deletion
DryRun *bool `json:"dryRun,omitempty"`
// Session IDs that should never be considered for pruning
ExcludeSessionIDs []string `json:"excludeSessionIds,omitzero"`
// When true, named sessions (set via /rename) are also eligible for pruning
IncludeNamed *bool `json:"includeNamed,omitempty"`
// Delete sessions whose modifiedTime is at least this many days old
OlderThanDays int64 `json:"olderThanDays"`
}
Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true). Experimental: SessionsPruneOldRequest is part of an experimental API and may change or be removed.
type SessionsRegisterExtensionToolsOnSessionOptions ¶ added in v1.0.1
type SessionsRegisterExtensionToolsOnSessionOptions struct {
// In-process `() => boolean` gating callback (CLI-only optimization). Marked internal:
// replaced by runtime-side enable/disable RPCs in the SDK migration.
// Internal: Enabled is part of the SDK's internal API surface and is not intended for
// external use.
Enabled any `json:"enabled,omitempty"`
}
Optional registration options. Experimental: SessionsRegisterExtensionToolsOnSessionOptions is part of an experimental API and may change or be removed.
type SessionsReleaseLockRequest ¶ added in v1.0.0
type SessionsReleaseLockRequest struct {
// Session ID whose in-use lock should be released
SessionID string `json:"sessionId"`
}
Session ID whose in-use lock should be released. Experimental: SessionsReleaseLockRequest is part of an experimental API and may change or be removed.
type SessionsReleaseLockResult ¶ added in v1.0.0
type SessionsReleaseLockResult struct {
}
Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session. Experimental: SessionsReleaseLockResult is part of an experimental API and may change or be removed.
type SessionsReloadPluginHooksRequest ¶ added in v1.0.0
type SessionsReloadPluginHooksRequest struct {
// When true, skip repo-level hooks. Use before folder trust is confirmed;
// loadDeferredRepoHooks loads them post-trust.
DeferRepoHooks *bool `json:"deferRepoHooks,omitempty"`
// Active session ID to reload hooks for
SessionID string `json:"sessionId"`
}
Active session ID and an optional flag for deferring repo-level hooks until folder trust. Experimental: SessionsReloadPluginHooksRequest is part of an experimental API and may change or be removed.
type SessionsReloadPluginHooksResult ¶ added in v1.0.0
type SessionsReloadPluginHooksResult struct {
}
Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId. Experimental: SessionsReloadPluginHooksResult is part of an experimental API and may change or be removed.
type SessionsSaveRequest ¶ added in v1.0.0
type SessionsSaveRequest struct {
// Session ID whose pending events should be flushed to disk
SessionID string `json:"sessionId"`
}
Session ID whose pending events should be flushed to disk. Experimental: SessionsSaveRequest is part of an experimental API and may change or be removed.
type SessionsSaveResult ¶ added in v1.0.0
type SessionsSaveResult struct {
}
Flush a session's pending events to disk. No-op when no writer exists for the session (e.g., already closed). Experimental: SessionsSaveResult is part of an experimental API and may change or be removed.
type SessionsSetAdditionalPluginsRequest ¶ added in v1.0.0
type SessionsSetAdditionalPluginsRequest struct {
// Manager-wide additional plugins to register. Replaces any previously-configured set. Pass
// an empty array to clear.
Plugins []InstalledPlugin `json:"plugins"`
}
Manager-wide additional plugins to register; replaces any previously-configured set. Experimental: SessionsSetAdditionalPluginsRequest is part of an experimental API and may change or be removed.
type SessionsSetAdditionalPluginsResult ¶ added in v1.0.0
type SessionsSetAdditionalPluginsResult struct {
}
Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload. Experimental: SessionsSetAdditionalPluginsResult is part of an experimental API and may change or be removed.
type SessionsSetRemoteControlSteeringRequest ¶ added in v1.0.1
type SessionsSetRemoteControlSteeringRequest struct {
// Target steering state. Today only `true` is actionable on the underlying exporter;
// `false` is reserved for future use.
Enabled bool `json:"enabled"`
}
Patch for the singleton's steering state. Experimental: SessionsSetRemoteControlSteeringRequest is part of an experimental API and may change or be removed.
type SessionsStartRemoteControlRequest ¶ added in v1.0.1
type SessionsStartRemoteControlRequest struct {
// Configuration for the runtime-managed remote-control singleton.
Config RemoteControlConfig `json:"config"`
// Local session id to attach remote control to.
SessionID string `json:"sessionId"`
}
Parameters for attaching the remote-control singleton to a session. Experimental: SessionsStartRemoteControlRequest is part of an experimental API and may change or be removed.
type SessionsStopRemoteControlRequest ¶ added in v1.0.1
type SessionsStopRemoteControlRequest struct {
// When provided, the stop is rejected unless the singleton currently points at this session
// id (compare-and-swap semantics).
ExpectedSessionID *string `json:"expectedSessionId,omitempty"`
// When true, the singleton is unconditionally torn down regardless of `expectedSessionId`.
// Use during shutdown or explicit `/remote off`.
Force *bool `json:"force,omitempty"`
}
Experimental: SessionsStopRemoteControlRequest is part of an experimental API and may change or be removed.
type SessionsTransferRemoteControlRequest ¶ added in v1.0.1
type SessionsTransferRemoteControlRequest struct {
// When provided, the transfer is rejected unless the singleton currently points at this
// session id (compare-and-swap semantics to avoid clobbering newer state).
ExpectedFromSessionID *string `json:"expectedFromSessionId,omitempty"`
// Local session id to point remote control at.
ToSessionID string `json:"toSessionId"`
}
Parameters for atomically rebinding the remote-control singleton. Experimental: SessionsTransferRemoteControlRequest is part of an experimental API and may change or be removed.
type ShellAPI ¶ added in v1.0.0
type ShellAPI sessionAPI
Experimental: ShellAPI contains experimental APIs that may change or be removed.
func (*ShellAPI) CancelUserRequested ¶ added in v1.0.1
func (a *ShellAPI) CancelUserRequested(ctx context.Context, params *ShellCancelUserRequestedRequest) (*CancelUserRequestedShellCommandResult, error)
CancelUserRequested cancels a user-requested shell command by request ID.
RPC method: session.shell.cancelUserRequested.
Parameters: User-requested shell execution cancellation handle.
Returns: Cancellation result for a user-requested shell command.
func (*ShellAPI) Exec ¶ added in v1.0.0
func (a *ShellAPI) Exec(ctx context.Context, params *ShellExecRequest) (*ShellExecResult, error)
Exec starts a shell command and streams output through session notifications.
RPC method: session.shell.exec.
Parameters: Shell command to run, with optional working directory and timeout in milliseconds.
Returns: Identifier of the spawned process, used to correlate streamed output and exit notifications.
func (*ShellAPI) ExecuteUserRequested ¶ added in v1.0.1
func (a *ShellAPI) ExecuteUserRequested(ctx context.Context, params *ShellExecuteUserRequestedRequest) (*UserRequestedShellCommandResult, error)
ExecuteUserRequested executes a user-requested shell command through the session runtime.
RPC method: session.shell.executeUserRequested.
Parameters: User-requested shell command and cancellation handle.
Returns: Result of a user-requested shell command.
func (*ShellAPI) Kill ¶ added in v1.0.0
func (a *ShellAPI) Kill(ctx context.Context, params *ShellKillRequest) (*ShellKillResult, error)
Kill sends a signal to a shell process previously started via "shell.exec".
RPC method: session.shell.kill.
Parameters: Identifier of a process previously returned by "shell.exec" and the signal to send.
Returns: Indicates whether the signal was delivered; false if the process was unknown or already exited.
type ShellCancelUserRequestedRequest ¶ added in v1.0.1
type ShellCancelUserRequestedRequest struct {
// Request ID previously passed to executeUserRequested
RequestID string `json:"requestId"`
}
User-requested shell execution cancellation handle. Experimental: ShellCancelUserRequestedRequest is part of an experimental API and may change or be removed.
type ShellExecRequest ¶ added in v0.3.0
type ShellExecRequest struct {
// Shell command to execute
Command string `json:"command"`
// Working directory (defaults to session working directory)
Cwd *string `json:"cwd,omitempty"`
// Timeout in milliseconds (default: 30000)
Timeout *int64 `json:"timeout,omitempty"`
}
Shell command to run, with optional working directory and timeout in milliseconds. Experimental: ShellExecRequest is part of an experimental API and may change or be removed.
type ShellExecResult ¶ added in v0.3.0
type ShellExecResult struct {
// Unique identifier for tracking streamed output
ProcessID string `json:"processId"`
}
Identifier of the spawned process, used to correlate streamed output and exit notifications. Experimental: ShellExecResult is part of an experimental API and may change or be removed.
type ShellExecuteUserRequestedRequest ¶ added in v1.0.1
type ShellExecuteUserRequestedRequest struct {
// Shell command to execute
Command string `json:"command"`
// Caller-provided cancellation handle for this execution
RequestID string `json:"requestId"`
}
User-requested shell command and cancellation handle. Experimental: ShellExecuteUserRequestedRequest is part of an experimental API and may change or be removed.
type ShellKillRequest ¶ added in v0.3.0
type ShellKillRequest struct {
// Process identifier returned by shell.exec
ProcessID string `json:"processId"`
// Signal to send (default: SIGTERM)
Signal *ShellKillSignal `json:"signal,omitempty"`
}
Identifier of a process previously returned by "shell.exec" and the signal to send. Experimental: ShellKillRequest is part of an experimental API and may change or be removed.
type ShellKillResult ¶ added in v0.3.0
type ShellKillResult struct {
// Whether the signal was sent successfully
Killed bool `json:"killed"`
}
Indicates whether the signal was delivered; false if the process was unknown or already exited. Experimental: ShellKillResult is part of an experimental API and may change or be removed.
type ShellKillSignal ¶ added in v0.3.0
type ShellKillSignal string
Signal to send (default: SIGTERM) Experimental: ShellKillSignal is part of an experimental API and may change or be removed.
const ( // Send an interrupt signal to the process. ShellKillSignalSIGINT ShellKillSignal = "SIGINT" // Forcefully terminate the process. ShellKillSignalSIGKILL ShellKillSignal = "SIGKILL" // Request graceful process termination. ShellKillSignalSIGTERM ShellKillSignal = "SIGTERM" )
type ShutdownCodeChanges ¶ added in v1.0.0
type ShutdownCodeChanges struct {
// List of file paths that were modified during the session
FilesModified []string `json:"filesModified"`
// Total number of lines added during the session
LinesAdded int64 `json:"linesAdded"`
// Total number of lines removed during the session
LinesRemoved int64 `json:"linesRemoved"`
}
Aggregate code change metrics for the session
type ShutdownModelMetric ¶ added in v1.0.0
type ShutdownModelMetric struct {
// Request count and cost metrics
Requests ShutdownModelMetricRequests `json:"requests"`
// Token count details per type
TokenDetails map[string]ShutdownModelMetricTokenDetail `json:"tokenDetails,omitzero"`
// Accumulated nano-AI units cost for this model
// Experimental: TotalNanoAiu is part of an experimental API and may change or be removed.
TotalNanoAiu *float64 `json:"totalNanoAiu,omitempty"`
// Token usage breakdown
Usage ShutdownModelMetricUsage `json:"usage"`
}
Schema for the `ShutdownModelMetric` type.
type ShutdownModelMetricRequests ¶ added in v1.0.0
type ShutdownModelMetricRequests struct {
// Cumulative cost multiplier for requests to this model
// Experimental: Cost is part of an experimental API and may change or be removed.
Cost *float64 `json:"cost,omitempty"`
// Total number of API requests made to this model
// Experimental: Count is part of an experimental API and may change or be removed.
Count *int64 `json:"count,omitempty"`
}
Request count and cost metrics
type ShutdownModelMetricTokenDetail ¶ added in v1.0.0
type ShutdownModelMetricTokenDetail struct {
// Accumulated token count for this token type
TokenCount int64 `json:"tokenCount"`
}
Schema for the `ShutdownModelMetricTokenDetail` type.
type ShutdownModelMetricUsage ¶ added in v1.0.0
type ShutdownModelMetricUsage struct {
// Total tokens read from prompt cache across all requests
CacheReadTokens int64 `json:"cacheReadTokens"`
// Total tokens written to prompt cache across all requests
CacheWriteTokens int64 `json:"cacheWriteTokens"`
// Total input tokens consumed across all requests to this model
InputTokens int64 `json:"inputTokens"`
// Total output tokens produced across all requests to this model
OutputTokens int64 `json:"outputTokens"`
// Total reasoning tokens produced across all requests to this model
ReasoningTokens *int64 `json:"reasoningTokens,omitempty"`
}
Token usage breakdown
type ShutdownRequest ¶ added in v1.0.0
type ShutdownRequest struct {
// Optional human-readable reason. Typically the message of the error that triggered
// shutdown when type is 'error'.
Reason *string `json:"reason,omitempty"`
// Why the session is being shut down. Defaults to "routine" when omitted.
Type *ShutdownType `json:"type,omitempty"`
}
Parameters for shutting down the session Experimental: ShutdownRequest is part of an experimental API and may change or be removed.
type ShutdownTokenDetail ¶ added in v1.0.0
type ShutdownTokenDetail struct {
// Accumulated token count for this token type
TokenCount int64 `json:"tokenCount"`
}
Schema for the `ShutdownTokenDetail` type.
type ShutdownType ¶ added in v1.0.0
type ShutdownType string
Why the session is being shut down. Defaults to "routine" when omitted. Experimental: ShutdownType is part of an experimental API and may change or be removed.
const ( // The session is shutting down because of an error. ShutdownTypeError ShutdownType = "error" // The session is shutting down normally. ShutdownTypeRoutine ShutdownType = "routine" )
type Skill ¶ added in v0.2.0
type Skill struct {
// Description of what the skill does
Description string `json:"description"`
// Whether the skill is currently enabled
Enabled bool `json:"enabled"`
// Unique identifier for the skill
Name string `json:"name"`
// Absolute path to the skill file
Path *string `json:"path,omitempty"`
// Name of the plugin that provides the skill, when source is 'plugin'
PluginName *string `json:"pluginName,omitempty"`
// Source location type (e.g., project, personal-copilot, plugin, builtin)
Source SkillSource `json:"source"`
// Whether the skill can be invoked by the user as a slash command
UserInvocable bool `json:"userInvocable"`
}
Schema for the `Skill` type. Experimental: Skill is part of an experimental API and may change or be removed.
type SkillInvokedData ¶ added in v1.0.0
type SkillInvokedData struct {
// Tool names that should be auto-approved when this skill is active
AllowedTools []string `json:"allowedTools,omitzero"`
// Full content of the skill file, injected into the conversation for the model
Content string `json:"content"`
// Description of the skill from its SKILL.md frontmatter
Description *string `json:"description,omitempty"`
// Name of the invoked skill
Name string `json:"name"`
// File path to the SKILL.md definition
Path string `json:"path"`
// Name of the plugin this skill originated from, when applicable
PluginName *string `json:"pluginName,omitempty"`
// Version of the plugin this skill originated from, when applicable
PluginVersion *string `json:"pluginVersion,omitempty"`
// Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), personal-claude (~/.claude/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), and remote (org/enterprise skill)
Source *string `json:"source,omitempty"`
// What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent)
Trigger *SkillInvokedTrigger `json:"trigger,omitempty"`
}
Skill invocation details including content, allowed tools, and plugin metadata
func (*SkillInvokedData) Type ¶ added in v1.0.0
func (*SkillInvokedData) Type() SessionEventType
type SkillInvokedTrigger ¶ added in v1.0.0
type SkillInvokedTrigger string
What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent)
const ( // Skill invocation requested by the agent. SkillInvokedTriggerAgentInvoked SkillInvokedTrigger = "agent-invoked" // Skill content loaded as part of another context, such as a configured custom agent or subagent. SkillInvokedTriggerContextLoad SkillInvokedTrigger = "context-load" // Skill invocation requested explicitly by the user, such as via a slash command or UI affordance. SkillInvokedTriggerUserInvoked SkillInvokedTrigger = "user-invoked" )
type SkillList ¶ added in v0.3.0
type SkillList struct {
// Available skills
Skills []Skill `json:"skills"`
}
Skills available to the session, with their enabled state. Experimental: SkillList is part of an experimental API and may change or be removed.
type SkillSource ¶ added in v1.0.0
type SkillSource string
Source location type (e.g., project, personal-copilot, plugin, builtin)
const ( // Skill bundled with the runtime. SkillSourceBuiltin SkillSource = "builtin" // Skill loaded from a configured custom skill directory. SkillSourceCustom SkillSource = "custom" // Skill discovered from a parent directory in the current workspace tree. SkillSourceInherited SkillSource = "inherited" // Skill defined in the user's personal agents skill directory. SkillSourcePersonalAgents SkillSource = "personal-agents" // Skill defined in the user's Copilot skill directory. SkillSourcePersonalCopilot SkillSource = "personal-copilot" // Skill provided by an installed plugin. SkillSourcePlugin SkillSource = "plugin" // Skill defined in the current project's skill directories. SkillSourceProject SkillSource = "project" )
type SkillsAPI ¶ added in v1.0.0
type SkillsAPI sessionAPI
Experimental: SkillsAPI contains experimental APIs that may change or be removed.
func (*SkillsAPI) Disable ¶ added in v1.0.0
func (a *SkillsAPI) Disable(ctx context.Context, params *SkillsDisableRequest) (*SessionSkillsDisableResult, error)
Disables a skill for the session.
RPC method: session.skills.disable.
Parameters: Name of the skill to disable for the session.
func (*SkillsAPI) Enable ¶ added in v1.0.0
func (a *SkillsAPI) Enable(ctx context.Context, params *SkillsEnableRequest) (*SessionSkillsEnableResult, error)
Enables a skill for the session.
RPC method: session.skills.enable.
Parameters: Name of the skill to enable for the session.
func (*SkillsAPI) EnsureLoaded ¶ added in v1.0.0
func (a *SkillsAPI) EnsureLoaded(ctx context.Context) (*SessionSkillsEnsureLoadedResult, error)
EnsureLoaded ensures the session's skill definitions have been loaded from disk.
RPC method: session.skills.ensureLoaded.
func (*SkillsAPI) GetInvoked ¶ added in v1.0.0
func (a *SkillsAPI) GetInvoked(ctx context.Context) (*SkillsGetInvokedResult, error)
GetInvoked returns the skills that have been invoked during this session.
RPC method: session.skills.getInvoked.
Returns: Skills invoked during this session, ordered by invocation time (most recent last).
type SkillsConfigSetDisabledSkillsRequest ¶ added in v0.3.0
type SkillsConfigSetDisabledSkillsRequest struct {
// List of skill names to disable
DisabledSkills []string `json:"disabledSkills"`
}
Skill names to mark as disabled in global configuration, replacing any previous list.
type SkillsConfigSetDisabledSkillsResult ¶ added in v0.3.0
type SkillsConfigSetDisabledSkillsResult struct {
}
type SkillsDisableRequest ¶ added in v0.3.0
type SkillsDisableRequest struct {
// Name of the skill to disable
Name string `json:"name"`
}
Name of the skill to disable for the session. Experimental: SkillsDisableRequest is part of an experimental API and may change or be removed.
type SkillsDiscoverRequest ¶ added in v0.3.0
type SkillsDiscoverRequest struct {
// Optional list of project directory paths to scan for project-scoped skills
ProjectPaths []string `json:"projectPaths,omitzero"`
// Optional list of additional skill directory paths to include
SkillDirectories []string `json:"skillDirectories,omitzero"`
}
Optional project paths and additional skill directories to include in discovery.
type SkillsEnableRequest ¶ added in v0.3.0
type SkillsEnableRequest struct {
// Name of the skill to enable
Name string `json:"name"`
}
Name of the skill to enable for the session. Experimental: SkillsEnableRequest is part of an experimental API and may change or be removed.
type SkillsGetInvokedResult ¶ added in v1.0.0
type SkillsGetInvokedResult struct {
// Skills invoked during this session, ordered by invocation time (most recent last)
Skills []SkillsInvokedSkill `json:"skills"`
}
Skills invoked during this session, ordered by invocation time (most recent last). Experimental: SkillsGetInvokedResult is part of an experimental API and may change or be removed.
type SkillsInvokedSkill ¶ added in v1.0.0
type SkillsInvokedSkill struct {
// Tools that should be auto-approved when this skill is active, captured at invocation time
AllowedTools []string `json:"allowedTools,omitzero"`
// Full content of the skill file
Content string `json:"content"`
// Turn number when the skill was invoked
InvokedAtTurn int64 `json:"invokedAtTurn"`
// Unique identifier for the skill
Name string `json:"name"`
// Path to the SKILL.md file
Path string `json:"path"`
}
Schema for the `SkillsInvokedSkill` type. Experimental: SkillsInvokedSkill is part of an experimental API and may change or be removed.
type SkillsLoadDiagnostics ¶ added in v1.0.0
type SkillsLoadDiagnostics struct {
// Errors emitted while loading skills (e.g. skills that failed to load entirely)
Errors []string `json:"errors"`
// Warnings emitted while loading skills (e.g. skills that loaded but had issues)
Warnings []string `json:"warnings"`
}
Diagnostics from reloading skill definitions, with warnings and errors as separate lists. Experimental: SkillsLoadDiagnostics is part of an experimental API and may change or be removed.
type SkillsLoadedSkill ¶ added in v1.0.0
type SkillsLoadedSkill struct {
// Description of what the skill does
Description string `json:"description"`
// Whether the skill is currently enabled
Enabled bool `json:"enabled"`
// Unique identifier for the skill
Name string `json:"name"`
// Absolute path to the skill file, if available
Path *string `json:"path,omitempty"`
// Source location type (e.g., project, personal-copilot, plugin, builtin)
Source SkillSource `json:"source"`
// Whether the skill can be invoked by the user as a slash command
UserInvocable bool `json:"userInvocable"`
}
Schema for the `SkillsLoadedSkill` type.
type SlashCommandAgentPromptResult ¶ added in v1.0.0
type SlashCommandAgentPromptResult struct {
// Prompt text to display to the user
DisplayPrompt string `json:"displayPrompt"`
// Optional target session mode for the agent prompt
Mode *SessionMode `json:"mode,omitempty"`
// Prompt to submit to the agent
Prompt string `json:"prompt"`
// True when the invocation mutated user runtime settings; consumers caching settings should
// refresh
RuntimeSettingsChanged *bool `json:"runtimeSettingsChanged,omitempty"`
}
Schema for the `SlashCommandAgentPromptResult` type. Experimental: SlashCommandAgentPromptResult is part of an experimental API and may change or be removed.
func (SlashCommandAgentPromptResult) MarshalJSON ¶ added in v1.0.0
func (r SlashCommandAgentPromptResult) MarshalJSON() ([]byte, error)
type SlashCommandCompletedResult ¶ added in v1.0.0
type SlashCommandCompletedResult struct {
// Optional user-facing message describing the completed command
Message *string `json:"message,omitempty"`
// True when the invocation mutated user runtime settings; consumers caching settings should
// refresh
RuntimeSettingsChanged *bool `json:"runtimeSettingsChanged,omitempty"`
}
Schema for the `SlashCommandCompletedResult` type. Experimental: SlashCommandCompletedResult is part of an experimental API and may change or be removed.
func (SlashCommandCompletedResult) Kind ¶ added in v1.0.0
func (SlashCommandCompletedResult) Kind() SlashCommandInvocationResultKind
func (SlashCommandCompletedResult) MarshalJSON ¶ added in v1.0.0
func (r SlashCommandCompletedResult) MarshalJSON() ([]byte, error)
type SlashCommandInfo ¶ added in v1.0.0
type SlashCommandInfo struct {
// Canonical aliases without leading slashes
Aliases []string `json:"aliases,omitzero"`
// Whether the command may run while an agent turn is active
AllowDuringAgentExecution bool `json:"allowDuringAgentExecution"`
// Human-readable command description
Description string `json:"description"`
// Whether the command is experimental
Experimental *bool `json:"experimental,omitempty"`
// Optional unstructured input hint
Input *SlashCommandInput `json:"input,omitempty"`
// Coarse command category for grouping and behavior: runtime built-in, skill-backed
// command, or SDK/client-owned command
Kind SlashCommandKind `json:"kind"`
// Canonical command name without a leading slash
Name string `json:"name"`
}
Schema for the `SlashCommandInfo` type. Experimental: SlashCommandInfo is part of an experimental API and may change or be removed.
type SlashCommandInput ¶ added in v1.0.0
type SlashCommandInput struct {
// Optional completion hint for the input (e.g. 'directory' for filesystem path completion)
Completion *SlashCommandInputCompletion `json:"completion,omitempty"`
// Hint to display when command input has not been provided
Hint string `json:"hint"`
// When true, clients should pass the full text after the command name as a single argument
// rather than splitting on whitespace
PreserveMultilineInput *bool `json:"preserveMultilineInput,omitempty"`
// When true, the command requires non-empty input; clients should render the input hint as
// required
Required *bool `json:"required,omitempty"`
}
Optional unstructured input hint Experimental: SlashCommandInput is part of an experimental API and may change or be removed.
type SlashCommandInputCompletion ¶ added in v1.0.0
type SlashCommandInputCompletion string
Optional completion hint for the input (e.g. 'directory' for filesystem path completion) Experimental: SlashCommandInputCompletion is part of an experimental API and may change or be removed.
const ( // Input should complete filesystem directories. SlashCommandInputCompletionDirectory SlashCommandInputCompletion = "directory" )
type SlashCommandInvocationResult ¶ added in v1.0.0
type SlashCommandInvocationResult interface {
Kind() SlashCommandInvocationResultKind
// contains filtered or unexported methods
}
Result of invoking the slash command (text output, prompt to send to the agent, or completion). Experimental: SlashCommandInvocationResult is part of an experimental API and may change or be removed.
type SlashCommandInvocationResultKind ¶ added in v1.0.0
type SlashCommandInvocationResultKind string
Kind discriminator for SlashCommandInvocationResult.
const ( SlashCommandInvocationResultKindAgentPrompt SlashCommandInvocationResultKind = "agent-prompt" SlashCommandInvocationResultKindCompleted SlashCommandInvocationResultKind = "completed" SlashCommandInvocationResultKindSelectSubcommand SlashCommandInvocationResultKind = "select-subcommand" SlashCommandInvocationResultKindText SlashCommandInvocationResultKind = "text" )
type SlashCommandKind ¶ added in v1.0.0
type SlashCommandKind string
Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command Experimental: SlashCommandKind is part of an experimental API and may change or be removed.
const ( // Command implemented by the runtime. SlashCommandKindBuiltin SlashCommandKind = "builtin" // Command registered by an SDK client or extension. SlashCommandKindClient SlashCommandKind = "client" // Command backed by a skill. SlashCommandKindSkill SlashCommandKind = "skill" )
type SlashCommandSelectSubcommandOption ¶ added in v1.0.0
type SlashCommandSelectSubcommandOption struct {
// Human-readable description of the subcommand
Description string `json:"description"`
// Optional group label for organizing options
Group *string `json:"group,omitempty"`
// Subcommand name to invoke
Name string `json:"name"`
}
Schema for the `SlashCommandSelectSubcommandOption` type. Experimental: SlashCommandSelectSubcommandOption is part of an experimental API and may change or be removed.
type SlashCommandSelectSubcommandResult ¶ added in v1.0.0
type SlashCommandSelectSubcommandResult struct {
// Parent command name that requires subcommand selection
Command string `json:"command"`
// Available subcommand options for the client to present
Options []SlashCommandSelectSubcommandOption `json:"options"`
// True when the invocation mutated user runtime settings; consumers caching settings should
// refresh
RuntimeSettingsChanged *bool `json:"runtimeSettingsChanged,omitempty"`
// Human-readable title for the selection UI
Title string `json:"title"`
}
Schema for the `SlashCommandSelectSubcommandResult` type. Experimental: SlashCommandSelectSubcommandResult is part of an experimental API and may change or be removed.
func (SlashCommandSelectSubcommandResult) MarshalJSON ¶ added in v1.0.0
func (r SlashCommandSelectSubcommandResult) MarshalJSON() ([]byte, error)
type SlashCommandTextResult ¶ added in v1.0.0
type SlashCommandTextResult struct {
// Whether text contains Markdown
Markdown *bool `json:"markdown,omitempty"`
// Whether ANSI sequences should be preserved
PreserveAnsi *bool `json:"preserveAnsi,omitempty"`
// True when the invocation mutated user runtime settings; consumers caching settings should
// refresh
RuntimeSettingsChanged *bool `json:"runtimeSettingsChanged,omitempty"`
// Text output for the client to render
Text string `json:"text"`
}
Schema for the `SlashCommandTextResult` type. Experimental: SlashCommandTextResult is part of an experimental API and may change or be removed.
func (SlashCommandTextResult) Kind ¶ added in v1.0.0
func (SlashCommandTextResult) Kind() SlashCommandInvocationResultKind
func (SlashCommandTextResult) MarshalJSON ¶ added in v1.0.0
func (r SlashCommandTextResult) MarshalJSON() ([]byte, error)
type SubagentCompletedData ¶ added in v1.0.0
type SubagentCompletedData struct {
// Human-readable display name of the sub-agent
AgentDisplayName string `json:"agentDisplayName"`
// Internal name of the sub-agent
AgentName string `json:"agentName"`
// Wall-clock duration of the sub-agent execution in milliseconds
DurationMs *int64 `json:"durationMs,omitempty"`
// Model used by the sub-agent
Model *string `json:"model,omitempty"`
// Tool call ID of the parent tool invocation that spawned this sub-agent
ToolCallID string `json:"toolCallId"`
// Total tokens (input + output) consumed by the sub-agent
TotalTokens *int64 `json:"totalTokens,omitempty"`
// Total number of tool calls made by the sub-agent
TotalToolCalls *int64 `json:"totalToolCalls,omitempty"`
}
Sub-agent completion details for successful execution
func (*SubagentCompletedData) Type ¶ added in v1.0.0
func (*SubagentCompletedData) Type() SessionEventType
type SubagentDeselectedData ¶ added in v1.0.0
type SubagentDeselectedData struct {
}
Empty payload; the event signals that the custom agent was deselected, returning to the default agent
func (*SubagentDeselectedData) Type ¶ added in v1.0.0
func (*SubagentDeselectedData) Type() SessionEventType
type SubagentFailedData ¶ added in v1.0.0
type SubagentFailedData struct {
// Human-readable display name of the sub-agent
AgentDisplayName string `json:"agentDisplayName"`
// Internal name of the sub-agent
AgentName string `json:"agentName"`
// Wall-clock duration of the sub-agent execution in milliseconds
DurationMs *int64 `json:"durationMs,omitempty"`
// Error message describing why the sub-agent failed
Error string `json:"error"`
// Model selected for the sub-agent, when known
Model *string `json:"model,omitempty"`
// Tool call ID of the parent tool invocation that spawned this sub-agent
ToolCallID string `json:"toolCallId"`
// Total tokens (input + output) consumed before the sub-agent failed
TotalTokens *int64 `json:"totalTokens,omitempty"`
// Total number of tool calls made before the sub-agent failed
TotalToolCalls *int64 `json:"totalToolCalls,omitempty"`
}
Sub-agent failure details including error message and agent information
func (*SubagentFailedData) Type ¶ added in v1.0.0
func (*SubagentFailedData) Type() SessionEventType
type SubagentSelectedData ¶ added in v1.0.0
type SubagentSelectedData struct {
// Human-readable display name of the selected custom agent
AgentDisplayName string `json:"agentDisplayName"`
// Internal name of the selected custom agent
AgentName string `json:"agentName"`
// List of tool names available to this agent, or null for all tools
Tools []string `json:"tools"`
}
Custom agent selection details including name and available tools
func (*SubagentSelectedData) Type ¶ added in v1.0.0
func (*SubagentSelectedData) Type() SessionEventType
type SubagentStartedData ¶ added in v1.0.0
type SubagentStartedData struct {
// Description of what the sub-agent does
AgentDescription string `json:"agentDescription"`
// Human-readable display name of the sub-agent
AgentDisplayName string `json:"agentDisplayName"`
// Internal name of the sub-agent
AgentName string `json:"agentName"`
// Model the sub-agent will run with, when known at start.
Model *string `json:"model,omitempty"`
// Tool call ID of the parent tool invocation that spawned this sub-agent
ToolCallID string `json:"toolCallId"`
}
Sub-agent startup details including parent tool call and agent information
func (*SubagentStartedData) Type ¶ added in v1.0.0
func (*SubagentStartedData) Type() SessionEventType
type SystemMessageData ¶ added in v1.0.0
type SystemMessageData struct {
// The system or developer prompt text sent as model input
Content string `json:"content"`
// Metadata about the prompt template and its construction
Metadata *SystemMessageMetadata `json:"metadata,omitempty"`
// Optional name identifier for the message source
Name *string `json:"name,omitempty"`
// Message role: "system" for system prompts, "developer" for developer-injected instructions
Role SystemMessageRole `json:"role"`
}
System/developer instruction content with role and optional template metadata
func (*SystemMessageData) Type ¶ added in v1.0.0
func (*SystemMessageData) Type() SessionEventType
type SystemMessageMetadata ¶ added in v1.0.0
type SystemMessageMetadata struct {
// Version identifier of the prompt template used
PromptVersion *string `json:"promptVersion,omitempty"`
// Template variables used when constructing the prompt
Variables map[string]any `json:"variables,omitzero"`
}
Metadata about the prompt template and its construction
type SystemMessageRole ¶ added in v1.0.0
type SystemMessageRole string
Message role: "system" for system prompts, "developer" for developer-injected instructions
const ( // Developer instruction message. SystemMessageRoleDeveloper SystemMessageRole = "developer" // System prompt message. SystemMessageRoleSystem SystemMessageRole = "system" )
type SystemNotification ¶ added in v1.0.0
type SystemNotification interface {
Type() SystemNotificationType
// contains filtered or unexported methods
}
Structured metadata identifying what triggered this notification
type SystemNotificationAgentCompleted ¶ added in v1.0.0
type SystemNotificationAgentCompleted struct {
// Unique identifier of the background agent
AgentID string `json:"agentId"`
// Type of the agent (e.g., explore, task, general-purpose)
AgentType string `json:"agentType"`
// Human-readable description of the agent task
Description *string `json:"description,omitempty"`
// The full prompt given to the background agent
Prompt *string `json:"prompt,omitempty"`
// Whether the agent completed successfully or failed
Status SystemNotificationAgentCompletedStatus `json:"status"`
}
Schema for the `SystemNotificationAgentCompleted` type.
func (SystemNotificationAgentCompleted) MarshalJSON ¶ added in v1.0.0
func (r SystemNotificationAgentCompleted) MarshalJSON() ([]byte, error)
func (SystemNotificationAgentCompleted) Type ¶ added in v1.0.0
func (SystemNotificationAgentCompleted) Type() SystemNotificationType
type SystemNotificationAgentCompletedStatus ¶ added in v1.0.0
type SystemNotificationAgentCompletedStatus string
Whether the agent completed successfully or failed
const ( // The agent completed successfully. SystemNotificationAgentCompletedStatusCompleted SystemNotificationAgentCompletedStatus = "completed" // The agent failed. SystemNotificationAgentCompletedStatusFailed SystemNotificationAgentCompletedStatus = "failed" )
type SystemNotificationAgentIdle ¶ added in v1.0.0
type SystemNotificationAgentIdle struct {
// Unique identifier of the background agent
AgentID string `json:"agentId"`
// Type of the agent (e.g., explore, task, general-purpose)
AgentType string `json:"agentType"`
// Human-readable description of the agent task
Description *string `json:"description,omitempty"`
}
Schema for the `SystemNotificationAgentIdle` type.
func (SystemNotificationAgentIdle) MarshalJSON ¶ added in v1.0.0
func (r SystemNotificationAgentIdle) MarshalJSON() ([]byte, error)
func (SystemNotificationAgentIdle) Type ¶ added in v1.0.0
func (SystemNotificationAgentIdle) Type() SystemNotificationType
type SystemNotificationData ¶ added in v1.0.0
type SystemNotificationData struct {
// The notification text, typically wrapped in <system_notification> XML tags
Content string `json:"content"`
// Structured metadata identifying what triggered this notification
Kind SystemNotification `json:"kind"`
}
System-generated notification for runtime events like background task completion
func (*SystemNotificationData) Type ¶ added in v1.0.0
func (*SystemNotificationData) Type() SessionEventType
func (*SystemNotificationData) UnmarshalJSON ¶ added in v1.0.0
func (r *SystemNotificationData) UnmarshalJSON(data []byte) error
type SystemNotificationInstructionDiscovered ¶ added in v1.0.0
type SystemNotificationInstructionDiscovered struct {
// Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/')
Description *string `json:"description,omitempty"`
// Relative path to the discovered instruction file
SourcePath string `json:"sourcePath"`
// Path of the file access that triggered discovery
TriggerFile string `json:"triggerFile"`
// Tool command that triggered discovery (currently always 'view')
TriggerTool string `json:"triggerTool"`
}
Schema for the `SystemNotificationInstructionDiscovered` type.
func (SystemNotificationInstructionDiscovered) MarshalJSON ¶ added in v1.0.0
func (r SystemNotificationInstructionDiscovered) MarshalJSON() ([]byte, error)
type SystemNotificationNewInboxMessage ¶ added in v1.0.0
type SystemNotificationNewInboxMessage struct {
// Unique identifier of the inbox entry
EntryID string `json:"entryId"`
// Human-readable name of the sender
SenderName string `json:"senderName"`
// Category of the sender (e.g., sidekick-agent, plugin, hook)
SenderType string `json:"senderType"`
// Short summary shown before the agent decides whether to read the inbox
Summary string `json:"summary"`
}
Schema for the `SystemNotificationNewInboxMessage` type.
func (SystemNotificationNewInboxMessage) MarshalJSON ¶ added in v1.0.0
func (r SystemNotificationNewInboxMessage) MarshalJSON() ([]byte, error)
func (SystemNotificationNewInboxMessage) Type ¶ added in v1.0.0
func (SystemNotificationNewInboxMessage) Type() SystemNotificationType
type SystemNotificationShellCompleted ¶ added in v1.0.0
type SystemNotificationShellCompleted struct {
// Human-readable description of the command
Description *string `json:"description,omitempty"`
// Exit code of the shell command, if available
ExitCode *int64 `json:"exitCode,omitempty"`
// Unique identifier of the shell session
ShellID string `json:"shellId"`
}
Schema for the `SystemNotificationShellCompleted` type.
func (SystemNotificationShellCompleted) MarshalJSON ¶ added in v1.0.0
func (r SystemNotificationShellCompleted) MarshalJSON() ([]byte, error)
func (SystemNotificationShellCompleted) Type ¶ added in v1.0.0
func (SystemNotificationShellCompleted) Type() SystemNotificationType
type SystemNotificationShellDetachedCompleted ¶ added in v1.0.0
type SystemNotificationShellDetachedCompleted struct {
// Human-readable description of the command
Description *string `json:"description,omitempty"`
// Unique identifier of the detached shell session
ShellID string `json:"shellId"`
}
Schema for the `SystemNotificationShellDetachedCompleted` type.
func (SystemNotificationShellDetachedCompleted) MarshalJSON ¶ added in v1.0.0
func (r SystemNotificationShellDetachedCompleted) MarshalJSON() ([]byte, error)
type SystemNotificationType ¶ added in v1.0.0
type SystemNotificationType string
Type discriminator for SystemNotification.
const ( SystemNotificationTypeAgentCompleted SystemNotificationType = "agent_completed" SystemNotificationTypeAgentIdle SystemNotificationType = "agent_idle" SystemNotificationTypeInstructionDiscovered SystemNotificationType = "instruction_discovered" SystemNotificationTypeNewInboxMessage SystemNotificationType = "new_inbox_message" SystemNotificationTypeShellCompleted SystemNotificationType = "shell_completed" SystemNotificationTypeShellDetachedCompleted SystemNotificationType = "shell_detached_completed" )
type TaskAgentInfo ¶ added in v1.0.0
type TaskAgentInfo struct {
// ISO 8601 timestamp when the current active period began
ActiveStartedAt *time.Time `json:"activeStartedAt,omitempty"`
// Accumulated active execution time in milliseconds
ActiveTimeMs *int64 `json:"activeTimeMs,omitempty"`
// Type of agent running this task
AgentType string `json:"agentType"`
// 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.
CanPromoteToBackground *bool `json:"canPromoteToBackground,omitempty"`
// ISO 8601 timestamp when the task finished
CompletedAt *time.Time `json:"completedAt,omitempty"`
// Short description of the task
Description string `json:"description"`
// Error message when the task failed
Error *string `json:"error,omitempty"`
// Whether task execution is synchronously awaited or managed in the background
ExecutionMode *TaskExecutionMode `json:"executionMode,omitempty"`
// Unique task identifier
ID string `json:"id"`
// ISO 8601 timestamp when the agent entered idle state
IdleSince *time.Time `json:"idleSince,omitempty"`
// Most recent response text from the agent
LatestResponse *string `json:"latestResponse,omitempty"`
// Requested model override for the task when specified
Model *string `json:"model,omitempty"`
// Most recent prompt delivered to the agent. Updated whenever the agent receives a
// follow-up message.
Prompt string `json:"prompt"`
// Runtime model resolved for the task when available
ResolvedModel *string `json:"resolvedModel,omitempty"`
// Result text from the task when available
Result *string `json:"result,omitempty"`
// ISO 8601 timestamp when the task was started
StartedAt time.Time `json:"startedAt"`
// Current lifecycle status of the task
Status TaskStatus `json:"status"`
// Tool call ID associated with this agent task
ToolCallID string `json:"toolCallId"`
}
Schema for the `TaskAgentInfo` type. Experimental: TaskAgentInfo is part of an experimental API and may change or be removed.
func (TaskAgentInfo) MarshalJSON ¶ added in v1.0.0
func (r TaskAgentInfo) MarshalJSON() ([]byte, error)
func (TaskAgentInfo) Type ¶ added in v1.0.0
func (TaskAgentInfo) Type() TaskInfoType
type TaskAgentProgress ¶ added in v1.0.0
type TaskAgentProgress struct {
// The most recent intent reported by the agent
LatestIntent *string `json:"latestIntent,omitempty"`
// Recent tool execution events converted to display lines
RecentActivity []TaskProgressLine `json:"recentActivity"`
}
Schema for the `TaskAgentProgress` type. Experimental: TaskAgentProgress is part of an experimental API and may change or be removed.
func (TaskAgentProgress) MarshalJSON ¶ added in v1.0.0
func (r TaskAgentProgress) MarshalJSON() ([]byte, error)
func (TaskAgentProgress) Type ¶ added in v1.0.0
func (TaskAgentProgress) Type() TaskProgressType
type TaskExecutionMode ¶ added in v1.0.0
type TaskExecutionMode string
Whether task execution is synchronously awaited or managed in the background Experimental: TaskExecutionMode is part of an experimental API and may change or be removed.
const ( // The task is managed in the background. TaskExecutionModeBackground TaskExecutionMode = "background" // The task was started with synchronous waiting. TaskExecutionModeSync TaskExecutionMode = "sync" )
type TaskInfo ¶ added in v1.0.0
type TaskInfo interface {
Type() TaskInfoType
// contains filtered or unexported methods
}
Schema for the `TaskInfo` type. Experimental: TaskInfo is part of an experimental API and may change or be removed.
type TaskInfoType ¶ added in v1.0.0
type TaskInfoType string
Type discriminator for TaskInfo.
const ( TaskInfoTypeAgent TaskInfoType = "agent" TaskInfoTypeShell TaskInfoType = "shell" )
type TaskList ¶ added in v1.0.0
type TaskList struct {
// Currently tracked tasks
Tasks []TaskInfo `json:"tasks"`
}
Background tasks currently tracked by the session. Experimental: TaskList is part of an experimental API and may change or be removed.
func (*TaskList) UnmarshalJSON ¶ added in v1.0.0
type TaskProgress ¶ added in v1.0.0
type TaskProgress interface {
Type() TaskProgressType
// contains filtered or unexported methods
}
Experimental: TaskProgress is part of an experimental API and may change or be removed.
type TaskProgressLine ¶ added in v1.0.0
type TaskProgressLine struct {
// Display message, e.g., "▸ bash", "✓ edit src/foo.ts"
Message string `json:"message"`
// ISO 8601 timestamp when this event occurred
Timestamp time.Time `json:"timestamp"`
}
Schema for the `TaskProgressLine` type. Experimental: TaskProgressLine is part of an experimental API and may change or be removed.
type TaskProgressType ¶ added in v1.0.0
type TaskProgressType string
Type discriminator for TaskProgress.
const ( TaskProgressTypeAgent TaskProgressType = "agent" TaskProgressTypeShell TaskProgressType = "shell" )
type TaskShellInfo ¶ added in v1.0.0
type TaskShellInfo struct {
// Whether the shell runs inside a managed PTY session or as an independent background
// process
AttachmentMode TaskShellInfoAttachmentMode `json:"attachmentMode"`
// Whether this shell task can be promoted to background mode
CanPromoteToBackground *bool `json:"canPromoteToBackground,omitempty"`
// Command being executed
Command string `json:"command"`
// ISO 8601 timestamp when the task finished
CompletedAt *time.Time `json:"completedAt,omitempty"`
// Short description of the task
Description string `json:"description"`
// Whether task execution is synchronously awaited or managed in the background
ExecutionMode *TaskExecutionMode `json:"executionMode,omitempty"`
// Unique task identifier
ID string `json:"id"`
// Path to the detached shell log, when available
LogPath *string `json:"logPath,omitempty"`
// Process ID when available
Pid *int64 `json:"pid,omitempty"`
// ISO 8601 timestamp when the task was started
StartedAt time.Time `json:"startedAt"`
// Current lifecycle status of the task
Status TaskStatus `json:"status"`
}
Schema for the `TaskShellInfo` type. Experimental: TaskShellInfo is part of an experimental API and may change or be removed.
func (TaskShellInfo) MarshalJSON ¶ added in v1.0.0
func (r TaskShellInfo) MarshalJSON() ([]byte, error)
func (TaskShellInfo) Type ¶ added in v1.0.0
func (TaskShellInfo) Type() TaskInfoType
type TaskShellInfoAttachmentMode ¶ added in v1.0.0
type TaskShellInfoAttachmentMode string
Whether the shell runs inside a managed PTY session or as an independent background process Experimental: TaskShellInfoAttachmentMode is part of an experimental API and may change or be removed.
const ( // The shell runs in a managed PTY session. TaskShellInfoAttachmentModeAttached TaskShellInfoAttachmentMode = "attached" // The shell runs as an independent background process. TaskShellInfoAttachmentModeDetached TaskShellInfoAttachmentMode = "detached" )
type TaskShellProgress ¶ added in v1.0.0
type TaskShellProgress struct {
// Process ID when available
Pid *int64 `json:"pid,omitempty"`
// Recent stdout/stderr lines from the running shell command
RecentOutput string `json:"recentOutput"`
}
Schema for the `TaskShellProgress` type. Experimental: TaskShellProgress is part of an experimental API and may change or be removed.
func (TaskShellProgress) MarshalJSON ¶ added in v1.0.0
func (r TaskShellProgress) MarshalJSON() ([]byte, error)
func (TaskShellProgress) Type ¶ added in v1.0.0
func (TaskShellProgress) Type() TaskProgressType
type TaskStatus ¶ added in v1.0.0
type TaskStatus string
Current lifecycle status of the task Experimental: TaskStatus is part of an experimental API and may change or be removed.
const ( // The task was cancelled before completion. TaskStatusCancelled TaskStatus = "cancelled" // The task finished successfully. TaskStatusCompleted TaskStatus = "completed" // The task finished with an error. TaskStatusFailed TaskStatus = "failed" // The task is waiting for additional input. TaskStatusIdle TaskStatus = "idle" // The task is actively executing. TaskStatusRunning TaskStatus = "running" )
type TasksAPI ¶ added in v1.0.0
type TasksAPI sessionAPI
Experimental: TasksAPI contains experimental APIs that may change or be removed.
func (*TasksAPI) Cancel ¶ added in v1.0.0
func (a *TasksAPI) Cancel(ctx context.Context, params *TasksCancelRequest) (*TasksCancelResult, error)
Cancels a background task.
RPC method: session.tasks.cancel.
Parameters: Identifier of the background task to cancel.
Returns: Indicates whether the background task was successfully cancelled.
func (*TasksAPI) GetCurrentPromotable ¶ added in v1.0.0
func (a *TasksAPI) GetCurrentPromotable(ctx context.Context) (*TasksGetCurrentPromotableResult, error)
GetCurrentPromotable returns the first sync-waiting task that can currently be promoted to background mode.
RPC method: session.tasks.getCurrentPromotable.
Returns: The first sync-waiting task that can currently be promoted to background mode.
func (*TasksAPI) GetProgress ¶ added in v1.0.0
func (a *TasksAPI) GetProgress(ctx context.Context, params *TasksGetProgressRequest) (*TasksGetProgressResult, error)
GetProgress returns progress information for a background task by ID.
RPC method: session.tasks.getProgress.
Parameters: Identifier of the background task to fetch progress for.
Returns: Progress information for the task, or null when no task with that ID is tracked.
func (*TasksAPI) List ¶ added in v1.0.0
Lists background tasks tracked by the session.
RPC method: session.tasks.list.
Returns: Background tasks currently tracked by the session.
func (*TasksAPI) PromoteCurrentToBackground ¶ added in v1.0.0
func (a *TasksAPI) PromoteCurrentToBackground(ctx context.Context) (*TasksPromoteCurrentToBackgroundResult, error)
PromoteCurrentToBackground atomically promotes the first promotable sync-waiting task to background mode and returns it.
RPC method: session.tasks.promoteCurrentToBackground.
Returns: The promoted task as it now exists in background mode, omitted if no promotable task was waiting.
func (*TasksAPI) PromoteToBackground ¶ added in v1.0.0
func (a *TasksAPI) PromoteToBackground(ctx context.Context, params *TasksPromoteToBackgroundRequest) (*TasksPromoteToBackgroundResult, error)
PromoteToBackground promotes an eligible synchronously-waited task so it continues running in the background.
RPC method: session.tasks.promoteToBackground.
Parameters: Identifier of the task to promote to background mode.
Returns: Indicates whether the task was successfully promoted to background mode.
func (*TasksAPI) Refresh ¶ added in v1.0.0
func (a *TasksAPI) Refresh(ctx context.Context) (*TasksRefreshResult, error)
Refreshes metadata for any detached background shells the runtime knows about.
RPC method: session.tasks.refresh.
Returns: 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.
func (*TasksAPI) Remove ¶ added in v1.0.0
func (a *TasksAPI) Remove(ctx context.Context, params *TasksRemoveRequest) (*TasksRemoveResult, error)
Removes a completed or cancelled background task from tracking.
RPC method: session.tasks.remove.
Parameters: Identifier of the completed or cancelled task to remove from tracking.
Returns: Indicates whether the task was removed. False when the task does not exist or is still running/idle.
func (*TasksAPI) SendMessage ¶ added in v1.0.0
func (a *TasksAPI) SendMessage(ctx context.Context, params *TasksSendMessageRequest) (*TasksSendMessageResult, error)
SendMessage sends a message to a background agent task.
RPC method: session.tasks.sendMessage.
Parameters: Identifier of the target agent task, message content, and optional sender agent ID.
Returns: Indicates whether the message was delivered, with an error message when delivery failed.
func (*TasksAPI) StartAgent ¶ added in v1.0.0
func (a *TasksAPI) StartAgent(ctx context.Context, params *TasksStartAgentRequest) (*TasksStartAgentResult, error)
StartAgent starts a background agent task in the session.
RPC method: session.tasks.startAgent.
Parameters: Agent type, prompt, name, and optional description and model override for the new task.
Returns: Identifier assigned to the newly started background agent task.
func (*TasksAPI) WaitForPending ¶ added in v1.0.0
func (a *TasksAPI) WaitForPending(ctx context.Context) (*TasksWaitForPendingResult, error)
WaitForPending waits for all in-flight background tasks and any follow-up turns to settle.
RPC method: session.tasks.waitForPending.
Returns: 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).
type TasksCancelRequest ¶ added in v1.0.0
type TasksCancelRequest struct {
// Task identifier
ID string `json:"id"`
}
Identifier of the background task to cancel. Experimental: TasksCancelRequest is part of an experimental API and may change or be removed.
type TasksCancelResult ¶ added in v1.0.0
type TasksCancelResult struct {
// Whether the task was successfully cancelled
Cancelled bool `json:"cancelled"`
}
Indicates whether the background task was successfully cancelled. Experimental: TasksCancelResult is part of an experimental API and may change or be removed.
type TasksGetCurrentPromotableResult ¶ added in v1.0.0
type TasksGetCurrentPromotableResult struct {
// 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.
Task TaskInfo `json:"task,omitempty"`
}
The first sync-waiting task that can currently be promoted to background mode. Experimental: TasksGetCurrentPromotableResult is part of an experimental API and may change or be removed.
func (*TasksGetCurrentPromotableResult) UnmarshalJSON ¶ added in v1.0.0
func (r *TasksGetCurrentPromotableResult) UnmarshalJSON(data []byte) error
type TasksGetProgressRequest ¶ added in v1.0.0
type TasksGetProgressRequest struct {
// Task identifier (agent ID or shell ID)
ID string `json:"id"`
}
Identifier of the background task to fetch progress for. Experimental: TasksGetProgressRequest is part of an experimental API and may change or be removed.
type TasksGetProgressResult ¶ added in v1.0.0
type TasksGetProgressResult struct {
// Progress information for the task, discriminated by type. Returns null when no task with
// this ID is currently tracked.
Progress TaskProgress `json:"progress,omitempty"`
}
Progress information for the task, or null when no task with that ID is tracked. Experimental: TasksGetProgressResult is part of an experimental API and may change or be removed.
func (*TasksGetProgressResult) UnmarshalJSON ¶ added in v1.0.0
func (r *TasksGetProgressResult) UnmarshalJSON(data []byte) error
type TasksPromoteCurrentToBackgroundResult ¶ added in v1.0.0
type TasksPromoteCurrentToBackgroundResult struct {
// 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.
Task TaskInfo `json:"task,omitempty"`
}
The promoted task as it now exists in background mode, omitted if no promotable task was waiting. Experimental: TasksPromoteCurrentToBackgroundResult is part of an experimental API and may change or be removed.
func (*TasksPromoteCurrentToBackgroundResult) UnmarshalJSON ¶ added in v1.0.0
func (r *TasksPromoteCurrentToBackgroundResult) UnmarshalJSON(data []byte) error
type TasksPromoteToBackgroundRequest ¶ added in v1.0.0
type TasksPromoteToBackgroundRequest struct {
// Task identifier
ID string `json:"id"`
}
Identifier of the task to promote to background mode. Experimental: TasksPromoteToBackgroundRequest is part of an experimental API and may change or be removed.
type TasksPromoteToBackgroundResult ¶ added in v1.0.0
type TasksPromoteToBackgroundResult struct {
// Whether the task was successfully promoted to background mode
Promoted bool `json:"promoted"`
}
Indicates whether the task was successfully promoted to background mode. Experimental: TasksPromoteToBackgroundResult is part of an experimental API and may change or be removed.
type TasksRefreshResult ¶ added in v1.0.0
type TasksRefreshResult struct {
}
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: TasksRefreshResult is part of an experimental API and may change or be removed.
type TasksRemoveRequest ¶ added in v1.0.0
type TasksRemoveRequest struct {
// Task identifier
ID string `json:"id"`
}
Identifier of the completed or cancelled task to remove from tracking. Experimental: TasksRemoveRequest is part of an experimental API and may change or be removed.
type TasksRemoveResult ¶ added in v1.0.0
type TasksRemoveResult struct {
// Whether the task was removed. Returns false if the task does not exist or is still
// running/idle (cancel it first).
Removed bool `json:"removed"`
}
Indicates whether the task was removed. False when the task does not exist or is still running/idle. Experimental: TasksRemoveResult is part of an experimental API and may change or be removed.
type TasksSendMessageRequest ¶ added in v1.0.0
type TasksSendMessageRequest struct {
// Agent ID of the sender, if sent on behalf of another agent
FromAgentID *string `json:"fromAgentId,omitempty"`
// Agent task identifier
ID string `json:"id"`
// Message content to send to the agent
Message string `json:"message"`
}
Identifier of the target agent task, message content, and optional sender agent ID. Experimental: TasksSendMessageRequest is part of an experimental API and may change or be removed.
type TasksSendMessageResult ¶ added in v1.0.0
type TasksSendMessageResult struct {
// Error message if delivery failed
Error *string `json:"error,omitempty"`
// Whether the message was successfully delivered or steered
Sent bool `json:"sent"`
}
Indicates whether the message was delivered, with an error message when delivery failed. Experimental: TasksSendMessageResult is part of an experimental API and may change or be removed.
type TasksStartAgentRequest ¶ added in v1.0.0
type TasksStartAgentRequest struct {
// Type of agent to start (e.g., 'explore', 'task', 'general-purpose')
AgentType string `json:"agentType"`
// Short description of the task
Description *string `json:"description,omitempty"`
// Optional model override
Model *string `json:"model,omitempty"`
// Short name for the agent, used to generate a human-readable ID
Name string `json:"name"`
// Task prompt for the agent
Prompt string `json:"prompt"`
}
Agent type, prompt, name, and optional description and model override for the new task. Experimental: TasksStartAgentRequest is part of an experimental API and may change or be removed.
type TasksStartAgentResult ¶ added in v1.0.0
type TasksStartAgentResult struct {
// Generated agent ID for the background task
AgentID string `json:"agentId"`
}
Identifier assigned to the newly started background agent task. Experimental: TasksStartAgentResult is part of an experimental API and may change or be removed.
type TasksWaitForPendingResult ¶ added in v1.0.0
type TasksWaitForPendingResult struct {
}
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: TasksWaitForPendingResult is part of an experimental API and may change or be removed.
type TelemetryAPI ¶ added in v1.0.0
type TelemetryAPI sessionAPI
Experimental: TelemetryAPI contains experimental APIs that may change or be removed.
func (*TelemetryAPI) GetEngagementId ¶ added in v1.0.1
func (a *TelemetryAPI) GetEngagementId(ctx context.Context) (*SessionTelemetryEngagement, error)
GetEngagementId gets the telemetry engagement ID currently associated with the session, when available.
RPC method: session.telemetry.getEngagementId.
Returns: Telemetry engagement ID for the session, when available.
func (*TelemetryAPI) SetFeatureOverrides ¶ added in v1.0.0
func (a *TelemetryAPI) SetFeatureOverrides(ctx context.Context, params *TelemetrySetFeatureOverridesRequest) (*SessionTelemetrySetFeatureOverridesResult, error)
SetFeatureOverrides sets feature override key/value pairs to attach to subsequent telemetry events for the session.
RPC method: session.telemetry.setFeatureOverrides.
Parameters: Feature override key/value pairs to attach to subsequent telemetry events from this session.
type TelemetrySetFeatureOverridesRequest ¶ added in v1.0.0
type TelemetrySetFeatureOverridesRequest struct {
// Override key/value pairs to attach to subsequent telemetry events from this session.
// Replaces any previously-set overrides.
Features map[string]string `json:"features"`
}
Feature override key/value pairs to attach to subsequent telemetry events from this session. Experimental: TelemetrySetFeatureOverridesRequest is part of an experimental API and may change or be removed.
type TokenAuthInfo ¶ added in v1.0.0
type TokenAuthInfo struct {
// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the
// GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this
// verbatim and does not re-fetch when set.
CopilotUser *CopilotUserResponse `json:"copilotUser,omitempty"`
// Authentication host.
Host string `json:"host"`
// The token value itself. Treat as a secret.
Token string `json:"token"`
}
Schema for the `TokenAuthInfo` type. Experimental: TokenAuthInfo is part of an experimental API and may change or be removed.
func (TokenAuthInfo) MarshalJSON ¶ added in v1.0.0
func (r TokenAuthInfo) MarshalJSON() ([]byte, error)
func (TokenAuthInfo) Type ¶ added in v1.0.0
func (TokenAuthInfo) Type() AuthInfoType
type Tool ¶
type Tool struct {
// Description of what the tool does
Description string `json:"description"`
// Optional instructions for how to use this tool effectively
Instructions *string `json:"instructions,omitempty"`
// Tool identifier (e.g., "bash", "grep", "str_replace_editor")
Name string `json:"name"`
// Optional namespaced name for declarative filtering (e.g., "playwright/navigate" for MCP
// tools)
NamespacedName *string `json:"namespacedName,omitempty"`
// JSON Schema for the tool's input parameters
Parameters map[string]any `json:"parameters,omitzero"`
}
Schema for the `Tool` type.
type ToolExecutionCompleteContent ¶ added in v1.0.0
type ToolExecutionCompleteContent interface {
Type() ToolExecutionCompleteContentType
// contains filtered or unexported methods
}
A content block within a tool result, which may be text, terminal output, image, audio, or a resource
type ToolExecutionCompleteContentAudio ¶ added in v1.0.0
type ToolExecutionCompleteContentAudio struct {
// Base64-encoded audio data
Data string `json:"data"`
// MIME type of the audio (e.g., audio/wav, audio/mpeg)
MIMEType string `json:"mimeType"`
}
Audio content block with base64-encoded data
func (ToolExecutionCompleteContentAudio) MarshalJSON ¶ added in v1.0.0
func (r ToolExecutionCompleteContentAudio) MarshalJSON() ([]byte, error)
type ToolExecutionCompleteContentImage ¶ added in v1.0.0
type ToolExecutionCompleteContentImage struct {
// Base64-encoded image data
Data string `json:"data"`
// MIME type of the image (e.g., image/png, image/jpeg)
MIMEType string `json:"mimeType"`
}
Image content block with base64-encoded data
func (ToolExecutionCompleteContentImage) MarshalJSON ¶ added in v1.0.0
func (r ToolExecutionCompleteContentImage) MarshalJSON() ([]byte, error)
type ToolExecutionCompleteContentResource ¶ added in v1.0.0
type ToolExecutionCompleteContentResource struct {
// The embedded resource contents, either text or base64-encoded binary
Resource ToolExecutionCompleteContentResourceDetails `json:"resource"`
}
Embedded resource content block with inline text or binary data
func (ToolExecutionCompleteContentResource) MarshalJSON ¶ added in v1.0.0
func (r ToolExecutionCompleteContentResource) MarshalJSON() ([]byte, error)
type ToolExecutionCompleteContentResourceDetails ¶ added in v1.0.0
type ToolExecutionCompleteContentResourceDetails struct {
EmbeddedBlobResourceContents *EmbeddedBlobResourceContents
EmbeddedTextResourceContents *EmbeddedTextResourceContents
}
The embedded resource contents, either text or base64-encoded binary
func (ToolExecutionCompleteContentResourceDetails) MarshalJSON ¶ added in v1.0.0
func (r ToolExecutionCompleteContentResourceDetails) MarshalJSON() ([]byte, error)
func (*ToolExecutionCompleteContentResourceDetails) UnmarshalJSON ¶ added in v1.0.0
func (r *ToolExecutionCompleteContentResourceDetails) UnmarshalJSON(data []byte) error
type ToolExecutionCompleteContentResourceLink ¶ added in v1.0.0
type ToolExecutionCompleteContentResourceLink struct {
// Human-readable description of the resource
Description *string `json:"description,omitempty"`
// Icons associated with this resource
Icons []ToolExecutionCompleteContentResourceLinkIcon `json:"icons,omitzero"`
// MIME type of the resource content
MIMEType *string `json:"mimeType,omitempty"`
// Resource name identifier
Name string `json:"name"`
// Size of the resource in bytes
Size *int64 `json:"size,omitempty"`
// Human-readable display title for the resource
Title *string `json:"title,omitempty"`
// URI identifying the resource
URI string `json:"uri"`
}
Resource link content block referencing an external resource
func (ToolExecutionCompleteContentResourceLink) MarshalJSON ¶ added in v1.0.0
func (r ToolExecutionCompleteContentResourceLink) MarshalJSON() ([]byte, error)
type ToolExecutionCompleteContentResourceLinkIcon ¶ added in v1.0.0
type ToolExecutionCompleteContentResourceLinkIcon struct {
// MIME type of the icon image
MIMEType *string `json:"mimeType,omitempty"`
// Available icon sizes (e.g., ['16x16', '32x32'])
Sizes []string `json:"sizes,omitzero"`
// URL or path to the icon image
Src string `json:"src"`
// Theme variant this icon is intended for
Theme *ToolExecutionCompleteContentResourceLinkIconTheme `json:"theme,omitempty"`
}
Icon image for a resource
type ToolExecutionCompleteContentResourceLinkIconTheme ¶ added in v1.0.0
type ToolExecutionCompleteContentResourceLinkIconTheme string
Theme variant this icon is intended for
const ( // Icon intended for dark themes. ToolExecutionCompleteContentResourceLinkIconThemeDark ToolExecutionCompleteContentResourceLinkIconTheme = "dark" // Icon intended for light themes. ToolExecutionCompleteContentResourceLinkIconThemeLight ToolExecutionCompleteContentResourceLinkIconTheme = "light" )
type ToolExecutionCompleteContentTerminal ¶ added in v1.0.0
type ToolExecutionCompleteContentTerminal struct {
// Working directory where the command was executed
Cwd *string `json:"cwd,omitempty"`
// Process exit code, if the command has completed
ExitCode *int64 `json:"exitCode,omitempty"`
// Terminal/shell output text
Text string `json:"text"`
}
Terminal/shell output content block with optional exit code and working directory
func (ToolExecutionCompleteContentTerminal) MarshalJSON ¶ added in v1.0.0
func (r ToolExecutionCompleteContentTerminal) MarshalJSON() ([]byte, error)
type ToolExecutionCompleteContentText ¶ added in v1.0.0
type ToolExecutionCompleteContentText struct {
// The text content
Text string `json:"text"`
}
Plain text content block
func (ToolExecutionCompleteContentText) MarshalJSON ¶ added in v1.0.0
func (r ToolExecutionCompleteContentText) MarshalJSON() ([]byte, error)
type ToolExecutionCompleteContentType ¶ added in v1.0.0
type ToolExecutionCompleteContentType string
Type discriminator for ToolExecutionCompleteContent.
const ( ToolExecutionCompleteContentTypeAudio ToolExecutionCompleteContentType = "audio" ToolExecutionCompleteContentTypeImage ToolExecutionCompleteContentType = "image" ToolExecutionCompleteContentTypeResource ToolExecutionCompleteContentType = "resource" ToolExecutionCompleteContentTypeResourceLink ToolExecutionCompleteContentType = "resource_link" ToolExecutionCompleteContentTypeTerminal ToolExecutionCompleteContentType = "terminal" ToolExecutionCompleteContentTypeText ToolExecutionCompleteContentType = "text" )
type ToolExecutionCompleteData ¶ added in v1.0.0
type ToolExecutionCompleteData struct {
// Error details when the tool execution failed
Error *ToolExecutionCompleteError `json:"error,omitempty"`
// CAPI interaction ID for correlating this tool execution with upstream telemetry
InteractionID *string `json:"interactionId,omitempty"`
// Whether this tool call was explicitly requested by the user rather than the assistant
IsUserRequested *bool `json:"isUserRequested,omitempty"`
// Model identifier that generated this tool call
Model *string `json:"model,omitempty"`
// Tool call ID of the parent tool invocation when this event originates from a sub-agent
// Deprecated: ParentToolCallID is deprecated.
ParentToolCallID *string `json:"parentToolCallId,omitempty"`
// Tool execution result on success
Result *ToolExecutionCompleteResult `json:"result,omitempty"`
// Whether this tool execution ran inside a sandbox container
Sandboxed *bool `json:"sandboxed,omitempty"`
// Whether the tool execution completed successfully
Success bool `json:"success"`
// Unique identifier for the completed tool call
ToolCallID string `json:"toolCallId"`
// Tool definition metadata, present for MCP tools with MCP Apps support
ToolDescription *ToolExecutionCompleteToolDescription `json:"toolDescription,omitempty"`
// Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts)
ToolTelemetry map[string]any `json:"toolTelemetry,omitzero"`
// Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event
TurnID *string `json:"turnId,omitempty"`
}
Tool execution completion results including success status, detailed output, and error information
func (*ToolExecutionCompleteData) Type ¶ added in v1.0.0
func (*ToolExecutionCompleteData) Type() SessionEventType
type ToolExecutionCompleteError ¶ added in v1.0.0
type ToolExecutionCompleteError struct {
// Machine-readable error code
Code *string `json:"code,omitempty"`
// Human-readable error message
Message string `json:"message"`
}
Error details when the tool execution failed
type ToolExecutionCompleteResult ¶ added in v1.0.0
type ToolExecutionCompleteResult struct {
// Concise tool result text sent to the LLM for chat completion, potentially truncated for token efficiency
Content string `json:"content"`
// Structured content blocks (text, images, audio, resources) returned by the tool in their native format
Contents []ToolExecutionCompleteContent `json:"contents,omitzero"`
// Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent.
DetailedContent *string `json:"detailedContent,omitempty"`
// MCP Apps UI resource content for rendering in a sandboxed iframe
UIResource *ToolExecutionCompleteUIResource `json:"uiResource,omitempty"`
}
Tool execution result on success
func (*ToolExecutionCompleteResult) UnmarshalJSON ¶ added in v1.0.0
func (r *ToolExecutionCompleteResult) UnmarshalJSON(data []byte) error
type ToolExecutionCompleteToolDescription ¶ added in v1.0.0
type ToolExecutionCompleteToolDescription struct {
// Tool description
Description *string `json:"description,omitempty"`
// MCP Apps metadata for UI resource association
Meta *ToolExecutionCompleteToolDescriptionMeta `json:"_meta,omitempty"`
// Tool name
Name string `json:"name"`
}
Tool definition metadata, present for MCP tools with MCP Apps support
type ToolExecutionCompleteToolDescriptionMeta ¶ added in v1.0.0
type ToolExecutionCompleteToolDescriptionMeta struct {
// Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type.
UI *ToolExecutionCompleteToolDescriptionMetaUI `json:"ui,omitempty"`
}
MCP Apps metadata for UI resource association
type ToolExecutionCompleteToolDescriptionMetaUI ¶ added in v1.0.0
type ToolExecutionCompleteToolDescriptionMetaUI struct {
// URI of the UI resource
ResourceURI *string `json:"resourceUri,omitempty"`
// Who can access this tool
Visibility []ToolExecutionCompleteToolDescriptionMetaUIVisibility `json:"visibility,omitzero"`
}
Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type.
type ToolExecutionCompleteToolDescriptionMetaUIVisibility ¶ added in v1.0.0
type ToolExecutionCompleteToolDescriptionMetaUIVisibility string
Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration.
const ( // Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool ToolExecutionCompleteToolDescriptionMetaUIVisibilityApp ToolExecutionCompleteToolDescriptionMetaUIVisibility = "app" // Tool is callable by the model (LLM tool surface) ToolExecutionCompleteToolDescriptionMetaUIVisibilityModel ToolExecutionCompleteToolDescriptionMetaUIVisibility = "model" )
type ToolExecutionCompleteUIResource ¶ added in v1.0.0
type ToolExecutionCompleteUIResource struct {
// Base64-encoded HTML content
Blob *string `json:"blob,omitempty"`
// Resource-level UI metadata (CSP, permissions, visual preferences)
Meta *ToolExecutionCompleteUIResourceMeta `json:"_meta,omitempty"`
// MIME type of the content
MIMEType string `json:"mimeType"`
// HTML content as a string
Text *string `json:"text,omitempty"`
// The ui:// URI of the resource
URI string `json:"uri"`
}
MCP Apps UI resource content for rendering in a sandboxed iframe
type ToolExecutionCompleteUIResourceMeta ¶ added in v1.0.0
type ToolExecutionCompleteUIResourceMeta struct {
// Schema for the `ToolExecutionCompleteUIResourceMetaUI` type.
UI *ToolExecutionCompleteUIResourceMetaUI `json:"ui,omitempty"`
}
Resource-level UI metadata (CSP, permissions, visual preferences)
type ToolExecutionCompleteUIResourceMetaUI ¶ added in v1.0.0
type ToolExecutionCompleteUIResourceMetaUI struct {
// Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type.
Csp *ToolExecutionCompleteUIResourceMetaUICsp `json:"csp,omitempty"`
Domain *string `json:"domain,omitempty"`
// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type.
Permissions *ToolExecutionCompleteUIResourceMetaUIPermissions `json:"permissions,omitempty"`
PrefersBorder *bool `json:"prefersBorder,omitempty"`
}
Schema for the `ToolExecutionCompleteUIResourceMetaUI` type.
type ToolExecutionCompleteUIResourceMetaUICsp ¶ added in v1.0.0
type ToolExecutionCompleteUIResourceMetaUICsp struct {
BaseURIDomains []string `json:"baseUriDomains,omitzero"`
ConnectDomains []string `json:"connectDomains,omitzero"`
FrameDomains []string `json:"frameDomains,omitzero"`
ResourceDomains []string `json:"resourceDomains,omitzero"`
}
Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type.
type ToolExecutionCompleteUIResourceMetaUIPermissions ¶ added in v1.0.0
type ToolExecutionCompleteUIResourceMetaUIPermissions struct {
// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type.
Camera *ToolExecutionCompleteUIResourceMetaUIPermissionsCamera `json:"camera,omitempty"`
// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type.
ClipboardWrite *ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite `json:"clipboardWrite,omitempty"`
// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type.
Geolocation *ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation `json:"geolocation,omitempty"`
// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type.
Microphone *ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone `json:"microphone,omitempty"`
}
Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type.
type ToolExecutionCompleteUIResourceMetaUIPermissionsCamera ¶ added in v1.0.0
type ToolExecutionCompleteUIResourceMetaUIPermissionsCamera struct {
}
Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type.
type ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite ¶ added in v1.0.0
type ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite struct {
}
Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type.
type ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation ¶ added in v1.0.0
type ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation struct {
}
Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type.
type ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone ¶ added in v1.0.0
type ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone struct {
}
Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type.
type ToolExecutionPartialResultData ¶ added in v1.0.0
type ToolExecutionPartialResultData struct {
// Incremental output chunk from the running tool
PartialOutput string `json:"partialOutput"`
// Tool call ID this partial result belongs to
ToolCallID string `json:"toolCallId"`
}
Streaming tool execution output for incremental result display
func (*ToolExecutionPartialResultData) Type ¶ added in v1.0.0
func (*ToolExecutionPartialResultData) Type() SessionEventType
type ToolExecutionProgressData ¶ added in v1.0.0
type ToolExecutionProgressData struct {
// Human-readable progress status message (e.g., from an MCP server)
ProgressMessage string `json:"progressMessage"`
// Tool call ID this progress notification belongs to
ToolCallID string `json:"toolCallId"`
}
Tool execution progress notification with status message
func (*ToolExecutionProgressData) Type ¶ added in v1.0.0
func (*ToolExecutionProgressData) Type() SessionEventType
type ToolExecutionStartData ¶ added in v1.0.0
type ToolExecutionStartData struct {
// Arguments passed to the tool
Arguments any `json:"arguments,omitempty"`
// When true, the tool output should be displayed expanded (verbatim) in the CLI timeline
DisplayVerbatim *bool `json:"displayVerbatim,omitempty"`
// Name of the MCP server hosting this tool, when the tool is an MCP tool
MCPServerName *string `json:"mcpServerName,omitempty"`
// Original tool name on the MCP server, when the tool is an MCP tool
MCPToolName *string `json:"mcpToolName,omitempty"`
// Model identifier that generated this tool call
Model *string `json:"model,omitempty"`
// Tool call ID of the parent tool invocation when this event originates from a sub-agent
// Deprecated: ParentToolCallID is deprecated.
ParentToolCallID *string `json:"parentToolCallId,omitempty"`
// Unique identifier for this tool call
ToolCallID string `json:"toolCallId"`
// Name of the tool being executed
ToolName string `json:"toolName"`
// Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event
TurnID *string `json:"turnId,omitempty"`
}
Tool execution startup details including MCP server information when applicable
func (*ToolExecutionStartData) Type ¶ added in v1.0.0
func (*ToolExecutionStartData) Type() SessionEventType
type ToolList ¶ added in v0.3.0
type ToolList struct {
// List of available built-in tools with metadata
Tools []Tool `json:"tools"`
}
Built-in tools available for the requested model, with their parameters and instructions.
type ToolUserRequestedData ¶ added in v1.0.0
type ToolUserRequestedData struct {
// Arguments for the tool invocation
Arguments any `json:"arguments,omitempty"`
// Unique identifier for this tool call
ToolCallID string `json:"toolCallId"`
// Name of the tool the user wants to invoke
ToolName string `json:"toolName"`
}
User-initiated tool invocation request with tool name and arguments
func (*ToolUserRequestedData) Type ¶ added in v1.0.0
func (*ToolUserRequestedData) Type() SessionEventType
type ToolsAPI ¶ added in v1.0.0
type ToolsAPI sessionAPI
Experimental: ToolsAPI contains experimental APIs that may change or be removed.
func (*ToolsAPI) GetCurrentMetadata ¶ added in v1.0.0
func (a *ToolsAPI) GetCurrentMetadata(ctx context.Context) (*ToolsGetCurrentMetadataResult, error)
GetCurrentMetadata returns lightweight metadata for the session's currently initialized tools.
RPC method: session.tools.getCurrentMetadata.
Returns: Current lightweight tool metadata snapshot for the session.
func (*ToolsAPI) HandlePendingToolCall ¶ added in v1.0.0
func (a *ToolsAPI) HandlePendingToolCall(ctx context.Context, params *HandlePendingToolCallRequest) (*HandlePendingToolCallResult, error)
HandlePendingToolCall provides the result for a pending external tool call.
RPC method: session.tools.handlePendingToolCall.
Parameters: Pending external tool call request ID, with the tool result or an error describing why it failed.
Returns: Indicates whether the external tool call result was handled successfully.
func (*ToolsAPI) InitializeAndValidate ¶ added in v1.0.0
func (a *ToolsAPI) InitializeAndValidate(ctx context.Context) (*ToolsInitializeAndValidateResult, error)
InitializeAndValidate resolves, builds, and validates the runtime tool list for the session.
RPC method: session.tools.initializeAndValidate.
Returns: 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.
type ToolsGetCurrentMetadataResult ¶ added in v1.0.0
type ToolsGetCurrentMetadataResult struct {
// Current tool metadata, or null when tools have not been initialized yet
Tools []CurrentToolMetadata `json:"tools"`
}
Current lightweight tool metadata snapshot for the session. Experimental: ToolsGetCurrentMetadataResult is part of an experimental API and may change or be removed.
type ToolsInitializeAndValidateResult ¶ added in v1.0.0
type ToolsInitializeAndValidateResult struct {
}
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: ToolsInitializeAndValidateResult is part of an experimental API and may change or be removed.
type ToolsListRequest ¶ added in v0.3.0
type ToolsListRequest struct {
// Optional model ID — when provided, the returned tool list reflects model-specific
// overrides
Model *string `json:"model,omitempty"`
}
Optional model identifier whose tool overrides should be applied to the listing.
type UIAPI ¶ added in v1.0.0
type UIAPI sessionAPI
Experimental: UIAPI contains experimental APIs that may change or be removed.
func (*UIAPI) Elicitation ¶ added in v1.0.0
func (a *UIAPI) Elicitation(ctx context.Context, params *UIElicitationRequest) (*UIElicitationResponse, error)
Elicitation requests structured input from a UI-capable client.
RPC method: session.ui.elicitation.
Parameters: Prompt message and JSON schema describing the form fields to elicit from the user.
Returns: The elicitation response (accept with form values, decline, or cancel)
func (*UIAPI) EphemeralQuery ¶ added in v1.0.1
func (a *UIAPI) EphemeralQuery(ctx context.Context, params *UIEphemeralQueryRequest) (*UIEphemeralQueryResult, error)
EphemeralQuery runs a transient no-tools model query against the current conversation context.
RPC method: session.ui.ephemeralQuery.
Parameters: Transient question to answer without adding it to conversation history.
Returns: Transient answer generated from current conversation context.
func (*UIAPI) HandlePendingAutoModeSwitch ¶ added in v1.0.0
func (a *UIAPI) HandlePendingAutoModeSwitch(ctx context.Context, params *UIHandlePendingAutoModeSwitchRequest) (*UIHandlePendingResult, error)
HandlePendingAutoModeSwitch resolves a pending `auto_mode_switch.requested` event with the user's accept/decline decision.
RPC method: session.ui.handlePendingAutoModeSwitch.
Parameters: Request ID of a pending `auto_mode_switch.requested` event and the user's response.
Returns: Indicates whether the pending UI request was resolved by this call.
func (*UIAPI) HandlePendingElicitation ¶ added in v1.0.0
func (a *UIAPI) HandlePendingElicitation(ctx context.Context, params *UIHandlePendingElicitationRequest) (*UIElicitationResult, error)
HandlePendingElicitation provides the user response for a pending elicitation request.
RPC method: session.ui.handlePendingElicitation.
Parameters: Pending elicitation request ID and the user's response (accept/decline/cancel + form values).
Returns: Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
func (*UIAPI) HandlePendingExitPlanMode ¶ added in v1.0.0
func (a *UIAPI) HandlePendingExitPlanMode(ctx context.Context, params *UIHandlePendingExitPlanModeRequest) (*UIHandlePendingResult, error)
HandlePendingExitPlanMode resolves a pending `exit_plan_mode.requested` event with the user's response.
RPC method: session.ui.handlePendingExitPlanMode.
Parameters: Request ID of a pending `exit_plan_mode.requested` event and the user's response.
Returns: Indicates whether the pending UI request was resolved by this call.
func (*UIAPI) HandlePendingSampling ¶ added in v1.0.0
func (a *UIAPI) HandlePendingSampling(ctx context.Context, params *UIHandlePendingSamplingRequest) (*UIHandlePendingResult, error)
HandlePendingSampling resolves a pending `sampling.requested` event with a sampling result, or rejects it.
RPC method: session.ui.handlePendingSampling.
Parameters: Request ID of a pending `sampling.requested` event and an optional sampling result payload (omit to reject).
Returns: Indicates whether the pending UI request was resolved by this call.
func (*UIAPI) HandlePendingUserInput ¶ added in v1.0.0
func (a *UIAPI) HandlePendingUserInput(ctx context.Context, params *UIHandlePendingUserInputRequest) (*UIHandlePendingResult, error)
HandlePendingUserInput resolves a pending `user_input.requested` event with the user's response.
RPC method: session.ui.handlePendingUserInput.
Parameters: Request ID of a pending `user_input.requested` event and the user's response.
Returns: Indicates whether the pending UI request was resolved by this call.
func (*UIAPI) RegisterDirectAutoModeSwitchHandler ¶ added in v1.0.0
func (a *UIAPI) RegisterDirectAutoModeSwitchHandler(ctx context.Context) (*UIRegisterDirectAutoModeSwitchHandlerResult, error)
RegisterDirectAutoModeSwitchHandler registers an in-process handler for auto-mode-switch requests so the server bridge skips dispatch.
RPC method: session.ui.registerDirectAutoModeSwitchHandler.
Returns: 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).
func (*UIAPI) UnregisterDirectAutoModeSwitchHandler ¶ added in v1.0.0
func (a *UIAPI) UnregisterDirectAutoModeSwitchHandler(ctx context.Context, params *UIUnregisterDirectAutoModeSwitchHandlerRequest) (*UIUnregisterDirectAutoModeSwitchHandlerResult, error)
UnregisterDirectAutoModeSwitchHandler unregisters a previously-registered in-process auto-mode-switch handler by its opaque handle.
RPC method: session.ui.unregisterDirectAutoModeSwitchHandler.
Parameters: Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release.
Returns: Indicates whether the handle was active and the registration count was decremented.
type UIAutoModeSwitchResponse ¶ added in v1.0.0
type UIAutoModeSwitchResponse string
User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline). Experimental: UIAutoModeSwitchResponse is part of an experimental API and may change or be removed.
const ( // Decline the automatic mode switch. UIAutoModeSwitchResponseNo UIAutoModeSwitchResponse = "no" // Allow the automatic mode switch for this turn. UIAutoModeSwitchResponseYes UIAutoModeSwitchResponse = "yes" // Allow this mode switch and persist the preference. UIAutoModeSwitchResponseYesAlways UIAutoModeSwitchResponse = "yes_always" )
type UIElicitationArrayAnyOfField ¶ added in v0.3.0
type UIElicitationArrayAnyOfField struct {
// Default values selected when the form is first shown.
Default []string `json:"default,omitzero"`
// Help text describing the field.
Description *string `json:"description,omitempty"`
// Schema applied to each item in the array.
Items UIElicitationArrayAnyOfFieldItems `json:"items"`
// Maximum number of items the user may select.
MaxItems *int64 `json:"maxItems,omitempty"`
// Minimum number of items the user must select.
MinItems *int64 `json:"minItems,omitempty"`
// Human-readable label for the field.
Title *string `json:"title,omitempty"`
}
Multi-select string field where each option pairs a value with a display label. Experimental: UIElicitationArrayAnyOfField is part of an experimental API and may change or be removed.
func (UIElicitationArrayAnyOfField) MarshalJSON ¶ added in v1.0.0
func (r UIElicitationArrayAnyOfField) MarshalJSON() ([]byte, error)
func (UIElicitationArrayAnyOfField) Type ¶ added in v0.3.0
func (UIElicitationArrayAnyOfField) Type() UIElicitationSchemaPropertyType
type UIElicitationArrayAnyOfFieldItems ¶ added in v0.3.0
type UIElicitationArrayAnyOfFieldItems struct {
// Selectable options, each with a value and a display label.
AnyOf []UIElicitationArrayAnyOfFieldItemsAnyOf `json:"anyOf"`
}
Schema applied to each item in the array. Experimental: UIElicitationArrayAnyOfFieldItems is part of an experimental API and may change or be removed.
type UIElicitationArrayAnyOfFieldItemsAnyOf ¶ added in v0.3.0
type UIElicitationArrayAnyOfFieldItemsAnyOf struct {
// Value submitted when this option is selected.
Const string `json:"const"`
// Display label for this option.
Title string `json:"title"`
}
Schema for the `UIElicitationArrayAnyOfFieldItemsAnyOf` type. Experimental: UIElicitationArrayAnyOfFieldItemsAnyOf is part of an experimental API and may change or be removed.
type UIElicitationArrayEnumField ¶ added in v0.3.0
type UIElicitationArrayEnumField struct {
// Default values selected when the form is first shown.
Default []string `json:"default,omitzero"`
// Help text describing the field.
Description *string `json:"description,omitempty"`
// Schema applied to each item in the array.
Items UIElicitationArrayEnumFieldItems `json:"items"`
// Maximum number of items the user may select.
MaxItems *int64 `json:"maxItems,omitempty"`
// Minimum number of items the user must select.
MinItems *int64 `json:"minItems,omitempty"`
// Human-readable label for the field.
Title *string `json:"title,omitempty"`
}
Multi-select string field whose allowed values are defined inline. Experimental: UIElicitationArrayEnumField is part of an experimental API and may change or be removed.
func (UIElicitationArrayEnumField) MarshalJSON ¶ added in v1.0.0
func (r UIElicitationArrayEnumField) MarshalJSON() ([]byte, error)
func (UIElicitationArrayEnumField) Type ¶ added in v0.3.0
func (UIElicitationArrayEnumField) Type() UIElicitationSchemaPropertyType
type UIElicitationArrayEnumFieldItems ¶ added in v0.3.0
type UIElicitationArrayEnumFieldItems struct {
// Allowed string values for each selected item.
Enum []string `json:"enum"`
// Type discriminator. Always "string".
Type UIElicitationArrayEnumFieldItemsType `json:"type"`
}
Schema applied to each item in the array. Experimental: UIElicitationArrayEnumFieldItems is part of an experimental API and may change or be removed.
type UIElicitationArrayEnumFieldItemsType ¶ added in v0.3.0
type UIElicitationArrayEnumFieldItemsType string
Type discriminator. Always "string".
const (
UIElicitationArrayEnumFieldItemsTypeString UIElicitationArrayEnumFieldItemsType = "string"
)
type UIElicitationBooleanValue ¶ added in v1.0.0
type UIElicitationBooleanValue bool
type UIElicitationFieldValue ¶ added in v0.3.0
type UIElicitationFieldValue interface {
// contains filtered or unexported methods
}
Schema for the `UIElicitationFieldValue` type. Experimental: UIElicitationFieldValue is part of an experimental API and may change or be removed.
type UIElicitationNumberValue ¶ added in v1.0.0
type UIElicitationNumberValue float64
type UIElicitationRequest ¶ added in v0.3.0
type UIElicitationRequest struct {
// Message describing what information is needed from the user
Message string `json:"message"`
// JSON Schema describing the form fields to present to the user
RequestedSchema UIElicitationSchema `json:"requestedSchema"`
}
Prompt message and JSON schema describing the form fields to elicit from the user. Experimental: UIElicitationRequest is part of an experimental API and may change or be removed.
type UIElicitationResponse ¶ added in v0.3.0
type UIElicitationResponse struct {
// The user's response: accept (submitted), decline (rejected), or cancel (dismissed)
Action UIElicitationResponseAction `json:"action"`
// The form values submitted by the user (present when action is 'accept')
Content map[string]UIElicitationFieldValue `json:"content,omitzero"`
}
The elicitation response (accept with form values, decline, or cancel) Experimental: UIElicitationResponse is part of an experimental API and may change or be removed.
func (*UIElicitationResponse) UnmarshalJSON ¶ added in v1.0.0
func (r *UIElicitationResponse) UnmarshalJSON(data []byte) error
type UIElicitationResponseAction ¶ added in v0.3.0
type UIElicitationResponseAction string
The user's response: accept (submitted), decline (rejected), or cancel (dismissed) Experimental: UIElicitationResponseAction is part of an experimental API and may change or be removed.
const ( // The user submitted the requested form values. UIElicitationResponseActionAccept UIElicitationResponseAction = "accept" // The user dismissed the elicitation request. UIElicitationResponseActionCancel UIElicitationResponseAction = "cancel" // The user explicitly declined to provide the requested input. UIElicitationResponseActionDecline UIElicitationResponseAction = "decline" )
type UIElicitationResponseContent ¶ added in v1.0.0
type UIElicitationResponseContent map[string]UIElicitationFieldValue
The form values submitted by the user (present when action is 'accept') Experimental: UIElicitationResponseContent is part of an experimental API and may change or be removed.
type UIElicitationResult ¶ added in v0.3.0
type UIElicitationResult struct {
// Whether the response was accepted. False if the request was already resolved by another
// client.
Success bool `json:"success"`
}
Indicates whether the elicitation response was accepted; false if it was already resolved by another client. Experimental: UIElicitationResult is part of an experimental API and may change or be removed.
type UIElicitationSchema ¶ added in v0.3.0
type UIElicitationSchema struct {
// Form field definitions, keyed by field name
Properties map[string]UIElicitationSchemaProperty `json:"properties"`
// List of required field names
Required []string `json:"required,omitzero"`
// Schema type indicator (always 'object')
Type UIElicitationSchemaType `json:"type"`
}
JSON Schema describing the form fields to present to the user Experimental: UIElicitationSchema is part of an experimental API and may change or be removed.
func (*UIElicitationSchema) UnmarshalJSON ¶ added in v1.0.0
func (r *UIElicitationSchema) UnmarshalJSON(data []byte) error
type UIElicitationSchemaProperty ¶ added in v0.3.0
type UIElicitationSchemaProperty interface {
Type() UIElicitationSchemaPropertyType
// contains filtered or unexported methods
}
Definition for a single elicitation form field. Experimental: UIElicitationSchemaProperty is part of an experimental API and may change or be removed.
type UIElicitationSchemaPropertyBoolean ¶ added in v0.3.0
type UIElicitationSchemaPropertyBoolean struct {
// Default value selected when the form is first shown.
Default *bool `json:"default,omitempty"`
// Help text describing the field.
Description *string `json:"description,omitempty"`
// Human-readable label for the field.
Title *string `json:"title,omitempty"`
}
Boolean field rendered as a yes/no toggle. Experimental: UIElicitationSchemaPropertyBoolean is part of an experimental API and may change or be removed.
func (UIElicitationSchemaPropertyBoolean) MarshalJSON ¶ added in v1.0.0
func (r UIElicitationSchemaPropertyBoolean) MarshalJSON() ([]byte, error)
type UIElicitationSchemaPropertyNumber ¶ added in v0.3.0
type UIElicitationSchemaPropertyNumber struct {
// Default value populated in the input when the form is first shown.
Default *float64 `json:"default,omitempty"`
// Help text describing the field.
Description *string `json:"description,omitempty"`
// Maximum allowed value (inclusive).
Maximum *float64 `json:"maximum,omitempty"`
// Minimum allowed value (inclusive).
Minimum *float64 `json:"minimum,omitempty"`
// Human-readable label for the field.
Title *string `json:"title,omitempty"`
Discriminator UIElicitationSchemaPropertyNumberType `json:"type,omitempty"`
}
Numeric field accepting either a number or an integer. Experimental: UIElicitationSchemaPropertyNumber is part of an experimental API and may change or be removed.
func (UIElicitationSchemaPropertyNumber) MarshalJSON ¶ added in v1.0.0
func (r UIElicitationSchemaPropertyNumber) MarshalJSON() ([]byte, error)
func (UIElicitationSchemaPropertyNumber) Type ¶ added in v0.3.0
func (r UIElicitationSchemaPropertyNumber) Type() UIElicitationSchemaPropertyType
type UIElicitationSchemaPropertyNumberType ¶ added in v1.0.0
type UIElicitationSchemaPropertyNumberType string
Numeric type accepted by the field. Experimental: UIElicitationSchemaPropertyNumberType is part of an experimental API and may change or be removed.
const ( // Integer JSON number. UIElicitationSchemaPropertyNumberTypeInteger UIElicitationSchemaPropertyNumberType = "integer" // Any JSON number. UIElicitationSchemaPropertyNumberTypeNumber UIElicitationSchemaPropertyNumberType = "number" )
type UIElicitationSchemaPropertyString ¶ added in v0.3.0
type UIElicitationSchemaPropertyString struct {
// Default value populated in the input when the form is first shown.
Default *string `json:"default,omitempty"`
// Help text describing the field.
Description *string `json:"description,omitempty"`
// Optional format hint that constrains the accepted input.
Format *UIElicitationSchemaPropertyStringFormat `json:"format,omitempty"`
// Maximum number of characters allowed.
MaxLength *int64 `json:"maxLength,omitempty"`
// Minimum number of characters required.
MinLength *int64 `json:"minLength,omitempty"`
// Human-readable label for the field.
Title *string `json:"title,omitempty"`
}
Free-text string field with optional length and format constraints. Experimental: UIElicitationSchemaPropertyString is part of an experimental API and may change or be removed.
func (UIElicitationSchemaPropertyString) MarshalJSON ¶ added in v1.0.0
func (r UIElicitationSchemaPropertyString) MarshalJSON() ([]byte, error)
type UIElicitationSchemaPropertyStringFormat ¶ added in v0.3.0
type UIElicitationSchemaPropertyStringFormat string
Optional format hint that constrains the accepted input. Experimental: UIElicitationSchemaPropertyStringFormat is part of an experimental API and may change or be removed.
const ( // Calendar date string format. UIElicitationSchemaPropertyStringFormatDate UIElicitationSchemaPropertyStringFormat = "date" // Date-time string format. UIElicitationSchemaPropertyStringFormatDateTime UIElicitationSchemaPropertyStringFormat = "date-time" // Email address string format. UIElicitationSchemaPropertyStringFormatEmail UIElicitationSchemaPropertyStringFormat = "email" // URI string format. UIElicitationSchemaPropertyStringFormatURI UIElicitationSchemaPropertyStringFormat = "uri" )
type UIElicitationSchemaPropertyType ¶ added in v0.3.0
type UIElicitationSchemaPropertyType string
Type discriminator for UIElicitationSchemaProperty.
const ( UIElicitationSchemaPropertyTypeArray UIElicitationSchemaPropertyType = "array" UIElicitationSchemaPropertyTypeBoolean UIElicitationSchemaPropertyType = "boolean" UIElicitationSchemaPropertyTypeInteger UIElicitationSchemaPropertyType = "integer" UIElicitationSchemaPropertyTypeNumber UIElicitationSchemaPropertyType = "number" UIElicitationSchemaPropertyTypeString UIElicitationSchemaPropertyType = "string" )
type UIElicitationSchemaType ¶ added in v0.3.0
type UIElicitationSchemaType string
Schema type indicator (always 'object')
const (
UIElicitationSchemaTypeObject UIElicitationSchemaType = "object"
)
type UIElicitationStringArrayValue ¶ added in v1.0.0
type UIElicitationStringArrayValue []string
type UIElicitationStringEnumField ¶ added in v0.3.0
type UIElicitationStringEnumField struct {
// Default value selected when the form is first shown.
Default *string `json:"default,omitempty"`
// Help text describing the field.
Description *string `json:"description,omitempty"`
// Allowed string values.
Enum []string `json:"enum"`
// Optional display labels for each enum value, in the same order as `enum`.
EnumNames []string `json:"enumNames,omitzero"`
// Human-readable label for the field.
Title *string `json:"title,omitempty"`
}
Single-select string field whose allowed values are defined inline. Experimental: UIElicitationStringEnumField is part of an experimental API and may change or be removed.
func (UIElicitationStringEnumField) MarshalJSON ¶ added in v1.0.0
func (r UIElicitationStringEnumField) MarshalJSON() ([]byte, error)
func (UIElicitationStringEnumField) Type ¶ added in v0.3.0
func (UIElicitationStringEnumField) Type() UIElicitationSchemaPropertyType
type UIElicitationStringOneOfField ¶ added in v0.3.0
type UIElicitationStringOneOfField struct {
// Default value selected when the form is first shown.
Default *string `json:"default,omitempty"`
// Help text describing the field.
Description *string `json:"description,omitempty"`
// Selectable options, each with a value and a display label.
OneOf []UIElicitationStringOneOfFieldOneOf `json:"oneOf"`
// Human-readable label for the field.
Title *string `json:"title,omitempty"`
}
Single-select string field where each option pairs a value with a display label. Experimental: UIElicitationStringOneOfField is part of an experimental API and may change or be removed.
func (UIElicitationStringOneOfField) MarshalJSON ¶ added in v1.0.0
func (r UIElicitationStringOneOfField) MarshalJSON() ([]byte, error)
func (UIElicitationStringOneOfField) Type ¶ added in v0.3.0
func (UIElicitationStringOneOfField) Type() UIElicitationSchemaPropertyType
type UIElicitationStringOneOfFieldOneOf ¶ added in v0.3.0
type UIElicitationStringOneOfFieldOneOf struct {
// Value submitted when this option is selected.
Const string `json:"const"`
// Display label for this option.
Title string `json:"title"`
}
Schema for the `UIElicitationStringOneOfFieldOneOf` type. Experimental: UIElicitationStringOneOfFieldOneOf is part of an experimental API and may change or be removed.
type UIElicitationStringValue ¶ added in v1.0.0
type UIElicitationStringValue string
type UIEphemeralQueryRequest ¶ added in v1.0.1
type UIEphemeralQueryRequest struct {
// In-process `AbortSignal` forwarded to the model client to cancel an in-flight request.
// Marked internal: excluded from the public SDK surface. Replaced by an explicit
// cancellation token + cancel RPC in the SDK migration.
// Internal: AbortSignal is part of the SDK's internal API surface and is not intended for
// external use.
AbortSignal any `json:"abortSignal,omitempty"`
// In-process streaming callback `(text) => void` invoked with each token as the model emits
// it. Marked internal: excluded from the public SDK surface. In a process-separated SDK
// this is replaced by a streaming RPC that yields chunks and a final answer.
// Internal: OnChunk is part of the SDK's internal API surface and is not intended for
// external use.
OnChunk any `json:"onChunk,omitempty"`
// Question to answer from the current conversation context.
Question string `json:"question"`
}
Transient question to answer without adding it to conversation history. Experimental: UIEphemeralQueryRequest is part of an experimental API and may change or be removed.
type UIEphemeralQueryResult ¶ added in v1.0.1
type UIEphemeralQueryResult struct {
// Full assistant response text.
Answer string `json:"answer"`
}
Transient answer generated from current conversation context. Experimental: UIEphemeralQueryResult is part of an experimental API and may change or be removed.
type UIExitPlanModeAction ¶ added in v1.0.0
type UIExitPlanModeAction string
The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'. Experimental: UIExitPlanModeAction is part of an experimental API and may change or be removed.
const ( // Exit plan mode and continue in autopilot mode. UIExitPlanModeActionAutopilot UIExitPlanModeAction = "autopilot" // Exit plan mode and continue in autopilot mode with parallel subagent execution. UIExitPlanModeActionAutopilotFleet UIExitPlanModeAction = "autopilot_fleet" // Exit plan mode without starting implementation. UIExitPlanModeActionExitOnly UIExitPlanModeAction = "exit_only" // Exit plan mode and continue interactively. UIExitPlanModeActionInteractive UIExitPlanModeAction = "interactive" )
type UIExitPlanModeResponse ¶ added in v1.0.0
type UIExitPlanModeResponse struct {
// Whether the plan was approved.
Approved bool `json:"approved"`
// Whether subsequent edits should be auto-approved without confirmation.
AutoApproveEdits *bool `json:"autoApproveEdits,omitempty"`
// Feedback from the user when they declined the plan or requested changes.
Feedback *string `json:"feedback,omitempty"`
// The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true,
// otherwise 'interactive'.
SelectedAction *UIExitPlanModeAction `json:"selectedAction,omitempty"`
}
Schema for the `UIExitPlanModeResponse` type. Experimental: UIExitPlanModeResponse is part of an experimental API and may change or be removed.
type UIHandlePendingAutoModeSwitchRequest ¶ added in v1.0.0
type UIHandlePendingAutoModeSwitchRequest struct {
// The unique request ID from the auto_mode_switch.requested event
RequestID string `json:"requestId"`
// User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist
// as setting), or no (decline).
Response UIAutoModeSwitchResponse `json:"response"`
}
Request ID of a pending `auto_mode_switch.requested` event and the user's response. Experimental: UIHandlePendingAutoModeSwitchRequest is part of an experimental API and may change or be removed.
type UIHandlePendingElicitationRequest ¶ added in v0.3.0
type UIHandlePendingElicitationRequest struct {
// The unique request ID from the elicitation.requested event
RequestID string `json:"requestId"`
// The elicitation response (accept with form values, decline, or cancel)
Result UIElicitationResponse `json:"result"`
}
Pending elicitation request ID and the user's response (accept/decline/cancel + form values). Experimental: UIHandlePendingElicitationRequest is part of an experimental API and may change or be removed.
type UIHandlePendingExitPlanModeRequest ¶ added in v1.0.0
type UIHandlePendingExitPlanModeRequest struct {
// The unique request ID from the exit_plan_mode.requested event
RequestID string `json:"requestId"`
// Schema for the `UIExitPlanModeResponse` type.
Response UIExitPlanModeResponse `json:"response"`
}
Request ID of a pending `exit_plan_mode.requested` event and the user's response. Experimental: UIHandlePendingExitPlanModeRequest is part of an experimental API and may change or be removed.
type UIHandlePendingResult ¶ added in v1.0.0
type UIHandlePendingResult struct {
// 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.
Success bool `json:"success"`
}
Indicates whether the pending UI request was resolved by this call. Experimental: UIHandlePendingResult is part of an experimental API and may change or be removed.
type UIHandlePendingSamplingRequest ¶ added in v1.0.0
type UIHandlePendingSamplingRequest struct {
// The unique request ID from the sampling.requested event
RequestID string `json:"requestId"`
// Optional sampling result payload. Omit to reject/cancel the sampling request without
// providing a result.
Response *UIHandlePendingSamplingResponse `json:"response,omitempty"`
}
Request ID of a pending `sampling.requested` event and an optional sampling result payload (omit to reject). Experimental: UIHandlePendingSamplingRequest is part of an experimental API and may change or be removed.
type UIHandlePendingSamplingResponse ¶ added in v1.0.0
type UIHandlePendingSamplingResponse struct {
}
Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result. Experimental: UIHandlePendingSamplingResponse is part of an experimental API and may change or be removed.
type UIHandlePendingUserInputRequest ¶ added in v1.0.0
type UIHandlePendingUserInputRequest struct {
// The unique request ID from the user_input.requested event
RequestID string `json:"requestId"`
// Schema for the `UIUserInputResponse` type.
Response UIUserInputResponse `json:"response"`
}
Request ID of a pending `user_input.requested` event and the user's response. Experimental: UIHandlePendingUserInputRequest is part of an experimental API and may change or be removed.
type UIRegisterDirectAutoModeSwitchHandlerResult ¶ added in v1.0.0
type UIRegisterDirectAutoModeSwitchHandlerResult struct {
// 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.
Handle string `json:"handle"`
}
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: UIRegisterDirectAutoModeSwitchHandlerResult is part of an experimental API and may change or be removed.
type UIUnregisterDirectAutoModeSwitchHandlerRequest ¶ added in v1.0.0
type UIUnregisterDirectAutoModeSwitchHandlerRequest struct {
// Handle previously returned by `registerDirectAutoModeSwitchHandler`
Handle string `json:"handle"`
}
Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release. Experimental: UIUnregisterDirectAutoModeSwitchHandlerRequest is part of an experimental API and may change or be removed.
type UIUnregisterDirectAutoModeSwitchHandlerResult ¶ added in v1.0.0
type UIUnregisterDirectAutoModeSwitchHandlerResult struct {
// True if the handle was active and decremented the counter; false if the handle was
// unknown.
Unregistered bool `json:"unregistered"`
}
Indicates whether the handle was active and the registration count was decremented. Experimental: UIUnregisterDirectAutoModeSwitchHandlerResult is part of an experimental API and may change or be removed.
type UIUserInputResponse ¶ added in v1.0.0
type UIUserInputResponse struct {
// The user's answer text
Answer string `json:"answer"`
// 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.
WasFreeform bool `json:"wasFreeform"`
}
Schema for the `UIUserInputResponse` type. Experimental: UIUserInputResponse is part of an experimental API and may change or be removed.
type UsageAPI ¶ added in v1.0.0
type UsageAPI sessionAPI
Experimental: UsageAPI contains experimental APIs that may change or be removed.
func (*UsageAPI) GetMetrics ¶ added in v1.0.0
func (a *UsageAPI) GetMetrics(ctx context.Context) (*UsageGetMetricsResult, error)
GetMetrics gets accumulated usage metrics for the session.
RPC method: session.usage.getMetrics.
Returns: Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals.
type UsageGetMetricsResult ¶ added in v0.3.0
type UsageGetMetricsResult struct {
// Aggregated code change metrics
CodeChanges UsageMetricsCodeChanges `json:"codeChanges"`
// Currently active model identifier
CurrentModel *string `json:"currentModel,omitempty"`
// Input tokens from the most recent main-agent API call
LastCallInputTokens int64 `json:"lastCallInputTokens"`
// Output tokens from the most recent main-agent API call
LastCallOutputTokens int64 `json:"lastCallOutputTokens"`
// Per-model token and request metrics, keyed by model identifier
ModelMetrics map[string]UsageMetricsModelMetric `json:"modelMetrics"`
// ISO 8601 timestamp when the session started
SessionStartTime time.Time `json:"sessionStartTime"`
// Session-wide per-token-type accumulated token counts
TokenDetails map[string]UsageMetricsTokenDetail `json:"tokenDetails,omitzero"`
// Total time spent in model API calls (milliseconds)
TotalAPIDurationMs int64 `json:"totalApiDurationMs"`
// Session-wide accumulated nano-AI units cost
TotalNanoAiu *float64 `json:"totalNanoAiu,omitempty"`
// Total user-initiated premium request cost across all models (may be fractional due to
// multipliers)
TotalPremiumRequestCost float64 `json:"totalPremiumRequestCost"`
// Raw count of user-initiated API requests
TotalUserRequests int64 `json:"totalUserRequests"`
}
Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals. Experimental: UsageGetMetricsResult is part of an experimental API and may change or be removed.
type UsageMetricsCodeChanges ¶ added in v0.3.0
type UsageMetricsCodeChanges struct {
// Distinct file paths modified during the session
FilesModified []string `json:"filesModified"`
// Number of distinct files modified
FilesModifiedCount int64 `json:"filesModifiedCount"`
// Total lines of code added
LinesAdded int64 `json:"linesAdded"`
// Total lines of code removed
LinesRemoved int64 `json:"linesRemoved"`
}
Aggregated code change metrics Experimental: UsageMetricsCodeChanges is part of an experimental API and may change or be removed.
type UsageMetricsModelMetric ¶ added in v0.3.0
type UsageMetricsModelMetric struct {
// Request count and cost metrics for this model
Requests UsageMetricsModelMetricRequests `json:"requests"`
// Token count details per type
TokenDetails map[string]UsageMetricsModelMetricTokenDetail `json:"tokenDetails,omitzero"`
// Accumulated nano-AI units cost for this model
TotalNanoAiu *float64 `json:"totalNanoAiu,omitempty"`
// Token usage metrics for this model
Usage UsageMetricsModelMetricUsage `json:"usage"`
}
Schema for the `UsageMetricsModelMetric` type. Experimental: UsageMetricsModelMetric is part of an experimental API and may change or be removed.
type UsageMetricsModelMetricRequests ¶ added in v0.3.0
type UsageMetricsModelMetricRequests struct {
// User-initiated premium request cost (with multiplier applied)
Cost float64 `json:"cost"`
// Number of API requests made with this model
Count int64 `json:"count"`
}
Request count and cost metrics for this model Experimental: UsageMetricsModelMetricRequests is part of an experimental API and may change or be removed.
type UsageMetricsModelMetricTokenDetail ¶ added in v1.0.0
type UsageMetricsModelMetricTokenDetail struct {
// Accumulated token count for this token type
TokenCount int64 `json:"tokenCount"`
}
Schema for the `UsageMetricsModelMetricTokenDetail` type. Experimental: UsageMetricsModelMetricTokenDetail is part of an experimental API and may change or be removed.
type UsageMetricsModelMetricUsage ¶ added in v0.3.0
type UsageMetricsModelMetricUsage struct {
// Total tokens read from prompt cache
CacheReadTokens int64 `json:"cacheReadTokens"`
// Total tokens written to prompt cache
CacheWriteTokens int64 `json:"cacheWriteTokens"`
// Total input tokens consumed
InputTokens int64 `json:"inputTokens"`
// Total output tokens produced
OutputTokens int64 `json:"outputTokens"`
// Total output tokens used for reasoning
ReasoningTokens *int64 `json:"reasoningTokens,omitempty"`
}
Token usage metrics for this model Experimental: UsageMetricsModelMetricUsage is part of an experimental API and may change or be removed.
type UsageMetricsTokenDetail ¶ added in v1.0.0
type UsageMetricsTokenDetail struct {
// Accumulated token count for this token type
TokenCount int64 `json:"tokenCount"`
}
Schema for the `UsageMetricsTokenDetail` type. Experimental: UsageMetricsTokenDetail is part of an experimental API and may change or be removed.
type UserAuthInfo ¶ added in v1.0.0
type UserAuthInfo struct {
// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the
// GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this
// verbatim and does not re-fetch when set.
CopilotUser *CopilotUserResponse `json:"copilotUser,omitempty"`
// Authentication host.
Host string `json:"host"`
// OAuth user login.
Login string `json:"login"`
}
Schema for the `UserAuthInfo` type. Experimental: UserAuthInfo is part of an experimental API and may change or be removed.
func (UserAuthInfo) MarshalJSON ¶ added in v1.0.0
func (r UserAuthInfo) MarshalJSON() ([]byte, error)
func (UserAuthInfo) Type ¶ added in v1.0.0
func (UserAuthInfo) Type() AuthInfoType
type UserInputCompletedData ¶ added in v1.0.0
type UserInputCompletedData struct {
// The user's answer to the input request
Answer *string `json:"answer,omitempty"`
// Request ID of the resolved user input request; clients should dismiss any UI for this request
RequestID string `json:"requestId"`
// Whether the answer was typed as free-form text rather than selected from choices
WasFreeform *bool `json:"wasFreeform,omitempty"`
}
User input request completion with the user's response
func (*UserInputCompletedData) Type ¶ added in v1.0.0
func (*UserInputCompletedData) Type() SessionEventType
type UserInputRequestedData ¶ added in v1.0.0
type UserInputRequestedData struct {
// Whether the user can provide a free-form text response in addition to predefined choices
AllowFreeform *bool `json:"allowFreeform,omitempty"`
// Predefined choices for the user to select from, if applicable
Choices []string `json:"choices,omitzero"`
// The question or prompt to present to the user
Question string `json:"question"`
// Unique identifier for this input request; used to respond via session.respondToUserInput()
RequestID string `json:"requestId"`
// The LLM-assigned tool call ID that triggered this request; used by remote UIs to correlate responses
ToolCallID *string `json:"toolCallId,omitempty"`
}
User input request notification with question and optional predefined choices
func (*UserInputRequestedData) Type ¶ added in v1.0.0
func (*UserInputRequestedData) Type() SessionEventType
type UserMessageAgentMode ¶ added in v1.0.0
type UserMessageAgentMode string
The agent mode that was active when this message was sent
const ( // The agent is working autonomously toward task completion. UserMessageAgentModeAutopilot UserMessageAgentMode = "autopilot" // The agent is responding interactively to the user. UserMessageAgentModeInteractive UserMessageAgentMode = "interactive" // The agent is preparing a plan before making changes. UserMessageAgentModePlan UserMessageAgentMode = "plan" // The agent is in shell-focused UI mode. UserMessageAgentModeShell UserMessageAgentMode = "shell" )
type UserMessageData ¶ added in v1.0.0
type UserMessageData struct {
// The agent mode that was active when this message was sent
AgentMode *UserMessageAgentMode `json:"agentMode,omitempty"`
// Files, selections, or GitHub references attached to the message
Attachments []Attachment `json:"attachments,omitzero"`
// The user's message text as displayed in the timeline
Content string `json:"content"`
// CAPI interaction ID for correlating this user message with its turn
InteractionID *string `json:"interactionId,omitempty"`
// True when this user message was auto-injected by autopilot's continuation loop rather than typed by the user; used to distinguish autopilot-driven turns in telemetry.
IsAutopilotContinuation *bool `json:"isAutopilotContinuation,omitempty"`
// Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit
NativeDocumentPathFallbackPaths []string `json:"nativeDocumentPathFallbackPaths,omitzero"`
// Parent agent task ID for background telemetry correlated to this user turn
ParentAgentTaskID *string `json:"parentAgentTaskId,omitempty"`
// Origin of this message, used for timeline filtering (e.g., "skill-pdf" for skill-injected messages that should be hidden from the user)
Source *string `json:"source,omitempty"`
// Normalized document MIME types that were sent natively instead of through tagged_files XML
SupportedNativeDocumentMIMETypes []string `json:"supportedNativeDocumentMimeTypes,omitzero"`
// Transformed version of the message sent to the model, with XML wrapping, timestamps, and other augmentations for prompt caching
TransformedContent *string `json:"transformedContent,omitempty"`
}
Schema for the `UserMessageData` type.
func (*UserMessageData) Type ¶ added in v1.0.0
func (*UserMessageData) Type() SessionEventType
func (*UserMessageData) UnmarshalJSON ¶ added in v1.0.0
func (r *UserMessageData) UnmarshalJSON(data []byte) error
type UserRequestedShellCommandResult ¶ added in v1.0.1
type UserRequestedShellCommandResult struct {
// Error output when the execution failed
Error *string `json:"error,omitempty"`
// Process exit code, when available
ExitCode *int64 `json:"exitCode,omitempty"`
// Captured command output
Output string `json:"output"`
// Whether the command completed successfully
Success bool `json:"success"`
// Tool call id emitted for the shell execution
ToolCallID string `json:"toolCallId"`
}
Result of a user-requested shell command. Experimental: UserRequestedShellCommandResult is part of an experimental API and may change or be removed.
type UserSettingsReloadResult ¶ added in v1.0.0
type UserSettingsReloadResult struct {
}
type UserToolSessionApproval ¶ added in v1.0.0
type UserToolSessionApproval interface {
Kind() UserToolSessionApprovalKind
// contains filtered or unexported methods
}
The approval to add as a session-scoped rule Experimental: UserToolSessionApproval is part of an experimental API and may change or be removed.
type UserToolSessionApprovalCommands ¶ added in v1.0.0
type UserToolSessionApprovalCommands struct {
// Command identifiers approved by the user
CommandIdentifiers []string `json:"commandIdentifiers"`
}
Schema for the `UserToolSessionApprovalCommands` type. Experimental: UserToolSessionApprovalCommands is part of an experimental API and may change or be removed.
func (UserToolSessionApprovalCommands) Kind ¶ added in v1.0.0
func (UserToolSessionApprovalCommands) Kind() UserToolSessionApprovalKind
func (UserToolSessionApprovalCommands) MarshalJSON ¶ added in v1.0.0
func (r UserToolSessionApprovalCommands) MarshalJSON() ([]byte, error)
type UserToolSessionApprovalCustomTool ¶ added in v1.0.0
type UserToolSessionApprovalCustomTool struct {
// Custom tool name
ToolName string `json:"toolName"`
}
Schema for the `UserToolSessionApprovalCustomTool` type. Experimental: UserToolSessionApprovalCustomTool is part of an experimental API and may change or be removed.
func (UserToolSessionApprovalCustomTool) Kind ¶ added in v1.0.0
func (UserToolSessionApprovalCustomTool) Kind() UserToolSessionApprovalKind
func (UserToolSessionApprovalCustomTool) MarshalJSON ¶ added in v1.0.0
func (r UserToolSessionApprovalCustomTool) MarshalJSON() ([]byte, error)
type UserToolSessionApprovalExtensionManagement ¶ added in v1.0.0
type UserToolSessionApprovalExtensionManagement struct {
// Optional operation identifier
Operation *string `json:"operation,omitempty"`
}
Schema for the `UserToolSessionApprovalExtensionManagement` type. Experimental: UserToolSessionApprovalExtensionManagement is part of an experimental API and may change or be removed.
func (UserToolSessionApprovalExtensionManagement) MarshalJSON ¶ added in v1.0.0
func (r UserToolSessionApprovalExtensionManagement) MarshalJSON() ([]byte, error)
type UserToolSessionApprovalExtensionPermissionAccess ¶ added in v1.0.0
type UserToolSessionApprovalExtensionPermissionAccess struct {
// Extension name
ExtensionName string `json:"extensionName"`
}
Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type. Experimental: UserToolSessionApprovalExtensionPermissionAccess is part of an experimental API and may change or be removed.
func (UserToolSessionApprovalExtensionPermissionAccess) MarshalJSON ¶ added in v1.0.0
func (r UserToolSessionApprovalExtensionPermissionAccess) MarshalJSON() ([]byte, error)
type UserToolSessionApprovalKind ¶ added in v1.0.0
type UserToolSessionApprovalKind string
Kind discriminator for UserToolSessionApproval.
const ( UserToolSessionApprovalKindCommands UserToolSessionApprovalKind = "commands" UserToolSessionApprovalKindCustomTool UserToolSessionApprovalKind = "custom-tool" UserToolSessionApprovalKindExtensionManagement UserToolSessionApprovalKind = "extension-management" UserToolSessionApprovalKindExtensionPermissionAccess UserToolSessionApprovalKind = "extension-permission-access" UserToolSessionApprovalKindMCP UserToolSessionApprovalKind = "mcp" UserToolSessionApprovalKindMemory UserToolSessionApprovalKind = "memory" UserToolSessionApprovalKindRead UserToolSessionApprovalKind = "read" UserToolSessionApprovalKindWrite UserToolSessionApprovalKind = "write" )
type UserToolSessionApprovalMCP ¶ added in v1.0.0
type UserToolSessionApprovalMCP struct {
// MCP server name
ServerName string `json:"serverName"`
// Optional MCP tool name, or null for all tools on the server
ToolName *string `json:"toolName"`
}
Schema for the `UserToolSessionApprovalMcp` type. Experimental: UserToolSessionApprovalMCP is part of an experimental API and may change or be removed.
func (UserToolSessionApprovalMCP) Kind ¶ added in v1.0.0
func (UserToolSessionApprovalMCP) Kind() UserToolSessionApprovalKind
func (UserToolSessionApprovalMCP) MarshalJSON ¶ added in v1.0.0
func (r UserToolSessionApprovalMCP) MarshalJSON() ([]byte, error)
type UserToolSessionApprovalMemory ¶ added in v1.0.0
type UserToolSessionApprovalMemory struct {
}
Schema for the `UserToolSessionApprovalMemory` type. Experimental: UserToolSessionApprovalMemory is part of an experimental API and may change or be removed.
func (UserToolSessionApprovalMemory) Kind ¶ added in v1.0.0
func (UserToolSessionApprovalMemory) Kind() UserToolSessionApprovalKind
func (UserToolSessionApprovalMemory) MarshalJSON ¶ added in v1.0.0
func (r UserToolSessionApprovalMemory) MarshalJSON() ([]byte, error)
type UserToolSessionApprovalRead ¶ added in v1.0.0
type UserToolSessionApprovalRead struct {
}
Schema for the `UserToolSessionApprovalRead` type. Experimental: UserToolSessionApprovalRead is part of an experimental API and may change or be removed.
func (UserToolSessionApprovalRead) Kind ¶ added in v1.0.0
func (UserToolSessionApprovalRead) Kind() UserToolSessionApprovalKind
func (UserToolSessionApprovalRead) MarshalJSON ¶ added in v1.0.0
func (r UserToolSessionApprovalRead) MarshalJSON() ([]byte, error)
type UserToolSessionApprovalWrite ¶ added in v1.0.0
type UserToolSessionApprovalWrite struct {
}
Schema for the `UserToolSessionApprovalWrite` type. Experimental: UserToolSessionApprovalWrite is part of an experimental API and may change or be removed.
func (UserToolSessionApprovalWrite) Kind ¶ added in v1.0.0
func (UserToolSessionApprovalWrite) Kind() UserToolSessionApprovalKind
func (UserToolSessionApprovalWrite) MarshalJSON ¶ added in v1.0.0
func (r UserToolSessionApprovalWrite) MarshalJSON() ([]byte, error)
type WorkingDirectoryContext ¶ added in v1.0.0
type WorkingDirectoryContext struct {
// Base commit of current git branch at session start time
BaseCommit *string `json:"baseCommit,omitempty"`
// Current git branch name
Branch *string `json:"branch,omitempty"`
// Current working directory path
Cwd string `json:"cwd"`
// Root directory of the git repository, resolved via git rev-parse
GitRoot *string `json:"gitRoot,omitempty"`
// Head commit of current git branch at session start time
HeadCommit *string `json:"headCommit,omitempty"`
// Hosting platform type of the repository (github or ado)
HostType *WorkingDirectoryContextHostType `json:"hostType,omitempty"`
// Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps)
Repository *string `json:"repository,omitempty"`
// Raw host string from the git remote URL (e.g. "github.com", "mycompany.ghe.com", "dev.azure.com")
RepositoryHost *string `json:"repositoryHost,omitempty"`
}
Working directory and git context at session start
type WorkingDirectoryContextHostType ¶ added in v1.0.0
type WorkingDirectoryContextHostType string
Hosting platform type of the repository (github or ado)
const ( // Repository is hosted on Azure DevOps. WorkingDirectoryContextHostTypeADO WorkingDirectoryContextHostType = "ado" // Repository is hosted on GitHub. WorkingDirectoryContextHostTypeGitHub WorkingDirectoryContextHostType = "github" )
type WorkspaceDiffFileChange ¶ added in v1.0.0
type WorkspaceDiffFileChange struct {
// Type of change represented by this file diff.
ChangeType WorkspaceDiffFileChangeType `json:"changeType"`
// Unified diff content for the file. Empty when the diff was truncated.
Diff string `json:"diff"`
// Whether the diff content was omitted because it exceeded the per-file size limit.
IsTruncated *bool `json:"isTruncated,omitempty"`
// Original file path for renamed files.
OldPath *string `json:"oldPath,omitempty"`
// Path to the changed file, relative to the workspace root.
Path string `json:"path"`
}
A single changed file and its unified diff. Experimental: WorkspaceDiffFileChange is part of an experimental API and may change or be removed.
type WorkspaceDiffFileChangeType ¶ added in v1.0.0
type WorkspaceDiffFileChangeType string
Type of change represented by this file diff. Experimental: WorkspaceDiffFileChangeType is part of an experimental API and may change or be removed.
const ( // The file was added. WorkspaceDiffFileChangeTypeAdded WorkspaceDiffFileChangeType = "added" // The file was deleted. WorkspaceDiffFileChangeTypeDeleted WorkspaceDiffFileChangeType = "deleted" // The file was modified. WorkspaceDiffFileChangeTypeModified WorkspaceDiffFileChangeType = "modified" // The file was renamed. WorkspaceDiffFileChangeTypeRenamed WorkspaceDiffFileChangeType = "renamed" )
type WorkspaceDiffMode ¶ added in v1.0.0
type WorkspaceDiffMode string
Diff mode requested by the client. Experimental: WorkspaceDiffMode is part of an experimental API and may change or be removed.
const ( // Return changes compared with the default branch. WorkspaceDiffModeBranch WorkspaceDiffMode = "branch" // Return staged, unstaged, and untracked working tree changes. WorkspaceDiffModeUnstaged WorkspaceDiffMode = "unstaged" )
type WorkspaceDiffResult ¶ added in v1.0.0
type WorkspaceDiffResult struct {
// Default branch used for a branch diff, when branch mode was requested.
BaseBranch *string `json:"baseBranch,omitempty"`
// Changed files and their unified diffs.
Changes []WorkspaceDiffFileChange `json:"changes"`
// Whether a requested branch diff fell back to unstaged changes because branch diff failed.
IsFallback bool `json:"isFallback"`
// Effective mode used for the returned changes.
Mode WorkspaceDiffMode `json:"mode"`
// Diff mode requested by the client.
RequestedMode WorkspaceDiffMode `json:"requestedMode"`
}
Workspace diff result for the requested mode. Experimental: WorkspaceDiffResult is part of an experimental API and may change or be removed.
type WorkspaceFileChangedOperation ¶ added in v1.0.0
type WorkspaceFileChangedOperation string
Whether the file was newly created or updated
const ( // The workspace file was created. WorkspaceFileChangedOperationCreate WorkspaceFileChangedOperation = "create" // The workspace file was updated. WorkspaceFileChangedOperationUpdate WorkspaceFileChangedOperation = "update" )
type WorkspaceSummary ¶ added in v1.0.0
type WorkspaceSummary struct {
// Branch checked out at session start, if any
Branch *string `json:"branch,omitempty"`
// ISO 8601 timestamp when the workspace was created
CreatedAt *time.Time `json:"created_at,omitempty"`
// Current working directory at session start
Cwd *string `json:"cwd,omitempty"`
// Resolved git root for cwd, if any
GitRoot *string `json:"git_root,omitempty"`
// Repository host type, if known
HostType *WorkspaceSummaryHostType `json:"host_type,omitempty"`
// Workspace identifier (1:1 with sessionId)
ID string `json:"id"`
// Display name for the session, if set
Name *string `json:"name,omitempty"`
// Repository identifier in 'owner/repo' or 'org/project/repo' format, if any
Repository *string `json:"repository,omitempty"`
// ISO 8601 timestamp when the workspace was last updated
UpdatedAt *time.Time `json:"updated_at,omitempty"`
// Whether the display name was explicitly set by the user
UserNamed *bool `json:"user_named,omitempty"`
}
Public-facing projection of workspace metadata for SDK / TUI consumers Experimental: WorkspaceSummary is part of an experimental API and may change or be removed.
type WorkspaceSummaryHostType ¶ added in v1.0.0
type WorkspaceSummaryHostType string
Repository host type, if known Experimental: WorkspaceSummaryHostType is part of an experimental API and may change or be removed.
const ( // Workspace summary repository is hosted on Azure DevOps. WorkspaceSummaryHostTypeADO WorkspaceSummaryHostType = "ado" // Workspace summary repository is hosted on GitHub. WorkspaceSummaryHostTypeGitHub WorkspaceSummaryHostType = "github" )
type WorkspacesAPI ¶ added in v1.0.0
type WorkspacesAPI sessionAPI
Experimental: WorkspacesAPI contains experimental APIs that may change or be removed.
func (*WorkspacesAPI) CreateFile ¶ added in v1.0.0
func (a *WorkspacesAPI) CreateFile(ctx context.Context, params *WorkspacesCreateFileRequest) (*SessionWorkspacesCreateFileResult, error)
CreateFile creates or overwrites a file in the session workspace files directory.
RPC method: session.workspaces.createFile.
Parameters: Relative path and UTF-8 content for the workspace file to create or overwrite.
func (*WorkspacesAPI) Diff ¶ added in v1.0.0
func (a *WorkspacesAPI) Diff(ctx context.Context, params *WorkspacesDiffRequest) (*WorkspaceDiffResult, error)
Diff computes a diff for the session workspace.
RPC method: session.workspaces.diff.
Parameters: Parameters for computing a workspace diff.
Returns: Workspace diff result for the requested mode.
func (*WorkspacesAPI) GetWorkspace ¶ added in v1.0.0
func (a *WorkspacesAPI) GetWorkspace(ctx context.Context) (*WorkspacesGetWorkspaceResult, error)
GetWorkspace gets current workspace metadata for the session.
RPC method: session.workspaces.getWorkspace.
Returns: Current workspace metadata for the session, including its absolute filesystem path when available.
func (*WorkspacesAPI) ListCheckpoints ¶ added in v1.0.0
func (a *WorkspacesAPI) ListCheckpoints(ctx context.Context) (*WorkspacesListCheckpointsResult, error)
ListCheckpoints lists workspace checkpoints in chronological order.
RPC method: session.workspaces.listCheckpoints.
Returns: Workspace checkpoints in chronological order; empty when the workspace is not enabled.
func (*WorkspacesAPI) ListFiles ¶ added in v1.0.0
func (a *WorkspacesAPI) ListFiles(ctx context.Context) (*WorkspacesListFilesResult, error)
ListFiles lists files stored in the session workspace files directory.
RPC method: session.workspaces.listFiles.
Returns: Relative paths of files stored in the session workspace files directory.
func (*WorkspacesAPI) ReadCheckpoint ¶ added in v1.0.0
func (a *WorkspacesAPI) ReadCheckpoint(ctx context.Context, params *WorkspacesReadCheckpointRequest) (*WorkspacesReadCheckpointResult, error)
ReadCheckpoint reads the content of a workspace checkpoint by number.
RPC method: session.workspaces.readCheckpoint.
Parameters: Checkpoint number to read.
Returns: Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
func (*WorkspacesAPI) ReadFile ¶ added in v1.0.0
func (a *WorkspacesAPI) ReadFile(ctx context.Context, params *WorkspacesReadFileRequest) (*WorkspacesReadFileResult, error)
ReadFile reads a file from the session workspace files directory.
RPC method: session.workspaces.readFile.
Parameters: Relative path of the workspace file to read.
Returns: Contents of the requested workspace file as a UTF-8 string.
func (*WorkspacesAPI) SaveLargePaste ¶ added in v1.0.0
func (a *WorkspacesAPI) SaveLargePaste(ctx context.Context, params *WorkspacesSaveLargePasteRequest) (*WorkspacesSaveLargePasteResult, error)
SaveLargePaste saves pasted content as a UTF-8 file in the session workspace.
RPC method: session.workspaces.saveLargePaste.
Parameters: Pasted content to save as a UTF-8 file in the session workspace.
Returns: Descriptor for the saved paste file, or null when the workspace is unavailable.
type WorkspacesCheckpoints ¶ added in v1.0.0
type WorkspacesCheckpoints struct {
// Filename of the checkpoint within the workspace checkpoints directory
Filename string `json:"filename"`
// Checkpoint number assigned by the workspace manager
Number int64 `json:"number"`
// Human-readable checkpoint title
Title string `json:"title"`
}
Schema for the `WorkspacesCheckpoints` type. Experimental: WorkspacesCheckpoints is part of an experimental API and may change or be removed.
type WorkspacesCreateFileRequest ¶ added in v0.3.0
type WorkspacesCreateFileRequest struct {
// File content to write as a UTF-8 string
Content string `json:"content"`
// Relative path within the workspace files directory
Path string `json:"path"`
}
Relative path and UTF-8 content for the workspace file to create or overwrite. Experimental: WorkspacesCreateFileRequest is part of an experimental API and may change or be removed.
type WorkspacesDiffRequest ¶ added in v1.0.0
type WorkspacesDiffRequest struct {
// Diff mode requested by the client.
Mode WorkspaceDiffMode `json:"mode"`
}
Parameters for computing a workspace diff. Experimental: WorkspacesDiffRequest is part of an experimental API and may change or be removed.
type WorkspacesGetWorkspaceResult ¶ added in v0.3.0
type WorkspacesGetWorkspaceResult struct {
// Absolute filesystem path to the workspace directory. Omitted when the session has no
// workspace (e.g. remote sessions).
Path *string `json:"path,omitempty"`
// Current workspace metadata, or null if not available
Workspace *WorkspacesGetWorkspaceResultWorkspace `json:"workspace"`
}
Current workspace metadata for the session, including its absolute filesystem path when available. Experimental: WorkspacesGetWorkspaceResult is part of an experimental API and may change or be removed.
type WorkspacesGetWorkspaceResultWorkspace ¶ added in v1.0.0
type WorkspacesGetWorkspaceResultWorkspace struct {
Branch *string `json:"branch,omitempty"`
ChronicleSyncDismissed *bool `json:"chronicle_sync_dismissed,omitempty"`
ClientName *string `json:"client_name,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Cwd *string `json:"cwd,omitempty"`
GitRoot *string `json:"git_root,omitempty"`
// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration.
HostType *WorkspacesWorkspaceDetailsHostType `json:"host_type,omitempty"`
ID string `json:"id"`
McLastEventID *string `json:"mc_last_event_id,omitempty"`
McSessionID *string `json:"mc_session_id,omitempty"`
McTaskID *string `json:"mc_task_id,omitempty"`
Name *string `json:"name,omitempty"`
RemoteSteerable *bool `json:"remote_steerable,omitempty"`
Repository *string `json:"repository,omitempty"`
SummaryCount *int64 `json:"summary_count,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
UserNamed *bool `json:"user_named,omitempty"`
}
type WorkspacesListCheckpointsResult ¶ added in v1.0.0
type WorkspacesListCheckpointsResult struct {
// Workspace checkpoints in chronological order. Empty when workspace is not enabled.
Checkpoints []WorkspacesCheckpoints `json:"checkpoints"`
}
Workspace checkpoints in chronological order; empty when the workspace is not enabled. Experimental: WorkspacesListCheckpointsResult is part of an experimental API and may change or be removed.
type WorkspacesListFilesResult ¶ added in v0.3.0
type WorkspacesListFilesResult struct {
// Relative file paths in the workspace files directory
Files []string `json:"files"`
}
Relative paths of files stored in the session workspace files directory. Experimental: WorkspacesListFilesResult is part of an experimental API and may change or be removed.
type WorkspacesReadCheckpointRequest ¶ added in v1.0.0
type WorkspacesReadCheckpointRequest struct {
// Checkpoint number to read
Number int64 `json:"number"`
}
Checkpoint number to read. Experimental: WorkspacesReadCheckpointRequest is part of an experimental API and may change or be removed.
type WorkspacesReadCheckpointResult ¶ added in v1.0.0
type WorkspacesReadCheckpointResult struct {
// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing
Content *string `json:"content"`
}
Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. Experimental: WorkspacesReadCheckpointResult is part of an experimental API and may change or be removed.
type WorkspacesReadFileRequest ¶ added in v0.3.0
type WorkspacesReadFileRequest struct {
// Relative path within the workspace files directory
Path string `json:"path"`
}
Relative path of the workspace file to read. Experimental: WorkspacesReadFileRequest is part of an experimental API and may change or be removed.
type WorkspacesReadFileResult ¶ added in v0.3.0
type WorkspacesReadFileResult struct {
// File content as a UTF-8 string
Content string `json:"content"`
}
Contents of the requested workspace file as a UTF-8 string. Experimental: WorkspacesReadFileResult is part of an experimental API and may change or be removed.
type WorkspacesSaveLargePasteRequest ¶ added in v1.0.0
type WorkspacesSaveLargePasteRequest struct {
// Pasted content to save as a UTF-8 file
Content string `json:"content"`
}
Pasted content to save as a UTF-8 file in the session workspace. Experimental: WorkspacesSaveLargePasteRequest is part of an experimental API and may change or be removed.
type WorkspacesSaveLargePasteResult ¶ added in v1.0.0
type WorkspacesSaveLargePasteResult struct {
// Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime,
// non-infinite sessions, remote sessions)
Saved *WorkspacesSaveLargePasteResultSaved `json:"saved"`
}
Descriptor for the saved paste file, or null when the workspace is unavailable. Experimental: WorkspacesSaveLargePasteResult is part of an experimental API and may change or be removed.
type WorkspacesSaveLargePasteResultSaved ¶ added in v1.0.0
type WorkspacesWorkspaceDetailsHostType ¶ added in v1.0.0
type WorkspacesWorkspaceDetailsHostType string
Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. Experimental: WorkspacesWorkspaceDetailsHostType is part of an experimental API and may change or be removed.
const ( // Workspace repository is hosted on Azure DevOps. WorkspacesWorkspaceDetailsHostTypeADO WorkspacesWorkspaceDetailsHostType = "ado" // Workspace repository is hosted on GitHub. WorkspacesWorkspaceDetailsHostTypeGitHub WorkspacesWorkspaceDetailsHostType = "github" )