Documentation
¶
Index ¶
- type BashAction
- type BashInterruptAction
- type BashObservation
- type BashSession
- type CloseBashSessionRequest
- type CloseBashSessionResponse
- type CloseResponse
- type Command
- type CommandResponse
- type CreateBashSessionRequest
- type CreateBashSessionResponse
- type DefaultLogger
- type Deployment
- type DeploymentConfig
- type DeploymentType
- type DockerConfig
- type IsAliveResponse
- type LocalDeployment
- type LocalRuntime
- func (r *LocalRuntime) Close(ctx context.Context) (*CloseResponse, error)
- func (r *LocalRuntime) CloseSession(ctx context.Context, request *CloseBashSessionRequest) (*CloseBashSessionResponse, error)
- func (r *LocalRuntime) CreateSession(ctx context.Context, request *CreateBashSessionRequest) (*CreateBashSessionResponse, error)
- func (r *LocalRuntime) Execute(ctx context.Context, command *Command) (*CommandResponse, error)
- func (r *LocalRuntime) IsAlive(ctx context.Context, timeout *time.Duration) (*IsAliveResponse, error)
- func (r *LocalRuntime) ReadFile(ctx context.Context, request *ReadFileRequest) (*ReadFileResponse, error)
- func (r *LocalRuntime) RunInSession(ctx context.Context, action interface{}) (*BashObservation, error)
- func (r *LocalRuntime) Upload(ctx context.Context, request *UploadRequest) (*UploadResponse, error)
- func (r *LocalRuntime) WriteFile(ctx context.Context, request *WriteFileRequest) (*WriteFileResponse, error)
- type Logger
- type ReadFileRequest
- type ReadFileResponse
- type RemoteConfig
- type Runtime
- func (r *Runtime) CreateTrajectory(id string, config TrajectoryConfig) (*Trajectory, error)
- func (r *Runtime) DeleteTrajectory(id string) error
- func (r *Runtime) ExecuteTool(ctx context.Context, name string, params map[string]interface{}) (interface{}, error)
- func (r *Runtime) GetContext() map[string]interface{}
- func (r *Runtime) GetTool(name string) (tools.Tool, error)
- func (r *Runtime) GetTrajectory(id string) (*Trajectory, error)
- func (r *Runtime) ListTools() []tools.Tool
- func (r *Runtime) ListTrajectories() []*Trajectory
- func (r *Runtime) LoadState(data []byte) error
- func (r *Runtime) LoadTrajectories(path string) error
- func (r *Runtime) RegisterTool(tool tools.Tool) error
- func (r *Runtime) SaveState() ([]byte, error)
- func (r *Runtime) SetContext(ctx map[string]interface{})
- func (r *Runtime) Start(ctx context.Context) error
- func (r *Runtime) Stop() error
- func (r *Runtime) UpdateContext(updates map[string]interface{})
- func (r *Runtime) WaitForTrajectory(id string, timeout time.Duration) error
- type RuntimeConfig
- type Trajectory
- func (t *Trajectory) GetContext() map[string]interface{}
- func (t *Trajectory) GetCurrentStep() string
- func (t *Trajectory) GetError() error
- func (t *Trajectory) GetResults() map[string]interface{}
- func (t *Trajectory) GetState() TrajectoryState
- func (t *Trajectory) LoadState(data []byte) error
- func (t *Trajectory) Pause() error
- func (t *Trajectory) Resume(ctx context.Context) error
- func (t *Trajectory) SaveState() ([]byte, error)
- func (t *Trajectory) SetContext(ctx map[string]interface{})
- func (t *Trajectory) Start(ctx context.Context) error
- func (t *Trajectory) Stop() error
- func (t *Trajectory) UpdateContext(updates map[string]interface{})
- func (t *Trajectory) Wait(timeout time.Duration) error
- type TrajectoryConfig
- type TrajectoryState
- type TrajectoryStep
- type UploadRequest
- type UploadResponse
- type WriteFileRequest
- type WriteFileResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BashAction ¶
type BashAction struct {
Command string `json:"command"`
Session string `json:"session,omitempty"`
Timeout *float64 `json:"timeout,omitempty"`
IsInteractiveCommand bool `json:"is_interactive_command,omitempty"`
IsInteractiveQuit bool `json:"is_interactive_quit,omitempty"`
Check string `json:"check,omitempty"`
ErrorMsg string `json:"error_msg,omitempty"`
Expect []string `json:"expect,omitempty"`
ActionType string `json:"action_type"`
}
type BashInterruptAction ¶
type BashObservation ¶
type BashSession ¶
type BashSession struct {
// contains filtered or unexported fields
}
type CloseBashSessionRequest ¶
type CloseBashSessionResponse ¶
type CloseBashSessionResponse struct {
SessionType string `json:"session_type"`
}
type CloseResponse ¶
type CloseResponse struct{}
type Command ¶
type Command struct {
Command interface{} `json:"command"`
Timeout *float64 `json:"timeout,omitempty"`
Shell bool `json:"shell,omitempty"`
Check bool `json:"check,omitempty"`
ErrorMsg string `json:"error_msg,omitempty"`
Env map[string]string `json:"env,omitempty"`
Cwd string `json:"cwd,omitempty"`
}
type CommandResponse ¶
type DefaultLogger ¶
type DefaultLogger struct{}
func (*DefaultLogger) Debug ¶
func (l *DefaultLogger) Debug(format string, args ...interface{})
func (*DefaultLogger) Error ¶
func (l *DefaultLogger) Error(format string, args ...interface{})
func (*DefaultLogger) Info ¶
func (l *DefaultLogger) Info(format string, args ...interface{})
func (*DefaultLogger) Warn ¶
func (l *DefaultLogger) Warn(format string, args ...interface{})
type Deployment ¶
type Deployment interface {
Start(ctx context.Context) error
Stop(ctx context.Context) error
GetRuntime() Runtime
}
func GetDeployment ¶
func GetDeployment(config *DeploymentConfig, logger Logger) (Deployment, error)
type DeploymentConfig ¶
type DeploymentConfig struct {
Type DeploymentType `json:"type"`
DockerConfig *DockerConfig `json:"docker_config,omitempty"`
RemoteConfig *RemoteConfig `json:"remote_config,omitempty"`
PythonStandaloneDir string `json:"python_standalone_dir,omitempty"`
}
type DeploymentType ¶
type DeploymentType string
const ( DeploymentTypeLocal DeploymentType = "local" DeploymentTypeDocker DeploymentType = "docker" DeploymentTypeRemote DeploymentType = "remote" )
type DockerConfig ¶
type IsAliveResponse ¶
type LocalDeployment ¶
type LocalDeployment struct {
// contains filtered or unexported fields
}
func NewLocalDeployment ¶
func NewLocalDeployment(logger Logger) *LocalDeployment
func (*LocalDeployment) GetRuntime ¶
func (d *LocalDeployment) GetRuntime() Runtime
type LocalRuntime ¶
type LocalRuntime struct {
// contains filtered or unexported fields
}
func NewLocalRuntime ¶
func NewLocalRuntime(logger Logger) *LocalRuntime
func (*LocalRuntime) Close ¶
func (r *LocalRuntime) Close(ctx context.Context) (*CloseResponse, error)
func (*LocalRuntime) CloseSession ¶
func (r *LocalRuntime) CloseSession(ctx context.Context, request *CloseBashSessionRequest) (*CloseBashSessionResponse, error)
func (*LocalRuntime) CreateSession ¶
func (r *LocalRuntime) CreateSession(ctx context.Context, request *CreateBashSessionRequest) (*CreateBashSessionResponse, error)
func (*LocalRuntime) Execute ¶
func (r *LocalRuntime) Execute(ctx context.Context, command *Command) (*CommandResponse, error)
func (*LocalRuntime) IsAlive ¶
func (r *LocalRuntime) IsAlive(ctx context.Context, timeout *time.Duration) (*IsAliveResponse, error)
func (*LocalRuntime) ReadFile ¶
func (r *LocalRuntime) ReadFile(ctx context.Context, request *ReadFileRequest) (*ReadFileResponse, error)
func (*LocalRuntime) RunInSession ¶
func (r *LocalRuntime) RunInSession(ctx context.Context, action interface{}) (*BashObservation, error)
func (*LocalRuntime) Upload ¶
func (r *LocalRuntime) Upload(ctx context.Context, request *UploadRequest) (*UploadResponse, error)
func (*LocalRuntime) WriteFile ¶
func (r *LocalRuntime) WriteFile(ctx context.Context, request *WriteFileRequest) (*WriteFileResponse, error)
type ReadFileRequest ¶
type ReadFileResponse ¶
type ReadFileResponse struct {
Content string `json:"content,omitempty"`
}
type RemoteConfig ¶
type Runtime ¶
type Runtime struct {
Agent interfaces.Agent
Trajectories map[string]*Trajectory
Context map[string]interface{}
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(agent interfaces.Agent, config RuntimeConfig) (*Runtime, error)
func (*Runtime) CreateTrajectory ¶
func (r *Runtime) CreateTrajectory(id string, config TrajectoryConfig) (*Trajectory, error)
func (*Runtime) DeleteTrajectory ¶
func (*Runtime) ExecuteTool ¶
func (*Runtime) GetContext ¶
func (*Runtime) GetTrajectory ¶
func (r *Runtime) GetTrajectory(id string) (*Trajectory, error)
func (*Runtime) ListTrajectories ¶
func (r *Runtime) ListTrajectories() []*Trajectory
func (*Runtime) LoadTrajectories ¶
func (*Runtime) SetContext ¶
func (*Runtime) UpdateContext ¶
type RuntimeConfig ¶
type Trajectory ¶
type Trajectory struct {
Runtime *Runtime
ID string
Config TrajectoryConfig
State TrajectoryState
CurrentStep string
Context map[string]interface{}
Results map[string]interface{}
Error error
RetryCount int
// contains filtered or unexported fields
}
func NewTrajectory ¶
func NewTrajectory(runtime *Runtime, id string, config TrajectoryConfig) *Trajectory
func (*Trajectory) GetContext ¶
func (t *Trajectory) GetContext() map[string]interface{}
func (*Trajectory) GetCurrentStep ¶
func (t *Trajectory) GetCurrentStep() string
func (*Trajectory) GetError ¶
func (t *Trajectory) GetError() error
func (*Trajectory) GetResults ¶
func (t *Trajectory) GetResults() map[string]interface{}
func (*Trajectory) GetState ¶
func (t *Trajectory) GetState() TrajectoryState
func (*Trajectory) LoadState ¶
func (t *Trajectory) LoadState(data []byte) error
func (*Trajectory) Pause ¶
func (t *Trajectory) Pause() error
func (*Trajectory) SaveState ¶
func (t *Trajectory) SaveState() ([]byte, error)
func (*Trajectory) SetContext ¶
func (t *Trajectory) SetContext(ctx map[string]interface{})
func (*Trajectory) Stop ¶
func (t *Trajectory) Stop() error
func (*Trajectory) UpdateContext ¶
func (t *Trajectory) UpdateContext(updates map[string]interface{})
type TrajectoryConfig ¶
type TrajectoryState ¶
type TrajectoryState string
const ( StateIdle TrajectoryState = "idle" StateRunning TrajectoryState = "running" StatePaused TrajectoryState = "paused" StateCompleted TrajectoryState = "completed" StateFailed TrajectoryState = "failed" )
type TrajectoryStep ¶
type UploadRequest ¶
type UploadResponse ¶
type UploadResponse struct{}
type WriteFileRequest ¶
type WriteFileResponse ¶
type WriteFileResponse struct{}
Click to show internal directories.
Click to hide internal directories.