Documentation
¶
Overview ¶
Package sandbox defines the isolated tool-execution abstraction used by the agent and verifier. Docker-backed execution is implemented in this package.
Index ¶
- Constants
- type Docker
- type FakeExec
- func (f *FakeExec) Bash(_ context.Context, command string) (string, error)
- func (f *FakeExec) Exists(_ context.Context, path string) (bool, error)
- func (f *FakeExec) ReadFile(_ context.Context, path string) (string, error)
- func (f *FakeExec) ReplaceText(_ context.Context, path, oldText, newText string) error
- func (f *FakeExec) WriteFile(_ context.Context, path, content string) error
- type Orchestrator
- type Task
- type TaskSpec
- type ToolExec
Constants ¶
const ( DefaultImage = "alpine/git:2.47.2" DefaultWorkdir = "/workspace" DefaultRepoDir = "repo" DefaultGitUser = "wright" DefaultGitEmail = "wright@local" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Docker ¶
type Docker struct {
// contains filtered or unexported fields
}
Docker orchestrates task containers through the Docker Engine API.
func NewDocker ¶
NewDocker creates a Docker orchestrator using the local Docker environment. retryCfg controls retries around image pulls, the orchestrator's one genuine network connection attempt.
func NewDockerWithClient ¶
NewDockerWithClient creates a Docker orchestrator from a caller-provided client (used mainly by tests).
type FakeExec ¶
type FakeExec struct {
Files map[string]string
BashFn func(command string) (string, error)
// contains filtered or unexported fields
}
FakeExec is an in-memory ToolExec for tests.
func (*FakeExec) ReplaceText ¶
type Orchestrator ¶
Orchestrator provisions per-issue isolated tasks.
type TaskSpec ¶
type TaskSpec struct {
Image string
Workdir string
RepoDir string
CloneURL string
BaseBranch string
GitUserName string
GitUserEmail string
}
TaskSpec configures one sandbox task.
type ToolExec ¶
type ToolExec interface {
Bash(ctx context.Context, command string) (string, error)
ReadFile(ctx context.Context, path string) (string, error)
WriteFile(ctx context.Context, path, content string) error
ReplaceText(ctx context.Context, path, oldText, newText string) error
Exists(ctx context.Context, path string) (bool, error)
}
ToolExec executes Claude tool calls inside an isolated repo workspace.