Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
feat(cua-driver): rename run_actions to run_steps; run_actions stays a hidden alias until a future release (#4935)
Francesco Bonaccid2b14913df63
diff --git a/.github/scripts/cua-driver-mcp-compat/expected-tools.json b/.github/scripts/cua-driver-mcp-compat/expected-tools.jsonindex d6840deb33..7ab2ed1bbc 100644--- a/.github/scripts/cua-driver-mcp-compat/expected-tools.json+++ b/.github/scripts/cua-driver-mcp-compat/expected-tools.json@@ -51,7 +51,7 @@"press_key","replay_trajectory","right_click",- "run_actions",+ "run_steps","scroll","set_agent_cursor_enabled","set_agent_cursor_motion",diff --git a/.github/workflows/smoke-cua-driver-live.yml b/.github/workflows/smoke-cua-driver-live.ymlindex 90b93d3901..e10a606ff8 100644--- a/.github/workflows/smoke-cua-driver-live.yml+++ b/.github/workflows/smoke-cua-driver-live.yml@@ -3,7 +3,7 @@ name: "Smoke: Cua Driver live agent loop"# Builds cua-driver from the checked-out commit and drives a real GUI window on# Windows and on Linux (Xvfb): the lean get_window_state default and# full_output, `since` diffs, act-by-element_token (with and without pid),-# run_actions, and set_value on combo boxes (background, foreground and an+# run_steps, and set_value on combo boxes (background, foreground and an# unknown option). The checks live in scripts/ci/cua-driver-live-smoke/smoke.py.on:diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/batch.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/batch.mdxindex f10fcda7ff..dc09f264d3 100644--- a/docs/content/docs/cua-driver/reference/mcp-tools/batch.mdx+++ b/docs/content/docs/cua-driver/reference/mcp-tools/batch.mdx@@ -12,11 +12,11 @@ description: "Run several action tools in one call."Served by `cua-driver mcp`; see [MCP tools](/cua-driver/reference/mcp-tools) for every tool.-## `run_actions`+## `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_actions 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: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.-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_actions is the default for its steps.+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.TARGET 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.@@ -29,16 +29,16 @@ Effect: destructive. Platforms: macOS, Linux, Windows.| Parameter | Type | Default | Description || --- | --- | --- | --- |-| <span id="run_actions--app"></span>`app` | `string` | | Default app (name or bundle id) for steps that name no window. |-| <span id="run_actions--delay_ms"></span>`delay_ms` | `integer` | | Pause between steps in milliseconds (not after the last). Default 0. Range: 0 to 2000. |-| <span id="run_actions--delivery_mode"></span>`delivery_mode` | `"background" \| "foreground"` | | Default delivery_mode for steps whose tool takes one and that set none. |-| <span id="run_actions--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_actions--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_actions--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_actions--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_actions--steps"></span>`steps` | `object[]` | required | 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: 1 to 64. |-| <span id="run_actions--window"></span>`window` | `string` | | Default window title substring for steps that name no window. |-| <span id="run_actions--window_id"></span>`window_id` | `integer` | | Default window_id for steps that name no window, with `pid`. |+| <span id="run_steps--app"></span>`app` | `string` | | Default app (name or bundle id) for steps that name no window. |+| <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--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 {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: 1 to 64. |+| <span id="run_steps--window"></span>`window` | `string` | | Default window title substring for steps that name no window. |+| <span id="run_steps--window_id"></span>`window_id` | `integer` | | Default window_id for steps that name no window, with `pid`. |**Example arguments**diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/index.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/index.mdxindex 976a9de2eb..c2bed84ade 100644--- a/docs/content/docs/cua-driver/reference/mcp-tools/index.mdx+++ b/docs/content/docs/cua-driver/reference/mcp-tools/index.mdx@@ -149,7 +149,7 @@ Run several action tools in one call. [Reference](/cua-driver/reference/mcp-tool| Tool | Description | Platforms || --- | --- | --- |-| <span id="run_actions"></span>[`run_actions`](/cua-driver/reference/mcp-tools/batch#run_actions) | 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. | macOS, Linux, Windows |+| <span id="run_steps"></span>[`run_steps`](/cua-driver/reference/mcp-tools/batch#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. | macOS, Linux, Windows |## Page toolsdiff --git a/libs/cua-driver/rust/Skills/cua-driver/SKILL.md b/libs/cua-driver/rust/Skills/cua-driver/SKILL.mdindex 6fbdc88fa3..2dfd3a8998 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 f1. 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_actions` 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).+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).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_actions({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:true})`; stops at the first failure | [Workflow](WORKFLOW.md#batch-known-actions) || 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) || Operate the authorized desktop | `get_desktop_state` → input with `target:{kind:"desktop",display_id:"primary"}` → `get_desktop_state` | [Workflow](WORKFLOW.md), [Linux](LINUX.md) on Wayland |diff --git a/libs/cua-driver/rust/Skills/cua-driver/WORKFLOW.md b/libs/cua-driver/rust/Skills/cua-driver/WORKFLOW.mdindex c691be6439..575a9f8dd2 100644--- a/libs/cua-driver/rust/Skills/cua-driver/WORKFLOW.md+++ b/libs/cua-driver/rust/Skills/cua-driver/WORKFLOW.md@@ -79,10 +79,10 @@ Keep `delivery_mode:"background"` as the default for window input. The route may## Batch known actions-`run_actions` is the default way to act. When the next action or actions are decided, send them as one `run_actions` 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: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).```bash-cua-driver run_actions '{"session":"run-1","steps":[+cua-driver run_steps '{"session":"run-1","steps":[{"tool":"set_value","args":{"pid":844,"element_token":"s0000002a:14","value":"Ada"}},{"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"}},@@ -90,13 +90,13 @@ cua-driver run_actions '{"session":"run-1","steps":[],"delay_ms":100,"observe":true}'```-- `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_actions` and `describe <tool>` for schemas. Up to 64 steps. `delivery_mode` on `run_actions` is the default for steps that set none.-- Name the window once: `pid` and `window_id` (or `app`/`window`) on `run_actions` itself are the default for every step that names none.+- `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.+- Name the window once: `pid` and `window_id` (or `app`/`window`) on `run_steps` itself are the default for every step that names none.- A step whose `element_token` went stale because an earlier step re-rendered the window is retried once on the element with the same role and label in a fresh read, when exactly one matches; the step's line says so.- Every step is validated before the first runs, so a malformed step changes nothing. Each step then passes the same session, permission, capability-manifest and approval checks as a direct call; a batch grants nothing a single call lacks, and a refused step ends the batch like any other failure.-- A batch has one session. Set `session` on `run_actions`; a step may repeat it but not name another.+- A batch has one session. Set `session` on `run_steps`; a step may repeat it but not name another.- `observe` is optional and reads once, after the last executed step (also after a failure). Pass `true` or `get_window_state` arguments; `pid`/`window_id` come from the last step that names both. Defaults: `since:"latest"` (only what changed since your last read of that window with the same view; a full read if there is none), `include_screenshot:false`, `max_elements:250`. Pass `include_screenshot:true` to see the window, or `since:null` for a full read. Omit `observe` to read nothing.-- Read `steps[].ok` and `failed_step`. Steps before a failure did run and are not rolled back; steps after it did not. Observe before repairing, as for a single `unverifiable` action. When a step fails because another window of the app holds focus (a dialog opened mid-batch), the end read is of that window, even without `observe`; when a pixel step names a window with no screenshot yet, the end read includes its screenshot. A step refused because its app ignores background input (Electron, LibreOffice) says how to re-send it; set `foreground_fallback:true` on `run_actions` to retry such steps once in the foreground (the window is activated and the pointer may move).+- Read `steps[].ok` and `failed_step`. Steps before a failure did run and are not rolled back; steps after it did not. Observe before repairing, as for a single `unverifiable` action. When a step fails because another window of the app holds focus (a dialog opened mid-batch), the end read is of that window, even without `observe`; when a pixel step names a window with no screenshot yet, the end read includes its screenshot. A step refused because its app ignores background input (Electron, LibreOffice) says how to re-send it; set `foreground_fallback:true` on `run_steps` to retry such steps once in the foreground (the window is activated and the pointer may move).## Pixel coordinatesdiff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/authorization.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/authorization.rsindex 3ed93fa70f..d8c79dd0b2 100644--- a/libs/cua-driver/rust/crates/cua-driver-core/src/authorization.rs+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/authorization.rs@@ -892,7 +892,7 @@ pub fn advertised_risk_for(tool: &str) -> RiskAssessment {| "press_key"| "hotkey"| "set_value"- | "run_actions"+ | "run_steps"| "run_script"| "invoke_menu"| "launch_app"@@ -1130,6 +1130,7 @@ pub fn authorize_tool_call_with_context(args: &Value,context: &crate::session_authorization::EffectiveAuthorizationContext,) -> Result<RiskAssessment, crate::policy::AuthorizationError> {+ let tool = crate::tool::renamed_tool(tool).unwrap_or(tool);enforce_hard_invariants(tool, args)?;if context.is_expired() {return Err(crate::policy::AuthorizationError::Denied(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.rsindex 9420dc7558..8f31b63e1f 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@@ -1,4 +1,4 @@-//! `run_actions`: run an ordered list of existing action tools in one call.+//! `run_steps`: run an ordered list of existing action tools in one call.//!//! The tool owns no input logic. Every step is dispatched through the same//! [`ToolRegistry`] entry point a direct call uses, inside the batch's own@@ -25,7 +25,7 @@ pub mod locate;use locate::{Check, ElementSpec, Locator, Window, WindowSpec};/// Public name of the batch tool.-pub const RUN_ACTIONS_TOOL: &str = "run_actions";+pub const RUN_STEPS_TOOL: &str = "run_steps";/// Action tools a batch may run. Observation tools are deliberately absent:/// the batch has exactly one optional observation, at the end.@@ -141,11 +141,11 @@ const BATCH_WINDOW_KEYS: &[&str] = &["pid", "window_id", "app", "window"];/// How long a stale element target may take to be found again by its label.const REFIND_TIMEOUT: Duration = Duration::from_millis(1_500);-pub struct RunActionsTool {+pub struct RunStepsTool {registry: ReplayRegistrySlot,}-impl RunActionsTool {+impl RunStepsTool {pub fn new(registry: ReplayRegistrySlot) -> Self {Self { registry }}@@ -154,10 +154,10 @@ impl RunActionsTool {static DEF: OnceLock<ToolDef> = OnceLock::new();#[async_trait]-impl Tool for RunActionsTool {+impl Tool for RunStepsTool {fn def(&self) -> &ToolDef {DEF.get_or_init(|| ToolDef {- name: RUN_ACTIONS_TOOL.into(),+ name: RUN_STEPS_TOOL.into(),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 \@@ -167,7 +167,7 @@ impl Tool for RunActionsTool {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_actions itself are the default window of every step that names \+ `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 \@@ -189,7 +189,7 @@ impl Tool for RunActionsTool {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_actions is the default for its steps.\n\n\+ 2000). At most 64 steps; `delivery_mode` on run_steps is the default for its steps.\n\n\TARGET 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, \@@ -305,7 +305,7 @@ impl Tool for RunActionsTool {Some(registry) => registry,None => {return ToolResult::error(- "run_actions is not available: registry not initialised yet.",+ "run_steps is not available: registry not initialised yet.",)}};@@ -389,7 +389,7 @@ impl PlanError {None => String::new(),};ToolResult::error(format!(- "run_actions rejected before running anything: {location}{}",+ "run_steps rejected before running anything: {location}{}",self.message)).with_structured(json!({@@ -724,9 +724,9 @@ impl Plan {"steps": reports,});let header = match failed_step {- None => format!("run_actions: {total}/{total} steps ok"),+ None => format!("run_steps: {total}/{total} steps ok"),Some(index) => format!(- "run_actions: step {} of {total} failed; {} step(s) ran before it, {} not run",+ "run_steps: step {} of {total} failed; {} step(s) ran before it, {} not run",index + 1,index,total - executed@@ -1007,7 +1007,7 @@ async fn run_step(} else if wants_foreground {foreground_hint = Some(format!(" To run it, send the batch again from step {} with \"delivery_mode\":\"foreground\" \- on this step, or set \"foreground_fallback\":true on run_actions (the window is \+ on this step, or set \"foreground_fallback\":true on run_steps (the window is \activated and the pointer may move).",index + 1));@@ -1895,7 +1895,7 @@ fn prepare_args(args: &mut Value, session: Option<&str>) -> Result<(), String> {"session `{own}` differs from the batch's session `{batch}`; a batch runs in one session")),(Some(own), None) if own != "default" => Err(format!(- "session `{own}` differs from the batch's session; set `session` on run_actions itself"+ "session `{own}` differs from the batch's session; set `session` on run_steps itself")),(_, Some(batch)) => {object.insert("session".to_owned(), Value::String(batch.to_owned()));diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/flow_tests.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/flow_tests.rsindex c3f03a1d01..48154f582d 100644--- a/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/flow_tests.rs+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/flow_tests.rs@@ -1,4 +1,4 @@-//! `run_actions` v2 against a fake two-screen app: steps that name their+//! `run_steps` v2 against a fake two-screen app: steps that name their//! target, waits, checks and the end-of-batch summary.use std::sync::{Arc, Mutex};@@ -208,7 +208,7 @@ impl Harness {}async fn run(&self, args: Value) -> ToolResult {- self.registry.invoke(super::RUN_ACTIONS_TOOL, args).await+ self.registry.invoke(super::RUN_STEPS_TOOL, args).await}fn calls(&self, tool: &str) -> Vec<Value> {diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/locate.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/locate.rsindex 1bd48d1b62..361cbf5722 100644--- a/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/locate.rs+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/batch_tools/locate.rs@@ -1,6 +1,6 @@//! Find windows and elements by description, wait for them, and check them.//!-//! Used by `run_actions` steps that name their target (`role`, `name`, `app`,+//! Used by `run_steps` steps that name their target (`role`, `name`, `app`,//! `window`) instead of carrying a token from an earlier read, and by the//! per-step `wait_for` / `expect` checks. Every read goes through the same//! [`ToolRegistry`] entry point a direct call uses (`list_windows`,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.rsindex 508ea4bb39..c132a04d60 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@@ -1,4 +1,4 @@-//! One test per run_actions failure class seen in bench run v036: the call+//! One test per run_steps failure class seen in bench run v036: the call//! shapes models sent, and what the batch does with them now.use std::sync::{Arc, Mutex};@@ -55,7 +55,7 @@ async fn string_scalars_in_step_args_are_coerced_before_validation() {#[tokio::test]async fn batch_level_pid_and_window_id_are_the_default_window() {let harness = Harness::new();- // The v036 shape: pid/window_id once (as strings) on run_actions itself.+ // The v036 shape: pid/window_id once (as strings) on run_steps itself.let result = harness.run(json!({"pid": "37641",@@ -158,7 +158,7 @@ fn a_failed_batch_keeps_the_step_report_readable() {// (~4 100 characters); the client cut it to "1. click ok: ... AXCh",// hiding why step 2 failed.let report =- "run_actions: step 2 of 2 failed\n1. click ok\n2. click ERROR (action): why".to_owned();+ "run_steps: step 2 of 2 failed\n1. click ok\n2. click ERROR (action): why".to_owned();let mut content = vec![crate::protocol::Content::text(report.clone()),crate::protocol::Content::text("x".repeat(6_000)),@@ -197,7 +197,7 @@ async fn a_failed_batch_with_a_long_read_stays_within_the_budget() {#[tokio::test]async fn batch_level_delivery_mode_is_the_steps_default() {let harness = Harness::new();- // v037c: `delivery_mode` on run_actions itself was refused.+ // v037c: `delivery_mode` on run_steps itself was refused.let result = harness.run(json!({"pid": 7, "window_id": 3, "delivery_mode": "foreground", "steps": [@@ -527,7 +527,7 @@ async fn a_stale_element_token_is_found_again_by_its_role_and_label() {);let result = registry.invoke(- super::super::RUN_ACTIONS_TOOL,+ super::super::RUN_STEPS_TOOL,json!({"steps": [{"tool": "click", "args": {"pid": 42, "window_id": 7, "element_token": "s0000002c:14"}}]}),).await;@@ -551,7 +551,7 @@ async fn a_stale_token_is_not_retried_when_its_label_is_ambiguous_or_unknown() {for token in ["s0000002d:3", "s0000002d:4", "s0000002d:99", "s0000777f:3"] {let result = registry.invoke(- super::super::RUN_ACTIONS_TOOL,+ super::super::RUN_STEPS_TOOL,json!({"steps": [{"tool": "click", "args": {"pid": 42, "window_id": 7, "element_token": token}}]}),).await;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.rsindex 738750ac16..04df1222fa 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@@ -119,7 +119,7 @@ impl Harness {async fn run(&self, args: Value) -> ToolResult {self.registry- .invoke_with_context(super::RUN_ACTIONS_TOOL, args, context(None))+ .invoke_with_context(super::RUN_STEPS_TOOL, args, context(None)).await}}@@ -221,7 +221,7 @@ async fn validates_every_step_before_running_any() {let harness = Harness::new();let cases = [(- json!({"tool": "run_actions", "args": {}}),+ json!({"tool": "run_steps", "args": {}}),"cannot run in a batch",),(@@ -360,11 +360,11 @@ async fn every_step_runs_in_the_batch_session() {#[tokio::test]async fn each_step_is_held_to_the_capability_manifest() {let harness = Harness::new();- let manifest = "version: 2\nmode: bounded\nexpires_after: 1h\nidle_timeout: 30m\nallow:\n tools: [run_actions, click]\n";+ let manifest = "version: 2\nmode: bounded\nexpires_after: 1h\nidle_timeout: 30m\nallow:\n tools: [run_steps, click]\n";let result = harness.registry.invoke_with_context(- super::RUN_ACTIONS_TOOL,+ super::RUN_STEPS_TOOL,json!({"steps": [{"tool": "click", "args": {"pid": 42}},{"tool": "set_value", "args": {"pid": 42, "text": "secret"}},@@ -392,7 +392,7 @@ async fn the_batch_itself_needs_the_manifest_to_allow_it() {let result = harness.registry.invoke_with_context(- super::RUN_ACTIONS_TOOL,+ super::RUN_STEPS_TOOL,json!({"steps": [{"tool": "click", "args": {"pid": 42}}]}),context(Some(manifest)),)@@ -406,7 +406,7 @@ async fn the_batch_is_advertised_with_its_schema() {let harness = Harness::new();let def = harness.registry- .get_def(super::RUN_ACTIONS_TOOL)+ .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"]@@ -419,6 +419,63 @@ async fn the_batch_is_advertised_with_its_schema() {assert_eq!(listed, super::BATCHABLE_TOOLS);}+#[tokio::test]+async fn the_old_name_run_actions_still_runs_but_is_not_listed() {+ let harness = Harness::new();+ assert!(harness.registry.get_def("run_actions").is_none());+ assert!(!harness+ .registry+ .tool_names()+ .any(|name| name == "run_actions"));++ let result = harness+ .registry+ .invoke_with_context(+ "run_actions",+ json!({"steps": [{"tool": "click", "args": {"pid": 42, "window_id": 7}}]}),+ context(None),+ )+ .await;+ assert_ne!(result.is_error, Some(true), "{}", text(&result));+ assert_eq!(harness.hits("click"), 1);+ let crate::protocol::Content::Text { text: note, .. } = result.content.last().unwrap() else {+ panic!("last content block is not text");+ };+ assert!(+ note.contains("`run_actions` is deprecated") && note.contains("`run_steps`"),+ "{note}"+ );+ assert_eq!(note.lines().count(), 1);++ // The new name carries no note.+ let current = harness+ .run(json!({"steps": [{"tool": "click", "args": {"pid": 42, "window_id": 7}}]}))+ .await;+ assert!(!text(¤t).contains("deprecated"), "{}", text(¤t));+}++#[tokio::test]+async fn a_manifest_that_allows_run_actions_allows_run_steps() {+ let harness = Harness::new();+ let manifest = "version: 2\nmode: bounded\nexpires_after: 1h\nidle_timeout: 30m\nallow:\n tools: [run_actions, click]\n";+ let result = harness+ .registry+ .invoke_with_context(+ super::RUN_STEPS_TOOL,+ json!({"steps": [{"tool": "click", "args": {"pid": 42, "window_id": 7}}]}),+ context(Some(manifest)),+ )+ .await;+ // The batch itself is allowed: the refusal comes from its first step,+ // whose pid the manifest does not declare.+ let message = text(&result);+ assert_eq!(+ result.structured_content.unwrap()["failed_step"],+ 0,+ "{message}"+ );+}+#[tokio::test]async fn observe_true_reads_a_diff_and_since_null_reads_in_full() {let harness = Harness::new();diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/policy.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/policy.rsindex 5029d6503e..20a3bce2d9 100644--- a/libs/cua-driver/rust/crates/cua-driver-core/src/policy.rs+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/policy.rs@@ -133,7 +133,7 @@ impl PolicyEngine {fn canonical_tool_name(tool: &str) -> &str {match tool {"type_text_chars" => "type_text",- other => other,+ other => crate::tool::renamed_tool(other).unwrap_or(other),}}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.rsindex db0dc48738..ebb01588d1 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@@ -385,7 +385,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_actions({{steps:[{{tool,args}}],observe:true}})`, even for one step: it stops at the first failure and returns what changed, so no separate re-read.+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.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.rsindex a1ed8b1c36..d5b0f569ec 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@@ -128,7 +128,7 @@ impl Tool for RunScriptTool {description: "EXPERIMENTAL. Run a JavaScript program that drives apps through Cua \Driver, in ONE call: loops, conditions, reads and checks between actions, and \only the result comes back. Use it for a multi-step flow you can write down; \- use run_actions for a fixed list of steps.\n\n\+ use run_steps for a fixed list of steps.\n\n\The script is the body of an async function: use `await`, and `return` a JSON \value. It runs in a sandbox with no filesystem, network, process, timers or \environment; the only API is `cua`:\n\diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/script_tool/tests.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/script_tool/tests.rsindex 883173c533..bced2f9b81 100644--- a/libs/cua-driver/rust/crates/cua-driver-core/src/script_tool/tests.rs+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/script_tool/tests.rs@@ -255,6 +255,10 @@ async fn only_driver_tools_on_the_allowlist_are_reachable() {"await cua.call('kill_app', {pid: 42})","not available to scripts",),+ (+ "await cua.call('run_steps', {steps: []})",+ "not available to scripts",+ ),("await cua.call('run_actions', {steps: []})","not available to scripts",@@ -456,7 +460,7 @@ fn an_unflagged_registry_does_not_offer_the_tool() {assert!(registry.get_def(super::RUN_SCRIPT_TOOL).is_none());}assert!(registry- .get_def(crate::batch_tools::RUN_ACTIONS_TOOL)+ .get_def(crate::batch_tools::RUN_STEPS_TOOL).is_some());}diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/server.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/server.rsindex 2f2402f5b2..10bd108af5 100644--- a/libs/cua-driver/rust/crates/cua-driver-core/src/server.rs+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/server.rs@@ -364,7 +364,7 @@ pub fn tool_operation(tool_name: &str, args: Option<&serde_json::Value>) -> Toolargs.and_then(|value| value.get(key)).and_then(serde_json::Value::as_str)};- match tool_name {+ match crate::tool::renamed_tool(tool_name).unwrap_or(tool_name) {"page" => match string_arg("action") {Some("execute_javascript") => ToolOperation::ExecuteJavascript,Some("get_text") => ToolOperation::GetText,@@ -612,7 +612,9 @@ pub fn session_tool_context(return None;}let call = req.tool_call().ok()?;- let known_tool = call.name == "type_text_chars" || is_known_tool(&call.name);+ let known_tool = call.name == "type_text_chars"+ || crate::tool::renamed_tool(&call.name).is_some()+ || is_known_tool(&call.name);let client_kind = match transport {crate::session::SessionTransport::Cli => crate::session::SessionClientKind::Cli,crate::session::SessionTransport::Daemon => crate::session::SessionClientKind::Direct,diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/session_manifest.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/session_manifest.rsindex 6b399a2db1..f51440058d 100644--- a/libs/cua-driver/rust/crates/cua-driver-core/src/session_manifest.rs+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/session_manifest.rs@@ -985,7 +985,7 @@ pub fn load_manifest(path: &Path) -> Result<SessionManifest, String> {"press_key","hotkey","set_value",- "run_actions",+ "run_steps","run_script","mouse_button_down","mouse_button_up",@@ -1067,7 +1067,7 @@ fn validate_tools(section: &str, tools: Vec<String>) -> Result<HashSet<String>,fn canonical_tool_name(tool: &str) -> &str {match tool {"type_text_chars" => "type_text",- other => other,+ other => crate::tool::renamed_tool(other).unwrap_or(other),}}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.rsindex 7a6f179f9f..37ac515d5e 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@@ -214,7 +214,7 @@ fn unknown_argument(def: &ToolDef, args: &Value) -> Option<String> {if unknown.is_empty() {return None;}- // A direct action named by role/name: that targeting lives in run_actions.+ // A direct action named by role/name: that targeting lives in run_steps.const NAME_TARGET: &[&str] = &["role", "name", "label", "app", "window", "nth"];let name_targeted = crate::batch_tools::BATCHABLE_TOOLS.contains(&def.name.as_str())&& unknown.iter().all(|name| NAME_TARGET.contains(name));@@ -234,8 +234,8 @@ fn unknown_argument(def: &ToolDef, args: &Value) -> Option<String> {};let hint = if name_targeted {format!(- ". To target by role/name/app/window, send the same arguments as one run_actions \- step: run_actions {{\"steps\":[{{\"{}\": {{...}}}}]}}",+ ". To target by role/name/app/window, send the same arguments as one run_steps \+ step: run_steps {{\"steps\":[{{\"{}\": {{...}}}}]}}",def.name)} else {@@ -249,7 +249,7 @@ fn unknown_argument(def: &ToolDef, args: &Value) -> Option<String> {}/// Rewrite argument spellings models guess into the advertised ones, before-/// the closed schema is checked. Shared by dispatch and `run_actions` step+/// the closed schema is checked. Shared by dispatch and `run_steps` step/// 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> {@@ -503,7 +503,7 @@ fn normalize_scroll_args(tool_name: &str, args: &mut Value) -> Result<(), String(true, true) => {return Err(format!("scroll moves along one axis per call, got dx={dx} and dy={dy}. Pass only dx or \- dy (or direction and amount), or use two scroll steps in run_actions."+ dy (or direction and amount), or use two scroll steps in run_steps."))}(false, false) => {@@ -607,6 +607,24 @@ pub(crate) fn advertised_runtime_input_schema(tool_name: &str, schema: &Value) -schema}+/// Tools renamed before 0.35.0, as (old name, new name). The old name still+/// dispatches to the new tool, but it is not registered, so tools/list shows+/// only the new name, and its result ends with a one-line deprecation note.+/// To be removed in a future release.+pub const RENAMED_TOOLS: &[(&str, &str)] = &[("run_actions", crate::batch_tools::RUN_STEPS_TOOL)];++/// 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+ .iter()+ .find(|(old, _)| *old == name)+ .map(|(_, new)| *new)+}++fn deprecated_name_note(old: &str, new: &str) -> String {+ format!("Note: `{old}` is deprecated and will be removed in a future release; call `{new}` instead.")+}+/// Centralised tool name → capability tokens map. Lookup is by name so/// platform-specific tool modules don't have to declare their own/// capabilities — keeps the additive-only contract tight and avoids@@ -770,7 +788,7 @@ pub fn default_capabilities_for(tool_name: &str) -> Vec<String> {"stop_recording" => &["recording.stop"],"get_recording_state" => &["recording.state"],"replay_trajectory" => &["recording.replay"],- "run_actions" => &["input.batch"],+ "run_steps" => &["input.batch"],"run_script" => &["input.script"],"install_ffmpeg" => &["recording.install_dependency"],"install_extension" => &["extension.install"],@@ -1304,12 +1322,12 @@ impl ToolRegistry {self.register_batch_tools();}- /// Register `run_actions`, which re-enters this registry for every step.+ /// Register `run_steps`, which re-enters this registry for every step./// Called from [`Self::register_session_tools`] so every platform that/// registers sessions gets it; [`Self::init_self_weak`] supplies the/// registry handle, as for `replay_trajectory`.fn register_batch_tools(&mut self) {- self.register(Box::new(crate::batch_tools::RunActionsTool::new(+ self.register(Box::new(crate::batch_tools::RunStepsTool::new(self.replay_registry.clone(),)));// Experimental and opt-in: only when the operator turned it on.@@ -1320,7 +1338,7 @@ impl ToolRegistry {}/// Register the experimental `run_script` tool, which, like- /// `run_actions`, re-enters this registry for every driver call.+ /// `run_steps`, re-enters this registry for every driver call.#[cfg(feature = "script")]pub fn register_script_tool(&mut self) {self.register(Box::new(crate::script_tool::RunScriptTool::new(@@ -1619,6 +1637,7 @@ impl ToolRegistry {// fields carry registry-internal attestations and must not be// caller-forgeable here.crate::tool_args::sanitize_reserved_args(&mut args);+ let original_name = name;if crate::session::is_runtime_scope_suspended(&context.runtime_scope_key()) {return protected_refusal(@@ -1643,7 +1662,7 @@ impl ToolRegistry {eprintln!("[cua-driver-rs] deprecated tool name 'type_text_chars' — use 'type_text' instead.");"type_text"}- other => other,+ other => renamed_tool(other).unwrap_or(other),};let Some(tool) = self.tools.get(resolved_name) else {@@ -2127,7 +2146,7 @@ impl ToolRegistry {| "stop_recording"| "get_recording_state"| "replay_trajectory"- | "run_actions"+ | "run_steps"| "run_script"| "start_session"| "end_session"@@ -2351,6 +2370,13 @@ impl ToolRegistry {}}+ if renamed_tool(original_name).is_some() {+ result.content.push(Content::text(deprecated_name_note(+ original_name,+ resolved_name,+ )));+ }+result}@@ -6931,7 +6957,7 @@ mod argument_shape_tests {}#[test]- fn a_direct_action_named_by_role_points_to_run_actions() {+ fn a_direct_action_named_by_role_points_to_run_steps() {let click = ToolDef {name: "click".into(),description: String::new(),@@ -6943,9 +6969,9 @@ mod argument_shape_tests {};let detail =unknown_argument(&click, &json!({"pid": 1, "role": "button", "name": "OK"})).unwrap();- assert!(detail.contains("one run_actions step"), "{detail}");+ assert!(detail.contains("one run_steps step"), "{detail}");let other = unknown_argument(&click, &json!({"pid": 1, "bogus": 1})).unwrap();- assert!(!other.contains("run_actions"), "{other}");+ assert!(!other.contains("run_steps"), "{other}");}#[test]diff --git a/libs/cua-driver/rust/crates/cua-driver-testkit/src/boundary_fuzz.rs b/libs/cua-driver/rust/crates/cua-driver-testkit/src/boundary_fuzz.rsindex edc2d9443e..49c474c1dd 100644--- a/libs/cua-driver/rust/crates/cua-driver-testkit/src/boundary_fuzz.rs+++ b/libs/cua-driver/rust/crates/cua-driver-testkit/src/boundary_fuzz.rs@@ -600,7 +600,9 @@ pub fn registry_invoke(data: &[u8]) {let tool = arbitrary_tool_name(&mut u);let args = arbitrary_arguments(&mut u);let registry = stub_registry();- let known = registry.get_def(&tool).is_some() || tool == "type_text_chars";+ let known = registry.get_def(&tool).is_some()+ || tool == "type_text_chars"+ || cua_driver_core::tool::renamed_tool(&tool).is_some();let result =runtime().block_on(registry.invoke_with_context(&tool, args, unrestricted_context()));diff --git a/libs/cua-driver/rust/crates/cua-driver/src/proxy.rs b/libs/cua-driver/rust/crates/cua-driver/src/proxy.rsindex 401a09b0b9..810bf385e5 100644--- a/libs/cua-driver/rust/crates/cua-driver/src/proxy.rs+++ b/libs/cua-driver/rust/crates/cua-driver/src/proxy.rs@@ -426,7 +426,7 @@ where}fn proxy_knows_tool(cached_tools_list: &serde_json::Value, name: &str) -> bool {- if name == "type_text_chars" {+ if name == "type_text_chars" || cua_driver_core::tool::renamed_tool(name).is_some() {return true;}cached_tools_list@@ -780,13 +780,14 @@ fn proxy_output_schema<'a>(.iter().find(|tool| tool.get("name").and_then(serde_json::Value::as_str) == Some(name)).or_else(|| {- (name == "type_text_chars")- .then(|| {- tools.iter().find(|tool| {- tool.get("name").and_then(serde_json::Value::as_str) == Some("type_text")- })- })- .flatten()+ let current = if name == "type_text_chars" {+ Some("type_text")+ } else {+ cua_driver_core::tool::renamed_tool(name)+ }?;+ tools+ .iter()+ .find(|tool| tool.get("name").and_then(serde_json::Value::as_str) == Some(current))})?.get("outputSchema")}diff --git a/libs/cua-driver/rust/crates/cua-driver/src/sdk_adapter.rs b/libs/cua-driver/rust/crates/cua-driver/src/sdk_adapter.rsindex e5f36053c8..9fe048bb35 100644--- a/libs/cua-driver/rust/crates/cua-driver/src/sdk_adapter.rs+++ b/libs/cua-driver/rust/crates/cua-driver/src/sdk_adapter.rs@@ -153,6 +153,7 @@ impl SdkAdapter {pub fn is_known_tool(&self, name: &str) -> bool {name == "type_text_chars"+ || cua_driver_core::tool::renamed_tool(name).is_some()|| self.tools_list.get("tools")diff --git a/libs/cua-driver/rust/crates/cua-driver/src/telemetry.rs b/libs/cua-driver/rust/crates/cua-driver/src/telemetry.rsindex 8c48b9ef76..0d1ed600c6 100644--- a/libs/cua-driver/rust/crates/cua-driver/src/telemetry.rs+++ b/libs/cua-driver/rust/crates/cua-driver/src/telemetry.rs@@ -1992,6 +1992,7 @@ fn fixed_tool_name(tool_name: &str) -> String {if tool_name == "type_text_chars" {return "type_text".into();}+ let tool_name = cua_driver_core::tool::renamed_tool(tool_name).unwrap_or(tool_name);if cua_driver_core::tool::default_capabilities_for(tool_name).is_empty() {"other".into()} else {diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/protocol_handshake_test.rs b/libs/cua-driver/rust/crates/cua-driver/tests/protocol_handshake_test.rsindex f18b9a50d7..cd108c25ab 100644--- a/libs/cua-driver/rust/crates/cua-driver/tests/protocol_handshake_test.rs+++ b/libs/cua-driver/rust/crates/cua-driver/tests/protocol_handshake_test.rs@@ -60,7 +60,7 @@ fn all_expected_tools_registered() {"stop_recording","get_recording_state","replay_trajectory",- "run_actions",+ "run_steps","page",];for name in expected {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.rsindex 8d37775678..748d657d17 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@@ -191,7 +191,7 @@ fn tools_list_schema_shape() {"browser_click","browser_pointer",// The batch's default for its steps' own delivery_mode.- "run_actions",+ "run_steps",// macOS set_value has no delivery ladder.#[cfg(any(target_os = "linux", target_os = "windows"))]"set_value",diff --git a/scripts/ci/cua-driver-live-smoke/smoke.py b/scripts/ci/cua-driver-live-smoke/smoke.pyindex 9a2ebfa099..bd221d857d 100644--- a/scripts/ci/cua-driver-live-smoke/smoke.py+++ b/scripts/ci/cua-driver-live-smoke/smoke.py@@ -7,7 +7,7 @@ fixture window (GTK3 on Linux, WinForms on Windows) and checks:* get_window_state's default (lean) output and `full_output: true`,* the act-by-element_token loop (snapshot, click a token, fresh snapshot),* `since` (a diff against an earlier snapshot, and `no change`),- * run_actions (one batch with an end-of-batch observation),+ * run_steps (one batch with an end-of-batch observation),* set_value on a drop-down combo box and on an editable combo box,* display_only previews (and plain screenshot-only reads) keep the agent'selement tokens valid.@@ -352,7 +352,7 @@ def run_checks(smoke):f"full read {after.size}; repeat read: no_change",)- # 5. run_actions: set a field, click Apply, click Increment, observe once.+ # 5. run_steps: set a field, click Apply, click Increment, observe once.state = smoke.read()md = tree(state)targets = {@@ -361,7 +361,7 @@ def run_checks(smoke):"increment": find_row(md, BUTTON, "Increment"),}if None in targets.values():- smoke.record("run_actions batch", "fail", f"fixture rows not found: {targets}")+ smoke.record("run_steps batch", "fail", f"fixture rows not found: {targets}")else:batch_args = {"steps": [@@ -371,7 +371,7 @@ def run_checks(smoke):],"observe": {"pid": smoke.pid, "window_id": smoke.window_id},}- batch = smoke.call("run_actions", batch_args)+ batch = smoke.call("run_steps", batch_args)b = batch.structuredobserved = ((b.get("observation") or {}).get("state") or {}).get("tree_markdown") or ""problems = []@@ -388,7 +388,7 @@ def run_checks(smoke):if missing:problems.append(f"neither the observation nor a fresh read shows {missing}")smoke.record(- "run_actions batch (set_value + 2 clicks + observe)",+ "run_steps batch (set_value + 2 clicks + observe)","fail" if problems else "pass","; ".join(problems)or "3/3 steps ok; "@@ -408,9 +408,12 @@ def run_checks(smoke):display_only_check(smoke)# 7b. Lean-read ergonomics from the v035 bench: since:"latest", a bare row- # number as element_token, run_actions observe:true, zoom x/y/width/height.+ # number as element_token, run_steps observe:true, zoom x/y/width/height.lean_read_ergonomics_check(smoke)+ # 7c. The pre-0.35 name run_actions still runs, unlisted, with a note.+ renamed_tool_alias_check(smoke)+# 8. The drop-down combo with delivery_mode foreground (last because a# broken route may leave a popup open), then a click by token must still# land, which it does not while a popup holds the pointer grab.@@ -553,7 +556,7 @@ def display_only_check(smoke):def lean_read_ergonomics_check(smoke):- check = "since:latest, bare row token, run_actions observe:true, zoom x/y/width/height, scroll dy"+ check = "since:latest, bare row token, run_steps observe:true, zoom x/y/width/height, scroll dy"problems = []smoke.read()latest = smoke.read(since="latest")@@ -572,7 +575,7 @@ def lean_read_ergonomics_check(smoke):problems.append(f"bare row click ok but the count did not move from {before}")increment = find_row(tree(after), BUTTON, "Increment")- batch = smoke.call("run_actions", {+ batch = smoke.call("run_steps", {"steps": [{"tool": "click", "args": {"pid": smoke.pid, "window_id": smoke.window_id,"element_token": token(after, increment)}}],"observe": True,@@ -580,7 +583,7 @@ def lean_read_ergonomics_check(smoke):observed = ((batch.structured.get("observation") or {}).get("state") or {})if batch.is_error or observed.get("since_status") not in ("diff", "no_change"):problems.append(- f"run_actions observe:true -> is_error={batch.is_error}, "+ f"run_steps observe:true -> is_error={batch.is_error}, "f"since_status={observed.get('since_status')!r}: {batch.first_line()}")@@ -605,6 +608,34 @@ def lean_read_ergonomics_check(smoke):)+def renamed_tool_alias_check(smoke):+ """run_actions was renamed run_steps: only run_steps is listed, and a+ call to the old name still runs and ends with a deprecation note."""+ check = "run_actions alias: unlisted, runs, deprecation note"+ problems = []+ listed = smoke.mcp.request("tools/list", {})+ names = {t.get("name") for t in (listed.get("result") or {}).get("tools") or []}+ if "run_steps" not in names:+ problems.append("tools/list lacks run_steps")+ if "run_actions" in names:+ problems.append("tools/list still lists run_actions")++ state = smoke.read()+ increment = find_row(tree(state), BUTTON, "Increment")+ if increment is None:+ problems.append("fixture Increment row not found")+ else:+ old = smoke.call("run_actions", {+ "steps": [{"tool": "click", "args": {"pid": smoke.pid, "window_id": smoke.window_id,+ "element_token": token(state, increment)}}],+ })+ if old.is_error:+ problems.append(f"run_actions -> {old.first_line()}")+ if "`run_actions` is deprecated" not in old.text or "`run_steps`" not in old.text:+ problems.append(f"no deprecation note in the run_actions result: {old.text[-300:]!r}")+ smoke.record(check, "fail" if problems else "pass", "; ".join(problems) or "listed: run_steps only; run_actions ran with the note")++def unknown_option_check(smoke):"""set_value with an option the drop-down does not have is refused andchanges nothing."""diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.jsonindex c66ec35fed..a92093849d 100644--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json@@ -3475,7 +3475,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_actions 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_actions 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: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}","destructive": true,"idempotent": false,"input_schema": {@@ -3609,7 +3609,7 @@],"type": "object"},- "name": "run_actions",+ "name": "run_steps","read_only": false},{diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.jsonindex 107f1f0950..c4c64913b2 100644--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json@@ -3111,7 +3111,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_actions 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_actions 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: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}","destructive": true,"idempotent": false,"input_schema": {@@ -3245,7 +3245,7 @@],"type": "object"},- "name": "run_actions",+ "name": "run_steps","read_only": false},{diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.jsonindex d46509ecd3..2e0beb5b7a 100644--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json@@ -3167,7 +3167,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_actions 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_actions 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: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}","destructive": true,"idempotent": false,"input_schema": {@@ -3301,7 +3301,7 @@],"type": "object"},- "name": "run_actions",+ "name": "run_steps","read_only": false},{diff --git a/scripts/docs-generators/cua-driver.ts b/scripts/docs-generators/cua-driver.tsindex 6b4965ec39..445762ca68 100644--- a/scripts/docs-generators/cua-driver.ts+++ b/scripts/docs-generators/cua-driver.ts@@ -300,7 +300,7 @@ export const MCP_CATEGORIES: Array<McpCategory & { tools: string[] }> = [slug: 'batch',title: 'Batch tool',summary: 'Run several action tools in one call',- tools: ['run_actions'],+ tools: ['run_steps'],},{slug: 'page',