Computer, windows and accessibility

cua.env.v1 ComputerService, DriverService, WindowsService and AccessibilityService: screenshots, input, clipboard, displays, Cua Driver tools, windows and the accessibility tree.

Desktop control. These services need the desktop provider; input goes through Cua Driver, which DriverService also exposes tool by tool.

Source: libs/cua/proto/cua/env/v1/computer.proto, libs/cua/proto/cua/env/v1/driver.proto, libs/cua/proto/cua/env/v1/windows.proto, libs/cua/proto/cua/env/v1/accessibility.proto.

ComputerService#

cua.env.v1.ComputerService

Screen capture and synthetic input.

Implemented by calling the cua-driver-core tool registry in-process (not over MCP). Every input RPC states its delivery mode explicitly and reports what actually happened in a DeliveryReport.

Coordinates: screenshots report both their pixel size and the logical region they cover, so clients never guess a Retina scale. Input can be expressed in screen points, window points, normalized units or the pixels of a specific screenshot (see CoordinateSpace); the server performs the single conversion to native coordinates.

ComputerService.Screenshot#

/cua.env.v1.ComputerService/Screenshot, unary: ScreenshotRequest to ScreenshotResponse.

Captures a display, a window or a region of either.

ComputerService.Pointer#

/cua.env.v1.ComputerService/Pointer, unary: PointerRequest to PointerResponse.

Performs one pointer (mouse) operation.

ComputerService.Keyboard#

/cua.env.v1.ComputerService/Keyboard, unary: KeyboardRequest to KeyboardResponse.

Performs one keyboard operation.

ComputerService.GetClipboard#

/cua.env.v1.ComputerService/GetClipboard, unary: GetClipboardRequest to GetClipboardResponse.

Reads the clipboard.

ComputerService.SetClipboard#

/cua.env.v1.ComputerService/SetClipboard, unary: SetClipboardRequest to SetClipboardResponse.

Replaces the clipboard.

ComputerService.GetCursorPosition#

/cua.env.v1.ComputerService/GetCursorPosition, unary: GetCursorPositionRequest to GetCursorPositionResponse.

Returns the user-visible pointer position.

ComputerService.ListDisplays#

/cua.env.v1.ComputerService/ListDisplays, unary: ListDisplaysRequest to ListDisplaysResponse.

Lists displays attached to the guest desktop.

DriverService#

cua.env.v1.DriverService

Passthrough to the full cua-driver tool registry.

Every cua-driver tool is reachable here without new protos. The same registry is exposed to agents as streamable-HTTP MCP at /mcp on the same port. Arguments and structured results are JSON text so that tool schemas evolve with the cua-driver contract, not with this package.

DriverService.ListTools#

/cua.env.v1.DriverService/ListTools, unary: ListToolsRequest to ListToolsResponse.

Lists the tools the linked cua-driver registry exposes on this platform.

DriverService.CallTool#

/cua.env.v1.DriverService/CallTool, unary: CallToolRequest to CallToolResponse.

Invokes one tool.

WindowsService#

cua.env.v1.WindowsService

Window enumeration, window management and app launching.

Windows are addressed with opaque WindowRef handles (id + epoch). Native handles never cross the wire. Nothing here goes through a shell: apps are launched by identifier with an explicit argument vector.

WindowsService.ListWindows#

/cua.env.v1.WindowsService/ListWindows, unary: ListWindowsRequest to ListWindowsResponse.

Lists windows matching a filter.

WindowsService.WatchWindows#

/cua.env.v1.WindowsService/WatchWindows, server stream: WatchWindowsRequest to WatchWindowsResponse.

Streams window lifecycle changes. Starts with a snapshot of all matching windows so clients never race between a list and a watch.

WindowsService.GetWindow#

/cua.env.v1.WindowsService/GetWindow, unary: GetWindowRequest to GetWindowResponse.

Returns one window.

WindowsService.ActivateWindow#

/cua.env.v1.WindowsService/ActivateWindow, unary: ActivateWindowRequest to ActivateWindowResponse.

Brings a window to the front and gives it keyboard focus.

WindowsService.SetWindowBounds#

/cua.env.v1.WindowsService/SetWindowBounds, unary: SetWindowBoundsRequest to SetWindowBoundsResponse.

Moves and/or resizes a window.

WindowsService.MinimizeWindow#

/cua.env.v1.WindowsService/MinimizeWindow, unary: MinimizeWindowRequest to MinimizeWindowResponse.

Minimizes (iconifies) a window.

WindowsService.MaximizeWindow#

/cua.env.v1.WindowsService/MaximizeWindow, unary: MaximizeWindowRequest to MaximizeWindowResponse.

Maximizes (zooms) a window.

WindowsService.RestoreWindow#

/cua.env.v1.WindowsService/RestoreWindow, unary: RestoreWindowRequest to RestoreWindowResponse.

Restores a minimized or maximized window to its normal state.

WindowsService.CloseWindow#

/cua.env.v1.WindowsService/CloseWindow, unary: CloseWindowRequest to CloseWindowResponse.

Asks a window to close (like clicking its close button), or force-closes it.

WindowsService.LaunchApp#

/cua.env.v1.WindowsService/LaunchApp, unary: LaunchAppRequest to LaunchAppResponse.

Launches an application.

WindowsService.Open#

/cua.env.v1.WindowsService/Open, unary: OpenRequest to OpenResponse.

Opens a URL or path with its default (or a given) application.

AccessibilityService#

cua.env.v1.AccessibilityService

The guest accessibility tree (macOS AX, Windows UI Automation, Linux AT-SPI via cua-driver platform-linux).

Every read returns a snapshot id. Element ids are only meaningful together with the snapshot id they came from; acting on an element from an older snapshot fails with ERROR_REASON_STALE_SNAPSHOT unless the server can prove the element is unchanged. Requires capability "a11y".

AccessibilityService.GetTree#

/cua.env.v1.AccessibilityService/GetTree, unary: GetTreeRequest to GetTreeResponse.

Returns the accessibility tree of a window (or the focused window).

AccessibilityService.Find#

/cua.env.v1.AccessibilityService/Find, unary: FindRequest to FindResponse.

Finds elements matching a query.

AccessibilityService.Act#

/cua.env.v1.AccessibilityService/Act, unary: ActRequest to ActResponse.

Performs an accessibility action on an element.

Types in cua/env/v1/computer.proto#

ScreenshotRequest#

Request for ComputerService.Screenshot.

Field#TypeDescription
display_id1string (oneof source)A display id, or "primary".
window2WindowRef (oneof source)A single window. Captured without occluding windows where the platform supports it (see capability "window_stream").
region3RectSub-region in logical points, relative to the source's top-left corner. Unset captures the whole source.
format4ImageFormatOutput format.
quality5uint32Quality 1 to 100 for lossy formats. 0 means 80.
max_dimension6uint32Downscale so the longer edge is at most this many pixels, preserving aspect ratio. 0 means no limit (native resolution).
include_cursor7boolDraw the pointer into the image.

ScreenshotResponse#

Response for ComputerService.Screenshot.

Field#TypeDescription
image1bytesEncoded image bytes.
format2ImageFormatFormat of image.
image_size3PixelSizePixel size of image (after any downscale).
native_size4PixelSizePixel size of the captured area at native (physical) resolution.
scale5doubleImage pixels per logical point. To convert an image pixel to a screen point: screen = logical_bounds.origin + pixel / scale.
logical_bounds6RectThe captured area in global logical points (COORDINATE_SPACE_SCREEN).
screenshot_id7stringId to reference this capture's pixel space in later input requests (COORDINATE_SPACE_SCREENSHOT). Valid until the geometry of the source changes; the server keeps at least the 16 most recent ids.
display_id8stringDisplay the capture came from (for a window capture, the display containing most of the window).
captured_at9google.protobuf.TimestampWhen the frame was captured.

InputTarget#

Where and how an input request is delivered.

Field#TypeDescription
window1WindowRefWindow to deliver to. Unset delivers to whatever is under the pointer (pointer) or focused (keyboard). Required for DELIVERY_BACKGROUND on most platforms and for COORDINATE_SPACE_WINDOW.
display_id2stringDisplay for COORDINATE_SPACE_NORMALIZED without a window. Empty means the primary display.
delivery3DeliveryDelivery mode.
space4CoordinateSpaceCoordinate space of every point in the request.
screenshot_id5stringRequired with COORDINATE_SPACE_SCREENSHOT: which screenshot's pixel space the points refer to.

PointerClick#

Click (press and release) one or more times.

Field#TypeDescription
position1PointWhere to click. Unset clicks at the current pointer position.
button2MouseButtonWhich button.
count3uint32Number of clicks: 1 single, 2 double, 3 triple. 0 means 1.
modifiers4repeated KeyModifier keys held during the click.

PointerMove#

Move the pointer.

Field#TypeDescription
position1PointDestination.
duration2google.protobuf.DurationAnimate the move over this duration. Unset jumps instantly.

PointerDown#

Press a button without releasing it.

Field#TypeDescription
position1PointWhere to press. Unset presses at the current position.
button2MouseButtonWhich button.

PointerUp#

Release a pressed button.

Field#TypeDescription
position1PointWhere to release. Unset releases at the current position.
button2MouseButtonWhich button.

PointerDrag#

Press at from, move along path to to, release.

Field#TypeDescription
from1PointStart point.
to2PointEnd point.
path3repeated PointOptional intermediate points, in order.
button4MouseButtonWhich button.
duration5google.protobuf.DurationTotal drag duration. Unset means 300 ms.
modifiers6repeated KeyModifier keys held during the drag.

PointerScroll#

Scroll by a delta.

Field#TypeDescription
position1PointWhere to scroll. Unset scrolls at the current pointer position. The pointer is not moved for background delivery.
delta_x2doubleHorizontal delta; positive scrolls content right.
delta_y3doubleVertical delta; positive scrolls content down.
unit4ScrollUnitUnit of the deltas.

PointerRequest#

Request for ComputerService.Pointer.

Field#TypeDescription
target1InputTargetTarget, delivery and coordinate space.
click2PointerClick (oneof action)Click.
move3PointerMove (oneof action)Move.
down4PointerDown (oneof action)Button down.
up5PointerUp (oneof action)Button up.
drag6PointerDrag (oneof action)Drag.
scroll7PointerScroll (oneof action)Scroll.

PointerResponse#

Response for ComputerService.Pointer.

Field#TypeDescription
report1DeliveryReportWhat actually happened.
cursor_position2PointUser-visible pointer position afterwards, in screen points.

KeyInput#

One key, either named or as a character.

Field#TypeDescription
named1Key (oneof key)A named key.
character2string (oneof key)A single Unicode scalar value, mapped through the guest's current keyboard layout to the key (and Shift/AltGr) that produces it. Fails with ERROR_REASON_DELIVERY_FAILED if no key produces it; use KeyboardType for arbitrary text.

KeyboardType#

Type text.

Field#TypeDescription
text1stringUTF-8 text. Newlines are typed as Enter.
mode2TextEntryModeEntry mode.
delay3google.protobuf.DurationDelay between characters for TEXT_ENTRY_MODE_KEYSTROKES. Unset means no deliberate delay.

KeyboardPress#

Press and release one key, optionally with modifiers held.

Field#TypeDescription
key1KeyInputThe key.
modifiers2repeated KeyModifiers held while the key is pressed.
repeat3uint32Number of presses. 0 means 1.

KeyboardHotkey#

Press a chord: keys go down in order and up in reverse order (for example Control, Shift, T).

Field#TypeDescription
keys1repeated KeyInputKeys in press order. At least one.

KeyboardDown#

Press a key without releasing it.

Field#TypeDescription
key1KeyInputThe key.

KeyboardUp#

Release a pressed key.

Field#TypeDescription
key1KeyInputThe key.

KeyboardRequest#

Request for ComputerService.Keyboard.

Field#TypeDescription
target1InputTargetTarget and delivery. space and points are ignored.
type2KeyboardType (oneof action)Type text.
press3KeyboardPress (oneof action)Press one key.
hotkey4KeyboardHotkey (oneof action)Press a chord.
down5KeyboardDown (oneof action)Key down.
up6KeyboardUp (oneof action)Key up.

KeyboardResponse#

Response for ComputerService.Keyboard.

Field#TypeDescription
report1DeliveryReportWhat actually happened.

ClipboardContent#

Clipboard content.

Field#TypeDescription
text1optional stringPlain UTF-8 text. At most 1 MiB. Unset means no text flavor.
file_paths2repeated stringAbsolute guest paths of files on the clipboard (file copy/paste). To put host files on the guest clipboard, upload them first with FilesystemService, then set their paths here. Requires capability "clipboard.files".
image_png3optional bytesA PNG image (for example a copied screenshot). At most 16 MiB. Requires capability "clipboard.image".

GetClipboardRequest#

Request for ComputerService.GetClipboard.

No fields.

GetClipboardResponse#

Response for ComputerService.GetClipboard.

Field#TypeDescription
content1ClipboardContentCurrent content. Only flavors the driver understands are reported.
generation2uint64Clipboard generation counter; changes whenever the content changes.

SetClipboardRequest#

Request for ComputerService.SetClipboard.

Field#TypeDescription
content1ClipboardContentNew content. Replaces every flavor.

SetClipboardResponse#

Response for ComputerService.SetClipboard.

Field#TypeDescription
generation1uint64Generation after the write.

GetCursorPositionRequest#

Request for ComputerService.GetCursorPosition.

No fields.

GetCursorPositionResponse#

Response for ComputerService.GetCursorPosition.

Field#TypeDescription
position1PointPosition in global logical points (COORDINATE_SPACE_SCREEN).
display_id2stringDisplay containing the pointer.

ListDisplaysRequest#

Request for ComputerService.ListDisplays.

No fields.

ListDisplaysResponse#

Response for ComputerService.ListDisplays.

Field#TypeDescription
displays1repeated DisplayAttached displays, primary first.

ImageFormat#

Encoded image format.

Value#Description
IMAGE_FORMAT_UNSPECIFIED0Not set. Treated as IMAGE_FORMAT_PNG.
IMAGE_FORMAT_PNG1PNG (lossless).
IMAGE_FORMAT_JPEG2JPEG (lossy, honours quality).
IMAGE_FORMAT_WEBP3WebP (lossy, honours quality).

MouseButton#

Mouse button.

Value#Description
MOUSE_BUTTON_UNSPECIFIED0Not set. Treated as MOUSE_BUTTON_LEFT.
MOUSE_BUTTON_LEFT1Primary button.
MOUSE_BUTTON_RIGHT2Secondary button.
MOUSE_BUTTON_MIDDLE3Middle button / wheel press.
MOUSE_BUTTON_BACK4Back (button 4).
MOUSE_BUTTON_FORWARD5Forward (button 5).

ScrollUnit#

Unit of scroll deltas.

Value#Description
SCROLL_UNIT_UNSPECIFIED0Not set. Treated as SCROLL_UNIT_LINE.
SCROLL_UNIT_LINE1Wheel notches / text lines.
SCROLL_UNIT_PIXEL2Logical points (precise, trackpad-style scrolling).

Key#

Named keys, independent of keyboard layout. Printable characters that are not listed here are sent with KeyInput.character.

Values are grouped in numeric blocks with gaps left for additions within each block: modifiers 1-19, editing and navigation 20-59, function keys 60-99, letters 100-129, digits 130-149, punctuation 150-179, numeric keypad 180-219, system and lock keys 220-239, media and hardware keys 240-269, browser and launcher keys 270-299.

Value#Description
KEY_UNSPECIFIED0Not set. Rejected.
KEY_SHIFT1Shift (either side).
KEY_SHIFT_LEFT2Left Shift.
KEY_SHIFT_RIGHT3Right Shift.
KEY_CONTROL4Control (either side).
KEY_CONTROL_LEFT5Left Control.
KEY_CONTROL_RIGHT6Right Control.
KEY_ALT7Alt / Option (either side).
KEY_ALT_LEFT8Left Alt / Option.
KEY_ALT_RIGHT9Right Alt / Option / AltGr.
KEY_META10Meta: Command on macOS, Windows key on Windows, Super on Linux (either side).
KEY_META_LEFT11Left Meta.
KEY_META_RIGHT12Right Meta.
KEY_FN13Fn (where the platform exposes it).
KEY_CAPS_LOCK14Caps Lock.
KEY_ENTER20Enter / Return.
KEY_TAB21Tab.
KEY_SPACE22Space bar.
KEY_BACKSPACE23Backspace (Delete on macOS keyboards).
KEY_DELETE24Forward delete.
KEY_ESCAPE25Escape.
KEY_INSERT26Insert.
KEY_HOME27Home.
KEY_END28End.
KEY_PAGE_UP29Page Up.
KEY_PAGE_DOWN30Page Down.
KEY_ARROW_UP31Up arrow.
KEY_ARROW_DOWN32Down arrow.
KEY_ARROW_LEFT33Left arrow.
KEY_ARROW_RIGHT34Right arrow.
KEY_CONTEXT_MENU35Context menu / Application key.
KEY_HELP36Help.
KEY_F160F1.
KEY_F261F2.
KEY_F362F3.
KEY_F463F4.
KEY_F564F5.
KEY_F665F6.
KEY_F766F7.
KEY_F867F8.
KEY_F968F9.
KEY_F1069F10.
KEY_F1170F11.
KEY_F1271F12.
KEY_F1372F13.
KEY_F1473F14.
KEY_F1574F15.
KEY_F1675F16.
KEY_F1776F17.
KEY_F1877F18.
KEY_F1978F19.
KEY_F2079F20.
KEY_F2180F21.
KEY_F2281F22.
KEY_F2382F23.
KEY_F2483F24.
KEY_A100Letter A (physical key position on a US layout).
KEY_B101Letter B.
KEY_C102Letter C.
KEY_D103Letter D.
KEY_E104Letter E.
KEY_F105Letter F.
KEY_G106Letter G.
KEY_H107Letter H.
KEY_I108Letter I.
KEY_J109Letter J.
KEY_K110Letter K.
KEY_L111Letter L.
KEY_M112Letter M.
KEY_N113Letter N.
KEY_O114Letter O.
KEY_P115Letter P.
KEY_Q116Letter Q.
KEY_R117Letter R.
KEY_S118Letter S.
KEY_T119Letter T.
KEY_U120Letter U.
KEY_V121Letter V.
KEY_W122Letter W.
KEY_X123Letter X.
KEY_Y124Letter Y.
KEY_Z125Letter Z.
KEY_DIGIT_0130Digit 0 (top row).
KEY_DIGIT_1131Digit 1.
KEY_DIGIT_2132Digit 2.
KEY_DIGIT_3133Digit 3.
KEY_DIGIT_4134Digit 4.
KEY_DIGIT_5135Digit 5.
KEY_DIGIT_6136Digit 6.
KEY_DIGIT_7137Digit 7.
KEY_DIGIT_8138Digit 8.
KEY_DIGIT_9139Digit 9.
KEY_MINUS150Minus / underscore.
KEY_EQUAL151Equal / plus.
KEY_BRACKET_LEFT152Left bracket / brace.
KEY_BRACKET_RIGHT153Right bracket / brace.
KEY_BACKSLASH154Backslash / pipe.
KEY_SEMICOLON155Semicolon / colon.
KEY_QUOTE156Quote / double quote.
KEY_BACKQUOTE157Backquote / tilde.
KEY_COMMA158Comma / less-than.
KEY_PERIOD159Period / greater-than.
KEY_SLASH160Slash / question mark.
KEY_INTL_BACKSLASH161The extra key left of Z on ISO keyboards.
KEY_NUMPAD_0180Keypad 0.
KEY_NUMPAD_1181Keypad 1.
KEY_NUMPAD_2182Keypad 2.
KEY_NUMPAD_3183Keypad 3.
KEY_NUMPAD_4184Keypad 4.
KEY_NUMPAD_5185Keypad 5.
KEY_NUMPAD_6186Keypad 6.
KEY_NUMPAD_7187Keypad 7.
KEY_NUMPAD_8188Keypad 8.
KEY_NUMPAD_9189Keypad 9.
KEY_NUMPAD_ADD190Keypad +.
KEY_NUMPAD_SUBTRACT191Keypad -.
KEY_NUMPAD_MULTIPLY192Keypad *.
KEY_NUMPAD_DIVIDE193Keypad /.
KEY_NUMPAD_DECIMAL194Keypad decimal point.
KEY_NUMPAD_ENTER195Keypad Enter.
KEY_NUMPAD_EQUAL196Keypad =.
KEY_NUM_LOCK197Num Lock / Clear.
KEY_PRINT_SCREEN220Print Screen / SysRq.
KEY_SCROLL_LOCK221Scroll Lock.
KEY_PAUSE222Pause / Break.
KEY_MEDIA_PLAY_PAUSE240Play / pause toggle.
KEY_MEDIA_STOP241Stop.
KEY_MEDIA_NEXT242Next track.
KEY_MEDIA_PREVIOUS243Previous track.
KEY_VOLUME_UP244Volume up.
KEY_VOLUME_DOWN245Volume down.
KEY_VOLUME_MUTE246Mute toggle.
KEY_BRIGHTNESS_UP247Brightness up.
KEY_BRIGHTNESS_DOWN248Brightness down.
KEY_EJECT249Eject.
KEY_POWER250Power.
KEY_SLEEP251Sleep.
KEY_BROWSER_BACK270Browser back.
KEY_BROWSER_FORWARD271Browser forward.
KEY_BROWSER_REFRESH272Browser refresh.
KEY_BROWSER_HOME273Browser home.
KEY_BROWSER_SEARCH274Browser search.
KEY_LAUNCH_MAIL275Launch mail client.
KEY_LAUNCH_APP1276Launch application 1 (often "My Computer" / Mission Control).
KEY_LAUNCH_APP2277Launch application 2 (often calculator / Launchpad).

TextEntryMode#

How KeyboardType enters text.

Value#Description
TEXT_ENTRY_MODE_UNSPECIFIED0Not set. Treated as TEXT_ENTRY_MODE_KEYSTROKES.
TEXT_ENTRY_MODE_KEYSTROKES1Synthesize a key press per character (Unicode injection for characters without a key). Honors the caret position and triggers key handlers.
TEXT_ENTRY_MODE_INSERT2Insert the text in one operation (accessibility value insertion or paste). Fast, but inserts relative to the element's own insertion point and may not fire per-key handlers.

Types in cua/env/v1/driver.proto#

ListToolsRequest#

Request for DriverService.ListTools.

No fields.

ToolInfo#

A tool description, mirroring the MCP tool shape.

Field#TypeDescription
name1stringTool name, for example "click" or "get_window_state".
description2stringHuman-readable description.
input_schema_json3stringJSON Schema of the arguments object, as JSON text.
output_schema_json4stringJSON Schema of the structured result, as JSON text. Empty when the tool declares none.
read_only5boolTrue if the tool does not modify guest state.
destructive6boolTrue if the tool may perform destructive changes.

ListToolsResponse#

Response for DriverService.ListTools.

Field#TypeDescription
tools1repeated ToolInfoAvailable tools.
contract_version2stringcua-driver contract version the registry implements.

CallToolRequest#

Request for DriverService.CallTool.

Field#TypeDescription
name1stringTool name.
arguments_json2stringArguments object as JSON text. Empty means {}.
timeout3google.protobuf.DurationAbort the call after this long. Unset means the tool's own default.

ToolImage#

An image produced by a tool.

Field#TypeDescription
data1bytesEncoded bytes.
mime_type2stringMedia type, for example "image/png".

ToolContent#

One part of a tool result, mirroring MCP content parts.

Field#TypeDescription
text1string (oneof content)Text.
image2ToolImage (oneof content)An image.
json3string (oneof content)JSON text.

CallToolResponse#

Response for DriverService.CallTool. Tool-level failures are reported with is_error, not as gRPC errors; gRPC errors mean the call could not be dispatched (unknown tool, invalid JSON, timeout).

Field#TypeDescription
content1repeated ToolContentResult parts in order.
structured_json2stringStructured result as JSON text, when the tool declares an output schema.
is_error3boolTrue if the tool reported a failure.

Types in cua/env/v1/windows.proto#

AppInfo#

Application that owns a window.

Field#TypeDescription
name1stringDisplay name, for example "Firefox".
app_id2stringPlatform app identifier: bundle id on macOS, .desktop id on Linux, AppUserModelID or executable name on Windows. Empty when unknown.
pid3uint32Guest process id of the owning process. Guest-local; never a host id.

WindowInfo#

Description of a window.

Field#TypeDescription
ref1WindowRefHandle.
title2stringTitle.
app3AppInfoOwning application.
bounds4RectFrame in global logical points. Advisory: it is a snapshot and may be stale by the time it is used. Media sessions and screenshots report their own authoritative geometry.
display_id5stringDisplay containing most of the window.
state6WindowStateState.
kind7WindowKindRole.
focused8boolTrue if this window has keyboard focus.
on_screen9boolTrue if any part is on screen (not minimized, hidden or off-desktop).
z_order10uint32Front-to-back stacking order among listed windows, 0 is frontmost.

WindowFilter#

Filter for window listing and watching. All set fields must match.

Field#TypeDescription
title_contains1stringCase-insensitive substring of the title.
app_name_contains2stringCase-insensitive substring of the app name.
app_id3stringExact AppInfo.app_id.
pid4uint32Owning process id.
display_id5stringOnly windows on this display.
on_screen_only6boolOnly on-screen windows.
include_system7boolInclude WINDOW_KIND_SYSTEM and WINDOW_KIND_PHANTOM windows, which are omitted by default.

ListWindowsRequest#

Request for WindowsService.ListWindows.

Field#TypeDescription
filter1WindowFilterFilter.

ListWindowsResponse#

Response for WindowsService.ListWindows.

Field#TypeDescription
windows1repeated WindowInfoMatching windows, front to back.

WatchWindowsRequest#

Request for WindowsService.WatchWindows.

Field#TypeDescription
filter1WindowFilterFilter applied to every event.
keepalive_interval2google.protobuf.DurationInterval between keepalive messages. Unset means 30 seconds.

WindowSnapshot#

Initial state of a window watch.

Field#TypeDescription
windows1repeated WindowInfoAll matching windows, front to back.

WindowClosed#

A window was closed or no longer matches the filter.

Field#TypeDescription
ref1WindowRefThe window.

WatchWindowsResponse#

One message of the WindowsService.WatchWindows stream.

Field#TypeDescription
snapshot1WindowSnapshot (oneof event)First message: current matching windows.
created2WindowInfo (oneof event)A new window appeared (or started matching).
updated3WindowInfo (oneof event)A window changed title, bounds, state, focus or z-order. Carries the full new description.
closed4WindowClosed (oneof event)A window closed.
keepalive5KeepAlive (oneof event)Idle stream heartbeat.

GetWindowRequest#

Request for WindowsService.GetWindow.

Field#TypeDescription
window1WindowRefWhich window.

GetWindowResponse#

Response for WindowsService.GetWindow.

Field#TypeDescription
window1WindowInfoThe window.

ActivateWindowRequest#

Request for WindowsService.ActivateWindow.

Field#TypeDescription
window1WindowRefWhich window.

ActivateWindowResponse#

Response for WindowsService.ActivateWindow.

Field#TypeDescription
window1WindowInfoThe window afterwards.

SetWindowBoundsRequest#

Request for WindowsService.SetWindowBounds.

Field#TypeDescription
window1WindowRefWhich window.
position2PointNew top-left corner in global logical points. Unset keeps the position.
width3optional doubleNew width in logical points. Unset keeps the width.
height4optional doubleNew height in logical points. Unset keeps the height.

SetWindowBoundsResponse#

Response for WindowsService.SetWindowBounds.

Field#TypeDescription
window1WindowInfoThe window afterwards. Its bounds may differ from the request when the window manager or app constrains them.

MinimizeWindowRequest#

Request for WindowsService.MinimizeWindow.

Field#TypeDescription
window1WindowRefWhich window.

MinimizeWindowResponse#

Response for WindowsService.MinimizeWindow.

Field#TypeDescription
window1WindowInfoThe window afterwards.

MaximizeWindowRequest#

Request for WindowsService.MaximizeWindow.

Field#TypeDescription
window1WindowRefWhich window.

MaximizeWindowResponse#

Response for WindowsService.MaximizeWindow.

Field#TypeDescription
window1WindowInfoThe window afterwards.

RestoreWindowRequest#

Request for WindowsService.RestoreWindow.

Field#TypeDescription
window1WindowRefWhich window.

RestoreWindowResponse#

Response for WindowsService.RestoreWindow.

Field#TypeDescription
window1WindowInfoThe window afterwards.

CloseWindowRequest#

Request for WindowsService.CloseWindow.

Field#TypeDescription
window1WindowRefWhich window.
force2boolDestroy the window without giving the app a chance to object (for example to an unsaved-changes prompt). On most platforms this kills the owning process.

CloseWindowResponse#

Response for WindowsService.CloseWindow.

Field#TypeDescription
closed1boolTrue if the window is gone. False when the app kept it open (for example it showed a save prompt).

AppSpec#

Identifies an application to launch.

Field#TypeDescription
app_id1string (oneof app)Platform app identifier: macOS bundle id ("org.mozilla.firefox"), Linux .desktop id ("firefox.desktop"), Windows AppUserModelID.
executable2string (oneof app)Executable name (resolved on PATH) or absolute path.
name3string (oneof app)Display name, resolved by the platform (for example "Firefox"). The least precise option.

LaunchAppRequest#

Request for WindowsService.LaunchApp.

Field#TypeDescription
app1AppSpecWhat to launch.
args2repeated stringArguments passed verbatim, never through a shell.
env3map of string to stringExtra environment variables.
cwd4stringWorking directory. Empty means the user's home.
delivery5DeliveryDELIVERY_BACKGROUND launches without activating the app or stealing focus (where the platform allows). DELIVERY_FOREGROUND activates it.
wait_for_window6google.protobuf.DurationWait up to this long for the app's first window and return it. Unset returns immediately after the process starts.

LaunchAppResponse#

Response for WindowsService.LaunchApp.

Field#TypeDescription
pid1uint32Guest process id of the launched (or already running, for single- instance apps) process. 0 when the platform does not report it.
windows2repeated WindowInfoWindows that appeared within wait_for_window.

OpenRequest#

Request for WindowsService.Open.

Field#TypeDescription
url1string (oneof target)A URL, for example "https://example.com" or "mailto:a@b".
path2string (oneof target)A guest file or directory path.
with_app3AppSpecOpen with this app instead of the default handler.
delivery4DeliveryDelivery, as for LaunchAppRequest.delivery.

OpenResponse#

Response for WindowsService.Open.

Field#TypeDescription
pid1uint32Guest process id of the handling app, 0 when unknown.

WindowState#

Window state.

Value#Description
WINDOW_STATE_UNSPECIFIED0Not reported.
WINDOW_STATE_NORMAL1Normal (neither minimized, maximized nor fullscreen).
WINDOW_STATE_MINIMIZED2Minimized / iconified.
WINDOW_STATE_MAXIMIZED3Maximized / zoomed.
WINDOW_STATE_FULLSCREEN4Fullscreen.
WINDOW_STATE_HIDDEN5Hidden (app hidden, withdrawn, or on another virtual desktop).

WindowKind#

Broad window role.

Value#Description
WINDOW_KIND_UNSPECIFIED0Not reported.
WINDOW_KIND_STANDARD1A normal application window.
WINDOW_KIND_DIALOG2A dialog or sheet.
WINDOW_KIND_PANEL3A floating panel or utility window.
WINDOW_KIND_MENU4A menu or popup.
WINDOW_KIND_TOOLTIP5A tooltip.
WINDOW_KIND_SYSTEM6Desktop chrome: dock, menu bar strip, panel, wallpaper.
WINDOW_KIND_PHANTOM7Invisible or indicator surfaces (for example the macOS screen-recording indicator, 1x1 helper windows). Hidden unless include_system is set.

Types in cua/env/v1/accessibility.proto#

AccessibilityNode#

One accessibility element. Trees are returned flattened in pre-order (parents before children) to avoid unbounded message nesting.

Field#TypeDescription
element_id1stringElement id, unique within its snapshot.
parent_id2stringParent element id, empty for the root.
depth3uint32Depth below the root (root is 0).
role4stringNormalized role, for example "button", "text_field", "menu_item", "window". Platform roles are mapped to one vocabulary.
native_role5stringThe platform's native role string (for example "AXButton", "ControlType.Button", "push button"), for debugging.
name6stringAccessible name / label.
value7stringCurrent value (text content, slider value), when it has one.
description8stringAccessible description / help text.
bounds9RectFrame in global logical points, when known.
states10repeated stringNormalized states, for example "focused", "enabled", "selected", "checked", "expanded", "editable", "offscreen".
actions11repeated AccessibilityActionActions the element supports (see AccessibilityAction).
attributes12map of string to stringOther attributes the platform exposes, stringified.

GetTreeRequest#

Request for AccessibilityService.GetTree.

Field#TypeDescription
window1WindowRefWindow whose tree to read. Unset means the focused window.
max_depth2uint32Maximum depth below the root. 0 means unlimited (subject to the server's node limit).
include_hidden3boolInclude elements that are offscreen or not visible.
max_nodes4uint32Stop after this many nodes. 0 means the server limit (normally 5000).

GetTreeResponse#

Response for AccessibilityService.GetTree.

Field#TypeDescription
snapshot_id1stringSnapshot id for later Act calls.
window2WindowRefThe window the tree belongs to.
nodes3repeated AccessibilityNodeNodes in pre-order.
truncated4boolTrue if max_depth or max_nodes cut the tree short.

AccessibilityQuery#

Query for AccessibilityService.Find. All set fields must match.

Field#TypeDescription
role1stringNormalized role.
name2stringExact accessible name.
name_contains3stringCase-insensitive substring of the accessible name.
value_contains4stringCase-insensitive substring of the value.
states5repeated stringRequired states.

FindRequest#

Request for AccessibilityService.Find.

Field#TypeDescription
window1WindowRefWindow to search. Unset means the focused window.
query2AccessibilityQueryWhat to look for.
max_results3uint32Maximum matches. 0 means 50.

FindResponse#

Response for AccessibilityService.Find.

Field#TypeDescription
snapshot_id1stringSnapshot id for later Act calls.
nodes2repeated AccessibilityNodeMatching elements (their parent_id refers to elements not necessarily included).

ElementRef#

Reference to an element within a snapshot.

Field#TypeDescription
snapshot_id1stringSnapshot the element id came from.
element_id2stringElement id.

ActRequest#

Request for AccessibilityService.Act.

Field#TypeDescription
element1ElementRefWhich element.
action2AccessibilityActionWhich action.
value3stringNew value for ACCESSIBILITY_ACTION_SET_VALUE.
custom_action4stringNative action name for ACCESSIBILITY_ACTION_CUSTOM.
delivery5DeliveryDelivery mode. Accessibility actions are background-safe on most platforms; DELIVERY_FOREGROUND activates the window first.

ActResponse#

Response for AccessibilityService.Act.

Field#TypeDescription
report1DeliveryReportWhat actually happened.

AccessibilityAction#

Accessibility action.

Value#Description
ACCESSIBILITY_ACTION_UNSPECIFIED0Not set. Rejected.
ACCESSIBILITY_ACTION_PRESS1Press / invoke / click.
ACCESSIBILITY_ACTION_FOCUS2Move keyboard focus to the element.
ACCESSIBILITY_ACTION_SET_VALUE3Replace the element's value with ActRequest.value.
ACCESSIBILITY_ACTION_INCREMENT4Increment (sliders, steppers).
ACCESSIBILITY_ACTION_DECREMENT5Decrement.
ACCESSIBILITY_ACTION_SHOW_MENU6Open the element's context menu.
ACCESSIBILITY_ACTION_EXPAND7Expand (tree items, disclosure triangles, combo boxes).
ACCESSIBILITY_ACTION_COLLAPSE8Collapse.
ACCESSIBILITY_ACTION_SELECT9Select (list items, tabs).
ACCESSIBILITY_ACTION_SCROLL_INTO_VIEW10Scroll the element into view.
ACCESSIBILITY_ACTION_CUSTOM11A platform-specific action named by ActRequest.custom_action.