Documentation
¶
Overview ¶
Package executor provides CLI execution for Copilot and custom review tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandRunner ¶
type CommandRunner interface {
Run(ctx context.Context, name string, args ...string) (output io.Reader, wait func() error, err error)
}
CommandRunner abstracts command execution for testing. Returns an io.Reader for streaming output and a wait function for completion.
type CopilotExecutor ¶
type CopilotExecutor struct {
Command string // command to execute, defaults to "copilot"
Args string // additional arguments (space-separated)
CodingModel string // model for coding/task phases
ReviewModel string // model for external review phases
ErrorPatterns []string // patterns to detect in output (e.g., rate limit messages)
LimitPatterns []string // patterns to detect rate limits (checked before error patterns)
OutputHandler func(text string) // called for each text chunk, can be nil
// contains filtered or unexported fields
}
CopilotExecutor runs GitHub Copilot CLI commands with JSONL output parsing.
type CustomExecutor ¶
type CustomExecutor struct {
Script string // path to the custom review script
OutputHandler func(text string) // called for each output line, can be nil
ErrorPatterns []string // patterns to detect in output (e.g., rate limit messages)
LimitPatterns []string // patterns to detect rate limits (checked before error patterns)
// contains filtered or unexported fields
}
CustomExecutor runs custom review scripts and streams output.
func (*CustomExecutor) Run ¶
func (e *CustomExecutor) Run(ctx context.Context, promptContent string) Result
Run executes the custom review script with the prompt content written to a temp file. The script receives the path to the prompt file as its single argument. Output is streamed line-by-line to OutputHandler.
func (*CustomExecutor) SetRunner ¶
func (e *CustomExecutor) SetRunner(r CustomRunner)
SetRunner sets the custom runner for testing purposes.
type CustomRunner ¶
type CustomRunner interface {
Run(ctx context.Context, script, promptFile string) (stdout io.Reader, wait func() error, err error)
}
CustomRunner abstracts command execution for custom review scripts. Returns stdout reader and a wait function for completion.
type LimitPatternError ¶
type LimitPatternError struct {
Pattern string // the pattern that matched
HelpCmd string // command to run for more information
}
LimitPatternError is returned when a configured rate limit pattern is detected in output. when wait-on-limit is configured, the caller retries instead of exiting.
func (*LimitPatternError) Error ¶
func (e *LimitPatternError) Error() string
type PatternMatchError ¶
type PatternMatchError struct {
Pattern string // the pattern that matched
HelpCmd string // command to run for more information
}
PatternMatchError is returned when a configured error pattern is detected in output.
func (*PatternMatchError) Error ¶
func (e *PatternMatchError) Error() string