Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(cua-driver)!: publish Vertex-compatible tool input schemas (#4888)

injaneity9f78f0e4f598
diff --git a/docs/content/docs/cua-driver/reference/cli/config.mdx b/docs/content/docs/cua-driver/reference/cli/config.mdx
index ee6b5c412d..657b3783da 100644
--- a/docs/content/docs/cua-driver/reference/cli/config.mdx
+++ b/docs/content/docs/cua-driver/reference/cli/config.mdx
@@ -97,7 +97,7 @@ cua-driver config get max_image_dimension
Set one config key.
-Cursor motion defaults are saved keys that apply to sessions started afterwards: cursor.motion.style (signature_arc, spring_settle, magnetic, comet_swoop, adaptive, classic), cursor.motion.timing (native, fitts, fixed) and cursor.motion.effects.<trail|glow|magnet|ripple|squish> (true, false). Use null for a key to clear it, or cursor.motion null to clear all. A start_session cursor_motion or a set_agent_cursor_motion call overrides the saved default.
+Cursor motion defaults are saved keys that apply to sessions started afterwards: cursor.motion.style (signature_arc, spring_settle, magnetic, comet_swoop, adaptive, classic), cursor.motion.timing (native, fitts, fixed) and cursor.motion.effects.<trail|glow|magnet|ripple|squish> (on, off, default). Use default for a key to clear it, or cursor.motion default to clear all. A start_session cursor_motion or a set_agent_cursor_motion call overrides the saved default.
```text output
cua-driver config set <key> <value>
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/agent-cursor.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/agent-cursor.mdx
index 3e4014dd18..f01f5422b8 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/agent-cursor.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/agent-cursor.mdx
@@ -47,12 +47,12 @@ Effect: mutating, idempotent. Platforms: macOS, Linux, Windows.
| <span id="set_agent_cursor_motion--arc_flow"></span>`arc_flow` | `number` | | Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`: positive moves the apex toward the destination. Clamped to -1..1 (default 0). |
| <span id="set_agent_cursor_motion--arc_size"></span>`arc_size` | `number` | | Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default) keeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1. |
| <span id="set_agent_cursor_motion--dwell_after_click_ms"></span>`dwell_after_click_ms` | `number` | | Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80). |
-| <span id="set_agent_cursor_motion--effects"></span>`effects` | `object` | | Turn single effects on or off. An omitted effect keeps its current setting; null restores the style's default. |
-| <span id="set_agent_cursor_motion--effects-glow"></span>`effects.glow` | `boolean` | | Soft glow around the cursor that grows with speed. |
-| <span id="set_agent_cursor_motion--effects-magnet"></span>`effects.magnet` | `boolean` | | Target glow when the `magnetic` style locks on. |
-| <span id="set_agent_cursor_motion--effects-ripple"></span>`effects.ripple` | `boolean` | | Ring that expands from the hotspot on click. |
-| <span id="set_agent_cursor_motion--effects-squish"></span>`effects.squish` | `boolean` | | Brief scale-down of the cursor on click. |
-| <span id="set_agent_cursor_motion--effects-trail"></span>`effects.trail` | `boolean` | | Short fading trail behind the cursor. |
+| <span id="set_agent_cursor_motion--effects"></span>`effects` | `object` | | Turn effects on or off. Omit a field to keep it; `"default"` restores the style default. |
+| <span id="set_agent_cursor_motion--effects-glow"></span>`effects.glow` | `"on" \| "off" \| "default"` | | Soft glow around the cursor that grows with speed. |
+| <span id="set_agent_cursor_motion--effects-magnet"></span>`effects.magnet` | `"on" \| "off" \| "default"` | | Target glow when the `magnetic` style locks on. |
+| <span id="set_agent_cursor_motion--effects-ripple"></span>`effects.ripple` | `"on" \| "off" \| "default"` | | Ring that expands from the hotspot on click. |
+| <span id="set_agent_cursor_motion--effects-squish"></span>`effects.squish` | `"on" \| "off" \| "default"` | | Brief scale-down of the cursor on click. |
+| <span id="set_agent_cursor_motion--effects-trail"></span>`effects.trail` | `"on" \| "off" \| "default"` | | Short fading trail behind the cursor. |
| <span id="set_agent_cursor_motion--end_handle"></span>`end_handle` | `number` | | Arc control-point offset from the end, as a fraction of the distance, for `signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3). |
| <span id="set_agent_cursor_motion--glide_duration_ms"></span>`glide_duration_ms` | `number` | | Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A nonzero value with `native` timing also fixes the duration. Clamped to 0..5000. |
| <span id="set_agent_cursor_motion--idle_hide_ms"></span>`idle_hide_ms` | `number` | | Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to 0..60000 (default 15000). |
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/batch.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/batch.mdx
index fcb71e5808..3277e70a0c 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/batch.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/batch.mdx
@@ -31,7 +31,7 @@ Served by `cua-driver mcp`; see [MCP tools](/cua-driver/reference/mcp-tools) for
## `run_steps`
-The default way to act: run one or more action tools in ONE call, in order, stop at the first failure, and (with `observe`) get what changed in the same response. Use it whenever you know the next action(s) and would otherwise re-read the window after them: fill three fields, click, and see the result in one call instead of five. Even a single step plus `observe:true` replaces an action call followed by a get_window_state call. Each step is `{tool, args}` where `tool` is one of click, double_click, right_click, set_value, type_text, press_key, hotkey, scroll, drag, move_cursor and `args` are exactly that tool's arguments. `pid` and `window_id` (or `app`/`window`) on run_steps itself are the default window of every step that names none. Reads (get_window_state, zoom) do not run between steps: one there is skipped; a get_window_state last is the `observe`, a zoom last runs after it. Every step goes through the same session, permission and approval checks as a direct call; a batch grants nothing extra. All steps are validated before the first one runs, so a malformed step 4 changes nothing. Element tokens and element_index values come from a get_window_state read before the batch; a step that changes the UI can invalidate later element targets, so put element-targeted actions before the actions that reshuffle the window, or target later steps by role/name. A token that went stale is retried once on the element with the same role and label, if exactly one matches.
+The default way to act: run one or more action tools in ONE call, in order, stop at the first failure, and (with `observe`) get what changed in the same response. Use it whenever you know the next action(s) and would otherwise re-read the window after them: fill three fields, click, and see the result in one call instead of five. Even a single step plus `observe:{}` replaces an action call followed by a get_window_state call. Each step is `{tool, args}` where `tool` is one of click, double_click, right_click, set_value, type_text, press_key, hotkey, scroll, drag, move_cursor and `args` are exactly that tool's arguments. `pid` and `window_id` (or `app`/`window`) on run_steps itself are the default window of every step that names none. Reads (get_window_state, zoom) do not run between steps: one there is skipped; a get_window_state last is the `observe`, a zoom last runs after it. Every step goes through the same session, permission and approval checks as a direct call; a batch grants nothing extra. All steps are validated before the first one runs, so a malformed step 4 changes nothing. Element tokens and element_index values come from a get_window_state read before the batch; a step that changes the UI can invalidate later element targets, so put element-targeted actions before the actions that reshuffle the window, or target later steps by role/name. A token that went stale is retried once on the element with the same role and label, if exactly one matches.
Returns per-step status (`ok` or the error message) and, when `observe` is given, ONE bounded get_window_state read after the last executed step (after a failure caused by a dialog holding focus, that dialog is read, even without `observe`). A step refused because its app ignores background input says how to re-send it; `foreground_fallback:true` retries such steps in the foreground once (the window is activated). That read is a `since:"latest"` diff by default: only the rows that changed since your last read of the window, plus a new snapshot_id. Without `observe` nothing is read. The batch uses one session: steps may omit `session` or repeat the batch's. `delay_ms` pauses between steps (max 2000). At most 64 steps; `delivery_mode` on run_steps is the default for its steps.
@@ -40,7 +40,7 @@ TARGET BY NAME (no earlier read needed, so one batch can cross screens): a step
WAITS AND CHECKS: a step may add `wait_for` (checked before its action) and `expect` (one check or up to 4, checked after it); a step may also be only a check. A check is &#123;role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?&#125;: `text` matches any row of the tree, static text included; `gone:true` waits for it to disappear. Checks poll until they hold or time out (wait_for 5 s, expect 2 s, max 10 s), and a check that does not hold fails the step with what was found instead. The report says which step failed, in which phase (wait_for, find, action, expect) and why. Whole batch: at most 60 s.
Example (fill a form, submit, confirm the dialog, check the result):
-&#123;"steps":[&#123;"set_value":&#123;"app":"Safari","role":"textfield","name":"Email","value":"[email protected]"&#125;&#125;,&#123;"click":&#123;"role":"button","name":"Submit"&#125;,"expect":&#123;"role":"button","name":"Confirm"&#125;&#125;,&#123;"click":&#123;"role":"button","name":"Confirm"&#125;,"expect":[&#123;"name":"Confirm","gone":true&#125;,&#123;"text":"Thanks"&#125;]&#125;],"observe":true&#125;.
+&#123;"steps":[&#123;"set_value":&#123;"app":"Safari","role":"textfield","name":"Email","value":"[email protected]"&#125;&#125;,&#123;"click":&#123;"role":"button","name":"Submit"&#125;,"expect":[&#123;"role":"button","name":"Confirm"&#125;]&#125;,&#123;"click":&#123;"role":"button","name":"Confirm"&#125;,"expect":[&#123;"name":"Confirm","gone":true&#125;,&#123;"text":"Thanks"&#125;]&#125;],"observe":&#123;&#125;&#125;.
Effect: destructive. Platforms: macOS, Linux, Windows.
@@ -50,7 +50,7 @@ Effect: destructive. Platforms: macOS, Linux, Windows.
| <span id="run_steps--delay_ms"></span>`delay_ms` | `integer` | | Pause between steps in milliseconds (not after the last). Default 0. Range: 0 to 2000. |
| <span id="run_steps--delivery_mode"></span>`delivery_mode` | `"background" \| "foreground"` | | Default delivery_mode for steps whose tool takes one and that set none. |
| <span id="run_steps--foreground_fallback"></span>`foreground_fallback` | `boolean` | | When a step is refused because its target ignores background input (Electron, LibreOffice and other toolkits), retry it once with delivery_mode:"foreground": the window is activated and the pointer may move. Default false. |
-| <span id="run_steps--observe"></span>`observe` | `object \| boolean` | | Optional end-of-batch observation: `true`, or arguments for ONE get_window_state call. `pid` and `window_id` default to those of the last step that names both. Defaults to since="latest" (only what changed since your last read of that window with the same query/max_elements/max_depth; a full read when there is none), include_screenshot=false and max_elements=250; pass include_screenshot=true to see the window, or since=null for a full read. Omit to read nothing. |
+| <span id="run_steps--observe"></span>`observe` | `object` | | Optional end-of-batch observation: arguments for ONE get_window_state call. `pid` and `window_id` default to those of the last step that names both. Defaults to since="latest" (only what changed since your last read of that window with the same query/max_elements/max_depth; a full read when there is none), include_screenshot=false and max_elements=250; pass include_screenshot=true to see the window, or since=null for a full read. Omit to read nothing. &#123;&#125; observes the last window. |
| <span id="run_steps--pid"></span>`pid` | `integer` | | Default pid for steps that name no window (a step's own pid/window_id/app/window wins). |
| <span id="run_steps--session"></span>`session` | `string` | | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session. |
| <span id="run_steps--steps"></span>`steps` | `object[]` | required | Ordered actions. Execution stops at the first failing step. Each step is &#123;tool, args&#125; or &#123;&lt;tool&gt;: args&#125;, plus optional wait_for / expect / timeout_ms; a step may also be only a wait_for or expect check. Items: 1 to 64. |
@@ -60,7 +60,7 @@ Effect: destructive. Platforms: macOS, Linux, Windows.
**Example arguments**
```json
-{"steps":[{"tool":"click"}]}
+{"steps":[{}]}
```
## `run_script`
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/click.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/click.mdx
index ed3b05916a..a942267747 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/click.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/click.mdx
@@ -120,4 +120,8 @@ Windows-only convenience: `button: "left"|"right"|"middle"` switches the mouse b
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| <span id="click--element_token"></span>`element_token` | `string` | | Element handle `<snapshot_id>:<row>` from get_window_state: row `[11]` of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in `structuredContent.elements[].element_token`). Returns an explicit stale error naming the current snapshots once a newer read supersedes it. |
-| <span id="click--target"></span>`target` | `window target \| desktop target` | | Exact capture/input target selected independently for each action. `display_id="primary"` is the portable desktop target in this release. Platforms that cannot address another display reject it explicitly rather than silently changing coordinate spaces. |
+| <span id="click--target"></span>`target` | `object` | | Exact window (kind "window", with pid and window_id) or desktop (kind "desktop", with display_id). "primary" is the portable desktop target. |
+| <span id="click--target-display_id"></span>`target.display_id` | `string` | | Display id. Required when kind is desktop; use "primary". |
+| <span id="click--target-kind"></span>`target.kind` | `"window" \| "desktop"` | | window requires pid and window_id; desktop requires display_id. |
+| <span id="click--target-pid"></span>`target.pid` | `integer` | | Process id. Required when kind is window. Minimum: 0. |
+| <span id="click--target-window_id"></span>`target.window_id` | `integer` | | Window id from list_windows. Required when kind is window. Minimum: 0. |
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/keyboard.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/keyboard.mdx
index 9edd11b006..018e0ec08f 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/keyboard.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/keyboard.mdx
@@ -93,7 +93,11 @@ Special keys (Return, Escape, arrows, Tab) go through `press_key` / `hotkey`: th
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
-| <span id="type_text--target"></span>`target` | `window target \| desktop target` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="type_text--target"></span>`target` | `object` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="type_text--target-display_id"></span>`target.display_id` | `string` | | Display id. Required when kind is desktop; use "primary". |
+| <span id="type_text--target-kind"></span>`target.kind` | `"window" \| "desktop"` | | window requires pid and window_id; desktop requires display_id. |
+| <span id="type_text--target-pid"></span>`target.pid` | `integer` | | Process id. Required when kind is window. Minimum: 0. |
+| <span id="type_text--target-window_id"></span>`target.window_id` | `integer` | | Window id from list_windows. Required when kind is window. Minimum: 0. |
**Example arguments**
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/keys-and-shortcuts.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/keys-and-shortcuts.mdx
index 7f7d18f7f8..44f20a1452 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/keys-and-shortcuts.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/keys-and-shortcuts.mdx
@@ -99,7 +99,11 @@ Key vocabulary: return, tab, escape, up/down/left/right, space, delete, home, en
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| <span id="press_key--element_token"></span>`element_token` | `string` | | Element handle `<snapshot_id>:<row>` from get_window_state: row `[11]` of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in `structuredContent.elements[].element_token`). Returns an explicit stale error naming the current snapshots once a newer read supersedes it. |
-| <span id="press_key--target"></span>`target` | `window target \| desktop target` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="press_key--target"></span>`target` | `object` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="press_key--target-display_id"></span>`target.display_id` | `string` | | Display id. Required when kind is desktop; use "primary". |
+| <span id="press_key--target-kind"></span>`target.kind` | `"window" \| "desktop"` | | window requires pid and window_id; desktop requires display_id. |
+| <span id="press_key--target-pid"></span>`target.pid` | `integer` | | Process id. Required when kind is window. Minimum: 0. |
+| <span id="press_key--target-window_id"></span>`target.window_id` | `integer` | | Window id from list_windows. Required when kind is window. Minimum: 0. |
**Example arguments**
@@ -189,7 +193,11 @@ Recognized modifiers: ctrl/control, shift, alt, win/windows. Non-modifier keys u
| --- | --- | --- | --- |
| <span id="hotkey--element_token"></span>`element_token` | `string` | | Element handle `<snapshot_id>:<row>` from get_window_state: row `[11]` of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in `structuredContent.elements[].element_token`). Returns an explicit stale error naming the current snapshots once a newer read supersedes it. |
| <span id="hotkey--session"></span>`session` | `string` | | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session. |
-| <span id="hotkey--target"></span>`target` | `window target \| desktop target` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="hotkey--target"></span>`target` | `object` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="hotkey--target-display_id"></span>`target.display_id` | `string` | | Display id. Required when kind is desktop; use "primary". |
+| <span id="hotkey--target-kind"></span>`target.kind` | `"window" \| "desktop"` | | window requires pid and window_id; desktop requires display_id. |
+| <span id="hotkey--target-pid"></span>`target.pid` | `integer` | | Process id. Required when kind is window. Minimum: 0. |
+| <span id="hotkey--target-window_id"></span>`target.window_id` | `integer` | | Window id from list_windows. Required when kind is window. Minimum: 0. |
**Example arguments**
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/maintenance.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/maintenance.mdx
index d5eb619f97..1cdbca8dc5 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/maintenance.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/maintenance.mdx
@@ -85,40 +85,30 @@ Cursor motion defaults: cursor.motion.style, cursor.motion.timing and cursor.mot
| --- | --- | --- | --- |
| <span id="set_config--macos--experimental_pip"></span>`experimental_pip` | `boolean` | | Enable the experimental picture-in-picture preview window. Applies on next daemon restart. |
| <span id="set_config--macos--experimental_pip_geometry"></span>`experimental_pip_geometry` | `string` | | PiP window size + optional position in `WxH` or `WxH+X+Y` form (e.g. `320x200+24+24`). Applies on next daemon restart. |
-| <span id="set_config--macos--key"></span>`key` | `string` | | Name of a single config field to write (&#123;key, value&#125; shape, matching the CLI `config set` and the Windows/Linux tools). Pair with `value`. Equivalent to passing the field directly. |
-| <span id="set_config--macos--max_image_dimension"></span>`max_image_dimension` | `integer` | | Max dimension for screenshot resizing (0 = no limit). |
</Tab>
<Tab value="Linux">
Update cua-driver-rs configuration. capture_mode / max_image_dimension take effect immediately.
-Two input shapes (both accepted, matching Windows/Swift):
-- **&#123;key, value&#125;** (preferred): `{"key": "max_image_dimension", "value": 800}`; single leaf write.
-- **Legacy per-field**: `{"capture_mode": "som", "max_image_dimension": 0}`.
+Pass each setting as its own field: `{"capture_mode": "som", "max_image_dimension": 0}`.
The experimental_pip keys persist to ~/.cua-driver/config.json and apply on next daemon restart (the PiP backend is initialised once at startup; Linux ships only the trait stub today: see issue #1729).
-`cursor.motion.style`, `cursor.motion.timing` and `cursor.motion.effects.<name>` save the default cursor motion for sessions started afterwards.
+`cursor.motion.style`, `cursor.motion.timing` and `cursor.motion.effects.<name>` (`on`, `off`, or `default`) save the default cursor motion for sessions started afterwards. `cursor.motion: "default"` clears every saved cursor motion default.
**Linux parameters**
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
-| <span id="set_config--linux--capture_mode"></span>`capture_mode` | `"ax" \| "vision"` | | Legacy per-field shape. Default capture mode for get_window_state. ("som"/"screenshot" still decode as deprecated aliases.). |
+| <span id="set_config--linux--capture_mode"></span>`capture_mode` | `"ax" \| "vision"` | | Default capture mode for get_window_state. ("som"/"screenshot" still decode as deprecated aliases.). |
| <span id="set_config--linux--experimental_pip"></span>`experimental_pip` | `boolean` | | Enable the experimental PiP preview window (applies next restart; Linux backend stubbed). |
| <span id="set_config--linux--experimental_pip_geometry"></span>`experimental_pip_geometry` | `string` | | PiP window size + optional position in `WxH` or `WxH+X+Y` form. |
-| <span id="set_config--linux--key"></span>`key` | `string` | | Name of a single config field to write (&#123;key, value&#125; shape). Pair with `value`. |
-| <span id="set_config--linux--max_image_dimension"></span>`max_image_dimension` | `integer` | | Legacy per-field shape. Max dimension for screenshot resizing (0 = no limit). |
</Tab>
<Tab value="Windows">
-Write a setting into the persistent driver config. Values take effect immediately.
-
-Two input shapes:
-- **Swift-compatible** (preferred): `{"key": "max_image_dimension", "value": 1568}`; single dotted-path leaf write.
-- **Legacy per-field** (Rust-only): `{"max_image_dimension": 0}`; bulk write of named fields.
+Write a setting into the persistent driver config. Values take effect immediately. Pass each setting as its own field.
Known keys:
- `capture_mode` (string: `vision` | `ax` | `som`); DEPRECATED and ignored; `get_window_state` always returns both the UIA tree and a screenshot. Still accepted/persisted for back-compat but has no effect.
@@ -126,7 +116,7 @@ Known keys:
- `experimental_pip` (boolean; persisted to config.json, applies on next daemon restart: Windows backend stubbed today, see issue #1729)
- `experimental_pip_geometry` (string `WxH` or `WxH+X+Y`; persisted; applies on next daemon restart)
-- `cursor.motion.style`, `cursor.motion.timing`, `cursor.motion.effects.<name>`: saved default cursor motion for sessions started afterwards (see the cursor docs).
+- `cursor.motion.style`, `cursor.motion.timing`, `cursor.motion.effects.<name>` (`on`, `off`, or `default`): saved default cursor motion for sessions started afterwards. `cursor.motion: "default"` clears every saved cursor motion default.
Returns the full updated config in the same shape as `get_config`.
@@ -135,10 +125,8 @@ Returns the full updated config in the same shape as `get_config`.
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| <span id="set_config--windows--capture_mode"></span>`capture_mode` | `"ax" \| "vision"` | | DEPRECATED and ignored: get_window_state always returns both the UIA tree and a screenshot. Still accepted/persisted for back-compat but has no effect. ("som"/"screenshot" still decode as deprecated aliases.). |
-| <span id="set_config--windows--experimental_pip"></span>`experimental_pip` | `boolean` | | Legacy per-field shape. Enables PiP preview (applies next restart). |
-| <span id="set_config--windows--experimental_pip_geometry"></span>`experimental_pip_geometry` | `string` | | Legacy per-field shape. PiP window size + optional position. |
-| <span id="set_config--windows--key"></span>`key` | `string` | | Dotted snake_case path to a leaf config field (Swift-compatible shape). Pair with `value`. |
-| <span id="set_config--windows--max_image_dimension"></span>`max_image_dimension` | `integer` | | Legacy per-field shape. |
+| <span id="set_config--windows--experimental_pip"></span>`experimental_pip` | `boolean` | | Enables PiP preview (applies next restart). |
+| <span id="set_config--windows--experimental_pip_geometry"></span>`experimental_pip_geometry` | `string` | | PiP window size + optional position. |
</Tab>
</Tabs>
@@ -147,16 +135,16 @@ Returns the full updated config in the same shape as `get_config`.
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
-| <span id="set_config--cursor-motion"></span>`cursor.motion` | `any` | | Pass null (or `default`) to clear every saved cursor motion default. |
-| <span id="set_config--cursor-motion-effects-glow"></span>`cursor.motion.effects.glow` | `boolean` | | Saved default for the `glow` cursor effect. Unset follows the style. |
-| <span id="set_config--cursor-motion-effects-magnet"></span>`cursor.motion.effects.magnet` | `boolean` | | Saved default for the `magnet` cursor effect. Unset follows the style. |
-| <span id="set_config--cursor-motion-effects-ripple"></span>`cursor.motion.effects.ripple` | `boolean` | | Saved default for the `ripple` cursor effect. Unset follows the style. |
-| <span id="set_config--cursor-motion-effects-squish"></span>`cursor.motion.effects.squish` | `boolean` | | Saved default for the `squish` cursor effect. Unset follows the style. |
-| <span id="set_config--cursor-motion-effects-trail"></span>`cursor.motion.effects.trail` | `boolean` | | Saved default for the `trail` cursor effect. Unset follows the style. |
+| <span id="set_config--cursor-motion"></span>`cursor.motion` | `"default"` | | Pass `default` to clear every saved cursor motion default. |
+| <span id="set_config--cursor-motion-effects-glow"></span>`cursor.motion.effects.glow` | `"on" \| "off" \| "default"` | | Saved default for the `glow` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged. |
+| <span id="set_config--cursor-motion-effects-magnet"></span>`cursor.motion.effects.magnet` | `"on" \| "off" \| "default"` | | Saved default for the `magnet` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged. |
+| <span id="set_config--cursor-motion-effects-ripple"></span>`cursor.motion.effects.ripple` | `"on" \| "off" \| "default"` | | Saved default for the `ripple` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged. |
+| <span id="set_config--cursor-motion-effects-squish"></span>`cursor.motion.effects.squish` | `"on" \| "off" \| "default"` | | Saved default for the `squish` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged. |
+| <span id="set_config--cursor-motion-effects-trail"></span>`cursor.motion.effects.trail` | `"on" \| "off" \| "default"` | | Saved default for the `trail` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged. |
| <span id="set_config--cursor-motion-style"></span>`cursor.motion.style` | `"signature_arc" \| "spring_settle" \| "magnetic" \| "comet_swoop" \| "adaptive" \| "classic"` | | Saved default cursor motion style for new sessions. Overridden by start_session cursor_motion and set_agent_cursor_motion; reduced motion always wins. Built-in default: signature_arc. |
| <span id="set_config--cursor-motion-timing"></span>`cursor.motion.timing` | `"native" \| "fitts" \| "fixed"` | | Saved default cursor move timing for new sessions. |
+| <span id="set_config--max_image_dimension"></span>`max_image_dimension` | `integer` | | Max dimension for screenshot resizing (0 = no limit). |
| <span id="set_config--session"></span>`session` | `string` | | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session. |
-| <span id="set_config--value"></span>`value` | `any` | | New value for `key`. JSON type depends on the key. |
## `check_permissions`
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/pointer.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/pointer.mdx
index 92b4797795..193e8b2904 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/pointer.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/pointer.mdx
@@ -117,7 +117,11 @@ Press-drag-release gesture from (from_x, from_y) to (to_x, to_y) in window-local
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| <span id="drag--session"></span>`session` | `string` | | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session. |
-| <span id="drag--target"></span>`target` | `window target \| desktop target` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="drag--target"></span>`target` | `object` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="drag--target-display_id"></span>`target.display_id` | `string` | | Display id. Required when kind is desktop; use "primary". |
+| <span id="drag--target-kind"></span>`target.kind` | `"window" \| "desktop"` | | window requires pid and window_id; desktop requires display_id. |
+| <span id="drag--target-pid"></span>`target.pid` | `integer` | | Process id. Required when kind is window. Minimum: 0. |
+| <span id="drag--target-window_id"></span>`target.window_id` | `integer` | | Window id from list_windows. Required when kind is window. Minimum: 0. |
**Example arguments**
@@ -206,7 +210,11 @@ Note: `element_token` is accepted for cross-platform parity but currently no-op
| <span id="scroll--by"></span>`by` | `"line" \| "page"` | | Scroll granularity. Default: line. |
| <span id="scroll--direction"></span>`direction` | `"up" \| "down" \| "left" \| "right"` | required | Scroll direction. |
| <span id="scroll--element_token"></span>`element_token` | `string` | | Element handle `<snapshot_id>:<row>` from get_window_state: row `[11]` of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in `structuredContent.elements[].element_token`). Returns an explicit stale error naming the current snapshots once a newer read supersedes it. |
-| <span id="scroll--target"></span>`target` | `window target \| desktop target` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="scroll--target"></span>`target` | `object` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="scroll--target-display_id"></span>`target.display_id` | `string` | | Display id. Required when kind is desktop; use "primary". |
+| <span id="scroll--target-kind"></span>`target.kind` | `"window" \| "desktop"` | | window requires pid and window_id; desktop requires display_id. |
+| <span id="scroll--target-pid"></span>`target.pid` | `integer` | | Process id. Required when kind is window. Minimum: 0. |
+| <span id="scroll--target-window_id"></span>`target.window_id` | `integer` | | Window id from list_windows. Required when kind is window. Minimum: 0. |
**Example arguments**
@@ -263,7 +271,11 @@ Move the agent cursor overlay to (x, y). Does NOT move the real mouse cursor.
| --- | --- | --- | --- |
| <span id="move_cursor--cursor_id"></span>`cursor_id` | `string` | | Cursor instance to move. Default: 'default'. |
| <span id="move_cursor--session"></span>`session` | `string` | | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session. |
-| <span id="move_cursor--target"></span>`target` | `window target \| desktop target` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="move_cursor--target"></span>`target` | `object` | | Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the primary desktop (`kind="desktop"`, `display_id="primary"`). |
+| <span id="move_cursor--target-display_id"></span>`target.display_id` | `string` | | Display id. Required when kind is desktop; use "primary". |
+| <span id="move_cursor--target-kind"></span>`target.kind` | `"window" \| "desktop"` | | window requires pid and window_id; desktop requires display_id. |
+| <span id="move_cursor--target-pid"></span>`target.pid` | `integer` | | Process id. Required when kind is window. Minimum: 0. |
+| <span id="move_cursor--target-window_id"></span>`target.window_id` | `integer` | | Window id from list_windows. Required when kind is window. Minimum: 0. |
| <span id="move_cursor--y"></span>`y` | `number` | required | Destination Y, in the same space as x. |
**Example arguments**
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/sessions.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/sessions.mdx
index b0b0f870f0..212109b924 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/sessions.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/sessions.mdx
@@ -34,7 +34,7 @@ Effect: mutating, idempotent. Platforms: macOS, Linux, Windows.
| <span id="start_session--cursor_motion-arc_flow"></span>`cursor_motion.arc_flow` | `number` | | Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`: positive moves the apex toward the destination. Clamped to -1..1 (default 0). |
| <span id="start_session--cursor_motion-arc_size"></span>`cursor_motion.arc_size` | `number` | | Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default) keeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1. |
| <span id="start_session--cursor_motion-dwell_after_click_ms"></span>`cursor_motion.dwell_after_click_ms` | `number` | | Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80). |
-| <span id="start_session--cursor_motion-effects"></span>`cursor_motion.effects` | `object` | | Turn single effects on or off. An omitted effect keeps its current setting; null restores the style's default. |
+| <span id="start_session--cursor_motion-effects"></span>`cursor_motion.effects` | `object` | | Turn effects on or off. Omit a field to keep it; `"default"` restores the style default. |
| <span id="start_session--cursor_motion-end_handle"></span>`cursor_motion.end_handle` | `number` | | Arc control-point offset from the end, as a fraction of the distance, for `signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3). |
| <span id="start_session--cursor_motion-glide_duration_ms"></span>`cursor_motion.glide_duration_ms` | `number` | | Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A nonzero value with `native` timing also fixes the duration. Clamped to 0..5000. |
| <span id="start_session--cursor_motion-idle_hide_ms"></span>`cursor_motion.idle_hide_ms` | `number` | | Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to 0..60000 (default 15000). |
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/values-and-clipboard.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/values-and-clipboard.mdx
index aaa7e9a5cc..c892b34ce2 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/values-and-clipboard.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/values-and-clipboard.mdx
@@ -50,7 +50,7 @@ Set value of an AT-SPI element via SetValue action.
| --- | --- | --- | --- |
| <span id="set_value--linux--delivery_mode"></span>`delivery_mode` | `"background" \| "foreground"` | `"background"` | Input delivery mode. 'background' (default) never activates or raises the target window. On X11 it injects via XTEST / the XInput2 master pointer (no focus steal). On Wayland it goes through libei + xdg-desktop-portal, which injects to the compositor's input focus: Wayland's security model has no per-window background targeting, so a specific non-focused window cannot be aimed at; when no libei backend is available the tool returns a structured background_unavailable error. 'foreground' is the explicit escalation: activate the target (X11 _NET_ACTIVE_WINDOW; Wayland compositor activate), inject, then restore the prior active window; a brief focus swap unless the target was already active. Matches the macOS / Windows delivery_mode surface. |
| <span id="set_value--linux--session"></span>`session` | `string` | | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session. |
-| <span id="set_value--linux--value"></span>`value` | `string \| number` | required | New value. Written through AT-SPI EditableText/Value when the element exposes them; otherwise (GTK2 spin scales, VCL spin buttons) the field is clicked with the session's real pointer, its text selected and replaced through the virtual keyboard and committed with Tab, then read back. |
+| <span id="set_value--linux--value"></span>`value` | `string` | required | New value. Written through AT-SPI EditableText/Value when the element exposes them; otherwise (GTK2 spin scales, VCL spin buttons) the field is clicked with the session's real pointer, its text selected and replaced through the virtual keyboard and committed with Tab, then read back. |
| <span id="set_value--linux--window_id"></span>`window_id` | `integer` | | Omit when element_token is supplied (the token carries it). |
</Tab>
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/window-state.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/window-state.mdx
index fc8d796023..2513769efa 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/window-state.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/window-state.mdx
@@ -223,7 +223,7 @@ Effect: read-only, idempotent. Platforms: macOS, Linux, Windows.
| --- | --- | --- | --- |
| <span id="parse_visual_regions--capture_id"></span>`capture_id` | `string` | required | `capture_id` of a screenshot returned by get_window_state or get_desktop_state. |
| <span id="parse_visual_regions--options"></span>`options` | `object` | `{}` | Optional, model-neutral controls for one bounded parse. |
-| <span id="parse_visual_regions--options-kinds"></span>`options.kinds` | `"text" \| "icon"[]` | | Region kinds to return (`text`, `icon`). Omit for all kinds. |
+| <span id="parse_visual_regions--options-kinds"></span>`options.kinds` | `"text" \| "icon"[]` | | Region kinds to return (`text`, `icon`). Omit for all kinds. Items: 1 to 2. |
| <span id="parse_visual_regions--options-max_regions"></span>`options.max_regions` | `integer` | | Return at most this many regions. Minimum: 1. |
| <span id="parse_visual_regions--options-min_confidence"></span>`options.min_confidence` | `number` | | Drop regions below this confidence (0 to 1). Range: 0 to 1. |
| <span id="parse_visual_regions--session"></span>`session` | `string` | | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session. |
diff --git a/libs/cua-driver/contract/manifest.json b/libs/cua-driver/contract/manifest.json
index 80d7ca449f..fcc4a8a0a2 100644
--- a/libs/cua-driver/contract/manifest.json
+++ b/libs/cua-driver/contract/manifest.json
@@ -33,46 +33,8 @@
},
"input_schema": {
"additionalProperties": false,
- "oneOf": [
- {
- "not": {
- "required": [
- "element_token"
- ]
- },
- "required": [
- "x",
- "y"
- ]
- },
- {
- "not": {
- "anyOf": [
- {
- "required": [
- "x"
- ]
- },
- {
- "required": [
- "y"
- ]
- },
- {
- "required": [
- "capture_id"
- ]
- }
- ]
- },
- "required": [
- "element_token"
- ]
- }
- ],
"properties": {
"button": {
- "default": null,
"enum": [
"left",
"right",
@@ -81,12 +43,10 @@
"type": "string"
},
"capture_id": {
- "default": null,
"minLength": 1,
"type": "string"
},
"count": {
- "default": null,
"maximum": 3,
"minimum": 1,
"type": "integer"
@@ -99,66 +59,49 @@
"type": "string"
},
"element_token": {
- "default": null,
"pattern": "^s[0-9a-f]{8}:[0-9]+$",
"type": "string"
},
"session": {
- "default": null,
"description": "For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.",
"type": "string"
},
"target": {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
+ "additionalProperties": true,
+ "description": "Exact window (kind \"window\", with pid and window_id) or desktop (kind \"desktop\", with display_id). \"primary\" is the portable desktop target.",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
],
- "type": "object"
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
- ]
+ },
+ "required": [
+ "kind"
+ ],
+ "type": "object"
},
"x": {
- "default": null,
"type": "number"
},
"y": {
- "default": null,
"type": "number"
}
},
@@ -522,8 +465,11 @@
"type": "array"
},
"scope": {
- "const": "desktop",
- "description": "Deprecated flat desktop target retained for wire compatibility."
+ "description": "Deprecated flat desktop target retained for wire compatibility.",
+ "enum": [
+ "desktop"
+ ],
+ "type": "string"
},
"session": {
"description": "For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.",
@@ -535,57 +481,36 @@
"type": "integer"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"to_x": {
"type": "number"
@@ -2077,65 +2002,47 @@
"type": "array"
},
"scope": {
- "const": "desktop",
- "description": "Deprecated flat desktop target retained for wire compatibility."
+ "description": "Deprecated flat desktop target retained for wire compatibility.",
+ "enum": [
+ "desktop"
+ ],
+ "type": "string"
},
"session": {
"description": "For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.",
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
}
},
"required": [
@@ -2615,10 +2522,7 @@
"limit": {
"description": "Maximum number of content-free summaries to return (default 50, max\n100). Ordinary agent transports are scoped to their own lease.",
"minimum": 0,
- "type": [
- "integer",
- "null"
- ]
+ "type": "integer"
}
},
"required": [],
@@ -2900,65 +2804,47 @@
"additionalProperties": false,
"properties": {
"scope": {
- "const": "desktop",
- "description": "Deprecated flat desktop target retained for wire compatibility."
+ "description": "Deprecated flat desktop target retained for wire compatibility.",
+ "enum": [
+ "desktop"
+ ],
+ "type": "string"
},
"session": {
"description": "For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.",
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"x": {
"description": "Destination X: window-local screenshot pixels for a window target, native\nget_desktop_state screenshot pixels for the desktop.",
@@ -3159,25 +3045,18 @@
"description": "Optional, model-neutral controls for one bounded parse.",
"properties": {
"kinds": {
- "anyOf": [
- {
- "items": {
- "enum": [
- "text",
- "icon"
- ]
- },
- "maxItems": 2,
- "minItems": 1,
- "type": "array",
- "uniqueItems": true
- },
- {
- "type": "null"
- }
- ],
- "description": "Region kinds to return (`text`, `icon`). Omit for all kinds."
- },
+ "description": "Region kinds to return (`text`, `icon`). Omit for all kinds.",
+ "items": {
+ "enum": [
+ "text",
+ "icon"
+ ],
+ "type": "string"
+ },
+ "maxItems": 2,
+ "minItems": 1,
+ "type": "array"
+ },
"max_regions": {
"description": "Return at most this many regions.",
"minimum": 1,
@@ -3652,65 +3531,47 @@
"type": "array"
},
"scope": {
- "const": "desktop",
- "description": "Deprecated flat desktop target retained for wire compatibility."
+ "description": "Deprecated flat desktop target retained for wire compatibility.",
+ "enum": [
+ "desktop"
+ ],
+ "type": "string"
},
"session": {
"description": "For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.",
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
}
},
"required": [
@@ -3912,65 +3773,47 @@
"type": "string"
},
"scope": {
- "const": "desktop",
- "description": "Deprecated flat desktop target retained for wire compatibility."
+ "description": "Deprecated flat desktop target retained for wire compatibility.",
+ "enum": [
+ "desktop"
+ ],
+ "type": "string"
},
"session": {
"description": "For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.",
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"x": {
"type": "number"
@@ -4209,90 +4052,80 @@
"properties": {
"arc_flow": {
"description": "Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`:\npositive moves the apex toward the destination. Clamped to -1..1 (default 0).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"arc_size": {
"description": "Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default)\nkeeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"dwell_after_click_ms": {
"description": "Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"effects": {
"additionalProperties": false,
- "description": "Turn single effects on or off. An omitted effect keeps its current setting; null\nrestores the style's default.",
+ "description": "Turn effects on or off. Omit a field to keep it; `\"default\"` restores the style default.",
"properties": {
"glow": {
"description": "Soft glow around the cursor that grows with speed.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"magnet": {
"description": "Target glow when the `magnetic` style locks on.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"ripple": {
"description": "Ring that expands from the hotspot on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"squish": {
"description": "Brief scale-down of the cursor on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"trail": {
"description": "Short fading trail behind the cursor.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"end_handle": {
"description": "Arc control-point offset from the end, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"glide_duration_ms": {
"description": "Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A\nnonzero value with `native` timing also fixes the duration. Clamped to 0..5000.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"idle_hide_ms": {
"description": "Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to\n0..60000 (default 15000).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"session": {
"description": "Public label of the session that owns the cursor. Omitted or null motion fields keep\ntheir current value.",
@@ -4300,17 +4133,11 @@
},
"spring": {
"description": "Arrival spring damping for `classic`: 1 is critically damped, 0.3 is bouncy. Clamped\nto 0.3..1 (default 0.72).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"start_handle": {
"description": "Arc control-point offset from the start, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"style": {
"description": "Trajectory style. `signature_arc` (default) is one arc with a small follow-through;\n`spring_settle` lands with one soft bounce; `magnetic` is pulled into the target;\n`comet_swoop` is a wide arc with a short trail; `adaptive` picks a careful approach for\nsmall targets and a swoop for long moves; `classic` is the previous Dubins glide. When\nthe theme's reduced motion is on, every move is a short straight glide with no effects.",
@@ -4335,10 +4162,7 @@
},
"turn_radius": {
"description": "Minimum turning radius of the `classic` glide path, in points; smaller turns tighter.\nClamped to 1..1000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
}
},
"required": [
@@ -4807,104 +4631,88 @@
"properties": {
"arc_flow": {
"description": "Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`:\npositive moves the apex toward the destination. Clamped to -1..1 (default 0).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"arc_size": {
"description": "Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default)\nkeeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"dwell_after_click_ms": {
"description": "Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"effects": {
"additionalProperties": false,
- "description": "Turn single effects on or off. An omitted effect keeps its current setting; null\nrestores the style's default.",
+ "description": "Turn effects on or off. Omit a field to keep it; `\"default\"` restores the style default.",
"properties": {
"glow": {
"description": "Soft glow around the cursor that grows with speed.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"magnet": {
"description": "Target glow when the `magnetic` style locks on.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"ripple": {
"description": "Ring that expands from the hotspot on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"squish": {
"description": "Brief scale-down of the cursor on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"trail": {
"description": "Short fading trail behind the cursor.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"end_handle": {
"description": "Arc control-point offset from the end, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"glide_duration_ms": {
"description": "Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A\nnonzero value with `native` timing also fixes the duration. Clamped to 0..5000.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"idle_hide_ms": {
"description": "Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to\n0..60000 (default 15000).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"spring": {
"description": "Arrival spring damping for `classic`: 1 is critically damped, 0.3 is bouncy. Clamped\nto 0.3..1 (default 0.72).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"start_handle": {
"description": "Arc control-point offset from the start, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"style": {
"description": "Trajectory style. `signature_arc` (default) is one arc with a small follow-through;\n`spring_settle` lands with one soft bounce; `magnetic` is pulled into the target;\n`comet_swoop` is a wide arc with a short trail; `adaptive` picks a careful approach for\nsmall targets and a swoop for long moves; `classic` is the previous Dubins glide. When\nthe theme's reduced motion is on, every move is a short straight glide with no effects.",
@@ -4929,18 +4737,14 @@
},
"turn_radius": {
"description": "Minimum turning radius of the `classic` glide path, in points; smaller turns tighter.\nClamped to 1..1000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"cursor_theme": {
+ "additionalProperties": true,
"description": "Optional initial cursor theme. The host applies it before the cursor is\nfirst made visible, avoiding a flash of the default theme.",
"properties": {
"reduced_motion": {
@@ -4959,10 +4763,7 @@
"required": [
"theme_id"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"session": {
"description": "Optional stable public label for this run (e.g. \"research-run-1\").\nWhen omitted, the authenticated transport lease's implicit session is\ncreated or returned.",
@@ -5011,34 +4812,44 @@
"additionalProperties": false,
"properties": {
"glow": {
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"magnet": {
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"ripple": {
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"squish": {
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"trail": {
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
}
},
"type": [
@@ -5195,65 +5006,47 @@
"additionalProperties": false,
"properties": {
"scope": {
- "const": "desktop",
- "description": "Deprecated flat desktop target retained for wire compatibility."
+ "description": "Deprecated flat desktop target retained for wire compatibility.",
+ "enum": [
+ "desktop"
+ ],
+ "type": "string"
},
"session": {
"description": "For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.",
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"text": {
"type": "string"
@@ -5444,20 +5237,14 @@
"additionalProperties": false,
"properties": {
"enabled": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"exists": {
"description": "Assert that at least one trusted element matches the selector.\n\nElement walks are not yet exhaustive on every platform, so absence\ncannot be proven. `false` is rejected instead of returning an\nindefinitely-unknown predicate.",
"type": "boolean"
},
"selected": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"selector": {
"additionalProperties": false,
@@ -5475,19 +5262,13 @@
"type": "object"
},
"value_equals": {
- "type": [
- "string",
- "null"
- ]
+ "type": "string"
}
},
"required": [
"selector"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"window": {
"additionalProperties": false,
@@ -5519,22 +5300,14 @@
"width",
"height"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"exists": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
}
},
"required": [],
@@ -5546,10 +5319,7 @@
},
"include_screenshot": {
"description": "Return the final window screenshot as image content for a multimodal\ncaller. The driver does not interpret that image.",
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"pid": {
"description": "Exact process whose window may be observed.",
diff --git a/libs/cua-driver/docs/cursor-themes.md b/libs/cua-driver/docs/cursor-themes.md
index a6d5f30f3e..2ad4648294 100644
--- a/libs/cua-driver/docs/cursor-themes.md
+++ b/libs/cua-driver/docs/cursor-themes.md
@@ -89,7 +89,7 @@ default), `spring_settle`, `magnetic`, `comet_swoop`, `adaptive`, or `classic`
(the previous Dubins glide). `timing` is `native` (the style's own), `fitts`
(scales with distance and target size), or `fixed` (`glide_duration_ms`, 1430
ms when 0). `effects` turns `trail`, `glow`, `magnet`, `ripple`, and `squish`
-on or off; null restores the style's default. From a shell, `cua-driver cursor
+on, off, or `default` (the style's own setting). Omit an effect to keep its current setting. From a shell, `cua-driver cursor
motion --session <label> --style magnetic` sets the same fields. The removed `set_agent_cursor_style` operation and
its `cursor_id`, shape, color, label, size, opacity, image-path, gradient, and
bloom styling fields are not accepted. Input-delivery tools may still use
diff --git a/libs/cua-driver/python/src/cua_driver/__init__.py b/libs/cua-driver/python/src/cua_driver/__init__.py
index 11e8ee36c7..396819f6af 100644
--- a/libs/cua-driver/python/src/cua_driver/__init__.py
+++ b/libs/cua-driver/python/src/cua_driver/__init__.py
@@ -123,6 +123,7 @@ from ._native_contract import (
ClickButton,
ClickInput,
CursorAction,
+ CursorEffectSetting,
CursorMotionEffects,
CursorMotionStyle,
CursorMotionTiming,
@@ -282,6 +283,7 @@ __all__ = [
"CuaDriver",
"CuaDriverSession",
"CursorAction",
+ "CursorEffectSetting",
"CursorMotionEffects",
"CursorMotionStyle",
"CursorMotionTiming",
diff --git a/libs/cua-driver/python/src/cua_driver/_native_contract.py b/libs/cua-driver/python/src/cua_driver/_native_contract.py
index d269f746ad..a6e5b54bde 100644
--- a/libs/cua-driver/python/src/cua_driver/_native_contract.py
+++ b/libs/cua-driver/python/src/cua_driver/_native_contract.py
@@ -2429,11 +2429,66 @@ class _UniffiFfiConverterTypeClipboardWriteOutput(_UniffiConverterRustBuffer):
_UniffiFfiConverterBoolean.write(value.privacy_sensitive, buf)
_UniffiFfiConverterBoolean.write(value.content_redacted_from_telemetry, buf)
-class _UniffiFfiConverterOptionalBoolean(_UniffiConverterRustBuffer):
+
+
+
+
+
+class CursorEffectSetting(enum.Enum):
+ """
+ One cursor effect: `on`, `off`, or `default` (the style's own setting).
+"""
+
+ ON = 0
+
+ OFF = 1
+
+ DEFAULT = 2
+
+
+
+class _UniffiFfiConverterTypeCursorEffectSetting(_UniffiConverterRustBuffer):
+ @staticmethod
+ def read(buf):
+ variant = buf.read_i32()
+ if variant == 1:
+ return CursorEffectSetting.ON
+ if variant == 2:
+ return CursorEffectSetting.OFF
+ if variant == 3:
+ return CursorEffectSetting.DEFAULT
+ raise InternalError("Raw enum value doesn't match any cases")
+
+ @staticmethod
+ def check_lower(value):
+ if type(value) is bool:
+ value = CursorEffectSetting.ON if value else CursorEffectSetting.OFF
+ if value == CursorEffectSetting.ON:
+ return
+ if value == CursorEffectSetting.OFF:
+ return
+ if value == CursorEffectSetting.DEFAULT:
+ return
+ raise ValueError(value)
+
+ @staticmethod
+ def write(value, buf):
+ if type(value) is bool:
+ value = CursorEffectSetting.ON if value else CursorEffectSetting.OFF
+ if value == CursorEffectSetting.ON:
+ buf.write_i32(1)
+ if value == CursorEffectSetting.OFF:
+ buf.write_i32(2)
+ if value == CursorEffectSetting.DEFAULT:
+ buf.write_i32(3)
+
+
+
+class _UniffiFfiConverterOptionalTypeCursorEffectSetting(_UniffiConverterRustBuffer):
@classmethod
def check_lower(cls, value):
if value is not None:
- _UniffiFfiConverterBoolean.check_lower(value)
+ _UniffiFfiConverterTypeCursorEffectSetting.check_lower(value)
@classmethod
def write(cls, value, buf):
@@ -2442,7 +2497,7 @@ class _UniffiFfiConverterOptionalBoolean(_UniffiConverterRustBuffer):
return
buf.write_u8(1)
- _UniffiFfiConverterBoolean.write(value, buf)
+ _UniffiFfiConverterTypeCursorEffectSetting.write(value, buf)
@classmethod
def read(cls, buf):
@@ -2450,17 +2505,17 @@ class _UniffiFfiConverterOptionalBoolean(_UniffiConverterRustBuffer):
if flag == 0:
return None
elif flag == 1:
- return _UniffiFfiConverterBoolean.read(buf)
+ return _UniffiFfiConverterTypeCursorEffectSetting.read(buf)
else:
raise InternalError("Unexpected flag byte for optional type")
@dataclass
class CursorMotionEffects:
"""
- Per-effect overrides for the agent cursor. Unset fields are omitted on the wire, so they
- keep their current setting.
+ Per-effect overrides for the agent cursor. An omitted field keeps the current setting.
+ `on` and `off` set it; `default` restores the style default.
"""
- def __init__(self, *, trail:typing.Optional[bool], glow:typing.Optional[bool], magnet:typing.Optional[bool], ripple:typing.Optional[bool], squish:typing.Optional[bool]):
+ def __init__(self, *, trail:typing.Optional[typing.Union[CursorEffectSetting, bool]], glow:typing.Optional[typing.Union[CursorEffectSetting, bool]], magnet:typing.Optional[typing.Union[CursorEffectSetting, bool]], ripple:typing.Optional[typing.Union[CursorEffectSetting, bool]], squish:typing.Optional[typing.Union[CursorEffectSetting, bool]]):
self.trail = trail
self.glow = glow
self.magnet = magnet
@@ -2489,28 +2544,28 @@ class _UniffiFfiConverterTypeCursorMotionEffects(_UniffiConverterRustBuffer):
@staticmethod
def read(buf):
return CursorMotionEffects(
- trail=_UniffiFfiConverterOptionalBoolean.read(buf),
- glow=_UniffiFfiConverterOptionalBoolean.read(buf),
- magnet=_UniffiFfiConverterOptionalBoolean.read(buf),
- ripple=_UniffiFfiConverterOptionalBoolean.read(buf),
- squish=_UniffiFfiConverterOptionalBoolean.read(buf),
+ trail=_UniffiFfiConverterOptionalTypeCursorEffectSetting.read(buf),
+ glow=_UniffiFfiConverterOptionalTypeCursorEffectSetting.read(buf),
+ magnet=_UniffiFfiConverterOptionalTypeCursorEffectSetting.read(buf),
+ ripple=_UniffiFfiConverterOptionalTypeCursorEffectSetting.read(buf),
+ squish=_UniffiFfiConverterOptionalTypeCursorEffectSetting.read(buf),
)
@staticmethod
def check_lower(value):
- _UniffiFfiConverterOptionalBoolean.check_lower(value.trail)
- _UniffiFfiConverterOptionalBoolean.check_lower(value.glow)
- _UniffiFfiConverterOptionalBoolean.check_lower(value.magnet)
- _UniffiFfiConverterOptionalBoolean.check_lower(value.ripple)
- _UniffiFfiConverterOptionalBoolean.check_lower(value.squish)
+ _UniffiFfiConverterOptionalTypeCursorEffectSetting.check_lower(value.trail)
+ _UniffiFfiConverterOptionalTypeCursorEffectSetting.check_lower(value.glow)
+ _UniffiFfiConverterOptionalTypeCursorEffectSetting.check_lower(value.magnet)
+ _UniffiFfiConverterOptionalTypeCursorEffectSetting.check_lower(value.ripple)
+ _UniffiFfiConverterOptionalTypeCursorEffectSetting.check_lower(value.squish)
@staticmethod
def write(value, buf):
- _UniffiFfiConverterOptionalBoolean.write(value.trail, buf)
- _UniffiFfiConverterOptionalBoolean.write(value.glow, buf)
- _UniffiFfiConverterOptionalBoolean.write(value.magnet, buf)
- _UniffiFfiConverterOptionalBoolean.write(value.ripple, buf)
- _UniffiFfiConverterOptionalBoolean.write(value.squish, buf)
+ _UniffiFfiConverterOptionalTypeCursorEffectSetting.write(value.trail, buf)
+ _UniffiFfiConverterOptionalTypeCursorEffectSetting.write(value.glow, buf)
+ _UniffiFfiConverterOptionalTypeCursorEffectSetting.write(value.magnet, buf)
+ _UniffiFfiConverterOptionalTypeCursorEffectSetting.write(value.ripple, buf)
+ _UniffiFfiConverterOptionalTypeCursorEffectSetting.write(value.squish, buf)
@dataclass
class CursorMotionEffectsOutput:
@@ -3646,6 +3701,31 @@ class _UniffiFfiConverterTypeElementSelector(_UniffiConverterRustBuffer):
_UniffiFfiConverterOptionalString.write(value.role, buf)
_UniffiFfiConverterOptionalString.write(value.label_contains, buf)
+class _UniffiFfiConverterOptionalBoolean(_UniffiConverterRustBuffer):
+ @classmethod
+ def check_lower(cls, value):
+ if value is not None:
+ _UniffiFfiConverterBoolean.check_lower(value)
+
+ @classmethod
+ def write(cls, value, buf):
+ if value is None:
+ buf.write_u8(0)
+ return
+
+ buf.write_u8(1)
+ _UniffiFfiConverterBoolean.write(value, buf)
+
+ @classmethod
+ def read(cls, buf):
+ flag = buf.read_u8()
+ if flag == 0:
+ return None
+ elif flag == 1:
+ return _UniffiFfiConverterBoolean.read(buf)
+ else:
+ raise InternalError("Unexpected flag byte for optional type")
+
@dataclass
class ElementPredicate:
def __init__(self, *, selector:ElementSelector, exists:typing.Optional[bool], value_equals:typing.Optional[str], enabled:typing.Optional[bool], selected:typing.Optional[bool]):
@@ -8500,6 +8580,7 @@ __all__ = [
"ClickPosition",
"InputDeliveryMode",
"ClickButton",
+ "CursorEffectSetting",
"CursorMotionStyle",
"CursorMotionTiming",
"CursorReducedMotion",
diff --git a/libs/cua-driver/python/tests/test_cursor_motion.py b/libs/cua-driver/python/tests/test_cursor_motion.py
index 17f481b61f..0b781314f0 100644
--- a/libs/cua-driver/python/tests/test_cursor_motion.py
+++ b/libs/cua-driver/python/tests/test_cursor_motion.py
@@ -52,7 +52,16 @@ class CursorMotionGoldenTests(unittest.TestCase):
return n.CursorMotionParams(
style=getattr(c.CursorMotionStyle, p["style"].upper()),
timing=getattr(c.CursorMotionTiming, p["timing"].upper()),
- effects=c.CursorMotionEffects(**{k: p["effects"][k] for k in self.effect_names}),
+ effects=c.CursorMotionEffects(
+ **{
+ k: None
+ if p["effects"][k] is None
+ else c.CursorEffectSetting.ON
+ if p["effects"][k]
+ else c.CursorEffectSetting.OFF
+ for k in self.effect_names
+ }
+ ),
start_handle=p["start_handle"],
end_handle=p["end_handle"],
arc_size=p["arc_size"],
@@ -174,6 +183,36 @@ class CursorMotionGoldenTests(unittest.TestCase):
traj = self.n.plan_cursor_spec(self.spec(case["spec"]), self.request(case["request"]))
self.check(case["name"], traj, case["out"])
+ def test_legacy_boolean_effects_reach_native_planner(self) -> None:
+ n, c = self.n, self.c
+ request = self.request(self.golden["cases"][0]["request"])
+ for name in self.effect_names:
+ for legacy, canonical in ((True, c.CursorEffectSetting.ON),
+ (False, c.CursorEffectSetting.OFF),
+ (None, None),
+ (c.CursorEffectSetting.DEFAULT, c.CursorEffectSetting.DEFAULT)):
+ with self.subTest(effect=name, value=legacy):
+ params = n.default_cursor_motion_params()
+ fields = dict.fromkeys(self.effect_names)
+ fields[name] = legacy
+ params.effects = c.CursorMotionEffects(**fields)
+ actual = n.plan_cursor_move(params, request).effects()
+ fields[name] = canonical
+ params.effects = c.CursorMotionEffects(**fields)
+ expected = n.plan_cursor_move(params, request).effects()
+ self.assertEqual(actual, expected)
+ if type(legacy) is bool:
+ self.assertEqual(getattr(actual, name), legacy)
+
+ def test_invalid_effect_is_refused_before_native_dispatch(self) -> None:
+ params = self.n.default_cursor_motion_params()
+ request = self.request(self.golden["cases"][0]["request"])
+ for invalid in ("true", "on", 1, 0, [], {}):
+ with self.subTest(value=invalid):
+ params.effects.trail = invalid
+ with self.assertRaises(ValueError):
+ self.n.plan_cursor_move(params, request)
+
def test_the_arc_styles_are_specs(self) -> None:
n, c = self.n, self.c
params = n.default_cursor_motion_params()
diff --git a/libs/cua-driver/rust/Skills/cua-driver/RUNTIME.md b/libs/cua-driver/rust/Skills/cua-driver/RUNTIME.md
index b5136aae55..d25161b9da 100644
--- a/libs/cua-driver/rust/Skills/cua-driver/RUNTIME.md
+++ b/libs/cua-driver/rust/Skills/cua-driver/RUNTIME.md
@@ -98,7 +98,7 @@ Pixel `click` already animates the cursor. Do not precede it with `move_cursor`
The default theme provides session-colored pointer/glow, action marks, and activity animations. Named sessions have stable palette colors. Native hosts own delivery/target badges separately from theme artwork; cursor state is scoped to the private lifecycle.
-`set_agent_cursor_enabled` controls idle visibility. `set_agent_cursor_motion` takes `style` (`signature_arc` default, `spring_settle`, `magnetic`, `comet_swoop`, `adaptive`, `classic`), `timing` (`native`, `fitts`, `fixed`), `effects` (`trail`, `glow`, `magnet`, `ripple`, `squish` booleans; null restores the style default), and the arc knobs `start_handle`, `end_handle`, `arc_size`, `arc_flow` (bezier styles) plus `spring` and `turn_radius` (`classic`) where advertised. Choose preinstalled artwork with `set_agent_cursor_theme`; `cursor_id` on input tools is not a theme selector. Never supply inline theme code or arbitrary source paths through agent tools. The trusted local `cursor-theme` workflow owns validation, compilation, preview, installation, and removal.
+`set_agent_cursor_enabled` controls idle visibility. `set_agent_cursor_motion` takes `style` (`signature_arc` default, `spring_settle`, `magnetic`, `comet_swoop`, `adaptive`, `classic`), `timing` (`native`, `fitts`, `fixed`), `effects` (`trail`, `glow`, `magnet`, `ripple`, `squish` as `on`, `off`, or `default`; `default` restores the style default, and an omitted effect keeps its current setting), and the arc knobs `start_handle`, `end_handle`, `arc_size`, `arc_flow` (bezier styles) plus `spring` and `turn_radius` (`classic`) where advertised. Choose preinstalled artwork with `set_agent_cursor_theme`; `cursor_id` on input tools is not a theme selector. Never supply inline theme code or arbitrary source paths through agent tools. The trusted local `cursor-theme` workflow owns validation, compilation, preview, installation, and removal.
Overlay operations need a suitable UI event loop. macOS direct SDK/MCP runtimes without a certified host main-thread adapter can return `facility_unavailable`; do not report that as a successful move. See [EMBEDDING.md](EMBEDDING.md).
diff --git a/libs/cua-driver/rust/Skills/cua-driver/SKILL.md b/libs/cua-driver/rust/Skills/cua-driver/SKILL.md
index 1477a2c0dc..db1a182bc3 100644
--- a/libs/cua-driver/rust/Skills/cua-driver/SKILL.md
+++ b/libs/cua-driver/rust/Skills/cua-driver/SKILL.md
@@ -39,7 +39,7 @@ The MCP server instructions carry the same rules, so they apply even when this f
1. Start with a targeted read: `get_window_state({pid, window_id, query:"Save"})` returns about 2K chars where a full snapshot is about 42K. Bound large trees with `max_elements` / `max_depth`. Widen only if the target is missing.
2. Act by `element_token`: row `[N]` of a read is `<snapshot_id>:N` (for example `"s0000002a:11"`, not `"11"`). Use pixels only for surfaces missing from the tree.
-3. Act through `run_steps` with `observe:true`, even for a single step. It runs the steps, stops at the first failure, and returns only what changed since your last read, so you do not need a separate read after acting; see [Workflow](WORKFLOW.md#batch-known-actions). When the flow needs logic between actions (a loop, a branch on what the app shows, a retry), write it as one `run_script` instead; see [Workflow](WORKFLOW.md#script-a-flow).
+3. Act through `run_steps` with `observe:{}`, even for a single step. It runs the steps, stops at the first failure, and returns only what changed since your last read, so you do not need a separate read after acting; see [Workflow](WORKFLOW.md#batch-known-actions). When the flow needs logic between actions (a loop, a branch on what the app shows, a retry), write it as one `run_script` instead; see [Workflow](WORKFLOW.md#script-a-flow).
4. To re-read a window, pass `since:"latest"`: you get the changed rows, not the whole tree. To just look, use `include_accessibility_tree:false` where advertised (it keeps the current tokens valid). Do not use `max_elements:1` or a junk `query` to get a picture.
5. Verify at checkpoints (after a meaningful state change, before finishing), not after every action. One `verify_state` or one targeted `get_window_state` is usually enough.
@@ -52,7 +52,7 @@ The MCP server instructions carry the same rules, so they apply even when this f
| View a local file in the GUI | `launch_app({bundle_id, urls:["file:///…"]})` opens it in that app | Current platform guide below |
| Observe one window | `get_window_state({pid, window_id, query})` | [Workflow](WORKFLOW.md) |
| Act on a control | `click` / `type_text` with a fresh `element_token` and exact window target | [Workflow](WORKFLOW.md) |
-| Act and see what changed in one call | `run_steps({steps:[{tool,args},...], observe:true})`; stops at the first failure | [Workflow](WORKFLOW.md#batch-known-actions) |
+| Act and see what changed in one call | `run_steps({steps:[{tool,args},...], observe:{}})`; stops at the first failure | [Workflow](WORKFLOW.md#batch-known-actions) |
| Loop, branch or retry in one call | `run_script({script})`: JavaScript over the `cua` API, sandboxed, time and call limits | [Workflow](WORKFLOW.md#script-a-flow) |
| Use pixels when semantics cannot reach it | Fresh target screenshot, then `x,y` on the same target | [Workflow](WORKFLOW.md) |
| Verify the outcome | `verify_state({pid, window_id, expect})` or a fresh snapshot read by the agent | [Workflow](WORKFLOW.md) |
diff --git a/libs/cua-driver/rust/Skills/cua-driver/WORKFLOW.md b/libs/cua-driver/rust/Skills/cua-driver/WORKFLOW.md
index 87b5e82f4d..2876c27c1a 100644
--- a/libs/cua-driver/rust/Skills/cua-driver/WORKFLOW.md
+++ b/libs/cua-driver/rust/Skills/cua-driver/WORKFLOW.md
@@ -79,7 +79,7 @@ Keep `delivery_mode:"background"` as the default for window input. The route may
## Batch known actions
-`run_steps` is the default way to act. When the next action or actions are decided, send them as one `run_steps` call with `observe:true` instead of one call per action followed by a read. Even a single step pays off: the action and the look at its result become one call. The batch runs the same tools in order, stops at the first failure, and returns per-step status plus at most one bounded observation. Typical fit: fill several fields, then press a button, then read the result. Do not batch across a point where the answer decides the next step, or when a step reshuffles the window and invalidates element tokens used by later steps (use pixel targets after it, or split the batch there).
+`run_steps` is the default way to act. When the next action or actions are decided, send them as one `run_steps` call with `observe:{}` instead of one call per action followed by a read. Even a single step pays off: the action and the look at its result become one call. The batch runs the same tools in order, stops at the first failure, and returns per-step status plus at most one bounded observation. Typical fit: fill several fields, then press a button, then read the result. Do not batch across a point where the answer decides the next step, or when a step reshuffles the window and invalidates element tokens used by later steps (use pixel targets after it, or split the batch there).
```bash
cua-driver run_steps '{"session":"run-1","steps":[
@@ -87,7 +87,7 @@ cua-driver run_steps '{"session":"run-1","steps":[
{"tool":"set_value","args":{"pid":844,"element_token":"s0000002a:15","value":"Lovelace"}},
{"tool":"click","args":{"target":{"kind":"window","pid":844,"window_id":10725},"element_token":"s0000002a:21"}},
{"tool":"press_key","args":{"pid":844,"key":"return"}}
- ],"delay_ms":100,"observe":true}'
+ ],"delay_ms":100,"observe":{}}'
```
- `tool` is one of `click`, `double_click`, `right_click`, `set_value`, `type_text`, `press_key`, `hotkey`, `scroll`, `drag`, `move_cursor` (`press` and `type` are accepted for `press_key` and `type_text`, `triple_click` is a click with `count:3`, and a key name such as `down` as the tool is a `press_key`); `args` are exactly that tool's arguments. Observation tools do not run inside a batch: a read between actions is skipped (it could not change the later steps), a `get_window_state` as the last step is the observation (merged with `observe`), and a trailing `zoom` runs after it. Run `describe run_steps` and `describe <tool>` for schemas. Up to 64 steps. `delivery_mode` on `run_steps` is the default for steps that set none.
diff --git a/libs/cua-driver/rust/crates/cua-driver-contract/src/cursor.rs b/libs/cua-driver/rust/crates/cua-driver-contract/src/cursor.rs
index 3c61383cc7..556f772d4c 100644
--- a/libs/cua-driver/rust/crates/cua-driver-contract/src/cursor.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-contract/src/cursor.rs
@@ -267,8 +267,63 @@ impl CursorMotionTiming {
}
}
-/// Per-effect overrides for the agent cursor. Unset fields are omitted on the wire, so they
-/// keep their current setting.
+/// One cursor effect: `on`, `off`, or `default` (the style's own setting).
+#[derive(Debug, Clone, Copy, Serialize, schemars::JsonSchema, PartialEq, Eq, uniffi::Enum)]
+#[serde(rename_all = "lowercase")]
+pub enum CursorEffectSetting {
+ On,
+ Off,
+ Default,
+}
+
+impl CursorEffectSetting {
+ /// Advertised spellings, plus unadvertised bool / `"true"` / `"false"` / null.
+ /// An explicit null resets the effect to its default.
+ pub fn from_json(value: &Value) -> Option<Self> {
+ Some(match value {
+ Value::Null => Self::Default,
+ Value::Bool(true) => Self::On,
+ Value::Bool(false) => Self::Off,
+ Value::String(text) => match text.as_str() {
+ "on" | "true" => Self::On,
+ "off" | "false" => Self::Off,
+ "default" => Self::Default,
+ _ => return None,
+ },
+ _ => return None,
+ })
+ }
+
+ /// `None` clears the override back to the style default.
+ pub fn override_value(self) -> Option<bool> {
+ match self {
+ Self::On => Some(true),
+ Self::Off => Some(false),
+ Self::Default => None,
+ }
+ }
+}
+
+impl<'de> Deserialize<'de> for CursorEffectSetting {
+ fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
+ let value = Value::deserialize(deserializer)?;
+ Self::from_json(&value).ok_or_else(|| {
+ serde::de::Error::custom(format!("expected on, off or default, got {value}"))
+ })
+ }
+}
+
+fn deserialize_present_cursor_effect<'de, D>(
+ deserializer: D,
+) -> Result<Option<CursorEffectSetting>, D::Error>
+where
+ D: serde::Deserializer<'de>,
+{
+ CursorEffectSetting::deserialize(deserializer).map(Some)
+}
+
+/// Per-effect overrides for the agent cursor. An omitted field keeps the current setting.
+/// `on` and `off` set it; `default` restores the style default.
#[derive(
Debug,
Clone,
@@ -284,20 +339,45 @@ impl CursorMotionTiming {
#[serde(deny_unknown_fields)]
pub struct CursorMotionEffects {
/// Short fading trail behind the cursor.
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub trail: Option<bool>,
+ #[serde(
+ default,
+ deserialize_with = "deserialize_present_cursor_effect",
+ skip_serializing_if = "Option::is_none"
+ )]
+ #[schemars(schema_with = "CursorEffectSetting::json_schema")]
+ pub trail: Option<CursorEffectSetting>,
/// Soft glow around the cursor that grows with speed.
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub glow: Option<bool>,
+ #[serde(
+ default,
+ deserialize_with = "deserialize_present_cursor_effect",
+ skip_serializing_if = "Option::is_none"
+ )]
+ #[schemars(schema_with = "CursorEffectSetting::json_schema")]
+ pub glow: Option<CursorEffectSetting>,
/// Target glow when the `magnetic` style locks on.
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub magnet: Option<bool>,
+ #[serde(
+ default,
+ deserialize_with = "deserialize_present_cursor_effect",
+ skip_serializing_if = "Option::is_none"
+ )]
+ #[schemars(schema_with = "CursorEffectSetting::json_schema")]
+ pub magnet: Option<CursorEffectSetting>,
/// Ring that expands from the hotspot on click.
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub ripple: Option<bool>,
+ #[serde(
+ default,
+ deserialize_with = "deserialize_present_cursor_effect",
+ skip_serializing_if = "Option::is_none"
+ )]
+ #[schemars(schema_with = "CursorEffectSetting::json_schema")]
+ pub ripple: Option<CursorEffectSetting>,
/// Brief scale-down of the cursor on click.
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub squish: Option<bool>,
+ #[serde(
+ default,
+ deserialize_with = "deserialize_present_cursor_effect",
+ skip_serializing_if = "Option::is_none"
+ )]
+ #[schemars(schema_with = "CursorEffectSetting::json_schema")]
+ pub squish: Option<CursorEffectSetting>,
}
/// Effects in use after applying overrides to the style's defaults.
@@ -521,4 +601,67 @@ mod tests {
None
);
}
+
+ #[test]
+ fn effect_setting_accepts_advertised_and_legacy_spellings() {
+ assert_eq!(
+ CursorEffectSetting::from_json(&json!("on")),
+ Some(CursorEffectSetting::On)
+ );
+ assert_eq!(
+ CursorEffectSetting::from_json(&json!("off")),
+ Some(CursorEffectSetting::Off)
+ );
+ assert_eq!(
+ CursorEffectSetting::from_json(&json!("default")),
+ Some(CursorEffectSetting::Default)
+ );
+ assert_eq!(
+ CursorEffectSetting::from_json(&json!(true)),
+ Some(CursorEffectSetting::On)
+ );
+ assert_eq!(
+ CursorEffectSetting::from_json(&json!("false")),
+ Some(CursorEffectSetting::Off)
+ );
+ assert_eq!(
+ CursorEffectSetting::from_json(&json!(null)),
+ Some(CursorEffectSetting::Default)
+ );
+ assert_eq!(CursorEffectSetting::On.override_value(), Some(true));
+ assert_eq!(CursorEffectSetting::Off.override_value(), Some(false));
+ assert_eq!(CursorEffectSetting::Default.override_value(), None);
+
+ let set: CursorMotionEffects =
+ serde_json::from_value(json!({"trail": "off", "ripple": "default", "glow": true}))
+ .unwrap();
+ assert_eq!(set.trail, Some(CursorEffectSetting::Off));
+ assert_eq!(set.ripple, Some(CursorEffectSetting::Default));
+ assert_eq!(set.glow, Some(CursorEffectSetting::On));
+ assert!(set.magnet.is_none());
+ let omitted: CursorMotionEffects = serde_json::from_value(json!({})).unwrap();
+ assert!(
+ omitted.trail.is_none(),
+ "omitted field must not update an override"
+ );
+ let reset: CursorMotionEffects = serde_json::from_value(json!({"trail": null})).unwrap();
+ assert_eq!(
+ reset.trail,
+ Some(CursorEffectSetting::Default),
+ "explicit null restores the style default, rather than keeping the override"
+ );
+ assert_eq!(
+ serde_json::to_value(&reset).unwrap()["trail"],
+ "default",
+ "typed parse/serialize must retain the reset intent on the wire"
+ );
+ assert_eq!(
+ serde_json::to_value(CursorMotionEffects {
+ trail: Some(CursorEffectSetting::On),
+ ..CursorMotionEffects::default()
+ })
+ .unwrap()["trail"],
+ "on"
+ );
+ }
}
diff --git a/libs/cua-driver/rust/crates/cua-driver-contract/src/cursor_tools.rs b/libs/cua-driver/rust/crates/cua-driver-contract/src/cursor_tools.rs
index eed9529ff9..48d5ceb5ca 100644
--- a/libs/cua-driver/rust/crates/cua-driver-contract/src/cursor_tools.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-contract/src/cursor_tools.rs
@@ -69,7 +69,10 @@ fn contract<I: ToolInput, O: ToolOutput>(
#[cfg(test)]
mod tests {
- use crate::{CursorMotionStyle, SetAgentCursorMotionInput, ToolInput};
+ use crate::{
+ CursorEffectSetting, CursorMotionStyle, SetAgentCursorMotionInput, StartSessionInput,
+ ToolInput,
+ };
use serde_json::json;
#[test]
@@ -100,13 +103,40 @@ mod tests {
.is_err());
}
+ #[test]
+ fn explicit_null_effect_reset_survives_typed_tool_inputs() {
+ let set: SetAgentCursorMotionInput = serde_json::from_value(json!({
+ "session": "s",
+ "effects": {"trail": null, "glow": true}
+ }))
+ .unwrap();
+ let effects = set.effects.as_ref().expect("effects object");
+ assert_eq!(effects.trail, Some(CursorEffectSetting::Default));
+ assert_eq!(effects.glow, Some(CursorEffectSetting::On));
+ assert_eq!(effects.magnet, None);
+ assert_eq!(
+ serde_json::to_value(&set).unwrap()["effects"],
+ json!({"trail": "default", "glow": "on"})
+ );
+
+ let started: StartSessionInput = serde_json::from_value(json!({
+ "session": "s",
+ "cursor_motion": {"effects": {"trail": null}}
+ }))
+ .unwrap();
+ assert_eq!(
+ serde_json::to_value(&started).unwrap()["cursor_motion"]["effects"],
+ json!({"trail": "default"})
+ );
+ }
+
#[test]
fn unset_effects_are_omitted_on_the_wire() {
let input: SetAgentCursorMotionInput =
serde_json::from_value(json!({"session": "s", "effects": {"trail": false}})).unwrap();
assert_eq!(
serde_json::to_value(&input).unwrap()["effects"],
- json!({"trail": false})
+ json!({"trail": "off"})
);
}
}
diff --git a/libs/cua-driver/rust/crates/cua-driver-contract/src/inputs.rs b/libs/cua-driver/rust/crates/cua-driver-contract/src/inputs.rs
index d6ea439f7e..75156eda5a 100644
--- a/libs/cua-driver/rust/crates/cua-driver-contract/src/inputs.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-contract/src/inputs.rs
@@ -32,6 +32,26 @@ fn normalize_schema(value: &mut Value) {
match value {
Value::Object(object) => {
object.remove("title");
+ if object.get("default").is_some_and(Value::is_null) {
+ object.remove("default");
+ }
+ if let Some(types) = object.get("type").and_then(Value::as_array).cloned() {
+ let kept: Vec<_> = types
+ .into_iter()
+ .filter(|ty| ty.as_str() != Some("null"))
+ .collect();
+ let Ok([one]) = <[Value; 1]>::try_from(kept) else {
+ panic!("exactly one non-null type, got {}", object["type"]);
+ };
+ object.insert("type".into(), one);
+ }
+ if let Some(constant) = object.remove("const") {
+ let Some(text) = constant.as_str() else {
+ panic!("schema const must be a string, got {constant}");
+ };
+ object.insert("type".into(), serde_json::json!("string"));
+ object.insert("enum".into(), serde_json::json!([text]));
+ }
if object.get("type").and_then(Value::as_str) == Some("object") {
object
.entry("properties")
@@ -230,20 +250,31 @@ fn desktop_scope_schema(generator: &mut SchemaGenerator) -> Schema {
/// `display_id="primary"` is the portable desktop target in this release.
/// Platforms that cannot address another display reject it explicitly rather
/// than silently changing coordinate spaces.
-#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq, uniffi::Enum)]
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, uniffi::Enum)]
#[serde(tag = "kind", rename_all = "snake_case")]
pub enum ActionTarget {
Window { pid: u32, window_id: u64 },
Desktop { display_id: String },
}
-pub fn action_target_schema() -> Value {
- let schema = schema_settings()
- .into_generator()
- .into_root_schema_for::<ActionTarget>();
- let mut value = serde_json::to_value(schema).expect("action target schema serializes");
- normalize_schema(&mut value);
- value
+impl JsonSchema for ActionTarget {
+ fn schema_name() -> std::borrow::Cow<'static, str> {
+ "ActionTarget".into()
+ }
+
+ fn json_schema(_: &mut SchemaGenerator) -> Schema {
+ json_schema!({
+ "type": "object",
+ "description": "Exact window (kind \"window\", with pid and window_id) or desktop (kind \"desktop\", with display_id). \"primary\" is the portable desktop target.",
+ "required": ["kind"],
+ "properties": {
+ "kind": {"type": "string", "enum": ["window", "desktop"], "description": "window requires pid and window_id; desktop requires display_id."},
+ "pid": {"type": "integer", "minimum": 0, "description": "Process id. Required when kind is window."},
+ "window_id": {"type": "integer", "minimum": 0, "description": "Window id from list_windows. Required when kind is window."},
+ "display_id": {"type": "string", "description": "Display id. Required when kind is desktop; use \"primary\"."}
+ }
+ })
+ }
}
impl JsonSchema for DesktopScope {
@@ -438,8 +469,7 @@ pub struct CursorMotionSelection {
#[serde(default, skip_serializing_if = "Option::is_none")]
#[schemars(schema_with = "cursor_motion_timing_schema")]
pub timing: Option<crate::CursorMotionTiming>,
- /// Turn single effects on or off. An omitted effect keeps its current setting; null
- /// restores the style's default.
+ /// Turn effects on or off. Omit a field to keep it; `"default"` restores the style default.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub effects: Option<crate::CursorMotionEffects>,
/// Arc control-point offset from the start, as a fraction of the distance, for
@@ -498,35 +528,43 @@ pub struct SetAgentCursorMotionInput {
#[serde(default, skip_serializing_if = "Option::is_none")]
#[schemars(schema_with = "cursor_motion_timing_schema")]
pub timing: Option<crate::CursorMotionTiming>,
- /// Turn single effects on or off. An omitted effect keeps its current setting; null
- /// restores the style's default.
+ /// Turn effects on or off. Omit a field to keep it; `"default"` restores the style default.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub effects: Option<crate::CursorMotionEffects>,
/// Arc control-point offset from the start, as a fraction of the distance, for
/// `signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).
+ #[serde(default, skip_serializing_if = "Option::is_none")]
pub start_handle: Option<f64>,
/// Arc control-point offset from the end, as a fraction of the distance, for
/// `signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).
+ #[serde(default, skip_serializing_if = "Option::is_none")]
pub end_handle: Option<f64>,
/// Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default)
/// keeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
pub arc_size: Option<f64>,
/// Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`:
/// positive moves the apex toward the destination. Clamped to -1..1 (default 0).
+ #[serde(default, skip_serializing_if = "Option::is_none")]
pub arc_flow: Option<f64>,
/// Arrival spring damping for `classic`: 1 is critically damped, 0.3 is bouncy. Clamped
/// to 0.3..1 (default 0.72).
+ #[serde(default, skip_serializing_if = "Option::is_none")]
pub spring: Option<f64>,
/// Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A
/// nonzero value with `native` timing also fixes the duration. Clamped to 0..5000.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
pub glide_duration_ms: Option<f64>,
/// Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80).
+ #[serde(default, skip_serializing_if = "Option::is_none")]
pub dwell_after_click_ms: Option<f64>,
/// Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to
/// 0..60000 (default 15000).
+ #[serde(default, skip_serializing_if = "Option::is_none")]
pub idle_hide_ms: Option<f64>,
/// Minimum turning radius of the `classic` glide path, in points; smaller turns tighter.
/// Clamped to 1..1000 (default 80).
+ #[serde(default, skip_serializing_if = "Option::is_none")]
pub turn_radius: Option<f64>,
}
@@ -850,12 +888,7 @@ impl JsonSchema for ClickInput {
"ClickInput".into()
}
fn json_schema(generator: &mut SchemaGenerator) -> Schema {
- let mut schema = ClickWireInput::json_schema(generator);
- schema.insert("oneOf".into(), serde_json::json!([
- {"required":["x","y"], "not":{"required":["element_token"]}},
- {"required":["element_token"], "not":{"anyOf":[{"required":["x"]},{"required":["y"]},{"required":["capture_id"]}]}}
- ]));
- schema
+ ClickWireInput::json_schema(generator)
}
}
@@ -1146,7 +1179,8 @@ mod tests {
}
let schema = ClickInput::input_schema();
assert_eq!(schema["required"], json!(["target", "delivery_mode"]));
- assert!(schema["oneOf"].is_array());
+ assert!(schema.get("oneOf").is_none());
+ assert!(schema.get("not").is_none());
assert!(schema["properties"].get("position").is_none());
assert!(schema["properties"].get("capture_id").is_some());
assert_eq!(schema["properties"]["capture_id"]["minLength"], 1);
@@ -1214,8 +1248,9 @@ mod tests {
assert_eq!(schema["type"], "object");
assert_eq!(schema["additionalProperties"], false);
assert_eq!(schema["required"], json!(["x", "y"]));
- assert_eq!(schema["properties"]["scope"]["const"], "desktop");
- assert!(schema["properties"]["target"]["anyOf"].is_array());
+ assert_eq!(schema["properties"]["scope"]["enum"], json!(["desktop"]));
+ assert_eq!(schema["properties"]["target"]["type"], "object");
+ assert!(schema["properties"]["target"].get("anyOf").is_none());
assert_eq!(
schema["properties"]["button"],
json!({ "type": "string", "enum": ["left", "right", "middle"] })
@@ -1250,4 +1285,55 @@ mod tests {
.expect_err("portable input must reject runtime-only fields");
assert!(error.to_string().contains("unknown field `pid`"));
}
+
+ #[test]
+ #[should_panic(expected = "schema const must be a string")]
+ fn normalize_schema_panics_on_a_non_string_const() {
+ let mut schema = json!({"const": 1});
+ normalize_schema(&mut schema);
+ }
+
+ #[test]
+ #[should_panic(expected = "exactly one non-null type")]
+ fn normalize_schema_panics_on_a_multi_type_array() {
+ let mut schema = json!({"type": ["string", "number"]});
+ normalize_schema(&mut schema);
+ }
+
+ #[test]
+ fn normalize_schema_drops_null_and_rewrites_string_const() {
+ let mut number = json!({"type": ["number", "null"], "default": null, "title": "N"});
+ normalize_schema(&mut number);
+ assert_eq!(number, json!({"type": "number"}));
+
+ let mut constant = json!({"const": "x"});
+ normalize_schema(&mut constant);
+ assert_eq!(constant, json!({"type": "string", "enum": ["x"]}));
+
+ let mut object = json!({"type": ["object", "null"]});
+ normalize_schema(&mut object);
+ assert_eq!(object["type"], "object");
+ assert_eq!(object["properties"], json!({}));
+ assert_eq!(object["required"], json!([]));
+ assert_eq!(object["additionalProperties"], true);
+
+ let target = MoveCursorInput::input_schema()["properties"]["target"].clone();
+ assert_eq!(target["type"], "object");
+ assert!(target.get("anyOf").is_none());
+ assert!(target.get("oneOf").is_none());
+ assert_eq!(
+ target["properties"]["kind"]["enum"],
+ json!(["window", "desktop"])
+ );
+ assert_eq!(
+ MoveCursorInput::input_schema()["properties"]["scope"]["enum"],
+ json!(["desktop"])
+ );
+ let effects = SetAgentCursorMotionInput::input_schema()["properties"]["effects"].clone();
+ assert_eq!(effects["properties"]["trail"]["type"], "string");
+ assert_eq!(
+ effects["properties"]["trail"]["enum"],
+ json!(["on", "off", "default"])
+ );
+ }
}
diff --git a/libs/cua-driver/rust/crates/cua-driver-contract/src/lib.rs b/libs/cua-driver/rust/crates/cua-driver-contract/src/lib.rs
index 5516b29339..263916de89 100644
--- a/libs/cua-driver/rust/crates/cua-driver-contract/src/lib.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-contract/src/lib.rs
@@ -44,21 +44,21 @@ fn drop_schemars_numeric_format(schema: &mut Schema) {
}
}
+pub use cursor::CursorEffectSetting;
pub use cursor::{
classify_cursor_semantics, CursorAction, CursorDelivery, CursorMotionEffects,
CursorMotionEffectsOutput, CursorMotionStyle, CursorMotionTiming, CursorPlayback,
CursorReducedMotion, CursorSemantics, CursorTarget, CursorThemeSelection,
};
pub use inputs::{
- action_target_schema, ActionTarget, CaptureScope, ClickButton, ClickInput, ClickPosition,
- ClipboardReadInput, ClipboardWriteInput, CursorMotionSelection, DesktopScope, DragInput,
- EndSessionInput, EscalateSessionInput, EscalationReason, GetAgentCursorStateInput,
- GetCursorPositionInput, GetDesktopStateInput, GetScreenSizeInput, GetSessionInput,
- GetSessionStateInput, HotkeyInput, InputDeliveryMode, InvokeMenuInput, LegacyClickInput,
- ListSessionsInput, MoveCursorInput, PressKeyInput, ScrollBy, ScrollDirection, ScrollInput,
- SetAgentCursorEnabledInput, SetAgentCursorMotionInput, SetAgentCursorThemeInput,
- SetWindowFrameInput, StartSessionInput, ToolInput, TypeTextInput,
- MULTI_CALL_SESSION_DESCRIPTION,
+ ActionTarget, CaptureScope, ClickButton, ClickInput, ClickPosition, ClipboardReadInput,
+ ClipboardWriteInput, CursorMotionSelection, DesktopScope, DragInput, EndSessionInput,
+ EscalateSessionInput, EscalationReason, GetAgentCursorStateInput, GetCursorPositionInput,
+ GetDesktopStateInput, GetScreenSizeInput, GetSessionInput, GetSessionStateInput, HotkeyInput,
+ InputDeliveryMode, InvokeMenuInput, LegacyClickInput, ListSessionsInput, MoveCursorInput,
+ PressKeyInput, ScrollBy, ScrollDirection, ScrollInput, SetAgentCursorEnabledInput,
+ SetAgentCursorMotionInput, SetAgentCursorThemeInput, SetWindowFrameInput, StartSessionInput,
+ ToolInput, TypeTextInput, MULTI_CALL_SESSION_DESCRIPTION,
};
pub use outputs::{
advertised_output_schema, conforming_error_envelope, is_refusal_envelope,
@@ -391,8 +391,15 @@ mod tests {
#[test]
fn input_and_output_schemas_drop_only_schemars_numeric_formats() {
+ // `input_schema` panics on this fixture's object `const`. The format
+ // stripper runs in `schema_settings` before that rewrite.
let schemas = [
- <NumericFormatFixture as ToolInput>::input_schema(),
+ serde_json::to_value(
+ schema_settings()
+ .into_generator()
+ .into_root_schema_for::<NumericFormatFixture>(),
+ )
+ .expect("schema"),
<NumericFormatFixture as ToolOutput>::output_schema(),
];
diff --git a/libs/cua-driver/rust/crates/cua-driver-contract/src/visual.rs b/libs/cua-driver/rust/crates/cua-driver-contract/src/visual.rs
index d4e73bf060..0cc9c2c6d0 100644
--- a/libs/cua-driver/rust/crates/cua-driver-contract/src/visual.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-contract/src/visual.rs
@@ -53,16 +53,10 @@ fn visual_regions_schema(_: &mut SchemaGenerator) -> Schema {
fn region_kinds_schema(_: &mut SchemaGenerator) -> Schema {
json_schema!({
- "anyOf": [
- {
- "type": "array",
- "minItems": 1,
- "maxItems": 2,
- "uniqueItems": true,
- "items": { "enum": ["text", "icon"] }
- },
- { "type": "null" }
- ]
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 2,
+ "items": { "type": "string", "enum": ["text", "icon"] }
})
}
@@ -886,7 +880,8 @@ mod tests {
let schema =
serde_json::to_string(&schemars::schema_for!(ParseVisualRegionsInput)).unwrap();
- assert!(schema.contains("\"uniqueItems\":true"));
+ assert!(schema.contains("\"enum\":[\"text\",\"icon\"]"));
+ assert!(!schema.contains("uniqueItems"));
}
#[test]
diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools.rs
index 8f31b63e1f..506434eebf 100644
--- a/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools.rs
@@ -162,7 +162,7 @@ impl Tool for RunStepsTool {
order, stop at the first failure, and (with `observe`) get what changed in the \
same response. Use it whenever you know the next action(s) and would otherwise \
re-read the window after them: fill three fields, click, and see the result in \
- one call instead of five. Even a single step plus `observe:true` replaces an \
+ one call instead of five. Even a single step plus `observe:{}` replaces an \
action call followed by a get_window_state call. \
Each step is `{tool, args}` where `tool` is one of click, double_click, \
right_click, set_value, type_text, press_key, hotkey, scroll, drag, move_cursor \
@@ -215,9 +215,9 @@ impl Tool for RunStepsTool {
Example (fill a form, submit, confirm the dialog, check the result):\n\
{\"steps\":[\
{\"set_value\":{\"app\":\"Safari\",\"role\":\"textfield\",\"name\":\"Email\",\"value\":\"[email protected]\"}},\
- {\"click\":{\"role\":\"button\",\"name\":\"Submit\"},\"expect\":{\"role\":\"button\",\"name\":\"Confirm\"}},\
+ {\"click\":{\"role\":\"button\",\"name\":\"Submit\"},\"expect\":[{\"role\":\"button\",\"name\":\"Confirm\"}]},\
{\"click\":{\"role\":\"button\",\"name\":\"Confirm\"},\"expect\":[{\"name\":\"Confirm\",\"gone\":true},{\"text\":\"Thanks\"}]}\
- ],\"observe\":true}"
+ ],\"observe\":{}}"
.into(),
input_schema: json!({
"type": "object",
@@ -229,30 +229,15 @@ impl Tool for RunStepsTool {
"maxItems": MAX_STEPS,
"description": "Ordered actions. Execution stops at the first failing step. Each step is {tool, args} or {<tool>: args}, plus optional wait_for / expect / timeout_ms; a step may also be only a wait_for or expect check.",
"items": {
- "anyOf": [
- {
- "type": "object",
- "required": ["tool"],
- "properties": {
- "tool": { "type": "string", "enum": BATCHABLE_TOOLS, "description": "Action tool to run." },
- "args": { "type": "object", "description": "Arguments for that tool, as in a direct call, optionally with role/name/nth/app/window to name the target instead of pid/window_id/element_token." },
- "wait_for": { "type": "object", "description": "Check that must hold before the action: {role?, name?, text?, gone?, app?, window?, timeout_ms?}. Default timeout 5000 ms." },
- "expect": { "type": ["object", "array"], "description": "Check (or up to 4) that must hold after the action: {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}. Default timeout 2000 ms." },
- "timeout_ms": { "type": "integer", "minimum": 0, "maximum": 10000, "description": "How long a named target may take to appear. Default 3000." }
- },
- "additionalProperties": false
- },
- {
- "type": "object",
- "description": "Shorthand {<tool>: args} with optional wait_for / expect / timeout_ms, or a step that is only a wait_for or expect check.",
- "properties": {
- "wait_for": { "type": "object" },
- "expect": { "type": ["object", "array"] },
- "timeout_ms": { "type": "integer", "minimum": 0, "maximum": 10000 }
- },
- "additionalProperties": true
- }
- ]
+ "type": "object",
+ "properties": {
+ "tool": { "type": "string", "enum": BATCHABLE_TOOLS, "description": "Action tool to run." },
+ "args": { "type": "object", "description": "Arguments for that tool, as in a direct call, optionally with role/name/nth/app/window to name the target instead of pid/window_id/element_token." },
+ "wait_for": { "type": "object", "description": "Check that must hold before the action: {role?, name?, text?, gone?, app?, window?, timeout_ms?}. Default timeout 5000 ms." },
+ "expect": { "type": "array", "maxItems": 4, "items": {"type": "object"}, "description": "Up to 4 checks that must hold after the action: {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}. Default timeout 2000 ms." },
+ "timeout_ms": { "type": "integer", "minimum": 0, "maximum": 10000, "description": "How long a named target may take to appear. Default 3000." }
+ },
+ "additionalProperties": true
}
},
"delay_ms": {
@@ -287,8 +272,8 @@ impl Tool for RunStepsTool {
"description": "When a step is refused because its target ignores background input (Electron, LibreOffice and other toolkits), retry it once with delivery_mode:\"foreground\": the window is activated and the pointer may move. Default false."
},
"observe": {
- "type": ["object", "boolean"],
- "description": "Optional end-of-batch observation: `true`, or arguments for ONE get_window_state call. `pid` and `window_id` default to those of the last step that names both. Defaults to since=\"latest\" (only what changed since your last read of that window with the same query/max_elements/max_depth; a full read when there is none), include_screenshot=false and max_elements=250; pass include_screenshot=true to see the window, or since=null for a full read. Omit to read nothing."
+ "type": "object",
+ "description": "Optional end-of-batch observation: arguments for ONE get_window_state call. `pid` and `window_id` default to those of the last step that names both. Defaults to since=\"latest\" (only what changed since your last read of that window with the same query/max_elements/max_depth; a full read when there is none), include_screenshot=false and max_elements=250; pass include_screenshot=true to see the window, or since=null for a full read. Omit to read nothing. {} observes the last window."
}
},
"additionalProperties": false
diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/reliability_tests.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/reliability_tests.rs
index c132a04d60..5e3c94e755 100644
--- a/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/reliability_tests.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/reliability_tests.rs
@@ -15,24 +15,19 @@ use crate::{
// ── schema leniency ──────────────────────────────────────────────────────
#[tokio::test]
-async fn observe_sent_as_a_string_is_read_as_the_boolean() {
+async fn observe_sent_as_a_string_is_refused() {
let harness = Harness::new();
- // 21 of the 102 failed v036 calls: `"observe": "true"`.
let result = harness
.run(json!({"steps": [{"tool": "click", "args": {"pid": 7, "window_id": 3}}], "observe": "true"}))
.await;
- assert_ne!(result.is_error, Some(true), "{}", text(&result));
- assert_eq!(harness.hits("get_window_state"), 1);
+ assert_eq!(result.is_error, Some(true));
+ assert!(text(&result).contains("observe"), "{}", text(&result));
- // `"observe": "false"` with a trailing read: the read is the observation.
let result = harness
- .run(json!({"steps": [
- {"tool": "click", "args": {"pid": 7, "window_id": 3}},
- {"tool": "get_window_state", "args": {"pid": 7, "window_id": 3, "max_elements": 100}}
- ], "observe": "false"}))
+ .run(json!({"steps": [{"tool": "click", "args": {"pid": 7, "window_id": 3}}], "observe": "false"}))
.await;
- assert_ne!(result.is_error, Some(true), "{}", text(&result));
- assert_eq!(harness.last("get_window_state")["max_elements"], 100);
+ assert_eq!(result.is_error, Some(true));
+ assert!(text(&result).contains("observe"), "{}", text(&result));
}
#[tokio::test]
@@ -60,7 +55,7 @@ async fn batch_level_pid_and_window_id_are_the_default_window() {
.run(json!({
"pid": "37641",
"window_id": "2126",
- "observe": "false",
+ "observe": false,
"steps": [
{"tool": "set_value", "args": {"element_token": "s0000000a:46", "value": "12:00"}},
{"tool": "set_value", "args": {"element_token": "s0000000a:48", "value": "Juniper"}},
diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/tests.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/tests.rs
index 04df1222fa..9783adc48b 100644
--- a/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/tests.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/tests.rs
@@ -85,6 +85,8 @@ impl Harness {
"amount": {"type": "integer", "minimum": 1, "maximum": 50},
"x": {"type": "number"},
"y": {"type": "number"},
+ "button": {"type": "string", "enum": ["left", "right", "middle"]},
+ "target": {"type": "object"},
"full_output": {"type": "boolean"},
"max_elements": {"type": "integer", "minimum": 1}
},
@@ -409,8 +411,8 @@ async fn the_batch_is_advertised_with_its_schema() {
.get_def(super::RUN_STEPS_TOOL)
.expect("registered");
assert_eq!(def.input_schema["required"], json!(["steps"]));
- let listed: Vec<_> = def.input_schema["properties"]["steps"]["items"]["anyOf"][0]["properties"]
- ["tool"]["enum"]
+ let listed: Vec<_> = def.input_schema["properties"]["steps"]["items"]["properties"]["tool"]
+ ["enum"]
.as_array()
.unwrap()
.iter()
@@ -640,6 +642,93 @@ async fn a_trailing_read_becomes_the_observation_and_a_middle_one_points_to_obse
);
}
+#[tokio::test]
+async fn click_step_refuses_null_target_and_button_five() {
+ let harness = Harness::new();
+ let target = harness
+ .run(json!({"steps": [{"click": {"x": 1, "y": 2, "target": null}}]}))
+ .await;
+ assert_eq!(target.is_error, Some(true));
+ assert!(text(&target).contains("/target"), "{}", text(&target));
+ let refused = harness
+ .run(json!({"steps": [{"click": {"x": 1, "y": 2, "button": 5}}]}))
+ .await;
+ assert_eq!(refused.is_error, Some(true));
+ assert!(text(&refused).contains("/button"), "{}", text(&refused));
+}
+
#[cfg(test)]
#[path = "reliability_tests.rs"]
mod reliability_tests;
+
+// The Linux runtime historically accepts JSON numbers for set_value. The
+// provider-facing string schema must not narrow direct or batched calls.
+#[cfg(target_os = "linux")]
+#[tokio::test]
+async fn numeric_set_value_matches_direct_and_batched_string_arguments() {
+ for value in [
+ json!(0),
+ json!(-12),
+ json!(4.5),
+ json!(18446744073709551615u64),
+ ] {
+ let expected = Value::String(value.to_string());
+ let harness = Harness::new();
+ harness
+ .registry
+ .invoke_with_context(
+ "set_value",
+ json!({"pid": 42, "value": value}),
+ context(None),
+ )
+ .await;
+ assert_eq!(harness.last("set_value")["value"], expected);
+ let result = harness
+ .run(json!({"steps": [{
+ "tool": "set_value", "args": {"pid": 42, "value": value}
+ }]}))
+ .await;
+ assert_ne!(result.is_error, Some(true), "{}", text(&result));
+ assert_eq!(harness.hits("set_value"), 2);
+ assert_eq!(harness.last("set_value")["value"], expected);
+ }
+ // A numeric field with the same name on another tool is not rewritten.
+ let unrelated = Harness::new();
+ unrelated
+ .registry
+ .invoke_with_context("type_text", json!({"value": 4.5}), context(None))
+ .await;
+ assert_eq!(unrelated.last("type_text")["value"], json!(4.5));
+ // Text must remain byte-for-byte unchanged, even when it looks numeric.
+ let harness = Harness::new();
+ let result = harness
+ .run(json!({"steps": [{
+ "tool": "set_value", "args": {"pid": 42, "value": " 004.50 "}
+ }]}))
+ .await;
+ assert_ne!(result.is_error, Some(true), "{}", text(&result));
+ assert_eq!(harness.last("set_value")["value"], " 004.50 ");
+}
+
+#[cfg(target_os = "linux")]
+#[tokio::test]
+async fn non_scalar_set_value_is_rejected_before_any_batch_action() {
+ for value in [Value::Null, json!(true), json!([]), json!({})] {
+ let harness = Harness::new();
+ let result = harness
+ .run(json!({"steps": [
+ {"tool": "set_value", "args": {"pid": 42, "value": "valid"}},
+ {"tool": "set_value", "args": {"pid": 42, "value": value}}
+ ]}))
+ .await;
+ let structured = result.structured_content.as_ref().unwrap();
+ assert_eq!(structured["code"], "invalid_batch");
+ assert_eq!(structured["executed"], 0);
+ assert_eq!(structured["failed_step"], 1);
+ assert!(structured["detail"]
+ .as_str()
+ .unwrap()
+ .starts_with("set_value: invalid arguments at /value:"));
+ assert_eq!(harness.hits("set_value"), 0);
+ }
+}
diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/protocol.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/protocol.rs
index e8cff5cdeb..79cc410e9c 100644
--- a/libs/cua-driver/rust/crates/cua-driver-core/src/protocol.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/protocol.rs
@@ -396,7 +396,7 @@ Efficient loop:
1. `list_windows({{app:"Name"}})` or `launch_app` for `pid` and `window_id`. Unfiltered `list_windows`/`list_apps` list the whole host.
2. Read narrowly: `get_window_state` with `query:"Save"` (or `max_elements`). Re-read with `since:"latest"` for only what changed. For just a picture, `include_accessibility_tree:false` (tokens stay valid).
3. Act by `element_token` ({tree_kind}): row `[N]` is `<snapshot_id>:N`. Pixel `x,y` only for surfaces missing from the tree.
-4. Act through `run_steps({{steps:[{{tool,args}}],observe:true}})`, even for one step: it stops at the first failure and returns what changed, so no separate re-read.{script_line}
+4. Act through `run_steps({{steps:[{{tool,args}}],observe:{{}}}})`, even for one step: it stops at the first failure and returns what changed, so no separate re-read.{script_line}
5. Verify at checkpoints, not after every action: `verify_state(pid, window_id, expect)`. `unknown` and `effect:"unverifiable"` are not success.
Use the narrowest semantic route first: `set_window_frame` plus `list_windows` for geometry, typed browser tools for pages, clipboard tools for the clipboard. Stay in the background; `delivery_mode:"foreground"` only if refused or unverifiable.
diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/script_tool.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/script_tool.rs
index b465d07c82..8542c8f6b8 100644
--- a/libs/cua-driver/rust/crates/cua-driver-core/src/script_tool.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/script_tool.rs
@@ -36,7 +36,7 @@ use crate::{
},
protocol::{Content, ToolResult},
recording_tools::ReplayRegistrySlot,
- tool::{Tool, ToolDef, ToolRegistry},
+ tool::{Tool, ToolDef, ToolRegistry, DISABLE_CONFIG_KEY, LEGACY_CONFIG_KEY},
};
mod engine;
@@ -46,14 +46,9 @@ use engine::{FailureKind, HostCall, HostError, Limits};
pub const RUN_SCRIPT_TOOL: &str = "run_script";
/// Environment switch that turns the tool off when set to `1`.
pub const DISABLE_ENV: &str = "CUA_DRIVER_DISABLE_RUN_SCRIPT";
-/// `~/.cua-driver/config.json` key that turns the tool off when `true`.
-pub const DISABLE_CONFIG_KEY: &str = "disable_run_script";
/// Legacy opt-in switch from when the tool was off by default. `0` still
/// turns the tool off; `1` changes nothing.
pub const LEGACY_ENV: &str = "CUA_DRIVER_EXPERIMENTAL_SCRIPT";
-/// Legacy `~/.cua-driver/config.json` key. `false` turns the tool off;
-/// `true` changes nothing.
-pub const LEGACY_CONFIG_KEY: &str = "experimental_script";
pub const DEFAULT_TIMEOUT_MS: u64 = 30_000;
pub const MAX_TIMEOUT_MS: u64 = 120_000;
diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/session_tools.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/session_tools.rs
index 45fee286cc..3bc43f816e 100644
--- a/libs/cua-driver/rust/crates/cua-driver-core/src/session_tools.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/session_tools.rs
@@ -600,7 +600,7 @@ mod tests {
let structured = result.structured_content.as_ref().unwrap();
assert_eq!(structured["cursor_motion"]["style"], "magnetic");
assert_eq!(structured["cursor_motion"]["timing"], "fitts");
- assert_eq!(structured["cursor_motion"]["effects"]["trail"], true);
+ assert_eq!(structured["cursor_motion"]["effects"]["trail"], "on");
EndSessionTool.invoke(json!({"session": id})).await;
// Optional: absent unless the call set it.
diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/tool.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/tool.rs
index 4f8a635c04..7bf3a58ad7 100644
--- a/libs/cua-driver/rust/crates/cua-driver-core/src/tool.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/tool.rs
@@ -253,10 +253,35 @@ fn unknown_argument(def: &ToolDef, args: &Value) -> Option<String> {
/// validation, so a batch step accepts what a direct call accepts. `Err` is a
/// refusal detail for an alias that cannot be translated.
pub(crate) fn normalize_argument_aliases(tool_name: &str, args: &mut Value) -> Result<(), String> {
+ if cfg!(target_os = "linux") && tool_name == "set_value" {
+ if let Some(value @ Value::Number(_)) = args.get_mut("value") {
+ *value = Value::String(value.to_string());
+ }
+ }
normalize_zoom_args(tool_name, args);
normalize_key_args(tool_name, args);
normalize_menu_args(tool_name, args);
- normalize_scroll_args(tool_name, args)
+ normalize_scroll_args(tool_name, args)?;
+ normalize_set_config_args(tool_name, args)
+}
+
+/// `{key, value}` is unadvertised; rewrite it before the closed schema rejects `key`.
+fn normalize_set_config_args(tool_name: &str, args: &mut Value) -> Result<(), String> {
+ let Some(object) = args.as_object_mut().filter(|_| tool_name == "set_config") else {
+ return Ok(());
+ };
+ match (object.remove("key"), object.remove("value")) {
+ (None, None) => Ok(()),
+ (Some(Value::String(key)), Some(value))
+ if !key.starts_with('_') && !matches!(key.as_str(), "key" | "value" | "session") =>
+ {
+ object.insert(key, value);
+ Ok(())
+ }
+ (Some(Value::String(key)), Some(_)) => Err(format!("key '{key}' is reserved")),
+ (Some(_), _) => Err("key requires an exact value".into()),
+ (None, Some(_)) => Err("value requires an exact key".into()),
+ }
}
/// `invoke_menu` takes `path` as a list of labels. Models also send
@@ -591,8 +616,6 @@ pub(crate) fn advertised_runtime_input_schema(tool_name: &str, schema: &Value) -
if !crate::action_target::supports_typed_target(tool_name) {
return schema;
}
- // Reuse the portable contract's exact tagged-union schema while retaining
- // the live runtime's broader legacy `scope=window|desktop` decoder.
if let Some(portable) = cua_driver_contract::tool_contract(tool_name) {
if let Some(portable_properties) = portable
.input_schema
@@ -613,6 +636,12 @@ pub(crate) fn advertised_runtime_input_schema(tool_name: &str, schema: &Value) -
/// To be removed in a future release.
pub const RENAMED_TOOLS: &[(&str, &str)] = &[("run_actions", crate::batch_tools::RUN_STEPS_TOOL)];
+/// `~/.cua-driver/config.json` key that turns `run_script` off when `true`.
+pub const DISABLE_CONFIG_KEY: &str = "disable_run_script";
+/// Legacy `~/.cua-driver/config.json` key. `false` turns `run_script` off;
+/// `true` changes nothing.
+pub const LEGACY_CONFIG_KEY: &str = "experimental_script";
+
/// The current name of a renamed tool, or `None` when `name` is not an old name.
pub fn renamed_tool(name: &str) -> Option<&'static str> {
RENAMED_TOOLS
@@ -1865,6 +1894,30 @@ impl ToolRegistry {
);
}
+ if resolved_name == "set_config" && args.get("capture_scope").is_some() {
+ return ToolResult::error(
+ "config key 'capture_scope' is retired; select a window or desktop target on each action",
+ )
+ .with_structured(serde_json::json!({
+ "code": "config_key_retired",
+ "key": "capture_scope",
+ "replacement": "action.target",
+ }));
+ }
+ if let Some(key) = [DISABLE_CONFIG_KEY, LEGACY_CONFIG_KEY]
+ .into_iter()
+ .find(|key| resolved_name == "set_config" && args.get(key).is_some())
+ {
+ return ToolResult::error(format!(
+ "config key '{key}' is set by whoever runs cua-driver, in \
+ ~/.cua-driver/config.json or the environment, not through set_config"
+ ))
+ .with_structured(serde_json::json!({
+ "code": "config_key_operator_only",
+ "key": key,
+ }));
+ }
+
if let Some(detail) = unknown_argument {
return protected_refusal(
"invalid_arguments",
@@ -2972,20 +3025,6 @@ impl ToolRegistry {
context: &crate::session_authorization::EffectiveAuthorizationContext,
lifecycle_session: Option<&str>,
) -> Result<(), ToolResult> {
- if args.get("capture_scope").is_some()
- || args.get("key").and_then(Value::as_str) == Some("capture_scope")
- {
- return Err(
- ToolResult::error(
- "config key 'capture_scope' is retired; select a window or desktop target on each action",
- )
- .with_structured(serde_json::json!({
- "code": "config_key_retired",
- "key": "capture_scope",
- "replacement": "action.target",
- })),
- );
- }
if context.mode() == crate::authorization::PermissionMode::Unrestricted
&& context.capability_manifest().is_none()
{
@@ -3012,25 +3051,8 @@ impl ToolRegistry {
}
let mut exact = serde_json::Map::new();
- if let Some(key) = args.get("key").and_then(Value::as_str) {
- if matches!(key, "key" | "value" | "session" | "_session_id")
- || !properties.contains_key(key)
- {
- return Err(protected_scope_refusal(&format!(
- "set_config key '{key}' is not present in the concrete tool schema"
- )));
- }
- let value = args
- .get("value")
- .ok_or_else(|| protected_scope_refusal("set_config key requires an exact value"))?;
- exact.insert(key.to_owned(), value.clone());
- } else if args.get("value").is_some() {
- return Err(protected_scope_refusal(
- "set_config value requires an exact key",
- ));
- }
for (key, value) in object {
- if matches!(key.as_str(), "session" | "key" | "value") || key.starts_with('_') {
+ if key == "session" || key.starts_with('_') {
continue;
}
exact.insert(key.clone(), value.clone());
@@ -5570,10 +5592,23 @@ resources:
"value": true,
"session": "config"
}),
- context,
+ context.clone(),
)
.await;
assert_eq!(unknown.is_error, Some(true));
+ for key in ["disable_run_script", "experimental_script"] {
+ for args in [
+ serde_json::json!({"key": key, "value": true}),
+ serde_json::json!({key: true}),
+ ] {
+ let refused = registry
+ .invoke_with_context("set_config", args.clone(), context.clone())
+ .await;
+ let structured = refused.structured_content.unwrap();
+ assert_eq!(structured["code"], "config_key_operator_only", "{args}");
+ assert_eq!(structured["key"], key, "{args}");
+ }
+ }
assert_eq!(hits.load(Ordering::SeqCst), 3);
assert_eq!(provider.requests.load(Ordering::SeqCst), 0);
}
@@ -7127,6 +7162,75 @@ mod argument_shape_tests {
assert_eq!(click, json!({"dy": 4}));
}
+ #[test]
+ fn set_config_key_value_alias_matches_the_direct_field_for_every_key() {
+ for key in [
+ "capture_mode",
+ "max_image_dimension",
+ "experimental_pip",
+ "experimental_pip_geometry",
+ "cursor.motion",
+ "cursor.motion.style",
+ "cursor.motion.timing",
+ "cursor.motion.effects.trail",
+ "cursor.motion.effects.glow",
+ "cursor.motion.effects.magnet",
+ "cursor.motion.effects.ripple",
+ "cursor.motion.effects.squish",
+ ] {
+ let mut aliased = json!({"key": key, "value": "default"});
+ normalize_argument_aliases("set_config", &mut aliased).unwrap();
+ assert_eq!(aliased, json!({key: "default"}), "{key}");
+ }
+ let mut bare_key = json!({"key": "capture_mode"});
+ let error = normalize_argument_aliases("set_config", &mut bare_key).unwrap_err();
+ assert!(error.contains("exact value"), "{error}");
+ let mut bare_value = json!({"value": 1});
+ let error = normalize_argument_aliases("set_config", &mut bare_value).unwrap_err();
+ assert!(error.contains("exact key"), "{error}");
+
+ let mut unknown = json!({"key": "not_a_key", "value": 1});
+ normalize_argument_aliases("set_config", &mut unknown).unwrap();
+ let def = ToolDef {
+ name: "set_config".into(),
+ description: String::new(),
+ input_schema: json!({
+ "type": "object",
+ "properties": {"max_image_dimension": {"type": "integer"}},
+ "additionalProperties": false
+ }),
+ read_only: false,
+ destructive: false,
+ idempotent: true,
+ open_world: false,
+ };
+ let detail = unknown_argument(&def, &unknown).unwrap();
+ assert!(detail.contains("not_a_key"), "{detail}");
+ let mut retired = json!({"key": "capture_scope", "value": "desktop"});
+ normalize_argument_aliases("set_config", &mut retired).unwrap();
+ assert_eq!(retired, json!({"capture_scope": "desktop"}));
+ }
+
+ #[test]
+ fn set_config_alias_refuses_reserved_keys_before_authorization() {
+ for key in [
+ "_session_id",
+ "_transport_session_id",
+ "_public_session_label",
+ "_other",
+ "key",
+ "value",
+ "session",
+ ] {
+ let mut args = json!({"key": key, "value": "forged", "max_image_dimension": 1});
+ let error = normalize_argument_aliases("set_config", &mut args).unwrap_err();
+ assert_eq!(error, format!("key '{key}' is reserved"));
+ let object = args.as_object().unwrap();
+ assert!(object.keys().all(|name| !name.starts_with('_')), "{args}");
+ assert!(object.get(key).is_none(), "{key} was written: {args}");
+ }
+ }
+
#[test]
fn unknown_arguments_are_all_named_with_the_accepted_ones() {
let detail = unknown_argument(
diff --git a/libs/cua-driver/rust/crates/cua-driver-sdk/src/cursor_motion.rs b/libs/cua-driver/rust/crates/cua-driver-sdk/src/cursor_motion.rs
index e27e5a84ec..6985675d8d 100644
--- a/libs/cua-driver/rust/crates/cua-driver-sdk/src/cursor_motion.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-sdk/src/cursor_motion.rs
@@ -9,7 +9,8 @@
use cua_cursor_motion as cm;
use cua_driver_contract::{
- CursorMotionEffects, CursorMotionEffectsOutput, CursorMotionStyle, CursorMotionTiming,
+ CursorEffectSetting, CursorMotionEffects, CursorMotionEffectsOutput, CursorMotionStyle,
+ CursorMotionTiming,
};
use std::sync::Arc;
@@ -33,12 +34,13 @@ fn timing_in(timing: CursorMotionTiming) -> cm::MotionTiming {
}
fn overrides_in(e: CursorMotionEffects) -> cm::MotionEffects {
+ let flag = |setting: Option<CursorEffectSetting>| setting.and_then(|s| s.override_value());
cm::MotionEffects {
- trail: e.trail,
- glow: e.glow,
- magnet: e.magnet,
- ripple: e.ripple,
- squish: e.squish,
+ trail: flag(e.trail),
+ glow: flag(e.glow),
+ magnet: flag(e.magnet),
+ ripple: flag(e.ripple),
+ squish: flag(e.squish),
}
}
diff --git a/libs/cua-driver/rust/crates/cua-driver-testkit/src/lib.rs b/libs/cua-driver/rust/crates/cua-driver-testkit/src/lib.rs
index 63921466e5..306e361a70 100644
--- a/libs/cua-driver/rust/crates/cua-driver-testkit/src/lib.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-testkit/src/lib.rs
@@ -53,6 +53,7 @@ mod raw;
mod reaper;
mod response;
pub mod sentinel;
+pub mod vertex;
mod windows_setup;
pub use browser_fixture::BrowserFixtureServer;
diff --git a/libs/cua-driver/rust/crates/cua-driver-testkit/src/vertex.rs b/libs/cua-driver/rust/crates/cua-driver-testkit/src/vertex.rs
new file mode 100644
index 0000000000..5b369ab254
--- /dev/null
+++ b/libs/cua-driver/rust/crates/cua-driver-testkit/src/vertex.rs
@@ -0,0 +1,169 @@
+//! Vertex AI / Gemini function-declaration `Schema` subset (#4798).
+//!
+//! The field list is the Vertex AI `Schema` object
+//! (https://cloud.google.com/vertex-ai/docs/reference/rest/v1/Schema).
+//! Keywords outside that object, type arrays, and untyped nodes are rejected
+//! by those clients for the whole `tools/list`.
+
+use serde_json::Value;
+
+const VERTEX_SCHEMA_FIELDS: &[&str] = &[
+ "type",
+ "format",
+ "title",
+ "description",
+ "default",
+ "items",
+ "minItems",
+ "maxItems",
+ "enum",
+ "properties",
+ "propertyOrdering",
+ "required",
+ "minProperties",
+ "maxProperties",
+ "minimum",
+ "maximum",
+ "minLength",
+ "maxLength",
+ "pattern",
+ "example",
+ "anyOf",
+ "additionalProperties",
+ "$defs",
+];
+
+const VERTEX_SCHEMA_TYPES: &[&str] = &[
+ "string", "number", "integer", "boolean", "array", "object", "null",
+];
+
+/// Every node of `schema` that falls outside the Vertex AI `Schema` object.
+/// Walks schema positions only, so property names and `default` / `example` /
+/// `enum` payloads are not mistaken for keywords.
+pub fn input_schema_violations(schema: &Value) -> Vec<String> {
+ let mut out = Vec::new();
+ walk(schema, "$", &mut out);
+ out
+}
+
+fn walk(schema: &Value, path: &str, out: &mut Vec<String>) {
+ let Some(node) = schema.as_object() else {
+ out.push(format!("{path}: schema must be an object, got {schema}"));
+ return;
+ };
+ for key in node.keys() {
+ if !VERTEX_SCHEMA_FIELDS.contains(&key.as_str()) {
+ out.push(format!(
+ "{path}: `{key}` is not a field of the Vertex AI Schema object"
+ ));
+ }
+ }
+ match node.get("type") {
+ Some(Value::String(name)) if VERTEX_SCHEMA_TYPES.contains(&name.as_str()) => {}
+ Some(other) => out.push(format!(
+ "{path}: type must be one of {VERTEX_SCHEMA_TYPES:?} as a single string, got {other}"
+ )),
+ None => out.push(format!("{path}: schema node has no type")),
+ }
+ if let Some(values) = node.get("enum") {
+ match values.as_array() {
+ Some(values) if values.iter().all(Value::is_string) => {}
+ _ => out.push(format!(
+ "{path}: enum must be a list of strings, got {values}"
+ )),
+ }
+ }
+ for keyword in ["properties", "$defs"] {
+ if let Some(children) = node.get(keyword).and_then(Value::as_object) {
+ for (name, child) in children {
+ walk(child, &format!("{path}.{keyword}.{name}"), out);
+ }
+ }
+ }
+ if let Some(items) = node.get("items") {
+ walk(items, &format!("{path}.items"), out);
+ }
+ if let Some(additional) = node.get("additionalProperties") {
+ if !additional.is_boolean() {
+ walk(additional, &format!("{path}.additionalProperties"), out);
+ }
+ }
+ if let Some(variants) = node.get("anyOf").and_then(Value::as_array) {
+ for (index, variant) in variants.iter().enumerate() {
+ walk(variant, &format!("{path}.anyOf[{index}]"), out);
+ }
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use serde_json::json;
+
+ fn lint(schema: Value) -> Vec<String> {
+ input_schema_violations(&schema)
+ }
+
+ #[test]
+ fn vertex_lint_follows_the_documented_schema_fields() {
+ let accepted = lint(json!({
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["value"],
+ "properties": {
+ "value": {
+ "type": "string",
+ "anyOf": [{"type": "string", "minLength": 1}, {"type": "string", "enum": ["x"]}]
+ },
+ "limit": {"type": "integer", "minimum": 0, "maximum": 9},
+ "tags": {"type": "array", "minItems": 1, "maxItems": 2, "items": {"type": "string"}},
+ "const": {"type": "string", "default": {"oneOf": "payload, not a keyword"}}
+ }
+ }));
+ assert!(accepted.is_empty(), "{accepted:#?}");
+
+ let rejected = lint(json!({
+ "type": "object",
+ "properties": {
+ "a": {"oneOf": [{"type": "string"}]},
+ "b": {"type": "string", "const": "x"},
+ "c": {"type": ["number", "null"]},
+ "d": {"type": "array", "uniqueItems": true, "items": {"enum": ["x"]}},
+ "e": {"type": "boolean", "enum": [true]},
+ "f": {"anyOf": [{"type": "string"}, {"type": "integer"}]}
+ }
+ }));
+ for expected in [
+ "$.properties.a: `oneOf` is not a field",
+ "$.properties.a: schema node has no type",
+ "$.properties.b: `const` is not a field",
+ "$.properties.c: type must be one of",
+ "$.properties.d: `uniqueItems` is not a field",
+ "$.properties.d.items: schema node has no type",
+ "$.properties.e: enum must be a list of strings",
+ "$.properties.f: schema node has no type",
+ ] {
+ assert!(
+ rejected
+ .iter()
+ .any(|violation| violation.starts_with(expected)),
+ "missing `{expected}` in {rejected:#?}"
+ );
+ }
+ }
+
+ #[test]
+ fn published_input_schemas_are_vertex_gemini_compatible() {
+ let mut violations = Vec::new();
+ for contract in cua_driver_contract::manifest().tools {
+ for violation in input_schema_violations(&contract.input_schema) {
+ violations.push(format!("{} {violation}", contract.name));
+ }
+ }
+ assert!(
+ violations.is_empty(),
+ "input schema nodes outside the Vertex AI Schema object (#4798):\n{}",
+ violations.join("\n")
+ );
+ }
+}
diff --git a/libs/cua-driver/rust/crates/cua-driver/src/cli.rs b/libs/cua-driver/rust/crates/cua-driver/src/cli.rs
index 4c2faff25e..265f8169ed 100644
--- a/libs/cua-driver/rust/crates/cua-driver/src/cli.rs
+++ b/libs/cua-driver/rust/crates/cua-driver/src/cli.rs
@@ -4414,7 +4414,7 @@ fn cli_docs_literal() -> serde_json::Value {
"subcommands": [
{"name":"show","abstract":"Print the full config.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]},
{"name":"get","abstract":"Print one config key.","discussion":"","arguments":[{"name":"key","help":"Config key to read.","type":"String","is_optional":false}],"options":[],"flags":[],"subcommands":[]},
- {"name":"set","abstract":"Set one config key.","discussion":"Cursor motion defaults are saved keys that apply to sessions started afterwards: cursor.motion.style (signature_arc, spring_settle, magnetic, comet_swoop, adaptive, classic), cursor.motion.timing (native, fitts, fixed) and cursor.motion.effects.<trail|glow|magnet|ripple|squish> (true, false). Use null for a key to clear it, or cursor.motion null to clear all. A start_session cursor_motion or a set_agent_cursor_motion call overrides the saved default.","arguments":[{"name":"key","help":"Config key to write.","type":"String","is_optional":false},{"name":"value","help":"Value to store.","type":"String","is_optional":false}],"options":[],"flags":[],"subcommands":[]},
+ {"name":"set","abstract":"Set one config key.","discussion":"Cursor motion defaults are saved keys that apply to sessions started afterwards: cursor.motion.style (signature_arc, spring_settle, magnetic, comet_swoop, adaptive, classic), cursor.motion.timing (native, fitts, fixed) and cursor.motion.effects.<trail|glow|magnet|ripple|squish> (on, off, default). Use default for a key to clear it, or cursor.motion default to clear all. A start_session cursor_motion or a set_agent_cursor_motion call overrides the saved default.","arguments":[{"name":"key","help":"Config key to write.","type":"String","is_optional":false},{"name":"value","help":"Value to store.","type":"String","is_optional":false}],"options":[],"flags":[],"subcommands":[]},
{"name":"reset","abstract":"Reset config to defaults.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]}
]
},
@@ -5193,12 +5193,7 @@ pub fn run_config_cmd(
// Parse value: try JSON, fall back to string.
let parsed_value: serde_json::Value = serde_json::from_str(value)
.unwrap_or_else(|_| serde_json::Value::String(value.to_owned()));
- // Dotted keys (cursor.motion.style, ...) use the {key, value} shape.
- let set_args = if key.contains('.') {
- serde_json::json!({ "key": key, "value": parsed_value })
- } else {
- serde_json::json!({ key: parsed_value })
- };
+ let set_args = serde_json::json!({ key: parsed_value });
let result = call("set_config", set_args);
exit_on_tool_error(&result);
println!("Config updated.");
@@ -5221,7 +5216,7 @@ pub fn run_config_cmd(
// Also clear the saved cursor motion defaults.
exit_on_tool_error(&call(
"set_config",
- serde_json::json!({ "key": "cursor.motion", "value": null }),
+ serde_json::json!({ "cursor.motion": "default" }),
));
println!("Config reset to defaults.");
let config = get_config();
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/protocol_schema_test.rs b/libs/cua-driver/rust/crates/cua-driver/tests/protocol_schema_test.rs
index 748d657d17..08e814b34e 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/protocol_schema_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver/tests/protocol_schema_test.rs
@@ -51,8 +51,21 @@ fn tools_list_schema_shape() {
//! no `type_text_chars` either — the old Windows mirror asserted it was
//! exposed, but that had never been run). The advertised schemas must still
//! carry their expected knobs.
- let mut d = RawDriver::spawn().expect("spawn source-built driver for schema test");
+ assert_tools_list_schema_shape(
+ RawDriver::spawn().expect("spawn source-built driver for schema test"),
+ );
+}
+
+#[cfg(target_os = "linux")]
+#[test]
+fn explicit_direct_tools_list_schema_shape() {
+ // Supported direct stdio transport. This does not replace the daemon gate.
+ assert_tools_list_schema_shape(
+ RawDriver::spawn_explicit_direct().expect("spawn source-built direct MCP driver"),
+ );
+}
+fn assert_tools_list_schema_shape(mut d: RawDriver) {
d.send(&serde_json::json!({"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}));
d.recv();
@@ -61,6 +74,37 @@ fn tools_list_schema_shape() {
let tools = list_resp["result"]["tools"]
.as_array()
.expect("tools array");
+ assert!(!tools.is_empty(), "tools/list must not be empty");
+ assert!(
+ list_resp["result"]["nextCursor"].is_null(),
+ "unread tool page"
+ );
+ let names: BTreeSet<&str> = tools
+ .iter()
+ .map(|tool| tool["name"].as_str().unwrap())
+ .collect();
+ assert_eq!(names.len(), tools.len(), "duplicate tool name");
+ assert!(
+ names.contains("run_steps"),
+ "runtime-only batch tool missing"
+ );
+ let platform = if cfg!(target_os = "macos") {
+ cua_driver_contract::Platform::Macos
+ } else if cfg!(target_os = "windows") {
+ cua_driver_contract::Platform::Windows
+ } else {
+ cua_driver_contract::Platform::Linux
+ };
+ for tool in cua_driver_contract::manifest().tools {
+ if tool.platforms.contains(&platform) {
+ assert!(
+ names.contains(tool.name.as_str()),
+ "missing portable tool {}",
+ tool.name
+ );
+ }
+ }
+ eprintln!("linted {} live tool input schemas", tools.len());
let properties = |name: &str| {
&tools
@@ -93,9 +137,13 @@ fn tools_list_schema_shape() {
"{name} top-level {unsupported} is rejected by Bedrock: {schema}"
);
}
- for field in ["inputSchema", "outputSchema"] {
- assert_string_enums(&tool[field], &format!("{name}.{field}"));
- }
+ assert_string_enums(&tool["outputSchema"], &format!("{name}.outputSchema"));
+ let violations = cua_driver_testkit::vertex::input_schema_violations(schema);
+ assert!(
+ violations.is_empty(),
+ "{name} inputSchema is outside the Vertex AI Schema object (#4798):\n{}",
+ violations.join("\n")
+ );
}
assert!(
undocumented.is_empty(),
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/protocol_set_value_compat_test.rs b/libs/cua-driver/rust/crates/cua-driver/tests/protocol_set_value_compat_test.rs
new file mode 100644
index 0000000000..c39f313fe8
--- /dev/null
+++ b/libs/cua-driver/rust/crates/cua-driver/tests/protocol_set_value_compat_test.rs
@@ -0,0 +1,62 @@
+//! Linux wire-argument compatibility, without any desktop input.
+//! Missing element tokens force the real handler to refuse before AT-SPI or
+//! keyboard delivery. This certifies argument admission, not value delivery.
+#![cfg(target_os = "linux")]
+
+use cua_driver_testkit::RawDriver;
+use serde_json::{json, Value};
+
+#[test]
+fn numeric_set_value_reaches_the_same_handler_directly_and_in_a_batch() {
+ let mut driver =
+ RawDriver::spawn_explicit_direct().expect("spawn source-built direct MCP driver");
+ driver.send(&json!({"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}));
+ assert!(driver.recv()["result"].is_object());
+ let expected = "set_value requires element_token to address the target element.";
+ for value in [
+ json!(0),
+ json!(-12),
+ json!(4.5),
+ json!(18446744073709551615u64),
+ json!(" 004.50 "),
+ ] {
+ let arguments = json!({"pid":1,"window_id":1,"value":value});
+ driver.send(
+ &json!({"jsonrpc":"2.0","id":2,"method":"tools/call","params":{
+ "name":"set_value","arguments":arguments
+ }}),
+ );
+ let direct = driver.recv();
+ assert_eq!(direct["result"]["isError"], true, "{direct}");
+ assert_eq!(direct["result"]["content"][0]["text"], expected, "{direct}");
+ for batch_tool in ["run_steps", "run_actions"] {
+ driver.send(
+ &json!({"jsonrpc":"2.0","id":3,"method":"tools/call","params":{
+ "name":batch_tool,"arguments":{"steps":[{"tool":"set_value","args":arguments}]}
+ }}),
+ );
+ let batch = driver.recv();
+ let result = &batch["result"]["structuredContent"];
+ assert_ne!(result["code"], "invalid_batch", "{batch}");
+ assert_eq!(result["steps"][0]["phase"], "action", "{batch}");
+ assert_eq!(result["steps"][0]["message"], expected, "{batch}");
+ }
+ }
+ for value in [Value::Null, json!(true), json!([]), json!({})] {
+ driver.send(
+ &json!({"jsonrpc":"2.0","id":4,"method":"tools/call","params":{
+ "name":"set_value","arguments":{"pid":1,"window_id":1,"value":value}
+ }}),
+ );
+ let direct = driver.recv();
+ assert_eq!(
+ direct["result"]["structuredContent"]["code"], "invalid_arguments",
+ "{direct}"
+ );
+ assert_eq!(
+ direct["result"]["content"][0]["text"],
+ "set_value: 'value' must be a string or a number.",
+ "{direct}"
+ );
+ }
+}
diff --git a/libs/cua-driver/rust/crates/cursor-overlay/src/motion.rs b/libs/cua-driver/rust/crates/cursor-overlay/src/motion.rs
index 29069c8e31..4a694f7aaa 100644
--- a/libs/cua-driver/rust/crates/cursor-overlay/src/motion.rs
+++ b/libs/cua-driver/rust/crates/cursor-overlay/src/motion.rs
@@ -186,13 +186,8 @@ impl MotionConfig {
None | Some(Value::Null) => {}
Some(Value::Object(map)) => {
for (key, value) in map {
- let flag = match value {
- Value::Null => None,
- Value::Bool(flag) => Some(*flag),
- other => {
- return Err(format!("effects.{key} must be a boolean, got {other}"))
- }
- };
+ let flag =
+ crate::motion_defaults::effect_flag(&format!("effects.{key}"), value)?;
match key.as_str() {
"trail" => out.effects.trail = flag,
"glow" => out.effects.glow = flag,
diff --git a/libs/cua-driver/rust/crates/cursor-overlay/src/motion_defaults.rs b/libs/cua-driver/rust/crates/cursor-overlay/src/motion_defaults.rs
index d5fcb04b7a..22e3b008c0 100644
--- a/libs/cua-driver/rust/crates/cursor-overlay/src/motion_defaults.rs
+++ b/libs/cua-driver/rust/crates/cursor-overlay/src/motion_defaults.rs
@@ -84,20 +84,10 @@ fn allowed_styles() -> String {
MotionStyle::ALL.map(MotionStyle::as_str).join(", ")
}
-fn effect_flag(key: &str, value: &Value) -> Result<Option<bool>, String> {
- match value {
- Value::Null => Ok(None),
- Value::Bool(flag) => Ok(Some(*flag)),
- Value::String(text) => match text.as_str() {
- "true" | "on" => Ok(Some(true)),
- "false" | "off" => Ok(Some(false)),
- "default" => Ok(None),
- _ => Err(format!(
- "{key} must be true, false or default, got `{text}`"
- )),
- },
- other => Err(format!("{key} must be true, false or default, got {other}")),
- }
+pub(crate) fn effect_flag(key: &str, value: &Value) -> Result<Option<bool>, String> {
+ cua_driver_contract::CursorEffectSetting::from_json(value)
+ .map(cua_driver_contract::CursorEffectSetting::override_value)
+ .ok_or_else(|| format!("{key} must be on, off or default, got {value}"))
}
/// Validate one config write and fold it into `saved`.
@@ -206,30 +196,27 @@ pub fn config_schema_properties() -> Map<String, Value> {
properties.insert(
format!("cursor.motion.effects.{name}"),
json!({
- "type": "boolean",
- "description": format!("Saved default for the `{name}` cursor effect. Unset follows the style.")
+ "type": "string",
+ "enum": ["on", "off", "default"],
+ "description": format!("Saved default for the `{name}` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.")
}),
);
}
properties.insert(
KEY_PREFIX.to_owned(),
json!({
- "description": "Pass null (or `default`) to clear every saved cursor motion default."
+ "type": "string",
+ "enum": ["default"],
+ "description": "Pass `default` to clear every saved cursor motion default."
}),
);
properties
}
-/// Apply every cursor motion write in a `set_config` call, accepting both the
-/// `{key, value}` shape and direct dotted fields. Returns the keys written, or
+/// Apply every cursor motion write in a `set_config` call. Returns the keys written, or
/// the first validation error (later keys are not written after an error).
pub fn apply_config_args(args: &Value) -> Result<Vec<String>, String> {
let mut writes: Vec<(String, Value)> = Vec::new();
- if let (Some(key), Some(value)) = (args.get("key").and_then(Value::as_str), args.get("value")) {
- if is_motion_key(key) {
- writes.push((key.to_owned(), value.clone()));
- }
- }
if let Some(object) = args.as_object() {
for (key, value) in object {
if is_motion_key(key) {
@@ -534,7 +521,87 @@ mod tests {
assert!(properties.contains_key(TIMING_KEY));
assert!(properties.contains_key(KEY_PREFIX));
for name in EFFECT_NAMES {
- assert!(properties.contains_key(&format!("cursor.motion.effects.{name}")));
+ let property = &properties[&format!("cursor.motion.effects.{name}")];
+ assert_eq!(property["enum"], json!(["on", "off", "default"]));
+ }
+ assert_eq!(properties[KEY_PREFIX]["enum"], json!(["default"]));
+ }
+
+ #[test]
+ fn typed_effect_roundtrip_preserves_reset_and_omission_when_applied() {
+ use cua_driver_contract::{SetAgentCursorMotionInput, StartSessionInput};
+
+ let base = MotionConfig::default()
+ .with_style_args(&json!({"effects": {
+ "trail": false, "glow": false, "magnet": false,
+ "ripple": false, "squish": false
+ }}))
+ .unwrap();
+ for name in EFFECT_NAMES {
+ for value in [Value::Null, json!("default"), json!(true), json!(false)] {
+ let mut effects = Map::new();
+ effects.insert(name.to_owned(), value.clone());
+ let args = json!({"session": "test", "effects": effects});
+ let typed: SetAgentCursorMotionInput =
+ serde_json::from_value(args.clone()).unwrap();
+ let wire = serde_json::to_value(typed).unwrap();
+ let direct = base.with_style_args(&args).unwrap();
+ let roundtrip = base.with_style_args(&wire).unwrap();
+ assert_eq!(roundtrip.effects, direct.effects, "{name}: {value}");
+ let serialized = serde_json::to_value(roundtrip.effects).unwrap();
+ let expected = if value.is_null() || value == "default" {
+ Value::Null
+ } else {
+ value.clone()
+ };
+ assert_eq!(serialized[name], expected, "{name}: reset/set intent");
+ for untouched in EFFECT_NAMES.into_iter().filter(|other| *other != name) {
+ assert_eq!(serialized[untouched], false, "omitted {untouched}");
+ }
+ let start: StartSessionInput = serde_json::from_value(json!({
+ "session": "test", "cursor_motion": {"effects": effects}
+ }))
+ .unwrap();
+ let wire = serde_json::to_value(start).unwrap();
+ let started = base.with_motion_args(&wire["cursor_motion"]).unwrap();
+ assert_eq!(started.effects, direct.effects, "nested {name}: {value}");
+ }
}
}
+
+ #[test]
+ fn default_resets_one_effect_and_an_omitted_effect_keeps() {
+ let path = temp_path("effects");
+ set_key_at(&path, "cursor.motion.effects.trail", &json!("off")).unwrap();
+ set_key_at(&path, "cursor.motion.effects.glow", &json!("on")).unwrap();
+ set_key_at(&path, "cursor.motion.effects.trail", &json!("default")).unwrap();
+ let saved = load_from(&path);
+ assert_eq!(saved.effects.trail, None);
+ assert_eq!(saved.effects.glow, Some(true));
+
+ let base = MotionConfig::default();
+ let set = base
+ .with_style_args(
+ &json!({"effects": {"trail": "off", "glow": "on", "ripple": "default"}}),
+ )
+ .unwrap();
+ assert_eq!(set.effects.trail, Some(false));
+ assert_eq!(set.effects.glow, Some(true));
+ assert_eq!(set.effects.ripple, None);
+ let kept = set
+ .with_style_args(&json!({"effects": {"trail": "on"}}))
+ .unwrap();
+ assert_eq!(kept.effects.trail, Some(true));
+ assert_eq!(kept.effects.glow, Some(true));
+
+ let legacy = base
+ .with_style_args(&json!({"effects": {"trail": true, "glow": false, "magnet": null, "ripple": "true", "squish": "false"}}))
+ .unwrap();
+ assert_eq!(legacy.effects.trail, Some(true));
+ assert_eq!(legacy.effects.glow, Some(false));
+ assert_eq!(legacy.effects.magnet, None);
+ assert_eq!(legacy.effects.ripple, Some(true));
+ assert_eq!(legacy.effects.squish, Some(false));
+ let _ = std::fs::remove_dir_all(path.parent().unwrap());
+ }
}
diff --git a/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs b/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs
index 3116681b1f..3c07cd7bee 100644
--- a/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs
+++ b/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs
@@ -9177,7 +9177,7 @@ impl Tool for SetValueTool {
"pid":{"type":"integer","description":"Target process ID."},
"window_id":{"type":"integer","description":"Omit when element_token is supplied (the token carries it)."},
"element_token": cua_driver_core::tool_schema::element_token_schema(),
- "value":{"type":["string","number"],"description":"New value. Written through AT-SPI EditableText/Value when the element exposes them; otherwise (GTK2 spin scales, VCL spin buttons) the field is clicked with the session's real pointer, its text selected and replaced through the virtual keyboard and committed with Tab, then read back."},
+ "value":{"type":"string","description":"New value. Written through AT-SPI EditableText/Value when the element exposes them; otherwise (GTK2 spin scales, VCL spin buttons) the field is clicked with the session's real pointer, its text selected and replaced through the virtual keyboard and committed with Tab, then read back."},
"delivery_mode": crate::input::delivery::delivery_mode_schema()
},"additionalProperties":false
}),
@@ -13291,20 +13291,16 @@ impl Tool for SetConfigTool {
name: "set_config".into(),
description: "Update cua-driver-rs configuration. capture_mode / \
max_image_dimension take effect immediately.\n\n\
- Two input shapes (both accepted, matching Windows/Swift):\n\
- - **{key, value}** (preferred): `{\"key\": \"max_image_dimension\", \"value\": 800}` \
- — single leaf write.\n\
- - **Legacy per-field**: `{\"capture_mode\": \"som\", \"max_image_dimension\": 0}`.\n\n\
+ Pass each setting as its own field: `{\"capture_mode\": \"som\", \"max_image_dimension\": 0}`.\n\n\
The experimental_pip keys persist to ~/.cua-driver/config.json and apply on next \
daemon restart (the PiP backend is initialised once at startup; \
Linux ships only the trait stub today — see issue #1729).\n\n\
`cursor.motion.style`, `cursor.motion.timing` and `cursor.motion.effects.<name>` \
- save the default cursor motion for sessions started afterwards.".into(),
+ (`on`, `off`, or `default`) save the default cursor motion for sessions started afterwards. \
+ `cursor.motion: \"default\"` clears every saved cursor motion default.".into(),
input_schema: with_cursor_motion_config_properties(json!({"type":"object","properties":{
- "key":{"type":"string","description":"Name of a single config field to write ({key, value} shape). Pair with `value`."},
- "value":{"description":"New value for `key`. JSON type depends on the key."},
- "capture_mode":{"type":"string","enum":["ax","vision"],"description":"Legacy per-field shape. Default capture mode for get_window_state. (\"som\"/\"screenshot\" still decode as deprecated aliases.)"},
- "max_image_dimension":{"type":"integer","description":"Legacy per-field shape. Max dimension for screenshot resizing (0 = no limit)."},
+ "capture_mode":{"type":"string","enum":["ax","vision"],"description":"Default capture mode for get_window_state. (\"som\"/\"screenshot\" still decode as deprecated aliases.)"},
+ "max_image_dimension":{"type":"integer","description":"Max dimension for screenshot resizing (0 = no limit)."},
"experimental_pip":{"type":"boolean","description":"Enable the experimental PiP preview window (applies next restart; Linux backend stubbed)."},
"experimental_pip_geometry":{"type":"string","description":"PiP window size + optional position in `WxH` or `WxH+X+Y` form."}
},"additionalProperties":false})),
@@ -13313,9 +13309,7 @@ impl Tool for SetConfigTool {
}
async fn invoke(&self, args: Value) -> ToolResult {
use cua_driver_core::tool_args::ArgsExt;
- if args.get("capture_scope").is_some()
- || args.get("key").and_then(Value::as_str) == Some("capture_scope")
- {
+ if args.get("capture_scope").is_some() {
return ToolResult::error(
"config key 'capture_scope' is retired; select a window or desktop target on each action",
)
@@ -13334,64 +13328,6 @@ impl Tool for SetConfigTool {
.iter()
.map(|key| format!("{key} (applies to sessions started from now on)"))
.collect();
- // {key, value} shape (what the Swift/macOS and Windows callers send).
- // Linux previously read only the legacy per-field keys below, so a
- // `{"key":"max_image_dimension","value":800}` write was silently
- // dropped (issue #1923). Dispatch on `key` to the same fields.
- if let (Some(key), Some(val)) =
- (args.get("key").and_then(|v| v.as_str()), args.get("value"))
- {
- match key {
- "capture_mode" => match val.as_str() {
- Some(s) => {
- cfg.capture_mode = s.to_owned();
- if let Err(e) = pip_preview::write_config_key("capture_mode", Value::String(s.to_owned())) {
- tracing::warn!("set_config: failed to persist capture_mode: {e}");
- }
- parts.push(format!("capture_mode={s}"));
- }
- None => return ToolResult::error(format!("`capture_mode` must be a string, got {val}.")),
- },
- "max_image_dimension" => match val.as_u64() {
- Some(n) => {
- cfg.max_image_dimension = n as u32;
- if let Err(e) = pip_preview::write_config_key("max_image_dimension", Value::from(n)) {
- tracing::warn!("set_config: failed to persist max_image_dimension: {e}");
- }
- parts.push(format!("max_image_dimension={n}"));
- }
- None => return ToolResult::error(format!("`max_image_dimension` must be an integer, got {val}.")),
- },
- "experimental_pip" => match val.as_bool() {
- Some(b) => {
- if let Err(e) = pip_preview::write_config_key("experimental_pip", Value::Bool(b)) {
- return ToolResult::error(format!("failed to persist experimental_pip: {e}"));
- }
- parts.push(format!("experimental_pip={b} (next restart)"));
- }
- None => return ToolResult::error(format!("`experimental_pip` must be a boolean, got {val}.")),
- },
- "experimental_pip_geometry" => match val.as_str() {
- Some(s) => {
- if pip_preview::PipGeometry::parse(s).is_none() {
- return ToolResult::error(format!(
- "experimental_pip_geometry `{s}` is not a valid WxH or WxH+X+Y string"
- ));
- }
- if let Err(e) = pip_preview::write_config_key("experimental_pip_geometry", Value::String(s.to_owned())) {
- return ToolResult::error(format!("failed to persist experimental_pip_geometry: {e}"));
- }
- parts.push(format!("experimental_pip_geometry={s} (next restart)"));
- }
- None => return ToolResult::error(format!("`experimental_pip_geometry` must be a string, got {val}.")),
- },
- other if motion_keys.iter().any(|written| written == other) => {}
- other => return ToolResult::error(format!(
- "Unknown config key `{other}`. Known: capture_mode, max_image_dimension, experimental_pip, experimental_pip_geometry, cursor.motion.style, cursor.motion.timing, cursor.motion.effects.<name>."
- )),
- }
- }
- // Legacy per-field shape.
if let Some(mode) = args.opt_str("capture_mode") {
if let Err(e) =
pip_preview::write_config_key("capture_mode", Value::String(mode.clone()))
diff --git a/libs/cua-driver/rust/crates/platform-macos/src/tools/set_config.rs b/libs/cua-driver/rust/crates/platform-macos/src/tools/set_config.rs
index ec65c58403..731335df73 100644
--- a/libs/cua-driver/rust/crates/platform-macos/src/tools/set_config.rs
+++ b/libs/cua-driver/rust/crates/platform-macos/src/tools/set_config.rs
@@ -42,19 +42,11 @@ fn def() -> &'static ToolDef {
cursor.motion.effects.<trail|glow|magnet|ripple|squish> are saved to \
~/.cua-driver/config.json and seed sessions started afterwards. \
start_session cursor_motion and set_agent_cursor_motion override them; \
- reduced motion always wins.".into(),
+ reduced motion always wins."
+ .into(),
input_schema: with_cursor_motion_properties(serde_json::json!({
"type": "object",
"properties": {
- "key": {
- "type": "string",
- "description": "Name of a single config field to write ({key, value} shape, \
- matching the CLI `config set` and the Windows/Linux tools). Pair with `value`. \
- Equivalent to passing the field directly."
- },
- "value": {
- "description": "New value for `key`. JSON type depends on the key."
- },
"max_image_dimension": {
"type": "integer",
"description": "Max dimension for screenshot resizing (0 = no limit)."
@@ -87,9 +79,7 @@ impl Tool for SetConfigTool {
async fn invoke(&self, args: Value) -> ToolResult {
use cua_driver_core::tool_args::ArgsExt;
- if args.get("capture_scope").is_some()
- || args.get("key").and_then(Value::as_str) == Some("capture_scope")
- {
+ if args.get("capture_scope").is_some() {
return ToolResult::error(
"config key 'capture_scope' is retired; select a window or desktop target on each action",
)
@@ -99,22 +89,6 @@ impl Tool for SetConfigTool {
"replacement": "action.target",
}));
}
- // Whether run_script is offered is the operator's choice, made in
- // config.json or the environment; a model cannot change it.
- if let Some(key) = args
- .get("key")
- .and_then(Value::as_str)
- .filter(|key| matches!(*key, "disable_run_script" | "experimental_script"))
- {
- return ToolResult::error(format!(
- "config key '{key}' is set by whoever runs cua-driver, in \
- ~/.cua-driver/config.json or the environment, not through set_config"
- ))
- .with_structured(serde_json::json!({
- "code": "config_key_operator_only",
- "key": key,
- }));
- }
// The daemon injects `_session_id` for non-anonymous MCP sessions.
// Absent => anonymous/global session (CLI one-shot, legacy proxy) =>
// today's behavior: write the shared global DriverConfig + persist to
@@ -130,22 +104,7 @@ impl Tool for SetConfigTool {
Err(message) => return ToolResult::error(message),
};
- // Accept BOTH the direct field and {key,value} shapes.
- let kv: Option<(String, Value)> = args
- .opt_str("key")
- .and_then(|k| args.get("value").map(|v| (k, v.clone())));
- let kv_u64 = |name: &str| -> Option<u64> {
- kv.as_ref()
- .filter(|(k, _)| k == name)
- .and_then(|(_, v)| v.as_u64())
- };
-
- // Validate max_image_dimension up front so both branches share the
- // u32 check and we never half-apply.
- let max_dim: Option<u32> = match args
- .opt_u64("max_image_dimension")
- .or_else(|| kv_u64("max_image_dimension"))
- {
+ let max_dim: Option<u32> = match args.opt_u64("max_image_dimension") {
Some(dim) => match u32::try_from(dim) {
Ok(d) => Some(d),
Err(_) => {
diff --git a/libs/cua-driver/rust/crates/platform-windows/src/tools/impl_.rs b/libs/cua-driver/rust/crates/platform-windows/src/tools/impl_.rs
index 785ceb44fa..e9793e6acf 100644
--- a/libs/cua-driver/rust/crates/platform-windows/src/tools/impl_.rs
+++ b/libs/cua-driver/rust/crates/platform-windows/src/tools/impl_.rs
@@ -8778,16 +8778,8 @@ impl Tool for SetConfigTool {
fn def(&self) -> &ToolDef {
SCFG_DEF.get_or_init(|| ToolDef {
name: "set_config".into(),
- // Description ported from Swift `SetConfigTool.swift`. Windows
- // accepts BOTH Swift's `{key, value}` dotted-path shape AND a
- // legacy per-field shape; documented as intentional.
description: "Write a setting into the persistent driver config. Values take \
- effect immediately.\n\n\
- Two input shapes:\n\
- - **Swift-compatible** (preferred): `{\"key\": \"max_image_dimension\", \"value\": 1568}` \
- — single dotted-path leaf write.\n\
- - **Legacy per-field** (Rust-only): `{\"max_image_dimension\": 0}` \
- — bulk write of named fields.\n\n\
+ effect immediately. Pass each setting as its own field.\n\n\
Known keys:\n\
- `capture_mode` (string: `vision` | `ax` | `som`) — DEPRECATED and ignored; \
`get_window_state` always returns both the UIA tree and a screenshot. Still \
@@ -8795,23 +8787,19 @@ impl Tool for SetConfigTool {
- `max_image_dimension` (integer)\n\
- `experimental_pip` (boolean; persisted to config.json, applies on next daemon restart — Windows backend stubbed today, see issue #1729)\n\
- `experimental_pip_geometry` (string `WxH` or `WxH+X+Y`; persisted; applies on next daemon restart)\n\n\
- - `cursor.motion.style`, `cursor.motion.timing`, `cursor.motion.effects.<name>` — saved default cursor motion for sessions started afterwards (see the cursor docs).\n\n\
+ - `cursor.motion.style`, `cursor.motion.timing`, `cursor.motion.effects.<name>` (`on`, `off`, or `default`) — saved default cursor motion for sessions started afterwards. `cursor.motion: \"default\"` clears every saved cursor motion default.\n\n\
Returns the full updated config in the same shape as `get_config`.".into(),
input_schema: with_cursor_motion_config_properties(json!({"type":"object","properties":{
- "key":{"type":"string","description":"Dotted snake_case path to a leaf config field (Swift-compatible shape). Pair with `value`."},
- "value":{"description":"New value for `key`. JSON type depends on the key."},
"capture_mode":{"type":"string","enum":["ax","vision"],"description":"DEPRECATED and ignored — get_window_state always returns both the UIA tree and a screenshot. Still accepted/persisted for back-compat but has no effect. (\"som\"/\"screenshot\" still decode as deprecated aliases.)"},
- "max_image_dimension":{"type":"integer","description":"Legacy per-field shape."},
- "experimental_pip":{"type":"boolean","description":"Legacy per-field shape. Enables PiP preview (applies next restart)."},
- "experimental_pip_geometry":{"type":"string","description":"Legacy per-field shape. PiP window size + optional position."}
+ "max_image_dimension":{"type":"integer","description":"Max dimension for screenshot resizing (0 = no limit)."},
+ "experimental_pip":{"type":"boolean","description":"Enables PiP preview (applies next restart)."},
+ "experimental_pip_geometry":{"type":"string","description":"PiP window size + optional position."}
},"additionalProperties":false})),
read_only: false, destructive: false, idempotent: true, open_world: false,
})
}
async fn invoke(&self, args: Value) -> ToolResult {
- if args.get("capture_scope").is_some()
- || args.get("key").and_then(Value::as_str) == Some("capture_scope")
- {
+ if args.get("capture_scope").is_some() {
return ToolResult::error(
"config key 'capture_scope' is retired; select a window or desktop target on each action",
)
@@ -8827,61 +8815,6 @@ impl Tool for SetConfigTool {
};
let mut cfg = self.state.config.write().unwrap();
let mut applied = !motion_keys.is_empty();
- // Swift-compatible {key, value} shape.
- if let (Some(key), Some(val)) =
- (args.get("key").and_then(|v| v.as_str()), args.get("value"))
- {
- match key {
- "capture_mode" => match val.as_str() {
- Some(s) => {
- cfg.capture_mode = s.to_owned();
- if let Err(e) = pip_preview::write_config_key("capture_mode", Value::String(s.to_owned())) {
- tracing::warn!("set_config: failed to persist capture_mode: {e}");
- }
- applied = true;
- }
- None => return ToolResult::error(format!("`capture_mode` must be a string, got {val}.")),
- },
- "max_image_dimension" => match val.as_u64() {
- Some(n) => {
- cfg.max_image_dimension = n as u32;
- if let Err(e) = pip_preview::write_config_key("max_image_dimension", Value::from(n)) {
- tracing::warn!("set_config: failed to persist max_image_dimension: {e}");
- }
- applied = true;
- }
- None => return ToolResult::error(format!("`max_image_dimension` must be an integer, got {val}.")),
- },
- "experimental_pip" => match val.as_bool() {
- Some(b) => {
- if let Err(e) = pip_preview::write_config_key("experimental_pip", Value::Bool(b)) {
- return ToolResult::error(format!("failed to persist experimental_pip: {e}"));
- }
- applied = true;
- }
- None => return ToolResult::error(format!("`experimental_pip` must be a boolean, got {val}.")),
- },
- "experimental_pip_geometry" => match val.as_str() {
- Some(s) => {
- if pip_preview::PipGeometry::parse(s).is_none() {
- return ToolResult::error(format!(
- "experimental_pip_geometry `{s}` is not a valid WxH or WxH+X+Y string"
- ));
- }
- if let Err(e) = pip_preview::write_config_key("experimental_pip_geometry", Value::String(s.to_owned())) {
- return ToolResult::error(format!("failed to persist experimental_pip_geometry: {e}"));
- }
- applied = true;
- }
- None => return ToolResult::error(format!("`experimental_pip_geometry` must be a string, got {val}.")),
- },
- other if motion_keys.iter().any(|written| written == other) => {}
- other => return ToolResult::error(format!(
- "Unknown config key `{other}`. Known: capture_mode, max_image_dimension, experimental_pip, experimental_pip_geometry, cursor.motion.style, cursor.motion.timing, cursor.motion.effects.<name>."
- )),
- }
- }
- // Legacy per-field shape.
if let Some(mode) = args.get("capture_mode").and_then(|v| v.as_str()) {
cfg.capture_mode = mode.to_owned();
if let Err(e) =
@@ -8925,9 +8858,7 @@ impl Tool for SetConfigTool {
applied = true;
}
if !applied {
- return ToolResult::error(
- "Missing required string field `key` (or a known legacy per-field).",
- );
+ return ToolResult::error("set_config did not contain a known field.");
}
// Emit the same pretty-JSON payload as `get_config` (matches Swift's
// `set_config` return shape — both tools echo the full config after).
diff --git a/libs/cua-driver/scripts/generate-uniffi-bindings.mjs b/libs/cua-driver/scripts/generate-uniffi-bindings.mjs
index c012568433..e63821fed5 100644
--- a/libs/cua-driver/scripts/generate-uniffi-bindings.mjs
+++ b/libs/cua-driver/scripts/generate-uniffi-bindings.mjs
@@ -55,6 +55,29 @@ function normalizeWhitespace(source) {
return output.endsWith("\n") ? output : `${output}\n`
}
+function replaceExact(text, before, after, count = 1) {
+ if (text.split(before).length - 1 !== count) {
+ throw new Error(`unexpected UniFFI template: ${before}`)
+ }
+ return text.replaceAll(before, after)
+}
+
+function normalizePythonCursorEffects(source) {
+ const output = replaceExact(source, ":typing.Optional[CursorEffectSetting]",
+ ":typing.Optional[typing.Union[CursorEffectSetting, bool]]", 5)
+ return replaceExact(output, " if value == CursorEffectSetting.ON:\n",
+ " if type(value) is bool:\n value = CursorEffectSetting.ON if value else CursorEffectSetting.OFF\n if value == CursorEffectSetting.ON:\n", 2)
+}
+
+function normalizeTypeScriptCursorEffects(source) {
+ let output = replaceExact(source, "?: CursorEffectSetting", "?: CursorEffectSetting | boolean", 5)
+ output = replaceExact(output, "type TypeName = CursorEffectSetting;", "type TypeName = CursorEffectSetting | boolean;")
+ output = replaceExact(output, " switch (value) {\n case CursorEffectSetting.On:",
+ " if (typeof value === \"boolean\") value = value ? CursorEffectSetting.On : CursorEffectSetting.Off;\n switch (value) {\n case CursorEffectSetting.On:")
+ return replaceExact(output, " case CursorEffectSetting.Default: return ordinalConverter.write(3, into);\n",
+ " case CursorEffectSetting.Default: return ordinalConverter.write(3, into);\n default: throw new UniffiInternalError.UnexpectedEnumCase();\n")
+}
+
function normalizePython(source) {
const output = normalizeWhitespace(source)
const unsafe = "eventloop.call_soon(_uniffi_cancel_task, task)"
@@ -107,12 +130,6 @@ function normalizePythonRemoteChannels(source) {
}
return source
}
- const replaceExact = (text, before, after, count = 1) => {
- if (text.split(before).length - 1 !== count) {
- throw new Error(`unexpected UniFFI Python remote callback template: ${before}`)
- }
- return text.replaceAll(before, after)
- }
// Each foreign carrier belongs to the loop on which it enters Rust. Rust
// lifecycle threads must not depend on the process-global callback loop.
let output = replaceExact(source,
@@ -179,6 +196,7 @@ function normalizeTypeScript(name, source) {
}
output = output.replace(needle, 'import lib from "./node-runtime.js";')
}
+ if (name === "cua_driver_contract.ts") output = normalizeTypeScriptCursorEffects(output)
if (name === "cua_driver_contract-ffi.ts") {
const needle = 'crateName: "cua_driver_contract"'
const matches = output.split(needle).length - 1
@@ -318,9 +336,9 @@ try {
"src/cua_driver/_native.py": normalizePython(
readFileSync(join(pythonOutput, "cua_driver_sdk.py"), "utf8"),
),
- "src/cua_driver/_native_contract.py": normalizePython(
+ "src/cua_driver/_native_contract.py": normalizePythonCursorEffects(normalizePython(
readFileSync(join(pythonOutput, "cua_driver_contract.py"), "utf8"),
- ),
+ )),
})
const typescriptFiles = {}
diff --git a/libs/cua-driver/typescript/package.json b/libs/cua-driver/typescript/package.json
index d314d40cd0..a9a9b5e150 100644
--- a/libs/cua-driver/typescript/package.json
+++ b/libs/cua-driver/typescript/package.json
@@ -46,7 +46,7 @@
"scripts": {
"build": "tsc -p tsconfig.json",
"prepack": "npm run build",
- "typecheck": "tsc -p tsconfig.json --noEmit && tsc --noEmit --strict --skipLibCheck --target ES2022 --module NodeNext test/fleet-types.ts",
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc --noEmit --strict --skipLibCheck --target ES2022 --module NodeNext test/fleet-types.ts test/cursor-effects-types.ts",
"test": "npm run build && node --test test/*.test.mjs",
"generate:uniffi": "node ../scripts/generate-uniffi-bindings.mjs",
"generate:uniffi:check": "node ../scripts/generate-uniffi-bindings.mjs --check",
diff --git a/libs/cua-driver/typescript/src/native/cua_driver_contract.ts b/libs/cua-driver/typescript/src/native/cua_driver_contract.ts
index 4a32a7a606..f70f6ee5ff 100644
--- a/libs/cua-driver/typescript/src/native/cua_driver_contract.ts
+++ b/libs/cua-driver/typescript/src/native/cua_driver_contract.ts
@@ -1317,30 +1317,67 @@ const FfiConverterTypeClipboardWriteOutput = (() => {
})();
/**
- * Per-effect overrides for the agent cursor. Unset fields are omitted on the wire, so they
- * keep their current setting.
+ * One cursor effect: `on`, `off`, or `default` (the style's own setting).
+ */
+export enum CursorEffectSetting {
+ On,
+ Off,
+ Default
+}
+
+const FfiConverterTypeCursorEffectSetting = (() => {
+ const ordinalConverter = FfiConverterInt32;
+ type TypeName = CursorEffectSetting | boolean;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ switch (ordinalConverter.read(from)) {
+ case 1: return CursorEffectSetting.On;
+ case 2: return CursorEffectSetting.Off;
+ case 3: return CursorEffectSetting.Default;
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
+ }
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ if (typeof value === "boolean") value = value ? CursorEffectSetting.On : CursorEffectSetting.Off;
+ switch (value) {
+ case CursorEffectSetting.On: return ordinalConverter.write(1, into);
+ case CursorEffectSetting.Off: return ordinalConverter.write(2, into);
+ case CursorEffectSetting.Default: return ordinalConverter.write(3, into);
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
+ }
+ }
+ allocationSize(value: TypeName): number {
+ return ordinalConverter.allocationSize(0);
+ }
+ }
+ return new FFIConverter();
+})();
+
+/**
+ * Per-effect overrides for the agent cursor. An omitted field keeps the current setting.
+ * `on` and `off` set it; `default` restores the style default.
*/
export type CursorMotionEffects = {
/**
* Short fading trail behind the cursor.
*/
- trail?: boolean,
+ trail?: CursorEffectSetting | boolean,
/**
* Soft glow around the cursor that grows with speed.
*/
- glow?: boolean,
+ glow?: CursorEffectSetting | boolean,
/**
* Target glow when the `magnetic` style locks on.
*/
- magnet?: boolean,
+ magnet?: CursorEffectSetting | boolean,
/**
* Ring that expands from the hotspot on click.
*/
- ripple?: boolean,
+ ripple?: CursorEffectSetting | boolean,
/**
* Brief scale-down of the cursor on click.
*/
- squish?: boolean
+ squish?: CursorEffectSetting | boolean
}
/**
@@ -1364,26 +1401,26 @@ const FfiConverterTypeCursorMotionEffects = (() => {
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
read(from: RustBuffer): TypeName {
return {
- trail: FfiConverterOptionalBoolean.read(from),
- glow: FfiConverterOptionalBoolean.read(from),
- magnet: FfiConverterOptionalBoolean.read(from),
- ripple: FfiConverterOptionalBoolean.read(from),
- squish: FfiConverterOptionalBoolean.read(from)
+ trail: FfiConverterOptionalTypeCursorEffectSetting.read(from),
+ glow: FfiConverterOptionalTypeCursorEffectSetting.read(from),
+ magnet: FfiConverterOptionalTypeCursorEffectSetting.read(from),
+ ripple: FfiConverterOptionalTypeCursorEffectSetting.read(from),
+ squish: FfiConverterOptionalTypeCursorEffectSetting.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
- FfiConverterOptionalBoolean.write(value.trail, into);
- FfiConverterOptionalBoolean.write(value.glow, into);
- FfiConverterOptionalBoolean.write(value.magnet, into);
- FfiConverterOptionalBoolean.write(value.ripple, into);
- FfiConverterOptionalBoolean.write(value.squish, into);
+ FfiConverterOptionalTypeCursorEffectSetting.write(value.trail, into);
+ FfiConverterOptionalTypeCursorEffectSetting.write(value.glow, into);
+ FfiConverterOptionalTypeCursorEffectSetting.write(value.magnet, into);
+ FfiConverterOptionalTypeCursorEffectSetting.write(value.ripple, into);
+ FfiConverterOptionalTypeCursorEffectSetting.write(value.squish, into);
}
allocationSize(value: TypeName): number {
- return FfiConverterOptionalBoolean.allocationSize(value.trail) +
- FfiConverterOptionalBoolean.allocationSize(value.glow) +
- FfiConverterOptionalBoolean.allocationSize(value.magnet) +
- FfiConverterOptionalBoolean.allocationSize(value.ripple) +
- FfiConverterOptionalBoolean.allocationSize(value.squish);
+ return FfiConverterOptionalTypeCursorEffectSetting.allocationSize(value.trail) +
+ FfiConverterOptionalTypeCursorEffectSetting.allocationSize(value.glow) +
+ FfiConverterOptionalTypeCursorEffectSetting.allocationSize(value.magnet) +
+ FfiConverterOptionalTypeCursorEffectSetting.allocationSize(value.ripple) +
+ FfiConverterOptionalTypeCursorEffectSetting.allocationSize(value.squish);
}
};
@@ -1634,8 +1671,7 @@ export type CursorMotionSelection = {
*/
timing?: CursorMotionTiming,
/**
- * Turn single effects on or off. An omitted effect keeps its current setting; null
- * restores the style's default.
+ * Turn effects on or off. Omit a field to keep it; `"default"` restores the style default.
*/
effects?: CursorMotionEffects,
/**
@@ -5263,8 +5299,7 @@ export type SetAgentCursorMotionInput = {
*/
timing?: CursorMotionTiming,
/**
- * Turn single effects on or off. An omitted effect keeps its current setting; null
- * restores the style's default.
+ * Turn effects on or off. Omit a field to keep it; `"default"` restores the style default.
*/
effects?: CursorMotionEffects,
/**
@@ -6526,8 +6561,8 @@ const FfiConverterOptionalTypeClickButton = new FfiConverterOptional(FfiConverte
// FfiConverter for Array<string>
const FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);
-// FfiConverter for boolean | undefined
-const FfiConverterOptionalBoolean = new FfiConverterOptional(FfiConverterBool);
+// FfiConverter for CursorEffectSetting | undefined
+const FfiConverterOptionalTypeCursorEffectSetting = new FfiConverterOptional(FfiConverterTypeCursorEffectSetting);
// FfiConverter for CursorMotionStyle | undefined
const FfiConverterOptionalTypeCursorMotionStyle = new FfiConverterOptional(FfiConverterTypeCursorMotionStyle);
@@ -6553,6 +6588,9 @@ const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
// FfiConverter for Array<string> | undefined
const FfiConverterOptionalSequenceString = new FfiConverterOptional(FfiConverterSequenceString);
+// FfiConverter for boolean | undefined
+const FfiConverterOptionalBoolean = new FfiConverterOptional(FfiConverterBool);
+
// FfiConverter for CursorPointOutput | undefined
const FfiConverterOptionalTypeCursorPointOutput = new FfiConverterOptional(FfiConverterTypeCursorPointOutput);
@@ -6685,6 +6723,7 @@ export default Object.freeze({
FfiConverterTypeClipboardWriteInput,
FfiConverterTypeClipboardWriteOutput,
FfiConverterTypeCursorAction,
+ FfiConverterTypeCursorEffectSetting,
FfiConverterTypeCursorMotionEffects,
FfiConverterTypeCursorMotionEffectsOutput,
FfiConverterTypeCursorMotionOutput,
diff --git a/libs/cua-driver/typescript/test/cursor-effects-types.ts b/libs/cua-driver/typescript/test/cursor-effects-types.ts
new file mode 100644
index 0000000000..84d393c6a3
--- /dev/null
+++ b/libs/cua-driver/typescript/test/cursor-effects-types.ts
@@ -0,0 +1,15 @@
+// Legacy callers remain source-compatible without casting to the new enum.
+import { CursorEffectSetting, CursorMotionEffects, defaultCursorMotionParams, planCursorMove, type CursorMoveRequest } from "../src/index.js"
+const effects: CursorMotionEffects = { trail: true, glow: false, magnet: undefined, ripple: CursorEffectSetting.Default }
+const constructed = CursorMotionEffects.create({ trail: true, squish: false })
+const params = defaultCursorMotionParams()
+params.effects = effects
+params.effects = constructed
+export function legacyCall(request: CursorMoveRequest) { return planCursorMove(params, request) }
+// @ts-expect-error Arbitrary strings are not SDK enum values.
+const invalid: CursorMotionEffects = { trail: "true" }
+void invalid
+
+// @ts-expect-error Use undefined for omission or the Default enum for reset.
+const invalidNull: CursorMotionEffects = { trail: null }
+void invalidNull
diff --git a/libs/cua-driver/typescript/test/cursor-motion.test.mjs b/libs/cua-driver/typescript/test/cursor-motion.test.mjs
index 1eaf85bc99..e77210ce9f 100644
--- a/libs/cua-driver/typescript/test/cursor-motion.test.mjs
+++ b/libs/cua-driver/typescript/test/cursor-motion.test.mjs
@@ -59,7 +59,16 @@ async function load() {
return Object.keys(fields).length ? ctor.new(camelKeys(fields)) : ctor.new()
}
const effects = (o) =>
- Object.fromEntries(EFFECTS.map((k) => [k, o[k] === null ? undefined : o[k]]))
+ Object.fromEntries(
+ EFFECTS.map((k) => [
+ k,
+ o[k] === null || o[k] === undefined
+ ? undefined
+ : o[k]
+ ? m.CursorEffectSetting.On
+ : m.CursorEffectSetting.Off,
+ ]),
+ )
const params = (p) => ({
style: m.CursorMotionStyle[pascal(p.style)],
timing: m.CursorMotionTiming[pascal(p.timing)],
@@ -179,3 +188,30 @@ test("the arc styles are specs", { skip }, async () => {
assert.deepEqual(m.planCursorSpec(spec, req).samples(), m.planCursorMove(params, req).samples())
assert.equal(m.cursorMotionSpecForStyle(m.CursorMotionStyle.Magnetic, params), undefined)
})
+
+
+test("legacy boolean effects reach the native planner", { skip }, async () => {
+ const { m, request } = await load()
+ const req = request(golden.cases[0].request)
+ for (const name of EFFECTS) {
+ for (const [legacy, canonical] of [[true, m.CursorEffectSetting.On], [false, m.CursorEffectSetting.Off], [undefined, undefined], [m.CursorEffectSetting.Default, m.CursorEffectSetting.Default]]) {
+ const params = m.defaultCursorMotionParams()
+ params.effects = m.CursorMotionEffects.create({ [name]: legacy })
+ const actual = m.planCursorMove(params, req).effects()
+ params.effects = { [name]: canonical }
+ const expected = m.planCursorMove(params, req).effects()
+ assert.deepEqual(actual, expected, `${name}: ${legacy}`)
+ if (typeof legacy === "boolean") assert.equal(actual[name], legacy)
+ }
+ }
+})
+
+test("invalid effects are refused before native dispatch", { skip }, async () => {
+ const { m, request } = await load()
+ const params = m.defaultCursorMotionParams()
+ const req = request(golden.cases[0].request)
+ for (const invalid of [null, "true", "on", 99, [], {}]) {
+ params.effects = { trail: invalid }
+ assert.throws(() => m.planCursorMove(params, req), /Unexpected.*[Ee]num|enum.*case/i)
+ }
+})
diff --git a/libs/cua/skills/cua-driver/RUNTIME.md b/libs/cua/skills/cua-driver/RUNTIME.md
index b5136aae55..d25161b9da 100644
--- a/libs/cua/skills/cua-driver/RUNTIME.md
+++ b/libs/cua/skills/cua-driver/RUNTIME.md
@@ -98,7 +98,7 @@ Pixel `click` already animates the cursor. Do not precede it with `move_cursor`
The default theme provides session-colored pointer/glow, action marks, and activity animations. Named sessions have stable palette colors. Native hosts own delivery/target badges separately from theme artwork; cursor state is scoped to the private lifecycle.
-`set_agent_cursor_enabled` controls idle visibility. `set_agent_cursor_motion` takes `style` (`signature_arc` default, `spring_settle`, `magnetic`, `comet_swoop`, `adaptive`, `classic`), `timing` (`native`, `fitts`, `fixed`), `effects` (`trail`, `glow`, `magnet`, `ripple`, `squish` booleans; null restores the style default), and the arc knobs `start_handle`, `end_handle`, `arc_size`, `arc_flow` (bezier styles) plus `spring` and `turn_radius` (`classic`) where advertised. Choose preinstalled artwork with `set_agent_cursor_theme`; `cursor_id` on input tools is not a theme selector. Never supply inline theme code or arbitrary source paths through agent tools. The trusted local `cursor-theme` workflow owns validation, compilation, preview, installation, and removal.
+`set_agent_cursor_enabled` controls idle visibility. `set_agent_cursor_motion` takes `style` (`signature_arc` default, `spring_settle`, `magnetic`, `comet_swoop`, `adaptive`, `classic`), `timing` (`native`, `fitts`, `fixed`), `effects` (`trail`, `glow`, `magnet`, `ripple`, `squish` as `on`, `off`, or `default`; `default` restores the style default, and an omitted effect keeps its current setting), and the arc knobs `start_handle`, `end_handle`, `arc_size`, `arc_flow` (bezier styles) plus `spring` and `turn_radius` (`classic`) where advertised. Choose preinstalled artwork with `set_agent_cursor_theme`; `cursor_id` on input tools is not a theme selector. Never supply inline theme code or arbitrary source paths through agent tools. The trusted local `cursor-theme` workflow owns validation, compilation, preview, installation, and removal.
Overlay operations need a suitable UI event loop. macOS direct SDK/MCP runtimes without a certified host main-thread adapter can return `facility_unavailable`; do not report that as a successful move. See [EMBEDDING.md](EMBEDDING.md).
diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json
index 5d1a82bdd8..557bb970de 100644
--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json
+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json
@@ -166,20 +166,14 @@
"additionalProperties": false,
"properties": {
"enabled": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"exists": {
"description": "Assert that at least one trusted element matches the selector.\n\nElement walks are not yet exhaustive on every platform, so absence\ncannot be proven. `false` is rejected instead of returning an\nindefinitely-unknown predicate.",
"type": "boolean"
},
"selected": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"selector": {
"additionalProperties": false,
@@ -197,19 +191,13 @@
"type": "object"
},
"value_equals": {
- "type": [
- "string",
- "null"
- ]
+ "type": "string"
}
},
"required": [
"selector"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"window": {
"additionalProperties": false,
@@ -241,22 +229,14 @@
"width",
"height"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"exists": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
}
},
"required": [],
@@ -268,10 +248,7 @@
},
"include_screenshot": {
"description": "Return the final window screenshot as image content for a multimodal\ncaller. The driver does not interpret that image.",
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"pid": {
"description": "Exact process whose window may be observed.",
@@ -583,49 +560,36 @@
"type": "string"
},
"target": {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
+ "additionalProperties": true,
+ "description": "Exact window (kind \"window\", with pid and window_id) or desktop (kind \"desktop\", with display_id). \"primary\" is the portable desktop target.",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
],
- "type": "object"
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
- ]
+ },
+ "required": [
+ "kind"
+ ],
+ "type": "object"
},
"window_id": {
"description": "Window id from list_windows. Required with x/y or element_index; optional with element_token (the token carries it).",
@@ -871,57 +835,36 @@
"type": "integer"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"to_x": {
"description": "Drag end X (same frame as from_x).",
@@ -1272,57 +1215,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
},
- {
- "type": "null"
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"text": {
"description": "Text to type.",
@@ -1407,57 +1329,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
},
- {
- "type": "null"
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"window_id": {
"description": "Window id from list_windows. Required with x/y or element_index; optional with element_token (the token carries it).",
@@ -1527,57 +1428,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"window_id": {
"description": "Window id from list_windows. Required with x/y or element_index; optional with element_token (the token carries it).",
@@ -1631,10 +1511,7 @@
},
"value": {
"description": "New value. Written through AT-SPI EditableText/Value when the element exposes them; otherwise (GTK2 spin scales, VCL spin buttons) the field is clicked with the session's real pointer, its text selected and replaced through the virtual keyboard and committed with Tab, then read back.",
- "type": [
- "string",
- "number"
- ]
+ "type": "string"
},
"window_id": {
"description": "Omit when element_token is supplied (the token carries it).",
@@ -1725,57 +1602,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
},
- {
- "type": "null"
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"window_id": {
"description": "Window id from list_windows. Required with x/y; optional with element_token (the token carries it).",
@@ -1936,57 +1792,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"x": {
"description": "Destination X. Window scope: screen coordinates of the agent cursor overlay. Desktop scope: get_desktop_state screenshot pixels.",
@@ -2040,90 +1875,80 @@
"properties": {
"arc_flow": {
"description": "Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`:\npositive moves the apex toward the destination. Clamped to -1..1 (default 0).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"arc_size": {
"description": "Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default)\nkeeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"dwell_after_click_ms": {
"description": "Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"effects": {
"additionalProperties": false,
- "description": "Turn single effects on or off. An omitted effect keeps its current setting; null\nrestores the style's default.",
+ "description": "Turn effects on or off. Omit a field to keep it; `\"default\"` restores the style default.",
"properties": {
"glow": {
"description": "Soft glow around the cursor that grows with speed.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"magnet": {
"description": "Target glow when the `magnetic` style locks on.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"ripple": {
"description": "Ring that expands from the hotspot on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"squish": {
"description": "Brief scale-down of the cursor on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"trail": {
"description": "Short fading trail behind the cursor.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"end_handle": {
"description": "Arc control-point offset from the end, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"glide_duration_ms": {
"description": "Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A\nnonzero value with `native` timing also fixes the duration. Clamped to 0..5000.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"idle_hide_ms": {
"description": "Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to\n0..60000 (default 15000).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"session": {
"description": "Public label of the session that owns the cursor. Omitted or null motion fields keep\ntheir current value.",
@@ -2131,17 +1956,11 @@
},
"spring": {
"description": "Arrival spring damping for `classic`: 1 is critically damped, 0.3 is bouncy. Clamped\nto 0.3..1 (default 0.72).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"start_handle": {
"description": "Arc control-point offset from the start, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"style": {
"description": "Trajectory style. `signature_arc` (default) is one arc with a small follow-through;\n`spring_settle` lands with one soft bounce; `magnetic` is pulled into the target;\n`comet_swoop` is a wide arc with a short trail; `adaptive` picks a careful approach for\nsmall targets and a swoop for long moves; `classic` is the previous Dubins glide. When\nthe theme's reduced motion is on, every move is a short straight glide with no effects.",
@@ -2166,10 +1985,7 @@
},
"turn_radius": {
"description": "Minimum turning radius of the `classic` glide path, in points; smaller turns tighter.\nClamped to 1..1000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
}
},
"required": [
@@ -2303,14 +2119,14 @@
"read_only": true
},
{
- "description": "Update cua-driver-rs configuration. capture_mode / max_image_dimension take effect immediately.\n\nTwo input shapes (both accepted, matching Windows/Swift):\n- **{key, value}** (preferred): `{\"key\": \"max_image_dimension\", \"value\": 800}` — single leaf write.\n- **Legacy per-field**: `{\"capture_mode\": \"som\", \"max_image_dimension\": 0}`.\n\nThe experimental_pip keys persist to ~/.cua-driver/config.json and apply on next daemon restart (the PiP backend is initialised once at startup; Linux ships only the trait stub today — see issue #1729).\n\n`cursor.motion.style`, `cursor.motion.timing` and `cursor.motion.effects.<name>` save the default cursor motion for sessions started afterwards.",
+ "description": "Update cua-driver-rs configuration. capture_mode / max_image_dimension take effect immediately.\n\nPass each setting as its own field: `{\"capture_mode\": \"som\", \"max_image_dimension\": 0}`.\n\nThe experimental_pip keys persist to ~/.cua-driver/config.json and apply on next daemon restart (the PiP backend is initialised once at startup; Linux ships only the trait stub today — see issue #1729).\n\n`cursor.motion.style`, `cursor.motion.timing` and `cursor.motion.effects.<name>` (`on`, `off`, or `default`) save the default cursor motion for sessions started afterwards. `cursor.motion: \"default\"` clears every saved cursor motion default.",
"destructive": false,
"idempotent": true,
"input_schema": {
"additionalProperties": false,
"properties": {
"capture_mode": {
- "description": "Legacy per-field shape. Default capture mode for get_window_state. (\"som\"/\"screenshot\" still decode as deprecated aliases.)",
+ "description": "Default capture mode for get_window_state. (\"som\"/\"screenshot\" still decode as deprecated aliases.)",
"enum": [
"ax",
"vision"
@@ -2318,27 +2134,56 @@
"type": "string"
},
"cursor.motion": {
- "description": "Pass null (or `default`) to clear every saved cursor motion default."
+ "description": "Pass `default` to clear every saved cursor motion default.",
+ "enum": [
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.glow": {
- "description": "Saved default for the `glow` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `glow` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.magnet": {
- "description": "Saved default for the `magnet` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `magnet` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.ripple": {
- "description": "Saved default for the `ripple` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `ripple` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.squish": {
- "description": "Saved default for the `squish` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `squish` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.trail": {
- "description": "Saved default for the `trail` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `trail` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.style": {
"description": "Saved default cursor motion style for new sessions. Overridden by start_session cursor_motion and set_agent_cursor_motion; reduced motion always wins. Built-in default: signature_arc.",
@@ -2369,20 +2214,13 @@
"description": "PiP window size + optional position in `WxH` or `WxH+X+Y` form.",
"type": "string"
},
- "key": {
- "description": "Name of a single config field to write ({key, value} shape). Pair with `value`.",
- "type": "string"
- },
"max_image_dimension": {
- "description": "Legacy per-field shape. Max dimension for screenshot resizing (0 = no limit).",
+ "description": "Max dimension for screenshot resizing (0 = no limit).",
"type": "integer"
},
"session": {
"description": "For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session.",
"type": "string"
- },
- "value": {
- "description": "New value for `key`. JSON type depends on the key."
}
},
"type": "object"
@@ -3189,104 +3027,88 @@
"properties": {
"arc_flow": {
"description": "Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`:\npositive moves the apex toward the destination. Clamped to -1..1 (default 0).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"arc_size": {
"description": "Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default)\nkeeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"dwell_after_click_ms": {
"description": "Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"effects": {
"additionalProperties": false,
- "description": "Turn single effects on or off. An omitted effect keeps its current setting; null\nrestores the style's default.",
+ "description": "Turn effects on or off. Omit a field to keep it; `\"default\"` restores the style default.",
"properties": {
"glow": {
"description": "Soft glow around the cursor that grows with speed.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"magnet": {
"description": "Target glow when the `magnetic` style locks on.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"ripple": {
"description": "Ring that expands from the hotspot on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"squish": {
"description": "Brief scale-down of the cursor on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"trail": {
"description": "Short fading trail behind the cursor.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"end_handle": {
"description": "Arc control-point offset from the end, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"glide_duration_ms": {
"description": "Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A\nnonzero value with `native` timing also fixes the duration. Clamped to 0..5000.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"idle_hide_ms": {
"description": "Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to\n0..60000 (default 15000).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"spring": {
"description": "Arrival spring damping for `classic`: 1 is critically damped, 0.3 is bouncy. Clamped\nto 0.3..1 (default 0.72).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"start_handle": {
"description": "Arc control-point offset from the start, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"style": {
"description": "Trajectory style. `signature_arc` (default) is one arc with a small follow-through;\n`spring_settle` lands with one soft bounce; `magnetic` is pulled into the target;\n`comet_swoop` is a wide arc with a short trail; `adaptive` picks a careful approach for\nsmall targets and a swoop for long moves; `classic` is the previous Dubins glide. When\nthe theme's reduced motion is on, every move is a short straight glide with no effects.",
@@ -3311,18 +3133,14 @@
},
"turn_radius": {
"description": "Minimum turning radius of the `classic` glide path, in points; smaller turns tighter.\nClamped to 1..1000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"cursor_theme": {
+ "additionalProperties": true,
"description": "Optional initial cursor theme. The host applies it before the cursor is\nfirst made visible, avoiding a flash of the default theme.",
"properties": {
"reduced_motion": {
@@ -3341,10 +3159,7 @@
"required": [
"theme_id"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"session": {
"description": "Optional stable public label for this run (e.g. \"research-run-1\").\nWhen omitted, the authenticated transport lease's implicit session is\ncreated or returned.",
@@ -3426,10 +3241,7 @@
"limit": {
"description": "Maximum number of content-free summaries to return (default 50, max\n100). Ordinary agent transports are scoped to their own lease.",
"minimum": 0,
- "type": [
- "integer",
- "null"
- ]
+ "type": "integer"
}
},
"required": [],
@@ -3475,7 +3287,7 @@
"read_only": false
},
{
- "description": "The default way to act: run one or more action tools in ONE call, in order, stop at the first failure, and (with `observe`) get what changed in the same response. Use it whenever you know the next action(s) and would otherwise re-read the window after them: fill three fields, click, and see the result in one call instead of five. Even a single step plus `observe:true` replaces an action call followed by a get_window_state call. Each step is `{tool, args}` where `tool` is one of click, double_click, right_click, set_value, type_text, press_key, hotkey, scroll, drag, move_cursor and `args` are exactly that tool's arguments. `pid` and `window_id` (or `app`/`window`) on run_steps itself are the default window of every step that names none. Reads (get_window_state, zoom) do not run between steps: one there is skipped; a get_window_state last is the `observe`, a zoom last runs after it. Every step goes through the same session, permission and approval checks as a direct call; a batch grants nothing extra. All steps are validated before the first one runs, so a malformed step 4 changes nothing. Element tokens and element_index values come from a get_window_state read before the batch; a step that changes the UI can invalidate later element targets, so put element-targeted actions before the actions that reshuffle the window, or target later steps by role/name. A token that went stale is retried once on the element with the same role and label, if exactly one matches.\n\nReturns per-step status (`ok` or the error message) and, when `observe` is given, ONE bounded get_window_state read after the last executed step (after a failure caused by a dialog holding focus, that dialog is read, even without `observe`). A step refused because its app ignores background input says how to re-send it; `foreground_fallback:true` retries such steps in the foreground once (the window is activated). That read is a `since:\"latest\"` diff by default: only the rows that changed since your last read of the window, plus a new snapshot_id. Without `observe` nothing is read. The batch uses one session: steps may omit `session` or repeat the batch's. `delay_ms` pauses between steps (max 2000). At most 64 steps; `delivery_mode` on run_steps is the default for its steps.\n\nTARGET BY NAME (no earlier read needed, so one batch can cross screens): a step can be written `{\"click\": {...args}}` as well as `{tool, args}`, and its args may name the target instead of carrying a token: `role` (button, textfield, link, checkbox, menuitem, ...; AX/UIA/AT-SPI names also work), `name` (the element's label; exact match wins over substring, case-insensitive), `nth` (0-based, when several match), and `app` (app name or bundle id) and/or `window` (title substring) instead of pid/window_id. The batch reads the window fresh, waits up to 3 s (step `timeout_ms`, max 10000) for the element to appear, and acts on it; with only `app` it uses that app's frontmost window, so a dialog that opened on top is found. Later steps inherit the window, so name `app` once. The first lookup in a window also reads it once for `observe`, so the end diff shows what the batch changed even in a window you never read. Several matches fail with the candidates listed; add `nth` or a fuller name.\n\nWAITS AND CHECKS: a step may add `wait_for` (checked before its action) and `expect` (one check or up to 4, checked after it); a step may also be only a check. A check is {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}: `text` matches any row of the tree, static text included; `gone:true` waits for it to disappear. Checks poll until they hold or time out (wait_for 5 s, expect 2 s, max 10 s), and a check that does not hold fails the step with what was found instead. The report says which step failed, in which phase (wait_for, find, action, expect) and why. Whole batch: at most 60 s.\n\nExample (fill a form, submit, confirm the dialog, check the result):\n{\"steps\":[{\"set_value\":{\"app\":\"Safari\",\"role\":\"textfield\",\"name\":\"Email\",\"value\":\"[email protected]\"}},{\"click\":{\"role\":\"button\",\"name\":\"Submit\"},\"expect\":{\"role\":\"button\",\"name\":\"Confirm\"}},{\"click\":{\"role\":\"button\",\"name\":\"Confirm\"},\"expect\":[{\"name\":\"Confirm\",\"gone\":true},{\"text\":\"Thanks\"}]}],\"observe\":true}",
+ "description": "The default way to act: run one or more action tools in ONE call, in order, stop at the first failure, and (with `observe`) get what changed in the same response. Use it whenever you know the next action(s) and would otherwise re-read the window after them: fill three fields, click, and see the result in one call instead of five. Even a single step plus `observe:{}` replaces an action call followed by a get_window_state call. Each step is `{tool, args}` where `tool` is one of click, double_click, right_click, set_value, type_text, press_key, hotkey, scroll, drag, move_cursor and `args` are exactly that tool's arguments. `pid` and `window_id` (or `app`/`window`) on run_steps itself are the default window of every step that names none. Reads (get_window_state, zoom) do not run between steps: one there is skipped; a get_window_state last is the `observe`, a zoom last runs after it. Every step goes through the same session, permission and approval checks as a direct call; a batch grants nothing extra. All steps are validated before the first one runs, so a malformed step 4 changes nothing. Element tokens and element_index values come from a get_window_state read before the batch; a step that changes the UI can invalidate later element targets, so put element-targeted actions before the actions that reshuffle the window, or target later steps by role/name. A token that went stale is retried once on the element with the same role and label, if exactly one matches.\n\nReturns per-step status (`ok` or the error message) and, when `observe` is given, ONE bounded get_window_state read after the last executed step (after a failure caused by a dialog holding focus, that dialog is read, even without `observe`). A step refused because its app ignores background input says how to re-send it; `foreground_fallback:true` retries such steps in the foreground once (the window is activated). That read is a `since:\"latest\"` diff by default: only the rows that changed since your last read of the window, plus a new snapshot_id. Without `observe` nothing is read. The batch uses one session: steps may omit `session` or repeat the batch's. `delay_ms` pauses between steps (max 2000). At most 64 steps; `delivery_mode` on run_steps is the default for its steps.\n\nTARGET BY NAME (no earlier read needed, so one batch can cross screens): a step can be written `{\"click\": {...args}}` as well as `{tool, args}`, and its args may name the target instead of carrying a token: `role` (button, textfield, link, checkbox, menuitem, ...; AX/UIA/AT-SPI names also work), `name` (the element's label; exact match wins over substring, case-insensitive), `nth` (0-based, when several match), and `app` (app name or bundle id) and/or `window` (title substring) instead of pid/window_id. The batch reads the window fresh, waits up to 3 s (step `timeout_ms`, max 10000) for the element to appear, and acts on it; with only `app` it uses that app's frontmost window, so a dialog that opened on top is found. Later steps inherit the window, so name `app` once. The first lookup in a window also reads it once for `observe`, so the end diff shows what the batch changed even in a window you never read. Several matches fail with the candidates listed; add `nth` or a fuller name.\n\nWAITS AND CHECKS: a step may add `wait_for` (checked before its action) and `expect` (one check or up to 4, checked after it); a step may also be only a check. A check is {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}: `text` matches any row of the tree, static text included; `gone:true` waits for it to disappear. Checks poll until they hold or time out (wait_for 5 s, expect 2 s, max 10 s), and a check that does not hold fails the step with what was found instead. The report says which step failed, in which phase (wait_for, find, action, expect) and why. Whole batch: at most 60 s.\n\nExample (fill a form, submit, confirm the dialog, check the result):\n{\"steps\":[{\"set_value\":{\"app\":\"Safari\",\"role\":\"textfield\",\"name\":\"Email\",\"value\":\"[email protected]\"}},{\"click\":{\"role\":\"button\",\"name\":\"Submit\"},\"expect\":[{\"role\":\"button\",\"name\":\"Confirm\"}]},{\"click\":{\"role\":\"button\",\"name\":\"Confirm\"},\"expect\":[{\"name\":\"Confirm\",\"gone\":true},{\"text\":\"Thanks\"}]}],\"observe\":{}}",
"destructive": true,
"idempotent": false,
"input_schema": {
@@ -3504,11 +3316,8 @@
"type": "boolean"
},
"observe": {
- "description": "Optional end-of-batch observation: `true`, or arguments for ONE get_window_state call. `pid` and `window_id` default to those of the last step that names both. Defaults to since=\"latest\" (only what changed since your last read of that window with the same query/max_elements/max_depth; a full read when there is none), include_screenshot=false and max_elements=250; pass include_screenshot=true to see the window, or since=null for a full read. Omit to read nothing.",
- "type": [
- "object",
- "boolean"
- ]
+ "description": "Optional end-of-batch observation: arguments for ONE get_window_state call. `pid` and `window_id` default to those of the last step that names both. Defaults to since=\"latest\" (only what changed since your last read of that window with the same query/max_elements/max_depth; a full read when there is none), include_screenshot=false and max_elements=250; pass include_screenshot=true to see the window, or since=null for a full read. Omit to read nothing. {} observes the last window.",
+ "type": "object"
},
"pid": {
"description": "Default pid for steps that name no window (a step's own pid/window_id/app/window wins).",
@@ -3521,75 +3330,48 @@
"steps": {
"description": "Ordered actions. Execution stops at the first failing step. Each step is {tool, args} or {<tool>: args}, plus optional wait_for / expect / timeout_ms; a step may also be only a wait_for or expect check.",
"items": {
- "anyOf": [
- {
- "additionalProperties": false,
- "properties": {
- "args": {
- "description": "Arguments for that tool, as in a direct call, optionally with role/name/nth/app/window to name the target instead of pid/window_id/element_token.",
- "type": "object"
- },
- "expect": {
- "description": "Check (or up to 4) that must hold after the action: {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}. Default timeout 2000 ms.",
- "type": [
- "object",
- "array"
- ]
- },
- "timeout_ms": {
- "description": "How long a named target may take to appear. Default 3000.",
- "maximum": 10000,
- "minimum": 0,
- "type": "integer"
- },
- "tool": {
- "description": "Action tool to run.",
- "enum": [
- "click",
- "double_click",
- "right_click",
- "set_value",
- "type_text",
- "press_key",
- "hotkey",
- "scroll",
- "drag",
- "move_cursor"
- ],
- "type": "string"
- },
- "wait_for": {
- "description": "Check that must hold before the action: {role?, name?, text?, gone?, app?, window?, timeout_ms?}. Default timeout 5000 ms.",
- "type": "object"
- }
- },
- "required": [
- "tool"
- ],
+ "additionalProperties": true,
+ "properties": {
+ "args": {
+ "description": "Arguments for that tool, as in a direct call, optionally with role/name/nth/app/window to name the target instead of pid/window_id/element_token.",
"type": "object"
},
- {
- "additionalProperties": true,
- "description": "Shorthand {<tool>: args} with optional wait_for / expect / timeout_ms, or a step that is only a wait_for or expect check.",
- "properties": {
- "expect": {
- "type": [
- "object",
- "array"
- ]
- },
- "timeout_ms": {
- "maximum": 10000,
- "minimum": 0,
- "type": "integer"
- },
- "wait_for": {
- "type": "object"
- }
+ "expect": {
+ "description": "Up to 4 checks that must hold after the action: {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}. Default timeout 2000 ms.",
+ "items": {
+ "type": "object"
},
+ "maxItems": 4,
+ "type": "array"
+ },
+ "timeout_ms": {
+ "description": "How long a named target may take to appear. Default 3000.",
+ "maximum": 10000,
+ "minimum": 0,
+ "type": "integer"
+ },
+ "tool": {
+ "description": "Action tool to run.",
+ "enum": [
+ "click",
+ "double_click",
+ "right_click",
+ "set_value",
+ "type_text",
+ "press_key",
+ "hotkey",
+ "scroll",
+ "drag",
+ "move_cursor"
+ ],
+ "type": "string"
+ },
+ "wait_for": {
+ "description": "Check that must hold before the action: {role?, name?, text?, gone?, app?, window?, timeout_ms?}. Default timeout 5000 ms.",
"type": "object"
}
- ]
+ },
+ "type": "object"
},
"maxItems": 64,
"minItems": 1,
@@ -3717,24 +3499,17 @@
"description": "Optional, model-neutral controls for one bounded parse.",
"properties": {
"kinds": {
- "anyOf": [
- {
- "items": {
- "enum": [
- "text",
- "icon"
- ]
- },
- "maxItems": 2,
- "minItems": 1,
- "type": "array",
- "uniqueItems": true
- },
- {
- "type": "null"
- }
- ],
- "description": "Region kinds to return (`text`, `icon`). Omit for all kinds."
+ "description": "Region kinds to return (`text`, `icon`). Omit for all kinds.",
+ "items": {
+ "enum": [
+ "text",
+ "icon"
+ ],
+ "type": "string"
+ },
+ "maxItems": 2,
+ "minItems": 1,
+ "type": "array"
},
"max_regions": {
"description": "Return at most this many regions.",
diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json
index 4c32f612ba..da991e478f 100644
--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json
+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json
@@ -167,20 +167,14 @@
"additionalProperties": false,
"properties": {
"enabled": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"exists": {
"description": "Assert that at least one trusted element matches the selector.\n\nElement walks are not yet exhaustive on every platform, so absence\ncannot be proven. `false` is rejected instead of returning an\nindefinitely-unknown predicate.",
"type": "boolean"
},
"selected": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"selector": {
"additionalProperties": false,
@@ -198,19 +192,13 @@
"type": "object"
},
"value_equals": {
- "type": [
- "string",
- "null"
- ]
+ "type": "string"
}
},
"required": [
"selector"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"window": {
"additionalProperties": false,
@@ -242,22 +230,14 @@
"width",
"height"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"exists": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
}
},
"required": [],
@@ -269,10 +249,7 @@
},
"include_screenshot": {
"description": "Return the final window screenshot as image content for a multimodal\ncaller. The driver does not interpret that image.",
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"pid": {
"description": "Exact process whose window may be observed.",
@@ -581,49 +558,36 @@
"type": "string"
},
"target": {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
+ "additionalProperties": true,
+ "description": "Exact window (kind \"window\", with pid and window_id) or desktop (kind \"desktop\", with display_id). \"primary\" is the portable desktop target.",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
],
- "type": "object"
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
- ]
+ },
+ "required": [
+ "kind"
+ ],
+ "type": "object"
},
"window_id": {
"description": "Target window ID. Omit with element_token.",
@@ -822,57 +786,36 @@
"type": "integer"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
},
- {
- "type": "null"
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"to_x": {
"description": "Drag-end X in window-local screenshot pixels.",
@@ -942,57 +885,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
},
- {
- "type": "null"
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"text": {
"description": "Text to insert.",
@@ -1068,57 +990,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
},
- {
- "type": "null"
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"window_id": {
"description": "Target window; required for foreground. Does not raise by itself.",
@@ -1187,57 +1088,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
},
- {
- "type": "null"
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"window_id": {
"description": "Target window. Required for delivery_mode:\"foreground\" (the NSMenu activation needs a window). Does NOT itself raise the window — raising is gated on delivery_mode.",
@@ -1360,57 +1240,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"window_id": {
"description": "Window ID. Required with x/y; optional with element_token.",
@@ -1571,57 +1430,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
},
- {
- "type": "null"
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"x": {
"description": "Destination X. Window scope: screen points for the agent cursor overlay. Desktop scope: native get_desktop_state screenshot pixels.",
@@ -1675,90 +1513,80 @@
"properties": {
"arc_flow": {
"description": "Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`:\npositive moves the apex toward the destination. Clamped to -1..1 (default 0).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"arc_size": {
"description": "Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default)\nkeeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"dwell_after_click_ms": {
"description": "Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"effects": {
"additionalProperties": false,
- "description": "Turn single effects on or off. An omitted effect keeps its current setting; null\nrestores the style's default.",
+ "description": "Turn effects on or off. Omit a field to keep it; `\"default\"` restores the style default.",
"properties": {
"glow": {
"description": "Soft glow around the cursor that grows with speed.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"magnet": {
"description": "Target glow when the `magnetic` style locks on.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"ripple": {
"description": "Ring that expands from the hotspot on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"squish": {
"description": "Brief scale-down of the cursor on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"trail": {
"description": "Short fading trail behind the cursor.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"end_handle": {
"description": "Arc control-point offset from the end, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"glide_duration_ms": {
"description": "Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A\nnonzero value with `native` timing also fixes the duration. Clamped to 0..5000.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"idle_hide_ms": {
"description": "Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to\n0..60000 (default 15000).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"session": {
"description": "Public label of the session that owns the cursor. Omitted or null motion fields keep\ntheir current value.",
@@ -1766,17 +1594,11 @@
},
"spring": {
"description": "Arrival spring damping for `classic`: 1 is critically damped, 0.3 is bouncy. Clamped\nto 0.3..1 (default 0.72).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"start_handle": {
"description": "Arc control-point offset from the start, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"style": {
"description": "Trajectory style. `signature_arc` (default) is one arc with a small follow-through;\n`spring_settle` lands with one soft bounce; `magnetic` is pulled into the target;\n`comet_swoop` is a wide arc with a short trail; `adaptive` picks a careful approach for\nsmall targets and a swoop for long moves; `classic` is the previous Dubins glide. When\nthe theme's reduced motion is on, every move is a short straight glide with no effects.",
@@ -1801,10 +1623,7 @@
},
"turn_radius": {
"description": "Minimum turning radius of the `classic` glide path, in points; smaller turns tighter.\nClamped to 1..1000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
}
},
"required": [
@@ -1954,27 +1773,56 @@
"additionalProperties": false,
"properties": {
"cursor.motion": {
- "description": "Pass null (or `default`) to clear every saved cursor motion default."
+ "description": "Pass `default` to clear every saved cursor motion default.",
+ "enum": [
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.glow": {
- "description": "Saved default for the `glow` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `glow` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.magnet": {
- "description": "Saved default for the `magnet` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `magnet` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.ripple": {
- "description": "Saved default for the `ripple` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `ripple` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.squish": {
- "description": "Saved default for the `squish` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `squish` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.trail": {
- "description": "Saved default for the `trail` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `trail` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.style": {
"description": "Saved default cursor motion style for new sessions. Overridden by start_session cursor_motion and set_agent_cursor_motion; reduced motion always wins. Built-in default: signature_arc.",
@@ -2005,10 +1853,6 @@
"description": "PiP window size + optional position in `WxH` or `WxH+X+Y` form (e.g. `320x200+24+24`). Applies on next daemon restart.",
"type": "string"
},
- "key": {
- "description": "Name of a single config field to write ({key, value} shape, matching the CLI `config set` and the Windows/Linux tools). Pair with `value`. Equivalent to passing the field directly.",
- "type": "string"
- },
"max_image_dimension": {
"description": "Max dimension for screenshot resizing (0 = no limit).",
"type": "integer"
@@ -2016,9 +1860,6 @@
"session": {
"description": "For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session.",
"type": "string"
- },
- "value": {
- "description": "New value for `key`. JSON type depends on the key."
}
},
"type": "object"
@@ -2825,104 +2666,88 @@
"properties": {
"arc_flow": {
"description": "Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`:\npositive moves the apex toward the destination. Clamped to -1..1 (default 0).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"arc_size": {
"description": "Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default)\nkeeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"dwell_after_click_ms": {
"description": "Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"effects": {
"additionalProperties": false,
- "description": "Turn single effects on or off. An omitted effect keeps its current setting; null\nrestores the style's default.",
+ "description": "Turn effects on or off. Omit a field to keep it; `\"default\"` restores the style default.",
"properties": {
"glow": {
"description": "Soft glow around the cursor that grows with speed.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"magnet": {
"description": "Target glow when the `magnetic` style locks on.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"ripple": {
"description": "Ring that expands from the hotspot on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"squish": {
"description": "Brief scale-down of the cursor on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"trail": {
"description": "Short fading trail behind the cursor.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"end_handle": {
"description": "Arc control-point offset from the end, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"glide_duration_ms": {
"description": "Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A\nnonzero value with `native` timing also fixes the duration. Clamped to 0..5000.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"idle_hide_ms": {
"description": "Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to\n0..60000 (default 15000).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"spring": {
"description": "Arrival spring damping for `classic`: 1 is critically damped, 0.3 is bouncy. Clamped\nto 0.3..1 (default 0.72).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"start_handle": {
"description": "Arc control-point offset from the start, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"style": {
"description": "Trajectory style. `signature_arc` (default) is one arc with a small follow-through;\n`spring_settle` lands with one soft bounce; `magnetic` is pulled into the target;\n`comet_swoop` is a wide arc with a short trail; `adaptive` picks a careful approach for\nsmall targets and a swoop for long moves; `classic` is the previous Dubins glide. When\nthe theme's reduced motion is on, every move is a short straight glide with no effects.",
@@ -2947,18 +2772,14 @@
},
"turn_radius": {
"description": "Minimum turning radius of the `classic` glide path, in points; smaller turns tighter.\nClamped to 1..1000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"cursor_theme": {
+ "additionalProperties": true,
"description": "Optional initial cursor theme. The host applies it before the cursor is\nfirst made visible, avoiding a flash of the default theme.",
"properties": {
"reduced_motion": {
@@ -2977,10 +2798,7 @@
"required": [
"theme_id"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"session": {
"description": "Optional stable public label for this run (e.g. \"research-run-1\").\nWhen omitted, the authenticated transport lease's implicit session is\ncreated or returned.",
@@ -3062,10 +2880,7 @@
"limit": {
"description": "Maximum number of content-free summaries to return (default 50, max\n100). Ordinary agent transports are scoped to their own lease.",
"minimum": 0,
- "type": [
- "integer",
- "null"
- ]
+ "type": "integer"
}
},
"required": [],
@@ -3111,7 +2926,7 @@
"read_only": false
},
{
- "description": "The default way to act: run one or more action tools in ONE call, in order, stop at the first failure, and (with `observe`) get what changed in the same response. Use it whenever you know the next action(s) and would otherwise re-read the window after them: fill three fields, click, and see the result in one call instead of five. Even a single step plus `observe:true` replaces an action call followed by a get_window_state call. Each step is `{tool, args}` where `tool` is one of click, double_click, right_click, set_value, type_text, press_key, hotkey, scroll, drag, move_cursor and `args` are exactly that tool's arguments. `pid` and `window_id` (or `app`/`window`) on run_steps itself are the default window of every step that names none. Reads (get_window_state, zoom) do not run between steps: one there is skipped; a get_window_state last is the `observe`, a zoom last runs after it. Every step goes through the same session, permission and approval checks as a direct call; a batch grants nothing extra. All steps are validated before the first one runs, so a malformed step 4 changes nothing. Element tokens and element_index values come from a get_window_state read before the batch; a step that changes the UI can invalidate later element targets, so put element-targeted actions before the actions that reshuffle the window, or target later steps by role/name. A token that went stale is retried once on the element with the same role and label, if exactly one matches.\n\nReturns per-step status (`ok` or the error message) and, when `observe` is given, ONE bounded get_window_state read after the last executed step (after a failure caused by a dialog holding focus, that dialog is read, even without `observe`). A step refused because its app ignores background input says how to re-send it; `foreground_fallback:true` retries such steps in the foreground once (the window is activated). That read is a `since:\"latest\"` diff by default: only the rows that changed since your last read of the window, plus a new snapshot_id. Without `observe` nothing is read. The batch uses one session: steps may omit `session` or repeat the batch's. `delay_ms` pauses between steps (max 2000). At most 64 steps; `delivery_mode` on run_steps is the default for its steps.\n\nTARGET BY NAME (no earlier read needed, so one batch can cross screens): a step can be written `{\"click\": {...args}}` as well as `{tool, args}`, and its args may name the target instead of carrying a token: `role` (button, textfield, link, checkbox, menuitem, ...; AX/UIA/AT-SPI names also work), `name` (the element's label; exact match wins over substring, case-insensitive), `nth` (0-based, when several match), and `app` (app name or bundle id) and/or `window` (title substring) instead of pid/window_id. The batch reads the window fresh, waits up to 3 s (step `timeout_ms`, max 10000) for the element to appear, and acts on it; with only `app` it uses that app's frontmost window, so a dialog that opened on top is found. Later steps inherit the window, so name `app` once. The first lookup in a window also reads it once for `observe`, so the end diff shows what the batch changed even in a window you never read. Several matches fail with the candidates listed; add `nth` or a fuller name.\n\nWAITS AND CHECKS: a step may add `wait_for` (checked before its action) and `expect` (one check or up to 4, checked after it); a step may also be only a check. A check is {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}: `text` matches any row of the tree, static text included; `gone:true` waits for it to disappear. Checks poll until they hold or time out (wait_for 5 s, expect 2 s, max 10 s), and a check that does not hold fails the step with what was found instead. The report says which step failed, in which phase (wait_for, find, action, expect) and why. Whole batch: at most 60 s.\n\nExample (fill a form, submit, confirm the dialog, check the result):\n{\"steps\":[{\"set_value\":{\"app\":\"Safari\",\"role\":\"textfield\",\"name\":\"Email\",\"value\":\"[email protected]\"}},{\"click\":{\"role\":\"button\",\"name\":\"Submit\"},\"expect\":{\"role\":\"button\",\"name\":\"Confirm\"}},{\"click\":{\"role\":\"button\",\"name\":\"Confirm\"},\"expect\":[{\"name\":\"Confirm\",\"gone\":true},{\"text\":\"Thanks\"}]}],\"observe\":true}",
+ "description": "The default way to act: run one or more action tools in ONE call, in order, stop at the first failure, and (with `observe`) get what changed in the same response. Use it whenever you know the next action(s) and would otherwise re-read the window after them: fill three fields, click, and see the result in one call instead of five. Even a single step plus `observe:{}` replaces an action call followed by a get_window_state call. Each step is `{tool, args}` where `tool` is one of click, double_click, right_click, set_value, type_text, press_key, hotkey, scroll, drag, move_cursor and `args` are exactly that tool's arguments. `pid` and `window_id` (or `app`/`window`) on run_steps itself are the default window of every step that names none. Reads (get_window_state, zoom) do not run between steps: one there is skipped; a get_window_state last is the `observe`, a zoom last runs after it. Every step goes through the same session, permission and approval checks as a direct call; a batch grants nothing extra. All steps are validated before the first one runs, so a malformed step 4 changes nothing. Element tokens and element_index values come from a get_window_state read before the batch; a step that changes the UI can invalidate later element targets, so put element-targeted actions before the actions that reshuffle the window, or target later steps by role/name. A token that went stale is retried once on the element with the same role and label, if exactly one matches.\n\nReturns per-step status (`ok` or the error message) and, when `observe` is given, ONE bounded get_window_state read after the last executed step (after a failure caused by a dialog holding focus, that dialog is read, even without `observe`). A step refused because its app ignores background input says how to re-send it; `foreground_fallback:true` retries such steps in the foreground once (the window is activated). That read is a `since:\"latest\"` diff by default: only the rows that changed since your last read of the window, plus a new snapshot_id. Without `observe` nothing is read. The batch uses one session: steps may omit `session` or repeat the batch's. `delay_ms` pauses between steps (max 2000). At most 64 steps; `delivery_mode` on run_steps is the default for its steps.\n\nTARGET BY NAME (no earlier read needed, so one batch can cross screens): a step can be written `{\"click\": {...args}}` as well as `{tool, args}`, and its args may name the target instead of carrying a token: `role` (button, textfield, link, checkbox, menuitem, ...; AX/UIA/AT-SPI names also work), `name` (the element's label; exact match wins over substring, case-insensitive), `nth` (0-based, when several match), and `app` (app name or bundle id) and/or `window` (title substring) instead of pid/window_id. The batch reads the window fresh, waits up to 3 s (step `timeout_ms`, max 10000) for the element to appear, and acts on it; with only `app` it uses that app's frontmost window, so a dialog that opened on top is found. Later steps inherit the window, so name `app` once. The first lookup in a window also reads it once for `observe`, so the end diff shows what the batch changed even in a window you never read. Several matches fail with the candidates listed; add `nth` or a fuller name.\n\nWAITS AND CHECKS: a step may add `wait_for` (checked before its action) and `expect` (one check or up to 4, checked after it); a step may also be only a check. A check is {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}: `text` matches any row of the tree, static text included; `gone:true` waits for it to disappear. Checks poll until they hold or time out (wait_for 5 s, expect 2 s, max 10 s), and a check that does not hold fails the step with what was found instead. The report says which step failed, in which phase (wait_for, find, action, expect) and why. Whole batch: at most 60 s.\n\nExample (fill a form, submit, confirm the dialog, check the result):\n{\"steps\":[{\"set_value\":{\"app\":\"Safari\",\"role\":\"textfield\",\"name\":\"Email\",\"value\":\"[email protected]\"}},{\"click\":{\"role\":\"button\",\"name\":\"Submit\"},\"expect\":[{\"role\":\"button\",\"name\":\"Confirm\"}]},{\"click\":{\"role\":\"button\",\"name\":\"Confirm\"},\"expect\":[{\"name\":\"Confirm\",\"gone\":true},{\"text\":\"Thanks\"}]}],\"observe\":{}}",
"destructive": true,
"idempotent": false,
"input_schema": {
@@ -3140,11 +2955,8 @@
"type": "boolean"
},
"observe": {
- "description": "Optional end-of-batch observation: `true`, or arguments for ONE get_window_state call. `pid` and `window_id` default to those of the last step that names both. Defaults to since=\"latest\" (only what changed since your last read of that window with the same query/max_elements/max_depth; a full read when there is none), include_screenshot=false and max_elements=250; pass include_screenshot=true to see the window, or since=null for a full read. Omit to read nothing.",
- "type": [
- "object",
- "boolean"
- ]
+ "description": "Optional end-of-batch observation: arguments for ONE get_window_state call. `pid` and `window_id` default to those of the last step that names both. Defaults to since=\"latest\" (only what changed since your last read of that window with the same query/max_elements/max_depth; a full read when there is none), include_screenshot=false and max_elements=250; pass include_screenshot=true to see the window, or since=null for a full read. Omit to read nothing. {} observes the last window.",
+ "type": "object"
},
"pid": {
"description": "Default pid for steps that name no window (a step's own pid/window_id/app/window wins).",
@@ -3157,75 +2969,48 @@
"steps": {
"description": "Ordered actions. Execution stops at the first failing step. Each step is {tool, args} or {<tool>: args}, plus optional wait_for / expect / timeout_ms; a step may also be only a wait_for or expect check.",
"items": {
- "anyOf": [
- {
- "additionalProperties": false,
- "properties": {
- "args": {
- "description": "Arguments for that tool, as in a direct call, optionally with role/name/nth/app/window to name the target instead of pid/window_id/element_token.",
- "type": "object"
- },
- "expect": {
- "description": "Check (or up to 4) that must hold after the action: {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}. Default timeout 2000 ms.",
- "type": [
- "object",
- "array"
- ]
- },
- "timeout_ms": {
- "description": "How long a named target may take to appear. Default 3000.",
- "maximum": 10000,
- "minimum": 0,
- "type": "integer"
- },
- "tool": {
- "description": "Action tool to run.",
- "enum": [
- "click",
- "double_click",
- "right_click",
- "set_value",
- "type_text",
- "press_key",
- "hotkey",
- "scroll",
- "drag",
- "move_cursor"
- ],
- "type": "string"
- },
- "wait_for": {
- "description": "Check that must hold before the action: {role?, name?, text?, gone?, app?, window?, timeout_ms?}. Default timeout 5000 ms.",
- "type": "object"
- }
- },
- "required": [
- "tool"
- ],
+ "additionalProperties": true,
+ "properties": {
+ "args": {
+ "description": "Arguments for that tool, as in a direct call, optionally with role/name/nth/app/window to name the target instead of pid/window_id/element_token.",
"type": "object"
},
- {
- "additionalProperties": true,
- "description": "Shorthand {<tool>: args} with optional wait_for / expect / timeout_ms, or a step that is only a wait_for or expect check.",
- "properties": {
- "expect": {
- "type": [
- "object",
- "array"
- ]
- },
- "timeout_ms": {
- "maximum": 10000,
- "minimum": 0,
- "type": "integer"
- },
- "wait_for": {
- "type": "object"
- }
+ "expect": {
+ "description": "Up to 4 checks that must hold after the action: {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}. Default timeout 2000 ms.",
+ "items": {
+ "type": "object"
},
+ "maxItems": 4,
+ "type": "array"
+ },
+ "timeout_ms": {
+ "description": "How long a named target may take to appear. Default 3000.",
+ "maximum": 10000,
+ "minimum": 0,
+ "type": "integer"
+ },
+ "tool": {
+ "description": "Action tool to run.",
+ "enum": [
+ "click",
+ "double_click",
+ "right_click",
+ "set_value",
+ "type_text",
+ "press_key",
+ "hotkey",
+ "scroll",
+ "drag",
+ "move_cursor"
+ ],
+ "type": "string"
+ },
+ "wait_for": {
+ "description": "Check that must hold before the action: {role?, name?, text?, gone?, app?, window?, timeout_ms?}. Default timeout 5000 ms.",
"type": "object"
}
- ]
+ },
+ "type": "object"
},
"maxItems": 64,
"minItems": 1,
@@ -3353,24 +3138,17 @@
"description": "Optional, model-neutral controls for one bounded parse.",
"properties": {
"kinds": {
- "anyOf": [
- {
- "items": {
- "enum": [
- "text",
- "icon"
- ]
- },
- "maxItems": 2,
- "minItems": 1,
- "type": "array",
- "uniqueItems": true
- },
- {
- "type": "null"
- }
- ],
- "description": "Region kinds to return (`text`, `icon`). Omit for all kinds."
+ "description": "Region kinds to return (`text`, `icon`). Omit for all kinds.",
+ "items": {
+ "enum": [
+ "text",
+ "icon"
+ ],
+ "type": "string"
+ },
+ "maxItems": 2,
+ "minItems": 1,
+ "type": "array"
},
"max_regions": {
"description": "Return at most this many regions.",
diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json
index d68cd4428a..8ac9540a9c 100644
--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json
+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json
@@ -167,20 +167,14 @@
"additionalProperties": false,
"properties": {
"enabled": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"exists": {
"description": "Assert that at least one trusted element matches the selector.\n\nElement walks are not yet exhaustive on every platform, so absence\ncannot be proven. `false` is rejected instead of returning an\nindefinitely-unknown predicate.",
"type": "boolean"
},
"selected": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"selector": {
"additionalProperties": false,
@@ -198,19 +192,13 @@
"type": "object"
},
"value_equals": {
- "type": [
- "string",
- "null"
- ]
+ "type": "string"
}
},
"required": [
"selector"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"window": {
"additionalProperties": false,
@@ -242,22 +230,14 @@
"width",
"height"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"exists": {
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
}
},
"required": [],
@@ -269,10 +249,7 @@
},
"include_screenshot": {
"description": "Return the final window screenshot as image content for a multimodal\ncaller. The driver does not interpret that image.",
- "type": [
- "boolean",
- "null"
- ]
+ "type": "boolean"
},
"pid": {
"description": "Exact process whose window may be observed.",
@@ -621,49 +598,36 @@
"type": "string"
},
"target": {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
+ "additionalProperties": true,
+ "description": "Exact window (kind \"window\", with pid and window_id) or desktop (kind \"desktop\", with display_id). \"primary\" is the portable desktop target.",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
],
- "type": "object"
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
- ]
+ },
+ "required": [
+ "kind"
+ ],
+ "type": "object"
},
"window_id": {
"description": "HWND of the target window. Omit when element_token is supplied (the token carries it).",
@@ -875,57 +839,36 @@
"type": "integer"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
},
- {
- "type": "null"
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"to_x": {
"description": "Drag-end X in window-local screenshot pixels.",
@@ -994,57 +937,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
},
- {
- "type": "null"
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"text": {
"description": "Text to insert at the focused element's cursor.",
@@ -1119,57 +1041,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
},
- {
- "type": "null"
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"window_id": {
"description": "HWND for the target window. Omit when element_token is supplied; otherwise auto-resolves the pid's first visible window.",
@@ -1237,57 +1138,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
},
- {
- "type": "null"
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"window_id": {
"description": "Explicit HWND when the pid owns multiple windows.",
@@ -1418,57 +1298,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
},
- {
- "type": "null"
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
+ },
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"window_id": {
"description": "HWND of the target window. Omit when element_token is supplied; otherwise auto-resolves the pid's first visible window.",
@@ -1628,57 +1487,36 @@
"type": "string"
},
"target": {
- "anyOf": [
- {
- "description": "Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.",
- "oneOf": [
- {
- "additionalProperties": true,
- "properties": {
- "kind": {
- "const": "window",
- "type": "string"
- },
- "pid": {
- "minimum": 0,
- "type": "integer"
- },
- "window_id": {
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "kind",
- "pid",
- "window_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": true,
- "properties": {
- "display_id": {
- "type": "string"
- },
- "kind": {
- "const": "desktop",
- "type": "string"
- }
- },
- "required": [
- "kind",
- "display_id"
- ],
- "type": "object"
- }
- ]
+ "additionalProperties": true,
+ "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`).",
+ "properties": {
+ "display_id": {
+ "description": "Display id. Required when kind is desktop; use \"primary\".",
+ "type": "string"
+ },
+ "kind": {
+ "description": "window requires pid and window_id; desktop requires display_id.",
+ "enum": [
+ "window",
+ "desktop"
+ ],
+ "type": "string"
+ },
+ "pid": {
+ "description": "Process id. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
},
- {
- "type": "null"
+ "window_id": {
+ "description": "Window id from list_windows. Required when kind is window.",
+ "minimum": 0,
+ "type": "integer"
}
+ },
+ "required": [
+ "kind"
],
- "description": "Preferred per-call target: an exact window (`kind=\"window\"`, `pid`, `window_id`) or the\nprimary desktop (`kind=\"desktop\"`, `display_id=\"primary\"`)."
+ "type": "object"
},
"x": {
"description": "Destination X. Window scope: screen coordinates of the agent cursor overlay. Desktop scope: get_desktop_state screenshot pixels.",
@@ -1732,90 +1570,80 @@
"properties": {
"arc_flow": {
"description": "Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`:\npositive moves the apex toward the destination. Clamped to -1..1 (default 0).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"arc_size": {
"description": "Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default)\nkeeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"dwell_after_click_ms": {
"description": "Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"effects": {
"additionalProperties": false,
- "description": "Turn single effects on or off. An omitted effect keeps its current setting; null\nrestores the style's default.",
+ "description": "Turn effects on or off. Omit a field to keep it; `\"default\"` restores the style default.",
"properties": {
"glow": {
"description": "Soft glow around the cursor that grows with speed.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"magnet": {
"description": "Target glow when the `magnetic` style locks on.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"ripple": {
"description": "Ring that expands from the hotspot on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"squish": {
"description": "Brief scale-down of the cursor on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"trail": {
"description": "Short fading trail behind the cursor.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"end_handle": {
"description": "Arc control-point offset from the end, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"glide_duration_ms": {
"description": "Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A\nnonzero value with `native` timing also fixes the duration. Clamped to 0..5000.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"idle_hide_ms": {
"description": "Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to\n0..60000 (default 15000).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"session": {
"description": "Public label of the session that owns the cursor. Omitted or null motion fields keep\ntheir current value.",
@@ -1823,17 +1651,11 @@
},
"spring": {
"description": "Arrival spring damping for `classic`: 1 is critically damped, 0.3 is bouncy. Clamped\nto 0.3..1 (default 0.72).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"start_handle": {
"description": "Arc control-point offset from the start, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"style": {
"description": "Trajectory style. `signature_arc` (default) is one arc with a small follow-through;\n`spring_settle` lands with one soft bounce; `magnetic` is pulled into the target;\n`comet_swoop` is a wide arc with a short trail; `adaptive` picks a careful approach for\nsmall targets and a swoop for long moves; `classic` is the previous Dubins glide. When\nthe theme's reduced motion is on, every move is a short straight glide with no effects.",
@@ -1858,10 +1680,7 @@
},
"turn_radius": {
"description": "Minimum turning radius of the `classic` glide path, in points; smaller turns tighter.\nClamped to 1..1000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
}
},
"required": [
@@ -1995,7 +1814,7 @@
"read_only": true
},
{
- "description": "Write a setting into the persistent driver config. Values take effect immediately.\n\nTwo input shapes:\n- **Swift-compatible** (preferred): `{\"key\": \"max_image_dimension\", \"value\": 1568}` — single dotted-path leaf write.\n- **Legacy per-field** (Rust-only): `{\"max_image_dimension\": 0}` — bulk write of named fields.\n\nKnown keys:\n- `capture_mode` (string: `vision` | `ax` | `som`) — DEPRECATED and ignored; `get_window_state` always returns both the UIA tree and a screenshot. Still accepted/persisted for back-compat but has no effect.\n- `max_image_dimension` (integer)\n- `experimental_pip` (boolean; persisted to config.json, applies on next daemon restart — Windows backend stubbed today, see issue #1729)\n- `experimental_pip_geometry` (string `WxH` or `WxH+X+Y`; persisted; applies on next daemon restart)\n\n- `cursor.motion.style`, `cursor.motion.timing`, `cursor.motion.effects.<name>` — saved default cursor motion for sessions started afterwards (see the cursor docs).\n\nReturns the full updated config in the same shape as `get_config`.",
+ "description": "Write a setting into the persistent driver config. Values take effect immediately. Pass each setting as its own field.\n\nKnown keys:\n- `capture_mode` (string: `vision` | `ax` | `som`) — DEPRECATED and ignored; `get_window_state` always returns both the UIA tree and a screenshot. Still accepted/persisted for back-compat but has no effect.\n- `max_image_dimension` (integer)\n- `experimental_pip` (boolean; persisted to config.json, applies on next daemon restart — Windows backend stubbed today, see issue #1729)\n- `experimental_pip_geometry` (string `WxH` or `WxH+X+Y`; persisted; applies on next daemon restart)\n\n- `cursor.motion.style`, `cursor.motion.timing`, `cursor.motion.effects.<name>` (`on`, `off`, or `default`) — saved default cursor motion for sessions started afterwards. `cursor.motion: \"default\"` clears every saved cursor motion default.\n\nReturns the full updated config in the same shape as `get_config`.",
"destructive": false,
"idempotent": true,
"input_schema": {
@@ -2010,27 +1829,56 @@
"type": "string"
},
"cursor.motion": {
- "description": "Pass null (or `default`) to clear every saved cursor motion default."
+ "description": "Pass `default` to clear every saved cursor motion default.",
+ "enum": [
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.glow": {
- "description": "Saved default for the `glow` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `glow` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.magnet": {
- "description": "Saved default for the `magnet` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `magnet` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.ripple": {
- "description": "Saved default for the `ripple` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `ripple` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.squish": {
- "description": "Saved default for the `squish` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `squish` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.effects.trail": {
- "description": "Saved default for the `trail` cursor effect. Unset follows the style.",
- "type": "boolean"
+ "description": "Saved default for the `trail` cursor effect: on, off, or default (the style's own). Omit the key to leave it unchanged.",
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"cursor.motion.style": {
"description": "Saved default cursor motion style for new sessions. Overridden by start_session cursor_motion and set_agent_cursor_motion; reduced motion always wins. Built-in default: signature_arc.",
@@ -2054,27 +1902,20 @@
"type": "string"
},
"experimental_pip": {
- "description": "Legacy per-field shape. Enables PiP preview (applies next restart).",
+ "description": "Enables PiP preview (applies next restart).",
"type": "boolean"
},
"experimental_pip_geometry": {
- "description": "Legacy per-field shape. PiP window size + optional position.",
- "type": "string"
- },
- "key": {
- "description": "Dotted snake_case path to a leaf config field (Swift-compatible shape). Pair with `value`.",
+ "description": "PiP window size + optional position.",
"type": "string"
},
"max_image_dimension": {
- "description": "Legacy per-field shape.",
+ "description": "Max dimension for screenshot resizing (0 = no limit).",
"type": "integer"
},
"session": {
"description": "For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session.",
"type": "string"
- },
- "value": {
- "description": "New value for `key`. JSON type depends on the key."
}
},
"type": "object"
@@ -2881,104 +2722,88 @@
"properties": {
"arc_flow": {
"description": "Added to the arc asymmetry of `signature_arc`, `spring_settle` and `comet_swoop`:\npositive moves the apex toward the destination. Clamped to -1..1 (default 0).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"arc_size": {
"description": "Scales the arc of `signature_arc`, `spring_settle` and `comet_swoop`: 0.25 (default)\nkeeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"dwell_after_click_ms": {
"description": "Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"effects": {
"additionalProperties": false,
- "description": "Turn single effects on or off. An omitted effect keeps its current setting; null\nrestores the style's default.",
+ "description": "Turn effects on or off. Omit a field to keep it; `\"default\"` restores the style default.",
"properties": {
"glow": {
"description": "Soft glow around the cursor that grows with speed.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"magnet": {
"description": "Target glow when the `magnetic` style locks on.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"ripple": {
"description": "Ring that expands from the hotspot on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"squish": {
"description": "Brief scale-down of the cursor on click.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
},
"trail": {
"description": "Short fading trail behind the cursor.",
- "type": [
- "boolean",
- "null"
- ]
+ "enum": [
+ "on",
+ "off",
+ "default"
+ ],
+ "type": "string"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"end_handle": {
"description": "Arc control-point offset from the end, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"glide_duration_ms": {
"description": "Move duration in milliseconds for `fixed` timing (1430 ms when 0, the default). A\nnonzero value with `native` timing also fixes the duration. Clamped to 0..5000.",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"idle_hide_ms": {
"description": "Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to\n0..60000 (default 15000).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"spring": {
"description": "Arrival spring damping for `classic`: 1 is critically damped, 0.3 is bouncy. Clamped\nto 0.3..1 (default 0.72).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"start_handle": {
"description": "Arc control-point offset from the start, as a fraction of the distance, for\n`signature_arc`, `spring_settle` and `comet_swoop`. Clamped to 0..1 (default 0.3).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
},
"style": {
"description": "Trajectory style. `signature_arc` (default) is one arc with a small follow-through;\n`spring_settle` lands with one soft bounce; `magnetic` is pulled into the target;\n`comet_swoop` is a wide arc with a short trail; `adaptive` picks a careful approach for\nsmall targets and a swoop for long moves; `classic` is the previous Dubins glide. When\nthe theme's reduced motion is on, every move is a short straight glide with no effects.",
@@ -3003,18 +2828,14 @@
},
"turn_radius": {
"description": "Minimum turning radius of the `classic` glide path, in points; smaller turns tighter.\nClamped to 1..1000 (default 80).",
- "type": [
- "number",
- "null"
- ]
+ "type": "number"
}
},
- "type": [
- "object",
- "null"
- ]
+ "required": [],
+ "type": "object"
},
"cursor_theme": {
+ "additionalProperties": true,
"description": "Optional initial cursor theme. The host applies it before the cursor is\nfirst made visible, avoiding a flash of the default theme.",
"properties": {
"reduced_motion": {
@@ -3033,10 +2854,7 @@
"required": [
"theme_id"
],
- "type": [
- "object",
- "null"
- ]
+ "type": "object"
},
"session": {
"description": "Optional stable public label for this run (e.g. \"research-run-1\").\nWhen omitted, the authenticated transport lease's implicit session is\ncreated or returned.",
@@ -3118,10 +2936,7 @@
"limit": {
"description": "Maximum number of content-free summaries to return (default 50, max\n100). Ordinary agent transports are scoped to their own lease.",
"minimum": 0,
- "type": [
- "integer",
- "null"
- ]
+ "type": "integer"
}
},
"required": [],
@@ -3167,7 +2982,7 @@
"read_only": false
},
{
- "description": "The default way to act: run one or more action tools in ONE call, in order, stop at the first failure, and (with `observe`) get what changed in the same response. Use it whenever you know the next action(s) and would otherwise re-read the window after them: fill three fields, click, and see the result in one call instead of five. Even a single step plus `observe:true` replaces an action call followed by a get_window_state call. Each step is `{tool, args}` where `tool` is one of click, double_click, right_click, set_value, type_text, press_key, hotkey, scroll, drag, move_cursor and `args` are exactly that tool's arguments. `pid` and `window_id` (or `app`/`window`) on run_steps itself are the default window of every step that names none. Reads (get_window_state, zoom) do not run between steps: one there is skipped; a get_window_state last is the `observe`, a zoom last runs after it. Every step goes through the same session, permission and approval checks as a direct call; a batch grants nothing extra. All steps are validated before the first one runs, so a malformed step 4 changes nothing. Element tokens and element_index values come from a get_window_state read before the batch; a step that changes the UI can invalidate later element targets, so put element-targeted actions before the actions that reshuffle the window, or target later steps by role/name. A token that went stale is retried once on the element with the same role and label, if exactly one matches.\n\nReturns per-step status (`ok` or the error message) and, when `observe` is given, ONE bounded get_window_state read after the last executed step (after a failure caused by a dialog holding focus, that dialog is read, even without `observe`). A step refused because its app ignores background input says how to re-send it; `foreground_fallback:true` retries such steps in the foreground once (the window is activated). That read is a `since:\"latest\"` diff by default: only the rows that changed since your last read of the window, plus a new snapshot_id. Without `observe` nothing is read. The batch uses one session: steps may omit `session` or repeat the batch's. `delay_ms` pauses between steps (max 2000). At most 64 steps; `delivery_mode` on run_steps is the default for its steps.\n\nTARGET BY NAME (no earlier read needed, so one batch can cross screens): a step can be written `{\"click\": {...args}}` as well as `{tool, args}`, and its args may name the target instead of carrying a token: `role` (button, textfield, link, checkbox, menuitem, ...; AX/UIA/AT-SPI names also work), `name` (the element's label; exact match wins over substring, case-insensitive), `nth` (0-based, when several match), and `app` (app name or bundle id) and/or `window` (title substring) instead of pid/window_id. The batch reads the window fresh, waits up to 3 s (step `timeout_ms`, max 10000) for the element to appear, and acts on it; with only `app` it uses that app's frontmost window, so a dialog that opened on top is found. Later steps inherit the window, so name `app` once. The first lookup in a window also reads it once for `observe`, so the end diff shows what the batch changed even in a window you never read. Several matches fail with the candidates listed; add `nth` or a fuller name.\n\nWAITS AND CHECKS: a step may add `wait_for` (checked before its action) and `expect` (one check or up to 4, checked after it); a step may also be only a check. A check is {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}: `text` matches any row of the tree, static text included; `gone:true` waits for it to disappear. Checks poll until they hold or time out (wait_for 5 s, expect 2 s, max 10 s), and a check that does not hold fails the step with what was found instead. The report says which step failed, in which phase (wait_for, find, action, expect) and why. Whole batch: at most 60 s.\n\nExample (fill a form, submit, confirm the dialog, check the result):\n{\"steps\":[{\"set_value\":{\"app\":\"Safari\",\"role\":\"textfield\",\"name\":\"Email\",\"value\":\"[email protected]\"}},{\"click\":{\"role\":\"button\",\"name\":\"Submit\"},\"expect\":{\"role\":\"button\",\"name\":\"Confirm\"}},{\"click\":{\"role\":\"button\",\"name\":\"Confirm\"},\"expect\":[{\"name\":\"Confirm\",\"gone\":true},{\"text\":\"Thanks\"}]}],\"observe\":true}",
+ "description": "The default way to act: run one or more action tools in ONE call, in order, stop at the first failure, and (with `observe`) get what changed in the same response. Use it whenever you know the next action(s) and would otherwise re-read the window after them: fill three fields, click, and see the result in one call instead of five. Even a single step plus `observe:{}` replaces an action call followed by a get_window_state call. Each step is `{tool, args}` where `tool` is one of click, double_click, right_click, set_value, type_text, press_key, hotkey, scroll, drag, move_cursor and `args` are exactly that tool's arguments. `pid` and `window_id` (or `app`/`window`) on run_steps itself are the default window of every step that names none. Reads (get_window_state, zoom) do not run between steps: one there is skipped; a get_window_state last is the `observe`, a zoom last runs after it. Every step goes through the same session, permission and approval checks as a direct call; a batch grants nothing extra. All steps are validated before the first one runs, so a malformed step 4 changes nothing. Element tokens and element_index values come from a get_window_state read before the batch; a step that changes the UI can invalidate later element targets, so put element-targeted actions before the actions that reshuffle the window, or target later steps by role/name. A token that went stale is retried once on the element with the same role and label, if exactly one matches.\n\nReturns per-step status (`ok` or the error message) and, when `observe` is given, ONE bounded get_window_state read after the last executed step (after a failure caused by a dialog holding focus, that dialog is read, even without `observe`). A step refused because its app ignores background input says how to re-send it; `foreground_fallback:true` retries such steps in the foreground once (the window is activated). That read is a `since:\"latest\"` diff by default: only the rows that changed since your last read of the window, plus a new snapshot_id. Without `observe` nothing is read. The batch uses one session: steps may omit `session` or repeat the batch's. `delay_ms` pauses between steps (max 2000). At most 64 steps; `delivery_mode` on run_steps is the default for its steps.\n\nTARGET BY NAME (no earlier read needed, so one batch can cross screens): a step can be written `{\"click\": {...args}}` as well as `{tool, args}`, and its args may name the target instead of carrying a token: `role` (button, textfield, link, checkbox, menuitem, ...; AX/UIA/AT-SPI names also work), `name` (the element's label; exact match wins over substring, case-insensitive), `nth` (0-based, when several match), and `app` (app name or bundle id) and/or `window` (title substring) instead of pid/window_id. The batch reads the window fresh, waits up to 3 s (step `timeout_ms`, max 10000) for the element to appear, and acts on it; with only `app` it uses that app's frontmost window, so a dialog that opened on top is found. Later steps inherit the window, so name `app` once. The first lookup in a window also reads it once for `observe`, so the end diff shows what the batch changed even in a window you never read. Several matches fail with the candidates listed; add `nth` or a fuller name.\n\nWAITS AND CHECKS: a step may add `wait_for` (checked before its action) and `expect` (one check or up to 4, checked after it); a step may also be only a check. A check is {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}: `text` matches any row of the tree, static text included; `gone:true` waits for it to disappear. Checks poll until they hold or time out (wait_for 5 s, expect 2 s, max 10 s), and a check that does not hold fails the step with what was found instead. The report says which step failed, in which phase (wait_for, find, action, expect) and why. Whole batch: at most 60 s.\n\nExample (fill a form, submit, confirm the dialog, check the result):\n{\"steps\":[{\"set_value\":{\"app\":\"Safari\",\"role\":\"textfield\",\"name\":\"Email\",\"value\":\"[email protected]\"}},{\"click\":{\"role\":\"button\",\"name\":\"Submit\"},\"expect\":[{\"role\":\"button\",\"name\":\"Confirm\"}]},{\"click\":{\"role\":\"button\",\"name\":\"Confirm\"},\"expect\":[{\"name\":\"Confirm\",\"gone\":true},{\"text\":\"Thanks\"}]}],\"observe\":{}}",
"destructive": true,
"idempotent": false,
"input_schema": {
@@ -3196,11 +3011,8 @@
"type": "boolean"
},
"observe": {
- "description": "Optional end-of-batch observation: `true`, or arguments for ONE get_window_state call. `pid` and `window_id` default to those of the last step that names both. Defaults to since=\"latest\" (only what changed since your last read of that window with the same query/max_elements/max_depth; a full read when there is none), include_screenshot=false and max_elements=250; pass include_screenshot=true to see the window, or since=null for a full read. Omit to read nothing.",
- "type": [
- "object",
- "boolean"
- ]
+ "description": "Optional end-of-batch observation: arguments for ONE get_window_state call. `pid` and `window_id` default to those of the last step that names both. Defaults to since=\"latest\" (only what changed since your last read of that window with the same query/max_elements/max_depth; a full read when there is none), include_screenshot=false and max_elements=250; pass include_screenshot=true to see the window, or since=null for a full read. Omit to read nothing. {} observes the last window.",
+ "type": "object"
},
"pid": {
"description": "Default pid for steps that name no window (a step's own pid/window_id/app/window wins).",
@@ -3213,75 +3025,48 @@
"steps": {
"description": "Ordered actions. Execution stops at the first failing step. Each step is {tool, args} or {<tool>: args}, plus optional wait_for / expect / timeout_ms; a step may also be only a wait_for or expect check.",
"items": {
- "anyOf": [
- {
- "additionalProperties": false,
- "properties": {
- "args": {
- "description": "Arguments for that tool, as in a direct call, optionally with role/name/nth/app/window to name the target instead of pid/window_id/element_token.",
- "type": "object"
- },
- "expect": {
- "description": "Check (or up to 4) that must hold after the action: {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}. Default timeout 2000 ms.",
- "type": [
- "object",
- "array"
- ]
- },
- "timeout_ms": {
- "description": "How long a named target may take to appear. Default 3000.",
- "maximum": 10000,
- "minimum": 0,
- "type": "integer"
- },
- "tool": {
- "description": "Action tool to run.",
- "enum": [
- "click",
- "double_click",
- "right_click",
- "set_value",
- "type_text",
- "press_key",
- "hotkey",
- "scroll",
- "drag",
- "move_cursor"
- ],
- "type": "string"
- },
- "wait_for": {
- "description": "Check that must hold before the action: {role?, name?, text?, gone?, app?, window?, timeout_ms?}. Default timeout 5000 ms.",
- "type": "object"
- }
- },
- "required": [
- "tool"
- ],
+ "additionalProperties": true,
+ "properties": {
+ "args": {
+ "description": "Arguments for that tool, as in a direct call, optionally with role/name/nth/app/window to name the target instead of pid/window_id/element_token.",
"type": "object"
},
- {
- "additionalProperties": true,
- "description": "Shorthand {<tool>: args} with optional wait_for / expect / timeout_ms, or a step that is only a wait_for or expect check.",
- "properties": {
- "expect": {
- "type": [
- "object",
- "array"
- ]
- },
- "timeout_ms": {
- "maximum": 10000,
- "minimum": 0,
- "type": "integer"
- },
- "wait_for": {
- "type": "object"
- }
+ "expect": {
+ "description": "Up to 4 checks that must hold after the action: {role?, name?, text?, gone?, value?, value_contains?, enabled?, selected?, app?, window?, timeout_ms?}. Default timeout 2000 ms.",
+ "items": {
+ "type": "object"
},
+ "maxItems": 4,
+ "type": "array"
+ },
+ "timeout_ms": {
+ "description": "How long a named target may take to appear. Default 3000.",
+ "maximum": 10000,
+ "minimum": 0,
+ "type": "integer"
+ },
+ "tool": {
+ "description": "Action tool to run.",
+ "enum": [
+ "click",
+ "double_click",
+ "right_click",
+ "set_value",
+ "type_text",
+ "press_key",
+ "hotkey",
+ "scroll",
+ "drag",
+ "move_cursor"
+ ],
+ "type": "string"
+ },
+ "wait_for": {
+ "description": "Check that must hold before the action: {role?, name?, text?, gone?, app?, window?, timeout_ms?}. Default timeout 5000 ms.",
"type": "object"
}
- ]
+ },
+ "type": "object"
},
"maxItems": 64,
"minItems": 1,
@@ -3409,24 +3194,17 @@
"description": "Optional, model-neutral controls for one bounded parse.",
"properties": {
"kinds": {
- "anyOf": [
- {
- "items": {
- "enum": [
- "text",
- "icon"
- ]
- },
- "maxItems": 2,
- "minItems": 1,
- "type": "array",
- "uniqueItems": true
- },
- {
- "type": "null"
- }
- ],
- "description": "Region kinds to return (`text`, `icon`). Omit for all kinds."
+ "description": "Region kinds to return (`text`, `icon`). Omit for all kinds.",
+ "items": {
+ "enum": [
+ "text",
+ "icon"
+ ],
+ "type": "string"
+ },
+ "maxItems": 2,
+ "minItems": 1,
+ "type": "array"
},
"max_regions": {
"description": "Return at most this many regions.",
diff --git a/scripts/docs-generators/cli-specs/cua-driver.json b/scripts/docs-generators/cli-specs/cua-driver.json
index 282830899f..3b4dcedd36 100644
--- a/scripts/docs-generators/cli-specs/cua-driver.json
+++ b/scripts/docs-generators/cli-specs/cua-driver.json
@@ -1009,7 +1009,7 @@
"type": "String"
}
],
- "discussion": "Cursor motion defaults are saved keys that apply to sessions started afterwards: cursor.motion.style (signature_arc, spring_settle, magnetic, comet_swoop, adaptive, classic), cursor.motion.timing (native, fitts, fixed) and cursor.motion.effects.<trail|glow|magnet|ripple|squish> (true, false). Use null for a key to clear it, or cursor.motion null to clear all. A start_session cursor_motion or a set_agent_cursor_motion call overrides the saved default.",
+ "discussion": "Cursor motion defaults are saved keys that apply to sessions started afterwards: cursor.motion.style (signature_arc, spring_settle, magnetic, comet_swoop, adaptive, classic), cursor.motion.timing (native, fitts, fixed) and cursor.motion.effects.<trail|glow|magnet|ripple|squish> (on, off, default). Use default for a key to clear it, or cursor.motion default to clear all. A start_session cursor_motion or a set_agent_cursor_motion call overrides the saved default.",
"examples": [
{
"command": "cua-driver config set max_image_dimension 1568",