cursor

package
v0.1.8-rc.24 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAPIKeyEnv = "CURSOR_API_KEY"

DefaultAPIKeyEnv is the default environment variable for the Cursor API key

Variables

This section is empty.

Functions

This section is empty.

Types

type AddFollowupRequest

type AddFollowupRequest struct {
	ID     string      `json:"id" jsonschema:"description=Unique identifier for the cloud agent,required"`
	Prompt AgentPrompt `json:"prompt" jsonschema:"description=The follow-up prompt for the agent,required"`
}

type AgentIDRequest

type AgentIDRequest struct {
	ID string `json:"id" jsonschema:"description=Unique identifier for the cloud agent,required"`
}

type AgentPrompt

type AgentPrompt struct {
	Text string `json:"text" jsonschema:"description=The instruction text for the agent,required"`
}

type AgentSource

type AgentSource struct {
	Repository string `json:"repository" jsonschema:"description=GitHub repository URL (e.g. https://github.com/org/repo),required"`
	Ref        string `json:"ref,omitempty" jsonschema:"description=Optional branch or commit ref"`
}

type AgentTarget

type AgentTarget struct {
	BranchName            string `json:"branchName,omitempty" jsonschema:"description=Target branch name for the PR"`
	AutoCreatePr          bool   `json:"autoCreatePr,omitempty" jsonschema:"description=Whether to automatically create a PR"`
	OpenAsCursorGithubApp bool   `json:"openAsCursorGithubApp,omitempty"`
	SkipReviewerRequest   bool   `json:"skipReviewerRequest,omitempty"`
}

type Client

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

Client is a minimal HTTP client for the Cursor Cloud Agents API.

func NewClient

func NewClient(apiKey string, timeout time.Duration) *Client

NewClient creates a new Cursor Cloud Agents API client.

func (*Client) AddFollowup

func (c *Client) AddFollowup(ctx context.Context, id string, req interface{}) (string, error)

AddFollowup adds a follow-up to an agent.

func (*Client) CancelAgent

func (c *Client) CancelAgent(ctx context.Context, id string) (string, error)

CancelAgent requests cancellation of an agent.

func (*Client) DeleteAgent

func (c *Client) DeleteAgent(ctx context.Context, id string) (string, error)

DeleteAgent deletes an agent.

func (*Client) DownloadArtifact

func (c *Client) DownloadArtifact(ctx context.Context, id, path string) (string, error)

DownloadArtifact gets a presigned download URL for an artifact.

func (*Client) GetAgentConversation

func (c *Client) GetAgentConversation(ctx context.Context, id string) (string, error)

GetAgentConversation gets an agent's conversation.

func (*Client) GetAgentStatus

func (c *Client) GetAgentStatus(ctx context.Context, id string) (string, error)

GetAgentStatus gets an agent's status.

func (*Client) LaunchAgent

func (c *Client) LaunchAgent(ctx context.Context, req interface{}) (string, error)

LaunchAgent launches a new agent.

func (*Client) ListAgents

func (c *Client) ListAgents(ctx context.Context, query string) (string, error)

ListAgents lists agents.

func (*Client) ListArtifacts

func (c *Client) ListArtifacts(ctx context.Context, id string) (string, error)

ListArtifacts lists an agent's artifacts.

func (*Client) ListModels

func (c *Client) ListModels(ctx context.Context) (string, error)

ListModels gets the available models

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(url string)

SetBaseURL overrides the default base URL for testing.

type Config

type Config struct {
	APIKey       string `toml:"api_key" json:"api_key" yaml:"api_key"`
	Timeout      int    `toml:"timeout" json:"timeout" yaml:"timeout"`
	AdvancedMode bool   `toml:"advanced_mode" json:"advanced_mode" yaml:"advanced_mode"`
}

type DownloadArtifactRequest

type DownloadArtifactRequest struct {
	ID   string `json:"id" jsonschema:"description=Unique identifier for the cloud agent,required"`
	Path string `json:"path" jsonschema:"description=Absolute artifact path from the list artifacts response,required"`
}

type LaunchAgentRequest

type LaunchAgentRequest struct {
	Prompt AgentPrompt `json:"prompt" jsonschema:"description=The task prompt for the agent,required"`
	Model  string      `json:"model,omitempty" jsonschema:"description=Optional model ID (e.g. claude-4-sonnet) or default"`
	Source AgentSource `json:"source" jsonschema:"description=Repository source information,required"`
	Target AgentTarget `json:"target,omitempty" jsonschema:"description=Optional target branch and PR settings"`
}

type ListAgentsRequest

type ListAgentsRequest struct {
	Limit  int    `json:"limit,omitempty" jsonschema:"description=Number of cloud agents to return."`
	Cursor string `json:"cursor,omitempty" jsonschema:"description=Pagination cursor from the previous response"`
	PrURL  string `json:"prUrl,omitempty" jsonschema:"description=Filter agents by pull request URL"`
}

type Provider

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

func NewToolProvider

func NewToolProvider(cfg Config) *Provider

NewToolProvider creates a set of tools for the Cursor Cloud Agents API.

func (*Provider) GetTools

func (p *Provider) GetTools(_ context.Context) []tool.Tool

GetTools returns the Cursor Cloud Agents tools.

func (*Provider) SetBaseURL

func (p *Provider) SetBaseURL(url string)

SetBaseURL overrides the default base URL for testing.

type RunTaskRequest

type RunTaskRequest struct {
	Prompt     string `json:"prompt" jsonschema:"description=The task prompt for the agent,required"`
	Model      string `json:"model,omitempty" jsonschema:"description=Optional model ID (e.g. claude-4-sonnet) or default"`
	Repository string `json:"repository" jsonschema:"description=GitHub repository URL (e.g. https://github.com/org/repo),required"`
	Ref        string `json:"ref,omitempty" jsonschema:"description=Optional branch or commit ref"`
}

Jump to

Keyboard shortcuts

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