Documentation
¶
Index ¶
- func AcquireSlot(ctx context.Context, a Agent) error
- func Register(a Agent)
- func RegisterGate(name string, defaultMax int)
- func ReleaseSlot(a Agent)
- type Agent
- type Claude
- func (c *Claude) Binary() string
- func (c *Claude) Bootstrap() error
- func (c *Claude) EntireAgent() string
- func (c *Claude) IsTransientError(out Output, _ error) bool
- func (c *Claude) Name() string
- func (c *Claude) PromptPattern() string
- func (c *Claude) RunPrompt(ctx context.Context, dir string, prompt string, opts ...Option) (Output, error)
- func (c *Claude) StartSession(ctx context.Context, dir string) (Session, error)
- func (c *Claude) TimeoutMultiplier() float64
- type Droid
- func (d *Droid) Binary() string
- func (d *Droid) Bootstrap() error
- func (d *Droid) EntireAgent() string
- func (d *Droid) IsTransientError(out Output, err error) bool
- func (d *Droid) Name() string
- func (d *Droid) PromptPattern() string
- func (d *Droid) RunPrompt(ctx context.Context, dir string, prompt string, opts ...Option) (Output, error)
- func (d *Droid) StartSession(ctx context.Context, dir string) (Session, error)
- func (d *Droid) TimeoutMultiplier() float64
- type Gemini
- func (g *Gemini) Binary() string
- func (g *Gemini) Bootstrap() error
- func (g *Gemini) EntireAgent() string
- func (g *Gemini) IsTransientError(out Output, err error) bool
- func (g *Gemini) Name() string
- func (g *Gemini) PromptPattern() string
- func (g *Gemini) RunPrompt(ctx context.Context, dir string, prompt string, opts ...Option) (Output, error)
- func (g *Gemini) StartSession(ctx context.Context, dir string) (Session, error)
- func (g *Gemini) TimeoutMultiplier() float64
- type Option
- type Output
- type Session
- type TmuxSession
- func (s *TmuxSession) Capture() string
- func (s *TmuxSession) Close() error
- func (s *TmuxSession) OnClose(fn func())
- func (s *TmuxSession) Send(input string) error
- func (s *TmuxSession) SendKeys(keys ...string) error
- func (s *TmuxSession) WaitFor(pattern string, timeout time.Duration) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcquireSlot ¶
AcquireSlot blocks until a test slot is available for the agent or the context is cancelled. Returns a non-nil error if the context expires before a slot opens.
func RegisterGate ¶
RegisterGate sets a concurrency limit for an agent's tests. Tests call AcquireSlot/ReleaseSlot to respect this limit. The limit can be overridden via E2E_CONCURRENT_TEST_LIMIT.
Types ¶
type Agent ¶
type Agent interface {
Name() string
// Binary returns the CLI binary name (e.g. "claude", "gemini").
Binary() string
EntireAgent() string
PromptPattern() string
// TimeoutMultiplier returns a factor applied to per-test timeouts.
// Slower agents (e.g. Gemini) return values > 1.
TimeoutMultiplier() float64
RunPrompt(ctx context.Context, dir string, prompt string, opts ...Option) (Output, error)
StartSession(ctx context.Context, dir string) (Session, error)
// Bootstrap performs one-time CI setup (auth config, warmup, etc.).
// Called before any tests run. Implementations should be idempotent.
Bootstrap() error
// IsTransientError returns true if the error from RunPrompt looks like
// a transient API failure (e.g. 500, rate limit, network error) that
// is worth retrying.
IsTransientError(out Output, err error) bool
}
type Claude ¶
type Claude struct{}
func (*Claude) EntireAgent ¶
func (*Claude) PromptPattern ¶
func (*Claude) StartSession ¶
func (*Claude) TimeoutMultiplier ¶
type Droid ¶ added in v0.4.9
type Droid struct{}
Droid implements the Agent interface for Factory AI Droid.
func (*Droid) EntireAgent ¶ added in v0.4.9
func (*Droid) IsTransientError ¶ added in v0.4.9
func (*Droid) PromptPattern ¶ added in v0.4.9
func (*Droid) StartSession ¶ added in v0.4.9
func (*Droid) TimeoutMultiplier ¶ added in v0.4.9
type Gemini ¶
type Gemini struct{}
func (*Gemini) EntireAgent ¶
func (*Gemini) PromptPattern ¶
func (*Gemini) StartSession ¶
func (*Gemini) TimeoutMultiplier ¶
type TmuxSession ¶
type TmuxSession struct {
// contains filtered or unexported fields
}
TmuxSession implements Session using tmux for PTY-based interactive agents.
func NewTmuxSession ¶
func NewTmuxSession(name string, dir string, unsetEnv []string, command string, args ...string) (*TmuxSession, error)
NewTmuxSession creates a new tmux session running the given command in dir. unsetEnv lists environment variable names to strip from the session.
func (*TmuxSession) Capture ¶
func (s *TmuxSession) Capture() string
func (*TmuxSession) Close ¶
func (s *TmuxSession) Close() error
func (*TmuxSession) OnClose ¶
func (s *TmuxSession) OnClose(fn func())
OnClose registers a function to run when the session is closed.
func (*TmuxSession) Send ¶
func (s *TmuxSession) Send(input string) error
func (*TmuxSession) SendKeys ¶
func (s *TmuxSession) SendKeys(keys ...string) error
SendKeys sends raw tmux key names without appending Enter.