Documentation
¶
Overview ¶
internal/cmd/sandbox/command.go
internal/cmd/sandbox/configflags.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrAborted = errors.New("session aborted by user")
ErrAborted is returned by SessionBootstrap.Run when the user chooses Exit from the failure menu. The caller must close the session lane without starting a PTY.
Functions ¶
Types ¶
type DataLane ¶ added in v0.16.0
type DataLane struct {
// contains filtered or unexported fields
}
DataLane manages the persistent reverse WebSocket to sandbox-proxy. It dispatches control messages to a SessionManager.
type SessionBootstrap ¶ added in v0.16.0
type SessionBootstrap struct {
SessionID string
SessionName string
SandboxID string
SandboxName string
WorkspaceID string
Config *sandboxv1.Sandbox_Config
SystemPrompt string
SeedPrompt string
JWT string
Endpoint string
BaseDir string // directory where `retask sandbox connect` was invoked
Log *slog.Logger
}
SessionBootstrap performs per-session setup for a Private VM sandbox: creates the session folder, writes agent configs, clones git repos, and builds the process environment.
func (*SessionBootstrap) Run ¶ added in v0.16.0
func (b *SessionBootstrap) Run(ctx context.Context, conn *websocket.Conn) (sessionDir string, env []string, err error)
Run performs all bootstrap steps before the PTY starts. It streams progress to conn as terminal output frames.
Returns (sessionDir, envSlice, nil) on success. Returns ("", nil, ErrAborted) if the user chooses Exit from the failure menu. Returns ("", nil, err) on non-recoverable error.
type SessionManager ¶ added in v0.16.0
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager creates and tracks one agentfleet Runner per active sandbox session.
func (*SessionManager) Remove ¶ added in v0.16.0
func (sm *SessionManager) Remove(sessionID string)
Remove stops the session's PTY and removes it from the fleet so it disappears from the TUI immediately. Used for delete_session messages.
func (*SessionManager) Start ¶ added in v0.16.0
func (sm *SessionManager) Start(ctx context.Context, sessionID, token, name string, configJSON json.RawMessage, systemPrompt, seedPrompt string)
Start handles a new_session event: connects the session lane, runs bootstrap, then launches the PTY and bridges it to the session lane.
func (*SessionManager) Stop ¶ added in v0.16.0
func (sm *SessionManager) Stop(sessionID string)
Stop sends SIGTERM to the session's PTY process.
func (*SessionManager) StopAll ¶ added in v0.16.0
func (sm *SessionManager) StopAll()
StopAll stops every active session.