Versions in this module Expand all Collapse all v0 v0.0.3 Jun 15, 2026 v0.0.2 Jun 15, 2026 Changes in this version + var Cursor = cursorNamespace + var Models = modelsNamespace + var Repositories = repositoriesNamespace + func ArchiveAgent(ctx context.Context, agentID string, opts AgentOperationOptions, ...) error + func AssistantText(msg SDKMessage) string + func CancelRun(ctx context.Context, runID, agentID string, clientOpts ...ClientOption) error + func CloseDefaultClient() error + func Configure(opts ConfigureOptions) + func DeleteAgent(ctx context.Context, agentID string, opts AgentOperationOptions, ...) error + func EnsureBridgeInstalled(ctx context.Context) error + func IsAgentBusy(err error) bool + func IsAuthentication(err error) bool + func IsConfiguration(err error) bool + func IsIntegrationNotConnected(err error) bool + func IsNotFound(err error) bool + func IsRateLimit(err error) bool + func IsUnsupportedRunOperation(err error) bool + func McpServerFromMap(m map[string]any) map[string]any + func Setup(ctx context.Context, opts SetupOptions) error + func UnarchiveAgent(ctx context.Context, agentID string, opts AgentOperationOptions, ...) error + type APITimeoutError struct + type Agent struct + AgentID string + Model *ModelSelection + func CreateAgent(ctx context.Context, opts AgentOptions, clientOpts ...ClientOption) (*Agent, error) + func ResumeAgent(ctx context.Context, agentID string, opts AgentOptions, ...) (*Agent, error) + func (a *Agent) Archive(ctx context.Context, opts AgentOperationOptions) error + func (a *Agent) Close(ctx context.Context) error + func (a *Agent) Delete(ctx context.Context, opts AgentOperationOptions) error + func (a *Agent) DownloadArtifact(ctx context.Context, path string) ([]byte, error) + func (a *Agent) ListArtifacts(ctx context.Context) ([]SdkArtifact, error) + func (a *Agent) ListMessages(ctx context.Context) ([]AgentMessage, error) + func (a *Agent) Reload(ctx context.Context) error + func (a *Agent) Send(ctx context.Context, message any, opts SendOptions) (*Run, error) + func (a *Agent) Unarchive(ctx context.Context, opts AgentOperationOptions) error + type AgentBusyError struct + type AgentDefinition struct + Description string + McpServers []any + Model any + Prompt string + func (d AgentDefinition) ToWire() map[string]any + type AgentError struct + Code string + Details []map[string]any + Headers map[string]string + IsRetryable bool + Message string + ProtoErrorCode string + RequestID string + RetryAfter string + Status int + func AsAgentError(err error) (*AgentError, bool) + func (e *AgentError) Error() string + type AgentMessage struct + AgentID string + Message any + Type string + UUID string + type AgentMode string + const AgentModeAgent + const AgentModePlan + type AgentNotFoundError struct + type AgentOperationOptions struct + APIKey string + CWD string + func (o AgentOperationOptions) ToWire() map[string]any + type AgentOptions struct + APIKey string + AgentID string + Agents map[string]AgentDefinition + Cloud *CloudAgentOptions + IdempotencyKey string + Local *LocalAgentOptions + McpServers map[string]McpServer + Mode AgentMode + Model any + Name string + func (o AgentOptions) ToWire() map[string]any + type AgentsResource struct + func (r *AgentsResource) Archive(ctx context.Context, agentID string, opts AgentOperationOptions) error + func (r *AgentsResource) CancelRun(ctx context.Context, runID, agentID string) error + func (r *AgentsResource) Create(ctx context.Context, opts AgentOptions) (*Agent, error) + func (r *AgentsResource) Delete(ctx context.Context, agentID string, opts AgentOperationOptions) error + func (r *AgentsResource) Get(ctx context.Context, agentID string, opts GetAgentOptions) (SDKAgentInfo, error) + func (r *AgentsResource) GetRun(ctx context.Context, runID string, opts GetRunOptions) (*Run, error) + func (r *AgentsResource) List(ctx context.Context, opts ListAgentsOptions) (ListResult[SDKAgentInfo], error) + func (r *AgentsResource) ListRuns(ctx context.Context, agentID string, opts ListRunsOptions) (ListResult[*Run], error) + func (r *AgentsResource) Resume(ctx context.Context, agentID string, opts AgentOptions) (*Agent, error) + func (r *AgentsResource) Unarchive(ctx context.Context, agentID string, opts AgentOperationOptions) error + type AuthenticationError struct + type BadRequestError struct + type Client struct + Agents *AgentsResource + Models *ModelsResource + Repositories *RepositoriesResource + func Connect(baseURL, authToken string, opts ...ClientOption) (*Client, error) + func DefaultClient(ctx context.Context) (*Client, error) + func LaunchBridge(ctx context.Context, opts ...ClientOption) (*Client, error) + func (c *Client) Close() error + func (c *Client) GetVersion(ctx context.Context) (map[string]any, error) + func (c *Client) Ping(ctx context.Context) (string, error) + func (c *Client) Shutdown(ctx context.Context, graceSeconds int) error + func (c *Client) WithOptions(opts ...ClientOption) (*Client, error) + type ClientOption func(*clientConfig) + func WithAllowAPIKeyEnvFallback(allow bool) ClientOption + func WithMaxRetries(n int) ClientOption + func WithStreamTimeout(d time.Duration) ClientOption + func WithUnaryTimeout(d time.Duration) ClientOption + func WithWorkspace(path string) ClientOption + type CloudAgentOptions struct + AutoCreatePR *bool + Env *CloudEnvironment + EnvVars map[string]string + Repos []CloudRepository + SkipReviewerRequest *bool + WorkOnCurrentBranch *bool + func (o CloudAgentOptions) ToWire() map[string]any + type CloudEnvironment struct + Name string + Type string + func (e CloudEnvironment) ToWire() map[string]any + type CloudRepository struct + PRURL string + StartingRef string + URL string + func (r CloudRepository) ToWire() map[string]any + type ConfigurationError struct + type ConfigureLocalOptions struct + Store *LocalAgentStoreConfig + type ConfigureOptions struct + Local *ConfigureLocalOptions + type ConversationStep struct + Message map[string]any + Raw map[string]any + Text string + Type string + func ParseConversationStep(m map[string]any) ConversationStep + type ConversationTurn struct + Turn any + Type string + func ConversationFromJSON(raw string) ([]ConversationTurn, error) + func ParseConversationTurn(m map[string]any) ConversationTurn + type CursorAgentError = AgentError + type CursorClient = Client + type CursorRequestOptions struct + APIKey string + type CustomTool struct + Description string + Execute func(args map[string]any, ctx CustomToolContext) (any, error) + InputSchema map[string]any + type CustomToolContext struct + ToolCallID string + type DeltaCallback func(InteractionUpdate) + type FlatMcpServer map[string]any + func (f FlatMcpServer) ToWire() map[string]any + type GetAgentOptions struct + APIKey string + CWD string + func (o GetAgentOptions) ToWire() map[string]any + type GetRunOptions struct + APIKey string + AgentID string + CWD string + Runtime string + func (o GetRunOptions) ToWire() map[string]any + type HttpMcpServerConfig struct + Auth *McpAuth + Headers map[string]string + Type string + URL string + func (c HttpMcpServerConfig) ToWire() map[string]any + type IntegrationNotConnectedError struct + HelpURL string + Provider string + type InteractionUpdate struct + CallID string + Event map[string]any + ModelCallID string + Raw map[string]any + StepDurationMS int + StepID int + Summary string + Text string + ThinkingDurationMS int + Tokens int + ToolCall map[string]any + Type string + Usage map[string]any + UserMessage map[string]any + func ParseInteractionUpdate(m map[string]any) InteractionUpdate + type InternalServerError struct + type ListAgentsOptions struct + APIKey string + CWD string + Cursor string + IncludeArchived *bool + Limit int + PRURL string + Runtime string + func (o ListAgentsOptions) ToWire() map[string]any + type ListResult struct + Items []T + NextCursor string + func ListAgents(ctx context.Context, opts ListAgentsOptions, clientOpts ...ClientOption) (ListResult[SDKAgentInfo], error) + func ListRuns(ctx context.Context, agentID string, opts ListRunsOptions, ...) (ListResult[*Run], error) + func (l ListResult[T]) AllPages() ([]T, error) + func (l ListResult[T]) HasNextPage() bool + func (l ListResult[T]) NextPage() (ListResult[T], error) + func (l ListResult[T]) NextPageInfo() map[string]string + type ListRunsOptions struct + APIKey string + CWD string + Cursor string + Limit int + Runtime string + func (o ListRunsOptions) ToWire() map[string]any + type LocalAgentOptions struct + AutoReview *bool + CWD []string + CustomTools map[string]CustomTool + SandboxOptions *SandboxOptions + SettingSources []SettingSource + Store *LocalAgentStoreConfig + func LocalOptions(cwd ...string) *LocalAgentOptions + func (o LocalAgentOptions) ToWire() map[string]any + type LocalAgentStoreConfig struct + RootDir string + Type string + func (c LocalAgentStoreConfig) ToWire() map[string]any + type LocalSendOptions struct + CustomTools map[string]CustomTool + Force *bool + func (o LocalSendOptions) ToWire() map[string]any + type McpAuth struct + ClientID string + ClientSecret string + Scopes []string + func (a McpAuth) ToWire() map[string]any + type McpServer interface + ToWire func() map[string]any + type ModelParameterDefinition struct + DisplayName string + ID string + Values []ModelParameterDefinitionValue + type ModelParameterDefinitionValue struct + DisplayName string + Value string + type ModelParameterValue struct + ID string + Value string + func (p ModelParameterValue) ToWire() map[string]any + type ModelSelection struct + ID string + Params []ModelParameterValue + func ModelFromString(id string) ModelSelection + func (m ModelSelection) ToWire() map[string]any + type ModelVariant struct + Description string + DisplayName string + IsDefault bool + Params []ModelParameterValue + type ModelsResource struct + func (r *ModelsResource) List(ctx context.Context, opts CursorRequestOptions) ([]SDKModel, error) + type NetworkError struct + type NotFoundError struct + type PermissionDeniedError struct + type RateLimitError struct + type RepositoriesResource struct + func (r *RepositoriesResource) List(ctx context.Context, opts CursorRequestOptions) ([]SDKRepository, error) + type Run struct + AgentID string + CreatedAt string + DurationMS int + Git *RunGitInfo + ID string + Model *ModelSelection + RequestID string + Result string + Status RunStatus + func GetRun(ctx context.Context, runID string, opts GetRunOptions, ...) (*Run, error) + func (r *Run) Cancel(ctx context.Context) error + func (r *Run) Conversation(ctx context.Context) ([]ConversationTurn, error) + func (r *Run) ConversationJSON(ctx context.Context) (string, error) + func (r *Run) Events(ctx context.Context) iter.Seq2[RunStreamEvent, error] + func (r *Run) IterText(ctx context.Context) iter.Seq2[string, error] + func (r *Run) Messages(ctx context.Context) iter.Seq2[SDKMessage, error] + func (r *Run) Observe(ctx context.Context, afterOffset string) iter.Seq2[RunStreamEvent, error] + func (r *Run) OnDidChangeStatus(fn func(RunStatus)) func() + func (r *Run) OnStatusChange(fn func(RunStatus)) func() + func (r *Run) Stream(ctx context.Context) iter.Seq2[SDKMessage, error] + func (r *Run) Supports(op RunOperation) bool + func (r *Run) SupportsString(op string) bool + func (r *Run) Text(ctx context.Context) (string, error) + func (r *Run) UnsupportedReason(op RunOperation) string + func (r *Run) UnsupportedReasonString(op string) string + func (r *Run) Wait(ctx context.Context) (RunResult, error) + type RunGitBranchInfo struct + Branch string + PRURL string + RepoURL string + type RunGitInfo struct + Branches []RunGitBranchInfo + type RunOperation string + const RunOpCancel + const RunOpConversation + const RunOpStream + const RunOpWait + type RunResult struct + AgentID string + CreatedAt string + DurationMS int + Git *RunGitInfo + ID string + Model *ModelSelection + RequestID string + Result string + Status RunStatus + func Prompt(ctx context.Context, message any, opts AgentOptions, ...) (RunResult, error) + type RunResultStatus = RunStatus + type RunSnapshot = RunResult + type RunStatus string + const RunStatusCancelled + const RunStatusError + const RunStatusExpired + const RunStatusFinished + const RunStatusRunning + type RunStreamEvent struct + Done map[string]any + InteractionUpdate InteractionUpdate + Kind string + Offset string + Result map[string]any + ResultIsFull bool + SDKMessage SDKMessage + Step ConversationStep + func ParseRunStreamEvent(m map[string]any) RunStreamEvent + type SDKAgentInfo struct + AgentID string + Archived bool + CWD string + CreatedAt string + Env *CloudEnvironment + LastModified string + Name string + Repos []string + Runtime string + Status string + Summary string + func GetAgent(ctx context.Context, agentID string, opts GetAgentOptions, ...) (SDKAgentInfo, error) + type SDKArtifact = SdkArtifact + type SDKError = AgentError + type SDKImage struct + Data string + Dimension *SDKImageDimension + MimeType string + URL string + func ImageFromFile(path string, mimeType string, dim *SDKImageDimension) (SDKImage, error) + func ImageFromURL(url string, dim *SDKImageDimension) SDKImage + func (i SDKImage) ToWire() map[string]any + type SDKImageDimension struct + Height int + Width int + type SDKMessage struct + AgentID string + AssistantContent []any + Model *ModelSelection + Raw map[string]any + RequestID string + RunID string + Status string + StatusMessage string + Subtype string + TaskStatus string + TaskText string + ThinkingDurationMS *int + ThinkingText string + ToolArgs any + ToolCallID string + ToolName string + ToolResult any + ToolStatus string + Tools []string + Type string + UserContent []TextBlock + func SDKMessageFromJSON(m map[string]any) SDKMessage + type SDKModel struct + Description string + DisplayName string + ID string + Parameters []ModelParameterDefinition + Variants []ModelVariant + type SDKRepository struct + URL string + type SDKUser struct + APIKeyName string + CreatedAt string + UserEmail string + UserFirstName string + UserID *int + UserLastName string + type SDKUserMessage = UserMessage + type SandboxOptions struct + Enabled *bool + func (s SandboxOptions) ToWire() map[string]any + type SdkArtifact struct + Path string + SizeBytes int + UpdatedAt string + type SendOptions struct + IdempotencyKey string + Local *LocalSendOptions + McpServers map[string]McpServer + Mode AgentMode + Model any + OnDelta DeltaCallback + OnStep StepCallback + func (o SendOptions) ToWire() map[string]any + type SettingSource string + const SettingSourceAll + const SettingSourceMDM + const SettingSourcePlugins + const SettingSourceProject + const SettingSourceTeam + const SettingSourceUser + type SetupOptions struct + BridgeDir string + Local bool + Version string + type StdioMcpServerConfig struct + Args []string + CWD string + Command string + Env map[string]string + func (c StdioMcpServerConfig) ToWire() map[string]any + type StepCallback func(ConversationStep) + type TextBlock struct + Text string + Type string + type ToolCallbackServer struct + Token string + URL string + func NewToolCallbackServer() *ToolCallbackServer + func (s *ToolCallbackServer) Close() + func (s *ToolCallbackServer) RegisterAgent(agentID string, tools map[string]CustomTool) + func (s *ToolCallbackServer) UnregisterAgent(agentID string) + type ToolUseBlock struct + ID string + Input any + Name string + Type string + type UnknownAgentError struct + type UnsupportedRunOperationError struct + Operation string + type UserMessage struct + Images []SDKImage + Text string + func UserMessageFromText(text string) UserMessage + func (m UserMessage) ToWire() map[string]any