rpc

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountGetQuotaResult

type AccountGetQuotaResult struct {
	// Quota snapshots keyed by type (e.g., chat, completions, premium_interactions)
	QuotaSnapshots map[string]QuotaSnapshot `json:"quotaSnapshots"`
}

type Action added in v0.2.0

type Action string

The user's response: accept (submitted), decline (rejected), or cancel (dismissed)

const (
	ActionAccept  Action = "accept"
	ActionCancel  Action = "cancel"
	ActionDecline Action = "decline"
)

type AgentRpcApi added in v0.1.28

type AgentRpcApi struct {
	// contains filtered or unexported fields
}

Experimental: AgentRpcApi contains experimental APIs that may change or be removed.

func (*AgentRpcApi) Deselect added in v0.1.28

func (*AgentRpcApi) GetCurrent added in v0.1.28

func (*AgentRpcApi) List added in v0.1.28

func (*AgentRpcApi) Reload added in v0.2.0

func (*AgentRpcApi) Select added in v0.1.28

type AnyOf added in v0.2.0

type AnyOf struct {
	Const string `json:"const"`
	Title string `json:"title"`
}

type Billing

type Billing struct {
	// Billing cost multiplier relative to the base rate
	Multiplier float64 `json:"multiplier"`
}

Billing information

type Capabilities

type Capabilities struct {
	// Token limits for prompts, outputs, and context window
	Limits Limits `json:"limits"`
	// Feature flags indicating what the model supports
	Supports Supports `json:"supports"`
}

Model capabilities and limits

type CommandsRpcApi added in v0.2.0

type CommandsRpcApi struct {
	// contains filtered or unexported fields
}

func (*CommandsRpcApi) HandlePendingCommand added in v0.2.0

type CompactionRpcApi added in v0.1.28

type CompactionRpcApi struct {
	// contains filtered or unexported fields
}

Experimental: CompactionRpcApi contains experimental APIs that may change or be removed.

func (*CompactionRpcApi) Compact added in v0.1.28

type Content added in v0.2.0

type Content struct {
	Bool        *bool
	Double      *float64
	String      *string
	StringArray []string
}

type Extension added in v0.2.0

type Extension struct {
	// Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper')
	ID string `json:"id"`
	// Extension name (directory name)
	Name string `json:"name"`
	// Process ID if the extension is running
	PID *int64 `json:"pid,omitempty"`
	// Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/)
	Source Source `json:"source"`
	// Current status: running, disabled, failed, or starting
	Status ExtensionStatus `json:"status"`
}

type ExtensionStatus added in v0.2.0

type ExtensionStatus string

Current status: running, disabled, failed, or starting

const (
	ExtensionStatusDisabled ExtensionStatus = "disabled"
	ExtensionStatusFailed   ExtensionStatus = "failed"
	ExtensionStatusRunning  ExtensionStatus = "running"
	ExtensionStatusStarting ExtensionStatus = "starting"
)

type ExtensionsRpcApi added in v0.2.0

type ExtensionsRpcApi struct {
	// contains filtered or unexported fields
}

Experimental: ExtensionsRpcApi contains experimental APIs that may change or be removed.

func (*ExtensionsRpcApi) Disable added in v0.2.0

func (*ExtensionsRpcApi) Enable added in v0.2.0

func (*ExtensionsRpcApi) List added in v0.2.0

func (*ExtensionsRpcApi) Reload added in v0.2.0

type FleetRpcApi added in v0.1.25

type FleetRpcApi struct {
	// contains filtered or unexported fields
}

Experimental: FleetRpcApi contains experimental APIs that may change or be removed.

func (*FleetRpcApi) Start added in v0.1.25

type Format added in v0.2.0

type Format string
const (
	FormatDate     Format = "date"
	FormatDateTime Format = "date-time"
	FormatEmail    Format = "email"
	FormatUri      Format = "uri"
)

type Items added in v0.2.0

type Items struct {
	Enum  []string   `json:"enum,omitempty"`
	Type  *ItemsType `json:"type,omitempty"`
	AnyOf []AnyOf    `json:"anyOf,omitempty"`
}

type ItemsType added in v0.2.0

type ItemsType string
const (
	ItemsTypeString ItemsType = "string"
)

type Kind added in v0.1.31

type Kind string
const (
	KindApproved                                       Kind = "approved"
	KindDeniedByContentExclusionPolicy                 Kind = "denied-by-content-exclusion-policy"
	KindDeniedByRules                                  Kind = "denied-by-rules"
	KindDeniedInteractivelyByUser                      Kind = "denied-interactively-by-user"
	KindDeniedNoApprovalRuleAndCouldNotRequestFromUser Kind = "denied-no-approval-rule-and-could-not-request-from-user"
)

type Level added in v0.2.0

type Level string

Log severity level. Determines how the message is displayed in the timeline. Defaults to "info".

const (
	LevelError   Level = "error"
	LevelInfo    Level = "info"
	LevelWarning Level = "warning"
)

type Limits

type Limits struct {
	// Maximum total context window size in tokens
	MaxContextWindowTokens float64 `json:"max_context_window_tokens"`
	// Maximum number of output/completion tokens
	MaxOutputTokens *float64 `json:"max_output_tokens,omitempty"`
	// Maximum number of prompt/input tokens
	MaxPromptTokens *float64 `json:"max_prompt_tokens,omitempty"`
}

Token limits for prompts, outputs, and context window

type McpRpcApi added in v0.2.0

type McpRpcApi struct {
	// contains filtered or unexported fields
}

Experimental: McpRpcApi contains experimental APIs that may change or be removed.

func (*McpRpcApi) Disable added in v0.2.0

func (*McpRpcApi) Enable added in v0.2.0

func (*McpRpcApi) List added in v0.2.0

func (*McpRpcApi) Reload added in v0.2.0

type Mode added in v0.1.25

type Mode string

The current agent mode.

The agent mode after switching.

The mode to switch to. Valid values: "interactive", "plan", "autopilot".

const (
	ModeAutopilot   Mode = "autopilot"
	ModeInteractive Mode = "interactive"
	ModePlan        Mode = "plan"
)

type ModeRpcApi added in v0.1.25

type ModeRpcApi struct {
	// contains filtered or unexported fields
}

func (*ModeRpcApi) Get added in v0.1.25

func (*ModeRpcApi) Set added in v0.1.25

type Model

type Model struct {
	// Billing information
	Billing *Billing `json:"billing,omitempty"`
	// Model capabilities and limits
	Capabilities Capabilities `json:"capabilities"`
	// Default reasoning effort level (only present if model supports reasoning effort)
	DefaultReasoningEffort *string `json:"defaultReasoningEffort,omitempty"`
	// Model identifier (e.g., "claude-sonnet-4.5")
	ID string `json:"id"`
	// Display name
	Name string `json:"name"`
	// Policy state (if applicable)
	Policy *Policy `json:"policy,omitempty"`
	// Supported reasoning effort levels (only present if model supports reasoning effort)
	SupportedReasoningEfforts []string `json:"supportedReasoningEfforts,omitempty"`
}

type ModelRpcApi

type ModelRpcApi struct {
	// contains filtered or unexported fields
}

func (*ModelRpcApi) GetCurrent

func (*ModelRpcApi) SwitchTo

type ModelsListResult

type ModelsListResult struct {
	// List of available models with full metadata
	Models []Model `json:"models"`
}

type OneOf added in v0.2.0

type OneOf struct {
	Const string `json:"const"`
	Title string `json:"title"`
}

type PermissionsRpcApi added in v0.1.31

type PermissionsRpcApi struct {
	// contains filtered or unexported fields
}

type PingParams

type PingParams struct {
	// Optional message to echo back
	Message *string `json:"message,omitempty"`
}

type PingResult

type PingResult struct {
	// Echoed message (or default greeting)
	Message string `json:"message"`
	// Server protocol version number
	ProtocolVersion float64 `json:"protocolVersion"`
	// Server timestamp in milliseconds
	Timestamp float64 `json:"timestamp"`
}

type PlanRpcApi added in v0.1.25

type PlanRpcApi struct {
	// contains filtered or unexported fields
}

func (*PlanRpcApi) Delete added in v0.1.25

func (*PlanRpcApi) Read added in v0.1.25

func (*PlanRpcApi) Update added in v0.1.25

type Plugin added in v0.2.0

type Plugin struct {
	// Whether the plugin is currently enabled
	Enabled bool `json:"enabled"`
	// Marketplace the plugin came from
	Marketplace string `json:"marketplace"`
	// Plugin name
	Name string `json:"name"`
	// Installed version
	Version *string `json:"version,omitempty"`
}

type PluginsRpcApi added in v0.2.0

type PluginsRpcApi struct {
	// contains filtered or unexported fields
}

Experimental: PluginsRpcApi contains experimental APIs that may change or be removed.

func (*PluginsRpcApi) List added in v0.2.0

type Policy

type Policy struct {
	// Current policy state for this model
	State string `json:"state"`
	// Usage terms or conditions for this model
	Terms string `json:"terms"`
}

Policy state (if applicable)

type Property added in v0.2.0

type Property struct {
	Default     *Content     `json:"default"`
	Description *string      `json:"description,omitempty"`
	Enum        []string     `json:"enum,omitempty"`
	EnumNames   []string     `json:"enumNames,omitempty"`
	Title       *string      `json:"title,omitempty"`
	Type        PropertyType `json:"type"`
	OneOf       []OneOf      `json:"oneOf,omitempty"`
	Items       *Items       `json:"items,omitempty"`
	MaxItems    *float64     `json:"maxItems,omitempty"`
	MinItems    *float64     `json:"minItems,omitempty"`
	Format      *Format      `json:"format,omitempty"`
	MaxLength   *float64     `json:"maxLength,omitempty"`
	MinLength   *float64     `json:"minLength,omitempty"`
	Maximum     *float64     `json:"maximum,omitempty"`
	Minimum     *float64     `json:"minimum,omitempty"`
}

type PropertyType added in v0.2.0

type PropertyType string
const (
	PropertyTypeArray   PropertyType = "array"
	PropertyTypeBoolean PropertyType = "boolean"
	PropertyTypeString  PropertyType = "string"
	PropertyTypeInteger PropertyType = "integer"
	PropertyTypeNumber  PropertyType = "number"
)

type QuotaSnapshot

type QuotaSnapshot struct {
	// Number of requests included in the entitlement
	EntitlementRequests float64 `json:"entitlementRequests"`
	// Number of overage requests made this period
	Overage float64 `json:"overage"`
	// Whether pay-per-request usage is allowed when quota is exhausted
	OverageAllowedWithExhaustedQuota bool `json:"overageAllowedWithExhaustedQuota"`
	// Percentage of entitlement remaining
	RemainingPercentage float64 `json:"remainingPercentage"`
	// Date when the quota resets (ISO 8601)
	ResetDate *string `json:"resetDate,omitempty"`
	// Number of requests used so far this period
	UsedRequests float64 `json:"usedRequests"`
}

type RequestedSchema added in v0.2.0

type RequestedSchema struct {
	// Form field definitions, keyed by field name
	Properties map[string]Property `json:"properties"`
	// List of required field names
	Required []string `json:"required,omitempty"`
	// Schema type indicator (always 'object')
	Type RequestedSchemaType `json:"type"`
}

JSON Schema describing the form fields to present to the user

type RequestedSchemaType added in v0.2.0

type RequestedSchemaType string
const (
	RequestedSchemaTypeObject RequestedSchemaType = "object"
)

type ResultResult added in v0.1.31

type ResultResult struct {
	Error            *string                `json:"error,omitempty"`
	ResultType       *string                `json:"resultType,omitempty"`
	TextResultForLlm string                 `json:"textResultForLlm"`
	ToolTelemetry    map[string]interface{} `json:"toolTelemetry,omitempty"`
}

type ResultUnion added in v0.1.31

type ResultUnion struct {
	ResultResult *ResultResult
	String       *string
}

func (ResultUnion) MarshalJSON added in v0.1.31

func (r ResultUnion) MarshalJSON() ([]byte, error)

MarshalJSON serializes ResultUnion as the appropriate JSON variant: a plain string when String is set, or the ResultResult object otherwise. The generated struct has no custom marshaler, so without this the Go struct fields would serialize as {"ResultResult":...,"String":...} instead of the union the server expects.

func (*ResultUnion) UnmarshalJSON added in v0.1.31

func (r *ResultUnion) UnmarshalJSON(data []byte) error

UnmarshalJSON deserializes a JSON value into the appropriate ResultUnion variant.

type Server added in v0.2.0

type Server struct {
	// Error message if the server failed to connect
	Error *string `json:"error,omitempty"`
	// Server name (config key)
	Name string `json:"name"`
	// Configuration source: user, workspace, plugin, or builtin
	Source *string `json:"source,omitempty"`
	// Connection status: connected, failed, pending, disabled, or not_configured
	Status ServerStatus `json:"status"`
}

type ServerAccountRpcApi added in v0.1.31

type ServerAccountRpcApi struct {
	// contains filtered or unexported fields
}

func (*ServerAccountRpcApi) GetQuota added in v0.1.31

type ServerModelsRpcApi added in v0.1.31

type ServerModelsRpcApi struct {
	// contains filtered or unexported fields
}

func (*ServerModelsRpcApi) List added in v0.1.31

type ServerRpc

type ServerRpc struct {
	Models  *ServerModelsRpcApi
	Tools   *ServerToolsRpcApi
	Account *ServerAccountRpcApi
	// contains filtered or unexported fields
}

ServerRpc provides typed server-scoped RPC methods.

func NewServerRpc

func NewServerRpc(client *jsonrpc2.Client) *ServerRpc

func (*ServerRpc) Ping

func (a *ServerRpc) Ping(ctx context.Context, params *PingParams) (*PingResult, error)

type ServerStatus added in v0.2.0

type ServerStatus string

Connection status: connected, failed, pending, disabled, or not_configured

const (
	ServerStatusConnected     ServerStatus = "connected"
	ServerStatusNotConfigured ServerStatus = "not_configured"
	ServerStatusPending       ServerStatus = "pending"
	ServerStatusDisabled      ServerStatus = "disabled"
	ServerStatusFailed        ServerStatus = "failed"
)

type ServerToolsRpcApi added in v0.1.31

type ServerToolsRpcApi struct {
	// contains filtered or unexported fields
}

func (*ServerToolsRpcApi) List added in v0.1.31

type SessionAgentDeselectResult added in v0.1.28

type SessionAgentDeselectResult struct {
}

Experimental: SessionAgentDeselectResult is part of an experimental API and may change or be removed.

type SessionAgentGetCurrentResult added in v0.1.28

type SessionAgentGetCurrentResult struct {
	// Currently selected custom agent, or null if using the default agent
	Agent *SessionAgentGetCurrentResultAgent `json:"agent"`
}

Experimental: SessionAgentGetCurrentResult is part of an experimental API and may change or be removed.

type SessionAgentGetCurrentResultAgent added in v0.1.28

type SessionAgentGetCurrentResultAgent struct {
	// Description of the agent's purpose
	Description string `json:"description"`
	// Human-readable display name
	DisplayName string `json:"displayName"`
	// Unique identifier of the custom agent
	Name string `json:"name"`
}

type SessionAgentListResult added in v0.1.28

type SessionAgentListResult struct {
	// Available custom agents
	Agents []SessionAgentListResultAgent `json:"agents"`
}

Experimental: SessionAgentListResult is part of an experimental API and may change or be removed.

type SessionAgentListResultAgent added in v0.2.0

type SessionAgentListResultAgent struct {
	// Description of the agent's purpose
	Description string `json:"description"`
	// Human-readable display name
	DisplayName string `json:"displayName"`
	// Unique identifier of the custom agent
	Name string `json:"name"`
}

type SessionAgentReloadResult added in v0.2.0

type SessionAgentReloadResult struct {
	// Reloaded custom agents
	Agents []SessionAgentReloadResultAgent `json:"agents"`
}

Experimental: SessionAgentReloadResult is part of an experimental API and may change or be removed.

type SessionAgentReloadResultAgent added in v0.2.0

type SessionAgentReloadResultAgent struct {
	// Description of the agent's purpose
	Description string `json:"description"`
	// Human-readable display name
	DisplayName string `json:"displayName"`
	// Unique identifier of the custom agent
	Name string `json:"name"`
}

type SessionAgentSelectParams added in v0.1.28

type SessionAgentSelectParams struct {
	// Name of the custom agent to select
	Name string `json:"name"`
}

Experimental: SessionAgentSelectParams is part of an experimental API and may change or be removed.

type SessionAgentSelectResult added in v0.1.28

type SessionAgentSelectResult struct {
	// The newly selected custom agent
	Agent SessionAgentSelectResultAgent `json:"agent"`
}

Experimental: SessionAgentSelectResult is part of an experimental API and may change or be removed.

type SessionAgentSelectResultAgent added in v0.1.28

type SessionAgentSelectResultAgent struct {
	// Description of the agent's purpose
	Description string `json:"description"`
	// Human-readable display name
	DisplayName string `json:"displayName"`
	// Unique identifier of the custom agent
	Name string `json:"name"`
}

The newly selected custom agent

type SessionCommandsHandlePendingCommandParams added in v0.2.0

type SessionCommandsHandlePendingCommandParams struct {
	// Error message if the command handler failed
	Error *string `json:"error,omitempty"`
	// Request ID from the command invocation event
	RequestID string `json:"requestId"`
}

type SessionCommandsHandlePendingCommandResult added in v0.2.0

type SessionCommandsHandlePendingCommandResult struct {
	Success bool `json:"success"`
}

type SessionCompactionCompactResult added in v0.1.28

type SessionCompactionCompactResult struct {
	// Number of messages removed during compaction
	MessagesRemoved float64 `json:"messagesRemoved"`
	// Whether compaction completed successfully
	Success bool `json:"success"`
	// Number of tokens freed by compaction
	TokensRemoved float64 `json:"tokensRemoved"`
}

Experimental: SessionCompactionCompactResult is part of an experimental API and may change or be removed.

type SessionExtensionsDisableParams added in v0.2.0

type SessionExtensionsDisableParams struct {
	// Source-qualified extension ID to disable
	ID string `json:"id"`
}

Experimental: SessionExtensionsDisableParams is part of an experimental API and may change or be removed.

type SessionExtensionsDisableResult added in v0.2.0

type SessionExtensionsDisableResult struct {
}

Experimental: SessionExtensionsDisableResult is part of an experimental API and may change or be removed.

type SessionExtensionsEnableParams added in v0.2.0

type SessionExtensionsEnableParams struct {
	// Source-qualified extension ID to enable
	ID string `json:"id"`
}

Experimental: SessionExtensionsEnableParams is part of an experimental API and may change or be removed.

type SessionExtensionsEnableResult added in v0.2.0

type SessionExtensionsEnableResult struct {
}

Experimental: SessionExtensionsEnableResult is part of an experimental API and may change or be removed.

type SessionExtensionsListResult added in v0.2.0

type SessionExtensionsListResult struct {
	// Discovered extensions and their current status
	Extensions []Extension `json:"extensions"`
}

Experimental: SessionExtensionsListResult is part of an experimental API and may change or be removed.

type SessionExtensionsReloadResult added in v0.2.0

type SessionExtensionsReloadResult struct {
}

Experimental: SessionExtensionsReloadResult is part of an experimental API and may change or be removed.

type SessionFleetStartParams added in v0.1.25

type SessionFleetStartParams struct {
	// Optional user prompt to combine with fleet instructions
	Prompt *string `json:"prompt,omitempty"`
}

Experimental: SessionFleetStartParams is part of an experimental API and may change or be removed.

type SessionFleetStartResult added in v0.1.25

type SessionFleetStartResult struct {
	// Whether fleet mode was successfully activated
	Started bool `json:"started"`
}

Experimental: SessionFleetStartResult is part of an experimental API and may change or be removed.

type SessionLogParams added in v0.2.0

type SessionLogParams struct {
	// When true, the message is transient and not persisted to the session event log on disk
	Ephemeral *bool `json:"ephemeral,omitempty"`
	// Log severity level. Determines how the message is displayed in the timeline. Defaults to
	// "info".
	Level *Level `json:"level,omitempty"`
	// Human-readable message
	Message string `json:"message"`
	// Optional URL the user can open in their browser for more details
	URL *string `json:"url,omitempty"`
}

type SessionLogResult added in v0.2.0

type SessionLogResult struct {
	// The unique identifier of the emitted session event
	EventID string `json:"eventId"`
}

type SessionMCPDisableParams added in v0.2.0

type SessionMCPDisableParams struct {
	// Name of the MCP server to disable
	ServerName string `json:"serverName"`
}

type SessionMCPDisableResult added in v0.2.0

type SessionMCPDisableResult struct {
}

type SessionMCPEnableParams added in v0.2.0

type SessionMCPEnableParams struct {
	// Name of the MCP server to enable
	ServerName string `json:"serverName"`
}

type SessionMCPEnableResult added in v0.2.0

type SessionMCPEnableResult struct {
}

type SessionMCPListResult added in v0.2.0

type SessionMCPListResult struct {
	// Configured MCP servers
	Servers []Server `json:"servers"`
}

type SessionMCPReloadResult added in v0.2.0

type SessionMCPReloadResult struct {
}

type SessionModeGetResult added in v0.1.25

type SessionModeGetResult struct {
	// The current agent mode.
	Mode Mode `json:"mode"`
}

type SessionModeSetParams added in v0.1.25

type SessionModeSetParams struct {
	// The mode to switch to. Valid values: "interactive", "plan", "autopilot".
	Mode Mode `json:"mode"`
}

type SessionModeSetResult added in v0.1.25

type SessionModeSetResult struct {
	// The agent mode after switching.
	Mode Mode `json:"mode"`
}

type SessionModelGetCurrentResult

type SessionModelGetCurrentResult struct {
	// Currently active model identifier
	ModelID *string `json:"modelId,omitempty"`
}

type SessionModelSwitchToParams

type SessionModelSwitchToParams struct {
	// Model identifier to switch to
	ModelID string `json:"modelId"`
	// Reasoning effort level to use for the model
	ReasoningEffort *string `json:"reasoningEffort,omitempty"`
}

type SessionModelSwitchToResult

type SessionModelSwitchToResult struct {
	// Currently active model identifier after the switch
	ModelID *string `json:"modelId,omitempty"`
}

type SessionPermissionsHandlePendingPermissionRequestParams added in v0.1.31

type SessionPermissionsHandlePendingPermissionRequestParams struct {
	RequestID string                                                       `json:"requestId"`
	Result    SessionPermissionsHandlePendingPermissionRequestParamsResult `json:"result"`
}

type SessionPermissionsHandlePendingPermissionRequestParamsResult added in v0.1.31

type SessionPermissionsHandlePendingPermissionRequestParamsResult struct {
	Kind     Kind          `json:"kind"`
	Rules    []interface{} `json:"rules,omitempty"`
	Feedback *string       `json:"feedback,omitempty"`
	Message  *string       `json:"message,omitempty"`
	Path     *string       `json:"path,omitempty"`
}

type SessionPermissionsHandlePendingPermissionRequestResult added in v0.1.31

type SessionPermissionsHandlePendingPermissionRequestResult struct {
	// Whether the permission request was handled successfully
	Success bool `json:"success"`
}

type SessionPlanDeleteResult added in v0.1.25

type SessionPlanDeleteResult struct {
}

type SessionPlanReadResult added in v0.1.25

type SessionPlanReadResult struct {
	// The content of the plan file, or null if it does not exist
	Content *string `json:"content"`
	// Whether the plan file exists in the workspace
	Exists bool `json:"exists"`
	// Absolute file path of the plan file, or null if workspace is not enabled
	Path *string `json:"path"`
}

type SessionPlanUpdateParams added in v0.1.25

type SessionPlanUpdateParams struct {
	// The new content for the plan file
	Content string `json:"content"`
}

type SessionPlanUpdateResult added in v0.1.25

type SessionPlanUpdateResult struct {
}

type SessionPluginsListResult added in v0.2.0

type SessionPluginsListResult struct {
	// Installed plugins
	Plugins []Plugin `json:"plugins"`
}

Experimental: SessionPluginsListResult is part of an experimental API and may change or be removed.

type SessionRpc

type SessionRpc struct {
	Model       *ModelRpcApi
	Mode        *ModeRpcApi
	Plan        *PlanRpcApi
	Workspace   *WorkspaceRpcApi
	Fleet       *FleetRpcApi
	Agent       *AgentRpcApi
	Skills      *SkillsRpcApi
	Mcp         *McpRpcApi
	Plugins     *PluginsRpcApi
	Extensions  *ExtensionsRpcApi
	Compaction  *CompactionRpcApi
	Tools       *ToolsRpcApi
	Commands    *CommandsRpcApi
	Ui          *UiRpcApi
	Permissions *PermissionsRpcApi
	Shell       *ShellRpcApi
	// contains filtered or unexported fields
}

SessionRpc provides typed session-scoped RPC methods.

func NewSessionRpc

func NewSessionRpc(client *jsonrpc2.Client, sessionID string) *SessionRpc

func (*SessionRpc) Log added in v0.2.0

type SessionShellExecParams added in v0.2.0

type SessionShellExecParams struct {
	// Shell command to execute
	Command string `json:"command"`
	// Working directory (defaults to session working directory)
	Cwd *string `json:"cwd,omitempty"`
	// Timeout in milliseconds (default: 30000)
	Timeout *float64 `json:"timeout,omitempty"`
}

type SessionShellExecResult added in v0.2.0

type SessionShellExecResult struct {
	// Unique identifier for tracking streamed output
	ProcessID string `json:"processId"`
}

type SessionShellKillParams added in v0.2.0

type SessionShellKillParams struct {
	// Process identifier returned by shell.exec
	ProcessID string `json:"processId"`
	// Signal to send (default: SIGTERM)
	Signal *Signal `json:"signal,omitempty"`
}

type SessionShellKillResult added in v0.2.0

type SessionShellKillResult struct {
	// Whether the signal was sent successfully
	Killed bool `json:"killed"`
}

type SessionSkillsDisableParams added in v0.2.0

type SessionSkillsDisableParams struct {
	// Name of the skill to disable
	Name string `json:"name"`
}

Experimental: SessionSkillsDisableParams is part of an experimental API and may change or be removed.

type SessionSkillsDisableResult added in v0.2.0

type SessionSkillsDisableResult struct {
}

Experimental: SessionSkillsDisableResult is part of an experimental API and may change or be removed.

type SessionSkillsEnableParams added in v0.2.0

type SessionSkillsEnableParams struct {
	// Name of the skill to enable
	Name string `json:"name"`
}

Experimental: SessionSkillsEnableParams is part of an experimental API and may change or be removed.

type SessionSkillsEnableResult added in v0.2.0

type SessionSkillsEnableResult struct {
}

Experimental: SessionSkillsEnableResult is part of an experimental API and may change or be removed.

type SessionSkillsListResult added in v0.2.0

type SessionSkillsListResult struct {
	// Available skills
	Skills []Skill `json:"skills"`
}

Experimental: SessionSkillsListResult is part of an experimental API and may change or be removed.

type SessionSkillsReloadResult added in v0.2.0

type SessionSkillsReloadResult struct {
}

Experimental: SessionSkillsReloadResult is part of an experimental API and may change or be removed.

type SessionToolsHandlePendingToolCallParams added in v0.1.31

type SessionToolsHandlePendingToolCallParams struct {
	Error     *string      `json:"error,omitempty"`
	RequestID string       `json:"requestId"`
	Result    *ResultUnion `json:"result"`
}

type SessionToolsHandlePendingToolCallResult added in v0.1.31

type SessionToolsHandlePendingToolCallResult struct {
	// Whether the tool call result was handled successfully
	Success bool `json:"success"`
}

type SessionUIElicitationParams added in v0.2.0

type SessionUIElicitationParams struct {
	// Message describing what information is needed from the user
	Message string `json:"message"`
	// JSON Schema describing the form fields to present to the user
	RequestedSchema RequestedSchema `json:"requestedSchema"`
}

type SessionUIElicitationResult added in v0.2.0

type SessionUIElicitationResult struct {
	// The user's response: accept (submitted), decline (rejected), or cancel (dismissed)
	Action Action `json:"action"`
	// The form values submitted by the user (present when action is 'accept')
	Content map[string]*Content `json:"content,omitempty"`
}

type SessionWorkspaceCreateFileParams added in v0.1.25

type SessionWorkspaceCreateFileParams struct {
	// File content to write as a UTF-8 string
	Content string `json:"content"`
	// Relative path within the workspace files directory
	Path string `json:"path"`
}

type SessionWorkspaceCreateFileResult added in v0.1.25

type SessionWorkspaceCreateFileResult struct {
}

type SessionWorkspaceListFilesResult added in v0.1.25

type SessionWorkspaceListFilesResult struct {
	// Relative file paths in the workspace files directory
	Files []string `json:"files"`
}

type SessionWorkspaceReadFileParams added in v0.1.25

type SessionWorkspaceReadFileParams struct {
	// Relative path within the workspace files directory
	Path string `json:"path"`
}

type SessionWorkspaceReadFileResult added in v0.1.25

type SessionWorkspaceReadFileResult struct {
	// File content as a UTF-8 string
	Content string `json:"content"`
}

type ShellRpcApi added in v0.2.0

type ShellRpcApi struct {
	// contains filtered or unexported fields
}

func (*ShellRpcApi) Exec added in v0.2.0

func (*ShellRpcApi) Kill added in v0.2.0

type Signal added in v0.2.0

type Signal string

Signal to send (default: SIGTERM)

const (
	SignalSIGINT  Signal = "SIGINT"
	SignalSIGKILL Signal = "SIGKILL"
	SignalSIGTERM Signal = "SIGTERM"
)

type Skill added in v0.2.0

type Skill struct {
	// Description of what the skill does
	Description string `json:"description"`
	// Whether the skill is currently enabled
	Enabled bool `json:"enabled"`
	// Unique identifier for the skill
	Name string `json:"name"`
	// Absolute path to the skill file
	Path *string `json:"path,omitempty"`
	// Source location type (e.g., project, personal, plugin)
	Source string `json:"source"`
	// Whether the skill can be invoked by the user as a slash command
	UserInvocable bool `json:"userInvocable"`
}

type SkillsRpcApi added in v0.2.0

type SkillsRpcApi struct {
	// contains filtered or unexported fields
}

Experimental: SkillsRpcApi contains experimental APIs that may change or be removed.

func (*SkillsRpcApi) Disable added in v0.2.0

func (*SkillsRpcApi) Enable added in v0.2.0

func (*SkillsRpcApi) List added in v0.2.0

func (*SkillsRpcApi) Reload added in v0.2.0

type Source added in v0.2.0

type Source string

Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/)

const (
	SourceProject Source = "project"
	SourceUser    Source = "user"
)

type Supports

type Supports struct {
	// Whether this model supports reasoning effort configuration
	ReasoningEffort *bool `json:"reasoningEffort,omitempty"`
	// Whether this model supports vision/image input
	Vision *bool `json:"vision,omitempty"`
}

Feature flags indicating what the model supports

type Tool

type Tool struct {
	// Description of what the tool does
	Description string `json:"description"`
	// Optional instructions for how to use this tool effectively
	Instructions *string `json:"instructions,omitempty"`
	// Tool identifier (e.g., "bash", "grep", "str_replace_editor")
	Name string `json:"name"`
	// Optional namespaced name for declarative filtering (e.g., "playwright/navigate" for MCP
	// tools)
	NamespacedName *string `json:"namespacedName,omitempty"`
	// JSON Schema for the tool's input parameters
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

type ToolsListParams

type ToolsListParams struct {
	// Optional model ID — when provided, the returned tool list reflects model-specific
	// overrides
	Model *string `json:"model,omitempty"`
}

type ToolsListResult

type ToolsListResult struct {
	// List of available built-in tools with metadata
	Tools []Tool `json:"tools"`
}

type ToolsRpcApi

type ToolsRpcApi struct {
	// contains filtered or unexported fields
}

func (*ToolsRpcApi) HandlePendingToolCall added in v0.1.31

type UiRpcApi added in v0.2.0

type UiRpcApi struct {
	// contains filtered or unexported fields
}

func (*UiRpcApi) Elicitation added in v0.2.0

type WorkspaceRpcApi added in v0.1.25

type WorkspaceRpcApi struct {
	// contains filtered or unexported fields
}

func (*WorkspaceRpcApi) CreateFile added in v0.1.25

func (*WorkspaceRpcApi) ListFiles added in v0.1.25

func (*WorkspaceRpcApi) ReadFile added in v0.1.25

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL