Documentation
¶
Overview ¶
Package code implements a coding agent that drives an LLM conversation loop to implement plan steps against a sandboxed project directory using file-system and shell tools.
Class: platform UseWhen: Building a coding agent (code-hand). Implements Implement(projectDir, step, feedback). Not for orchestrators or non-coding workers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent interface {
Implement(projectDir string, step plan.Step, feedback string) (*ImplementResult, error)
}
Agent implements a plan step in a given project directory.
type Coder ¶
type Coder struct {
// contains filtered or unexported fields
}
Coder implements the Agent interface using axon-loop, axon-talk, and axon-tool.
func New ¶
New constructs a Coder with the given LLM client and options. Default: MaxIterations=50, Timeout=15min.
func (*Coder) Implement ¶
func (c *Coder) Implement(projectDir string, step plan.Step, feedback string) (*ImplementResult, error)
Implement runs the coding agent loop for the given plan step. It builds the tool registry, assembles the system prompt, runs axon-loop, and returns the done summary on success.
type Config ¶
type Config struct {
Model string
MaxIterations int
Timeout time.Duration
SystemPromptPrefix string
SessionID string
Verbose io.Writer
}
Config holds runtime configuration for a Coder.
type DoneSignal ¶
type DoneSignal = internaltools.DoneSignal
DoneSignal is populated by the done tool when the agent signals completion.
func BuildTools ¶
BuildTools returns the standard coding tool set bound to projectDir, plus a DoneSignal the caller can inspect after the loop exits. Tools are returned as a map keyed by tool name.
type ImplementResult ¶
type ImplementResult struct {
Summary string // what the agent accomplished
Files []string // paths modified (relative to project dir)
Usage *talk.Usage // token usage for this step; nil if provider doesn't report
}
ImplementResult captures the outcome of implementing a plan step.
type Option ¶
type Option func(*Config)
Option applies a configuration change to a Config.
func WithMaxIterations ¶
WithMaxIterations sets the maximum number of loop iterations.
func WithSessionID ¶
WithSessionID sets the OpenRouter session ID for request grouping.
func WithSystemPromptPrefix ¶
WithSystemPromptPrefix prepends a custom string to the system prompt.
func WithTimeout ¶
WithTimeout sets the timeout for a single Implement call.
func WithVerbose ¶
WithVerbose sets the writer for verbose tool-use logging.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package inspect provides deterministic codebase inspection functionality.
|
Package inspect provides deterministic codebase inspection functionality. |
|
internal
|
|
|
Package vcs provides Git version control operations.
|
Package vcs provides Git version control operations. |
|
Package verify provides functions to run go test, go build, and go vet commands with output parsing capabilities.
|
Package verify provides functions to run go test, go build, and go vet commands with output parsing capabilities. |