Versions in this module Expand all Collapse all v1 v1.3.2 Nov 30, 2026 v1.3.1 Nov 30, 2026 v1.3.0 Nov 30, 2026 v1.1.1 Nov 28, 2026 v1.1.0 Nov 27, 2026 v1.0.0 Nov 27, 2026 Changes in this version + const GUIActionClick + const GUIActionDoubleClick + const GUIActionDrag + const GUIActionInvalid + const GUIActionKey + const GUIActionMove + const GUIActionRightClick + const GUIActionScreenshot + const GUIActionScroll + const GUIActionType + const GUISessionInvalid + const GUISessionVNC + const GUISessionX11 + const LogTargetDocker + const LogTargetFile + const LogTargetInvalid + const ProcessSortCPU + const ProcessSortInvalid + const ProcessSortMem + const ScrollDirectionInvalid + const ScrollDown + const ScrollLeft + const ScrollRight + const ScrollUp + var ErrForwarderUnavailable = errors.New(...) + var ErrInvalidConfig = errors.New("usecase/observability: 无效的 ServiceConfig 或 ProjectionConfig 配置") + var ErrInvalidGUIInput = errors.New("usecase/observability: 无效或包含注入风险的 GUI 输入参数") + var ErrInvalidLogTarget = errors.New("usecase/observability: 无效的远端日志目标或非法容器名称") + var ErrInvalidRequest = errors.New("usecase/observability: 无效的可观测性或 GUI 请求") + var ErrNilContext = errors.New("usecase/observability: context 不能为 nil") + var ErrPOSIXShellRequired = errors.New(...) + var ErrProjectionClosed = errors.New("usecase/observability: Projection 未初始化或已关闭") + var ErrScopedFSUnavailable = errors.New("usecase/observability: 未配置 ScopedRootFS,无法落盘沙箱产物") + var ErrScreenshotInvalid = errors.New(...) + var ErrServiceNotInitialized = errors.New("usecase/observability: Service 未初始化") + var ErrSymlinkPolicyDenied = errors.New("usecase/observability: 远端软链展开超限或被策略拒绝") + var ErrUncertainOutcome = errors.New(...) + func BuildGUIScript(spec GUIActionSpec) (string, error) + func ValidateGUIAction(spec GUIActionSpec) error + func ValidateGUIKeySpec(raw string) error + func ValidateWaylandDisplay(raw string) error + func ValidateX11Display(raw string) error + type DiagnosticRecord struct + Attrs map[string]string + Code string + Message string + OccurredAt time.Time + Scope events.DiagnosticScope + Severity events.Severity + type DiskMetric struct + Mount string + TotalBytes uint64 + UsedBytes uint64 + UsedPercent float64 + type GUIActionKind uint8 + func ParseGUIActionKind(raw string) (GUIActionKind, error) + func (k *GUIActionKind) UnmarshalText(t []byte) error + func (k GUIActionKind) AppendText(b []byte) ([]byte, error) + func (k GUIActionKind) IsValid() bool + func (k GUIActionKind) IsZero() bool + func (k GUIActionKind) MarshalText() ([]byte, error) + func (k GUIActionKind) String() string + type GUIActionSpec struct + Action GUIActionKind + Clicks int + Direction ScrollDirection + Display string + EndX int + EndY int + IncludeShot bool + Key string + StartX int + StartY int + Text string + WaylandDisplay string + X int + Y int + type GUIArtifactDest struct + File pathalg.LocalRootedDest + RootDir pathalg.LocalDir + type GUIExecRequest struct + Approval algebraic.Option[gate.ApprovalSubmission] + Artifact algebraic.Option[GUIArtifactDest] + NodeID string + OperationStream *events.OperationStream + Plan plan.SealedConnectionPlan + Profile algebraic.Option[execution.LaunchProfile] + Risk algebraic.Option[security.RiskLevel] + Spec GUIActionSpec + Timeout algebraic.Option[algebraic.Duration] + type GUIExecResult struct + func (r GUIExecResult) Action() GUIActionKind + func (r GUIExecResult) Artifact() algebraic.Option[pathalg.LocalRootedDest] + func (r GUIExecResult) Duration() algebraic.Duration + func (r GUIExecResult) IsValid() bool + func (r GUIExecResult) IsZero() bool + func (r GUIExecResult) Outcome() execution.ExecutionOutcome + func (r GUIExecResult) Screenshot() algebraic.Option[ProcessedScreenshot] + func (r GUIExecResult) Stderr() string + func (r GUIExecResult) Stdout() string + type GUISessionInfo struct + func (i GUISessionInfo) BoundAddr() string + func (i GUISessionInfo) DisplayNum() int + func (i GUISessionInfo) Handle() plan.ManagedHandle[plan.KindTunnel] + func (i GUISessionInfo) IsValid() bool + func (i GUISessionInfo) IsZero() bool + func (i GUISessionInfo) Kind() GUISessionKind + func (i GUISessionInfo) RemoteTarget() string + type GUISessionKind uint8 + func ParseGUISessionKind(raw string) (GUISessionKind, error) + func (k *GUISessionKind) UnmarshalText(t []byte) error + func (k GUISessionKind) AppendText(b []byte) ([]byte, error) + func (k GUISessionKind) IsValid() bool + func (k GUISessionKind) IsZero() bool + func (k GUISessionKind) MarshalText() ([]byte, error) + func (k GUISessionKind) String() string + type GUISessionSpec struct + AllowNonLoopbackBind bool + DisplayNum int + Kind GUISessionKind + LocalBindHost string + LocalBindPort uint16 + UseUnixSocket bool + type GUISessionStatus struct + func (s GUISessionStatus) Active() bool + func (s GUISessionStatus) BoundAddr() string + func (s GUISessionStatus) DisplayNum() int + func (s GUISessionStatus) Err() error + func (s GUISessionStatus) HandleStatus() pool.HandleStatus + func (s GUISessionStatus) IsValid() bool + func (s GUISessionStatus) IsZero() bool + func (s GUISessionStatus) Kind() GUISessionKind + func (s GUISessionStatus) RemoteTarget() string + type HostMetricsFrame struct + CPUPercent float64 + Disks []DiskMetric + Hostname string + Load1 float64 + Load15 float64 + Load5 float64 + MemPercent float64 + MemTotal uint64 + MemUsed uint64 + NodeID string + Processes []ProcessMetric + SampledAt time.Time + Uptime algebraic.Duration + type LogEntry struct + ChunkIndex uint64 + Data string + NodeID string + OccurredAt time.Time + OperationID string + Stream events.OutputStreamKind + TraceID string + Truncated bool + type LogStreamRequest struct + Approval algebraic.Option[gate.ApprovalSubmission] + Follow bool + MaxBytes uint64 + NodeID string + OperationStream *events.OperationStream + Output io.Writer + Plan plan.SealedConnectionPlan + Profile algebraic.Option[execution.LaunchProfile] + Risk algebraic.Option[security.RiskLevel] + TailLines int + Target LogTarget + Timeout algebraic.Option[algebraic.Duration] + type LogStreamResult struct + func (r LogStreamResult) Data() []byte + func (r LogStreamResult) Duration() algebraic.Duration + func (r LogStreamResult) IsValid() bool + func (r LogStreamResult) IsZero() bool + func (r LogStreamResult) Outcome() execution.ExecutionOutcome + func (r LogStreamResult) Truncated() bool + type LogTarget struct + func NewDockerLogTarget(container string) (LogTarget, error) + func NewFileLogTarget(p pathalg.RemotePath) (LogTarget, error) + func (t LogTarget) Container() string + func (t LogTarget) FilePath() pathalg.RemotePath + func (t LogTarget) IsValid() bool + func (t LogTarget) IsZero() bool + func (t LogTarget) Kind() LogTargetKind + type LogTargetKind uint8 + func ParseLogTargetKind(raw string) (LogTargetKind, error) + func (k *LogTargetKind) UnmarshalText(t []byte) error + func (k LogTargetKind) AppendText(b []byte) ([]byte, error) + func (k LogTargetKind) IsValid() bool + func (k LogTargetKind) IsZero() bool + func (k LogTargetKind) MarshalText() ([]byte, error) + func (k LogTargetKind) String() string + type MetricPoint struct + Interval algebraic.Duration + Key string + Labels map[string]string + Name string + NodeID string + OccurredAt time.Time + Unit string + Value float64 + type MetricsStreamRequest struct + Approval algebraic.Option[gate.ApprovalSubmission] + Interval algebraic.Option[algebraic.Duration] + MaxSamples int + NodeID string + OnFrame func(HostMetricsFrame) + OperationStream *events.OperationStream + Plan plan.SealedConnectionPlan + Profile algebraic.Option[execution.LaunchProfile] + Risk algebraic.Option[security.RiskLevel] + SortBy algebraic.Option[ProcessSortBy] + Timeout algebraic.Option[algebraic.Duration] + TopProcesses int + type MetricsStreamResult struct + func (r MetricsStreamResult) Duration() algebraic.Duration + func (r MetricsStreamResult) Frames() []HostMetricsFrame + func (r MetricsStreamResult) IsValid() bool + func (r MetricsStreamResult) IsZero() bool + func (r MetricsStreamResult) Outcome() execution.ExecutionOutcome + type OpenGUISessionRequest struct + Approval algebraic.Option[gate.ApprovalSubmission] + NodeID string + OperationStream *events.OperationStream + Plan plan.SealedConnectionPlan + Risk algebraic.Option[security.RiskLevel] + Spec GUISessionSpec + type OperationView struct + Action string + Completed bool + Duration algebraic.Duration + LastCode string + LastMessage string + LastStepID string + LastStepStat string + NodeID string + OperationID string + Succeeded bool + Summary string + Tool string + TraceID string + Unknown bool + UpdatedAt time.Time + type PoolRecord struct + Action events.PoolEventAction + ActiveLeases uint32 + Detail string + Endpoint string + Latency algebraic.Duration + OccurredAt time.Time + type ProcessMetric struct + CPUPercent float64 + Command string + MemPercent float64 + PID int32 + User string + type ProcessSortBy uint8 + func ParseProcessSortBy(raw string) (ProcessSortBy, error) + func (s *ProcessSortBy) UnmarshalText(t []byte) error + func (s ProcessSortBy) AppendText(b []byte) ([]byte, error) + func (s ProcessSortBy) IsValid() bool + func (s ProcessSortBy) IsZero() bool + func (s ProcessSortBy) MarshalText() ([]byte, error) + func (s ProcessSortBy) String() string + type ProcessedScreenshot struct + Data []byte + Height int + MIMEType string + OrigHeight int + OrigWidth int + Width int + func ExtractAndProcessScreenshot(rawStdout []byte) (ProcessedScreenshot, error) + func ProcessScreenshotBytes(raw []byte) (ProcessedScreenshot, error) + type Projection struct + func NewProjection(ctx context.Context, cfg ProjectionConfig) (*Projection, error) + func (p *Projection) ApplyEvent(ev events.Event) error + func (p *Projection) AttachOperationStream(stream *events.OperationStream) error + func (p *Projection) Close() error + func (p *Projection) Snapshot() ProjectionSnapshot + func (p *Projection) WaitUpdate(ctx context.Context, sinceVersion uint64) (ProjectionSnapshot, error) + type ProjectionConfig struct + BusBuffer int + MaxDiagnostics int + MaxLogEntries int + MaxMetrics int + MaxOperations int + MaxPoolEvents int + SystemBus *events.SystemBus + type ProjectionSnapshot struct + func (s ProjectionSnapshot) ActiveStreams() int + func (s ProjectionSnapshot) CanonicalJSON() ([]byte, error) + func (s ProjectionSnapshot) Diagnostics() []DiagnosticRecord + func (s ProjectionSnapshot) DroppedEvents() uint64 + func (s ProjectionSnapshot) GateHalted() bool + func (s ProjectionSnapshot) HasUnknownOutcome() bool + func (s ProjectionSnapshot) IsValid() bool + func (s ProjectionSnapshot) IsZero() bool + func (s ProjectionSnapshot) Logs() []LogEntry + func (s ProjectionSnapshot) MarshalJSONTo(enc *jsontext.Encoder) error + func (s ProjectionSnapshot) Metrics() []MetricPoint + func (s ProjectionSnapshot) Operations() []OperationView + func (s ProjectionSnapshot) PoolEvents() []PoolRecord + func (s ProjectionSnapshot) TotalEvents() uint64 + func (s ProjectionSnapshot) Version() uint64 + type ScrollDirection uint8 + func ParseScrollDirection(raw string) (ScrollDirection, error) + func (d *ScrollDirection) UnmarshalText(t []byte) error + func (d ScrollDirection) AppendText(b []byte) ([]byte, error) + func (d ScrollDirection) IsValid() bool + func (d ScrollDirection) IsZero() bool + func (d ScrollDirection) MarshalText() ([]byte, error) + func (d ScrollDirection) String() string + type Service struct + func NewService(cfg ServiceConfig) (*Service, error) + func (s *Service) CloseGUISession(ctx context.Context, handle plan.ManagedHandle[plan.KindTunnel]) error + func (s *Service) ExecuteGUI(ctx context.Context, req GUIExecRequest) (GUIExecResult, error) + func (s *Service) InspectGUISession(ctx context.Context, handle plan.ManagedHandle[plan.KindTunnel]) (GUISessionStatus, error) + func (s *Service) OpenGUISession(ctx context.Context, req OpenGUISessionRequest) (GUISessionInfo, error) + func (s *Service) StreamLogs(ctx context.Context, req LogStreamRequest) (LogStreamResult, error) + func (s *Service) StreamMetrics(ctx context.Context, req MetricsStreamRequest) (MetricsStreamResult, error) + type ServiceConfig struct + Clock ports.Clock + Entropy ports.Entropy + Env ports.EnvPort + Forwarder ports.ForwarderPort + Gate gate.Authorizer + Pool *pool.Pool + ScopedFS ports.ScopedRootFS + ShellProbe ports.ShellProbePort + SystemBus *events.SystemBus