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§
- 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.
- Cloud
Session Options - Options for creating a remote session in the cloud.
- Cloud
Session Repository - GitHub repository metadata to associate with a cloud session.
- 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. - Extension
Info - Stable extension identity for session participants that provide canvases.
- 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.
- Large
Tool Output Config - Configuration for large tool output handling.
- 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.
- Memory
Configuration - Per-session configuration for the runtime memory feature.
- Message
Options - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Schema for theModeltype. - Model
Billing - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Billing information - Model
Billing Token Prices - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Token-level pricing information for this model - Model
Billing Token Prices Long Context - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Long context tier pricing (available for models with extended context windows) - Model
Capabilities - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Model capabilities and limits - Model
Capabilities Limits - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Token limits for prompts, outputs, and context window - Model
Capabilities Limits Vision - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Vision-specific limits - Model
Capabilities Supports - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Feature flags indicating what the model supports - Model
List - 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-rootpub use types::*surfaces them alongside hand-written SDK types. List of Copilot models available to the resolved user, including capabilities and billing metadata. - Model
Policy - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Policy state (if applicable) - Permission
Decision Approve Once - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Schema for thePermissionDecisionApproveOncetype. - Permission
Decision Reject - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Schema for thePermissionDecisionRejecttype. - Permission
Decision User NotAvailable - 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-rootpub use types::*surfaces them alongside hand-written SDK types. Schema for thePermissionDecisionUserNotAvailabletype. - 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 message 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
Binary Result - Binary content returned by a tool.
- 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.
- UiInput
Options - Options for the
SessionUi::inputconvenience method.
Enums§
- Agent
Mode - The UI mode the agent is in for a given turn, used by
MessageOptions::agent_mode. - Attachment
- An attachment included with a user message.
- Context
Tier - Context window tier for models that support tiered context windows.
Allowed values for the
ContextTierenumeration. - Defer
Mode - Controls whether a
Toolmay be deferred (loaded lazily via tool search) rather than always pre-loaded. - 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
Decision - 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-rootpub use types::*surfaces them alongside hand-written SDK types. The client’s response to the pending permission prompt - 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.