diff options
Diffstat (limited to 'internal/sandbox/sandbox.go')
| -rw-r--r-- | internal/sandbox/sandbox.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/sandbox/sandbox.go b/internal/sandbox/sandbox.go new file mode 100644 index 0000000..4275475 --- /dev/null +++ b/internal/sandbox/sandbox.go @@ -0,0 +1,25 @@ +// Package sandbox defines the filesystem/shell/git surface an agent loop +// executes tool calls against. Sandbox is intentionally narrow — just the +// operations internal/agentloop's read_file/write_file/run_bash/glob tools +// and its git clone/push/cleanup lifecycle need. +// +// Phase 1 ships exactly one implementation, HostSandbox, which lifts the +// LocalRunner's existing behavior (host git clone into a temp dir, plain +// os.Exec-backed file/bash tools) verbatim. A DockerSandbox (isolation +// improvements, new safety checks) is explicitly out of scope for this phase. +package sandbox + +import "context" + +// Sandbox is the environment a single task execution runs its tool calls +// against. +type Sandbox interface { + ReadFile(ctx context.Context, path string) (string, error) + WriteFile(ctx context.Context, path, content string) error + RunBash(ctx context.Context, command string) (stdout, stderr string, exitCode int, err error) + Glob(ctx context.Context, pattern string) ([]string, error) + GitClone(ctx context.Context, remote, branch string) error + GitPush(ctx context.Context, branch string) error + WorkDir() string + Cleanup(ctx context.Context) error +} |
