headless

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Command agent is the CLI front-end for the package agent loop. The loop itself — think -> act -> observe, the tools, the termination conditions — lives in ../../agent so it can be both driven here and MEASURED by the eval harness (HP-11). This file is only the wiring: pick a provider, open the sandbox and memory, run, and render the result to the terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(argv []string) int

func MainWithExtras

func MainWithExtras(argv []string, invocationSurface string, extras Extras) int

MainWithExtras runs headless mode with optional binary-supplied capabilities.

func MainWithInvocation

func MainWithInvocation(argv []string, invocationSurface string) int

MainWithInvocation runs headless mode with the dispatcher-selected invocation surface. It receives this as data rather than inspecting process arguments.

Types

type Extras

type Extras struct {
	Price       PriceLookup
	NewReviewer func(llm.Provider, string, string) agent.Reviewer
	NewPlanner  func(llm.Provider, string, string) agent.Planner
	LoadLadder  func(string) (LadderConfig, error)
	RunLadder   func(context.Context, LadderRequest) (*LadderResult, error)

	// OpenMemory opens the cross-run memory store at dbPath. Nil means this
	// binary ships no memory backend: -memory degrades to a stateless run
	// with a stderr notice, because memory is best-effort by contract and a
	// missing backend must never fail a run.
	OpenMemory func(dbPath string) (memory.Store, error)
	// MemoryDBName is the backend's store filename, joined to the run's
	// original cwd for worktree runs. Empty when OpenMemory is nil.
	MemoryDBName string
}

Extras are optional capabilities supplied by a fully armed binary.

type LadderConfig

type LadderConfig interface{}

LadderConfig is an opaque ladder configuration owned by the wiring package.

type LadderRequest

type LadderRequest struct {
	Config    LadderConfig
	Base      agent.Config
	Dir       string
	Run       func(context.Context, agent.Config) (*agent.RunResult, error)
	Provider  func(string) (llm.Provider, error)
	Reviewer  func(string) (agent.Reviewer, error)
	Price     PriceLookup
	RecordDir string
	Task      string
}

LadderRequest contains only core types needed to execute a ladder.

type LadderResult

type LadderResult struct {
	RunResult   *agent.RunResult
	WinnerModel string
	RecordErr   error
}

LadderResult is the headless projection of an orchestration result.

type PriceLookup

type PriceLookup func(model string, usage llm.Usage) (float64, bool)

PriceLookup returns the modeled cost for a model and usage.

Jump to

Keyboard shortcuts

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