machinetransport

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTransportUnavailable = errors.New("machine transport unavailable")

Functions

func NewProcessManager

func NewProcessManager(transport Transport, machine domain.Machine) provider.AgentCLIProcessManager

func NewWebsocketListenerHandler

func NewWebsocketListenerHandler(options ListenerHandlerOptions) http.Handler

func RunRemoteRuntimePreflight

func RunRemoteRuntimePreflight(
	ctx context.Context,
	execution CommandSessionExecution,
	machine domain.Machine,
	spec RuntimePreflightSpec,
) error

func StartRuntimeLocalRelayServerForCLI added in v0.7.0

func StartRuntimeLocalRelayServerForCLI(ctx context.Context, relay *RuntimeLocalRelayManager, address string) (*http.Server, string, error)

Types

type ArtifactSyncExecution added in v0.2.0

type ArtifactSyncExecution interface {
	SyncArtifacts(ctx context.Context, machine domain.Machine, request SyncArtifactsRequest) error
}

type ChannelTransport added in v0.2.0

type ChannelTransport interface {
	Mode() domain.MachineConnectionMode
	SessionState(ctx context.Context, machine domain.Machine) (domain.MachineTransportSessionState, error)
	Heartbeat(ctx context.Context, machine domain.Machine) (domain.MachineDaemonStatus, error)
}

type CommandSession

type CommandSession interface {
	CombinedOutput(cmd string) ([]byte, error)
	StdinPipe() (io.WriteCloser, error)
	StdoutPipe() (io.Reader, error)
	StderrPipe() (io.Reader, error)
	Start(cmd string) error
	StartPTY(cmd string, cols int, rows int) error
	Resize(cols int, rows int) error
	Signal(signal string) error
	Wait() error
	Close() error
}

type CommandSessionExecution added in v0.2.0

type CommandSessionExecution interface {
	OpenCommandSession(ctx context.Context, machine domain.Machine) (CommandSession, error)
}

type DaemonRuntimeProtocolServer added in v0.2.0

type DaemonRuntimeProtocolServer struct {
	// contains filtered or unexported fields
}

func NewDaemonRuntimeProtocolServer added in v0.2.0

func NewDaemonRuntimeProtocolServer(send func(context.Context, runtimecontract.Envelope) error) *DaemonRuntimeProtocolServer

func (*DaemonRuntimeProtocolServer) Close added in v0.2.0

func (s *DaemonRuntimeProtocolServer) Close()

func (*DaemonRuntimeProtocolServer) HandleEnvelope added in v0.2.0

func (s *DaemonRuntimeProtocolServer) HandleEnvelope(ctx context.Context, envelope runtimecontract.Envelope) error

type ExecutionSurface added in v0.2.0

type ExecutionSurface struct {
	Probe          ProbeExecution
	Workspace      WorkspaceExecution
	ArtifactSync   ArtifactSyncExecution
	Process        ProcessExecution
	CommandSession CommandSessionExecution
	Runtime        *RemoteRuntimeSurface
	// contains filtered or unexported fields
}

func (ExecutionSurface) Capabilities added in v0.2.0

func (ExecutionSurface) Supports added in v0.2.0

func (s ExecutionSurface) Supports(capability domain.MachineTransportCapability) bool

func (ExecutionSurface) SupportsAll added in v0.2.0

func (s ExecutionSurface) SupportsAll(capabilities ...domain.MachineTransportCapability) bool

type ListenerHandlerOptions

type ListenerHandlerOptions struct {
	BearerToken string
	APIRelay    *runtimeAPIRelayManager
}

type MonitorCollector

type MonitorCollector struct {
	// contains filtered or unexported fields
}

func NewMonitorCollector

func NewMonitorCollector(resolver *Resolver, sshPool *sshinfra.Pool) *MonitorCollector

func (*MonitorCollector) CollectAgentEnvironment

func (c *MonitorCollector) CollectAgentEnvironment(ctx context.Context, machine domain.Machine) (domain.MachineAgentEnvironment, error)

func (*MonitorCollector) CollectFullAudit

func (c *MonitorCollector) CollectFullAudit(ctx context.Context, machine domain.Machine) (domain.MachineFullAudit, error)

func (*MonitorCollector) CollectGPUResources

func (c *MonitorCollector) CollectGPUResources(ctx context.Context, machine domain.Machine) (domain.MachineGPUResources, error)

func (*MonitorCollector) CollectReachability

func (c *MonitorCollector) CollectReachability(ctx context.Context, machine domain.Machine) (domain.MachineReachability, error)

func (*MonitorCollector) CollectSystemResources

func (c *MonitorCollector) CollectSystemResources(ctx context.Context, machine domain.Machine) (domain.MachineSystemResources, error)

func (*MonitorCollector) CollectWebsocketHealth added in v0.6.0

func (c *MonitorCollector) CollectWebsocketHealth(ctx context.Context, machine domain.Machine) (domain.WebsocketMachineHealth, error)

type ProbeExecution added in v0.2.0

type ProbeExecution interface {
	Probe(ctx context.Context, machine domain.Machine) (domain.MachineProbe, error)
}

type ProcessExecution added in v0.2.0

type ProcessExecution interface {
	StartProcess(ctx context.Context, machine domain.Machine, spec provider.AgentCLIProcessSpec) (provider.AgentCLIProcess, error)
}

type ProcessExitError

type ProcessExitError struct {
	// contains filtered or unexported fields
}

func (ProcessExitError) Error

func (e ProcessExitError) Error() string

func (ProcessExitError) ExitStatus

func (e ProcessExitError) ExitStatus() int

type RemoteRuntimeSurface added in v0.2.0

type RemoteRuntimeSurface struct {
	Probe          ProbeExecution
	Workspace      WorkspaceExecution
	ArtifactSync   ArtifactSyncExecution
	Process        ProcessExecution
	CommandSession CommandSessionExecution
	// contains filtered or unexported fields
}

func (*RemoteRuntimeSurface) Capabilities added in v0.2.0

func (*RemoteRuntimeSurface) Supports added in v0.2.0

func (*RemoteRuntimeSurface) SupportsAll added in v0.2.0

func (s *RemoteRuntimeSurface) SupportsAll(capabilities ...domain.MachineTransportCapability) bool

type ResolvedTransport added in v0.2.0

type ResolvedTransport struct {
	Channel   ChannelTransport
	Execution ExecutionSurface
}

func (ResolvedTransport) ArtifactSyncExecutor added in v0.3.0

func (r ResolvedTransport) ArtifactSyncExecutor() ArtifactSyncExecution

func (ResolvedTransport) CommandSessionExecutor added in v0.3.0

func (r ResolvedTransport) CommandSessionExecutor() CommandSessionExecution

func (ResolvedTransport) ProbeExecutor added in v0.3.0

func (r ResolvedTransport) ProbeExecutor() ProbeExecution

func (ResolvedTransport) ProcessExecutor added in v0.3.0

func (r ResolvedTransport) ProcessExecutor() ProcessExecution

func (ResolvedTransport) WorkspaceExecutor added in v0.3.0

func (r ResolvedTransport) WorkspaceExecutor() WorkspaceExecution

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func NewResolver

func NewResolver(localProcessManager provider.AgentCLIProcessManager, sshPool *sshinfra.Pool) *Resolver

func (*Resolver) Resolve

func (r *Resolver) Resolve(machine domain.Machine) (Transport, error)

func (*Resolver) ResolveRuntime added in v0.2.0

func (r *Resolver) ResolveRuntime(machine domain.Machine) (ResolvedTransport, error)

func (*Resolver) WithReverseRuntimeRelay added in v0.2.0

func (r *Resolver) WithReverseRuntimeRelay(relay *ReverseRuntimeRelayRegistry) *Resolver

type ReverseRuntimeRelayRegistry added in v0.2.0

type ReverseRuntimeRelayRegistry struct {
	// contains filtered or unexported fields
}

func NewReverseRuntimeRelayRegistry added in v0.2.0

func NewReverseRuntimeRelayRegistry() *ReverseRuntimeRelayRegistry

func (*ReverseRuntimeRelayRegistry) Deliver added in v0.2.0

func (r *ReverseRuntimeRelayRegistry) Deliver(sessionID string, envelope runtimecontract.Envelope) error

func (*ReverseRuntimeRelayRegistry) Register added in v0.2.0

func (r *ReverseRuntimeRelayRegistry) Register(
	machineID uuid.UUID,
	sessionID string,
	send runtimeEnvelopeSender,
)

func (*ReverseRuntimeRelayRegistry) Remove added in v0.2.0

func (r *ReverseRuntimeRelayRegistry) Remove(sessionID string)

type RuntimeLocalRelayManager added in v0.7.0

type RuntimeLocalRelayManager = runtimeAPIRelayManager

func NewRuntimeLocalRelayManagerForCLI added in v0.7.0

func NewRuntimeLocalRelayManagerForCLI() *RuntimeLocalRelayManager

type RuntimePreflightError

type RuntimePreflightError struct {
	Stage   RuntimePreflightStage
	Message string
	Cause   error
}

func (*RuntimePreflightError) Error

func (e *RuntimePreflightError) Error() string

func (*RuntimePreflightError) Unwrap

func (e *RuntimePreflightError) Unwrap() error

type RuntimePreflightSpec

type RuntimePreflightSpec struct {
	WorkingDirectory string
	AgentCommand     string
	Environment      []string
}

type RuntimePreflightStage

type RuntimePreflightStage string
const (
	RuntimePreflightStageTransport RuntimePreflightStage = "transport"
	RuntimePreflightStageWorkspace RuntimePreflightStage = "workspace"
	RuntimePreflightStageOpenASE   RuntimePreflightStage = "openase"
	RuntimePreflightStageAgentCLI  RuntimePreflightStage = "agent_cli"
)

type SyncArtifactsRequest

type SyncArtifactsRequest struct {
	LocalRoot   string
	TargetRoot  string
	Paths       []string
	RemovePaths []string
}

type Tester

type Tester struct {
	// contains filtered or unexported fields
}

func NewTester

func NewTester(resolver *Resolver) *Tester

func (*Tester) TestConnection

func (t *Tester) TestConnection(ctx context.Context, machine domain.Machine) (domain.MachineProbe, error)

type Transport

type Transport interface {
	Mode() domain.MachineConnectionMode
	Capabilities(machine domain.Machine) []domain.MachineTransportCapability
	Probe(ctx context.Context, machine domain.Machine) (domain.MachineProbe, error)
	PrepareWorkspace(ctx context.Context, machine domain.Machine, request workspaceinfra.SetupRequest) (workspaceinfra.Workspace, error)
	SyncArtifacts(ctx context.Context, machine domain.Machine, request SyncArtifactsRequest) error
	StartProcess(ctx context.Context, machine domain.Machine, spec provider.AgentCLIProcessSpec) (provider.AgentCLIProcess, error)
	OpenCommandSession(ctx context.Context, machine domain.Machine) (CommandSession, error)
	SessionState(ctx context.Context, machine domain.Machine) (domain.MachineTransportSessionState, error)
	Heartbeat(ctx context.Context, machine domain.Machine) (domain.MachineDaemonStatus, error)
}

type WorkspaceExecution added in v0.2.0

type WorkspaceExecution interface {
	PrepareWorkspace(ctx context.Context, machine domain.Machine, request workspaceinfra.SetupRequest) (workspaceinfra.Workspace, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL