computer
computer
The computer worker turns a live desktop into iii functions. Start a session
with neither image nor endpoint to drive the local machine this worker runs
on (unless the operator configured a default image or endpoint, which is
resolved first; native: true skips those defaults), pass an image to boot a sandboxed desktop, or an endpoint
to drive a remote one. Take a
screenshot to see the screen, then act on it by pixel coordinate: the screenshot
is the source of truth for where things are, and computer::act clicks and
types at those coordinates. On native sessions you can also act
by element: read an app's accessibility tree, then act on an element by its
ref (see "Acting by element"). The session stays alive, so you can act, look at
the result, and act again.
Sessions usually survive a worker restart (it reconnects them best-effort, so an id can still go away — start a new session if one does) and cost one driver connection each; the configured session cap is small. Stop sessions when a task is done. Screenshots are large; take one when you need to see the screen, not after every action.