Documentation
¶
Overview ¶
Package computer locates the bundled computer-use helper, reads the execution device's helper grants and owns the helper's cursor-overlay sessions. The helper is never searched on PATH and never downloaded.
Index ¶
- Constants
- Variables
- func Disclaim(command string, args []string) (string, []string)
- func Executable() (string, error)
- func PrepareHome(data, home string) error
- func Session(env map[string]string)
- func Trampoline()
- func Unconfigured() error
- type Invocation
- type Overlay
- type Probe
- type Screen
- type ScreenTask
Constants ¶
const (
// SessionVariable names the overlay session a helper launch joins.
SessionVariable = "AGENT_DESKTOP_SESSION"
)
const Token = "${SAILRY_COMPUTER_USE}"
Token is the stdio MCP command a package declares to launch the helper.
Variables ¶
var ErrScreenTimeout = errors.New("timed out after 10 minutes waiting for the executor screen")
Functions ¶
func Executable ¶
Executable returns the execution Node's packaged helper.
func PrepareHome ¶
PrepareHome makes the helper home a private directory inside the package data directory.
func Session ¶
Session passes the Node's graphical session to the Linux helper; declared values take precedence.
func Trampoline ¶
func Trampoline()
Trampoline is a macOS concern: other systems grant nothing per application.
func Unconfigured ¶
func Unconfigured() error
Unconfigured reports a permission command without a captured helper.
Types ¶
type Invocation ¶
type Invocation struct {
Command string
Directory string
Env map[string]string
Environment []string
}
Invocation is the captured helper launch a diagnostic command reuses: the helper, its directory, the declared variables and the Node's environment.
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
Overlay owns one cursor-overlay session per helper home. The overlay never moves the physical pointer. A failed step leaves the launch headless.
func (*Overlay) Attach ¶
Attach returns the session an allowed package's helper launch joins. It keeps a session the launch already declares and starts none for a launch without a helper home.
func (*Overlay) Retain ¶
Retain ends the sessions of packages that no longer allow the overlay: those of one package, or of every package when pack is empty.
func (*Overlay) RetainSuffix ¶
RetainSuffix ends every tracked session whose owner ends with suffix.
type Probe ¶
type Probe struct {
// contains filtered or unexported fields
}
Probe reads the helper's own grants on the execution device. Diagnostics reuse the captured helper configuration of the MCP launch.
func (Probe) Read ¶
func (probe Probe) Read(ctx context.Context, node, caller protocol.NodeID, launch *Invocation) (protocol.ComputerPermissions, error)
Read reports the helper's grants. Only macOS gates them; other platforms report no requirement without starting the helper.
func (Probe) Request ¶
func (probe Probe) Request(ctx context.Context, node, caller protocol.NodeID, permission protocol.ComputerPermission, launch *Invocation) (protocol.ComputerPermissions, error)
Request raises the helper's system prompts for a missing grant and reads the result from a fresh process, because Screen Recording state is fixed at process launch.
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}
Screen is shared by all users and turns on a Node. Admission is FIFO between turns. Calls from the owning turn may reuse it until settlement or idle expiry.
func (*Screen) Task ¶
func (screen *Screen) Task(label string) *ScreenTask
type ScreenTask ¶
type ScreenTask struct {
// contains filtered or unexported fields
}
ScreenTask has the lifetime of one captured computer tool set for a turn.
func (*ScreenTask) Acquire ¶
func (task *ScreenTask) Acquire(ctx context.Context, notify func(string) func()) (func(), error)
Acquire returns the release for this operation. notify scopes a transient conversation notice to the time actually spent waiting for another turn.
func (*ScreenTask) Finish ¶
func (task *ScreenTask) Finish()
Finish relinquishes a settled turn. An interrupted MCP call can outlive its caller, so the next turn waits for the transport to finish that call.