engine

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignalComplete      = ".brr-complete"
	SignalNeedsApproval = ".brr-needs-approval"
)

Signal file paths used by the brr engine.

Variables

View Source
var ErrInterrupted = errors.New("interrupted")

ErrInterrupted is returned when the engine is stopped by a user signal (Ctrl+C).

Functions

This section is empty.

Types

type Options

type Options struct {
	Prompt  string   // resolved prompt text
	Max     int      // max iterations (0 = unlimited)
	Command []string // command + args to run (prompt piped to stdin)
}

Options configures a loop run.

type Result added in v0.2.0

type Result struct {
	Reason          StopReason
	ApprovalContent string // populated only for ReasonApproval
}

Result carries the structured stop reason from a completed engine run.

func Run

func Run(opts Options) (*Result, error)

Run executes the loop until completion, max iterations, or interrupt. The returned Result is always non-nil when error is nil, and may also be non-nil on error paths to communicate the stop reason.

type StopReason added in v0.2.0

type StopReason int

StopReason indicates why the engine stopped.

const (
	ReasonComplete      StopReason = iota // .brr-complete signal file
	ReasonApproval                        // .brr-needs-approval signal file
	ReasonMaxIterations                   // max iteration count reached
	ReasonFailStreak                      // too many consecutive failures
	ReasonInterrupted                     // user signal (Ctrl+C / SIGTERM)
)

Jump to

Keyboard shortcuts

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