Expand description
computer_act — semantic actions AND keyboard as one pipeline on the
accessibility tree (no screen coordinates involved).
One step is EITHER a semantic action on the element matched by
selector (auto-waiting for visible + enabled), OR a keyboard action
(key/text via the SHARED keyboard engine), OR a wait pause — and
steps chain via then with shell && semantics, each only if the
previous succeeded, the first failure aborting the chain with the exact
failing step and everything that completed.
This file is ONLY the pipeline: chain walking, wait steps and step
classification. The step KINDS live in their components — semantic
dispatch in super::touch, keyboard dispatch in super::keyboard
— so each can be reused by other tools without carrying this pipeline
along.
The schema skeleton (then → then → wait) is IDENTICAL to
computer_control’s on purpose: the model learns the pipeline shape
once and carries it across both tools — only each tool’s particular
step kind differs (semantic actions here, pointer actions there).
FOCUS CAVEAT: a semantic press focuses the target on many toolkits
but NOT reliably on every one — the one mechanism that always moves OS
keyboard focus is a real click, which is computer_control’s job. If
chained typing keeps missing the field, click the field element there
instead.
Cancellation caveat: the blocking actions run on tokio’s blocking pool
and CANNOT be interrupted by dropping the future. If the caller aborts
an act that is still auto-waiting, the underlying spawn_blocking
task keeps running and the action may still fire once the element
appears. Callers that need hard cancellation must gate the tool call
itself (the harness-level authorization), not rely on future drops.
Constants§
- ACT_
CHAIN_ MAX_ DEPTH - Maximum number of steps in a
thenpipeline (the root step included) — the same capcomputer_controluses, so the two pipelines behave alike.
Functions§
- act
- Run a semantic pipeline on an accessibility-tree element: actions,
keyboard steps and waits chained via
then, executed sequentially in ONE call with&&semantics.