appserver

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodThreadStarted             = "thread/started"
	MethodThreadStatusChanged       = "thread/status/changed"
	MethodThreadArchived            = "thread/archived"
	MethodThreadUnarchived          = "thread/unarchived"
	MethodThreadClosed              = "thread/closed"
	MethodThreadNameUpdated         = "thread/name/updated"
	MethodThreadTokenUsageUpdated   = "thread/tokenUsage/updated"
	MethodTurnStarted               = "turn/started"
	MethodTurnCompleted             = "turn/completed"
	MethodTurnDiffUpdated           = "turn/diff/updated"
	MethodTurnPlanUpdated           = "turn/plan/updated"
	MethodItemStarted               = "item/started"
	MethodItemCompleted             = "item/completed"
	MethodItemAgentMessageDelta     = "item/agentMessage/delta"
	MethodItemPlanDelta             = "item/plan/delta"
	MethodItemReasoningSummaryDelta = "item/reasoning/summaryTextDelta"
	MethodItemReasoningPartAdded    = "item/reasoning/summaryPartAdded"
	MethodItemReasoningTextDelta    = "item/reasoning/textDelta"
	MethodItemCommandOutputDelta    = "item/commandExecution/outputDelta"
	MethodItemFileChangeOutputDelta = "item/fileChange/outputDelta"
	MethodAccountLoginCompleted     = "account/login/completed"
	MethodAccountUpdated            = "account/updated"
	MethodAccountRateLimitsUpdated  = "account/rateLimits/updated"
	MethodMCPOAuthLoginCompleted    = "mcpServer/oauthLogin/completed"
	MethodWindowsSandboxCompleted   = "windowsSandbox/setupCompleted"
	MethodFuzzyFileSearchUpdated    = "fuzzyFileSearch/sessionUpdated"
	MethodFuzzyFileSearchCompleted  = "fuzzyFileSearch/sessionCompleted"
)
View Source
const MethodToolRequestUserInput = "item/tool/requestUserInput"

Variables

View Source
var (
	ErrClientClosed = errors.New("appserver: client is closed")
)

Functions

func Initialized

func Initialized(ctx context.Context, conn *jsonrpc2.Conn) error

func IsNotInitializedError

func IsNotInitializedError(err error) bool

func IsRateLimitError

func IsRateLimitError(err error) bool

func IsValidationError

func IsValidationError(err error) bool

func NewClient

func NewClient(ctx context.Context, opts StartOptions) (*Client, *InitializeResult, error)

func OnEvent

func OnEvent[T NotificationEvent](client *Client, handler func(context.Context, T)) (func(), error)

func StartStdio

func StartStdio(ctx context.Context, opts StartOptions) (*Client, *InitializeResult, error)

Types

type Account

type Account struct {
	Type     string `json:"type"`
	Email    string `json:"email,omitempty"`
	PlanType string `json:"planType,omitempty"`
}

type AccountLoginCompletedEvent

type AccountLoginCompletedEvent struct {
	LoginID *string `json:"loginId"`
	Success bool    `json:"success"`
	Error   *string `json:"error"`
}

func (AccountLoginCompletedEvent) NotificationMethod

func (AccountLoginCompletedEvent) NotificationMethod() string

type AccountRateLimitsUpdatedEvent

type AccountRateLimitsUpdatedEvent struct {
	RateLimits RateLimitBucket `json:"rateLimits"`
}

func (AccountRateLimitsUpdatedEvent) NotificationMethod

func (AccountRateLimitsUpdatedEvent) NotificationMethod() string

type AccountReadParams

type AccountReadParams struct {
	RefreshToken bool `json:"refreshToken"`
}

type AccountReadResult

type AccountReadResult struct {
	Account            *Account `json:"account"`
	RequiresOpenAIAuth bool     `json:"requiresOpenaiAuth"`
}

type AccountUpdatedEvent

type AccountUpdatedEvent struct {
	AuthMode *string `json:"authMode"`
	PlanType *string `json:"planType"`
}

func (AccountUpdatedEvent) NotificationMethod

func (AccountUpdatedEvent) NotificationMethod() string

type AgentMessageDeltaEvent

type AgentMessageDeltaEvent struct {
	ItemID   string `json:"itemId"`
	Delta    string `json:"delta"`
	TurnID   string `json:"turnId,omitempty"`
	ThreadID string `json:"threadId,omitempty"`
}

func (AgentMessageDeltaEvent) NotificationMethod

func (AgentMessageDeltaEvent) NotificationMethod() string

type AppBranding

type AppBranding struct {
	Category          *string `json:"category,omitempty"`
	Developer         *string `json:"developer,omitempty"`
	IsDiscoverableApp bool    `json:"isDiscoverableApp"`
	PrivacyPolicy     *string `json:"privacyPolicy,omitempty"`
	TermsOfService    *string `json:"termsOfService,omitempty"`
	Website           *string `json:"website,omitempty"`
}

type AppInfo

type AppInfo struct {
	AppMetadata         *AppMetadata      `json:"appMetadata,omitempty"`
	Branding            *AppBranding      `json:"branding,omitempty"`
	Description         *string           `json:"description,omitempty"`
	DistributionChannel *string           `json:"distributionChannel,omitempty"`
	ID                  string            `json:"id"`
	InstallURL          *string           `json:"installUrl,omitempty"`
	IsAccessible        bool              `json:"isAccessible"`
	IsEnabled           bool              `json:"isEnabled"`
	Labels              map[string]string `json:"labels,omitempty"`
	LogoURL             *string           `json:"logoUrl,omitempty"`
	LogoURLDark         *string           `json:"logoUrlDark,omitempty"`
	Name                string            `json:"name"`
	PluginDisplayNames  []string          `json:"pluginDisplayNames,omitempty"`
}

type AppMetadata

type AppMetadata struct {
	Categories                 []string        `json:"categories,omitempty"`
	Developer                  *string         `json:"developer,omitempty"`
	FirstPartyRequiresInstall  *bool           `json:"firstPartyRequiresInstall,omitempty"`
	FirstPartyType             *string         `json:"firstPartyType,omitempty"`
	Review                     *AppReview      `json:"review,omitempty"`
	Screenshots                []AppScreenshot `json:"screenshots,omitempty"`
	SEODescription             *string         `json:"seoDescription,omitempty"`
	ShowInComposerWhenUnlinked *bool           `json:"showInComposerWhenUnlinked,omitempty"`
	SubCategories              []string        `json:"subCategories,omitempty"`
	Version                    *string         `json:"version,omitempty"`
	VersionID                  *string         `json:"versionId,omitempty"`
	VersionNotes               *string         `json:"versionNotes,omitempty"`
}

type AppReview

type AppReview struct {
	Status string `json:"status"`
}

type AppScreenshot

type AppScreenshot struct {
	FileID     *string `json:"fileId,omitempty"`
	URL        *string `json:"url,omitempty"`
	UserPrompt string  `json:"userPrompt"`
}

type AppSummary

type AppSummary struct {
	Description *string `json:"description,omitempty"`
	ID          string  `json:"id"`
	InstallURL  *string `json:"installUrl,omitempty"`
	Name        string  `json:"name"`
}

type AppsListParams

type AppsListParams struct {
	Cursor       *string `json:"cursor,omitempty"`
	ForceRefetch *bool   `json:"forceRefetch,omitempty"`
	Limit        *uint32 `json:"limit,omitempty"`
	ThreadID     *string `json:"threadId,omitempty"`
}

type AppsListResult

type AppsListResult struct {
	Data       []AppInfo `json:"data"`
	NextCursor *string   `json:"nextCursor,omitempty"`
}

type Capabilities

type Capabilities struct {
	ExperimentalAPI           bool     `json:"experimentalApi,omitempty"`
	OptOutNotificationMethods []string `json:"optOutNotificationMethods,omitempty"`
}

type Client

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

func (*Client) ArchiveThread

func (c *Client) ArchiveThread(ctx context.Context, params ThreadArchiveParams) (*ThreadArchiveResult, error)

func (*Client) BatchWriteConfig

func (c *Client) BatchWriteConfig(ctx context.Context, params ConfigBatchWriteParams) (*ConfigWriteResult, error)

func (*Client) Call

func (c *Client) Call(ctx context.Context, method string, params, result any) error

func (*Client) Close

func (c *Client) Close() error

func (*Client) CompactThread

func (*Client) CopyPath

func (c *Client) CopyPath(ctx context.Context, params FSCopyPathParams) (*FSCopyPathResult, error)

func (*Client) CreateDirectory

func (c *Client) CreateDirectory(ctx context.Context, params FSCreateDirectoryParams) (*FSCreateDirectoryResult, error)

func (*Client) DetectExternalAgentConfig

func (c *Client) DetectExternalAgentConfig(ctx context.Context, params ExternalAgentConfigDetectParams) (*ExternalAgentConfigDetectResult, error)

func (*Client) ExecCommand

func (c *Client) ExecCommand(ctx context.Context, params CommandExecParams) (*CommandExecResult, error)

func (*Client) ForkThread

func (c *Client) ForkThread(ctx context.Context, params ThreadForkParams) (*ThreadForkResult, error)

func (*Client) GetMetadata

func (c *Client) GetMetadata(ctx context.Context, params FSGetMetadataParams) (*FSGetMetadataResult, error)

func (*Client) ImportExternalAgentConfig

func (c *Client) ImportExternalAgentConfig(ctx context.Context, params ExternalAgentConfigImportParams) (*ExternalAgentConfigImportResult, error)

func (*Client) InterruptTurn

func (c *Client) InterruptTurn(ctx context.Context, params TurnInterruptParams) (*TurnInterruptResult, error)

func (*Client) ListAllModels

func (c *Client) ListAllModels(ctx context.Context, params ModelListParams, yield func(ModelInfo) bool) error

func (*Client) ListAllThreads

func (c *Client) ListAllThreads(ctx context.Context, params ThreadListParams, yield func(Thread) bool) error

func (*Client) ListApps

func (c *Client) ListApps(ctx context.Context, params AppsListParams) (*AppsListResult, error)

func (*Client) ListCollaborationModes

func (c *Client) ListCollaborationModes(ctx context.Context) (*CollaborationModeListResult, error)

func (*Client) ListExperimentalFeatures

func (c *Client) ListExperimentalFeatures(ctx context.Context, params ExperimentalFeatureListParams) (*ExperimentalFeatureListResult, error)

func (*Client) ListLoadedThreads

func (c *Client) ListLoadedThreads(ctx context.Context, params ThreadLoadedListParams) (*ThreadLoadedListResult, error)

func (*Client) ListMCPServerStatus

func (c *Client) ListMCPServerStatus(ctx context.Context, params MCPServerStatusListParams) (*MCPServerStatusListResult, error)

func (*Client) ListModels

func (c *Client) ListModels(ctx context.Context, params ModelListParams) (*ModelListResult, error)

func (*Client) ListPlugins

func (c *Client) ListPlugins(ctx context.Context, params PluginListParams) (*PluginListResult, error)

func (*Client) ListSkills

func (c *Client) ListSkills(ctx context.Context, params SkillsListParams) (*SkillsListResult, error)

func (*Client) ListThreads

func (c *Client) ListThreads(ctx context.Context, params ThreadListParams) (*ThreadListResult, error)

func (*Client) Notify

func (c *Client) Notify(ctx context.Context, method string, params any) error

func (*Client) OnItemDelta

func (c *Client) OnItemDelta(handler func(context.Context, ItemDeltaEvent)) (func(), error)

func (*Client) OnProcessExit

func (c *Client) OnProcessExit(handler ProcessExitHandler) (func(), error)

func (*Client) OnTurnCompleted

func (c *Client) OnTurnCompleted(handler func(context.Context, *TurnCompletedEvent)) (func(), error)

func (*Client) QuickThread

func (c *Client) QuickThread(ctx context.Context, threadParams ThreadStartParams, text string) (*ThreadStartResult, *TurnCompletedEvent, error)

func (*Client) ReadAccount

func (c *Client) ReadAccount(ctx context.Context, params AccountReadParams) (*AccountReadResult, error)

func (*Client) ReadConfig

func (c *Client) ReadConfig(ctx context.Context, params ConfigReadParams) (*ConfigReadResult, error)

func (*Client) ReadConfigRequirements

func (c *Client) ReadConfigRequirements(ctx context.Context) (*ConfigRequirementsReadResult, error)

func (*Client) ReadDirectory

func (c *Client) ReadDirectory(ctx context.Context, params FSReadDirectoryParams) (*FSReadDirectoryResult, error)

func (*Client) ReadFile

func (c *Client) ReadFile(ctx context.Context, params FSReadFileParams) (*FSReadFileResult, error)

func (*Client) ReadPlugin

func (c *Client) ReadPlugin(ctx context.Context, params PluginReadParams) (*PluginReadResult, error)

func (*Client) ReadRateLimits

func (c *Client) ReadRateLimits(ctx context.Context) (*RateLimitsReadResult, error)

func (*Client) ReadThread

func (c *Client) ReadThread(ctx context.Context, params ThreadReadParams) (*ThreadReadResult, error)

func (*Client) RegisterNotificationHandler

func (c *Client) RegisterNotificationHandler(method string, handler NotificationHandler) (func(), error)

func (*Client) RegisterToolRequestUserInputHandler

func (c *Client) RegisterToolRequestUserInputHandler(handler ToolRequestUserInputHandler) error

func (*Client) ReloadMCPServerConfig

func (c *Client) ReloadMCPServerConfig(ctx context.Context) (*MCPServerRefreshResult, error)

func (*Client) RemovePath

func (c *Client) RemovePath(ctx context.Context, params FSRemovePathParams) (*FSRemovePathResult, error)

func (*Client) ResizeCommandPTY

func (c *Client) ResizeCommandPTY(ctx context.Context, params CommandExecResizeParams) (*CommandExecResizeResult, error)

func (*Client) ResumeThread

func (c *Client) ResumeThread(ctx context.Context, params ThreadResumeParams) (*ThreadResumeResult, error)

func (*Client) RollbackThread

func (c *Client) RollbackThread(ctx context.Context, params ThreadRollbackParams) (*ThreadRollbackResult, error)

func (*Client) SendMessageAndWait

func (c *Client) SendMessageAndWait(ctx context.Context, threadID string, text string) (*TurnCompletedEvent, error)

func (*Client) SetThreadName

func (c *Client) SetThreadName(ctx context.Context, params ThreadSetNameParams) (*ThreadSetNameResult, error)

func (*Client) StartMCPOAuthLogin

func (c *Client) StartMCPOAuthLogin(ctx context.Context, params MCPOAuthLoginParams) (*MCPOAuthLoginResult, error)

func (*Client) StartReview

func (c *Client) StartReview(ctx context.Context, params ReviewStartParams) (*ReviewStartResult, error)

func (*Client) StartThread

func (c *Client) StartThread(ctx context.Context, params ThreadStartParams) (*ThreadStartResult, error)

func (*Client) StartTurn

func (c *Client) StartTurn(ctx context.Context, params TurnStartParams) (*TurnStartResult, error)

func (*Client) StartWindowsSandboxSetup

func (c *Client) StartWindowsSandboxSetup(ctx context.Context, params WindowsSandboxSetupStartParams) (*WindowsSandboxSetupStartResult, error)

func (*Client) SteerTurn

func (c *Client) SteerTurn(ctx context.Context, params TurnSteerParams) (*TurnSteerResult, error)

func (*Client) StreamTurn

func (c *Client) StreamTurn(ctx context.Context, params TurnStartParams) (<-chan NotificationEvent, *TurnStartResult, error)

func (*Client) TerminateCommand

func (*Client) UnarchiveThread

func (c *Client) UnarchiveThread(ctx context.Context, params ThreadUnarchiveParams) (*ThreadUnarchiveResult, error)

func (*Client) UnsubscribeThread

func (c *Client) UnsubscribeThread(ctx context.Context, params ThreadUnsubscribeParams) (*ThreadUnsubscribeResult, error)

func (*Client) UploadFeedback

func (c *Client) UploadFeedback(ctx context.Context, params FeedbackUploadParams) (*FeedbackUploadResult, error)

func (*Client) WriteCommandStdin

func (c *Client) WriteCommandStdin(ctx context.Context, params CommandExecWriteParams) (*CommandExecWriteResult, error)

func (*Client) WriteConfigValue

func (c *Client) WriteConfigValue(ctx context.Context, params ConfigWriteParams) (*ConfigWriteResult, error)

func (*Client) WriteFile

func (c *Client) WriteFile(ctx context.Context, params FSWriteFileParams) (*FSWriteFileResult, error)

func (*Client) WriteSkillsConfig

func (c *Client) WriteSkillsConfig(ctx context.Context, params SkillsConfigWriteParams) (*SkillsConfigWriteResult, error)

type ClientInfo

type ClientInfo struct {
	Name    string `json:"name"`
	Title   string `json:"title"`
	Version string `json:"version"`
}

type CollaborationMode

type CollaborationMode struct {
	Mode            *CollaborationModeKind `json:"mode,omitempty"`
	Model           *string                `json:"model,omitempty"`
	Name            string                 `json:"name"`
	ReasoningEffort *string                `json:"reasoning_effort,omitempty"`
}

type CollaborationModeKind

type CollaborationModeKind string
const (
	CollaborationModeKindPlan    CollaborationModeKind = "plan"
	CollaborationModeKindDefault CollaborationModeKind = "default"
)

type CollaborationModeListResult

type CollaborationModeListResult struct {
	Data []CollaborationMode `json:"data"`
}

type CommandExecParams

type CommandExecParams struct {
	Command            []string                 `json:"command"`
	Cwd                *string                  `json:"cwd,omitempty"`
	DisableOutputCap   bool                     `json:"disableOutputCap,omitempty"`
	DisableTimeout     bool                     `json:"disableTimeout,omitempty"`
	Env                map[string]*string       `json:"env,omitempty"`
	OutputBytesCap     *uint64                  `json:"outputBytesCap,omitempty"`
	ProcessID          *string                  `json:"processId,omitempty"`
	SandboxPolicy      any                      `json:"sandboxPolicy,omitempty"`
	Size               *CommandExecTerminalSize `json:"size,omitempty"`
	StreamStdin        bool                     `json:"streamStdin,omitempty"`
	StreamStdoutStderr bool                     `json:"streamStdoutStderr,omitempty"`
	TimeoutMs          *int64                   `json:"timeoutMs,omitempty"`
	TTY                bool                     `json:"tty,omitempty"`
}

type CommandExecResizeParams

type CommandExecResizeParams struct {
	ProcessID string                  `json:"processId"`
	Size      CommandExecTerminalSize `json:"size"`
}

type CommandExecResizeResult

type CommandExecResizeResult struct{}

type CommandExecResult

type CommandExecResult struct {
	ExitCode int    `json:"exitCode"`
	Stdout   string `json:"stdout"`
	Stderr   string `json:"stderr"`
}

type CommandExecTerminalSize

type CommandExecTerminalSize struct {
	Cols uint16 `json:"cols"`
	Rows uint16 `json:"rows"`
}

type CommandExecTerminateParams

type CommandExecTerminateParams struct {
	ProcessID string `json:"processId"`
}

type CommandExecTerminateResult

type CommandExecTerminateResult struct{}

type CommandExecWriteParams

type CommandExecWriteParams struct {
	ProcessID   string  `json:"processId"`
	CloseStdin  bool    `json:"closeStdin,omitempty"`
	DeltaBase64 *string `json:"deltaBase64,omitempty"`
}

type CommandExecWriteResult

type CommandExecWriteResult struct{}

type CommandExecutionOutputDeltaEvent

type CommandExecutionOutputDeltaEvent struct {
	ItemID   string `json:"itemId,omitempty"`
	Delta    string `json:"delta,omitempty"`
	Stream   string `json:"stream,omitempty"`
	ThreadID string `json:"threadId,omitempty"`
	TurnID   string `json:"turnId,omitempty"`
}

func (CommandExecutionOutputDeltaEvent) NotificationMethod

func (CommandExecutionOutputDeltaEvent) NotificationMethod() string

type ConfigBatchWriteParams

type ConfigBatchWriteParams struct {
	Edits            []ConfigEdit `json:"edits"`
	ExpectedVersion  *string      `json:"expectedVersion,omitempty"`
	FilePath         *string      `json:"filePath,omitempty"`
	ReloadUserConfig bool         `json:"reloadUserConfig,omitempty"`
}

type ConfigEdit

type ConfigEdit struct {
	KeyPath       string              `json:"keyPath"`
	MergeStrategy ConfigMergeStrategy `json:"mergeStrategy"`
	Value         any                 `json:"value"`
}

type ConfigLayer

type ConfigLayer map[string]any

type ConfigLayerMetadata

type ConfigLayerMetadata map[string]any

type ConfigMergeStrategy

type ConfigMergeStrategy string
const (
	ConfigMergeStrategyReplace ConfigMergeStrategy = "replace"
	ConfigMergeStrategyUpsert  ConfigMergeStrategy = "upsert"
)

type ConfigReadParams

type ConfigReadParams struct {
	Cwd           *string `json:"cwd,omitempty"`
	IncludeLayers bool    `json:"includeLayers,omitempty"`
}

type ConfigReadResult

type ConfigReadResult struct {
	Config  ConfigValueMap                 `json:"config"`
	Layers  []ConfigLayer                  `json:"layers,omitempty"`
	Origins map[string]ConfigLayerMetadata `json:"origins"`
}

type ConfigRequirements

type ConfigRequirements struct {
	AllowedApprovalPolicies []json.RawMessage            `json:"allowedApprovalPolicies,omitempty"`
	AllowedSandboxModes     []string                     `json:"allowedSandboxModes,omitempty"`
	AllowedWebSearchModes   []string                     `json:"allowedWebSearchModes,omitempty"`
	EnforceResidency        *ConfigRequirementsResidency `json:"enforceResidency,omitempty"`
	FeatureRequirements     map[string]bool              `json:"featureRequirements,omitempty"`
}

type ConfigRequirementsReadResult

type ConfigRequirementsReadResult struct {
	Requirements *ConfigRequirements `json:"requirements"`
}

type ConfigRequirementsResidency

type ConfigRequirementsResidency string
const (
	ConfigRequirementsResidencyUS ConfigRequirementsResidency = "us"
)

type ConfigValueMap

type ConfigValueMap map[string]any

type ConfigWriteOverriddenMetadata

type ConfigWriteOverriddenMetadata struct {
	EffectiveValue  any                 `json:"effectiveValue"`
	Message         string              `json:"message"`
	OverridingLayer ConfigLayerMetadata `json:"overridingLayer"`
}

type ConfigWriteParams

type ConfigWriteParams struct {
	ExpectedVersion *string             `json:"expectedVersion,omitempty"`
	FilePath        *string             `json:"filePath,omitempty"`
	KeyPath         string              `json:"keyPath"`
	MergeStrategy   ConfigMergeStrategy `json:"mergeStrategy"`
	Value           any                 `json:"value"`
}

type ConfigWriteResult

type ConfigWriteResult struct {
	FilePath           string                         `json:"filePath"`
	OverriddenMetadata *ConfigWriteOverriddenMetadata `json:"overriddenMetadata,omitempty"`
	Status             ConfigWriteStatus              `json:"status"`
	Version            string                         `json:"version"`
}

type ConfigWriteStatus

type ConfigWriteStatus string
const (
	ConfigWriteStatusOK           ConfigWriteStatus = "ok"
	ConfigWriteStatusOKOverridden ConfigWriteStatus = "okOverridden"
)

type CreditsSnapshot

type CreditsSnapshot struct {
	Balance    *string `json:"balance"`
	HasCredits bool    `json:"hasCredits"`
	Unlimited  bool    `json:"unlimited"`
}

type ExperimentalFeature

type ExperimentalFeature struct {
	Announcement   *string                  `json:"announcement,omitempty"`
	DefaultEnabled bool                     `json:"defaultEnabled"`
	Description    *string                  `json:"description,omitempty"`
	DisplayName    *string                  `json:"displayName,omitempty"`
	Enabled        bool                     `json:"enabled"`
	Name           string                   `json:"name"`
	Stage          ExperimentalFeatureStage `json:"stage"`
}

type ExperimentalFeatureListParams

type ExperimentalFeatureListParams struct {
	Cursor *string `json:"cursor,omitempty"`
	Limit  *uint32 `json:"limit,omitempty"`
}

type ExperimentalFeatureListResult

type ExperimentalFeatureListResult struct {
	Data       []ExperimentalFeature `json:"data"`
	NextCursor *string               `json:"nextCursor,omitempty"`
}

type ExperimentalFeatureStage

type ExperimentalFeatureStage string
const (
	ExperimentalFeatureStageBeta             ExperimentalFeatureStage = "beta"
	ExperimentalFeatureStageUnderDevelopment ExperimentalFeatureStage = "underDevelopment"
	ExperimentalFeatureStageStable           ExperimentalFeatureStage = "stable"
	ExperimentalFeatureStageDeprecated       ExperimentalFeatureStage = "deprecated"
	ExperimentalFeatureStageRemoved          ExperimentalFeatureStage = "removed"
)

type ExternalAgentConfigDetectParams

type ExternalAgentConfigDetectParams struct {
	Cwds        []string `json:"cwds,omitempty"`
	IncludeHome bool     `json:"includeHome,omitempty"`
}

type ExternalAgentConfigDetectResult

type ExternalAgentConfigDetectResult struct {
	Items []ExternalAgentConfigMigrationItem `json:"items"`
}

type ExternalAgentConfigImportParams

type ExternalAgentConfigImportParams struct {
	MigrationItems []ExternalAgentConfigMigrationItem `json:"migrationItems"`
}

type ExternalAgentConfigImportResult

type ExternalAgentConfigImportResult struct{}

type ExternalAgentConfigMigrationItem

type ExternalAgentConfigMigrationItem struct {
	Cwd         *string                              `json:"cwd,omitempty"`
	Description string                               `json:"description"`
	ItemType    ExternalAgentConfigMigrationItemType `json:"itemType"`
}

type ExternalAgentConfigMigrationItemType

type ExternalAgentConfigMigrationItemType string
const (
	ExternalAgentConfigMigrationItemTypeAgentsMD        ExternalAgentConfigMigrationItemType = "AGENTS_MD"
	ExternalAgentConfigMigrationItemTypeConfig          ExternalAgentConfigMigrationItemType = "CONFIG"
	ExternalAgentConfigMigrationItemTypeSkills          ExternalAgentConfigMigrationItemType = "SKILLS"
	ExternalAgentConfigMigrationItemTypeMCPServerConfig ExternalAgentConfigMigrationItemType = "MCP_SERVER_CONFIG"
)

type FSCopyPathParams

type FSCopyPathParams struct {
	DestinationPath string `json:"destinationPath"`
	Recursive       bool   `json:"recursive"`
	SourcePath      string `json:"sourcePath"`
}

type FSCopyPathResult

type FSCopyPathResult struct{}

type FSCreateDirectoryParams

type FSCreateDirectoryParams struct {
	Path      string `json:"path"`
	Recursive *bool  `json:"recursive,omitempty"`
}

type FSCreateDirectoryResult

type FSCreateDirectoryResult struct{}

type FSGetMetadataParams

type FSGetMetadataParams struct {
	Path string `json:"path"`
}

type FSGetMetadataResult

type FSGetMetadataResult struct {
	CreatedAtMs  int64 `json:"createdAtMs"`
	IsDirectory  bool  `json:"isDirectory"`
	IsFile       bool  `json:"isFile"`
	ModifiedAtMs int64 `json:"modifiedAtMs"`
}

type FSReadDirectoryEntry

type FSReadDirectoryEntry struct {
	FileName    string `json:"fileName"`
	IsDirectory bool   `json:"isDirectory"`
	IsFile      bool   `json:"isFile"`
}

type FSReadDirectoryParams

type FSReadDirectoryParams struct {
	Path string `json:"path"`
}

type FSReadDirectoryResult

type FSReadDirectoryResult struct {
	Entries []FSReadDirectoryEntry `json:"entries"`
}

type FSReadFileParams

type FSReadFileParams struct {
	Path string `json:"path"`
}

type FSReadFileResult

type FSReadFileResult struct {
	DataBase64 string `json:"dataBase64"`
}

type FSRemovePathParams

type FSRemovePathParams struct {
	Force     *bool  `json:"force,omitempty"`
	Path      string `json:"path"`
	Recursive *bool  `json:"recursive,omitempty"`
}

type FSRemovePathResult

type FSRemovePathResult struct{}

type FSWriteFileParams

type FSWriteFileParams struct {
	DataBase64 string `json:"dataBase64"`
	Path       string `json:"path"`
}

type FSWriteFileResult

type FSWriteFileResult struct{}

type FeedbackUploadParams

type FeedbackUploadParams struct {
	Classification string   `json:"classification"`
	ExtraLogFiles  []string `json:"extraLogFiles,omitempty"`
	IncludeLogs    bool     `json:"includeLogs"`
	Reason         *string  `json:"reason,omitempty"`
	ThreadID       *string  `json:"threadId,omitempty"`
}

type FeedbackUploadResult

type FeedbackUploadResult struct {
	ThreadID string `json:"threadId"`
}

type FileChangeOutputDeltaEvent

type FileChangeOutputDeltaEvent struct {
	ItemID   string `json:"itemId"`
	Delta    string `json:"delta"`
	ThreadID string `json:"threadId"`
	TurnID   string `json:"turnId"`
}

func (FileChangeOutputDeltaEvent) NotificationMethod

func (FileChangeOutputDeltaEvent) NotificationMethod() string

type FuzzyFileSearchResult

type FuzzyFileSearchResult struct {
	FileName string   `json:"file_name"`
	Indices  []uint32 `json:"indices,omitempty"`
	Path     string   `json:"path"`
	Root     string   `json:"root"`
	Score    uint32   `json:"score"`
}

type FuzzyFileSearchSessionCompletedEvent

type FuzzyFileSearchSessionCompletedEvent struct {
	SessionID string `json:"sessionId"`
}

func (FuzzyFileSearchSessionCompletedEvent) NotificationMethod

func (FuzzyFileSearchSessionCompletedEvent) NotificationMethod() string

type FuzzyFileSearchSessionUpdatedEvent

type FuzzyFileSearchSessionUpdatedEvent struct {
	Files     []FuzzyFileSearchResult `json:"files"`
	Query     string                  `json:"query"`
	SessionID string                  `json:"sessionId"`
}

func (FuzzyFileSearchSessionUpdatedEvent) NotificationMethod

func (FuzzyFileSearchSessionUpdatedEvent) NotificationMethod() string

type InitializeParams

type InitializeParams struct {
	ClientInfo   ClientInfo    `json:"clientInfo"`
	Capabilities *Capabilities `json:"capabilities,omitempty"`
}

type InitializeResult

type InitializeResult struct {
	UserAgent      string `json:"userAgent"`
	PlatformFamily string `json:"platformFamily"`
	PlatformOS     string `json:"platformOs"`
}

func Initialize

func Initialize(ctx context.Context, conn *jsonrpc2.Conn, params InitializeParams) (*InitializeResult, error)

type ItemCompletedEvent

type ItemCompletedEvent struct {
	ThreadID string     `json:"threadId"`
	TurnID   string     `json:"turnId"`
	Item     ThreadItem `json:"item"`
}

func (ItemCompletedEvent) NotificationMethod

func (ItemCompletedEvent) NotificationMethod() string

type ItemDeltaEvent

type ItemDeltaEvent interface {
	NotificationEvent
	// contains filtered or unexported methods
}

type ItemStartedEvent

type ItemStartedEvent struct {
	ThreadID string     `json:"threadId"`
	TurnID   string     `json:"turnId"`
	Item     ThreadItem `json:"item"`
}

func (ItemStartedEvent) NotificationMethod

func (ItemStartedEvent) NotificationMethod() string

type MCPAuthStatus

type MCPAuthStatus string
const (
	MCPAuthStatusUnsupported MCPAuthStatus = "unsupported"
	MCPAuthStatusNotLoggedIn MCPAuthStatus = "notLoggedIn"
	MCPAuthStatusBearerToken MCPAuthStatus = "bearerToken"
	MCPAuthStatusOAuth       MCPAuthStatus = "oAuth"
)

type MCPOAuthLoginCompletedEvent

type MCPOAuthLoginCompletedEvent struct {
	Name    string  `json:"name"`
	Success bool    `json:"success"`
	Error   *string `json:"error"`
}

func (MCPOAuthLoginCompletedEvent) NotificationMethod

func (MCPOAuthLoginCompletedEvent) NotificationMethod() string

type MCPOAuthLoginParams

type MCPOAuthLoginParams struct {
	Name        string   `json:"name"`
	Scopes      []string `json:"scopes,omitempty"`
	TimeoutSecs *int64   `json:"timeoutSecs,omitempty"`
}

type MCPOAuthLoginResult

type MCPOAuthLoginResult struct {
	AuthorizationURL string `json:"authorizationUrl"`
}

type MCPResource

type MCPResource struct {
	Meta        json.RawMessage   `json:"_meta,omitempty"`
	Annotations json.RawMessage   `json:"annotations,omitempty"`
	Description *string           `json:"description,omitempty"`
	Icons       []json.RawMessage `json:"icons,omitempty"`
	MimeType    *string           `json:"mimeType,omitempty"`
	Name        string            `json:"name"`
	Size        *int64            `json:"size,omitempty"`
	Title       *string           `json:"title,omitempty"`
	URI         string            `json:"uri"`
}

type MCPResourceTemplate

type MCPResourceTemplate struct {
	Annotations json.RawMessage `json:"annotations,omitempty"`
	Description *string         `json:"description,omitempty"`
	MimeType    *string         `json:"mimeType,omitempty"`
	Name        string          `json:"name"`
	Title       *string         `json:"title,omitempty"`
	URITemplate string          `json:"uriTemplate"`
}

type MCPServerRefreshResult

type MCPServerRefreshResult struct{}

type MCPServerStatus

type MCPServerStatus struct {
	AuthStatus        MCPAuthStatus         `json:"authStatus"`
	Name              string                `json:"name"`
	ResourceTemplates []MCPResourceTemplate `json:"resourceTemplates"`
	Resources         []MCPResource         `json:"resources"`
	Tools             map[string]MCPTool    `json:"tools"`
}

type MCPServerStatusListParams

type MCPServerStatusListParams struct {
	Cursor *string `json:"cursor,omitempty"`
	Limit  *uint32 `json:"limit,omitempty"`
}

type MCPServerStatusListResult

type MCPServerStatusListResult struct {
	Data       []MCPServerStatus `json:"data"`
	NextCursor *string           `json:"nextCursor,omitempty"`
}

type MCPTool

type MCPTool struct {
	Meta         json.RawMessage   `json:"_meta,omitempty"`
	Annotations  json.RawMessage   `json:"annotations,omitempty"`
	Description  *string           `json:"description,omitempty"`
	Icons        []json.RawMessage `json:"icons,omitempty"`
	InputSchema  json.RawMessage   `json:"inputSchema"`
	Name         string            `json:"name"`
	OutputSchema json.RawMessage   `json:"outputSchema,omitempty"`
	Title        *string           `json:"title,omitempty"`
}

type MarketplaceInterface

type MarketplaceInterface struct {
	DisplayName *string `json:"displayName,omitempty"`
}

type ModelAvailabilityNux

type ModelAvailabilityNux struct {
	Message string `json:"message"`
}

type ModelInfo

type ModelInfo struct {
	ID                        string                  `json:"id"`
	Model                     string                  `json:"model"`
	DisplayName               string                  `json:"displayName"`
	Description               string                  `json:"description"`
	Hidden                    bool                    `json:"hidden"`
	IsDefault                 bool                    `json:"isDefault"`
	DefaultReasoningEffort    string                  `json:"defaultReasoningEffort"`
	SupportedReasoningEfforts []ReasoningEffortOption `json:"supportedReasoningEfforts"`
	InputModalities           []string                `json:"inputModalities,omitempty"`
	SupportsPersonality       bool                    `json:"supportsPersonality,omitempty"`
	Upgrade                   *string                 `json:"upgrade,omitempty"`
	UpgradeInfo               *ModelUpgradeInfo       `json:"upgradeInfo,omitempty"`
	AvailabilityNux           *ModelAvailabilityNux   `json:"availabilityNux,omitempty"`
}

type ModelListParams

type ModelListParams struct {
	Cursor        *string `json:"cursor,omitempty"`
	IncludeHidden *bool   `json:"includeHidden,omitempty"`
	Limit         *uint32 `json:"limit,omitempty"`
}

type ModelListResult

type ModelListResult struct {
	Data       []ModelInfo `json:"data"`
	NextCursor *string     `json:"nextCursor,omitempty"`
}

type ModelUpgradeInfo

type ModelUpgradeInfo struct {
	Model             string  `json:"model"`
	MigrationMarkdown *string `json:"migrationMarkdown,omitempty"`
	ModelLink         *string `json:"modelLink,omitempty"`
	UpgradeCopy       *string `json:"upgradeCopy,omitempty"`
}

type Notification

type Notification struct {
	Method string
	Params json.RawMessage
}

func (Notification) DecodeEvent

func (n Notification) DecodeEvent() (NotificationEvent, error)

func (Notification) DecodeParams

func (n Notification) DecodeParams(v any) error

type NotificationEvent

type NotificationEvent interface {
	NotificationMethod() string
}

func DecodeNotificationEvent

func DecodeNotificationEvent(notification Notification) (NotificationEvent, error)

type NotificationHandler

type NotificationHandler func(context.Context, Notification)

type PlanDeltaEvent

type PlanDeltaEvent struct {
	ItemID string `json:"itemId"`
	Delta  string `json:"delta"`
	TurnID string `json:"turnId,omitempty"`
}

func (PlanDeltaEvent) NotificationMethod

func (PlanDeltaEvent) NotificationMethod() string

type PluginDetail

type PluginDetail struct {
	Apps            []AppSummary   `json:"apps"`
	Description     *string        `json:"description,omitempty"`
	MarketplaceName string         `json:"marketplaceName"`
	MarketplacePath string         `json:"marketplacePath"`
	MCPServers      []string       `json:"mcpServers"`
	Skills          []SkillSummary `json:"skills"`
	Summary         PluginSummary  `json:"summary"`
}

type PluginInterface

type PluginInterface struct {
	BrandColor        *string  `json:"brandColor,omitempty"`
	Capabilities      []string `json:"capabilities"`
	Category          *string  `json:"category,omitempty"`
	ComposerIcon      *string  `json:"composerIcon,omitempty"`
	DefaultPrompt     []string `json:"defaultPrompt,omitempty"`
	DeveloperName     *string  `json:"developerName,omitempty"`
	DisplayName       *string  `json:"displayName,omitempty"`
	LongDescription   *string  `json:"longDescription,omitempty"`
	PrivacyPolicyURL  *string  `json:"privacyPolicyUrl,omitempty"`
	Screenshots       []string `json:"screenshots"`
	ShortDescription  *string  `json:"shortDescription,omitempty"`
	TermsOfServiceURL *string  `json:"termsOfServiceUrl,omitempty"`
	WebsiteURL        *string  `json:"websiteUrl,omitempty"`
}

type PluginListParams

type PluginListParams struct {
	Cwds            []string `json:"cwds,omitempty"`
	ForceRemoteSync bool     `json:"forceRemoteSync,omitempty"`
}

type PluginListResult

type PluginListResult struct {
	Marketplaces    []PluginMarketplaceEntry `json:"marketplaces"`
	RemoteSyncError *string                  `json:"remoteSyncError,omitempty"`
}

type PluginMarketplaceEntry

type PluginMarketplaceEntry struct {
	Interface *MarketplaceInterface `json:"interface,omitempty"`
	Name      string                `json:"name"`
	Path      string                `json:"path"`
	Plugins   []PluginSummary       `json:"plugins"`
}

type PluginReadParams

type PluginReadParams struct {
	MarketplacePath string `json:"marketplacePath"`
	PluginName      string `json:"pluginName"`
}

type PluginReadResult

type PluginReadResult struct {
	Plugin PluginDetail `json:"plugin"`
}

type PluginSource

type PluginSource struct {
	Type string  `json:"type"`
	Path *string `json:"path,omitempty"`
}

type PluginSummary

type PluginSummary struct {
	AuthPolicy    string           `json:"authPolicy"`
	Enabled       bool             `json:"enabled"`
	ID            string           `json:"id"`
	InstallPolicy string           `json:"installPolicy"`
	Installed     bool             `json:"installed"`
	Interface     *PluginInterface `json:"interface,omitempty"`
	Name          string           `json:"name"`
	Source        PluginSource     `json:"source"`
}

type ProcessExitError

type ProcessExitError struct {
	Err error
}

func (*ProcessExitError) Error

func (e *ProcessExitError) Error() string

func (*ProcessExitError) Unwrap

func (e *ProcessExitError) Unwrap() error

type ProcessExitHandler

type ProcessExitHandler func(error)

type RPCError

type RPCError struct {
	Code    int64
	Message string
	Data    any
}

func (*RPCError) Error

func (e *RPCError) Error() string

type RateLimitBucket

type RateLimitBucket struct {
	Credits   *CreditsSnapshot `json:"credits"`
	LimitID   *string          `json:"limitId"`
	LimitName *string          `json:"limitName"`
	PlanType  *string          `json:"planType"`
	Primary   *RateLimitWindow `json:"primary"`
	Secondary *RateLimitWindow `json:"secondary"`
}

type RateLimitWindow

type RateLimitWindow struct {
	UsedPercent        int    `json:"usedPercent"`
	WindowDurationMins *int64 `json:"windowDurationMins"`
	ResetsAt           *int64 `json:"resetsAt"`
}

type RateLimitsReadResult

type RateLimitsReadResult struct {
	RateLimits          *RateLimitBucket           `json:"rateLimits"`
	RateLimitsByLimitID map[string]RateLimitBucket `json:"rateLimitsByLimitId,omitempty"`
}

type ReasoningEffortOption

type ReasoningEffortOption struct {
	ReasoningEffort string `json:"reasoningEffort"`
	Description     string `json:"description"`
}

type ReasoningSummaryPartAddedEvent

type ReasoningSummaryPartAddedEvent struct {
	ItemID       string `json:"itemId"`
	SummaryIndex int64  `json:"summaryIndex"`
	ThreadID     string `json:"threadId"`
	TurnID       string `json:"turnId"`
}

func (ReasoningSummaryPartAddedEvent) NotificationMethod

func (ReasoningSummaryPartAddedEvent) NotificationMethod() string

type ReasoningSummaryTextDeltaEvent

type ReasoningSummaryTextDeltaEvent struct {
	ItemID       string `json:"itemId"`
	Delta        string `json:"delta"`
	SummaryIndex int64  `json:"summaryIndex"`
	ThreadID     string `json:"threadId"`
	TurnID       string `json:"turnId"`
}

func (ReasoningSummaryTextDeltaEvent) NotificationMethod

func (ReasoningSummaryTextDeltaEvent) NotificationMethod() string

type ReasoningTextDeltaEvent

type ReasoningTextDeltaEvent struct {
	ContentIndex int64  `json:"contentIndex"`
	ItemID       string `json:"itemId"`
	Delta        string `json:"delta"`
	ThreadID     string `json:"threadId"`
	TurnID       string `json:"turnId"`
}

func (ReasoningTextDeltaEvent) NotificationMethod

func (ReasoningTextDeltaEvent) NotificationMethod() string

type RestartPolicy

type RestartPolicy string
const (
	RestartPolicyNever  RestartPolicy = "never"
	RestartPolicyAlways RestartPolicy = "always"
)

type ReviewDelivery

type ReviewDelivery string
const (
	ReviewDeliveryInline   ReviewDelivery = "inline"
	ReviewDeliveryDetached ReviewDelivery = "detached"
)

type ReviewStartParams

type ReviewStartParams struct {
	ThreadID string          `json:"threadId"`
	Target   ReviewTarget    `json:"target"`
	Delivery *ReviewDelivery `json:"delivery,omitempty"`
}

type ReviewStartResult

type ReviewStartResult struct {
	ReviewThreadID string `json:"reviewThreadId"`
	Turn           Turn   `json:"turn"`
}

type ReviewTarget

type ReviewTarget map[string]any

type SkillDependencies

type SkillDependencies struct {
	Tools []SkillToolDependency `json:"tools"`
}

type SkillErrorInfo

type SkillErrorInfo struct {
	Message string `json:"message"`
	Path    string `json:"path"`
}

type SkillInterface

type SkillInterface struct {
	BrandColor       *string `json:"brandColor,omitempty"`
	DefaultPrompt    *string `json:"defaultPrompt,omitempty"`
	DisplayName      *string `json:"displayName,omitempty"`
	IconLarge        *string `json:"iconLarge,omitempty"`
	IconSmall        *string `json:"iconSmall,omitempty"`
	ShortDescription *string `json:"shortDescription,omitempty"`
}

type SkillMetadata

type SkillMetadata struct {
	Dependencies     *SkillDependencies `json:"dependencies,omitempty"`
	Description      string             `json:"description"`
	Enabled          bool               `json:"enabled"`
	Interface        *SkillInterface    `json:"interface,omitempty"`
	Name             string             `json:"name"`
	Path             string             `json:"path"`
	Scope            string             `json:"scope"`
	ShortDescription *string            `json:"shortDescription,omitempty"`
}

type SkillSummary

type SkillSummary struct {
	Description      string          `json:"description"`
	Interface        *SkillInterface `json:"interface,omitempty"`
	Name             string          `json:"name"`
	Path             string          `json:"path"`
	ShortDescription *string         `json:"shortDescription,omitempty"`
}

type SkillToolDependency

type SkillToolDependency struct {
	Command     *string `json:"command,omitempty"`
	Description *string `json:"description,omitempty"`
	Transport   *string `json:"transport,omitempty"`
	Type        string  `json:"type"`
	URL         *string `json:"url,omitempty"`
	Value       string  `json:"value"`
}

type SkillsConfigWriteParams

type SkillsConfigWriteParams struct {
	Path    string `json:"path"`
	Enabled bool   `json:"enabled"`
}

type SkillsConfigWriteResult

type SkillsConfigWriteResult struct {
	EffectiveEnabled bool `json:"effectiveEnabled"`
}

type SkillsListEntry

type SkillsListEntry struct {
	Cwd    string           `json:"cwd"`
	Errors []SkillErrorInfo `json:"errors"`
	Skills []SkillMetadata  `json:"skills"`
}

type SkillsListExtraRootsForCwd

type SkillsListExtraRootsForCwd struct {
	Cwd            string   `json:"cwd"`
	ExtraUserRoots []string `json:"extraUserRoots"`
}

type SkillsListParams

type SkillsListParams struct {
	Cwds                 []string                     `json:"cwds,omitempty"`
	ForceReload          bool                         `json:"forceReload,omitempty"`
	PerCwdExtraUserRoots []SkillsListExtraRootsForCwd `json:"perCwdExtraUserRoots,omitempty"`
}

type SkillsListResult

type SkillsListResult struct {
	Data []SkillsListEntry `json:"data"`
}

type StartOptions

type StartOptions struct {
	Command          string
	Args             []string
	Dir              string
	Env              []string
	Stderr           io.Writer
	ClientInfo       ClientInfo
	Capabilities     *Capabilities
	RestartOnFailure bool
	RestartPolicy    RestartPolicy
}

func (StartOptions) SetExperimentalAPI

func (o StartOptions) SetExperimentalAPI(enabled bool) StartOptions

func (StartOptions) SetNotificationOptOut

func (o StartOptions) SetNotificationOptOut(methods ...string) StartOptions

type Thread

type Thread struct {
	ID     string        `json:"id"`
	Name   *string       `json:"name,omitempty"`
	Status *ThreadStatus `json:"status,omitempty"`
	Turns  []Turn        `json:"turns,omitempty"`
}

type ThreadArchiveParams

type ThreadArchiveParams struct {
	ThreadID string `json:"threadId"`
}

type ThreadArchiveResult

type ThreadArchiveResult struct{}

type ThreadArchivedEvent

type ThreadArchivedEvent struct {
	ThreadID string  `json:"threadId,omitempty"`
	Thread   *Thread `json:"thread,omitempty"`
}

func (ThreadArchivedEvent) NotificationMethod

func (ThreadArchivedEvent) NotificationMethod() string

type ThreadClosedEvent

type ThreadClosedEvent struct {
	ThreadID string `json:"threadId"`
}

func (ThreadClosedEvent) NotificationMethod

func (ThreadClosedEvent) NotificationMethod() string

type ThreadCompactStartParams

type ThreadCompactStartParams struct {
	ThreadID string `json:"threadId"`
}

type ThreadCompactStartResult

type ThreadCompactStartResult struct{}

type ThreadForkParams

type ThreadForkParams struct {
	ThreadID              string         `json:"threadId"`
	ApprovalPolicy        any            `json:"approvalPolicy,omitempty"`
	ApprovalsReviewer     *string        `json:"approvalsReviewer,omitempty"`
	BaseInstructions      *string        `json:"baseInstructions,omitempty"`
	Config                map[string]any `json:"config,omitempty"`
	Cwd                   *string        `json:"cwd,omitempty"`
	DeveloperInstructions *string        `json:"developerInstructions,omitempty"`
	Ephemeral             bool           `json:"ephemeral"`
	Model                 *string        `json:"model,omitempty"`
	ModelProvider         *string        `json:"modelProvider,omitempty"`
	ServiceTier           *string        `json:"serviceTier,omitempty"`
	Sandbox               *string        `json:"sandbox,omitempty"`
}

type ThreadForkResult

type ThreadForkResult = ThreadStartResult

type ThreadItem

type ThreadItem struct {
	ID               string          `json:"id"`
	Type             string          `json:"type"`
	Status           string          `json:"status,omitempty"`
	Text             string          `json:"text,omitempty"`
	Content          json.RawMessage `json:"content,omitempty"`
	Command          string          `json:"command,omitempty"`
	Cwd              string          `json:"cwd,omitempty"`
	AggregatedOutput string          `json:"aggregatedOutput,omitempty"`
	ExitCode         *int            `json:"exitCode,omitempty"`
	DurationMs       *int64          `json:"durationMs,omitempty"`
	Result           json.RawMessage `json:"result,omitempty"`
	Error            json.RawMessage `json:"error,omitempty"`
	Changes          json.RawMessage `json:"changes,omitempty"`
}

type ThreadListParams

type ThreadListParams struct {
	Archived       *bool              `json:"archived,omitempty"`
	Cursor         *string            `json:"cursor,omitempty"`
	Cwd            *string            `json:"cwd,omitempty"`
	Limit          *uint32            `json:"limit,omitempty"`
	ModelProviders []string           `json:"modelProviders,omitempty"`
	SearchTerm     *string            `json:"searchTerm,omitempty"`
	SortKey        *ThreadSortKey     `json:"sortKey,omitempty"`
	SourceKinds    []ThreadSourceKind `json:"sourceKinds,omitempty"`
}

type ThreadListResult

type ThreadListResult struct {
	Data       []Thread `json:"data"`
	NextCursor *string  `json:"nextCursor,omitempty"`
}

type ThreadLoadedListParams

type ThreadLoadedListParams struct {
	Cursor *string `json:"cursor,omitempty"`
	Limit  *uint32 `json:"limit,omitempty"`
}

type ThreadLoadedListResult

type ThreadLoadedListResult struct {
	Data       []string `json:"data"`
	NextCursor *string  `json:"nextCursor,omitempty"`
}

type ThreadNameUpdatedEvent

type ThreadNameUpdatedEvent struct {
	ThreadID string `json:"threadId"`
	Name     string `json:"name"`
}

func (ThreadNameUpdatedEvent) NotificationMethod

func (ThreadNameUpdatedEvent) NotificationMethod() string

type ThreadReadParams

type ThreadReadParams struct {
	ThreadID     string `json:"threadId"`
	IncludeTurns bool   `json:"includeTurns,omitempty"`
}

type ThreadReadResult

type ThreadReadResult struct {
	Thread Thread `json:"thread"`
}

type ThreadResumeParams

type ThreadResumeParams struct {
	ThreadID              string         `json:"threadId"`
	ApprovalPolicy        any            `json:"approvalPolicy,omitempty"`
	ApprovalsReviewer     *string        `json:"approvalsReviewer,omitempty"`
	BaseInstructions      *string        `json:"baseInstructions,omitempty"`
	Config                map[string]any `json:"config,omitempty"`
	Cwd                   *string        `json:"cwd,omitempty"`
	DeveloperInstructions *string        `json:"developerInstructions,omitempty"`
	Sandbox               *string        `json:"sandbox,omitempty"`
	Model                 *string        `json:"model,omitempty"`
	ModelProvider         *string        `json:"modelProvider,omitempty"`
	ServiceTier           *string        `json:"serviceTier,omitempty"`
	Personality           *string        `json:"personality,omitempty"`
}

type ThreadResumeResult

type ThreadResumeResult = ThreadStartResult

type ThreadRollbackParams

type ThreadRollbackParams struct {
	ThreadID string `json:"threadId"`
	NumTurns uint32 `json:"numTurns"`
}

type ThreadRollbackResult

type ThreadRollbackResult struct {
	Thread Thread `json:"thread"`
}

type ThreadSetNameParams

type ThreadSetNameParams struct {
	ThreadID string `json:"threadId"`
	Name     string `json:"name"`
}

type ThreadSetNameResult

type ThreadSetNameResult struct{}

type ThreadSortKey

type ThreadSortKey string
const (
	ThreadSortKeyCreatedAt ThreadSortKey = "created_at"
	ThreadSortKeyUpdatedAt ThreadSortKey = "updated_at"
)

type ThreadSourceKind

type ThreadSourceKind string
const (
	ThreadSourceKindCLI                 ThreadSourceKind = "cli"
	ThreadSourceKindVSCode              ThreadSourceKind = "vscode"
	ThreadSourceKindExec                ThreadSourceKind = "exec"
	ThreadSourceKindAppServer           ThreadSourceKind = "appServer"
	ThreadSourceKindCustom              ThreadSourceKind = "custom"
	ThreadSourceKindSubAgent            ThreadSourceKind = "subAgent"
	ThreadSourceKindSubAgentReview      ThreadSourceKind = "subAgentReview"
	ThreadSourceKindSubAgentCompact     ThreadSourceKind = "subAgentCompact"
	ThreadSourceKindSubAgentThreadSpawn ThreadSourceKind = "subAgentThreadSpawn"
	ThreadSourceKindSubAgentOther       ThreadSourceKind = "subAgentOther"
	ThreadSourceKindUnknown             ThreadSourceKind = "unknown"
)

type ThreadStartParams

type ThreadStartParams struct {
	ApprovalPolicy        any            `json:"approvalPolicy,omitempty"`
	ApprovalsReviewer     *string        `json:"approvalsReviewer,omitempty"`
	BaseInstructions      *string        `json:"baseInstructions,omitempty"`
	Config                map[string]any `json:"config,omitempty"`
	Cwd                   *string        `json:"cwd,omitempty"`
	DeveloperInstructions *string        `json:"developerInstructions,omitempty"`
	ServiceTier           *string        `json:"serviceTier,omitempty"`
	Ephemeral             *bool          `json:"ephemeral,omitempty"`
	ServiceName           *string        `json:"serviceName,omitempty"`
	Personality           *string        `json:"personality,omitempty"`
	Model                 *string        `json:"model,omitempty"`
	ModelProvider         *string        `json:"modelProvider,omitempty"`
	Sandbox               *string        `json:"sandbox,omitempty"`
}

type ThreadStartResult

type ThreadStartResult struct {
	ApprovalPolicy    json.RawMessage `json:"approvalPolicy"`
	ApprovalsReviewer string          `json:"approvalsReviewer"`
	Cwd               string          `json:"cwd"`
	Model             string          `json:"model"`
	ModelProvider     string          `json:"modelProvider"`
	ReasoningEffort   *string         `json:"reasoningEffort,omitempty"`
	Sandbox           json.RawMessage `json:"sandbox"`
	ServiceTier       *string         `json:"serviceTier,omitempty"`
	Thread            Thread          `json:"thread"`
}

type ThreadStartedEvent

type ThreadStartedEvent struct {
	Thread Thread `json:"thread"`
}

func (ThreadStartedEvent) NotificationMethod

func (ThreadStartedEvent) NotificationMethod() string

type ThreadStatus

type ThreadStatus struct {
	Type        string   `json:"type"`
	ActiveFlags []string `json:"activeFlags,omitempty"`
}

type ThreadStatusChangedEvent

type ThreadStatusChangedEvent struct {
	ThreadID string       `json:"threadId"`
	Status   ThreadStatus `json:"status"`
}

func (ThreadStatusChangedEvent) NotificationMethod

func (ThreadStatusChangedEvent) NotificationMethod() string

type ThreadTokenUsage

type ThreadTokenUsage struct {
	Last               TokenUsageBreakdown `json:"last"`
	ModelContextWindow *int64              `json:"modelContextWindow,omitempty"`
	Total              TokenUsageBreakdown `json:"total"`
}

type ThreadTokenUsageUpdatedEvent

type ThreadTokenUsageUpdatedEvent struct {
	ThreadID   string           `json:"threadId"`
	TurnID     string           `json:"turnId"`
	TokenUsage ThreadTokenUsage `json:"tokenUsage"`
}

func (ThreadTokenUsageUpdatedEvent) NotificationMethod

func (ThreadTokenUsageUpdatedEvent) NotificationMethod() string

type ThreadUnarchiveParams

type ThreadUnarchiveParams struct {
	ThreadID string `json:"threadId"`
}

type ThreadUnarchiveResult

type ThreadUnarchiveResult struct {
	Thread Thread `json:"thread"`
}

type ThreadUnarchivedEvent

type ThreadUnarchivedEvent struct {
	Thread Thread `json:"thread"`
}

func (ThreadUnarchivedEvent) NotificationMethod

func (ThreadUnarchivedEvent) NotificationMethod() string

type ThreadUnsubscribeParams

type ThreadUnsubscribeParams struct {
	ThreadID string `json:"threadId"`
}

type ThreadUnsubscribeResult

type ThreadUnsubscribeResult struct {
	Status ThreadUnsubscribeStatus `json:"status"`
}

type ThreadUnsubscribeStatus

type ThreadUnsubscribeStatus string
const (
	ThreadUnsubscribeStatusNotLoaded     ThreadUnsubscribeStatus = "notLoaded"
	ThreadUnsubscribeStatusNotSubscribed ThreadUnsubscribeStatus = "notSubscribed"
	ThreadUnsubscribeStatusUnsubscribed  ThreadUnsubscribeStatus = "unsubscribed"
)

type TokenUsageBreakdown

type TokenUsageBreakdown struct {
	CachedInputTokens     int64 `json:"cachedInputTokens"`
	InputTokens           int64 `json:"inputTokens"`
	OutputTokens          int64 `json:"outputTokens"`
	ReasoningOutputTokens int64 `json:"reasoningOutputTokens"`
	TotalTokens           int64 `json:"totalTokens"`
}

type ToolRequestUserInputAnswer

type ToolRequestUserInputAnswer struct {
	Answers []string `json:"answers"`
}

type ToolRequestUserInputOption

type ToolRequestUserInputOption struct {
	Description string `json:"description"`
	Label       string `json:"label"`
}

type ToolRequestUserInputParams

type ToolRequestUserInputParams struct {
	ItemID    string                         `json:"itemId"`
	Questions []ToolRequestUserInputQuestion `json:"questions"`
	ThreadID  string                         `json:"threadId"`
	TurnID    string                         `json:"turnId"`
}

type ToolRequestUserInputQuestion

type ToolRequestUserInputQuestion struct {
	Header   string                       `json:"header"`
	ID       string                       `json:"id"`
	IsOther  bool                         `json:"isOther,omitempty"`
	IsSecret bool                         `json:"isSecret,omitempty"`
	Options  []ToolRequestUserInputOption `json:"options,omitempty"`
	Question string                       `json:"question"`
}

type ToolRequestUserInputResult

type ToolRequestUserInputResult struct {
	Answers map[string]ToolRequestUserInputAnswer `json:"answers"`
}

type Turn

type Turn struct {
	ID     string       `json:"id"`
	Status string       `json:"status,omitempty"`
	Items  []ThreadItem `json:"items,omitempty"`
	Error  *TurnError   `json:"error,omitempty"`
}

type TurnCompletedEvent

type TurnCompletedEvent struct {
	ThreadID string `json:"threadId"`
	Turn     Turn   `json:"turn"`
}

func (TurnCompletedEvent) NotificationMethod

func (TurnCompletedEvent) NotificationMethod() string

type TurnDiffUpdatedEvent

type TurnDiffUpdatedEvent struct {
	ThreadID string `json:"threadId"`
	TurnID   string `json:"turnId"`
	Diff     string `json:"diff"`
}

func (TurnDiffUpdatedEvent) NotificationMethod

func (TurnDiffUpdatedEvent) NotificationMethod() string

type TurnError

type TurnError struct {
	Message           string          `json:"message"`
	CodexErrorInfo    json.RawMessage `json:"codexErrorInfo,omitempty"`
	AdditionalDetails json.RawMessage `json:"additionalDetails,omitempty"`
}

type TurnInterruptParams

type TurnInterruptParams struct {
	ThreadID string `json:"threadId"`
	TurnID   string `json:"turnId"`
}

type TurnInterruptResult

type TurnInterruptResult struct{}

type TurnPlanUpdatedEvent

type TurnPlanUpdatedEvent struct {
	TurnID      string          `json:"turnId"`
	Explanation *string         `json:"explanation,omitempty"`
	Plan        json.RawMessage `json:"plan"`
}

func (TurnPlanUpdatedEvent) NotificationMethod

func (TurnPlanUpdatedEvent) NotificationMethod() string

type TurnStartInputItem

type TurnStartInputItem map[string]any

type TurnStartParams

type TurnStartParams struct {
	ThreadID          string               `json:"threadId"`
	Input             []TurnStartInputItem `json:"input"`
	ApprovalPolicy    any                  `json:"approvalPolicy,omitempty"`
	ApprovalsReviewer *string              `json:"approvalsReviewer,omitempty"`
	Cwd               *string              `json:"cwd,omitempty"`
	Effort            *string              `json:"effort,omitempty"`
	Model             *string              `json:"model,omitempty"`
	OutputSchema      any                  `json:"outputSchema,omitempty"`
	Personality       *string              `json:"personality,omitempty"`
	SandboxPolicy     any                  `json:"sandboxPolicy,omitempty"`
	ServiceTier       *string              `json:"serviceTier,omitempty"`
	Summary           *string              `json:"summary,omitempty"`
}

type TurnStartResult

type TurnStartResult struct {
	Turn Turn `json:"turn"`
}

type TurnStartedEvent

type TurnStartedEvent struct {
	ThreadID string `json:"threadId"`
	Turn     Turn   `json:"turn"`
}

func (TurnStartedEvent) NotificationMethod

func (TurnStartedEvent) NotificationMethod() string

type TurnSteerParams

type TurnSteerParams struct {
	ThreadID       string               `json:"threadId"`
	ExpectedTurnID string               `json:"expectedTurnId"`
	Input          []TurnStartInputItem `json:"input"`
}

type TurnSteerResult

type TurnSteerResult struct {
	TurnID string `json:"turnId"`
}

type WindowsSandboxSetupCompletedEvent

type WindowsSandboxSetupCompletedEvent struct {
	Mode    WindowsSandboxSetupMode `json:"mode"`
	Success bool                    `json:"success"`
	Error   *string                 `json:"error"`
}

func (WindowsSandboxSetupCompletedEvent) NotificationMethod

func (WindowsSandboxSetupCompletedEvent) NotificationMethod() string

type WindowsSandboxSetupMode

type WindowsSandboxSetupMode string
const (
	WindowsSandboxSetupModeElevated   WindowsSandboxSetupMode = "elevated"
	WindowsSandboxSetupModeUnelevated WindowsSandboxSetupMode = "unelevated"
)

type WindowsSandboxSetupStartParams

type WindowsSandboxSetupStartParams struct {
	Cwd  *string                 `json:"cwd,omitempty"`
	Mode WindowsSandboxSetupMode `json:"mode"`
}

type WindowsSandboxSetupStartResult

type WindowsSandboxSetupStartResult struct {
	Started bool `json:"started"`
}

Jump to

Keyboard shortcuts

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