Skip to main content

Module session_events

Module session_events 

Source
Expand description

Auto-generated from session-events.schema.json — do not edit manually.

Structs§

AbortData
Session event “abort”. Turn abort information including the reason for termination
AssistantIntentData
Session event “assistant.intent”. Agent intent description for current activity or plan
AssistantMessageData
Session event “assistant.message”. Assistant response containing text content, optional tool requests, and interaction metadata
AssistantMessageDeltaData
Session event “assistant.message_delta”. Streaming assistant message delta for incremental response updates
AssistantMessageStartData
Session event “assistant.message_start”. Streaming assistant message start metadata
AssistantMessageToolRequest
A tool invocation request from the assistant
AssistantReasoningData
Session event “assistant.reasoning”. Assistant reasoning content for timeline display with complete thinking text
AssistantReasoningDeltaData
Session event “assistant.reasoning_delta”. Streaming reasoning delta for incremental extended thinking updates
AssistantStreamingDeltaData
Session event “assistant.streaming_delta”. Streaming response progress with cumulative byte count
AssistantTurnEndData
Session event “assistant.turn_end”. Turn completion metadata including the turn identifier
AssistantTurnStartData
Session event “assistant.turn_start”. Turn initialization metadata including identifier and interaction tracking
AssistantUsageCopilotUsage
Per-request cost and usage data from the CAPI copilot_usage response field
AssistantUsageCopilotUsageTokenDetail
Token usage detail for a single billing category
AssistantUsageData
Session event “assistant.usage”. LLM API call usage metrics including tokens, costs, quotas, and billing information
AssistantUsageQuotaSnapshot
Schema for the AssistantUsageQuotaSnapshot type.
AutoModeSwitchCompletedData
Session event “auto_mode_switch.completed”. Auto mode switch completion notification
AutoModeSwitchRequestedData
Session event “auto_mode_switch.requested”. Auto mode switch request notification requiring user approval
CapabilitiesChangedData
Session event “capabilities.changed”. Session capability change notification
CapabilitiesChangedUI
UI capability changes
CommandCompletedData
Session event “command.completed”. Queued command completion notification signaling UI dismissal
CommandExecuteData
Session event “command.execute”. Registered command dispatch request routed to the owning client
CommandQueuedData
Session event “command.queued”. Queued slash command dispatch request for client execution
CommandsChangedCommand
Schema for the CommandsChangedCommand type.
CommandsChangedData
Session event “commands.changed”. SDK command registration change notification
CompactionCompleteCompactionTokensUsed
Token usage breakdown for the compaction LLM call (aligned with assistant.usage format)
CompactionCompleteCompactionTokensUsedCopilotUsage
Per-request cost and usage data from the CAPI copilot_usage response field
CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail
Token usage detail for a single billing category
CustomAgentsUpdatedAgent
Schema for the CustomAgentsUpdatedAgent type.
ElicitationCompletedData
Session event “elicitation.completed”. Elicitation request completion with the user’s response
ElicitationRequestedData
Session event “elicitation.requested”. Elicitation request; may be form-based (structured input) or URL-based (browser redirect)
ElicitationRequestedSchema
JSON Schema describing the form fields to present to the user (form mode only)
EmbeddedBlobResourceContents
Schema for the EmbeddedBlobResourceContents type.
EmbeddedTextResourceContents
Schema for the EmbeddedTextResourceContents type.
ExitPlanModeCompletedData
Session event “exit_plan_mode.completed”. Plan mode exit completion with the user’s approval decision and optional feedback
ExitPlanModeRequestedData
Session event “exit_plan_mode.requested”. Plan approval request with plan content and available user actions
ExtensionsLoadedExtension
Schema for the ExtensionsLoadedExtension type.
ExternalToolCompletedData
Session event “external_tool.completed”. External tool completion notification signaling UI dismissal
ExternalToolRequestedData
Session event “external_tool.requested”. External tool invocation request for client-side tool execution
HandoffRepository
Repository context for the handed-off session
HookEndData
Session event “hook.end”. Hook invocation completion details including output, success status, and error information
HookEndError
Error details when the hook failed
HookStartData
Session event “hook.start”. Hook invocation start details including type and input data
McpOauthCompletedData
Session event “mcp.oauth_completed”. MCP OAuth request completion notification
McpOauthRequiredData
Session event “mcp.oauth_required”. OAuth authentication request for an MCP server
McpOauthRequiredStaticClientConfig
Static OAuth client configuration, if the server specifies one
McpServersLoadedServer
Schema for the McpServersLoadedServer type.
ModelCallFailureData
Session event “model.call_failure”. Failed LLM API call metadata for telemetry
PendingMessagesModifiedData
Session event “pending_messages.modified”. Empty payload; the event signals that the pending message queue has changed
PermissionApproved
Schema for the PermissionApproved type.
PermissionApprovedForLocation
Schema for the PermissionApprovedForLocation type.
PermissionApprovedForSession
Schema for the PermissionApprovedForSession type.
PermissionCancelled
Schema for the PermissionCancelled type.
PermissionCompletedData
Session event “permission.completed”. Permission request completion notification signaling UI dismissal
PermissionDeniedByContentExclusionPolicy
Schema for the PermissionDeniedByContentExclusionPolicy type.
PermissionDeniedByPermissionRequestHook
Schema for the PermissionDeniedByPermissionRequestHook type.
PermissionDeniedByRules
Schema for the PermissionDeniedByRules type.
PermissionDeniedInteractivelyByUser
Schema for the PermissionDeniedInteractivelyByUser type.
PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser
Schema for the PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser type.
PermissionPromptRequestCommands
Shell command permission prompt
PermissionPromptRequestCustomTool
Custom tool invocation permission prompt
PermissionPromptRequestExtensionManagement
Extension management permission prompt
PermissionPromptRequestExtensionPermissionAccess
Extension permission access prompt
PermissionPromptRequestHook
Hook confirmation permission prompt
PermissionPromptRequestMcp
MCP tool invocation permission prompt
PermissionPromptRequestMemory
Memory operation permission prompt
PermissionPromptRequestPath
Path access permission prompt
PermissionPromptRequestRead
File read permission prompt
PermissionPromptRequestUrl
URL access permission prompt
PermissionPromptRequestWrite
File write permission prompt
PermissionRequestCustomTool
Custom tool invocation permission request
PermissionRequestExtensionManagement
Extension management permission request
PermissionRequestExtensionPermissionAccess
Extension permission access request
PermissionRequestHook
Hook confirmation permission request
PermissionRequestMcp
MCP tool invocation permission request
PermissionRequestMemory
Memory operation permission request
PermissionRequestRead
File or directory read permission request
PermissionRequestShell
Shell command permission request
PermissionRequestShellCommand
Schema for the PermissionRequestShellCommand type.
PermissionRequestShellPossibleUrl
Schema for the PermissionRequestShellPossibleUrl type.
PermissionRequestUrl
URL access permission request
PermissionRequestWrite
File write permission request
PermissionRequestedData
Session event “permission.requested”. Permission request notification requiring client approval with request details
PermissionRule
Schema for the PermissionRule type.
SamplingCompletedData
Session event “sampling.completed”. Sampling request completion notification signaling UI dismissal
SamplingRequestedData
Session event “sampling.requested”. Sampling request from an MCP server; contains the server name and a requestId for correlation
SessionBackgroundTasksChangedData
Session event “session.background_tasks_changed”.
SessionCompactionCompleteData
Session event “session.compaction_complete”. Conversation compaction results including success status, metrics, and optional error details
SessionCompactionStartData
Session event “session.compaction_start”. Context window breakdown at the start of LLM-powered conversation compaction
SessionContextChangedData
Session event “session.context_changed”. Updated working directory and git context after the change
SessionCustomAgentsUpdatedData
Session event “session.custom_agents_updated”.
SessionCustomNotificationData
Session event “session.custom_notification”. Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.
SessionErrorData
Session event “session.error”. Error details for timeline display including message and optional diagnostic information
SessionExtensionsLoadedData
Session event “session.extensions_loaded”.
SessionHandoffData
Session event “session.handoff”. Session handoff metadata including source, context, and repository information
SessionIdleData
Session event “session.idle”. Payload indicating the session is idle with no background agents in flight
SessionInfoData
Session event “session.info”. Informational message for timeline display with categorization
SessionMcpServerStatusChangedData
Session event “session.mcp_server_status_changed”.
SessionMcpServersLoadedData
Session event “session.mcp_servers_loaded”.
SessionModeChangedData
Session event “session.mode_changed”. Agent mode change details including previous and new modes
SessionModelChangeData
Session event “session.model_change”. Model change details including previous and new model identifiers
SessionPlanChangedData
Session event “session.plan_changed”. Plan file operation details indicating what changed
SessionRemoteSteerableChangedData
Session event “session.remote_steerable_changed”. Notifies that the session’s remote steering capability has changed
SessionResumeData
Session event “session.resume”. Session resume metadata including current context and event count
SessionScheduleCancelledData
Session event “session.schedule_cancelled”. Scheduled prompt cancelled from the schedule manager dialog
SessionScheduleCreatedData
Session event “session.schedule_created”. Scheduled prompt registered via /every or /after
SessionShutdownData
Session event “session.shutdown”. Session termination metrics including usage statistics, code changes, and shutdown reason
SessionSkillsLoadedData
Session event “session.skills_loaded”.
SessionSnapshotRewindData
Session event “session.snapshot_rewind”. Session rewind details including target event and count of removed events
SessionStartData
Session event “session.start”. Session initialization metadata including context and configuration
SessionTaskCompleteData
Session event “session.task_complete”. Task completion notification with summary from the agent
SessionTitleChangedData
Session event “session.title_changed”. Session title change payload containing the new display title
SessionToolsUpdatedData
Session event “session.tools_updated”.
SessionTruncationData
Session event “session.truncation”. Conversation truncation statistics including token counts and removed content metrics
SessionUsageInfoData
Session event “session.usage_info”. Current context window usage statistics including token and message counts
SessionWarningData
Session event “session.warning”. Warning message for timeline display with categorization
SessionWorkspaceFileChangedData
Session event “session.workspace_file_changed”. Workspace file change details including path and operation type
ShutdownCodeChanges
Aggregate code change metrics for the session
ShutdownModelMetric
Schema for the ShutdownModelMetric type.
ShutdownModelMetricRequests
Request count and cost metrics
ShutdownModelMetricTokenDetail
Schema for the ShutdownModelMetricTokenDetail type.
ShutdownModelMetricUsage
Token usage breakdown
ShutdownTokenDetail
Schema for the ShutdownTokenDetail type.
SkillInvokedData
Session event “skill.invoked”. Skill invocation details including content, allowed tools, and plugin metadata
SkillsLoadedSkill
Schema for the SkillsLoadedSkill type.
SubagentCompletedData
Session event “subagent.completed”. Sub-agent completion details for successful execution
SubagentDeselectedData
Session event “subagent.deselected”. Empty payload; the event signals that the custom agent was deselected, returning to the default agent
SubagentFailedData
Session event “subagent.failed”. Sub-agent failure details including error message and agent information
SubagentSelectedData
Session event “subagent.selected”. Custom agent selection details including name and available tools
SubagentStartedData
Session event “subagent.started”. Sub-agent startup details including parent tool call and agent information
SystemMessageData
Session event “system.message”. System/developer instruction content with role and optional template metadata
SystemMessageMetadata
Metadata about the prompt template and its construction
SystemNotificationData
Session event “system.notification”. System-generated notification for runtime events like background task completion
ToolExecutionCompleteContentAudio
Audio content block with base64-encoded data
ToolExecutionCompleteContentImage
Image content block with base64-encoded data
ToolExecutionCompleteContentResource
Embedded resource content block with inline text or binary data
ToolExecutionCompleteContentResourceLink
Resource link content block referencing an external resource
ToolExecutionCompleteContentResourceLinkIcon
Icon image for a resource
ToolExecutionCompleteContentTerminal
Terminal/shell output content block with optional exit code and working directory
ToolExecutionCompleteContentText
Plain text content block
ToolExecutionCompleteData
Session event “tool.execution_complete”. Tool execution completion results including success status, detailed output, and error information
ToolExecutionCompleteError
Error details when the tool execution failed
ToolExecutionCompleteResult
Tool execution result on success
ToolExecutionPartialResultData
Session event “tool.execution_partial_result”. Streaming tool execution output for incremental result display
ToolExecutionProgressData
Session event “tool.execution_progress”. Tool execution progress notification with status message
ToolExecutionStartData
Session event “tool.execution_start”. Tool execution startup details including MCP server information when applicable
ToolUserRequestedData
Session event “tool.user_requested”. User-initiated tool invocation request with tool name and arguments
TypedSessionEvent
A session event with typed data payload.
UserInputCompletedData
Session event “user_input.completed”. User input request completion with the user’s response
UserInputRequestedData
Session event “user_input.requested”. User input request notification with question and optional predefined choices
UserMessageData
Session event “user.message”.
UserToolSessionApprovalCommands
Schema for the UserToolSessionApprovalCommands type.
UserToolSessionApprovalCustomTool
Schema for the UserToolSessionApprovalCustomTool type.
UserToolSessionApprovalExtensionManagement
Schema for the UserToolSessionApprovalExtensionManagement type.
UserToolSessionApprovalExtensionPermissionAccess
Schema for the UserToolSessionApprovalExtensionPermissionAccess type.
UserToolSessionApprovalMcp
Schema for the UserToolSessionApprovalMcp type.
UserToolSessionApprovalMemory
Schema for the UserToolSessionApprovalMemory type.
UserToolSessionApprovalRead
Schema for the UserToolSessionApprovalRead type.
UserToolSessionApprovalWrite
Schema for the UserToolSessionApprovalWrite type.
WorkingDirectoryContext
Working directory and git context at session start

Enums§

AbortReason
Finite reason code describing why the current turn was aborted
AssistantMessageToolRequestType
Tool call type: “function” for standard tool calls, “custom” for grammar-based tool calls. Defaults to “function” when absent.
AssistantUsageApiEndpoint
API endpoint used for this model call, matching CAPI supported_endpoints vocabulary
AutoModeSwitchResponse
The user’s auto-mode-switch choice
ElicitationCompletedAction
The user action: “accept” (submitted form), “decline” (explicitly refused), or “cancel” (dismissed)
ElicitationRequestedMode
Elicitation mode; “form” for structured input, “url” for browser-based. Defaults to “form” when absent.
ElicitationRequestedSchemaType
Schema type indicator (always ‘object’)
ExitPlanModeAction
Exit plan mode action
ExtensionsLoadedExtensionSource
Discovery source
ExtensionsLoadedExtensionStatus
Current status: running, disabled, failed, or starting
HandoffSourceType
Origin type of the session being handed off
McpOauthRequiredStaticClientConfigGrantType
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).
McpServerSource
Configuration source: user, workspace, plugin, or builtin
McpServerStatus
Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
ModelCallFailureSource
Where the failed model call originated
PermissionApprovedForLocationKind
Approved and persisted for this project location
PermissionApprovedForSessionKind
Approved and remembered for the rest of the session
PermissionApprovedKind
The permission request was approved
PermissionCancelledKind
The permission request was cancelled before a response was used
PermissionDeniedByContentExclusionPolicyKind
Denied by the organization’s content exclusion policy
PermissionDeniedByPermissionRequestHookKind
Denied by a permission request hook registered by an extension or plugin
PermissionDeniedByRulesKind
Denied because approval rules explicitly blocked it
PermissionDeniedInteractivelyByUserKind
Denied by the user during an interactive prompt
PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUserKind
Denied because no approval rule matched and user confirmation was unavailable
PermissionPromptRequest
Derived user-facing permission prompt details for UI consumers
PermissionPromptRequestCommandsKind
Prompt kind discriminator
PermissionPromptRequestCustomToolKind
Prompt kind discriminator
PermissionPromptRequestExtensionManagementKind
Prompt kind discriminator
PermissionPromptRequestExtensionPermissionAccessKind
Prompt kind discriminator
PermissionPromptRequestHookKind
Prompt kind discriminator
PermissionPromptRequestMcpKind
Prompt kind discriminator
PermissionPromptRequestMemoryKind
Prompt kind discriminator
PermissionPromptRequestPathAccessKind
Underlying permission kind that needs path approval
PermissionPromptRequestPathKind
Prompt kind discriminator
PermissionPromptRequestReadKind
Prompt kind discriminator
PermissionPromptRequestUrlKind
Prompt kind discriminator
PermissionPromptRequestWriteKind
Prompt kind discriminator
PermissionRequest
Details of the permission being requested
PermissionRequestCustomToolKind
Permission kind discriminator
PermissionRequestExtensionManagementKind
Permission kind discriminator
PermissionRequestExtensionPermissionAccessKind
Permission kind discriminator
PermissionRequestHookKind
Permission kind discriminator
PermissionRequestMcpKind
Permission kind discriminator
PermissionRequestMemoryAction
Whether this is a store or vote memory operation
PermissionRequestMemoryDirection
Vote direction (vote only)
PermissionRequestMemoryKind
Permission kind discriminator
PermissionRequestReadKind
Permission kind discriminator
PermissionRequestShellKind
Permission kind discriminator
PermissionRequestUrlKind
Permission kind discriminator
PermissionRequestWriteKind
Permission kind discriminator
PermissionResult
The result of the permission request
PlanChangedOperation
The type of operation performed on the plan file
ReasoningSummary
Reasoning summary mode used for model calls, if applicable (e.g. “none”, “concise”, “detailed”)
SessionEventData
Typed session event data, discriminated by the event type field.
SessionEventType
Identifies the kind of session event.
SessionMode
The session mode the agent is operating in
ShutdownType
Whether the session ended normally (“routine”) or due to a crash/fatal error (“error”)
SkillSource
Source location type (e.g., project, personal-copilot, plugin, builtin)
SystemMessageRole
Message role: “system” for system prompts, “developer” for developer-injected instructions
ToolExecutionCompleteContent
A content block within a tool result, which may be text, terminal output, image, audio, or a resource
ToolExecutionCompleteContentAudioType
Content block type discriminator
ToolExecutionCompleteContentImageType
Content block type discriminator
ToolExecutionCompleteContentResourceDetails
The embedded resource contents, either text or base64-encoded binary
ToolExecutionCompleteContentResourceLinkIconTheme
Theme variant this icon is intended for
ToolExecutionCompleteContentResourceLinkType
Content block type discriminator
ToolExecutionCompleteContentResourceType
Content block type discriminator
ToolExecutionCompleteContentTerminalType
Content block type discriminator
ToolExecutionCompleteContentTextType
Content block type discriminator
UserMessageAgentMode
The agent mode that was active when this message was sent
UserToolSessionApproval
The approval to add as a session-scoped rule
UserToolSessionApprovalCommandsKind
Command approval kind
UserToolSessionApprovalCustomToolKind
Custom tool approval kind
UserToolSessionApprovalExtensionManagementKind
Extension management approval kind
UserToolSessionApprovalExtensionPermissionAccessKind
Extension permission access approval kind
UserToolSessionApprovalMcpKind
MCP tool approval kind
UserToolSessionApprovalMemoryKind
Memory approval kind
UserToolSessionApprovalReadKind
Read approval kind
UserToolSessionApprovalWriteKind
Write approval kind
WorkingDirectoryContextHostType
Hosting platform type of the repository (github or ado)
WorkspaceFileChangedOperation
Whether the file was newly created or updated