Versions in this module Expand all Collapse all v0 v0.3.0 May 13, 2026 Changes in this version type AgentRunRequest + TimeoutMS *int64 type ProcessStartRequest + TimeoutMS *int64 v0.2.0 May 11, 2026 v0.1.3 May 8, 2026 Changes in this version + var ErrPTYRequired = errors.New("sandbox/cmd: pty is required") type Signal + const SignalUnspecified v0.1.2 Apr 24, 2026 v0.1.0 Apr 24, 2026 Changes in this version + const ConnectProtocolVersion + var ErrBaseURLEmpty = core.ErrBaseURLEmpty + var ErrCmdIDEmpty = errors.New("sandbox/cmd: cmdID is required") + var ErrCommandEmpty = errors.New("sandbox/cmd: cmd is required") + var ErrInvalidBaseURL = core.ErrInvalidBaseURL + var ErrMultipartFilesEmpty = errors.New("sandbox/cmd: multipart upload requires at least one part") + var ErrPathEmpty = errors.New("sandbox/cmd: path is required") + var ErrPortInvalid = errors.New("sandbox/cmd: port must be greater than 0") + var ErrProcessInputEmpty = errors.New("sandbox/cmd: process input requires stdin or pty") + var ErrProcessNil = errors.New("sandbox/cmd: process is required") + var ErrProcessSelectorAmbig = errors.New("sandbox/cmd: process selector requires exactly one of pid or tag") + var ErrProcessSelectorEmpty = errors.New("sandbox/cmd: process selector requires pid or tag") + var ErrStreamInputFramesZero = errors.New("sandbox/cmd: stream input requires at least one frame") + var ErrWatcherIDEmpty = errors.New("sandbox/cmd: watcherID is required") + type AgentRunRequest struct + Args []string + CWD string + Cmd string + Env map[string]string + Stdin *string + Timeout *int + type AgentRunResponse struct + DurationMS int64 + Error string + ExitCode int + Stderr string + Stdout string + type CloseStdinRequest struct + Process ProcessSelector + type ComposeFilesRequest struct + Destination string + SourcePaths []string + type ConfigureRequest struct + Envs map[string]string + type ConnectFrame struct + Flags byte + Payload json.RawMessage + func (f *ConnectFrame) Decode(out any) error + func (f *ConnectFrame) IsEnd() bool + type ConnectRequest struct + Process ProcessSelector + type ConnectStream struct + func (s *ConnectStream) Close() error + func (s *ConnectStream) NextFrame() (*ConnectFrame, error) + func (s *ConnectStream) NextJSON(out any) (*ConnectFrame, error) + func (s *ConnectStream) Response() *http.Response + type CreateWatcherRequest struct + Path string + Recursive *bool + type CreateWatcherResponse struct + WatcherID string + type DownloadRequest struct + Path string + type EntryInfo struct + Group string + Mode int64 + ModifiedTime string + Name string + Owner string + Path string + Permissions string + Size int64 + SymlinkTarget *string + Type FileType + type EventType string + const EventTypeChmod + const EventTypeCreate + const EventTypeRemove + const EventTypeRename + const EventTypeUnspecified + const EventTypeWrite + type FileRequest struct + Path string + type FileType string + const FileTypeDirectory + const FileTypeFile + const FileTypeSymlink + const FileTypeUnspecified + type FilesContentRequest struct + MaxTokens *int + Path string + type FilesContentResponse struct + Content string + Data string + MIMEType string + Truncated bool + Type string + type FilesystemEvent struct + Name string + Type EventType + type FilesystemWatchFrame struct + Filesystem *FilesystemEvent + Keepalive *struct{} + Start *struct{} + type FilesystemWatchStream struct + func (s *FilesystemWatchStream) Next() (*FilesystemWatchFrame, error) + type FsEditRequest struct + NewText string + OldText string + Path string + type FsEditResponse struct + Message string + type GetResultRequest struct + CmdID string + type GetResultResponse struct + ExitCode int + StartedAtUnix int64 + Stderr string + Stdout string + type GetWatcherEventsRequest struct + Limit *int + WatcherID string + type GetWatcherEventsResponse struct + Events []FilesystemEvent + type ListDirRequest struct + Depth *int + Path string + type ListDirResponse struct + Entries []EntryInfo + type MakeDirRequest struct + Path string + type MakeDirResponse struct + Entry EntryInfo + type MetricsResponse struct + CPUCount int + CPUUsedPct float64 + DiskTotal int64 + DiskUsed int64 + MemCache int64 + MemTotal int64 + MemTotalMiB int64 + MemUsed int64 + MemUsedMiB int64 + TS int64 + type MoveRequest struct + Destination string + Source string + type MoveResponse struct + Entry EntryInfo + type MultipartFile struct + ContentType string + Data []byte + FieldName string + FileName string + type PortEntry struct + Address string + PID *int + Port int + ProcessName string + Protocol string + type ProcessConfig struct + Args []string + CWD *string + Cmd string + Envs map[string]string + type ProcessDataEvent struct + PTY string + Stderr string + Stdout string + type ProcessEndEvent struct + Error *string + Exited bool + Status string + type ProcessEvent struct + Data *ProcessDataEvent + End *ProcessEndEvent + Keepalive *struct{} + Start *ProcessStartEvent + type ProcessInfo struct + CmdID string + Config ProcessConfig + PID int + Tag string + type ProcessInput struct + PTY string + Stdin string + func (i ProcessInput) Validate() error + type ProcessListResponse struct + Processes []ProcessInfo + type ProcessSelector struct + PID int + Tag string + func (s ProcessSelector) Validate() error + type ProcessStartEvent struct + CmdID string + PID int + type ProcessStartRequest struct + PTY *PtyConfig + Process *ProcessConfig + Stdin *bool + Tag string + Timeout *int + type ProcessStream struct + func (s *ProcessStream) Next() (*ProcessStreamFrame, error) + type ProcessStreamFrame struct + Event ProcessEvent + type ProxyRequest struct + Body io.Reader + Headers http.Header + Method string + Path string + Port int + type PtyConfig struct + Size PtySize + type PtySize struct + Cols int + Rows int + type RemoveRequest struct + Path string + type RemoveWatcherRequest struct + WatcherID string + type RequestOptions struct + Headers http.Header + Range string + Signature string + SignatureExpiration *int64 + Username string + type RestEntryInfo struct + Name string + Path string + Type RestEntryType + type RestEntryType string + const RestEntryTypeDirectory + const RestEntryTypeFile + type SendInputRequest struct + Input ProcessInput + Process ProcessSelector + type SendSignalRequest struct + Process ProcessSelector + Signal string + type Service struct + func NewService(baseURL, accessToken string) (*Service, error) + func (c *Service) BaseURL() string + func (c *Service) CloseStdin(ctx context.Context, req *CloseStdinRequest, opts *RequestOptions) error + func (c *Service) ComposeFiles(ctx context.Context, req *ComposeFilesRequest, opts *RequestOptions) (*RestEntryInfo, error) + func (c *Service) Configure(ctx context.Context, req *ConfigureRequest) error + func (c *Service) Connect(ctx context.Context, req *ConnectRequest, opts *RequestOptions) (*ProcessStream, error) + func (c *Service) CreateWatcher(ctx context.Context, req *CreateWatcherRequest, opts *RequestOptions) (*CreateWatcherResponse, error) + func (c *Service) Download(ctx context.Context, req *DownloadRequest, opts *RequestOptions) (*http.Response, error) + func (c *Service) Edit(ctx context.Context, req *FsEditRequest, opts *RequestOptions) (*FsEditResponse, error) + func (c *Service) Envs(ctx context.Context) (map[string]string, error) + func (c *Service) FilesContent(ctx context.Context, req *FilesContentRequest, opts *RequestOptions) (*FilesContentResponse, error) + func (c *Service) GetResult(ctx context.Context, req *GetResultRequest, opts *RequestOptions) (*GetResultResponse, error) + func (c *Service) GetWatcherEvents(ctx context.Context, req *GetWatcherEventsRequest, opts *RequestOptions) (*GetWatcherEventsResponse, error) + func (c *Service) ListDir(ctx context.Context, req *ListDirRequest, opts *RequestOptions) (*ListDirResponse, error) + func (c *Service) ListProcesses(ctx context.Context, opts *RequestOptions) (*ProcessListResponse, error) + func (c *Service) MakeDir(ctx context.Context, req *MakeDirRequest, opts *RequestOptions) (*MakeDirResponse, error) + func (c *Service) Metrics(ctx context.Context) (*MetricsResponse, error) + func (c *Service) Move(ctx context.Context, req *MoveRequest, opts *RequestOptions) (*MoveResponse, error) + func (c *Service) Ports(ctx context.Context) ([]PortEntry, error) + func (c *Service) Proxy(ctx context.Context, req *ProxyRequest) (*http.Response, error) + func (c *Service) ReadFile(ctx context.Context, req *FileRequest, opts *RequestOptions) (*http.Response, error) + func (c *Service) Remove(ctx context.Context, req *RemoveRequest, opts *RequestOptions) error + func (c *Service) RemoveWatcher(ctx context.Context, req *RemoveWatcherRequest, opts *RequestOptions) error + func (c *Service) Run(ctx context.Context, req *AgentRunRequest, opts *RequestOptions) (*AgentRunResponse, error) + func (c *Service) SendInput(ctx context.Context, req *SendInputRequest, opts *RequestOptions) error + func (c *Service) SendSignal(ctx context.Context, req *SendSignalRequest, opts *RequestOptions) error + func (c *Service) Start(ctx context.Context, req *ProcessStartRequest, opts *RequestOptions) (*ProcessStream, error) + func (c *Service) Stat(ctx context.Context, req *StatRequest, opts *RequestOptions) (*StatResponse, error) + func (c *Service) StreamInput(ctx context.Context, frames []StreamInputFrame, opts *RequestOptions) (*ConnectFrame, error) + func (c *Service) Update(ctx context.Context, req *UpdateRequest, opts *RequestOptions) error + func (c *Service) UploadBytes(ctx context.Context, req *UploadBytesRequest, opts *RequestOptions) ([]RestEntryInfo, error) + func (c *Service) UploadJSON(ctx context.Context, entry *WriteFileEntry, opts *RequestOptions) ([]RestEntryInfo, error) + func (c *Service) UploadMultipart(ctx context.Context, req *UploadMultipartRequest, opts *RequestOptions) ([]RestEntryInfo, error) + func (c *Service) WatchDir(ctx context.Context, req *WatchDirRequest, opts *RequestOptions) (*FilesystemWatchStream, error) + func (c *Service) WriteBatch(ctx context.Context, req *WriteFilesRequest, opts *RequestOptions) (*WriteFilesBatchResponse, error) + func (c *Service) WriteFile(ctx context.Context, req *UploadBytesRequest, opts *RequestOptions) error + type Signal string + const SignalSIGHUP + const SignalSIGINT + const SignalSIGKILL + const SignalSIGTERM + type StatRequest struct + Path string + type StatResponse struct + Entry EntryInfo + type StreamInputData struct + Input ProcessInput + type StreamInputFrame struct + Data *StreamInputData + Keepalive *struct{} + Start *StreamInputStart + type StreamInputStart struct + Process ProcessSelector + type UpdateRequest struct + PTY *PtyConfig + Process ProcessSelector + type UploadBytesRequest struct + Data []byte + GzipCompress bool + Path string + type UploadMultipartRequest struct + Parts []MultipartFile + Path string + type WatchDirRequest struct + Path string + Recursive *bool + type WriteFileEntry struct + Content string + Data string + Mode *int + Path string + type WriteFilesBatchResponse struct + Files []WriteFilesBatchResult + type WriteFilesBatchResult struct + BytesWritten int64 + Path string + type WriteFilesRequest struct + Files []WriteFileEntry