Documentation
¶
Index ¶
- Variables
- func IsUnsupportedAction(err error) bool
- func SafeExternalHTTPClient(resolver NetIPResolver, timeout time.Duration) *http.Client
- func ValidateExternalBaseURL(ctx context.Context, raw string, resolver NetIPResolver) (*url.URL, error)
- func ValidatePublicHTTPSURL(ctx context.Context, raw string, resolver NetIPResolver) (*url.URL, error)
- func ValidatePublicHost(ctx context.Context, host string, resolver NetIPResolver) error
- type CommandRunner
- type CommandSpec
- type DockerBrowser
- func (executor *DockerBrowser) Check(ctx context.Context) error
- func (executor *DockerBrowser) Close() error
- func (executor *DockerBrowser) CommandSpec() CommandSpec
- func (executor *DockerBrowser) ContainerName() string
- func (executor *DockerBrowser) DebugURL() string
- func (executor *DockerBrowser) Execute(ctx context.Context, action cua.Action) (cua.Observation, error)
- func (executor *DockerBrowser) Name() string
- type DockerBrowserOptions
- type ExternalHTTP
- func (executor *ExternalHTTP) BaseURL() string
- func (executor *ExternalHTTP) Check(ctx context.Context) error
- func (executor *ExternalHTTP) Close() error
- func (executor *ExternalHTTP) Execute(ctx context.Context, action cua.Action) (cua.Observation, error)
- func (executor *ExternalHTTP) Name() string
- type ExternalOptions
- type LocalBrowser
- func (executor *LocalBrowser) Check(ctx context.Context) error
- func (executor *LocalBrowser) Close() error
- func (executor *LocalBrowser) CommandSpec() CommandSpec
- func (executor *LocalBrowser) DebugURL() string
- func (executor *LocalBrowser) Execute(ctx context.Context, action cua.Action) (cua.Observation, error)
- func (executor *LocalBrowser) Name() string
- func (executor *LocalBrowser) ProfileDir() string
- type LocalBrowserOptions
- type MacOSPreview
- func (executor *MacOSPreview) Check(ctx context.Context) error
- func (executor *MacOSPreview) Close() error
- func (executor *MacOSPreview) CommandSpec() CommandSpec
- func (executor *MacOSPreview) Execute(ctx context.Context, action cua.Action) (cua.Observation, error)
- func (executor *MacOSPreview) Name() string
- func (executor *MacOSPreview) Shutdown(ctx context.Context) error
- type MacOSPreviewOptions
- type NetIPResolver
- type OSCommandRunner
- type Process
- type Target
- type UnsupportedActionError
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedAction = errors.New("unsupported computer-use executor action")
Functions ¶
func IsUnsupportedAction ¶
func SafeExternalHTTPClient ¶
func SafeExternalHTTPClient(resolver NetIPResolver, timeout time.Duration) *http.Client
SafeExternalHTTPClient returns an HTTP client that rejects redirects and DNS rebinding.
func ValidateExternalBaseURL ¶
func ValidateExternalBaseURL(ctx context.Context, raw string, resolver NetIPResolver) (*url.URL, error)
ValidateExternalBaseURL validates the external executor base URL.
func ValidatePublicHTTPSURL ¶
func ValidatePublicHTTPSURL(ctx context.Context, raw string, resolver NetIPResolver) (*url.URL, error)
ValidatePublicHTTPSURL rejects non-public or credential-bearing HTTPS URLs.
func ValidatePublicHost ¶
func ValidatePublicHost(ctx context.Context, host string, resolver NetIPResolver) error
ValidatePublicHost rejects localhost, private, link-local, metadata, and reserved hosts.
Types ¶
type CommandRunner ¶
type CommandRunner interface {
Start(context.Context, CommandSpec) (Process, error)
}
CommandRunner starts subprocesses for launch-scoped executors.
type CommandSpec ¶
type CommandSpec struct {
Path string
Args []string
Env []string
Dir string
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
}
CommandSpec describes one subprocess launch without inheriting stdio by default.
type DockerBrowser ¶
type DockerBrowser struct {
// contains filtered or unexported fields
}
DockerBrowser launches an isolated browser inside a Docker container.
func NewDockerBrowser ¶
func NewDockerBrowser(ctx context.Context, opts DockerBrowserOptions) (*DockerBrowser, error)
func (*DockerBrowser) Close ¶
func (executor *DockerBrowser) Close() error
func (*DockerBrowser) CommandSpec ¶
func (executor *DockerBrowser) CommandSpec() CommandSpec
func (*DockerBrowser) ContainerName ¶
func (executor *DockerBrowser) ContainerName() string
func (*DockerBrowser) DebugURL ¶
func (executor *DockerBrowser) DebugURL() string
func (*DockerBrowser) Execute ¶
func (executor *DockerBrowser) Execute(ctx context.Context, action cua.Action) (cua.Observation, error)
func (*DockerBrowser) Name ¶
func (executor *DockerBrowser) Name() string
type DockerBrowserOptions ¶
type DockerBrowserOptions struct {
Runner CommandRunner
HTTPClient *http.Client
DockerPath string
Image string
BrowserBinary string
HostDebugPort int
LaunchID string
StartupURL string
CommandEnvBase []string
}
DockerBrowserOptions configures a launch-scoped Docker browser executor.
type ExternalHTTP ¶
type ExternalHTTP struct {
// contains filtered or unexported fields
}
ExternalHTTP forwards validated actions to a named external HTTPS executor.
func NewExternalHTTP ¶
func NewExternalHTTP(ctx context.Context, name string, opts ExternalOptions) (*ExternalHTTP, error)
func (*ExternalHTTP) BaseURL ¶
func (executor *ExternalHTTP) BaseURL() string
func (*ExternalHTTP) Close ¶
func (executor *ExternalHTTP) Close() error
func (*ExternalHTTP) Execute ¶
func (executor *ExternalHTTP) Execute(ctx context.Context, action cua.Action) (cua.Observation, error)
func (*ExternalHTTP) Name ¶
func (executor *ExternalHTTP) Name() string
type ExternalOptions ¶
type ExternalOptions struct {
BaseURL string
BearerToken string
Resolver NetIPResolver
}
ExternalOptions configures an external public-HTTPS CUA executor.
type LocalBrowser ¶
type LocalBrowser struct {
// contains filtered or unexported fields
}
LocalBrowser launches a local browser with an isolated temporary profile.
func NewLocalBrowser ¶
func NewLocalBrowser(ctx context.Context, opts LocalBrowserOptions) (*LocalBrowser, error)
func (*LocalBrowser) Close ¶
func (executor *LocalBrowser) Close() error
func (*LocalBrowser) CommandSpec ¶
func (executor *LocalBrowser) CommandSpec() CommandSpec
func (*LocalBrowser) DebugURL ¶
func (executor *LocalBrowser) DebugURL() string
func (*LocalBrowser) Execute ¶
func (executor *LocalBrowser) Execute(ctx context.Context, action cua.Action) (cua.Observation, error)
func (*LocalBrowser) Name ¶
func (executor *LocalBrowser) Name() string
func (*LocalBrowser) ProfileDir ¶
func (executor *LocalBrowser) ProfileDir() string
type LocalBrowserOptions ¶
type LocalBrowserOptions struct {
Runner CommandRunner
HTTPClient *http.Client
BrowserPath string
HostDebugPort int
ProfileRoot string
StartupURL string
CommandEnvBase []string
}
LocalBrowserOptions configures a launch-scoped local browser executor.
type MacOSPreview ¶
type MacOSPreview struct {
// contains filtered or unexported fields
}
MacOSPreview owns one ccr-cua-macos helper process for one CCR launch.
func NewMacOSPreview ¶
func NewMacOSPreview(ctx context.Context, opts MacOSPreviewOptions) (*MacOSPreview, error)
NewMacOSPreview starts ccr-cua-macos, validates ready/start JSONL IPC, and returns a launch-scoped executor. It is only supported on darwin.
func (*MacOSPreview) Close ¶
func (executor *MacOSPreview) Close() error
func (*MacOSPreview) CommandSpec ¶
func (executor *MacOSPreview) CommandSpec() CommandSpec
func (*MacOSPreview) Execute ¶
func (executor *MacOSPreview) Execute(ctx context.Context, action cua.Action) (cua.Observation, error)
func (*MacOSPreview) Name ¶
func (executor *MacOSPreview) Name() string
type MacOSPreviewOptions ¶
type MacOSPreviewOptions struct {
Runner CommandRunner
HelperPath string
Args []string
Dir string
CommandEnvBase []string
StartupTimeout time.Duration
ShutdownTimeout time.Duration
}
MacOSPreviewOptions configures the launch-scoped unsigned macOS preview helper. The helper token is learned from ready IPC and is never accepted in options, command arguments, or environment.
type NetIPResolver ¶
NetIPResolver resolves hostnames to IP addresses.
type OSCommandRunner ¶
type OSCommandRunner struct{}
OSCommandRunner starts real operating-system processes.
func (OSCommandRunner) Start ¶
func (OSCommandRunner) Start(ctx context.Context, spec CommandSpec) (Process, error)
type Target ¶
type Target struct {
Kind cua.ExecutorKind
ExternalName string
}
Target is the parsed launch-scoped executor selector.
func ParseTarget ¶
ParseTarget parses the managed CUA executor selector.
type UnsupportedActionError ¶
type UnsupportedActionError struct {
Executor string
Action cua.ActionKind
Reason string
}
UnsupportedActionError reports a CUA action the executor cannot perform.
func (*UnsupportedActionError) Error ¶
func (err *UnsupportedActionError) Error() string
func (*UnsupportedActionError) Unwrap ¶
func (err *UnsupportedActionError) Unwrap() error