Documentation
¶
Index ¶
- Constants
- type AddFollowupRequest
- type AgentIDRequest
- type AgentPrompt
- type AgentSource
- type AgentTarget
- type Client
- func (c *Client) AddFollowup(ctx context.Context, id string, req interface{}) (string, error)
- func (c *Client) CancelAgent(ctx context.Context, id string) (string, error)
- func (c *Client) DeleteAgent(ctx context.Context, id string) (string, error)
- func (c *Client) DownloadArtifact(ctx context.Context, id, path string) (string, error)
- func (c *Client) GetAgentConversation(ctx context.Context, id string) (string, error)
- func (c *Client) GetAgentStatus(ctx context.Context, id string) (string, error)
- func (c *Client) LaunchAgent(ctx context.Context, req interface{}) (string, error)
- func (c *Client) ListAgents(ctx context.Context, query string) (string, error)
- func (c *Client) ListArtifacts(ctx context.Context, id string) (string, error)
- func (c *Client) ListModels(ctx context.Context) (string, error)
- func (c *Client) SetBaseURL(url string)
- type Config
- type DownloadArtifactRequest
- type LaunchAgentRequest
- type ListAgentsRequest
- type Provider
- type RunTaskRequest
Constants ¶
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 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 (*Client) AddFollowup ¶
AddFollowup adds a follow-up to an agent.
func (*Client) CancelAgent ¶
CancelAgent requests cancellation of an agent.
func (*Client) DeleteAgent ¶
DeleteAgent deletes an agent.
func (*Client) DownloadArtifact ¶
DownloadArtifact gets a presigned download URL for an artifact.
func (*Client) GetAgentConversation ¶
GetAgentConversation gets an agent's conversation.
func (*Client) GetAgentStatus ¶
GetAgentStatus gets an agent's status.
func (*Client) LaunchAgent ¶
LaunchAgent launches a new agent.
func (*Client) ListAgents ¶
ListAgents lists agents.
func (*Client) ListArtifacts ¶
ListArtifacts lists an agent's artifacts.
func (*Client) ListModels ¶
ListModels gets the available models
func (*Client) SetBaseURL ¶
SetBaseURL overrides the default base URL for testing.
type DownloadArtifactRequest ¶
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 ¶
NewToolProvider creates a set of tools for the Cursor Cloud Agents API.
func (*Provider) SetBaseURL ¶
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"`
}