cursor

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LaunchAgentPayloadType            = "cursor.launchAgent.finished"
	LaunchAgentDefaultChannel         = "default"
	LaunchAgentStatusCreating         = "CREATING"
	LaunchAgentStatusRunning          = "RUNNING"
	LaunchAgentStatusFinished         = "FINISHED"
	LaunchAgentStatusDone             = "done"
	LaunchAgentStatusSucceeded        = "succeeded"
	LaunchAgentStatusFailed           = "failed"
	LaunchAgentStatusError            = "error"
	LaunchAgentDefaultBranch          = "main"
	LaunchAgentBranchPrefix           = "cursor/agent-"
	LaunchAgentSkipReviewerRequest    = false
	LaunchAgentInitialPollInterval    = 30 * time.Second
	LaunchAgentMaxPollInterval        = 10 * time.Minute
	LaunchAgentMaxPollAttempts        = 100
	LaunchAgentMaxPollErrors          = 5
	LaunchAgentWebhookSignatureHeader = "X-Webhook-Signature"
)
View Source
const (
	GetDailyUsageDataPayloadType = "cursor.getDailyUsageData.result"
)
View Source
const (
	GetLastMessagePayloadType = "cursor.getLastMessage.result"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentMetadata

type AgentMetadata struct {
	ID      string `json:"id" mapstructure:"id"`
	Name    string `json:"name,omitempty" mapstructure:"name,omitempty"`
	Status  string `json:"status" mapstructure:"status"`
	URL     string `json:"url,omitempty" mapstructure:"url,omitempty"`
	Summary string `json:"summary,omitempty" mapstructure:"summary,omitempty"`
}

type Client

type Client struct {
	LaunchAgentKey string
	AdminKey       string
	BaseURL        string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient core.HTTPContext, ctx core.IntegrationContext) (*Client, error)

func (*Client) CancelAgent

func (c *Client) CancelAgent(agentID string) error

func (*Client) GetAgentConversation

func (c *Client) GetAgentConversation(agentID string) (*ConversationResponse, error)

func (*Client) GetAgentStatus

func (c *Client) GetAgentStatus(agentID string) (*LaunchAgentResponse, error)

func (*Client) GetDailyUsage

func (c *Client) GetDailyUsage(req UsageRequest) (*UsageResponse, error)

func (*Client) LaunchAgent

func (c *Client) LaunchAgent(req launchAgentRequest) (*LaunchAgentResponse, error)

func (*Client) ListModels

func (c *Client) ListModels() ([]string, error)

func (*Client) VerifyAdmin

func (c *Client) VerifyAdmin() error

func (*Client) VerifyLaunchAgent

func (c *Client) VerifyLaunchAgent() error

type Configuration

type Configuration struct {
	LaunchAgentKey string `json:"launchAgentKey"`
	AdminKey       string `json:"adminKey"`
}

type ConversationMessage

type ConversationMessage struct {
	ID   string `json:"id"`
	Type string `json:"type"`
	Text string `json:"text"`
}

type ConversationResponse

type ConversationResponse struct {
	ID       string                `json:"id"`
	Messages []ConversationMessage `json:"messages"`
}

type Cursor

type Cursor struct{}

func (*Cursor) Actions

func (i *Cursor) Actions() []core.Action

func (*Cursor) Cleanup

func (i *Cursor) Cleanup(ctx core.IntegrationCleanupContext) error

func (*Cursor) Components

func (i *Cursor) Components() []core.Component

func (*Cursor) Configuration

func (i *Cursor) Configuration() []configuration.Field

func (*Cursor) Description

func (i *Cursor) Description() string

func (*Cursor) HandleAction

func (i *Cursor) HandleAction(ctx core.IntegrationActionContext) error

func (*Cursor) HandleRequest

func (i *Cursor) HandleRequest(ctx core.HTTPRequestContext)

func (*Cursor) Icon

func (i *Cursor) Icon() string

func (*Cursor) Instructions

func (i *Cursor) Instructions() string

func (*Cursor) Label

func (i *Cursor) Label() string

func (*Cursor) ListResources

func (i *Cursor) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*Cursor) Name

func (i *Cursor) Name() string

func (*Cursor) Sync

func (i *Cursor) Sync(ctx core.SyncContext) error

func (*Cursor) Triggers

func (i *Cursor) Triggers() []core.Trigger

type GetDailyUsageData

type GetDailyUsageData struct{}

func (*GetDailyUsageData) Actions

func (c *GetDailyUsageData) Actions() []core.Action

func (*GetDailyUsageData) Cancel

func (*GetDailyUsageData) Cleanup

func (c *GetDailyUsageData) Cleanup(ctx core.SetupContext) error

func (*GetDailyUsageData) Color

func (c *GetDailyUsageData) Color() string

func (*GetDailyUsageData) Configuration

func (c *GetDailyUsageData) Configuration() []configuration.Field

func (*GetDailyUsageData) Description

func (c *GetDailyUsageData) Description() string

func (*GetDailyUsageData) Documentation

func (c *GetDailyUsageData) Documentation() string

func (*GetDailyUsageData) ExampleOutput

func (c *GetDailyUsageData) ExampleOutput() map[string]any

func (*GetDailyUsageData) Execute

func (c *GetDailyUsageData) Execute(ctx core.ExecutionContext) error

func (*GetDailyUsageData) HandleAction

func (c *GetDailyUsageData) HandleAction(ctx core.ActionContext) error

func (*GetDailyUsageData) HandleWebhook

func (c *GetDailyUsageData) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*GetDailyUsageData) Icon

func (c *GetDailyUsageData) Icon() string

func (*GetDailyUsageData) Label

func (c *GetDailyUsageData) Label() string

func (*GetDailyUsageData) Name

func (c *GetDailyUsageData) Name() string

func (*GetDailyUsageData) OutputChannels

func (c *GetDailyUsageData) OutputChannels(config any) []core.OutputChannel

func (*GetDailyUsageData) ProcessQueueItem

func (c *GetDailyUsageData) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*GetDailyUsageData) Setup

func (c *GetDailyUsageData) Setup(ctx core.SetupContext) error

type GetDailyUsageDataOutput

type GetDailyUsageDataOutput struct {
	Data   []map[string]any `json:"data"`
	Period map[string]any   `json:"period"`
}

type GetDailyUsageDataSpec

type GetDailyUsageDataSpec struct {
	StartDate string `json:"startDate" mapstructure:"startDate"`
	EndDate   string `json:"endDate" mapstructure:"endDate"`
}

type GetLastMessage

type GetLastMessage struct{}

func (*GetLastMessage) Actions

func (c *GetLastMessage) Actions() []core.Action

func (*GetLastMessage) Cancel

func (c *GetLastMessage) Cancel(ctx core.ExecutionContext) error

func (*GetLastMessage) Cleanup

func (c *GetLastMessage) Cleanup(ctx core.SetupContext) error

func (*GetLastMessage) Color

func (c *GetLastMessage) Color() string

func (*GetLastMessage) Configuration

func (c *GetLastMessage) Configuration() []configuration.Field

func (*GetLastMessage) Description

func (c *GetLastMessage) Description() string

func (*GetLastMessage) Documentation

func (c *GetLastMessage) Documentation() string

func (*GetLastMessage) ExampleOutput

func (c *GetLastMessage) ExampleOutput() map[string]any

func (*GetLastMessage) Execute

func (c *GetLastMessage) Execute(ctx core.ExecutionContext) error

func (*GetLastMessage) HandleAction

func (c *GetLastMessage) HandleAction(ctx core.ActionContext) error

func (*GetLastMessage) HandleWebhook

func (c *GetLastMessage) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*GetLastMessage) Icon

func (c *GetLastMessage) Icon() string

func (*GetLastMessage) Label

func (c *GetLastMessage) Label() string

func (*GetLastMessage) Name

func (c *GetLastMessage) Name() string

func (*GetLastMessage) OutputChannels

func (c *GetLastMessage) OutputChannels(config any) []core.OutputChannel

func (*GetLastMessage) ProcessQueueItem

func (c *GetLastMessage) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*GetLastMessage) Setup

func (c *GetLastMessage) Setup(ctx core.SetupContext) error

type GetLastMessageOutput

type GetLastMessageOutput struct {
	AgentID string               `json:"agentId"`
	Message *ConversationMessage `json:"message"`
}

type GetLastMessageSpec

type GetLastMessageSpec struct {
	AgentID string `json:"agentId" mapstructure:"agentId"`
}

type LaunchAgent

type LaunchAgent struct{}

func (*LaunchAgent) Actions

func (c *LaunchAgent) Actions() []core.Action

func (*LaunchAgent) Cancel

func (c *LaunchAgent) Cancel(ctx core.ExecutionContext) error

func (*LaunchAgent) Cleanup

func (c *LaunchAgent) Cleanup(ctx core.SetupContext) error

func (*LaunchAgent) Color

func (c *LaunchAgent) Color() string

func (*LaunchAgent) Configuration

func (c *LaunchAgent) Configuration() []configuration.Field

func (*LaunchAgent) Description

func (c *LaunchAgent) Description() string

func (*LaunchAgent) Documentation

func (c *LaunchAgent) Documentation() string

func (*LaunchAgent) ExampleOutput

func (c *LaunchAgent) ExampleOutput() map[string]any

func (*LaunchAgent) Execute

func (c *LaunchAgent) Execute(ctx core.ExecutionContext) error

func (*LaunchAgent) HandleAction

func (c *LaunchAgent) HandleAction(ctx core.ActionContext) error

func (*LaunchAgent) HandleWebhook

func (c *LaunchAgent) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

HandleWebhook processes incoming updates from Cursor

func (*LaunchAgent) Icon

func (c *LaunchAgent) Icon() string

func (*LaunchAgent) Label

func (c *LaunchAgent) Label() string

func (*LaunchAgent) Name

func (c *LaunchAgent) Name() string

func (*LaunchAgent) OutputChannels

func (c *LaunchAgent) OutputChannels(config any) []core.OutputChannel

func (*LaunchAgent) ProcessQueueItem

func (c *LaunchAgent) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*LaunchAgent) Setup

func (c *LaunchAgent) Setup(ctx core.SetupContext) error

type LaunchAgentExecutionMetadata

type LaunchAgentExecutionMetadata struct {
	Agent  *AgentMetadata  `json:"agent,omitempty" mapstructure:"agent,omitempty"`
	Target *TargetMetadata `json:"target,omitempty" mapstructure:"target,omitempty"`
	Source *SourceMetadata `json:"source,omitempty" mapstructure:"source,omitempty"`
}

type LaunchAgentOutputPayload

type LaunchAgentOutputPayload struct {
	Status     string `json:"status"`
	AgentID    string `json:"agentId"`
	PrURL      string `json:"prUrl,omitempty"`
	Summary    string `json:"summary,omitempty"`
	BranchName string `json:"branchName,omitempty"`
}

type LaunchAgentResponse

type LaunchAgentResponse struct {
	ID        string                     `json:"id"`
	Name      string                     `json:"name,omitempty"`
	Status    string                     `json:"status"`
	Source    *launchAgentSourceResponse `json:"source,omitempty"`
	Target    *launchAgentTargetResponse `json:"target,omitempty"`
	Summary   string                     `json:"summary,omitempty"`
	CreatedAt string                     `json:"createdAt,omitempty"`
}

type LaunchAgentSpec

type LaunchAgentSpec struct {
	Prompt       string `json:"prompt" mapstructure:"prompt"`
	Model        string `json:"model" mapstructure:"model"`
	SourceMode   string `json:"sourceMode" mapstructure:"sourceMode"`
	Repository   string `json:"repository" mapstructure:"repository"`
	Branch       string `json:"branch" mapstructure:"branch"`
	PrURL        string `json:"prUrl" mapstructure:"prUrl"`
	AutoCreatePr bool   `json:"autoCreatePr" mapstructure:"autoCreatePr"`
	UseCursorBot bool   `json:"useCursorBot" mapstructure:"useCursorBot"`
}

type ModelsResponse

type ModelsResponse struct {
	Models []string `json:"models"`
}

type SourceMetadata

type SourceMetadata struct {
	Repository string `json:"repository,omitempty" mapstructure:"repository,omitempty"`
	Ref        string `json:"ref,omitempty" mapstructure:"ref,omitempty"`
}

type TargetMetadata

type TargetMetadata struct {
	BranchName string `json:"branchName,omitempty" mapstructure:"branchName,omitempty"`
	PrURL      string `json:"prUrl,omitempty" mapstructure:"prUrl,omitempty"`
}

type UsageRequest

type UsageRequest struct {
	StartDate int64 `json:"startDate"`
	EndDate   int64 `json:"endDate"`
}

type UsageResponse

type UsageResponse map[string]any

Jump to

Keyboard shortcuts

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