Documentation
¶
Overview ¶
Package run launches an agent under a budget and turns its usage into rows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Agents = []string{claudecode.Name, claudecode.SDKName, codex.Agent{}.Name(), codex.SDKName, opencode.Name, copilot.Name}
Agents are the names --agent takes: each agent, and a program that runs Claude Code or Codex through its SDK.
Functions ¶
Types ¶
type MissingAgentError ¶
MissingAgentError is an agent command that is not on PATH.
func (*MissingAgentError) Error ¶
func (e *MissingAgentError) Error() string
func (*MissingAgentError) Unwrap ¶
func (e *MissingAgentError) Unwrap() error
type Options ¶
type Options struct {
// Agent names the adapter, one of Agents. Empty picks it by the command's
// name.
Agent string
Argv []string
Budget decimal.Decimal
// BillingAccount fills BillingAccountId. Empty reads unknown.
BillingAccount string
// Credential fills SubAccountId. Empty reads null.
Credential string
// CI is what the CI system says about the run. Its tags are claims: the
// rows stay unverified and unattributed until a server checks them.
CI cicontext.Context
Rows io.Writer
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
Catalog *catalog.Catalog
// Now is the clock. Nil means time.Now.
Now func() time.Time
// Grace is how long a stopped agent has before SIGKILL.
Grace time.Duration
// Gateway is the run's own key on a gateway. Nil runs without one.
Gateway *gateway.Session
}
Options describes one run.
type ReaderError ¶
type ReaderError struct {
Err error
}
ReaderError is a reader that refused the agent's stream or its execution file. No usage was read, so no rows were written.
func (*ReaderError) Error ¶
func (e *ReaderError) Error() string
func (*ReaderError) Unwrap ¶
func (e *ReaderError) Unwrap() error
type RefusedError ¶
RefusedError is a run that never started its agent, and why.
func (*RefusedError) Error ¶
func (e *RefusedError) Error() string
func (*RefusedError) Unwrap ¶
func (e *RefusedError) Unwrap() error
type Result ¶
type Result struct {
Agent string
AgentExit int
Stopped bool
Enforcement adapter.Enforcement
Report adapter.Report
Rows int
ListTotal decimal.Decimal
// Reason is set when the run wrote no rows.
Reason reason.Reason
// AgentError is the class of error the agent ended in, empty when it
// ended in none. It can sit beside rows: an agent can fail after it has
// made requests.
AgentError adapter.AgentError
// RowsSHA256 is the SHA-256 of the rows' x_CostroidRowId values, sorted,
// each followed by a line feed, in lower-case hex. Empty when the run wrote
// no rows.
RowsSHA256 string
// RowsFileSHA256 is the SHA-256 of every byte the run wrote to Rows, in
// lower-case hex. A rows file that reads otherwise was written after the
// run.
RowsFileSHA256 string
}