Documentation
¶
Index ¶
- Constants
- type ContainerRuntime
- type NativeSandboxConfig
- type NativeSandboxEnvironment
- func (e *NativeSandboxEnvironment) AttachSession(sessionID string) error
- func (e *NativeSandboxEnvironment) Capabilities() environment.Capabilities
- func (e *NativeSandboxEnvironment) Create(ctx context.Context, config environment.SessionConfig) error
- func (e *NativeSandboxEnvironment) CreateSnapshot(ctx context.Context, name string) (*environment.SnapshotInfo, error)
- func (e *NativeSandboxEnvironment) Destroy(ctx context.Context) error
- func (e *NativeSandboxEnvironment) ExecuteTool(ctx context.Context, req environment.ToolRequest, ...) (*environment.ToolResponse, error)
- func (e *NativeSandboxEnvironment) Pause(ctx context.Context) error
- func (e *NativeSandboxEnvironment) Resume(ctx context.Context) error
- func (e *NativeSandboxEnvironment) Rollback(ctx context.Context, snapshotID string) error
- func (e *NativeSandboxEnvironment) State() environment.SessionState
- type StorageBackend
Constants ¶
const ( StorageBackendZFS = sandbox.StorageBackendZFS StorageBackendLocalDisk = sandbox.StorageBackendLocalDisk ContainerRuntimeGVisor = sandbox.ContainerRuntimeGVisor ContainerRuntimeNone = sandbox.ContainerRuntimeNone )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerRuntime ¶
type ContainerRuntime = sandbox.ContainerRuntime
type NativeSandboxConfig ¶
type NativeSandboxConfig struct {
StorageBackend StorageBackend
ContainerRuntime ContainerRuntime
}
func DefaultConfig ¶
func DefaultConfig() NativeSandboxConfig
type NativeSandboxEnvironment ¶
type NativeSandboxEnvironment struct {
// contains filtered or unexported fields
}
NativeSandboxEnvironment adapts the ConnectRPC SandboxClient to the ExecutionEnvironment interface. Wraps api.SandboxService (the RPC client interface) and translates between environment-level types and RPC-level types.
Per §3.4 concurrency contract: NativeSandboxEnvironment delegates all state management to the server-side SandboxHostService via RPC, so it does not need internal locking. The sessionID is set during Create() and read-only after that. A destroyed atomic.Bool tracks local Destroy completion to avoid querying a deleted server-side session.
func NewNativeSandboxEnvironment ¶
func NewNativeSandboxEnvironment(service api.SandboxService, config NativeSandboxConfig, logger *slog.Logger) *NativeSandboxEnvironment
func (*NativeSandboxEnvironment) AttachSession ¶
func (e *NativeSandboxEnvironment) AttachSession(sessionID string) error
AttachSession binds this environment to an existing sandbox session. This is used when the orchestrator has already provisioned the sandbox and only tool execution needs to be wired into an agent session.
func (*NativeSandboxEnvironment) Capabilities ¶
func (e *NativeSandboxEnvironment) Capabilities() environment.Capabilities
func (*NativeSandboxEnvironment) Create ¶
func (e *NativeSandboxEnvironment) Create(ctx context.Context, config environment.SessionConfig) error
func (*NativeSandboxEnvironment) CreateSnapshot ¶
func (e *NativeSandboxEnvironment) CreateSnapshot(ctx context.Context, name string) (*environment.SnapshotInfo, error)
func (*NativeSandboxEnvironment) Destroy ¶
func (e *NativeSandboxEnvironment) Destroy(ctx context.Context) error
func (*NativeSandboxEnvironment) ExecuteTool ¶
func (e *NativeSandboxEnvironment) ExecuteTool(ctx context.Context, req environment.ToolRequest, onProgress func(environment.ToolProgress)) (*environment.ToolResponse, error)
func (*NativeSandboxEnvironment) Pause ¶
func (e *NativeSandboxEnvironment) Pause(ctx context.Context) error
func (*NativeSandboxEnvironment) Resume ¶
func (e *NativeSandboxEnvironment) Resume(ctx context.Context) error
func (*NativeSandboxEnvironment) Rollback ¶
func (e *NativeSandboxEnvironment) Rollback(ctx context.Context, snapshotID string) error
func (*NativeSandboxEnvironment) State ¶
func (e *NativeSandboxEnvironment) State() environment.SessionState
State queries the server for the current session state. After Destroy(), returns StateDestroyed without querying (the session is deleted server-side).
type StorageBackend ¶
type StorageBackend = sandbox.StorageBackend