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::SessionFsConfig;
pub use crate::session_fs::SessionFsConventions;
pub use crate::session_fs::SessionFsProvider;
pub use crate::trace_context::TraceContext;
pub use crate::trace_context::TraceContextProvider;
pub use crate::generated::api_types::Model;
pub use crate::generated::api_types::ModelBilling;
pub use crate::generated::api_types::ModelCapabilities;
pub use crate::generated::api_types::ModelCapabilitiesLimits;
pub use crate::generated::api_types::ModelCapabilitiesLimitsVision;
pub use crate::generated::api_types::ModelCapabilitiesSupports;
pub use crate::generated::api_types::ModelList;
pub use crate::generated::api_types::ModelPolicy;

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.
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.
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.
InputOptions
Options for the SessionUi::input convenience method.
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.
MessageOptions
Options for sending a user message to the agent.
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 prompt 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.

Enums§

Attachment
An attachment included with a user message.
ConnectionState
Lifecycle state of a Client connection to the CLI.
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.
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.