rpc

package
v1.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 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,omitempty"`
}

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"`
	// Absolute local file path of the agent definition. Only set for file-based agents loaded
	// from disk; remote agents do not have a path.
	Path *string `json:"path,omitempty"`
}

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 ConnectRequest added in v1.0.0

type ConnectRequest struct {
	// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN
	Token *string `json:"token,omitempty"`
}

Internal: ConnectRequest is an internal SDK API and is not part of the public surface.

type ConnectResult added in v1.0.0

type ConnectResult struct {
	// Always true on success
	Ok bool `json:"ok"`
	// Server protocol version number
	ProtocolVersion int64 `json:"protocolVersion"`
	// Server package version
	Version string `json:"version"`
}

Internal: ConnectResult is an internal SDK API and is not part of the public surface.

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 EmbeddedBlobResourceContents added in v1.0.0

type EmbeddedBlobResourceContents struct {
	// Base64-encoded binary content of the resource
	Blob string `json:"blob"`
	// MIME type of the blob content
	MIMEType *string `json:"mimeType,omitempty"`
	// URI identifying the resource
	URI string `json:"uri"`
}

type EmbeddedTextResourceContents added in v1.0.0

type EmbeddedTextResourceContents struct {
	// MIME type of the text content
	MIMEType *string `json:"mimeType,omitempty"`
	// Text content of the resource
	Text string `json:"text"`
	// URI identifying the resource
	URI string `json:"uri"`
}

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 ExternalToolResult added in v1.0.0

type ExternalToolResult struct {
	ExternalToolTextResultForLlm *ExternalToolTextResultForLlm
	String                       *string
}

Tool call result (string or expanded result object)

func (ExternalToolResult) MarshalJSON

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

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

func (*ExternalToolResult) UnmarshalJSON

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

UnmarshalJSON deserializes a JSON value into the appropriate ExternalToolResult variant.

type ExternalToolTextResultForLlm added in v1.0.0

type ExternalToolTextResultForLlm struct {
	// Structured content blocks from the tool
	Contents []ExternalToolTextResultForLlmContent `json:"contents,omitempty"`
	// Optional error message for failed executions
	Error *string `json:"error,omitempty"`
	// Execution outcome classification. Optional for back-compat; normalized to 'success' (or
	// 'failure' when error is present) when missing or unrecognized.
	ResultType *string `json:"resultType,omitempty"`
	// Detailed log content for timeline display
	SessionLog *string `json:"sessionLog,omitempty"`
	// Text result returned to the model
	TextResultForLlm string `json:"textResultForLlm"`
	// Optional tool-specific telemetry
	ToolTelemetry map[string]any `json:"toolTelemetry,omitempty"`
}

Expanded external tool result payload

type ExternalToolTextResultForLlmContent added in v1.0.0

type ExternalToolTextResultForLlmContent struct {
	// The text content
	//
	// Terminal/shell output text
	Text *string `json:"text,omitempty"`
	// Content block type discriminator
	Type ExternalToolTextResultForLlmContentType `json:"type"`
	// Working directory where the command was executed
	Cwd *string `json:"cwd,omitempty"`
	// Process exit code, if the command has completed
	ExitCode *float64 `json:"exitCode,omitempty"`
	// Base64-encoded image data
	//
	// Base64-encoded audio data
	Data *string `json:"data,omitempty"`
	// MIME type of the image (e.g., image/png, image/jpeg)
	//
	// MIME type of the audio (e.g., audio/wav, audio/mpeg)
	//
	// MIME type of the resource content
	MIMEType *string `json:"mimeType,omitempty"`
	// Human-readable description of the resource
	Description *string `json:"description,omitempty"`
	// Icons associated with this resource
	Icons []ExternalToolTextResultForLlmContentResourceLinkIcon `json:"icons,omitempty"`
	// Resource name identifier
	Name *string `json:"name,omitempty"`
	// Size of the resource in bytes
	Size *float64 `json:"size,omitempty"`
	// Human-readable display title for the resource
	Title *string `json:"title,omitempty"`
	// URI identifying the resource
	URI *string `json:"uri,omitempty"`
	// The embedded resource contents, either text or base64-encoded binary
	Resource *ExternalToolTextResultForLlmContentResourceDetails `json:"resource,omitempty"`
}

A content block within a tool result, which may be text, terminal output, image, audio, or a resource

Plain text content block

Terminal/shell output content block with optional exit code and working directory

Image content block with base64-encoded data

Audio content block with base64-encoded data

Embedded resource content block with inline text or binary data

type ExternalToolTextResultForLlmContentAudio added in v1.0.0

type ExternalToolTextResultForLlmContentAudio struct {
	// Base64-encoded audio data
	Data string `json:"data"`
	// MIME type of the audio (e.g., audio/wav, audio/mpeg)
	MIMEType string `json:"mimeType"`
	// Content block type discriminator
	Type ExternalToolTextResultForLlmContentAudioType `json:"type"`
}

Audio content block with base64-encoded data

type ExternalToolTextResultForLlmContentAudioType

type ExternalToolTextResultForLlmContentAudioType string
const (
	ExternalToolTextResultForLlmContentAudioTypeAudio ExternalToolTextResultForLlmContentAudioType = "audio"
)

type ExternalToolTextResultForLlmContentImage added in v1.0.0

type ExternalToolTextResultForLlmContentImage struct {
	// Base64-encoded image data
	Data string `json:"data"`
	// MIME type of the image (e.g., image/png, image/jpeg)
	MIMEType string `json:"mimeType"`
	// Content block type discriminator
	Type ExternalToolTextResultForLlmContentImageType `json:"type"`
}

Image content block with base64-encoded data

type ExternalToolTextResultForLlmContentImageType

type ExternalToolTextResultForLlmContentImageType string
const (
	ExternalToolTextResultForLlmContentImageTypeImage ExternalToolTextResultForLlmContentImageType = "image"
)

type ExternalToolTextResultForLlmContentResource added in v1.0.0

type ExternalToolTextResultForLlmContentResource struct {
	// The embedded resource contents, either text or base64-encoded binary
	Resource ExternalToolTextResultForLlmContentResourceDetails `json:"resource"`
	// Content block type discriminator
	Type ExternalToolTextResultForLlmContentResourceType `json:"type"`
}

Embedded resource content block with inline text or binary data

type ExternalToolTextResultForLlmContentResourceDetails added in v1.0.0

type ExternalToolTextResultForLlmContentResourceDetails struct {
	// MIME type of the text content
	//
	// MIME type of the blob content
	MIMEType *string `json:"mimeType,omitempty"`
	// Text content of the resource
	Text *string `json:"text,omitempty"`
	// URI identifying the resource
	URI string `json:"uri"`
	// Base64-encoded binary content of the resource
	Blob *string `json:"blob,omitempty"`
}

The embedded resource contents, either text or base64-encoded binary

type ExternalToolTextResultForLlmContentResourceLink struct {
	// Human-readable description of the resource
	Description *string `json:"description,omitempty"`
	// Icons associated with this resource
	Icons []ExternalToolTextResultForLlmContentResourceLinkIcon `json:"icons,omitempty"`
	// MIME type of the resource content
	MIMEType *string `json:"mimeType,omitempty"`
	// Resource name identifier
	Name string `json:"name"`
	// Size of the resource in bytes
	Size *float64 `json:"size,omitempty"`
	// Human-readable display title for the resource
	Title *string `json:"title,omitempty"`
	// Content block type discriminator
	Type ExternalToolTextResultForLlmContentResourceLinkType `json:"type"`
	// URI identifying the resource
	URI string `json:"uri"`
}

Resource link content block referencing an external resource

type ExternalToolTextResultForLlmContentResourceLinkIcon added in v1.0.0

type ExternalToolTextResultForLlmContentResourceLinkIcon struct {
	// MIME type of the icon image
	MIMEType *string `json:"mimeType,omitempty"`
	// Available icon sizes (e.g., ['16x16', '32x32'])
	Sizes []string `json:"sizes,omitempty"`
	// URL or path to the icon image
	Src string `json:"src"`
	// Theme variant this icon is intended for
	Theme *ExternalToolTextResultForLlmContentResourceLinkIconTheme `json:"theme,omitempty"`
}

Icon image for a resource

type ExternalToolTextResultForLlmContentResourceLinkIconTheme added in v1.0.0

type ExternalToolTextResultForLlmContentResourceLinkIconTheme string

Theme variant this icon is intended for

const (
	ExternalToolTextResultForLlmContentResourceLinkIconThemeDark  ExternalToolTextResultForLlmContentResourceLinkIconTheme = "dark"
	ExternalToolTextResultForLlmContentResourceLinkIconThemeLight ExternalToolTextResultForLlmContentResourceLinkIconTheme = "light"
)

type ExternalToolTextResultForLlmContentResourceLinkType

type ExternalToolTextResultForLlmContentResourceLinkType string
const (
	ExternalToolTextResultForLlmContentResourceLinkTypeResourceLink ExternalToolTextResultForLlmContentResourceLinkType = "resource_link"
)

type ExternalToolTextResultForLlmContentResourceType

type ExternalToolTextResultForLlmContentResourceType string
const (
	ExternalToolTextResultForLlmContentResourceTypeResource ExternalToolTextResultForLlmContentResourceType = "resource"
)

type ExternalToolTextResultForLlmContentTerminal added in v1.0.0

type ExternalToolTextResultForLlmContentTerminal struct {
	// Working directory where the command was executed
	Cwd *string `json:"cwd,omitempty"`
	// Process exit code, if the command has completed
	ExitCode *float64 `json:"exitCode,omitempty"`
	// Terminal/shell output text
	Text string `json:"text"`
	// Content block type discriminator
	Type ExternalToolTextResultForLlmContentTerminalType `json:"type"`
}

Terminal/shell output content block with optional exit code and working directory

type ExternalToolTextResultForLlmContentTerminalType

type ExternalToolTextResultForLlmContentTerminalType string
const (
	ExternalToolTextResultForLlmContentTerminalTypeTerminal ExternalToolTextResultForLlmContentTerminalType = "terminal"
)

type ExternalToolTextResultForLlmContentText added in v1.0.0

type ExternalToolTextResultForLlmContentText struct {
	// The text content
	Text string `json:"text"`
	// Content block type discriminator
	Type ExternalToolTextResultForLlmContentTextType `json:"type"`
}

Plain text content block

type ExternalToolTextResultForLlmContentTextType

type ExternalToolTextResultForLlmContentTextType string
const (
	ExternalToolTextResultForLlmContentTextTypeText ExternalToolTextResultForLlmContentTextType = "text"
)

type ExternalToolTextResultForLlmContentType added in v1.0.0

type ExternalToolTextResultForLlmContentType string
const (
	ExternalToolTextResultForLlmContentTypeAudio        ExternalToolTextResultForLlmContentType = "audio"
	ExternalToolTextResultForLlmContentTypeImage        ExternalToolTextResultForLlmContentType = "image"
	ExternalToolTextResultForLlmContentTypeResource     ExternalToolTextResultForLlmContentType = "resource"
	ExternalToolTextResultForLlmContentTypeResourceLink ExternalToolTextResultForLlmContentType = "resource_link"
	ExternalToolTextResultForLlmContentTypeTerminal     ExternalToolTextResultForLlmContentType = "terminal"
	ExternalToolTextResultForLlmContentTypeText         ExternalToolTextResultForLlmContentType = "text"
)

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 HandlePendingToolCallRequest added in v1.0.0

type HandlePendingToolCallRequest 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 *ExternalToolResult `json:"result,omitempty"`
}

type HandlePendingToolCallResult added in v1.0.0

type HandlePendingToolCallResult 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 InternalServerRpc

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

InternalServerRpc provides internal SDK server-scoped RPC methods (handshake helpers etc.). Not part of the public API.

func NewInternalServerRpc

func NewInternalServerRpc(client *jsonrpc2.Client) *InternalServerRpc

func (*InternalServerRpc) Connect

func (a *InternalServerRpc) Connect(ctx context.Context, params *ConnectRequest) (*ConnectResult, error)

Internal: Connect is part of the SDK's internal handshake/plumbing; external callers should not use it.

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,omitempty"`
	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"`
	OauthGrantType    *MCPServerConfigHTTPOauthGrantType `json:"oauthGrantType,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,omitempty"`
	Headers           map[string]string                  `json:"headers,omitempty"`
	IsDefaultServer   *bool                              `json:"isDefaultServer,omitempty"`
	OauthClientID     *string                            `json:"oauthClientId,omitempty"`
	OauthGrantType    *MCPServerConfigHTTPOauthGrantType `json:"oauthGrantType,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 MCPServerConfigHTTPOauthGrantType added in v1.0.0

type MCPServerConfigHTTPOauthGrantType string
const (
	MCPServerConfigHTTPOauthGrantTypeAuthorizationCode MCPServerConfigHTTPOauthGrantType = "authorization_code"
	MCPServerConfigHTTPOauthGrantTypeClientCredentials MCPServerConfigHTTPOauthGrantType = "client_credentials"
)

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,omitempty"`
	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 (user-set or auto-generated), or null if not yet set
	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
	//
	// Approved and persisted across sessions
	//
	// 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 URL domain to approve for this session
	//
	// The URL domain to approve permanently
	Domain *string `json:"domain,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,omitempty"`
}

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,omitempty"`
	// The URL domain to approve for this session
	Domain *string `json:"domain,omitempty"`
	// 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,omitempty"`
}

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 PermissionDecisionApprovePermanently added in v1.0.0

type PermissionDecisionApprovePermanently struct {
	// The URL domain to approve permanently
	Domain string `json:"domain"`
	// Approved and persisted across sessions
	Kind PermissionDecisionApprovePermanentlyKind `json:"kind"`
}

type PermissionDecisionApprovePermanentlyKind

type PermissionDecisionApprovePermanentlyKind string
const (
	PermissionDecisionApprovePermanentlyKindApprovePermanently PermissionDecisionApprovePermanentlyKind = "approve-permanently"
)

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"
	PermissionDecisionKindApprovePermanently PermissionDecisionKind = "approve-permanently"
	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"`
	ConnectRequest                                           ConnectRequest                                           `json:"ConnectRequest"`
	ConnectResult                                            ConnectResult                                            `json:"ConnectResult"`
	CurrentModel                                             CurrentModel                                             `json:"CurrentModel"`
	DiscoveredMCPServer                                      DiscoveredMCPServer                                      `json:"DiscoveredMcpServer"`
	DiscoveredMCPServerSource                                MCPServerSource                                          `json:"DiscoveredMcpServerSource"`
	DiscoveredMCPServerType                                  DiscoveredMCPServerType                                  `json:"DiscoveredMcpServerType"`
	EmbeddedBlobResourceContents                             EmbeddedBlobResourceContents                             `json:"EmbeddedBlobResourceContents"`
	EmbeddedTextResourceContents                             EmbeddedTextResourceContents                             `json:"EmbeddedTextResourceContents"`
	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"`
	ExternalToolResult                                       *ExternalToolResult                                      `json:"ExternalToolResult"`
	ExternalToolTextResultForLlm                             ExternalToolTextResultForLlm                             `json:"ExternalToolTextResultForLlm"`
	ExternalToolTextResultForLlmContent                      ExternalToolTextResultForLlmContent                      `json:"ExternalToolTextResultForLlmContent"`
	ExternalToolTextResultForLlmContentAudio                 ExternalToolTextResultForLlmContentAudio                 `json:"ExternalToolTextResultForLlmContentAudio"`
	ExternalToolTextResultForLlmContentImage                 ExternalToolTextResultForLlmContentImage                 `json:"ExternalToolTextResultForLlmContentImage"`
	ExternalToolTextResultForLlmContentResource              ExternalToolTextResultForLlmContentResource              `json:"ExternalToolTextResultForLlmContentResource"`
	ExternalToolTextResultForLlmContentResourceDetails       ExternalToolTextResultForLlmContentResourceDetails       `json:"ExternalToolTextResultForLlmContentResourceDetails"`
	ExternalToolTextResultForLlmContentResourceLink          ExternalToolTextResultForLlmContentResourceLink          `json:"ExternalToolTextResultForLlmContentResourceLink"`
	ExternalToolTextResultForLlmContentResourceLinkIcon      ExternalToolTextResultForLlmContentResourceLinkIcon      `json:"ExternalToolTextResultForLlmContentResourceLinkIcon"`
	ExternalToolTextResultForLlmContentResourceLinkIconTheme ExternalToolTextResultForLlmContentResourceLinkIconTheme `json:"ExternalToolTextResultForLlmContentResourceLinkIconTheme"`
	ExternalToolTextResultForLlmContentTerminal              ExternalToolTextResultForLlmContentTerminal              `json:"ExternalToolTextResultForLlmContentTerminal"`
	ExternalToolTextResultForLlmContentText                  ExternalToolTextResultForLlmContentText                  `json:"ExternalToolTextResultForLlmContentText"`
	FilterMapping                                            *FilterMapping                                           `json:"FilterMapping"`
	FilterMappingString                                      FilterMappingString                                      `json:"FilterMappingString"`
	FilterMappingValue                                       FilterMappingString                                      `json:"FilterMappingValue"`
	FleetStartRequest                                        FleetStartRequest                                        `json:"FleetStartRequest"`
	FleetStartResult                                         FleetStartResult                                         `json:"FleetStartResult"`
	HandlePendingToolCallRequest                             HandlePendingToolCallRequest                             `json:"HandlePendingToolCallRequest"`
	HandlePendingToolCallResult                              HandlePendingToolCallResult                              `json:"HandlePendingToolCallResult"`
	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"`
	MCPServerConfigHTTPOauthGrantType                        MCPServerConfigHTTPOauthGrantType                        `json:"McpServerConfigHttpOauthGrantType"`
	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"`
	PermissionDecisionApprovePermanently                     PermissionDecisionApprovePermanently                     `json:"PermissionDecisionApprovePermanently"`
	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"`
	RemoteDisableResult                                      RemoteDisableResult                                      `json:"RemoteDisableResult"`
	RemoteEnableResult                                       RemoteEnableResult                                       `json:"RemoteEnableResult"`
	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"`
	SuspendResult                                            SuspendResult                                            `json:"SuspendResult"`
	TaskAgentInfo                                            TaskAgentInfo                                            `json:"TaskAgentInfo"`
	TaskAgentInfoExecutionMode                               TaskInfoExecutionMode                                    `json:"TaskAgentInfoExecutionMode"`
	TaskAgentInfoStatus                                      TaskInfoStatus                                           `json:"TaskAgentInfoStatus"`
	TaskInfo                                                 TaskInfo                                                 `json:"TaskInfo"`
	TaskList                                                 TaskList                                                 `json:"TaskList"`
	TasksCancelRequest                                       TasksCancelRequest                                       `json:"TasksCancelRequest"`
	TasksCancelResult                                        TasksCancelResult                                        `json:"TasksCancelResult"`
	TaskShellInfo                                            TaskShellInfo                                            `json:"TaskShellInfo"`
	TaskShellInfoAttachmentMode                              TaskShellInfoAttachmentMode                              `json:"TaskShellInfoAttachmentMode"`
	TaskShellInfoExecutionMode                               TaskInfoExecutionMode                                    `json:"TaskShellInfoExecutionMode"`
	TaskShellInfoStatus                                      TaskInfoStatus                                           `json:"TaskShellInfoStatus"`
	TasksPromoteToBackgroundRequest                          TasksPromoteToBackgroundRequest                          `json:"TasksPromoteToBackgroundRequest"`
	TasksPromoteToBackgroundResult                           TasksPromoteToBackgroundResult                           `json:"TasksPromoteToBackgroundResult"`
	TasksRemoveRequest                                       TasksRemoveRequest                                       `json:"TasksRemoveRequest"`
	TasksRemoveResult                                        TasksRemoveResult                                        `json:"TasksRemoveResult"`
	TasksStartAgentRequest                                   TasksStartAgentRequest                                   `json:"TasksStartAgentRequest"`
	TasksStartAgentResult                                    TasksStartAgentResult                                    `json:"TasksStartAgentResult"`
	Tool                                                     Tool                                                     `json:"Tool"`
	ToolList                                                 ToolList                                                 `json:"ToolList"`
	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"`
	UsageMetricsModelMetricTokenDetail                       UsageMetricsModelMetricTokenDetail                       `json:"UsageMetricsModelMetricTokenDetail"`
	UsageMetricsModelMetricUsage                             UsageMetricsModelMetricUsage                             `json:"UsageMetricsModelMetricUsage"`
	UsageMetricsTokenDetail                                  UsageMetricsTokenDetail                                  `json:"UsageMetricsTokenDetail"`
	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 RemoteApi

type RemoteApi sessionApi

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

func (*RemoteApi) Disable

func (a *RemoteApi) Disable(ctx context.Context) (*RemoteDisableResult, error)

func (*RemoteApi) Enable

func (a *RemoteApi) Enable(ctx context.Context) (*RemoteEnableResult, error)

type RemoteDisableResult

type RemoteDisableResult struct {
}

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

type RemoteEnableResult added in v1.0.0

type RemoteEnableResult struct {
	// Whether remote steering is enabled
	RemoteSteerable bool `json:"remoteSteerable"`
	// Mission Control frontend URL for this session
	URL *string `json:"url,omitempty"`
}

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

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
	Tasks        *TasksApi
	Skills       *SkillsApi
	Mcp          *McpApi
	Plugins      *PluginsApi
	Extensions   *ExtensionsApi
	Tools        *ToolsApi
	Commands     *CommandsApi
	UI           *UIApi
	Permissions  *PermissionsApi
	Shell        *ShellApi
	History      *HistoryApi
	Usage        *UsageApi
	Remote       *RemoteApi
	// 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)

func (*SessionRpc) Suspend

func (a *SessionRpc) Suspend(ctx context.Context) (*SuspendResult, 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 SuspendResult

type SuspendResult struct {
}

type TaskAgentInfo added in v1.0.0

type TaskAgentInfo struct {
	// ISO 8601 timestamp when the current active period began
	ActiveStartedAt *time.Time `json:"activeStartedAt,omitempty"`
	// Accumulated active execution time in milliseconds
	ActiveTimeMS *int64 `json:"activeTimeMs,omitempty"`
	// Type of agent running this task
	AgentType string `json:"agentType"`
	// Whether the task is currently in the original sync wait and can be moved to background
	// mode. False once it is already backgrounded, idle, finished, or no longer has a
	// promotable sync waiter.
	CanPromoteToBackground *bool `json:"canPromoteToBackground,omitempty"`
	// ISO 8601 timestamp when the task finished
	CompletedAt *time.Time `json:"completedAt,omitempty"`
	// Short description of the task
	Description string `json:"description"`
	// Error message when the task failed
	Error *string `json:"error,omitempty"`
	// How the agent is currently being managed by the runtime
	ExecutionMode *TaskInfoExecutionMode `json:"executionMode,omitempty"`
	// Unique task identifier
	ID string `json:"id"`
	// ISO 8601 timestamp when the agent entered idle state
	IdleSince *time.Time `json:"idleSince,omitempty"`
	// Most recent response text from the agent
	LatestResponse *string `json:"latestResponse,omitempty"`
	// Model used for the task when specified
	Model *string `json:"model,omitempty"`
	// Prompt passed to the agent
	Prompt string `json:"prompt"`
	// Result text from the task when available
	Result *string `json:"result,omitempty"`
	// ISO 8601 timestamp when the task was started
	StartedAt time.Time `json:"startedAt"`
	// Current lifecycle status of the task
	Status TaskInfoStatus `json:"status"`
	// Tool call ID associated with this agent task
	ToolCallID string `json:"toolCallId"`
	// Task kind
	Type TaskAgentInfoType `json:"type"`
}

type TaskAgentInfoType

type TaskAgentInfoType string
const (
	TaskAgentInfoTypeAgent TaskAgentInfoType = "agent"
)

type TaskInfo added in v1.0.0

type TaskInfo struct {
	// ISO 8601 timestamp when the current active period began
	ActiveStartedAt *time.Time `json:"activeStartedAt,omitempty"`
	// Accumulated active execution time in milliseconds
	ActiveTimeMS *int64 `json:"activeTimeMs,omitempty"`
	// Type of agent running this task
	AgentType *string `json:"agentType,omitempty"`
	// Whether the task is currently in the original sync wait and can be moved to background
	// mode. False once it is already backgrounded, idle, finished, or no longer has a
	// promotable sync waiter.
	//
	// Whether this shell task can be promoted to background mode
	CanPromoteToBackground *bool `json:"canPromoteToBackground,omitempty"`
	// ISO 8601 timestamp when the task finished
	CompletedAt *time.Time `json:"completedAt,omitempty"`
	// Short description of the task
	Description string `json:"description"`
	// Error message when the task failed
	Error *string `json:"error,omitempty"`
	// How the agent is currently being managed by the runtime
	//
	// Whether the shell command is currently sync-waited or background-managed
	ExecutionMode *TaskInfoExecutionMode `json:"executionMode,omitempty"`
	// Unique task identifier
	ID string `json:"id"`
	// ISO 8601 timestamp when the agent entered idle state
	IdleSince *time.Time `json:"idleSince,omitempty"`
	// Most recent response text from the agent
	LatestResponse *string `json:"latestResponse,omitempty"`
	// Model used for the task when specified
	Model *string `json:"model,omitempty"`
	// Prompt passed to the agent
	Prompt *string `json:"prompt,omitempty"`
	// Result text from the task when available
	Result *string `json:"result,omitempty"`
	// ISO 8601 timestamp when the task was started
	StartedAt time.Time `json:"startedAt"`
	// Current lifecycle status of the task
	Status TaskInfoStatus `json:"status"`
	// Tool call ID associated with this agent task
	ToolCallID *string `json:"toolCallId,omitempty"`
	// Task kind
	Type TaskInfoType `json:"type"`
	// Whether the shell runs inside a managed PTY session or as an independent background
	// process
	AttachmentMode *TaskShellInfoAttachmentMode `json:"attachmentMode,omitempty"`
	// Command being executed
	Command *string `json:"command,omitempty"`
	// Path to the detached shell log, when available
	LogPath *string `json:"logPath,omitempty"`
	// Process ID when available
	PID *int64 `json:"pid,omitempty"`
}

type TaskInfoExecutionMode

type TaskInfoExecutionMode string

How the agent is currently being managed by the runtime

Whether the shell command is currently sync-waited or background-managed

const (
	TaskInfoExecutionModeBackground TaskInfoExecutionMode = "background"
	TaskInfoExecutionModeSync       TaskInfoExecutionMode = "sync"
)

type TaskInfoStatus

type TaskInfoStatus string

Current lifecycle status of the task

const (
	TaskInfoStatusCancelled TaskInfoStatus = "cancelled"
	TaskInfoStatusCompleted TaskInfoStatus = "completed"
	TaskInfoStatusIdle      TaskInfoStatus = "idle"
	TaskInfoStatusFailed    TaskInfoStatus = "failed"
	TaskInfoStatusRunning   TaskInfoStatus = "running"
)

type TaskInfoType added in v1.0.0

type TaskInfoType string
const (
	TaskInfoTypeAgent TaskInfoType = "agent"
	TaskInfoTypeShell TaskInfoType = "shell"
)

type TaskList added in v1.0.0

type TaskList struct {
	// Currently tracked tasks
	Tasks []TaskInfo `json:"tasks"`
}

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

type TaskShellInfo added in v1.0.0

type TaskShellInfo struct {
	// Whether the shell runs inside a managed PTY session or as an independent background
	// process
	AttachmentMode TaskShellInfoAttachmentMode `json:"attachmentMode"`
	// Whether this shell task can be promoted to background mode
	CanPromoteToBackground *bool `json:"canPromoteToBackground,omitempty"`
	// Command being executed
	Command string `json:"command"`
	// ISO 8601 timestamp when the task finished
	CompletedAt *time.Time `json:"completedAt,omitempty"`
	// Short description of the task
	Description string `json:"description"`
	// Whether the shell command is currently sync-waited or background-managed
	ExecutionMode *TaskInfoExecutionMode `json:"executionMode,omitempty"`
	// Unique task identifier
	ID string `json:"id"`
	// Path to the detached shell log, when available
	LogPath *string `json:"logPath,omitempty"`
	// Process ID when available
	PID *int64 `json:"pid,omitempty"`
	// ISO 8601 timestamp when the task was started
	StartedAt time.Time `json:"startedAt"`
	// Current lifecycle status of the task
	Status TaskInfoStatus `json:"status"`
	// Task kind
	Type TaskShellInfoType `json:"type"`
}

type TaskShellInfoAttachmentMode added in v1.0.0

type TaskShellInfoAttachmentMode string

Whether the shell runs inside a managed PTY session or as an independent background process

const (
	TaskShellInfoAttachmentModeAttached TaskShellInfoAttachmentMode = "attached"
	TaskShellInfoAttachmentModeDetached TaskShellInfoAttachmentMode = "detached"
)

type TaskShellInfoType

type TaskShellInfoType string
const (
	TaskShellInfoTypeShell TaskShellInfoType = "shell"
)

type TasksApi

type TasksApi sessionApi

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

func (*TasksApi) Cancel

func (a *TasksApi) Cancel(ctx context.Context, params *TasksCancelRequest) (*TasksCancelResult, error)

func (*TasksApi) List

func (a *TasksApi) List(ctx context.Context) (*TaskList, error)

func (*TasksApi) PromoteToBackground

func (*TasksApi) Remove

func (a *TasksApi) Remove(ctx context.Context, params *TasksRemoveRequest) (*TasksRemoveResult, error)

func (*TasksApi) StartAgent

type TasksCancelRequest added in v1.0.0

type TasksCancelRequest struct {
	// Task identifier
	ID string `json:"id"`
}

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

type TasksCancelResult added in v1.0.0

type TasksCancelResult struct {
	// Whether the task was successfully cancelled
	Cancelled bool `json:"cancelled"`
}

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

type TasksPromoteToBackgroundRequest added in v1.0.0

type TasksPromoteToBackgroundRequest struct {
	// Task identifier
	ID string `json:"id"`
}

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

type TasksPromoteToBackgroundResult added in v1.0.0

type TasksPromoteToBackgroundResult struct {
	// Whether the task was successfully promoted to background mode
	Promoted bool `json:"promoted"`
}

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

type TasksRemoveRequest added in v1.0.0

type TasksRemoveRequest struct {
	// Task identifier
	ID string `json:"id"`
}

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

type TasksRemoveResult added in v1.0.0

type TasksRemoveResult struct {
	// Whether the task was removed. Returns false if the task does not exist or is still
	// running/idle (cancel it first).
	Removed bool `json:"removed"`
}

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

type TasksStartAgentRequest added in v1.0.0

type TasksStartAgentRequest struct {
	// Type of agent to start (e.g., 'explore', 'task', 'general-purpose')
	AgentType string `json:"agentType"`
	// Short description of the task
	Description *string `json:"description,omitempty"`
	// Optional model override
	Model *string `json:"model,omitempty"`
	// Short name for the agent, used to generate a human-readable ID
	Name string `json:"name"`
	// Task prompt for the agent
	Prompt string `json:"prompt"`
}

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

type TasksStartAgentResult added in v1.0.0

type TasksStartAgentResult struct {
	// Generated agent ID for the background task
	AgentID string `json:"agentId"`
}

Experimental: TasksStartAgentResult 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 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 *HandlePendingToolCallRequest) (*HandlePendingToolCallResult, error)

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,omitempty"`
	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"`
	// Session-wide per-token-type accumulated token counts
	TokenDetails map[string]UsageMetricsTokenDetail `json:"tokenDetails,omitempty"`
	// Total time spent in model API calls (milliseconds)
	TotalAPIDurationMS float64 `json:"totalApiDurationMs"`
	// Session-wide accumulated nano-AI units cost
	TotalNanoAiu *int64 `json:"totalNanoAiu,omitempty"`
	// 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 count details per type
	TokenDetails map[string]UsageMetricsModelMetricTokenDetail `json:"tokenDetails,omitempty"`
	// Accumulated nano-AI units cost for this model
	TotalNanoAiu *int64 `json:"totalNanoAiu,omitempty"`
	// 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 UsageMetricsModelMetricTokenDetail added in v1.0.0

type UsageMetricsModelMetricTokenDetail struct {
	// Accumulated token count for this token type
	TokenCount int64 `json:"tokenCount"`
}

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 UsageMetricsTokenDetail added in v1.0.0

type UsageMetricsTokenDetail struct {
	// Accumulated token count for this token type
	TokenCount int64 `json:"tokenCount"`
}

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"`
	UserNamed              *bool             `json:"user_named,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