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§
- Attachment
Line Range - Line range for file attachments.
- Attachment
Selection Position - Cursor position within a file selection.
- Attachment
Selection Range - Range of selected text within a file.
- Azure
Provider Options - Azure-specific provider options.
- Command
Context - Context passed to a
CommandHandlerwhen a registered slash command is executed by the user. - Command
Definition - Definition of a slash command registered with the session.
- Create
Session Result - Response from
session.create. - Custom
Agent Config - Configures a custom agent (sub-agent) for the session.
- Default
Agent Config - Configures the default (built-in) agent that handles turns when no custom agent is selected.
- Elicitation
Request - An incoming elicitation request from the CLI (provider side).
- Elicitation
Result - Result of an elicitation (interactive UI form) request.
- Exit
Plan Mode Data - Data sent by the CLI with an
exitPlanMode.requestRPC call. - GetAuth
Status Response - Response from
Client::get_auth_status. - GetForeground
Session Response - Response from
session.getForeground. - GetLast
Session IdResponse - Response from
session.getLastId. - GetMessages
Response - Response from
session.getMessages. - GetSession
Metadata Response - Response from
session.getMetadata. - GetStatus
Response - Response from
Client::get_status. - Infinite
Session Config - Configures infinite sessions: persistent workspaces with automatic context-window compaction.
- Input
Options - Options for the
SessionUi::inputconvenience method. - List
Sessions Response - Response from
session.list. - LogOptions
- Options for
Session::log. - McpHttp
Server Config - Configuration for a remote MCP server (HTTP or SSE).
- McpStdio
Server Config - Configuration for a local/stdio MCP server.
- Message
Options - Options for sending a user message to the agent.
- Permission
Request Data - Data sent by the CLI for permission-related events.
- Ping
Response - Response from the top-level
pingRPC. - Provider
Config - Configures a custom inference provider (BYOK — Bring Your Own Key).
- Request
Id - Opaque request identifier for pending CLI requests (permission, user-input, etc.).
- Resume
Session Config - Configuration for resuming an existing session via the
session.resumeRPC. - Section
Override - An override operation for a single system prompt section.
- Session
Capabilities - Session-level capabilities reported by the CLI after session creation.
- Session
Config - Configuration for creating a new session via the
session.createRPC. - Session
Event - A single event in a session’s timeline.
- Session
Event Notification - Wrapper for session event notifications received from the CLI.
- Session
Id - Opaque session identifier assigned by the CLI.
- Session
Lifecycle Event - A
session.lifecyclenotification dispatched to subscribers obtained viaClient::subscribe_lifecycle. - Session
Lifecycle Event Metadata - Optional metadata attached to a
SessionLifecycleEvent. - Session
List Filter - Filter options for
Client::list_sessions. - Session
Metadata - Metadata for a persisted session, returned by
session.list. - SetModel
Options - Options for
Session::set_model. - System
Message Config - Controls how the system message is constructed.
- Tool
- A tool that the client exposes to the Copilot agent.
- Tool
Invocation - A request from the CLI to invoke a client-defined tool.
- Tool
Result Expanded - Expanded tool result with metadata for the LLM and session log.
- Tool
Result Response - 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.
- Connection
State - Lifecycle state of a
Clientconnection to the CLI. - Delivery
Mode - Message delivery mode for
MessageOptions::mode. - Elicitation
Mode - Elicitation display mode.
- GitHub
Reference Type - Type of GitHub reference attachment.
- Input
Format - Semantic format hints for text input fields.
- LogLevel
- Severity level for
Session::logmessages. - McpServer
Config - Configuration for a single MCP server.
- Permission
Request Kind - Permission categories the CLI may request approval for.
- Session
Lifecycle Event Type - Type of
SessionLifecycleEventreceived viaClient::subscribe_lifecycle. - Tool
Result - Result of a tool invocation — either a plain text string or an expanded result.
Traits§
- Command
Handler - 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.