rpc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterClientSessionApiHandlers added in v0.2.2

func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func(sessionID string) *ClientSessionApiHandlers)

RegisterClientSessionApiHandlers registers handlers for server-to-client session API calls.

Types

type AccountGetQuotaRequest added in v0.3.0

type AccountGetQuotaRequest struct {
	// GitHub token for per-user quota lookup. When provided, resolves this token to determine
	// the user's quota instead of using the global auth.
	GitHubToken *string `json:"gitHubToken,omitempty"`
}

type AccountGetQuotaResult

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

type AccountQuotaSnapshot added in v0.3.0

type AccountQuotaSnapshot struct {
	// Number of requests included in the entitlement
	EntitlementRequests int64 `json:"entitlementRequests"`
	// Whether the user has an unlimited usage entitlement
	IsUnlimitedEntitlement bool `json:"isUnlimitedEntitlement"`
	// Number of overage requests made this period
	Overage float64 `json:"overage"`
	// Whether overage 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 string)
	ResetDate *string `json:"resetDate,omitempty"`
	// Whether usage is still permitted after quota exhaustion
	UsageAllowedWithExhaustedQuota bool `json:"usageAllowedWithExhaustedQuota"`
	// Number of requests used so far this period
	UsedRequests int64 `json:"usedRequests"`
}

type AgentApi added in v0.2.1

type AgentApi sessionApi

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

func (*AgentApi) Deselect added in v0.2.1

func (a *AgentApi) Deselect(ctx context.Context) (*AgentDeselectResult, error)

func (*AgentApi) GetCurrent added in v0.2.1

func (a *AgentApi) GetCurrent(ctx context.Context) (*AgentGetCurrentResult, error)

func (*AgentApi) List added in v0.2.1

func (a *AgentApi) List(ctx context.Context) (*AgentList, error)

func (*AgentApi) Reload added in v0.2.1

func (a *AgentApi) Reload(ctx context.Context) (*AgentReloadResult, error)

func (*AgentApi) Select added in v0.2.1

func (a *AgentApi) Select(ctx context.Context, params *AgentSelectRequest) (*AgentSelectResult, error)

type AgentDeselectResult added in v0.3.0

type AgentDeselectResult struct {
}

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

type AgentGetCurrentResult added in v0.3.0

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

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

type AgentInfo added in v0.3.0

type AgentInfo 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 AgentList added in v0.3.0

type AgentList struct {
	// Available custom agents
	Agents []AgentInfo `json:"agents"`
}

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

type AgentReloadResult added in v0.3.0

type AgentReloadResult struct {
	// Reloaded custom agents
	Agents []AgentInfo `json:"agents"`
}

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

type AgentSelectRequest added in v0.3.0

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

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

type AgentSelectResult added in v0.3.0

type AgentSelectResult struct {
	// The newly selected custom agent
	Agent AgentInfo `json:"agent"`
}

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

type ApprovalKind added in v0.3.0

type ApprovalKind string
const (
	ApprovalKindCommands    ApprovalKind = "commands"
	ApprovalKindCustomTool  ApprovalKind = "custom-tool"
	ApprovalKindMcp         ApprovalKind = "mcp"
	ApprovalKindMcpSampling ApprovalKind = "mcp-sampling"
	ApprovalKindMemory      ApprovalKind = "memory"
	ApprovalKindRead        ApprovalKind = "read"
	ApprovalKindWrite       ApprovalKind = "write"
)

type AuthApi added in v0.3.0

type AuthApi sessionApi

func (*AuthApi) GetStatus added in v0.3.0

func (a *AuthApi) GetStatus(ctx context.Context) (*SessionAuthStatus, error)

type AuthInfoType added in v0.3.0

type AuthInfoType string

Authentication type

const (
	AuthInfoTypeAPIKey          AuthInfoType = "api-key"
	AuthInfoTypeUser            AuthInfoType = "user"
	AuthInfoTypeCopilotAPIToken AuthInfoType = "copilot-api-token"
	AuthInfoTypeEnv             AuthInfoType = "env"
	AuthInfoTypeGhCli           AuthInfoType = "gh-cli"
	AuthInfoTypeHmac            AuthInfoType = "hmac"
	AuthInfoTypeToken           AuthInfoType = "token"
)

type ClientSessionApiHandlers added in v0.2.2

type ClientSessionApiHandlers struct {
	SessionFs SessionFsHandler
}

ClientSessionApiHandlers provides all client session API handler groups for a session.

type CommandsApi added in v0.2.1

type CommandsApi sessionApi

func (*CommandsApi) HandlePendingCommand added in v0.2.1

type CommandsHandlePendingCommandRequest added in v0.3.0

type CommandsHandlePendingCommandRequest 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 CommandsHandlePendingCommandResult added in v0.3.0

type CommandsHandlePendingCommandResult struct {
	// Whether the command was handled successfully
	Success bool `json:"success"`
}

type CurrentModel added in v0.3.0

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

type DiscoveredMCPServer added in v0.3.0

type DiscoveredMCPServer struct {
	// Whether the server is enabled (not in the disabled list)
	Enabled bool `json:"enabled"`
	// Server name (config key)
	Name string `json:"name"`
	// Configuration source
	Source MCPServerSource `json:"source"`
	// Server transport type: stdio, http, sse, or memory (local configs are normalized to stdio)
	Type *DiscoveredMCPServerType `json:"type,omitempty"`
}

type DiscoveredMCPServerType added in v0.3.0

type DiscoveredMCPServerType string

Server transport type: stdio, http, sse, or memory (local configs are normalized to stdio)

const (
	DiscoveredMCPServerTypeHTTP   DiscoveredMCPServerType = "http"
	DiscoveredMCPServerTypeMemory DiscoveredMCPServerType = "memory"
	DiscoveredMCPServerTypeSSE    DiscoveredMCPServerType = "sse"
	DiscoveredMCPServerTypeStdio  DiscoveredMCPServerType = "stdio"
)

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 ExtensionSource `json:"source"`
	// Current status: running, disabled, failed, or starting
	Status ExtensionStatus `json:"status"`
}

type ExtensionList added in v0.3.0

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

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

type ExtensionSource added in v0.3.0

type ExtensionSource string

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

const (
	ExtensionSourceUser    ExtensionSource = "user"
	ExtensionSourceProject ExtensionSource = "project"
)

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 ExtensionsApi added in v0.2.1

type ExtensionsApi sessionApi

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

func (*ExtensionsApi) Disable added in v0.2.1

func (*ExtensionsApi) Enable added in v0.2.1

func (*ExtensionsApi) List added in v0.2.1

func (a *ExtensionsApi) List(ctx context.Context) (*ExtensionList, error)

func (*ExtensionsApi) Reload added in v0.2.1

type ExtensionsDisableRequest added in v0.3.0

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

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

type ExtensionsDisableResult added in v0.3.0

type ExtensionsDisableResult struct {
}

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

type ExtensionsEnableRequest added in v0.3.0

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

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

type ExtensionsEnableResult added in v0.3.0

type ExtensionsEnableResult struct {
}

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

type ExtensionsReloadResult added in v0.3.0

type ExtensionsReloadResult struct {
}

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

type FilterMapping added in v0.3.0

type FilterMapping struct {
	Enum    *FilterMappingString
	EnumMap map[string]FilterMappingString
}

type FilterMappingString added in v0.3.0

type FilterMappingString string
const (
	FilterMappingStringHiddenCharacters FilterMappingString = "hidden_characters"
	FilterMappingStringMarkdown         FilterMappingString = "markdown"
	FilterMappingStringNone             FilterMappingString = "none"
)

type FleetApi added in v0.2.1

type FleetApi sessionApi

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

func (*FleetApi) Start added in v0.2.1

func (a *FleetApi) Start(ctx context.Context, params *FleetStartRequest) (*FleetStartResult, error)

type FleetStartRequest added in v0.3.0

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

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

type FleetStartResult added in v0.3.0

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

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

type HandleToolCallResult added in v0.3.0

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

type HistoryApi added in v0.2.2

type HistoryApi sessionApi

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

func (*HistoryApi) Compact added in v0.2.2

func (a *HistoryApi) Compact(ctx context.Context) (*HistoryCompactResult, error)

func (*HistoryApi) Truncate added in v0.2.2

type HistoryCompactContextWindow added in v0.3.0

type HistoryCompactContextWindow struct {
	// Token count from non-system messages (user, assistant, tool)
	ConversationTokens *int64 `json:"conversationTokens,omitempty"`
	// Current total tokens in the context window (system + conversation + tool definitions)
	CurrentTokens int64 `json:"currentTokens"`
	// Current number of messages in the conversation
	MessagesLength int64 `json:"messagesLength"`
	// Token count from system message(s)
	SystemTokens *int64 `json:"systemTokens,omitempty"`
	// Maximum token count for the model's context window
	TokenLimit int64 `json:"tokenLimit"`
	// Token count from tool definitions
	ToolDefinitionsTokens *int64 `json:"toolDefinitionsTokens,omitempty"`
}

Post-compaction context window usage breakdown

type HistoryCompactResult added in v0.3.0

type HistoryCompactResult struct {
	// Post-compaction context window usage breakdown
	ContextWindow *HistoryCompactContextWindow `json:"contextWindow,omitempty"`
	// Number of messages removed during compaction
	MessagesRemoved int64 `json:"messagesRemoved"`
	// Whether compaction completed successfully
	Success bool `json:"success"`
	// Number of tokens freed by compaction
	TokensRemoved int64 `json:"tokensRemoved"`
}

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

type HistoryTruncateRequest added in v0.3.0

type HistoryTruncateRequest struct {
	// Event ID to truncate to. This event and all events after it are removed from the session.
	EventID string `json:"eventId"`
}

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

type HistoryTruncateResult added in v0.3.0

type HistoryTruncateResult struct {
	// Number of events that were removed
	EventsRemoved int64 `json:"eventsRemoved"`
}

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

type HostType added in v0.3.0

type HostType string
const (
	HostTypeAdo    HostType = "ado"
	HostTypeGithub HostType = "github"
)

type InstructionsApi added in v0.3.0

type InstructionsApi sessionApi

func (*InstructionsApi) GetSources added in v0.3.0

type InstructionsGetSourcesResult added in v0.3.0

type InstructionsGetSourcesResult struct {
	// Instruction sources for the session
	Sources []InstructionsSources `json:"sources"`
}

type InstructionsSources added in v0.3.0

type InstructionsSources struct {
	// Glob pattern from frontmatter — when set, this instruction applies only to matching files
	ApplyTo *string `json:"applyTo,omitempty"`
	// Raw content of the instruction file
	Content string `json:"content"`
	// Short description (body after frontmatter) for use in instruction tables
	Description *string `json:"description,omitempty"`
	// Unique identifier for this source (used for toggling)
	ID string `json:"id"`
	// Human-readable label
	Label string `json:"label"`
	// Where this source lives — used for UI grouping
	Location InstructionsSourcesLocation `json:"location"`
	// File path relative to repo or absolute for home
	SourcePath string `json:"sourcePath"`
	// Category of instruction source — used for merge logic
	Type InstructionsSourcesType `json:"type"`
}

type InstructionsSourcesLocation added in v0.3.0

type InstructionsSourcesLocation string

Where this source lives — used for UI grouping

const (
	InstructionsSourcesLocationUser             InstructionsSourcesLocation = "user"
	InstructionsSourcesLocationRepository       InstructionsSourcesLocation = "repository"
	InstructionsSourcesLocationWorkingDirectory InstructionsSourcesLocation = "working-directory"
)

type InstructionsSourcesType added in v0.3.0

type InstructionsSourcesType string

Category of instruction source — used for merge logic

const (
	InstructionsSourcesTypeChildInstructions InstructionsSourcesType = "child-instructions"
	InstructionsSourcesTypeHome              InstructionsSourcesType = "home"
	InstructionsSourcesTypeModel             InstructionsSourcesType = "model"
	InstructionsSourcesTypeNestedAgents      InstructionsSourcesType = "nested-agents"
	InstructionsSourcesTypeRepo              InstructionsSourcesType = "repo"
	InstructionsSourcesTypeVscode            InstructionsSourcesType = "vscode"
)

type LogRequest added in v0.3.0

type LogRequest 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 *SessionLogLevel `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 LogResult added in v0.3.0

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

type MCPConfigAddRequest added in v0.3.0

type MCPConfigAddRequest struct {
	// MCP server configuration (local/stdio or remote/http)
	Config MCPServerConfig `json:"config"`
	// Unique name for the MCP server
	Name string `json:"name"`
}

type MCPConfigAddResult added in v0.3.0

type MCPConfigAddResult struct {
}

type MCPConfigDisableRequest added in v0.3.0

type MCPConfigDisableRequest struct {
	// Names of MCP servers to disable. Each server is added to the persisted disabled list so
	// new sessions skip it. Already-disabled names are ignored. Active sessions keep their
	// current connections until they end.
	Names []string `json:"names"`
}

type MCPConfigDisableResult added in v0.3.0

type MCPConfigDisableResult struct {
}

type MCPConfigEnableRequest added in v0.3.0

type MCPConfigEnableRequest struct {
	// Names of MCP servers to enable. Each server is removed from the persisted disabled list
	// so new sessions spawn it. Unknown or already-enabled names are ignored.
	Names []string `json:"names"`
}

type MCPConfigEnableResult added in v0.3.0

type MCPConfigEnableResult struct {
}

type MCPConfigList added in v0.3.0

type MCPConfigList struct {
	// All MCP servers from user config, keyed by name
	Servers map[string]MCPServerConfig `json:"servers"`
}

type MCPConfigRemoveRequest added in v0.3.0

type MCPConfigRemoveRequest struct {
	// Name of the MCP server to remove
	Name string `json:"name"`
}

type MCPConfigRemoveResult added in v0.3.0

type MCPConfigRemoveResult struct {
}

type MCPConfigUpdateRequest added in v0.3.0

type MCPConfigUpdateRequest struct {
	// MCP server configuration (local/stdio or remote/http)
	Config MCPServerConfig `json:"config"`
	// Name of the MCP server to update
	Name string `json:"name"`
}

type MCPConfigUpdateResult added in v0.3.0

type MCPConfigUpdateResult struct {
}

type MCPDisableRequest added in v0.3.0

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

type MCPDisableResult added in v0.3.0

type MCPDisableResult struct {
}

type MCPDiscoverRequest added in v0.3.0

type MCPDiscoverRequest struct {
	// Working directory used as context for discovery (e.g., plugin resolution)
	WorkingDirectory *string `json:"workingDirectory,omitempty"`
}

type MCPDiscoverResult added in v0.3.0

type MCPDiscoverResult struct {
	// MCP servers discovered from all sources
	Servers []DiscoveredMCPServer `json:"servers"`
}

type MCPEnableRequest added in v0.3.0

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

type MCPEnableResult added in v0.3.0

type MCPEnableResult struct {
}

type MCPOauthLoginRequest added in v0.3.0

type MCPOauthLoginRequest struct {
	// Optional override for the body text shown on the OAuth loopback callback success page.
	// When omitted, the runtime applies a neutral fallback; callers driving interactive auth
	// should pass surface-specific copy telling the user where to return.
	CallbackSuccessMessage *string `json:"callbackSuccessMessage,omitempty"`
	// Optional override for the OAuth client display name shown on the consent screen. Applies
	// to newly registered dynamic clients only — existing registrations keep the name they were
	// created with. When omitted, the runtime applies a neutral fallback; callers driving
	// interactive auth should pass their own surface-specific label so the consent screen
	// matches the product the user sees.
	ClientName *string `json:"clientName,omitempty"`
	// When true, clears any cached OAuth token for the server and runs a full new
	// authorization. Use when the user explicitly wants to switch accounts or believes their
	// session is stuck.
	ForceReauth *bool `json:"forceReauth,omitempty"`
	// Name of the remote MCP server to authenticate
	ServerName string `json:"serverName"`
}

type MCPOauthLoginResult added in v0.3.0

type MCPOauthLoginResult struct {
	// URL the caller should open in a browser to complete OAuth. Omitted when cached tokens
	// were still valid and no browser interaction was needed — the server is already
	// reconnected in that case. When present, the runtime starts the callback listener before
	// returning and continues the flow in the background; completion is signaled via
	// session.mcp_server_status_changed.
	AuthorizationURL *string `json:"authorizationUrl,omitempty"`
}

type MCPReloadResult added in v0.3.0

type MCPReloadResult struct {
}

type MCPServer added in v0.3.0

type MCPServer 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 *MCPServerSource `json:"source,omitempty"`
	// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
	Status MCPServerStatus `json:"status"`
}

type MCPServerConfig added in v0.3.0

type MCPServerConfig struct {
	Args            []string          `json:"args,omitempty"`
	Command         *string           `json:"command,omitempty"`
	Cwd             *string           `json:"cwd,omitempty"`
	Env             map[string]string `json:"env,omitempty"`
	FilterMapping   *FilterMapping    `json:"filterMapping"`
	IsDefaultServer *bool             `json:"isDefaultServer,omitempty"`
	// Timeout in milliseconds for tool calls to this server.
	Timeout *int64 `json:"timeout,omitempty"`
	// Tools to include. Defaults to all tools if not specified.
	Tools []string `json:"tools,omitempty"`
	// Remote transport type. Defaults to "http" when omitted.
	Type              *MCPServerConfigType `json:"type,omitempty"`
	Headers           map[string]string    `json:"headers,omitempty"`
	OauthClientID     *string              `json:"oauthClientId,omitempty"`
	OauthPublicClient *bool                `json:"oauthPublicClient,omitempty"`
	URL               *string              `json:"url,omitempty"`
}

MCP server configuration (local/stdio or remote/http)

type MCPServerConfigHTTP added in v0.3.0

type MCPServerConfigHTTP struct {
	FilterMapping     *FilterMapping    `json:"filterMapping"`
	Headers           map[string]string `json:"headers,omitempty"`
	IsDefaultServer   *bool             `json:"isDefaultServer,omitempty"`
	OauthClientID     *string           `json:"oauthClientId,omitempty"`
	OauthPublicClient *bool             `json:"oauthPublicClient,omitempty"`
	// Timeout in milliseconds for tool calls to this server.
	Timeout *int64 `json:"timeout,omitempty"`
	// Tools to include. Defaults to all tools if not specified.
	Tools []string `json:"tools,omitempty"`
	// Remote transport type. Defaults to "http" when omitted.
	Type *MCPServerConfigHTTPType `json:"type,omitempty"`
	URL  string                   `json:"url"`
}

type MCPServerConfigHTTPType added in v0.3.0

type MCPServerConfigHTTPType string

Remote transport type. Defaults to "http" when omitted.

const (
	MCPServerConfigHTTPTypeHTTP MCPServerConfigHTTPType = "http"
	MCPServerConfigHTTPTypeSSE  MCPServerConfigHTTPType = "sse"
)

type MCPServerConfigLocal added in v0.3.0

type MCPServerConfigLocal struct {
	Args            []string          `json:"args"`
	Command         string            `json:"command"`
	Cwd             *string           `json:"cwd,omitempty"`
	Env             map[string]string `json:"env,omitempty"`
	FilterMapping   *FilterMapping    `json:"filterMapping"`
	IsDefaultServer *bool             `json:"isDefaultServer,omitempty"`
	// Timeout in milliseconds for tool calls to this server.
	Timeout *int64 `json:"timeout,omitempty"`
	// Tools to include. Defaults to all tools if not specified.
	Tools []string                  `json:"tools,omitempty"`
	Type  *MCPServerConfigLocalType `json:"type,omitempty"`
}

type MCPServerConfigLocalType added in v0.3.0

type MCPServerConfigLocalType string
const (
	MCPServerConfigLocalTypeLocal MCPServerConfigLocalType = "local"
	MCPServerConfigLocalTypeStdio MCPServerConfigLocalType = "stdio"
)

type MCPServerConfigType added in v0.3.0

type MCPServerConfigType string

Remote transport type. Defaults to "http" when omitted.

const (
	MCPServerConfigTypeHTTP  MCPServerConfigType = "http"
	MCPServerConfigTypeLocal MCPServerConfigType = "local"
	MCPServerConfigTypeSSE   MCPServerConfigType = "sse"
	MCPServerConfigTypeStdio MCPServerConfigType = "stdio"
)

type MCPServerList added in v0.3.0

type MCPServerList struct {
	// Configured MCP servers
	Servers []MCPServer `json:"servers"`
}

type MCPServerSource added in v0.3.0

type MCPServerSource string

Configuration source

Configuration source: user, workspace, plugin, or builtin

const (
	MCPServerSourceBuiltin   MCPServerSource = "builtin"
	MCPServerSourceUser      MCPServerSource = "user"
	MCPServerSourcePlugin    MCPServerSource = "plugin"
	MCPServerSourceWorkspace MCPServerSource = "workspace"
)

type MCPServerStatus added in v0.3.0

type MCPServerStatus string

Connection status: connected, failed, needs-auth, pending, disabled, or not_configured

const (
	MCPServerStatusConnected     MCPServerStatus = "connected"
	MCPServerStatusDisabled      MCPServerStatus = "disabled"
	MCPServerStatusFailed        MCPServerStatus = "failed"
	MCPServerStatusNeedsAuth     MCPServerStatus = "needs-auth"
	MCPServerStatusNotConfigured MCPServerStatus = "not_configured"
	MCPServerStatusPending       MCPServerStatus = "pending"
)

type McpApi added in v0.2.1

type McpApi sessionApi

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

func (*McpApi) Disable added in v0.2.1

func (a *McpApi) Disable(ctx context.Context, params *MCPDisableRequest) (*MCPDisableResult, error)

func (*McpApi) Enable added in v0.2.1

func (a *McpApi) Enable(ctx context.Context, params *MCPEnableRequest) (*MCPEnableResult, error)

func (*McpApi) List added in v0.2.1

func (a *McpApi) List(ctx context.Context) (*MCPServerList, error)

func (*McpApi) Oauth added in v0.3.0

func (s *McpApi) Oauth() *McpOauthApi

Experimental: Oauth returns experimental APIs that may change or be removed.

func (*McpApi) Reload added in v0.2.1

func (a *McpApi) Reload(ctx context.Context) (*MCPReloadResult, error)

type McpOauthApi added in v0.3.0

type McpOauthApi sessionApi

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

func (*McpOauthApi) Login added in v0.3.0

type ModeApi added in v0.2.1

type ModeApi sessionApi

func (*ModeApi) Get added in v0.2.1

func (a *ModeApi) Get(ctx context.Context) (*SessionMode, error)

func (*ModeApi) Set added in v0.2.1

func (a *ModeApi) Set(ctx context.Context, params *ModeSetRequest) (*ModeSetResult, error)

type ModeSetRequest added in v0.3.0

type ModeSetRequest struct {
	// The agent mode. Valid values: "interactive", "plan", "autopilot".
	Mode SessionMode `json:"mode"`
}

type ModeSetResult added in v0.3.0

type ModeSetResult struct {
}

type ModelApi added in v0.2.1

type ModelApi sessionApi

func (*ModelApi) GetCurrent added in v0.2.1

func (a *ModelApi) GetCurrent(ctx context.Context) (*CurrentModel, error)

func (*ModelApi) SwitchTo added in v0.2.1

func (a *ModelApi) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) (*ModelSwitchToResult, error)

type ModelBilling added in v0.3.0

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

Billing information

type ModelCapabilities added in v0.2.2

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

Model capabilities and limits

type ModelCapabilitiesLimits added in v0.2.2

type ModelCapabilitiesLimits struct {
	// Maximum total context window size in tokens
	MaxContextWindowTokens *int64 `json:"max_context_window_tokens,omitempty"`
	// Maximum number of output/completion tokens
	MaxOutputTokens *int64 `json:"max_output_tokens,omitempty"`
	// Maximum number of prompt/input tokens
	MaxPromptTokens *int64 `json:"max_prompt_tokens,omitempty"`
	// Vision-specific limits
	Vision *ModelCapabilitiesLimitsVision `json:"vision,omitempty"`
}

Token limits for prompts, outputs, and context window

type ModelCapabilitiesLimitsVision added in v0.2.2

type ModelCapabilitiesLimitsVision struct {
	// Maximum image size in bytes
	MaxPromptImageSize int64 `json:"max_prompt_image_size"`
	// Maximum number of images per prompt
	MaxPromptImages int64 `json:"max_prompt_images"`
	// MIME types the model accepts
	SupportedMediaTypes []string `json:"supported_media_types"`
}

Vision-specific limits

type ModelCapabilitiesOverride added in v0.2.2

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

Override individual model capabilities resolved by the runtime

type ModelCapabilitiesOverrideLimits added in v0.2.2

type ModelCapabilitiesOverrideLimits struct {
	// Maximum total context window size in tokens
	MaxContextWindowTokens *int64                                 `json:"max_context_window_tokens,omitempty"`
	MaxOutputTokens        *int64                                 `json:"max_output_tokens,omitempty"`
	MaxPromptTokens        *int64                                 `json:"max_prompt_tokens,omitempty"`
	Vision                 *ModelCapabilitiesOverrideLimitsVision `json:"vision,omitempty"`
}

Token limits for prompts, outputs, and context window

type ModelCapabilitiesOverrideLimitsVision added in v0.2.2

type ModelCapabilitiesOverrideLimitsVision struct {
	// Maximum image size in bytes
	MaxPromptImageSize *int64 `json:"max_prompt_image_size,omitempty"`
	// Maximum number of images per prompt
	MaxPromptImages *int64 `json:"max_prompt_images,omitempty"`
	// MIME types the model accepts
	SupportedMediaTypes []string `json:"supported_media_types,omitempty"`
}

type ModelCapabilitiesOverrideSupports added in v0.2.2

type ModelCapabilitiesOverrideSupports struct {
	ReasoningEffort *bool `json:"reasoningEffort,omitempty"`
	Vision          *bool `json:"vision,omitempty"`
}

Feature flags indicating what the model supports

type ModelCapabilitiesSupports added in v0.2.2

type ModelCapabilitiesSupports 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 ModelElement added in v0.3.0

type ModelElement struct {
	// Billing information
	Billing *ModelBilling `json:"billing,omitempty"`
	// Model capabilities and limits
	Capabilities ModelCapabilities `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 *ModelPolicy `json:"policy,omitempty"`
	// Supported reasoning effort levels (only present if model supports reasoning effort)
	SupportedReasoningEfforts []string `json:"supportedReasoningEfforts,omitempty"`
}

type ModelList added in v0.3.0

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

type ModelPolicy added in v0.3.0

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

Policy state (if applicable)

type ModelSwitchToRequest added in v0.3.0

type ModelSwitchToRequest struct {
	// Override individual model capabilities resolved by the runtime
	ModelCapabilities *ModelCapabilitiesOverride `json:"modelCapabilities,omitempty"`
	// Model identifier to switch to
	ModelID string `json:"modelId"`
	// Reasoning effort level to use for the model
	ReasoningEffort *string `json:"reasoningEffort,omitempty"`
}

type ModelSwitchToResult added in v0.3.0

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

type ModelsListRequest added in v0.3.0

type ModelsListRequest struct {
	// GitHub token for per-user model listing. When provided, resolves this token to determine
	// the user's Copilot plan and available models instead of using the global auth.
	GitHubToken *string `json:"gitHubToken,omitempty"`
}

type NameApi added in v0.3.0

type NameApi sessionApi

func (*NameApi) Get added in v0.3.0

func (a *NameApi) Get(ctx context.Context) (*NameGetResult, error)

func (*NameApi) Set added in v0.3.0

func (a *NameApi) Set(ctx context.Context, params *NameSetRequest) (*NameSetResult, error)

type NameGetResult added in v0.3.0

type NameGetResult struct {
	// The session name, falling back to the auto-generated summary, or null if neither exists
	Name *string `json:"name"`
}

type NameSetRequest added in v0.3.0

type NameSetRequest struct {
	// New session name (1–100 characters, trimmed of leading/trailing whitespace)
	Name string `json:"name"`
}

type NameSetResult added in v0.3.0

type NameSetResult struct {
}

type PermissionDecision added in v0.3.0

type PermissionDecision struct {
	// The permission request was approved for this one instance
	//
	// Approved and remembered for the rest of the session
	//
	// Approved and persisted for this project location
	//
	// Denied by the user during an interactive prompt
	//
	// Denied because user confirmation was unavailable
	Kind PermissionDecisionKind `json:"kind"`
	// The approval to add as a session-scoped rule
	//
	// The approval to persist for this location
	Approval *PermissionDecisionApproveForLocationApproval `json:"approval,omitempty"`
	// The location key (git root or cwd) to persist the approval to
	LocationKey *string `json:"locationKey,omitempty"`
	// Optional feedback from the user explaining the denial
	Feedback *string `json:"feedback,omitempty"`
}

type PermissionDecisionApproveForLocation added in v0.3.0

type PermissionDecisionApproveForLocation struct {
	// The approval to persist for this location
	Approval PermissionDecisionApproveForLocationApproval `json:"approval"`
	// Approved and persisted for this project location
	Kind PermissionDecisionApproveForLocationKind `json:"kind"`
	// The location key (git root or cwd) to persist the approval to
	LocationKey string `json:"locationKey"`
}

type PermissionDecisionApproveForLocationApproval added in v0.3.0

type PermissionDecisionApproveForLocationApproval struct {
	CommandIdentifiers []string     `json:"commandIdentifiers,omitempty"`
	Kind               ApprovalKind `json:"kind"`
	ServerName         *string      `json:"serverName,omitempty"`
	ToolName           *string      `json:"toolName"`
}

The approval to persist for this location

type PermissionDecisionApproveForLocationApprovalCommands added in v0.3.0

type PermissionDecisionApproveForLocationApprovalCommands struct {
	CommandIdentifiers []string                                                 `json:"commandIdentifiers"`
	Kind               PermissionDecisionApproveForLocationApprovalCommandsKind `json:"kind"`
}

type PermissionDecisionApproveForLocationApprovalCommandsKind added in v0.3.0

type PermissionDecisionApproveForLocationApprovalCommandsKind string
const (
	PermissionDecisionApproveForLocationApprovalCommandsKindCommands PermissionDecisionApproveForLocationApprovalCommandsKind = "commands"
)

type PermissionDecisionApproveForLocationApprovalCustomTool added in v0.3.0

type PermissionDecisionApproveForLocationApprovalCustomTool struct {
	Kind     PermissionDecisionApproveForLocationApprovalCustomToolKind `json:"kind"`
	ToolName string                                                     `json:"toolName"`
}

type PermissionDecisionApproveForLocationApprovalCustomToolKind added in v0.3.0

type PermissionDecisionApproveForLocationApprovalCustomToolKind string
const (
	PermissionDecisionApproveForLocationApprovalCustomToolKindCustomTool PermissionDecisionApproveForLocationApprovalCustomToolKind = "custom-tool"
)

type PermissionDecisionApproveForLocationApprovalMCP added in v0.3.0

type PermissionDecisionApproveForLocationApprovalMCP struct {
	Kind       PermissionDecisionApproveForLocationApprovalMCPKind `json:"kind"`
	ServerName string                                              `json:"serverName"`
	ToolName   *string                                             `json:"toolName"`
}

type PermissionDecisionApproveForLocationApprovalMCPKind added in v0.3.0

type PermissionDecisionApproveForLocationApprovalMCPKind string
const (
	PermissionDecisionApproveForLocationApprovalMCPKindMcp PermissionDecisionApproveForLocationApprovalMCPKind = "mcp"
)

type PermissionDecisionApproveForLocationApprovalMCPSampling added in v0.3.0

type PermissionDecisionApproveForLocationApprovalMCPSampling struct {
	Kind       PermissionDecisionApproveForLocationApprovalMCPSamplingKind `json:"kind"`
	ServerName string                                                      `json:"serverName"`
}

type PermissionDecisionApproveForLocationApprovalMCPSamplingKind added in v0.3.0

type PermissionDecisionApproveForLocationApprovalMCPSamplingKind string
const (
	PermissionDecisionApproveForLocationApprovalMCPSamplingKindMcpSampling PermissionDecisionApproveForLocationApprovalMCPSamplingKind = "mcp-sampling"
)

type PermissionDecisionApproveForLocationApprovalMemory added in v0.3.0

type PermissionDecisionApproveForLocationApprovalMemory struct {
	Kind PermissionDecisionApproveForLocationApprovalMemoryKind `json:"kind"`
}

type PermissionDecisionApproveForLocationApprovalMemoryKind added in v0.3.0

type PermissionDecisionApproveForLocationApprovalMemoryKind string
const (
	PermissionDecisionApproveForLocationApprovalMemoryKindMemory PermissionDecisionApproveForLocationApprovalMemoryKind = "memory"
)

type PermissionDecisionApproveForLocationApprovalRead added in v0.3.0

type PermissionDecisionApproveForLocationApprovalRead struct {
	Kind PermissionDecisionApproveForLocationApprovalReadKind `json:"kind"`
}

type PermissionDecisionApproveForLocationApprovalReadKind added in v0.3.0

type PermissionDecisionApproveForLocationApprovalReadKind string
const (
	PermissionDecisionApproveForLocationApprovalReadKindRead PermissionDecisionApproveForLocationApprovalReadKind = "read"
)

type PermissionDecisionApproveForLocationApprovalWrite added in v0.3.0

type PermissionDecisionApproveForLocationApprovalWrite struct {
	Kind PermissionDecisionApproveForLocationApprovalWriteKind `json:"kind"`
}

type PermissionDecisionApproveForLocationApprovalWriteKind added in v0.3.0

type PermissionDecisionApproveForLocationApprovalWriteKind string
const (
	PermissionDecisionApproveForLocationApprovalWriteKindWrite PermissionDecisionApproveForLocationApprovalWriteKind = "write"
)

type PermissionDecisionApproveForLocationKind added in v0.3.0

type PermissionDecisionApproveForLocationKind string
const (
	PermissionDecisionApproveForLocationKindApproveForLocation PermissionDecisionApproveForLocationKind = "approve-for-location"
)

type PermissionDecisionApproveForSession added in v0.3.0

type PermissionDecisionApproveForSession struct {
	// The approval to add as a session-scoped rule
	Approval PermissionDecisionApproveForSessionApproval `json:"approval"`
	// Approved and remembered for the rest of the session
	Kind PermissionDecisionApproveForSessionKind `json:"kind"`
}

type PermissionDecisionApproveForSessionApproval added in v0.3.0

type PermissionDecisionApproveForSessionApproval struct {
	CommandIdentifiers []string     `json:"commandIdentifiers,omitempty"`
	Kind               ApprovalKind `json:"kind"`
	ServerName         *string      `json:"serverName,omitempty"`
	ToolName           *string      `json:"toolName"`
}

The approval to add as a session-scoped rule

type PermissionDecisionApproveForSessionApprovalCommands added in v0.3.0

type PermissionDecisionApproveForSessionApprovalCommands struct {
	CommandIdentifiers []string                                                 `json:"commandIdentifiers"`
	Kind               PermissionDecisionApproveForLocationApprovalCommandsKind `json:"kind"`
}

type PermissionDecisionApproveForSessionApprovalCustomTool added in v0.3.0

type PermissionDecisionApproveForSessionApprovalCustomTool struct {
	Kind     PermissionDecisionApproveForLocationApprovalCustomToolKind `json:"kind"`
	ToolName string                                                     `json:"toolName"`
}

type PermissionDecisionApproveForSessionApprovalMCP added in v0.3.0

type PermissionDecisionApproveForSessionApprovalMCP struct {
	Kind       PermissionDecisionApproveForLocationApprovalMCPKind `json:"kind"`
	ServerName string                                              `json:"serverName"`
	ToolName   *string                                             `json:"toolName"`
}

type PermissionDecisionApproveForSessionApprovalMCPSampling added in v0.3.0

type PermissionDecisionApproveForSessionApprovalMCPSampling struct {
	Kind       PermissionDecisionApproveForLocationApprovalMCPSamplingKind `json:"kind"`
	ServerName string                                                      `json:"serverName"`
}

type PermissionDecisionApproveForSessionApprovalMemory added in v0.3.0

type PermissionDecisionApproveForSessionApprovalMemory struct {
	Kind PermissionDecisionApproveForLocationApprovalMemoryKind `json:"kind"`
}

type PermissionDecisionApproveForSessionApprovalRead added in v0.3.0

type PermissionDecisionApproveForSessionApprovalRead struct {
	Kind PermissionDecisionApproveForLocationApprovalReadKind `json:"kind"`
}

type PermissionDecisionApproveForSessionApprovalWrite added in v0.3.0

type PermissionDecisionApproveForSessionApprovalWrite struct {
	Kind PermissionDecisionApproveForLocationApprovalWriteKind `json:"kind"`
}

type PermissionDecisionApproveForSessionKind added in v0.3.0

type PermissionDecisionApproveForSessionKind string
const (
	PermissionDecisionApproveForSessionKindApproveForSession PermissionDecisionApproveForSessionKind = "approve-for-session"
)

type PermissionDecisionApproveOnce added in v0.3.0

type PermissionDecisionApproveOnce struct {
	// The permission request was approved for this one instance
	Kind PermissionDecisionApproveOnceKind `json:"kind"`
}

type PermissionDecisionApproveOnceKind added in v0.3.0

type PermissionDecisionApproveOnceKind string
const (
	PermissionDecisionApproveOnceKindApproveOnce PermissionDecisionApproveOnceKind = "approve-once"
)

type PermissionDecisionKind added in v0.3.0

type PermissionDecisionKind string
const (
	PermissionDecisionKindApproveForLocation PermissionDecisionKind = "approve-for-location"
	PermissionDecisionKindApproveForSession  PermissionDecisionKind = "approve-for-session"
	PermissionDecisionKindApproveOnce        PermissionDecisionKind = "approve-once"
	PermissionDecisionKindReject             PermissionDecisionKind = "reject"
	PermissionDecisionKindUserNotAvailable   PermissionDecisionKind = "user-not-available"
)

type PermissionDecisionReject added in v0.3.0

type PermissionDecisionReject struct {
	// Optional feedback from the user explaining the denial
	Feedback *string `json:"feedback,omitempty"`
	// Denied by the user during an interactive prompt
	Kind PermissionDecisionRejectKind `json:"kind"`
}

type PermissionDecisionRejectKind added in v0.3.0

type PermissionDecisionRejectKind string
const (
	PermissionDecisionRejectKindReject PermissionDecisionRejectKind = "reject"
)

type PermissionDecisionRequest added in v0.3.0

type PermissionDecisionRequest struct {
	// Request ID of the pending permission request
	RequestID string             `json:"requestId"`
	Result    PermissionDecision `json:"result"`
}

type PermissionDecisionUserNotAvailable added in v0.3.0

type PermissionDecisionUserNotAvailable struct {
	// Denied because user confirmation was unavailable
	Kind PermissionDecisionUserNotAvailableKind `json:"kind"`
}

type PermissionDecisionUserNotAvailableKind added in v0.3.0

type PermissionDecisionUserNotAvailableKind string
const (
	PermissionDecisionUserNotAvailableKindUserNotAvailable PermissionDecisionUserNotAvailableKind = "user-not-available"
)

type PermissionRequestResult added in v0.3.0

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

type PermissionsApi added in v0.2.1

type PermissionsApi sessionApi

func (*PermissionsApi) HandlePendingPermissionRequest added in v0.2.1

func (a *PermissionsApi) HandlePendingPermissionRequest(ctx context.Context, params *PermissionDecisionRequest) (*PermissionRequestResult, error)

func (*PermissionsApi) ResetSessionApprovals added in v0.3.0

func (*PermissionsApi) SetApproveAll added in v0.3.0

type PermissionsResetSessionApprovalsRequest added in v0.3.0

type PermissionsResetSessionApprovalsRequest struct {
}

type PermissionsResetSessionApprovalsResult added in v0.3.0

type PermissionsResetSessionApprovalsResult struct {
	// Whether the operation succeeded
	Success bool `json:"success"`
}

type PermissionsSetApproveAllRequest added in v0.3.0

type PermissionsSetApproveAllRequest struct {
	// Whether to auto-approve all tool permission requests
	Enabled bool `json:"enabled"`
}

type PermissionsSetApproveAllResult added in v0.3.0

type PermissionsSetApproveAllResult struct {
	// Whether the operation succeeded
	Success bool `json:"success"`
}

type PingRequest added in v0.3.0

type PingRequest 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 int64 `json:"protocolVersion"`
	// Server timestamp in milliseconds
	Timestamp int64 `json:"timestamp"`
}

type PlanApi added in v0.2.1

type PlanApi sessionApi

func (*PlanApi) Delete added in v0.2.1

func (a *PlanApi) Delete(ctx context.Context) (*PlanDeleteResult, error)

func (*PlanApi) Read added in v0.2.1

func (a *PlanApi) Read(ctx context.Context) (*PlanReadResult, error)

func (*PlanApi) Update added in v0.2.1

func (a *PlanApi) Update(ctx context.Context, params *PlanUpdateRequest) (*PlanUpdateResult, error)

type PlanDeleteResult added in v0.3.0

type PlanDeleteResult struct {
}

type PlanReadResult added in v0.3.0

type PlanReadResult 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 PlanUpdateRequest added in v0.3.0

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

type PlanUpdateResult added in v0.3.0

type PlanUpdateResult struct {
}

type PluginElement added in v0.3.0

type PluginElement 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 PluginList added in v0.3.0

type PluginList struct {
	// Installed plugins
	Plugins []PluginElement `json:"plugins"`
}

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

type PluginsApi added in v0.2.1

type PluginsApi sessionApi

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

func (*PluginsApi) List added in v0.2.1

func (a *PluginsApi) List(ctx context.Context) (*PluginList, error)

type RPCTypes added in v0.3.0

type RPCTypes struct {
	AccountGetQuotaRequest                                  AccountGetQuotaRequest                                  `json:"AccountGetQuotaRequest"`
	AccountGetQuotaResult                                   AccountGetQuotaResult                                   `json:"AccountGetQuotaResult"`
	AccountQuotaSnapshot                                    AccountQuotaSnapshot                                    `json:"AccountQuotaSnapshot"`
	AgentDeselectResult                                     AgentDeselectResult                                     `json:"AgentDeselectResult"`
	AgentGetCurrentResult                                   AgentGetCurrentResult                                   `json:"AgentGetCurrentResult"`
	AgentInfo                                               AgentInfo                                               `json:"AgentInfo"`
	AgentList                                               AgentList                                               `json:"AgentList"`
	AgentReloadResult                                       AgentReloadResult                                       `json:"AgentReloadResult"`
	AgentSelectRequest                                      AgentSelectRequest                                      `json:"AgentSelectRequest"`
	AgentSelectResult                                       AgentSelectResult                                       `json:"AgentSelectResult"`
	AuthInfoType                                            AuthInfoType                                            `json:"AuthInfoType"`
	CommandsHandlePendingCommandRequest                     CommandsHandlePendingCommandRequest                     `json:"CommandsHandlePendingCommandRequest"`
	CommandsHandlePendingCommandResult                      CommandsHandlePendingCommandResult                      `json:"CommandsHandlePendingCommandResult"`
	CurrentModel                                            CurrentModel                                            `json:"CurrentModel"`
	DiscoveredMCPServer                                     DiscoveredMCPServer                                     `json:"DiscoveredMcpServer"`
	DiscoveredMCPServerSource                               MCPServerSource                                         `json:"DiscoveredMcpServerSource"`
	DiscoveredMCPServerType                                 DiscoveredMCPServerType                                 `json:"DiscoveredMcpServerType"`
	Extension                                               Extension                                               `json:"Extension"`
	ExtensionList                                           ExtensionList                                           `json:"ExtensionList"`
	ExtensionsDisableRequest                                ExtensionsDisableRequest                                `json:"ExtensionsDisableRequest"`
	ExtensionsDisableResult                                 ExtensionsDisableResult                                 `json:"ExtensionsDisableResult"`
	ExtensionsEnableRequest                                 ExtensionsEnableRequest                                 `json:"ExtensionsEnableRequest"`
	ExtensionsEnableResult                                  ExtensionsEnableResult                                  `json:"ExtensionsEnableResult"`
	ExtensionSource                                         ExtensionSource                                         `json:"ExtensionSource"`
	ExtensionsReloadResult                                  ExtensionsReloadResult                                  `json:"ExtensionsReloadResult"`
	ExtensionStatus                                         ExtensionStatus                                         `json:"ExtensionStatus"`
	FilterMapping                                           *FilterMapping                                          `json:"FilterMapping"`
	FilterMappingString                                     FilterMappingString                                     `json:"FilterMappingString"`
	FilterMappingValue                                      FilterMappingString                                     `json:"FilterMappingValue"`
	FleetStartRequest                                       FleetStartRequest                                       `json:"FleetStartRequest"`
	FleetStartResult                                        FleetStartResult                                        `json:"FleetStartResult"`
	HandleToolCallResult                                    HandleToolCallResult                                    `json:"HandleToolCallResult"`
	HistoryCompactContextWindow                             HistoryCompactContextWindow                             `json:"HistoryCompactContextWindow"`
	HistoryCompactResult                                    HistoryCompactResult                                    `json:"HistoryCompactResult"`
	HistoryTruncateRequest                                  HistoryTruncateRequest                                  `json:"HistoryTruncateRequest"`
	HistoryTruncateResult                                   HistoryTruncateResult                                   `json:"HistoryTruncateResult"`
	InstructionsGetSourcesResult                            InstructionsGetSourcesResult                            `json:"InstructionsGetSourcesResult"`
	InstructionsSources                                     InstructionsSources                                     `json:"InstructionsSources"`
	InstructionsSourcesLocation                             InstructionsSourcesLocation                             `json:"InstructionsSourcesLocation"`
	InstructionsSourcesType                                 InstructionsSourcesType                                 `json:"InstructionsSourcesType"`
	LogRequest                                              LogRequest                                              `json:"LogRequest"`
	LogResult                                               LogResult                                               `json:"LogResult"`
	MCPConfigAddRequest                                     MCPConfigAddRequest                                     `json:"McpConfigAddRequest"`
	MCPConfigAddResult                                      MCPConfigAddResult                                      `json:"McpConfigAddResult"`
	MCPConfigDisableRequest                                 MCPConfigDisableRequest                                 `json:"McpConfigDisableRequest"`
	MCPConfigDisableResult                                  MCPConfigDisableResult                                  `json:"McpConfigDisableResult"`
	MCPConfigEnableRequest                                  MCPConfigEnableRequest                                  `json:"McpConfigEnableRequest"`
	MCPConfigEnableResult                                   MCPConfigEnableResult                                   `json:"McpConfigEnableResult"`
	MCPConfigList                                           MCPConfigList                                           `json:"McpConfigList"`
	MCPConfigRemoveRequest                                  MCPConfigRemoveRequest                                  `json:"McpConfigRemoveRequest"`
	MCPConfigRemoveResult                                   MCPConfigRemoveResult                                   `json:"McpConfigRemoveResult"`
	MCPConfigUpdateRequest                                  MCPConfigUpdateRequest                                  `json:"McpConfigUpdateRequest"`
	MCPConfigUpdateResult                                   MCPConfigUpdateResult                                   `json:"McpConfigUpdateResult"`
	MCPDisableRequest                                       MCPDisableRequest                                       `json:"McpDisableRequest"`
	MCPDisableResult                                        MCPDisableResult                                        `json:"McpDisableResult"`
	MCPDiscoverRequest                                      MCPDiscoverRequest                                      `json:"McpDiscoverRequest"`
	MCPDiscoverResult                                       MCPDiscoverResult                                       `json:"McpDiscoverResult"`
	MCPEnableRequest                                        MCPEnableRequest                                        `json:"McpEnableRequest"`
	MCPEnableResult                                         MCPEnableResult                                         `json:"McpEnableResult"`
	MCPOauthLoginRequest                                    MCPOauthLoginRequest                                    `json:"McpOauthLoginRequest"`
	MCPOauthLoginResult                                     MCPOauthLoginResult                                     `json:"McpOauthLoginResult"`
	MCPReloadResult                                         MCPReloadResult                                         `json:"McpReloadResult"`
	MCPServer                                               MCPServer                                               `json:"McpServer"`
	MCPServerConfig                                         MCPServerConfig                                         `json:"McpServerConfig"`
	MCPServerConfigHTTP                                     MCPServerConfigHTTP                                     `json:"McpServerConfigHttp"`
	MCPServerConfigHTTPType                                 MCPServerConfigHTTPType                                 `json:"McpServerConfigHttpType"`
	MCPServerConfigLocal                                    MCPServerConfigLocal                                    `json:"McpServerConfigLocal"`
	MCPServerConfigLocalType                                MCPServerConfigLocalType                                `json:"McpServerConfigLocalType"`
	MCPServerList                                           MCPServerList                                           `json:"McpServerList"`
	MCPServerSource                                         MCPServerSource                                         `json:"McpServerSource"`
	MCPServerStatus                                         MCPServerStatus                                         `json:"McpServerStatus"`
	Model                                                   ModelElement                                            `json:"Model"`
	ModelBilling                                            ModelBilling                                            `json:"ModelBilling"`
	ModelCapabilities                                       ModelCapabilities                                       `json:"ModelCapabilities"`
	ModelCapabilitiesLimits                                 ModelCapabilitiesLimits                                 `json:"ModelCapabilitiesLimits"`
	ModelCapabilitiesLimitsVision                           ModelCapabilitiesLimitsVision                           `json:"ModelCapabilitiesLimitsVision"`
	ModelCapabilitiesOverride                               ModelCapabilitiesOverride                               `json:"ModelCapabilitiesOverride"`
	ModelCapabilitiesOverrideLimits                         ModelCapabilitiesOverrideLimits                         `json:"ModelCapabilitiesOverrideLimits"`
	ModelCapabilitiesOverrideLimitsVision                   ModelCapabilitiesOverrideLimitsVision                   `json:"ModelCapabilitiesOverrideLimitsVision"`
	ModelCapabilitiesOverrideSupports                       ModelCapabilitiesOverrideSupports                       `json:"ModelCapabilitiesOverrideSupports"`
	ModelCapabilitiesSupports                               ModelCapabilitiesSupports                               `json:"ModelCapabilitiesSupports"`
	ModelList                                               ModelList                                               `json:"ModelList"`
	ModelPolicy                                             ModelPolicy                                             `json:"ModelPolicy"`
	ModelsListRequest                                       ModelsListRequest                                       `json:"ModelsListRequest"`
	ModelSwitchToRequest                                    ModelSwitchToRequest                                    `json:"ModelSwitchToRequest"`
	ModelSwitchToResult                                     ModelSwitchToResult                                     `json:"ModelSwitchToResult"`
	ModeSetRequest                                          ModeSetRequest                                          `json:"ModeSetRequest"`
	ModeSetResult                                           ModeSetResult                                           `json:"ModeSetResult"`
	NameGetResult                                           NameGetResult                                           `json:"NameGetResult"`
	NameSetRequest                                          NameSetRequest                                          `json:"NameSetRequest"`
	NameSetResult                                           NameSetResult                                           `json:"NameSetResult"`
	PermissionDecision                                      PermissionDecision                                      `json:"PermissionDecision"`
	PermissionDecisionApproveForLocation                    PermissionDecisionApproveForLocation                    `json:"PermissionDecisionApproveForLocation"`
	PermissionDecisionApproveForLocationApproval            PermissionDecisionApproveForLocationApproval            `json:"PermissionDecisionApproveForLocationApproval"`
	PermissionDecisionApproveForLocationApprovalCommands    PermissionDecisionApproveForLocationApprovalCommands    `json:"PermissionDecisionApproveForLocationApprovalCommands"`
	PermissionDecisionApproveForLocationApprovalCustomTool  PermissionDecisionApproveForLocationApprovalCustomTool  `json:"PermissionDecisionApproveForLocationApprovalCustomTool"`
	PermissionDecisionApproveForLocationApprovalMCP         PermissionDecisionApproveForLocationApprovalMCP         `json:"PermissionDecisionApproveForLocationApprovalMcp"`
	PermissionDecisionApproveForLocationApprovalMCPSampling PermissionDecisionApproveForLocationApprovalMCPSampling `json:"PermissionDecisionApproveForLocationApprovalMcpSampling"`
	PermissionDecisionApproveForLocationApprovalMemory      PermissionDecisionApproveForLocationApprovalMemory      `json:"PermissionDecisionApproveForLocationApprovalMemory"`
	PermissionDecisionApproveForLocationApprovalRead        PermissionDecisionApproveForLocationApprovalRead        `json:"PermissionDecisionApproveForLocationApprovalRead"`
	PermissionDecisionApproveForLocationApprovalWrite       PermissionDecisionApproveForLocationApprovalWrite       `json:"PermissionDecisionApproveForLocationApprovalWrite"`
	PermissionDecisionApproveForSession                     PermissionDecisionApproveForSession                     `json:"PermissionDecisionApproveForSession"`
	PermissionDecisionApproveForSessionApproval             PermissionDecisionApproveForSessionApproval             `json:"PermissionDecisionApproveForSessionApproval"`
	PermissionDecisionApproveForSessionApprovalCommands     PermissionDecisionApproveForSessionApprovalCommands     `json:"PermissionDecisionApproveForSessionApprovalCommands"`
	PermissionDecisionApproveForSessionApprovalCustomTool   PermissionDecisionApproveForSessionApprovalCustomTool   `json:"PermissionDecisionApproveForSessionApprovalCustomTool"`
	PermissionDecisionApproveForSessionApprovalMCP          PermissionDecisionApproveForSessionApprovalMCP          `json:"PermissionDecisionApproveForSessionApprovalMcp"`
	PermissionDecisionApproveForSessionApprovalMCPSampling  PermissionDecisionApproveForSessionApprovalMCPSampling  `json:"PermissionDecisionApproveForSessionApprovalMcpSampling"`
	PermissionDecisionApproveForSessionApprovalMemory       PermissionDecisionApproveForSessionApprovalMemory       `json:"PermissionDecisionApproveForSessionApprovalMemory"`
	PermissionDecisionApproveForSessionApprovalRead         PermissionDecisionApproveForSessionApprovalRead         `json:"PermissionDecisionApproveForSessionApprovalRead"`
	PermissionDecisionApproveForSessionApprovalWrite        PermissionDecisionApproveForSessionApprovalWrite        `json:"PermissionDecisionApproveForSessionApprovalWrite"`
	PermissionDecisionApproveOnce                           PermissionDecisionApproveOnce                           `json:"PermissionDecisionApproveOnce"`
	PermissionDecisionReject                                PermissionDecisionReject                                `json:"PermissionDecisionReject"`
	PermissionDecisionRequest                               PermissionDecisionRequest                               `json:"PermissionDecisionRequest"`
	PermissionDecisionUserNotAvailable                      PermissionDecisionUserNotAvailable                      `json:"PermissionDecisionUserNotAvailable"`
	PermissionRequestResult                                 PermissionRequestResult                                 `json:"PermissionRequestResult"`
	PermissionsResetSessionApprovalsRequest                 PermissionsResetSessionApprovalsRequest                 `json:"PermissionsResetSessionApprovalsRequest"`
	PermissionsResetSessionApprovalsResult                  PermissionsResetSessionApprovalsResult                  `json:"PermissionsResetSessionApprovalsResult"`
	PermissionsSetApproveAllRequest                         PermissionsSetApproveAllRequest                         `json:"PermissionsSetApproveAllRequest"`
	PermissionsSetApproveAllResult                          PermissionsSetApproveAllResult                          `json:"PermissionsSetApproveAllResult"`
	PingRequest                                             PingRequest                                             `json:"PingRequest"`
	PingResult                                              PingResult                                              `json:"PingResult"`
	PlanDeleteResult                                        PlanDeleteResult                                        `json:"PlanDeleteResult"`
	PlanReadResult                                          PlanReadResult                                          `json:"PlanReadResult"`
	PlanUpdateRequest                                       PlanUpdateRequest                                       `json:"PlanUpdateRequest"`
	PlanUpdateResult                                        PlanUpdateResult                                        `json:"PlanUpdateResult"`
	Plugin                                                  PluginElement                                           `json:"Plugin"`
	PluginList                                              PluginList                                              `json:"PluginList"`
	ServerSkill                                             ServerSkill                                             `json:"ServerSkill"`
	ServerSkillList                                         ServerSkillList                                         `json:"ServerSkillList"`
	SessionAuthStatus                                       SessionAuthStatus                                       `json:"SessionAuthStatus"`
	SessionFSAppendFileRequest                              SessionFSAppendFileRequest                              `json:"SessionFsAppendFileRequest"`
	SessionFSError                                          SessionFSError                                          `json:"SessionFsError"`
	SessionFSErrorCode                                      SessionFSErrorCode                                      `json:"SessionFsErrorCode"`
	SessionFSExistsRequest                                  SessionFSExistsRequest                                  `json:"SessionFsExistsRequest"`
	SessionFSExistsResult                                   SessionFSExistsResult                                   `json:"SessionFsExistsResult"`
	SessionFSMkdirRequest                                   SessionFSMkdirRequest                                   `json:"SessionFsMkdirRequest"`
	SessionFSReaddirRequest                                 SessionFSReaddirRequest                                 `json:"SessionFsReaddirRequest"`
	SessionFSReaddirResult                                  SessionFSReaddirResult                                  `json:"SessionFsReaddirResult"`
	SessionFSReaddirWithTypesEntry                          SessionFSReaddirWithTypesEntry                          `json:"SessionFsReaddirWithTypesEntry"`
	SessionFSReaddirWithTypesEntryType                      SessionFSReaddirWithTypesEntryType                      `json:"SessionFsReaddirWithTypesEntryType"`
	SessionFSReaddirWithTypesRequest                        SessionFSReaddirWithTypesRequest                        `json:"SessionFsReaddirWithTypesRequest"`
	SessionFSReaddirWithTypesResult                         SessionFSReaddirWithTypesResult                         `json:"SessionFsReaddirWithTypesResult"`
	SessionFSReadFileRequest                                SessionFSReadFileRequest                                `json:"SessionFsReadFileRequest"`
	SessionFSReadFileResult                                 SessionFSReadFileResult                                 `json:"SessionFsReadFileResult"`
	SessionFSRenameRequest                                  SessionFSRenameRequest                                  `json:"SessionFsRenameRequest"`
	SessionFSRmRequest                                      SessionFSRmRequest                                      `json:"SessionFsRmRequest"`
	SessionFSSetProviderConventions                         SessionFSSetProviderConventions                         `json:"SessionFsSetProviderConventions"`
	SessionFSSetProviderRequest                             SessionFSSetProviderRequest                             `json:"SessionFsSetProviderRequest"`
	SessionFSSetProviderResult                              SessionFSSetProviderResult                              `json:"SessionFsSetProviderResult"`
	SessionFSStatRequest                                    SessionFSStatRequest                                    `json:"SessionFsStatRequest"`
	SessionFSStatResult                                     SessionFSStatResult                                     `json:"SessionFsStatResult"`
	SessionFSWriteFileRequest                               SessionFSWriteFileRequest                               `json:"SessionFsWriteFileRequest"`
	SessionLogLevel                                         SessionLogLevel                                         `json:"SessionLogLevel"`
	SessionMode                                             SessionMode                                             `json:"SessionMode"`
	SessionsForkRequest                                     SessionsForkRequest                                     `json:"SessionsForkRequest"`
	SessionsForkResult                                      SessionsForkResult                                      `json:"SessionsForkResult"`
	ShellExecRequest                                        ShellExecRequest                                        `json:"ShellExecRequest"`
	ShellExecResult                                         ShellExecResult                                         `json:"ShellExecResult"`
	ShellKillRequest                                        ShellKillRequest                                        `json:"ShellKillRequest"`
	ShellKillResult                                         ShellKillResult                                         `json:"ShellKillResult"`
	ShellKillSignal                                         ShellKillSignal                                         `json:"ShellKillSignal"`
	Skill                                                   Skill                                                   `json:"Skill"`
	SkillList                                               SkillList                                               `json:"SkillList"`
	SkillsConfigSetDisabledSkillsRequest                    SkillsConfigSetDisabledSkillsRequest                    `json:"SkillsConfigSetDisabledSkillsRequest"`
	SkillsConfigSetDisabledSkillsResult                     SkillsConfigSetDisabledSkillsResult                     `json:"SkillsConfigSetDisabledSkillsResult"`
	SkillsDisableRequest                                    SkillsDisableRequest                                    `json:"SkillsDisableRequest"`
	SkillsDisableResult                                     SkillsDisableResult                                     `json:"SkillsDisableResult"`
	SkillsDiscoverRequest                                   SkillsDiscoverRequest                                   `json:"SkillsDiscoverRequest"`
	SkillsEnableRequest                                     SkillsEnableRequest                                     `json:"SkillsEnableRequest"`
	SkillsEnableResult                                      SkillsEnableResult                                      `json:"SkillsEnableResult"`
	SkillsReloadResult                                      SkillsReloadResult                                      `json:"SkillsReloadResult"`
	Tool                                                    Tool                                                    `json:"Tool"`
	ToolCallResult                                          ToolCallResult                                          `json:"ToolCallResult"`
	ToolList                                                ToolList                                                `json:"ToolList"`
	ToolsHandlePendingToolCall                              *ToolsHandlePendingToolCall                             `json:"ToolsHandlePendingToolCall"`
	ToolsHandlePendingToolCallRequest                       ToolsHandlePendingToolCallRequest                       `json:"ToolsHandlePendingToolCallRequest"`
	ToolsListRequest                                        ToolsListRequest                                        `json:"ToolsListRequest"`
	UIElicitationArrayAnyOfField                            UIElicitationArrayAnyOfField                            `json:"UIElicitationArrayAnyOfField"`
	UIElicitationArrayAnyOfFieldItems                       UIElicitationArrayAnyOfFieldItems                       `json:"UIElicitationArrayAnyOfFieldItems"`
	UIElicitationArrayAnyOfFieldItemsAnyOf                  UIElicitationArrayAnyOfFieldItemsAnyOf                  `json:"UIElicitationArrayAnyOfFieldItemsAnyOf"`
	UIElicitationArrayEnumField                             UIElicitationArrayEnumField                             `json:"UIElicitationArrayEnumField"`
	UIElicitationArrayEnumFieldItems                        UIElicitationArrayEnumFieldItems                        `json:"UIElicitationArrayEnumFieldItems"`
	UIElicitationFieldValue                                 *UIElicitationFieldValue                                `json:"UIElicitationFieldValue"`
	UIElicitationRequest                                    UIElicitationRequest                                    `json:"UIElicitationRequest"`
	UIElicitationResponse                                   UIElicitationResponse                                   `json:"UIElicitationResponse"`
	UIElicitationResponseAction                             UIElicitationResponseAction                             `json:"UIElicitationResponseAction"`
	UIElicitationResponseContent                            map[string]*UIElicitationFieldValue                     `json:"UIElicitationResponseContent"`
	UIElicitationResult                                     UIElicitationResult                                     `json:"UIElicitationResult"`
	UIElicitationSchema                                     UIElicitationSchema                                     `json:"UIElicitationSchema"`
	UIElicitationSchemaProperty                             UIElicitationSchemaProperty                             `json:"UIElicitationSchemaProperty"`
	UIElicitationSchemaPropertyBoolean                      UIElicitationSchemaPropertyBoolean                      `json:"UIElicitationSchemaPropertyBoolean"`
	UIElicitationSchemaPropertyNumber                       UIElicitationSchemaPropertyNumber                       `json:"UIElicitationSchemaPropertyNumber"`
	UIElicitationSchemaPropertyNumberType                   UIElicitationSchemaPropertyNumberTypeEnum               `json:"UIElicitationSchemaPropertyNumberType"`
	UIElicitationSchemaPropertyString                       UIElicitationSchemaPropertyString                       `json:"UIElicitationSchemaPropertyString"`
	UIElicitationSchemaPropertyStringFormat                 UIElicitationSchemaPropertyStringFormat                 `json:"UIElicitationSchemaPropertyStringFormat"`
	UIElicitationStringEnumField                            UIElicitationStringEnumField                            `json:"UIElicitationStringEnumField"`
	UIElicitationStringOneOfField                           UIElicitationStringOneOfField                           `json:"UIElicitationStringOneOfField"`
	UIElicitationStringOneOfFieldOneOf                      UIElicitationStringOneOfFieldOneOf                      `json:"UIElicitationStringOneOfFieldOneOf"`
	UIHandlePendingElicitationRequest                       UIHandlePendingElicitationRequest                       `json:"UIHandlePendingElicitationRequest"`
	UsageGetMetricsResult                                   UsageGetMetricsResult                                   `json:"UsageGetMetricsResult"`
	UsageMetricsCodeChanges                                 UsageMetricsCodeChanges                                 `json:"UsageMetricsCodeChanges"`
	UsageMetricsModelMetric                                 UsageMetricsModelMetric                                 `json:"UsageMetricsModelMetric"`
	UsageMetricsModelMetricRequests                         UsageMetricsModelMetricRequests                         `json:"UsageMetricsModelMetricRequests"`
	UsageMetricsModelMetricUsage                            UsageMetricsModelMetricUsage                            `json:"UsageMetricsModelMetricUsage"`
	WorkspacesCreateFileRequest                             WorkspacesCreateFileRequest                             `json:"WorkspacesCreateFileRequest"`
	WorkspacesCreateFileResult                              WorkspacesCreateFileResult                              `json:"WorkspacesCreateFileResult"`
	WorkspacesGetWorkspaceResult                            WorkspacesGetWorkspaceResult                            `json:"WorkspacesGetWorkspaceResult"`
	WorkspacesListFilesResult                               WorkspacesListFilesResult                               `json:"WorkspacesListFilesResult"`
	WorkspacesReadFileRequest                               WorkspacesReadFileRequest                               `json:"WorkspacesReadFileRequest"`
	WorkspacesReadFileResult                                WorkspacesReadFileResult                                `json:"WorkspacesReadFileResult"`
}

type ServerAccountApi added in v0.2.1

type ServerAccountApi serverApi

func (*ServerAccountApi) GetQuota added in v0.2.1

type ServerMcpApi added in v0.2.1

type ServerMcpApi serverApi

func (*ServerMcpApi) Config added in v0.3.0

func (s *ServerMcpApi) Config() *ServerMcpConfigApi

func (*ServerMcpApi) Discover added in v0.3.0

func (a *ServerMcpApi) Discover(ctx context.Context, params *MCPDiscoverRequest) (*MCPDiscoverResult, error)

type ServerMcpConfigApi added in v0.3.0

type ServerMcpConfigApi serverApi

func (*ServerMcpConfigApi) Add added in v0.3.0

func (*ServerMcpConfigApi) Disable added in v0.3.0

func (*ServerMcpConfigApi) Enable added in v0.3.0

func (*ServerMcpConfigApi) List added in v0.3.0

func (*ServerMcpConfigApi) Remove added in v0.3.0

func (*ServerMcpConfigApi) Update added in v0.3.0

type ServerModelsApi added in v0.2.1

type ServerModelsApi serverApi

func (*ServerModelsApi) List added in v0.2.1

func (a *ServerModelsApi) List(ctx context.Context, params *ModelsListRequest) (*ModelList, error)

type ServerRpc

type ServerRpc struct {
	Models    *ServerModelsApi
	Tools     *ServerToolsApi
	Account   *ServerAccountApi
	Mcp       *ServerMcpApi
	Skills    *ServerSkillsApi
	SessionFs *ServerSessionFsApi
	Sessions  *ServerSessionsApi
	// 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 *PingRequest) (*PingResult, error)

type ServerSessionFsApi added in v0.2.1

type ServerSessionFsApi serverApi

func (*ServerSessionFsApi) SetProvider added in v0.2.1

type ServerSessionsApi added in v0.2.2

type ServerSessionsApi serverApi

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

func (*ServerSessionsApi) Fork added in v0.2.2

type ServerSkill added in v0.3.0

type ServerSkill struct {
	// Description of what the skill does
	Description string `json:"description"`
	// Whether the skill is currently enabled (based on global config)
	Enabled bool `json:"enabled"`
	// Unique identifier for the skill
	Name string `json:"name"`
	// Absolute path to the skill file
	Path *string `json:"path,omitempty"`
	// The project path this skill belongs to (only for project/inherited skills)
	ProjectPath *string `json:"projectPath,omitempty"`
	// Source location type (e.g., project, personal-copilot, plugin, builtin)
	Source string `json:"source"`
	// Whether the skill can be invoked by the user as a slash command
	UserInvocable bool `json:"userInvocable"`
}

type ServerSkillList added in v0.3.0

type ServerSkillList struct {
	// All discovered skills across all sources
	Skills []ServerSkill `json:"skills"`
}

type ServerSkillsApi added in v0.3.0

type ServerSkillsApi serverApi

func (*ServerSkillsApi) Config added in v0.3.0

func (*ServerSkillsApi) Discover added in v0.3.0

type ServerSkillsConfigApi added in v0.3.0

type ServerSkillsConfigApi serverApi

func (*ServerSkillsConfigApi) SetDisabledSkills added in v0.3.0

type ServerToolsApi added in v0.2.1

type ServerToolsApi serverApi

func (*ServerToolsApi) List added in v0.2.1

func (a *ServerToolsApi) List(ctx context.Context, params *ToolsListRequest) (*ToolList, error)

type SessionAuthStatus added in v0.3.0

type SessionAuthStatus struct {
	// Authentication type
	AuthType *AuthInfoType `json:"authType,omitempty"`
	// Copilot plan tier (e.g., individual_pro, business)
	CopilotPlan *string `json:"copilotPlan,omitempty"`
	// Authentication host URL
	Host *string `json:"host,omitempty"`
	// Whether the session has resolved authentication
	IsAuthenticated bool `json:"isAuthenticated"`
	// Authenticated login/username, if available
	Login *string `json:"login,omitempty"`
	// Human-readable authentication status description
	StatusMessage *string `json:"statusMessage,omitempty"`
}

type SessionFSAppendFileRequest added in v0.3.0

type SessionFSAppendFileRequest struct {
	// Content to append
	Content string `json:"content"`
	// Optional POSIX-style mode for newly created files
	Mode *int64 `json:"mode,omitempty"`
	// Path using SessionFs conventions
	Path string `json:"path"`
	// Target session identifier
	SessionID string `json:"sessionId"`
}

type SessionFSError added in v0.3.0

type SessionFSError struct {
	// Error classification
	Code SessionFSErrorCode `json:"code"`
	// Free-form detail about the error, for logging/diagnostics
	Message *string `json:"message,omitempty"`
}

Describes a filesystem error.

type SessionFSErrorCode added in v0.3.0

type SessionFSErrorCode string

Error classification

const (
	SessionFSErrorCodeENOENT  SessionFSErrorCode = "ENOENT"
	SessionFSErrorCodeUNKNOWN SessionFSErrorCode = "UNKNOWN"
)

type SessionFSExistsRequest added in v0.3.0

type SessionFSExistsRequest struct {
	// Path using SessionFs conventions
	Path string `json:"path"`
	// Target session identifier
	SessionID string `json:"sessionId"`
}

type SessionFSExistsResult added in v0.2.2

type SessionFSExistsResult struct {
	// Whether the path exists
	Exists bool `json:"exists"`
}

type SessionFSMkdirRequest added in v0.3.0

type SessionFSMkdirRequest struct {
	// Optional POSIX-style mode for newly created directories
	Mode *int64 `json:"mode,omitempty"`
	// Path using SessionFs conventions
	Path string `json:"path"`
	// Create parent directories as needed
	Recursive *bool `json:"recursive,omitempty"`
	// Target session identifier
	SessionID string `json:"sessionId"`
}

type SessionFSReadFileRequest added in v0.3.0

type SessionFSReadFileRequest struct {
	// Path using SessionFs conventions
	Path string `json:"path"`
	// Target session identifier
	SessionID string `json:"sessionId"`
}

type SessionFSReadFileResult added in v0.2.2

type SessionFSReadFileResult struct {
	// File content as UTF-8 string
	Content string `json:"content"`
	// Describes a filesystem error.
	Error *SessionFSError `json:"error,omitempty"`
}

type SessionFSReaddirRequest added in v0.3.0

type SessionFSReaddirRequest struct {
	// Path using SessionFs conventions
	Path string `json:"path"`
	// Target session identifier
	SessionID string `json:"sessionId"`
}

type SessionFSReaddirResult added in v0.2.2

type SessionFSReaddirResult struct {
	// Entry names in the directory
	Entries []string `json:"entries"`
	// Describes a filesystem error.
	Error *SessionFSError `json:"error,omitempty"`
}

type SessionFSReaddirWithTypesEntry added in v0.3.0

type SessionFSReaddirWithTypesEntry struct {
	// Entry name
	Name string `json:"name"`
	// Entry type
	Type SessionFSReaddirWithTypesEntryType `json:"type"`
}

type SessionFSReaddirWithTypesEntryType added in v0.3.0

type SessionFSReaddirWithTypesEntryType string

Entry type

const (
	SessionFSReaddirWithTypesEntryTypeDirectory SessionFSReaddirWithTypesEntryType = "directory"
	SessionFSReaddirWithTypesEntryTypeFile      SessionFSReaddirWithTypesEntryType = "file"
)

type SessionFSReaddirWithTypesRequest added in v0.3.0

type SessionFSReaddirWithTypesRequest struct {
	// Path using SessionFs conventions
	Path string `json:"path"`
	// Target session identifier
	SessionID string `json:"sessionId"`
}

type SessionFSReaddirWithTypesResult added in v0.2.2

type SessionFSReaddirWithTypesResult struct {
	// Directory entries with type information
	Entries []SessionFSReaddirWithTypesEntry `json:"entries"`
	// Describes a filesystem error.
	Error *SessionFSError `json:"error,omitempty"`
}

type SessionFSRenameRequest added in v0.3.0

type SessionFSRenameRequest struct {
	// Destination path using SessionFs conventions
	Dest string `json:"dest"`
	// Target session identifier
	SessionID string `json:"sessionId"`
	// Source path using SessionFs conventions
	Src string `json:"src"`
}

type SessionFSRmRequest added in v0.3.0

type SessionFSRmRequest struct {
	// Ignore errors if the path does not exist
	Force *bool `json:"force,omitempty"`
	// Path using SessionFs conventions
	Path string `json:"path"`
	// Remove directories and their contents recursively
	Recursive *bool `json:"recursive,omitempty"`
	// Target session identifier
	SessionID string `json:"sessionId"`
}

type SessionFSSetProviderConventions added in v0.3.0

type SessionFSSetProviderConventions string

Path conventions used by this filesystem

const (
	SessionFSSetProviderConventionsPosix   SessionFSSetProviderConventions = "posix"
	SessionFSSetProviderConventionsWindows SessionFSSetProviderConventions = "windows"
)

type SessionFSSetProviderRequest added in v0.3.0

type SessionFSSetProviderRequest struct {
	// Path conventions used by this filesystem
	Conventions SessionFSSetProviderConventions `json:"conventions"`
	// Initial working directory for sessions
	InitialCwd string `json:"initialCwd"`
	// Path within each session's SessionFs where the runtime stores files for that session
	SessionStatePath string `json:"sessionStatePath"`
}

type SessionFSSetProviderResult added in v0.2.1

type SessionFSSetProviderResult struct {
	// Whether the provider was set successfully
	Success bool `json:"success"`
}

type SessionFSStatRequest added in v0.3.0

type SessionFSStatRequest struct {
	// Path using SessionFs conventions
	Path string `json:"path"`
	// Target session identifier
	SessionID string `json:"sessionId"`
}

type SessionFSStatResult added in v0.2.2

type SessionFSStatResult struct {
	// ISO 8601 timestamp of creation
	Birthtime time.Time `json:"birthtime"`
	// Describes a filesystem error.
	Error *SessionFSError `json:"error,omitempty"`
	// Whether the path is a directory
	IsDirectory bool `json:"isDirectory"`
	// Whether the path is a file
	IsFile bool `json:"isFile"`
	// ISO 8601 timestamp of last modification
	Mtime time.Time `json:"mtime"`
	// File size in bytes
	Size int64 `json:"size"`
}

type SessionFSWriteFileRequest added in v0.3.0

type SessionFSWriteFileRequest struct {
	// Content to write
	Content string `json:"content"`
	// Optional POSIX-style mode for newly created files
	Mode *int64 `json:"mode,omitempty"`
	// Path using SessionFs conventions
	Path string `json:"path"`
	// Target session identifier
	SessionID string `json:"sessionId"`
}

type SessionLogLevel added in v0.3.0

type SessionLogLevel string

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

const (
	SessionLogLevelError   SessionLogLevel = "error"
	SessionLogLevelInfo    SessionLogLevel = "info"
	SessionLogLevelWarning SessionLogLevel = "warning"
)

type SessionMode added in v0.3.0

type SessionMode string

The agent mode. Valid values: "interactive", "plan", "autopilot".

const (
	SessionModeAutopilot   SessionMode = "autopilot"
	SessionModeInteractive SessionMode = "interactive"
	SessionModePlan        SessionMode = "plan"
)

type SessionRpc

type SessionRpc struct {
	Auth         *AuthApi
	Model        *ModelApi
	Mode         *ModeApi
	Name         *NameApi
	Plan         *PlanApi
	Workspaces   *WorkspacesApi
	Instructions *InstructionsApi
	Fleet        *FleetApi
	Agent        *AgentApi
	Skills       *SkillsApi
	Mcp          *McpApi
	Plugins      *PluginsApi
	Extensions   *ExtensionsApi
	Tools        *ToolsApi
	Commands     *CommandsApi
	UI           *UIApi
	Permissions  *PermissionsApi
	Shell        *ShellApi
	History      *HistoryApi
	Usage        *UsageApi
	// 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

func (a *SessionRpc) Log(ctx context.Context, params *LogRequest) (*LogResult, error)

type SessionSyncLevel added in v0.3.0

type SessionSyncLevel string
const (
	SessionSyncLevelRepoAndUser SessionSyncLevel = "repo_and_user"
	SessionSyncLevelLocal       SessionSyncLevel = "local"
	SessionSyncLevelUser        SessionSyncLevel = "user"
)

type SessionsForkRequest added in v0.3.0

type SessionsForkRequest struct {
	// Source session ID to fork from
	SessionID string `json:"sessionId"`
	// Optional event ID boundary. When provided, the fork includes only events before this ID
	// (exclusive). When omitted, all events are included.
	ToEventID *string `json:"toEventId,omitempty"`
}

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

type SessionsForkResult added in v0.2.2

type SessionsForkResult struct {
	// The new forked session's ID
	SessionID string `json:"sessionId"`
}

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

type ShellApi added in v0.2.1

type ShellApi sessionApi

func (*ShellApi) Exec added in v0.2.1

func (a *ShellApi) Exec(ctx context.Context, params *ShellExecRequest) (*ShellExecResult, error)

func (*ShellApi) Kill added in v0.2.1

func (a *ShellApi) Kill(ctx context.Context, params *ShellKillRequest) (*ShellKillResult, error)

type ShellExecRequest added in v0.3.0

type ShellExecRequest 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 *int64 `json:"timeout,omitempty"`
}

type ShellExecResult added in v0.3.0

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

type ShellKillRequest added in v0.3.0

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

type ShellKillResult added in v0.3.0

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

type ShellKillSignal added in v0.3.0

type ShellKillSignal string

Signal to send (default: SIGTERM)

const (
	ShellKillSignalSIGINT  ShellKillSignal = "SIGINT"
	ShellKillSignalSIGKILL ShellKillSignal = "SIGKILL"
	ShellKillSignalSIGTERM ShellKillSignal = "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 SkillList added in v0.3.0

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

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

type SkillsApi added in v0.2.1

type SkillsApi sessionApi

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

func (*SkillsApi) Disable added in v0.2.1

func (*SkillsApi) Enable added in v0.2.1

func (*SkillsApi) List added in v0.2.1

func (a *SkillsApi) List(ctx context.Context) (*SkillList, error)

func (*SkillsApi) Reload added in v0.2.1

func (a *SkillsApi) Reload(ctx context.Context) (*SkillsReloadResult, error)

type SkillsConfigSetDisabledSkillsRequest added in v0.3.0

type SkillsConfigSetDisabledSkillsRequest struct {
	// List of skill names to disable
	DisabledSkills []string `json:"disabledSkills"`
}

type SkillsConfigSetDisabledSkillsResult added in v0.3.0

type SkillsConfigSetDisabledSkillsResult struct {
}

type SkillsDisableRequest added in v0.3.0

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

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

type SkillsDisableResult added in v0.3.0

type SkillsDisableResult struct {
}

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

type SkillsDiscoverRequest added in v0.3.0

type SkillsDiscoverRequest struct {
	// Optional list of project directory paths to scan for project-scoped skills
	ProjectPaths []string `json:"projectPaths,omitempty"`
	// Optional list of additional skill directory paths to include
	SkillDirectories []string `json:"skillDirectories,omitempty"`
}

type SkillsEnableRequest added in v0.3.0

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

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

type SkillsEnableResult added in v0.3.0

type SkillsEnableResult struct {
}

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

type SkillsReloadResult added in v0.3.0

type SkillsReloadResult struct {
}

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

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]any `json:"parameters,omitempty"`
}

type ToolCallResult added in v0.3.0

type ToolCallResult struct {
	// Error message if the tool call failed
	Error *string `json:"error,omitempty"`
	// Type of the tool result
	ResultType *string `json:"resultType,omitempty"`
	// Text result to send back to the LLM
	TextResultForLlm string `json:"textResultForLlm"`
	// Telemetry data from tool execution
	ToolTelemetry map[string]any `json:"toolTelemetry,omitempty"`
}

type ToolList added in v0.3.0

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

type ToolsApi added in v0.2.1

type ToolsApi sessionApi

func (*ToolsApi) HandlePendingToolCall added in v0.2.1

func (a *ToolsApi) HandlePendingToolCall(ctx context.Context, params *ToolsHandlePendingToolCallRequest) (*HandleToolCallResult, error)

type ToolsHandlePendingToolCall added in v0.3.0

type ToolsHandlePendingToolCall struct {
	String         *string
	ToolCallResult *ToolCallResult
}

Tool call result (string or expanded result object)

func (ToolsHandlePendingToolCall) MarshalJSON added in v0.3.0

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

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

func (*ToolsHandlePendingToolCall) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON deserializes a JSON value into the appropriate ToolsHandlePendingToolCall variant.

type ToolsHandlePendingToolCallRequest added in v0.3.0

type ToolsHandlePendingToolCallRequest struct {
	// Error message if the tool call failed
	Error *string `json:"error,omitempty"`
	// Request ID of the pending tool call
	RequestID string `json:"requestId"`
	// Tool call result (string or expanded result object)
	Result *ToolsHandlePendingToolCall `json:"result"`
}

type ToolsListRequest added in v0.3.0

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

type UIApi added in v0.2.2

type UIApi sessionApi

func (*UIApi) Elicitation added in v0.2.2

func (a *UIApi) Elicitation(ctx context.Context, params *UIElicitationRequest) (*UIElicitationResponse, error)

func (*UIApi) HandlePendingElicitation added in v0.2.2

func (a *UIApi) HandlePendingElicitation(ctx context.Context, params *UIHandlePendingElicitationRequest) (*UIElicitationResult, error)

type UIElicitationArrayAnyOfField added in v0.3.0

type UIElicitationArrayAnyOfField struct {
	Default     []string                          `json:"default,omitempty"`
	Description *string                           `json:"description,omitempty"`
	Items       UIElicitationArrayAnyOfFieldItems `json:"items"`
	MaxItems    *float64                          `json:"maxItems,omitempty"`
	MinItems    *float64                          `json:"minItems,omitempty"`
	Title       *string                           `json:"title,omitempty"`
	Type        UIElicitationArrayAnyOfFieldType  `json:"type"`
}

type UIElicitationArrayAnyOfFieldItems added in v0.3.0

type UIElicitationArrayAnyOfFieldItems struct {
	AnyOf []UIElicitationArrayAnyOfFieldItemsAnyOf `json:"anyOf"`
}

type UIElicitationArrayAnyOfFieldItemsAnyOf added in v0.3.0

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

type UIElicitationArrayAnyOfFieldType added in v0.3.0

type UIElicitationArrayAnyOfFieldType string
const (
	UIElicitationArrayAnyOfFieldTypeArray UIElicitationArrayAnyOfFieldType = "array"
)

type UIElicitationArrayEnumField added in v0.3.0

type UIElicitationArrayEnumField struct {
	Default     []string                         `json:"default,omitempty"`
	Description *string                          `json:"description,omitempty"`
	Items       UIElicitationArrayEnumFieldItems `json:"items"`
	MaxItems    *float64                         `json:"maxItems,omitempty"`
	MinItems    *float64                         `json:"minItems,omitempty"`
	Title       *string                          `json:"title,omitempty"`
	Type        UIElicitationArrayAnyOfFieldType `json:"type"`
}

type UIElicitationArrayEnumFieldItems added in v0.3.0

type UIElicitationArrayEnumFieldItems struct {
	Enum []string                             `json:"enum"`
	Type UIElicitationArrayEnumFieldItemsType `json:"type"`
}

type UIElicitationArrayEnumFieldItemsType added in v0.3.0

type UIElicitationArrayEnumFieldItemsType string
const (
	UIElicitationArrayEnumFieldItemsTypeString UIElicitationArrayEnumFieldItemsType = "string"
)

type UIElicitationArrayFieldItems added in v0.3.0

type UIElicitationArrayFieldItems struct {
	Enum  []string                                 `json:"enum,omitempty"`
	Type  *UIElicitationArrayEnumFieldItemsType    `json:"type,omitempty"`
	AnyOf []UIElicitationArrayAnyOfFieldItemsAnyOf `json:"anyOf,omitempty"`
}

type UIElicitationFieldValue added in v0.3.0

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

type UIElicitationRequest added in v0.3.0

type UIElicitationRequest 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 UIElicitationSchema `json:"requestedSchema"`
}

type UIElicitationResponse added in v0.3.0

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

The elicitation response (accept with form values, decline, or cancel)

type UIElicitationResponseAction added in v0.3.0

type UIElicitationResponseAction string

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

const (
	UIElicitationResponseActionAccept  UIElicitationResponseAction = "accept"
	UIElicitationResponseActionCancel  UIElicitationResponseAction = "cancel"
	UIElicitationResponseActionDecline UIElicitationResponseAction = "decline"
)

type UIElicitationResult added in v0.3.0

type UIElicitationResult struct {
	// Whether the response was accepted. False if the request was already resolved by another
	// client.
	Success bool `json:"success"`
}

type UIElicitationSchema added in v0.3.0

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

JSON Schema describing the form fields to present to the user

type UIElicitationSchemaProperty added in v0.3.0

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

type UIElicitationSchemaPropertyBoolean added in v0.3.0

type UIElicitationSchemaPropertyBoolean struct {
	Default     *bool                                  `json:"default,omitempty"`
	Description *string                                `json:"description,omitempty"`
	Title       *string                                `json:"title,omitempty"`
	Type        UIElicitationSchemaPropertyBooleanType `json:"type"`
}

type UIElicitationSchemaPropertyBooleanType added in v0.3.0

type UIElicitationSchemaPropertyBooleanType string
const (
	UIElicitationSchemaPropertyBooleanTypeBoolean UIElicitationSchemaPropertyBooleanType = "boolean"
)

type UIElicitationSchemaPropertyNumber added in v0.3.0

type UIElicitationSchemaPropertyNumber struct {
	Default     *float64                                  `json:"default,omitempty"`
	Description *string                                   `json:"description,omitempty"`
	Maximum     *float64                                  `json:"maximum,omitempty"`
	Minimum     *float64                                  `json:"minimum,omitempty"`
	Title       *string                                   `json:"title,omitempty"`
	Type        UIElicitationSchemaPropertyNumberTypeEnum `json:"type"`
}

type UIElicitationSchemaPropertyNumberTypeEnum added in v0.3.0

type UIElicitationSchemaPropertyNumberTypeEnum string
const (
	UIElicitationSchemaPropertyNumberTypeEnumInteger UIElicitationSchemaPropertyNumberTypeEnum = "integer"
	UIElicitationSchemaPropertyNumberTypeEnumNumber  UIElicitationSchemaPropertyNumberTypeEnum = "number"
)

type UIElicitationSchemaPropertyString added in v0.3.0

type UIElicitationSchemaPropertyString struct {
	Default     *string                                  `json:"default,omitempty"`
	Description *string                                  `json:"description,omitempty"`
	Format      *UIElicitationSchemaPropertyStringFormat `json:"format,omitempty"`
	MaxLength   *float64                                 `json:"maxLength,omitempty"`
	MinLength   *float64                                 `json:"minLength,omitempty"`
	Title       *string                                  `json:"title,omitempty"`
	Type        UIElicitationArrayEnumFieldItemsType     `json:"type"`
}

type UIElicitationSchemaPropertyStringFormat added in v0.3.0

type UIElicitationSchemaPropertyStringFormat string
const (
	UIElicitationSchemaPropertyStringFormatDate     UIElicitationSchemaPropertyStringFormat = "date"
	UIElicitationSchemaPropertyStringFormatDateTime UIElicitationSchemaPropertyStringFormat = "date-time"
	UIElicitationSchemaPropertyStringFormatEmail    UIElicitationSchemaPropertyStringFormat = "email"
	UIElicitationSchemaPropertyStringFormatURI      UIElicitationSchemaPropertyStringFormat = "uri"
)

type UIElicitationSchemaPropertyType added in v0.3.0

type UIElicitationSchemaPropertyType string
const (
	UIElicitationSchemaPropertyTypeInteger UIElicitationSchemaPropertyType = "integer"
	UIElicitationSchemaPropertyTypeNumber  UIElicitationSchemaPropertyType = "number"
	UIElicitationSchemaPropertyTypeArray   UIElicitationSchemaPropertyType = "array"
	UIElicitationSchemaPropertyTypeBoolean UIElicitationSchemaPropertyType = "boolean"
	UIElicitationSchemaPropertyTypeString  UIElicitationSchemaPropertyType = "string"
)

type UIElicitationSchemaType added in v0.3.0

type UIElicitationSchemaType string
const (
	UIElicitationSchemaTypeObject UIElicitationSchemaType = "object"
)

type UIElicitationStringEnumField added in v0.3.0

type UIElicitationStringEnumField struct {
	Default     *string                              `json:"default,omitempty"`
	Description *string                              `json:"description,omitempty"`
	Enum        []string                             `json:"enum"`
	EnumNames   []string                             `json:"enumNames,omitempty"`
	Title       *string                              `json:"title,omitempty"`
	Type        UIElicitationArrayEnumFieldItemsType `json:"type"`
}

type UIElicitationStringOneOfField added in v0.3.0

type UIElicitationStringOneOfField struct {
	Default     *string                              `json:"default,omitempty"`
	Description *string                              `json:"description,omitempty"`
	OneOf       []UIElicitationStringOneOfFieldOneOf `json:"oneOf"`
	Title       *string                              `json:"title,omitempty"`
	Type        UIElicitationArrayEnumFieldItemsType `json:"type"`
}

type UIElicitationStringOneOfFieldOneOf added in v0.3.0

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

type UIHandlePendingElicitationRequest added in v0.3.0

type UIHandlePendingElicitationRequest struct {
	// The unique request ID from the elicitation.requested event
	RequestID string `json:"requestId"`
	// The elicitation response (accept with form values, decline, or cancel)
	Result UIElicitationResponse `json:"result"`
}

type UsageApi added in v0.3.0

type UsageApi sessionApi

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

func (*UsageApi) GetMetrics added in v0.3.0

func (a *UsageApi) GetMetrics(ctx context.Context) (*UsageGetMetricsResult, error)

type UsageGetMetricsResult added in v0.3.0

type UsageGetMetricsResult struct {
	// Aggregated code change metrics
	CodeChanges UsageMetricsCodeChanges `json:"codeChanges"`
	// Currently active model identifier
	CurrentModel *string `json:"currentModel,omitempty"`
	// Input tokens from the most recent main-agent API call
	LastCallInputTokens int64 `json:"lastCallInputTokens"`
	// Output tokens from the most recent main-agent API call
	LastCallOutputTokens int64 `json:"lastCallOutputTokens"`
	// Per-model token and request metrics, keyed by model identifier
	ModelMetrics map[string]UsageMetricsModelMetric `json:"modelMetrics"`
	// Session start timestamp (epoch milliseconds)
	SessionStartTime int64 `json:"sessionStartTime"`
	// Total time spent in model API calls (milliseconds)
	TotalAPIDurationMS float64 `json:"totalApiDurationMs"`
	// Total user-initiated premium request cost across all models (may be fractional due to
	// multipliers)
	TotalPremiumRequestCost float64 `json:"totalPremiumRequestCost"`
	// Raw count of user-initiated API requests
	TotalUserRequests int64 `json:"totalUserRequests"`
}

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

type UsageMetricsCodeChanges added in v0.3.0

type UsageMetricsCodeChanges struct {
	// Number of distinct files modified
	FilesModifiedCount int64 `json:"filesModifiedCount"`
	// Total lines of code added
	LinesAdded int64 `json:"linesAdded"`
	// Total lines of code removed
	LinesRemoved int64 `json:"linesRemoved"`
}

Aggregated code change metrics

type UsageMetricsModelMetric added in v0.3.0

type UsageMetricsModelMetric struct {
	// Request count and cost metrics for this model
	Requests UsageMetricsModelMetricRequests `json:"requests"`
	// Token usage metrics for this model
	Usage UsageMetricsModelMetricUsage `json:"usage"`
}

type UsageMetricsModelMetricRequests added in v0.3.0

type UsageMetricsModelMetricRequests struct {
	// User-initiated premium request cost (with multiplier applied)
	Cost float64 `json:"cost"`
	// Number of API requests made with this model
	Count int64 `json:"count"`
}

Request count and cost metrics for this model

type UsageMetricsModelMetricUsage added in v0.3.0

type UsageMetricsModelMetricUsage struct {
	// Total tokens read from prompt cache
	CacheReadTokens int64 `json:"cacheReadTokens"`
	// Total tokens written to prompt cache
	CacheWriteTokens int64 `json:"cacheWriteTokens"`
	// Total input tokens consumed
	InputTokens int64 `json:"inputTokens"`
	// Total output tokens produced
	OutputTokens int64 `json:"outputTokens"`
	// Total output tokens used for reasoning
	ReasoningTokens *int64 `json:"reasoningTokens,omitempty"`
}

Token usage metrics for this model

type WorkspaceClass added in v0.3.0

type WorkspaceClass struct {
	Branch                 *string           `json:"branch,omitempty"`
	ChronicleSyncDismissed *bool             `json:"chronicle_sync_dismissed,omitempty"`
	CreatedAt              *time.Time        `json:"created_at,omitempty"`
	Cwd                    *string           `json:"cwd,omitempty"`
	GitRoot                *string           `json:"git_root,omitempty"`
	HostType               *HostType         `json:"host_type,omitempty"`
	ID                     string            `json:"id"`
	McLastEventID          *string           `json:"mc_last_event_id,omitempty"`
	McSessionID            *string           `json:"mc_session_id,omitempty"`
	McTaskID               *string           `json:"mc_task_id,omitempty"`
	Name                   *string           `json:"name,omitempty"`
	RemoteSteerable        *bool             `json:"remote_steerable,omitempty"`
	Repository             *string           `json:"repository,omitempty"`
	SessionSyncLevel       *SessionSyncLevel `json:"session_sync_level,omitempty"`
	Summary                *string           `json:"summary,omitempty"`
	SummaryCount           *int64            `json:"summary_count,omitempty"`
	UpdatedAt              *time.Time        `json:"updated_at,omitempty"`
}

type WorkspacesApi added in v0.3.0

type WorkspacesApi sessionApi

func (*WorkspacesApi) CreateFile added in v0.3.0

func (*WorkspacesApi) GetWorkspace added in v0.3.0

func (*WorkspacesApi) ListFiles added in v0.3.0

func (*WorkspacesApi) ReadFile added in v0.3.0

type WorkspacesCreateFileRequest added in v0.3.0

type WorkspacesCreateFileRequest 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 WorkspacesCreateFileResult added in v0.3.0

type WorkspacesCreateFileResult struct {
}

type WorkspacesGetWorkspaceResult added in v0.3.0

type WorkspacesGetWorkspaceResult struct {
	// Current workspace metadata, or null if not available
	Workspace *WorkspaceClass `json:"workspace"`
}

type WorkspacesListFilesResult added in v0.3.0

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

type WorkspacesReadFileRequest added in v0.3.0

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

type WorkspacesReadFileResult added in v0.3.0

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

Jump to

Keyboard shortcuts

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