Skip to main content

Module types

Module types 

Source
Expand description

Protocol types shared between the SDK and the GitHub Copilot CLI. Protocol types shared between the SDK and the GitHub Copilot CLI.

These types map directly to the JSON-RPC request/response payloads defined by the GitHub Copilot CLI protocol. They are used for session configuration, event handling, tool invocations, and model queries.

Re-exports§

pub use crate::session_fs::DirEntry;
pub use crate::session_fs::DirEntryKind;
pub use crate::session_fs::FileInfo;
pub use crate::session_fs::FsError;
pub use crate::session_fs::SessionFsCapabilities;
pub use crate::session_fs::SessionFsConfig;
pub use crate::session_fs::SessionFsConventions;
pub use crate::session_fs::SessionFsProvider;
pub use crate::session_fs::SessionFsSqliteProvider;
pub use crate::session_fs::SessionFsSqliteQueryResult;
pub use crate::session_fs::SessionFsSqliteQueryType;
pub use crate::trace_context::TraceContext;
pub use crate::trace_context::TraceContextProvider;

Structs§

AttachmentLineRange
Line range for file attachments.
AttachmentSelectionPosition
Cursor position within a file selection.
AttachmentSelectionRange
Range of selected text within a file.
AzureProviderOptions
Azure-specific provider options.
CloudSessionOptions
Options for creating a remote session in the cloud.
CloudSessionRepository
GitHub repository metadata to associate with a cloud session.
CommandContext
Context passed to a CommandHandler when a registered slash command is executed by the user.
CommandDefinition
Definition of a slash command registered with the session.
CreateSessionResult
Response from session.create.
CustomAgentConfig
Configures a custom agent (sub-agent) for the session.
DefaultAgentConfig
Configures the default (built-in) agent that handles turns when no custom agent is selected.
ElicitationRequest
An incoming elicitation request from the CLI (provider side).
ElicitationResult
Result of an elicitation (interactive UI form) request.
ExitPlanModeData
Data sent by the CLI with an exitPlanMode.request RPC call.
ExtensionInfo
Stable extension identity for session participants that provide canvases.
GetAuthStatusResponse
Response from Client::get_auth_status.
GetForegroundSessionResponse
Response from session.getForeground.
GetLastSessionIdResponse
Response from session.getLastId.
GetMessagesResponse
Response from session.getMessages.
GetSessionMetadataResponse
Response from session.getMetadata.
GetStatusResponse
Response from Client::get_status.
InfiniteSessionConfig
Configures infinite sessions: persistent workspaces with automatic context-window compaction.
LargeToolOutputConfig
Configuration for large tool output handling.
ListSessionsResponse
Response from session.list.
LogOptions
Options for Session::log.
McpHttpServerConfig
Configuration for a remote MCP server (HTTP or SSE).
McpStdioServerConfig
Configuration for a local/stdio MCP server.
MemoryConfiguration
Per-session configuration for the runtime memory feature.
MessageOptions
Options for sending a user message to the agent.
Model
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Schema for the Model type.
ModelBilling
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Billing information
ModelBillingTokenPrices
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Token-level pricing information for this model
ModelBillingTokenPricesLongContext
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Long context tier pricing (available for models with extended context windows)
ModelCapabilities
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Model capabilities and limits
ModelCapabilitiesLimits
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Token limits for prompts, outputs, and context window
ModelCapabilitiesLimitsVision
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Vision-specific limits
ModelCapabilitiesSupports
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Feature flags indicating what the model supports
ModelList
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. List of Copilot models available to the resolved user, including capabilities and billing metadata.
ModelPolicy
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Policy state (if applicable)
PermissionDecisionApproveOnce
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Schema for the PermissionDecisionApproveOnce type.
PermissionDecisionReject
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Schema for the PermissionDecisionReject type.
PermissionDecisionUserNotAvailable
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. Schema for the PermissionDecisionUserNotAvailable type.
PermissionRequestData
Data sent by the CLI for permission-related events.
PingResponse
Response from the top-level ping RPC.
ProviderConfig
Configures a custom inference provider (BYOK — Bring Your Own Key).
RequestId
Opaque request identifier for pending CLI requests (permission, user-input, etc.).
ResumeSessionConfig
Configuration for resuming an existing session via the session.resume RPC.
SectionOverride
An override operation for a single system message section.
SessionCapabilities
Session-level capabilities reported by the CLI after session creation.
SessionConfig
Configuration for creating a new session via the session.create RPC.
SessionEvent
A single event in a session’s timeline.
SessionEventNotification
Wrapper for session event notifications received from the CLI.
SessionId
Opaque session identifier assigned by the CLI.
SessionLifecycleEvent
A session.lifecycle notification dispatched to subscribers obtained via Client::subscribe_lifecycle.
SessionLifecycleEventMetadata
Optional metadata attached to a SessionLifecycleEvent.
SessionListFilter
Filter options for Client::list_sessions.
SessionMetadata
Metadata for a persisted session, returned by session.list.
SetModelOptions
Options for Session::set_model.
SystemMessageConfig
Controls how the system message is constructed.
Tool
A tool that the client exposes to the Copilot agent.
ToolBinaryResult
Binary content returned by a tool.
ToolInvocation
A request from the CLI to invoke a client-defined tool.
ToolResultExpanded
Expanded tool result with metadata for the LLM and session log.
ToolResultResponse
JSON-RPC response wrapper for a tool result, sent back to the CLI.
UiCapabilities
UI-specific capabilities for a session.
UiInputOptions
Options for the SessionUi::input convenience method.

Enums§

AgentMode
The UI mode the agent is in for a given turn, used by MessageOptions::agent_mode.
Attachment
An attachment included with a user message.
ContextTier
Context window tier for models that support tiered context windows. Allowed values for the ContextTier enumeration.
DeferMode
Controls whether a Tool may be deferred (loaded lazily via tool search) rather than always pre-loaded.
DeliveryMode
Message delivery mode for MessageOptions::mode.
ElicitationMode
Elicitation display mode.
GitHubReferenceType
Type of GitHub reference attachment.
InputFormat
Semantic format hints for text input fields.
LogLevel
Severity level for Session::log messages.
McpServerConfig
Configuration for a single MCP server.
PermissionDecision
Re-exports of generated protocol types that are part of the SDK’s public API surface. The canonical definitions live in crate::rpc; they live here so the crate-root pub use types::* surfaces them alongside hand-written SDK types. The client’s response to the pending permission prompt
PermissionRequestKind
Permission categories the CLI may request approval for.
SessionLifecycleEventType
Type of SessionLifecycleEvent received via Client::subscribe_lifecycle.
ToolResult
Result of a tool invocation — either a plain text string or an expanded result.

Traits§

CommandHandler
Handler invoked when a registered slash command is executed.

Functions§

ensure_attachment_display_names
Normalize a list of attachments so every entry has a display_name.