Documentation
¶
Index ¶
- type AgentExecution
- type AgentExecutionStartedFunc
- type AgentExecutionStartedInput
- type AgentExecutor
- type AgentResult
- type AgentRunInput
- type CommitInput
- type CommitResult
- type CompareBranchesInput
- type CompareBranchesResult
- type CreatePullRequestInput
- type CreatePullRequestResult
- type CreateWorktreeInput
- type CreateWorktreeResult
- type DiscoveryInput
- type DiscoveryPolicy
- type DiscoveryResult
- type GitGateway
- type GitHubGateway
- type HITLAskNotification
- type HITLGitHubSettings
- type HITLNotifyFunc
- type InspectHeadInput
- type InspectHeadResult
- type IssueAssigneesInput
- type IssueCommentInput
- type IssueCommentResult
- type IssueDetail
- type IssueSummary
- type ListOpenIssuesInput
- type ListOpenPullRequestsInput
- type NetworkStatusGateway
- type Options
- type PrepareWorktreeInput
- type PrepareWorktreeResult
- type ProcessResult
- type PullRequestDetail
- type PullRequestLabelsInput
- type PullRequestReviewersInput
- type PullRequestSummary
- type PushInput
- type QueueFailureKind
- type RestoreWorktreeInput
- type RestoreWorktreeResult
- type RunCompletedFunc
- type RunCompletedInput
- type Runner
- func (r *Runner) DiscoverIssues(ctx context.Context, input DiscoveryInput) (DiscoveryResult, error)
- func (r *Runner) ProcessClaimedItem(ctx context.Context, queueItem storage.QueueItemRecord) (ProcessResult, error)
- func (r *Runner) ProcessClaimedQueueItem(ctx context.Context, queueItem storage.QueueItemRecord) (*ProcessResult, error)
- func (r *Runner) ProcessNext(ctx context.Context, claimedBy string) (*ProcessResult, error)
- type UpdateIssueCommentInput
- type UpdatePullRequestBodyInput
- type UpdatePullRequestTitleInput
- type ValidationInput
- type ValidationResult
- type ValidationRunner
- type ViewIssueInput
- type ViewPullRequestInput
- type WorkerStep
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentExecution ¶
type AgentExecutionStartedFunc ¶
type AgentExecutionStartedFunc func(context.Context, AgentExecutionStartedInput) error
type AgentExecutor ¶
type AgentExecutor interface {
Start(context.Context, AgentRunInput) (AgentExecution, error)
}
type AgentResult ¶
type AgentResult struct {
Status string
Summary string
Stdout string
Stderr string
ParseStatus string
ChangedFiles []string
Commits []string
Lifecycle *lifecycle.State
TimeoutType string
ConfiguredIdleTimeoutSeconds int64
ConfiguredMaxRuntimeSeconds int64
ElapsedRuntimeSeconds int64
LastProgressAt string
}
type AgentRunInput ¶
type AgentRunInput struct {
ExecutionID string
ProjectID string
LoopID string
RunID string
Prompt string
NativeResumePrompt string
NativeSessionID string
WorkingDirectory string
Timeout time.Duration
HeartbeatTimeout time.Duration
Metadata map[string]any
IdempotencyKey string
// UseSnapshot + SnapshotVendor/Model override the executor config for this
// start when the run has a durable agent snapshot (execution authority).
UseSnapshot bool
SnapshotVendor string
SnapshotModel *string
}
type CommitInput ¶
type CommitResult ¶
type CommitResult struct{ CommitSHA string }
type CompareBranchesInput ¶ added in v0.7.4
type CompareBranchesResult ¶ added in v0.7.4
type CreatePullRequestInput ¶
type CreatePullRequestResult ¶
type CreateWorktreeInput ¶
type CreateWorktreeResult ¶
type DiscoveryInput ¶
type DiscoveryInput struct {
ProjectID string
Repo string
Limit int
Snapshot *githubinfra.DiscoverySnapshot
}
type DiscoveryPolicy ¶
type DiscoveryPolicy struct {
AutoDiscovery bool
Labels []string
LabelMode config.LabelMode
RequireAssigneeCurrentUser bool
RoutedClaimPolicy networkpolicy.ProjectPolicy
// IsPlane marks a Plane task-source project; PlaneAssigneeID, when set,
// scopes discovery to work-items assigned to that Plane member UUID.
IsPlane bool
PlaneAssigneeID string
}
type DiscoveryResult ¶
type DiscoveryResult struct {
CreatedLoopIDs []string
QueueItems []storage.QueueItemRecord
Skipped int
}
type GitGateway ¶
type GitGateway interface {
CreateWorktree(context.Context, CreateWorktreeInput) (CreateWorktreeResult, error)
RestoreWorktree(context.Context, RestoreWorktreeInput) (*RestoreWorktreeResult, error)
PrepareWorktree(context.Context, PrepareWorktreeInput) (PrepareWorktreeResult, error)
InspectHead(context.Context, InspectHeadInput) (InspectHeadResult, error)
Commit(context.Context, CommitInput) (CommitResult, error)
Push(context.Context, PushInput) error
}
type GitHubGateway ¶
type GitHubGateway interface {
ListOpenPullRequests(context.Context, ListOpenPullRequestsInput) ([]PullRequestSummary, error)
ListOpenIssues(context.Context, ListOpenIssuesInput) ([]IssueSummary, error)
ViewPullRequest(context.Context, ViewPullRequestInput) (PullRequestDetail, error)
ViewIssue(context.Context, ViewIssueInput) (IssueDetail, error)
GetCurrentUserLogin(context.Context, string) (string, error)
AddIssueAssignees(context.Context, IssueAssigneesInput) error
CreateIssueComment(context.Context, IssueCommentInput) (IssueCommentResult, error)
UpdateIssueComment(context.Context, UpdateIssueCommentInput) error
CreatePullRequest(context.Context, CreatePullRequestInput) (CreatePullRequestResult, error)
CompareBranches(context.Context, CompareBranchesInput) (CompareBranchesResult, error)
UpdatePullRequestBody(context.Context, UpdatePullRequestBodyInput) error
UpdatePullRequestTitle(context.Context, UpdatePullRequestTitleInput) error
AddPullRequestLabels(context.Context, PullRequestLabelsInput) error
RemovePullRequestLabels(context.Context, PullRequestLabelsInput) error
AddPullRequestReviewers(context.Context, PullRequestReviewersInput) error
}
type HITLAskNotification ¶ added in v0.10.0
type HITLAskNotification struct {
ProjectID string
LoopID string
LoopSeq int64
RunID string
Repo string
Title string
Question string
Options []string
// Source + trigger, so the human knows what they are deciding and whose task
// it is. SourceType/Ref/URL identify the origin (GitHub Issue #132 → link);
// TriggerLogin is who created it.
SourceType string
SourceRef string
SourceURL string
TriggerLogin string
// The agent's decision brief.
Recommendation string
RecommendedOption string
Consequences map[string]string
Confidence string
}
HITLAskNotification is the payload the worker hands to HITLNotify when an agent pauses mid-run to ask a human.
type HITLGitHubSettings ¶ added in v0.10.0
HITLGitHubSettings tunes the GitHub PR-comment ask transport.
type HITLNotifyFunc ¶ added in v0.10.0
type HITLNotifyFunc func(context.Context, HITLAskNotification) error
HITLNotifyFunc delivers a mid-run ask to the human channel (e.g. a Feishu app-bot card). Best-effort; a returned error is logged, not fatal.
type InspectHeadInput ¶
type InspectHeadResult ¶
type IssueAssigneesInput ¶
type IssueCommentInput ¶
type IssueCommentResult ¶
type IssueDetail ¶
type IssueDetail struct {
Number int64
Title string
Body string
URL string
State string
IsPullRequest bool
AssigneeUsers []networkpolicy.GitHubUser
Labels []string
}
type IssueSummary ¶
type IssueSummary struct {
Number int64
Title string
Body string
URL string
Author string
Assignees []string
AssigneeUsers []networkpolicy.GitHubUser
Labels []string
}
type ListOpenIssuesInput ¶
type NetworkStatusGateway ¶ added in v0.9.0
type NetworkStatusGateway interface {
Status(context.Context) (protocol.NodeStatusResponse, error)
}
type Options ¶
type Options struct {
DB *sql.DB
Repos *storage.Repositories
GitHub GitHubGateway
GitHubCLIAvailable *bool
GitHubCLIAutoPROpeningAvailable func(context.Context, string, string) bool
Git GitGateway
AgentExecutor AgentExecutor
Logger bootstrap.Logger
Now func() time.Time
AgentTimeout time.Duration
AgentIdleTimeout time.Duration
ClaimTTL time.Duration
ValidationCommands []string
ValidationRunner ValidationRunner
// ContainmentTracker registers validation shell handles with the Execution
// Supervisor for shutdown drain / retain-storage (#577). Nil in tests or
// when the runner is not daemon-owned.
ContainmentTracker processcontainment.LiveTracker
AllowAutoCommit bool
AllowAutoPush bool
OpenPRStrategy config.OpenPRStrategy
Disclosure *config.DisclosureConfig
AgentRuntime string
AgentProfileID string
CustomInstructions *config.Config
AgentModel *string
RetryBaseDelay time.Duration
RetryMaxAttempts int64
OnAgentExecutionStarted AgentExecutionStartedFunc
OnRunCompleted RunCompletedFunc
DiscoveryPolicy DiscoveryPolicy
OnQueueItemEnqueued func()
Network NetworkStatusGateway
// HITLEnabled gates the mid-run human-in-the-loop feature. When false (the
// default) none of the HITL code paths run and the worker behaves exactly as
// before. HITLNotify, when set, sends the ask-card to the human channel.
HITLEnabled bool
HITLNotify HITLNotifyFunc
// HITLAnswerTransport selects how a mid-run ask is delivered: "github" (post it
// as a PR comment; the default) or "feishu"/"respond" (via HITLNotify / the API).
HITLAnswerTransport string
HITLGitHub HITLGitHubSettings
}
type PrepareWorktreeInput ¶
type PrepareWorktreeResult ¶
type ProcessResult ¶
type PullRequestDetail ¶
type PullRequestLabelsInput ¶
type PullRequestSummary ¶
type QueueFailureKind ¶
type QueueFailureKind string
const ( FailureRetryableTransient QueueFailureKind = "retryable_transient" FailureRetryableAfterResume QueueFailureKind = "retryable_after_resume" FailureNonRetryable QueueFailureKind = "non_retryable" FailureManualIntervention QueueFailureKind = "manual_intervention" )
type RestoreWorktreeInput ¶
type RestoreWorktreeResult ¶
type RunCompletedFunc ¶
type RunCompletedFunc func(context.Context, RunCompletedInput) error
type RunCompletedInput ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) DiscoverIssues ¶
func (r *Runner) DiscoverIssues(ctx context.Context, input DiscoveryInput) (DiscoveryResult, error)
func (*Runner) ProcessClaimedItem ¶
func (r *Runner) ProcessClaimedItem(ctx context.Context, queueItem storage.QueueItemRecord) (ProcessResult, error)
func (*Runner) ProcessClaimedQueueItem ¶
func (r *Runner) ProcessClaimedQueueItem(ctx context.Context, queueItem storage.QueueItemRecord) (*ProcessResult, error)
func (*Runner) ProcessNext ¶
type UpdateIssueCommentInput ¶
type UpdatePullRequestBodyInput ¶ added in v0.7.1
type ValidationInput ¶
type ValidationResult ¶
type ValidationRunner ¶
type ValidationRunner func(context.Context, ValidationInput) (ValidationResult, error)
type ViewIssueInput ¶
type ViewPullRequestInput ¶
type WorkerStep ¶
type WorkerStep string
Click to show internal directories.
Click to hide internal directories.