Documentation
¶
Index ¶
- Constants
- Variables
- type AddCommentInput
- type AddDependencyInput
- type AddExternalLinkInput
- type AppliedUsage
- type ArchivedListInput
- type ArchivedListRawInput
- type ArchivedListResult
- type Comment
- type CommentRevision
- type CreateInput
- type CreateRepoScopeInput
- type DeferredLifecycleHook
- type DeleteCommentResult
- type DeleteDependencyResult
- type DeleteExternalLinkResult
- type Dependency
- type DependencyType
- type ExternalLink
- type ExternalLinkRelation
- type ExternalLinkType
- type HookWorkspace
- type LifecycleHookRuntimeData
- type ListInput
- type Optional
- type PersistedUsageResult
- type PickupDiagnosis
- type PickupDiagnosisAgent
- type PickupDiagnosisBlockedTicket
- type PickupDiagnosisCapacity
- type PickupDiagnosisCapacityBucket
- type PickupDiagnosisProvider
- type PickupDiagnosisReason
- type PickupDiagnosisReasonCode
- type PickupDiagnosisReasonSeverity
- type PickupDiagnosisRetry
- type PickupDiagnosisState
- type PickupDiagnosisStatusCapacity
- type PickupDiagnosisWorkflow
- type Priority
- type RecordActivityEventInput
- type RecordUsageInput
- type RecordUsageResult
- type ResumeRetryInput
- type Ticket
- type TicketReference
- type Type
- type UpdateCommentInput
- type UpdateInput
- type UpdateResult
- type UsageMetricsAgent
Constants ¶
View Source
const ( DefaultArchivedTicketPage = 1 DefaultArchivedTicketPerPage = 20 MaxArchivedTicketPerPage = 100 )
Variables ¶
View Source
var ( ErrProjectNotFound = errors.New("project not found") ErrProjectRepoNotFound = errors.New("project repo not found") ErrRepoScopeRequired = errors.New("explicit repo scope is required when a project has multiple repos") ErrTicketNotFound = errors.New("ticket not found") ErrTicketConflict = errors.New("ticket identifier already exists in project") ErrStatusNotFound = errors.New("ticket status not found") ErrWorkflowNotFound = errors.New("workflow not found") ErrStatusNotAllowed = errors.New("ticket status is not allowed by the workflow finish set") ErrParentTicketNotFound = errors.New("parent ticket not found") ErrTargetMachineNotFound = errors.New("target machine not found in project organization") ErrDependencyNotFound = errors.New("ticket dependency not found") ErrDependencyConflict = errors.New("ticket dependency already exists") ErrCommentNotFound = errors.New("ticket comment not found") ErrExternalLinkNotFound = errors.New("ticket external link not found") ErrExternalLinkConflict = errors.New("ticket external link already exists") ErrInvalidDependency = errors.New("invalid ticket dependency") ErrRetryResumeConflict = errors.New("ticket retry is not paused for repeated stalls") )
Functions ¶
This section is empty.
Types ¶
type AddCommentInput ¶
type AddDependencyInput ¶
type AddDependencyInput struct {
TicketID uuid.UUID
TargetTicketID uuid.UUID
Type DependencyType
}
type AddExternalLinkInput ¶
type AddExternalLinkInput struct {
TicketID uuid.UUID
LinkType ExternalLinkType
URL string
ExternalID string
Title string
Status string
Relation ExternalLinkRelation
}
type AppliedUsage ¶
type ArchivedListInput ¶
func ParseArchivedListInput ¶
func ParseArchivedListInput(projectID uuid.UUID, raw ArchivedListRawInput) (ArchivedListInput, error)
type ArchivedListRawInput ¶
type ArchivedListResult ¶
type Comment ¶
type Comment struct {
ID uuid.UUID `json:"id"`
TicketID uuid.UUID `json:"ticket_id"`
BodyMarkdown string `json:"body_markdown"`
CreatedBy string `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
EditedAt *time.Time `json:"edited_at,omitempty"`
EditCount int `json:"edit_count"`
LastEditedBy *string `json:"last_edited_by,omitempty"`
IsDeleted bool `json:"is_deleted"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
DeletedBy *string `json:"deleted_by,omitempty"`
}
type CommentRevision ¶
type CommentRevision struct {
ID uuid.UUID `json:"id"`
CommentID uuid.UUID `json:"comment_id"`
RevisionNumber int `json:"revision_number"`
BodyMarkdown string `json:"body_markdown"`
EditedBy string `json:"edited_by"`
EditedAt time.Time `json:"edited_at"`
EditReason *string `json:"edit_reason,omitempty"`
}
type CreateInput ¶
type CreateInput struct {
ProjectID uuid.UUID
Title string
Description string
StatusID *uuid.UUID
Archived bool
Priority *Priority
Type Type
WorkflowID *uuid.UUID
TargetMachineID *uuid.UUID
CreatedBy string
ParentTicketID *uuid.UUID
ExternalRef string
BudgetUSD float64
RepoScopes []CreateRepoScopeInput
}
type CreateRepoScopeInput ¶
type DeferredLifecycleHook ¶
type DeleteCommentResult ¶
type DeleteDependencyResult ¶
type Dependency ¶
type Dependency struct {
ID uuid.UUID `json:"id"`
Type DependencyType `json:"type"`
Target TicketReference `json:"target"`
}
type DependencyType ¶
type DependencyType string
const ( DefaultDependencyType DependencyType = DependencyTypeBlocks DependencyTypeBlocks DependencyType = "blocks" DependencyTypeSubIssue DependencyType = "sub-issue" )
func ParseDependencyType ¶
func ParseDependencyType(raw string) (DependencyType, error)
func (DependencyType) String ¶
func (t DependencyType) String() string
type ExternalLink ¶
type ExternalLink struct {
ID uuid.UUID `json:"id"`
LinkType ExternalLinkType `json:"link_type"`
URL string `json:"url"`
ExternalID string `json:"external_id"`
Title string `json:"title,omitempty"`
Status string `json:"status,omitempty"`
Relation ExternalLinkRelation `json:"relation"`
CreatedAt time.Time `json:"created_at"`
}
type ExternalLinkRelation ¶
type ExternalLinkRelation string
const ( DefaultExternalLinkRelation ExternalLinkRelation = ExternalLinkRelationRelated ExternalLinkRelationResolves ExternalLinkRelation = "resolves" ExternalLinkRelationRelated ExternalLinkRelation = "related" ExternalLinkRelationCausedBy ExternalLinkRelation = "caused_by" )
func ParseExternalLinkRelation ¶
func ParseExternalLinkRelation(raw string) (ExternalLinkRelation, error)
func (ExternalLinkRelation) String ¶
func (r ExternalLinkRelation) String() string
type ExternalLinkType ¶
type ExternalLinkType string
const ( ExternalLinkTypeGithubIssue ExternalLinkType = "github_issue" ExternalLinkTypeGitlabIssue ExternalLinkType = "gitlab_issue" ExternalLinkTypeJiraTicket ExternalLinkType = "jira_ticket" ExternalLinkTypeGithubPR ExternalLinkType = "github_pr" ExternalLinkTypeGitlabMR ExternalLinkType = "gitlab_mr" ExternalLinkTypeCustom ExternalLinkType = "custom" )
func ParseExternalLinkType ¶
func ParseExternalLinkType(raw string) (ExternalLinkType, error)
func (ExternalLinkType) String ¶
func (t ExternalLinkType) String() string
type HookWorkspace ¶
type LifecycleHookRuntimeData ¶
type LifecycleHookRuntimeData struct {
TicketID uuid.UUID
ProjectID uuid.UUID
AgentID uuid.UUID
TicketIdentifier string
AgentName string
WorkflowType string
WorkflowFamily string
PlatformAccessAllowed []string
Attempt int
WorkspaceRoot string
Hooks map[string]any
Machine catalogdomain.Machine
Workspaces []HookWorkspace
}
type PersistedUsageResult ¶
type PersistedUsageResult struct {
Result RecordUsageResult
MetricsAgent UsageMetricsAgent
ProjectID uuid.UUID
}
type PickupDiagnosis ¶
type PickupDiagnosis struct {
State PickupDiagnosisState `json:"state"`
PrimaryReasonCode PickupDiagnosisReasonCode `json:"primary_reason_code"`
PrimaryReasonMessage string `json:"primary_reason_message"`
NextActionHint string `json:"next_action_hint,omitempty"`
Reasons []PickupDiagnosisReason `json:"reasons"`
Workflow *PickupDiagnosisWorkflow `json:"workflow,omitempty"`
Agent *PickupDiagnosisAgent `json:"agent,omitempty"`
Provider *PickupDiagnosisProvider `json:"provider,omitempty"`
Retry PickupDiagnosisRetry `json:"retry"`
Capacity PickupDiagnosisCapacity `json:"capacity"`
BlockedBy []PickupDiagnosisBlockedTicket `json:"blocked_by"`
}
type PickupDiagnosisAgent ¶
type PickupDiagnosisAgent struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
RuntimeControlState catalogdomain.AgentRuntimeControlState `json:"runtime_control_state"`
}
type PickupDiagnosisCapacity ¶
type PickupDiagnosisCapacity struct {
Workflow PickupDiagnosisCapacityBucket `json:"workflow"`
Project PickupDiagnosisCapacityBucket `json:"project"`
Provider PickupDiagnosisCapacityBucket `json:"provider"`
Status PickupDiagnosisStatusCapacity `json:"status"`
}
type PickupDiagnosisProvider ¶
type PickupDiagnosisProvider struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
MachineID uuid.UUID `json:"machine_id"`
MachineName string `json:"machine_name"`
MachineStatus catalogdomain.MachineStatus `json:"machine_status"`
AvailabilityState catalogdomain.AgentProviderAvailabilityState `json:"availability_state"`
AvailabilityReason *string `json:"availability_reason,omitempty"`
}
type PickupDiagnosisReason ¶
type PickupDiagnosisReason struct {
Code PickupDiagnosisReasonCode `json:"code"`
Message string `json:"message"`
Severity PickupDiagnosisReasonSeverity `json:"severity"`
}
type PickupDiagnosisReasonCode ¶
type PickupDiagnosisReasonCode string
const ( PickupDiagnosisReasonReadyForPickup PickupDiagnosisReasonCode = "ready_for_pickup" PickupDiagnosisReasonArchived PickupDiagnosisReasonCode = "archived" PickupDiagnosisReasonCompleted PickupDiagnosisReasonCode = "completed" PickupDiagnosisReasonRunningCurrentRun PickupDiagnosisReasonCode = "running_current_run" PickupDiagnosisReasonRetryBackoff PickupDiagnosisReasonCode = "retry_backoff" PickupDiagnosisReasonRetryPausedRepeatedStalls PickupDiagnosisReasonCode = "retry_paused_repeated_stalls" PickupDiagnosisReasonRetryPausedBudget PickupDiagnosisReasonCode = "retry_paused_budget" PickupDiagnosisReasonRetryPausedUser PickupDiagnosisReasonCode = "retry_paused_user" PickupDiagnosisReasonBlockedDependency PickupDiagnosisReasonCode = "blocked_dependency" PickupDiagnosisReasonNoMatchingActiveWorkflow PickupDiagnosisReasonCode = "no_matching_active_workflow" PickupDiagnosisReasonWorkflowInactive PickupDiagnosisReasonCode = "workflow_inactive" PickupDiagnosisReasonWorkflowMissingAgent PickupDiagnosisReasonCode = "workflow_missing_agent" PickupDiagnosisReasonAgentMissing PickupDiagnosisReasonCode = "agent_missing" PickupDiagnosisReasonAgentPaused PickupDiagnosisReasonCode = "agent_paused" PickupDiagnosisReasonAgentPauseRequested PickupDiagnosisReasonCode = "agent_pause_requested" PickupDiagnosisReasonProviderMissing PickupDiagnosisReasonCode = "provider_missing" PickupDiagnosisReasonMachineMissing PickupDiagnosisReasonCode = "machine_missing" PickupDiagnosisReasonMachineOffline PickupDiagnosisReasonCode = "machine_offline" PickupDiagnosisReasonProviderUnknown PickupDiagnosisReasonCode = "provider_unknown" PickupDiagnosisReasonProviderStale PickupDiagnosisReasonCode = "provider_stale" PickupDiagnosisReasonWorkflowConcurrencyFull PickupDiagnosisReasonCode = "workflow_concurrency_full" PickupDiagnosisReasonProjectConcurrencyFull PickupDiagnosisReasonCode = "project_concurrency_full" PickupDiagnosisReasonProviderConcurrencyFull PickupDiagnosisReasonCode = "provider_concurrency_full" PickupDiagnosisReasonStatusCapacityFull PickupDiagnosisReasonCode = "status_capacity_full" )
type PickupDiagnosisReasonSeverity ¶
type PickupDiagnosisReasonSeverity string
const ( PickupDiagnosisReasonSeverityInfo PickupDiagnosisReasonSeverity = "info" PickupDiagnosisReasonSeverityWarning PickupDiagnosisReasonSeverity = "warning" PickupDiagnosisReasonSeverityError PickupDiagnosisReasonSeverity = "error" )
type PickupDiagnosisRetry ¶
type PickupDiagnosisState ¶
type PickupDiagnosisState string
const ( PickupDiagnosisStateRunnable PickupDiagnosisState = "runnable" PickupDiagnosisStateWaiting PickupDiagnosisState = "waiting" PickupDiagnosisStateBlocked PickupDiagnosisState = "blocked" PickupDiagnosisStateRunning PickupDiagnosisState = "running" PickupDiagnosisStateCompleted PickupDiagnosisState = "completed" )
type PickupDiagnosisWorkflow ¶
type RecordUsageInput ¶
type RecordUsageResult ¶
type RecordUsageResult struct {
Ticket Ticket `json:"ticket"`
Applied AppliedUsage `json:"applied"`
BudgetExceeded bool `json:"budget_exceeded"`
}
type ResumeRetryInput ¶
type Ticket ¶
type Ticket struct {
ID uuid.UUID `json:"id"`
ProjectID uuid.UUID `json:"project_id"`
Identifier string `json:"identifier"`
Title string `json:"title"`
Description string `json:"description"`
StatusID uuid.UUID `json:"status_id"`
StatusName string `json:"status_name"`
Archived bool `json:"archived"`
Priority Priority `json:"priority"`
Type Type `json:"type"`
WorkflowID *uuid.UUID `json:"workflow_id,omitempty"`
CurrentRunID *uuid.UUID `json:"current_run_id,omitempty"`
TargetMachineID *uuid.UUID `json:"target_machine_id,omitempty"`
CreatedBy string `json:"created_by"`
Parent *TicketReference `json:"parent,omitempty"`
Children []TicketReference `json:"children"`
Dependencies []Dependency `json:"dependencies"`
IncomingDependencies []Dependency `json:"incoming_dependencies"`
ExternalLinks []ExternalLink `json:"external_links"`
ExternalRef string `json:"external_ref"`
BudgetUSD float64 `json:"budget_usd"`
CostTokensInput int64 `json:"cost_tokens_input"`
CostTokensOutput int64 `json:"cost_tokens_output"`
CostAmount float64 `json:"cost_amount"`
AttemptCount int `json:"attempt_count"`
ConsecutiveErrors int `json:"consecutive_errors"`
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
NextRetryAt *time.Time `json:"next_retry_at,omitempty"`
RetryPaused bool `json:"retry_paused"`
PauseReason string `json:"pause_reason,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type TicketReference ¶
type UpdateCommentInput ¶
type UpdateInput ¶
type UpdateInput struct {
TicketID uuid.UUID
Title Optional[string]
Description Optional[string]
StatusID Optional[uuid.UUID]
Archived Optional[bool]
Priority Optional[*Priority]
Type Optional[Type]
WorkflowID Optional[*uuid.UUID]
TargetMachineID Optional[*uuid.UUID]
CreatedBy Optional[string]
ParentTicketID Optional[*uuid.UUID]
ExternalRef Optional[string]
BudgetUSD Optional[float64]
RestrictStatusToWorkflowFinishSet bool
}
type UpdateResult ¶
type UpdateResult struct {
Ticket Ticket
DeferredHook *DeferredLifecycleHook
}
type UsageMetricsAgent ¶
Click to show internal directories.
Click to hide internal directories.