Skip to main content

Module desktop

Module desktop 

Source
Expand description

Desktop: look at and control a native app, with the user’s consent for each app (docs/specs/SPEC_DESKTOP_DRIVING_2026_10_20.md §5.1).

The last rung of the ladder: connectors, an app’s own API, Browser, Terminal and UI come first. Every action but apps and wait asks srv’s gate (/api/v1/agent/desktop/authorize) first; srv answers from the grants, the blocklist, the limits and Stop, and asks the user in the app when there is no grant. The tool then acts (desktop_input) and tells srv what happened, for the audit log.

Structs§

Captured 🔒
What a look made: the image’s path and hash, and either the whole window’s look or the zoom of a region.
DragArgs 🔒
A drag’s two ends, the points it passes through, and what it holds, read from the call’s arguments.

Enums§

Asked 🔒
What srv answered about one window in a call that asks for several.
CaptureKind 🔒

Constants§

FRAME_HOST 🔒
The process that hosts every Windows Store (UWP) app’s window.
MAX_LISTED 🔒
Windows apps lists at most.
MAX_REQUEST_WINDOWS 🔒
Windows one request call may name.
UNIDENTIFIED_STORE_APP 🔒
Why a Windows Store app’s window can’t be used right now.

Functions§

app_label 🔒
The app’s name as shown: the executable’s file name without .exe.
apps 🔒
authorize 🔒
Ask srv whether action on w may go ahead. Returns the grant’s id, or srv’s reason as an error. It never waits for the user: with no grant srv asks them and answers pending at once, and their answer reaches the agent as an [AgentMux] note.
call 🔒
click 🔒
drag 🔒
drive 🔒
What every input action does after the gate: bring the window forward and check every point isn’t covered, run act with the points’ screen positions, and record the outcome.
find_window 🔒
A window by the id apps gave. Only a foreign app of the user’s own can be driven (spec §5.3); the others are refused with where to go instead.
int_arg 🔒
key 🔒
look 🔒
parse_drag 🔒
Read a drag’s arguments. Refuses what can’t be a drag, with the fix.
parse_region 🔒
region of a look: x, y, w, h in the pixels of the last look.
post 🔒
read_answer 🔒
Sort srv’s answer to one window of a request call.
record 🔒
Tell srv what an authorized action did. Best effort: the action has happened (or failed) either way.
release 🔒
request_many 🔒
Ask for several apps in one call. Each app is its own request to the user, with its own card, countdown, veto and grant; nothing about one decides another. What is shared is the answer: one [AgentMux] note names every app as allowed, declined or vetoed once all have been decided.
request_windows 🔒
The windows a request call names, without repeats, at most MAX_REQUEST_WINDOWS.
screen_point 🔒
The screen point for image point (x, y) of window id, from its last look. Errors say what to do (look again, stay inside the image).
scroll 🔒
type_text 🔒
wait 🔒
window_id 🔒
window_ref 🔒
The window as srv names it. The app is what grants, denials and the blocklist key on, so a Windows Store app is named by its own executable, not by ApplicationFrameHost.exe, which hosts all of them: a grant for Calculator must not cover every other Store app, and a Store password manager must stay blockable by name. When the hosted app can’t be found (it is suspended while minimised), the window is refused, never keyed on the frame host.
with_look 🔒
After an action that asked for it (look: true), the fresh look at the window, appended to what the action said: one call instead of three. A look that fails doesn’t fail the action, which has happened.