Skip to content

docs(cua-driver): wire reference auto-generation to the real docs dir + release - #2088

Merged
f-trycua merged 3 commits into
mainfrom
docs/cua-driver-reference-autogen
Jul 1, 2026
Merged

docs(cua-driver): wire reference auto-generation to the real docs dir + release#2088
f-trycua merged 3 commits into
mainfrom
docs/cua-driver-reference-autogen

Conversation

@f-trycua

@f-trycua f-trycua commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

The cua-driver reference generator was enabled: false and pointed at docs/content/docs/cua-driver/reference (which does not exist), while the committed docs live at docs/content/docs/reference/cua-driver. So the runner/CI silently skipped it and falsely reported "up to date", and the reference drifted from the binary: committed said v0.5.7 / 36 tools, the shipping binary is v0.7.0 / 38 tools (missing get_desktop_state and health_report). This PR makes the generator the real, working owner of cli-reference.mdx + mcp-tools.mdx, preserves the hand-authored content, and wires release-time regeneration.

What was repointed

  • cua-driver.ts DOCS_OUTPUT_DIR and config.json docsOutputPathdocs/content/docs/reference/cua-driver (the one canonical location). No duplicate docs/content/docs/cua-driver/reference tree is created.

Generator fixes for the current (Diátaxis) docs

Running the generator as-is would have broken the docs build: it emitted import { VersionHeader } from '@/components/version-selector' (that component no longer exists — no doc uses it) and /cua-driver/reference/… + /cua-driver/guide/… links that don't resolve.

  • Dropped the dead VersionHeader block + discoverVersions/VersionInfo machinery.
  • CLI intro now matches the repo convention: install snippet + "Documented against {version}" line.
  • Fixed cross-links to /reference/cua-driver/… and /explanation/process-model / /explanation/the-no-foreground-contract.
  • Backtick-styled command/tool headings to match the existing reference style.

Curated content split out (nothing lost)

The per-tool bodies come from the binary's own dump-docs descriptions (rich and current). The genuinely cross-cutting hand-authored content — not derivable from any single tool schema — was extracted into two non-generated siblings:

  • mcp-tool-notes.mdx ← "Common parameters", "Required parameters", "Platform-specific parameters", "Action response shape", plus the get_window_state degraded-result note and the page platform-support note (trycua/cua#2084).
  • macos-permissions.mdx ← the macOS-only cua-driver permissions command (absent from dump-docs, so the generator can't emit it).

meta.json links both; the generated files link back to them. contracts.mdx, limits.mdx, modality-test-suite.mdx are untouched. Verified every curated phrase still resolves in the docs dir.

Config / CI / script / workflow

  • config.json: enabled: false → true; refreshed the stale note.
  • ci-check-docs.yml: fixed the path filter and changed-generator grep (docs/content/docs/cua-driver/referencedocs/content/docs/reference/cua-driver) so the drift check actually runs for cua-driver instead of no-op passing.
  • docs/package.json: added docs:generate:cua-driver (mirrors docs:generate:lume).
  • New cd-cua-driver-docs.yml: on a cua-driver-rs-v* tag (or manual dispatch), rebuild + regenerate + open a PR with the refreshed MDX. No release workflow (lume included) previously regenerated docs, so this is a minimal tag-triggered workflow scoped to cua-driver, using the same App-token identity as the existing release automation.

Regen result

  • Categorized the five newer tools (get_desktop_state, health_report, install_ffmpeg, start_session, end_session) instead of dumping them in "Other tools".
  • Regenerated to v0.7.0 / 38 tools; get_desktop_state and health_report now present.
  • npx tsx scripts/docs-generators/runner.ts --library cua-driver --check now actually checks (builds, 38 tools) and reports up-to-date — no longer "Skipped (disabled)".
  • Docs internal link check passes (0 errors).

Known follow-up (intentionally out of scope)

CLI docs still come from the hand-maintained cli_docs_json() literal in libs/cua-driver/rust/crates/cua-driver/src/cli.rs. The CLI is hand-parsed (not clap), so there's nothing to introspect yet; adopting clap or reflecting the parser to make CLI docs source-derived (like the MCP side already is) is a separate change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

Summary by CodeRabbit

  • New Features

    • Expanded the Cua Driver docs with refreshed CLI and MCP tool reference content.
    • Added new documentation for macOS permissions and MCP tool notes.
  • Documentation

    • Updated install guidance and platform-specific setup instructions in the first-run tutorial.
    • Regenerated reference pages to match the latest Cua Driver release and command behavior.
  • Bug Fixes

    • Corrected documentation paths so generated reference content is picked up by CI and published consistently.

f-trycua and others added 2 commits June 30, 2026 23:42
…rst-app tutorial

The tutorial told users to start the daemon by hand (`cua-driver serve`, or on
macOS `open -n -g -a CuaDriver --args serve`) in each install tab. That's not
needed: the CLI (`doctor`/`call`) and the agent's MCP connection start the daemon
automatically. Removed the daemon-start blocks from the macOS/Windows/Linux tabs;
macOS keeps `permissions grant` (which launches CuaDriver itself for the TCC
prompts). Section 2's verify step is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BJPGdRQxiBPTQhjwZsQ8G
… + release

The cua-driver reference generator was disabled and pointed at a docs
directory that does not exist, so CI silently skipped it and the committed
reference drifted (v0.5.7, 36 tools) from the shipping binary (v0.7.0, 38
tools). This repoints and re-enables it, splits the hand-authored content
out of the generator-owned files, and wires a release-time regen.

- Repoint output to the real dir: cua-driver.ts DOCS_OUTPUT_DIR and
  config.json docsOutputPath now target docs/content/docs/reference/cua-driver.
  No duplicate docs/content/docs/cua-driver/reference tree is created.
- Fix the generator for the current Diataxis docs: drop the dead
  <VersionHeader>/@/components/version-selector import (the component no
  longer exists) and the /cua-driver/reference + /cua-driver/guide links;
  emit the repo's install-snippet + "Documented against X" intro and
  /reference/cua-driver + /explanation links instead.
- Preserve curated content the generator does not own by extracting it into
  two non-generated siblings:
    mcp-tool-notes.mdx  <- Common/Required/Platform-specific parameters and
                           the action response shape, plus get_window_state
                           degraded + page platform per-tool notes.
    macos-permissions.mdx <- the macOS-only `cua-driver permissions` command.
  meta.json links both; the generated files link back to them.
- Categorize the five newer tools (get_desktop_state, health_report,
  install_ffmpeg, start_session, end_session) instead of dumping them in
  "Other tools".
- Enable the generator in config.json; fix ci-check-docs.yml path filter
  (docs/content/docs/cua-driver/reference -> docs/content/docs/reference/
  cua-driver) so it stops falsely passing; add docs:generate:cua-driver.
- Add cd-cua-driver-docs.yml: on a cua-driver-rs-v* tag, rebuild, regenerate,
  and open a PR with the refreshed MDX.
- Regenerate to v0.7.0 / 38 tools.

CLI docs still come from the hand-maintained cli_docs_json() literal in
crates/cua-driver/src/cli.rs (the CLI is hand-parsed, not clap); introspecting
it is a tracked follow-up, intentionally out of scope here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Error Error Jul 1, 2026 2:51pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3a7d9254-1b56-40ca-a6a7-fe81b526692a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a CD workflow that regenerates auto-generated cua-driver reference docs on version-tag pushes, updates CI path filters, enables and repoints the cua-driver docs generator's output path, adjusts generator logic (removing version-header generation, adding code-formatted headings), and regenerates CLI/MCP reference MDX plus two new hand-maintained pages and minor tutorial edits.

Changes

Cua Driver docs generation pipeline and reference docs

Layer / File(s) Summary
CD workflow and generator config/output wiring
.github/workflows/cd-cua-driver-docs.yml, .github/workflows/ci-check-docs.yml, scripts/docs-generators/config.json, docs/package.json
New CD workflow regenerates docs on tag push and opens a PR; CI path filters and generator config point to the new docs/content/docs/reference/cua-driver location and enable the generator; a new pnpm script runs it.
Docs generator script logic
scripts/docs-generators/cua-driver.ts
Output directory updated, VersionInfo/discoverVersions removed, CLI intro rewritten, command/tool headings wrapped in inline code, and MCP tool category lists/links updated.
Regenerated CLI reference docs
docs/content/docs/reference/cua-driver/cli-reference.mdx
CLI reference regenerated for v0.7.0 with reformatted command, argument, and options tables across dispatch, recording, configuration, diagnostics, skills, and global options.
Regenerated MCP tools reference docs
docs/content/docs/reference/cua-driver/mcp-tools.mdx
MCP tools doc regenerated for 38 tools with expanded inspection, action, browser, recording, configuration/session/cursor, and maintenance tool contracts.
New macOS permissions and MCP tool notes pages
docs/content/docs/reference/cua-driver/macos-permissions.mdx, .../mcp-tool-notes.mdx, .../meta.json
New pages document the permissions CLI command and cross-cutting MCP parameter/response contracts; meta.json lists the new page.
Tutorial install instructions update
docs/content/docs/tutorials/drive-your-first-app.mdx
macOS/Windows/Linux daemon-start instructions simplified.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

Possibly related PRs

  • trycua/cua#1418: Modifies the same scripts/docs-generators/cua-driver.ts generator that this PR further updates.
  • trycua/cua#1738: Touches the same cua-driver.ts, config.json, and ci-check-docs.yml generator/CI logic.
  • trycua/cua#1627: Modifies the same mcp-tools.mdx reference content this PR regenerates.

Poem

A rabbit hops through docs anew,
Regenerating pages, tables too. 🐇
Permissions granted, tools laid bare,
CLI and MCP, everywhere!
Hop, commit, and push with glee—
Fresh docs bloom for all to see. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the core change: repointing cua-driver reference docs generation to the real docs directory and adding release-time automation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/cua-driver-reference-autogen

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
docs/content/docs/tutorials/drive-your-first-app.mdx (2)

67-67: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Rephrase "only CLI you run by hand" for macOS readers.

macOS users have already run cua-driver permissions grant by hand in the install step, so the claim that doctor and list_apps are "the only CLI you run by hand" is inaccurate for them. Consider qualifying the statement, e.g., "That is the last CLI you need to run by hand" or "From here the agent does the driving."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/docs/tutorials/drive-your-first-app.mdx` at line 67, The wording
in the tutorial is too absolute for macOS users, since they already ran the
permissions grant command by hand during setup. Update the sentence in the
introductory flow around the app-check/doctor guidance to avoid saying it is the
only CLI run manually; use phrasing like “the last CLI you need to run by hand”
or simply “from here the agent does the driving,” so the copy stays accurate for
the `doctor` and `list_apps` section.

25-29: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update downstream claim about "only CLI you run by hand."

Adding cua-driver permissions grant to the macOS install step means macOS users have now run a CLI command by hand before reaching the verification section. The unchanged line 67 ("That is the only CLI you run by hand") becomes inaccurate for macOS readers. Consider rephrasing that claim to account for the permissions command, e.g., "That is the last CLI you need to run by hand."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/docs/tutorials/drive-your-first-app.mdx` around lines 25 - 29,
The install walkthrough now includes the cua-driver permissions grant command,
so the later claim in drive-your-first-app.mdx that it is “the only CLI you run
by hand” is no longer accurate for macOS readers. Update that downstream
sentence to reflect that the permissions command is also run manually, and
rephrase it in a way that matches the tutorial flow; use the surrounding
verification section text and the cua-driver permissions grant step to locate
the affected wording.
.github/workflows/ci-check-docs.yml (1)

61-116: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

config.json changes can still bypass the drift check.

This PR proves scripts/docs-generators/config.json is not metadata-only: it now changes both the cua-driver output path and whether that generator runs at all. But this step still ignores config-only edits unless a generator script also changed, so future wiring changes can merge without ever exercising the relevant generator.

Suggested fix
-          # Only runner.ts changes trigger all generators (it's the orchestration layer)
-          # config.json changes only affect whichever generator scripts were also changed
-          if echo "$CHANGED_FILES" | grep -qE "^scripts/docs-generators/runner\.ts$"; then
+          # runner.ts and config.json both affect generator selection/output wiring
+          if echo "$CHANGED_FILES" | grep -qE "^scripts/docs-generators/(runner\.ts|config\.json)$"; then
             GENERATORS="all"
           fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-check-docs.yml around lines 61 - 116, The
changed-generator detection in the “Determine changed generators” step still
ignores scripts/docs-generators/config.json when no generator script changed,
which can let generator wiring changes skip validation. Update the CHANGED_FILES
matching logic so config.json edits are treated as triggering the affected
generator(s) in the same way as source changes, using the existing GENERATORS
aggregation and dedup flow. Make sure the detection rules in this step stay
aligned with the config-driven behavior used by
scripts/docs-generators/runner.ts and the per-generator scripts like
cua-driver.ts.
🧹 Nitpick comments (1)
.github/workflows/cd-cua-driver-docs.yml (1)

55-63: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Scope the GitHub App token to the permissions this job actually uses.

This token currently inherits whatever repo permissions the App installation has. The rest of the job only needs contents: write and pull-requests: write, so minting a narrower token would reduce blast radius if GH_TOKEN ever leaks.

Suggested fix
       - name: Generate GitHub App token
         id: app-token
         uses: actions/create-github-app-token@v1
         with:
           app-id: ${{ secrets.RELEASE_APP_ID }}
           private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
           owner: ${{ github.repository_owner }}
           repositories: ${{ github.event.repository.name }}
+          permission-contents: write
+          permission-pull-requests: write
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/cd-cua-driver-docs.yml around lines 55 - 63, The GitHub
App token created in the app-token step is broader than this job needs, so
narrow it to only the permissions used by the workflow. Update the token minting
in the actions/create-github-app-token@v1 step so the resulting GH_TOKEN is
scoped to contents: write and pull-requests: write only, using the existing
app-token/app-id/private-key setup. Keep the rest of the job unchanged and
ensure the new scope still works with the doc publishing and PR update steps.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/cd-cua-driver-docs.yml:
- Around line 28-31: The Checkout repository step in the workflow leaves the
default token persisted in git config, which can expose write-capable
credentials to later commands like pnpm install and cargo build. Update the
actions/checkout@v4 configuration in the checkout step to disable persisted
credentials, using the existing Checkout repository action block as the
reference, and keep the later App token re-authentication flow for pushes
unchanged.

In `@docs/content/docs/reference/cua-driver/mcp-tools.mdx`:
- Around line 538-556: The `replay_trajectory` docs contain an incorrect
parameter description for `dir` that references a non-existent tool name. Update
the source string in the Rust `replay_trajectory` tool definition, specifically
the `dir` argument description, so it uses `start_recording` and matches the
surrounding documentation text. Ensure the generated MDX picks up the corrected
wording on the next regen.

In `@scripts/docs-generators/cua-driver.ts`:
- Around line 278-295: Exclude the macOS-only permissions command from the
generated CLI reference so it no longer appears under “Other commands.” Update
the CLI docs generation flow in scripts/docs-generators/cua-driver.ts,
specifically around generateCLIReferenceMDX() and the dump-docs input, to filter
out `permissions` before rendering. Keep the separate macOS permissions page as
the only source for that command.

---

Outside diff comments:
In @.github/workflows/ci-check-docs.yml:
- Around line 61-116: The changed-generator detection in the “Determine changed
generators” step still ignores scripts/docs-generators/config.json when no
generator script changed, which can let generator wiring changes skip
validation. Update the CHANGED_FILES matching logic so config.json edits are
treated as triggering the affected generator(s) in the same way as source
changes, using the existing GENERATORS aggregation and dedup flow. Make sure the
detection rules in this step stay aligned with the config-driven behavior used
by scripts/docs-generators/runner.ts and the per-generator scripts like
cua-driver.ts.

In `@docs/content/docs/tutorials/drive-your-first-app.mdx`:
- Line 67: The wording in the tutorial is too absolute for macOS users, since
they already ran the permissions grant command by hand during setup. Update the
sentence in the introductory flow around the app-check/doctor guidance to avoid
saying it is the only CLI run manually; use phrasing like “the last CLI you need
to run by hand” or simply “from here the agent does the driving,” so the copy
stays accurate for the `doctor` and `list_apps` section.
- Around line 25-29: The install walkthrough now includes the cua-driver
permissions grant command, so the later claim in drive-your-first-app.mdx that
it is “the only CLI you run by hand” is no longer accurate for macOS readers.
Update that downstream sentence to reflect that the permissions command is also
run manually, and rephrase it in a way that matches the tutorial flow; use the
surrounding verification section text and the cua-driver permissions grant step
to locate the affected wording.

---

Nitpick comments:
In @.github/workflows/cd-cua-driver-docs.yml:
- Around line 55-63: The GitHub App token created in the app-token step is
broader than this job needs, so narrow it to only the permissions used by the
workflow. Update the token minting in the actions/create-github-app-token@v1
step so the resulting GH_TOKEN is scoped to contents: write and pull-requests:
write only, using the existing app-token/app-id/private-key setup. Keep the rest
of the job unchanged and ensure the new scope still works with the doc
publishing and PR update steps.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a0c5b2c3-b886-4d03-9a44-f1b6466cc47c

📥 Commits

Reviewing files that changed from the base of the PR and between 62b3a7e and 2c73670.

📒 Files selected for processing (11)
  • .github/workflows/cd-cua-driver-docs.yml
  • .github/workflows/ci-check-docs.yml
  • docs/content/docs/reference/cua-driver/cli-reference.mdx
  • docs/content/docs/reference/cua-driver/macos-permissions.mdx
  • docs/content/docs/reference/cua-driver/mcp-tool-notes.mdx
  • docs/content/docs/reference/cua-driver/mcp-tools.mdx
  • docs/content/docs/reference/cua-driver/meta.json
  • docs/content/docs/tutorials/drive-your-first-app.mdx
  • docs/package.json
  • scripts/docs-generators/config.json
  • scripts/docs-generators/cua-driver.ts

Comment on lines +28 to +31
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for git-tag version discovery

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

sed -n '1,180p' .github/workflows/cd-cua-driver-docs.yml | cat -n

Repository: trycua/cua

Length of output: 4408


🏁 Script executed:

python3 - <<'PY'
from pathlib import Path
p = Path('.github/workflows/cd-cua-driver-docs.yml')
text = p.read_text()
for i, line in enumerate(text.splitlines(), 1):
    if 'checkout' in line.lower() or 'credentials' in line.lower() or 'github app' in line.lower() or 'git remote set-url' in line.lower() or 'pnpm install' in line.lower() or 'cargo build' in line.lower():
        print(f"{i}: {line}")
PY

Repository: trycua/cua

Length of output: 566


🏁 Script executed:

sed -n '1,140p' .github/workflows/cd-cua-driver-docs.yml | nl -ba | sed -n '1,140p'

Repository: trycua/cua

Length of output: 184


Disable persisted checkout credentials. actions/checkout leaves the repo token in git config until it is cleared later, so pnpm install and cargo build can read a write-capable credential. Set persist-credentials: false here; the workflow re-authenticates with the App token before pushing.

🧰 Tools
🪛 zizmor (1.26.1)

[warning] 28-31: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/cd-cua-driver-docs.yml around lines 28 - 31, The Checkout
repository step in the workflow leaves the default token persisted in git
config, which can expose write-capable credentials to later commands like pnpm
install and cargo build. Update the actions/checkout@v4 configuration in the
checkout step to disable persisted credentials, using the existing Checkout
repository action block as the reference, and keep the later App token
re-authentication flow for pushes unchanged.

Source: Linters/SAST tools

Comment on lines 538 to 556
### `replay_trajectory`

Replay a recorded trajectory by re-invoking every turn's tool call in lexical order. `dir` must point at a directory previously written by `start_recording`.
Replay a recorded trajectory by re-invoking every turn's tool call in lexical order. `dir` must point at a directory previously written by `start_recording`. Each `turn-NNNNN/` is parsed for `action.json`, and the recorded tool is called with its recorded `arguments` via the same dispatch path an MCP / CLI call uses.

Caveats:
- Element-indexed actions fail because element indices are per-snapshot. Pixel clicks and keyboard tools replay cleanly.
- `get_window_state` and other read-only tools are not recorded, so replays do not re-populate the element cache.
- When recording is enabled while replay runs, the replay itself is recorded into the currently configured output directory.
- Element-indexed actions (`click({pid, element_index})` etc.) will fail because element indices are per-snapshot and don't survive across sessions. Pixel clicks (`click({pid, x, y})`) and all keyboard tools replay cleanly. Failures are reported but don't stop replay unless `stop_on_error` is true.
- `get_window_state` and other read-only tools are NOT currently recorded, so replays do not re-populate the per-(pid, window_id) element cache.
- If recording is ENABLED while replay runs, the replay itself is recorded into the currently configured output directory. That's deliberate: recording a replay against a new build and diffing the two trajectories is the regression-test workflow.

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `dir` | string | Yes | Trajectory directory previously written by `start_recording`. Absolute or `~`-rooted. |
| `delay_ms` | integer | No | Milliseconds to sleep between turns. Default 500. |
| `stop_on_error` | boolean | No | Stop replay on the first tool-call error. Default true. |
**Arguments:**

- `delay_ms` (integer, optional): Milliseconds to sleep between turns, for human-observable pacing. Default 500.
- `dir` (string, required): Trajectory directory previously written by `set_recording`. Absolute or ~-rooted.
- `stop_on_error` (boolean, optional): Stop replay on the first tool-call error. Default true — set false to best-effort through the full trajectory.

```json
{"dir": "~/cua-trajectories/demo1"}
{"dir":"~/cua-trajectories/demo1"}
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix non-existent tool name in replay_trajectory parameter description.

The dir parameter description references set_recording, which is not a valid tool. It should read start_recording to match the actual tool name and the description text two lines above.

Since this MDX is auto-generated, fix the source string in the Rust replay_trajectory tool definition (likely in the dir parameter's description field) so the next regeneration picks it up.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/docs/reference/cua-driver/mcp-tools.mdx` around lines 538 - 556,
The `replay_trajectory` docs contain an incorrect parameter description for
`dir` that references a non-existent tool name. Update the source string in the
Rust `replay_trajectory` tool definition, specifically the `dir` argument
description, so it uses `start_recording` and matches the surrounding
documentation text. Ensure the generated MDX picks up the corrected wording on
the next regen.

Comment on lines +278 to +295
// Introduction
lines.push(escapeMdxText(docs.abstract) + ' Install via the official script:');
lines.push('');
lines.push('```sh');
lines.push(
` installCommand="curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh | bash"`
'curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh | bash'
);
lines.push('/>');
lines.push('```');
lines.push('');

// Introduction
lines.push(escapeMdxText(docs.abstract));
lines.push(
`Documented against Cua Driver **${releasedVersion}**. Run \`cua-driver --version\` for your installed version.`
);
lines.push('');
lines.push(
'The macOS-only `cua-driver permissions` command is documented separately in [macOS permissions](/reference/cua-driver/macos-permissions).'
);
lines.push('');
lines.push('---');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking whether the permissions command is still present in generator inputs/outputs..."
rg -n -C2 '\bpermissions\b' \
  docs/content/docs/reference/cua-driver/cli-reference.mdx \
  libs/cua-driver/rust/crates/cua-driver/src/cli.rs

Repository: trycua/cua

Length of output: 14044


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Map the docs generator and inspect the CLI reference generation path."
ast-grep outline scripts/docs-generators/cua-driver.ts --view expanded

echo
echo "Relevant generator slices:"
sed -n '1,220p' scripts/docs-generators/cua-driver.ts
echo
sed -n '220,380p' scripts/docs-generators/cua-driver.ts
echo
sed -n '380,520p' scripts/docs-generators/cua-driver.ts

Repository: trycua/cua

Length of output: 18947


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Inspect how dump-docs populates the CLI command list and whether permissions is filtered anywhere."
ast-grep outline libs/cua-driver/rust/crates/cua-driver/src/cli.rs --view expanded

echo
echo "Search for command serialization / filtering around dump-docs:"
rg -n -C3 'permissions|dump-docs|commands|subcommands|mcp' libs/cua-driver/rust/crates/cua-driver/src/cli.rs

Repository: trycua/cua

Length of output: 50366


Exclude permissions from the generated CLI reference. dump-docs still includes permissions, and generateCLIReferenceMDX() will render it under “Other commands, so cli-reference.mdxstill owns the macOS-only command even though the intro points to the separate page.scripts/docs-generators/cua-driver.ts`

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/docs-generators/cua-driver.ts` around lines 278 - 295, Exclude the
macOS-only permissions command from the generated CLI reference so it no longer
appears under “Other commands.” Update the CLI docs generation flow in
scripts/docs-generators/cua-driver.ts, specifically around
generateCLIReferenceMDX() and the dump-docs input, to filter out `permissions`
before rendering. Keep the separate macOS permissions page as the only source
for that command.

f-trycua added a commit that referenced this pull request Jul 1, 2026
…grant recipe

- capture-and-dispatch-modalities: mcp-tool-notes doesn't exist on main (it's
  introduced by #2088), so point action-response-shape back to mcp-tools
- fill-a-form recipe: 'permissions status' is read-only and won't trigger the
  prompts the step tells you to approve — use 'permissions grant' first

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s
…desc, exclude permissions

- cd-cua-driver-docs.yml: persist-credentials: false on checkout (the workflow
  re-auths with the App token before pushing)
- recording_tools.rs: replay_trajectory 'dir' description referenced the removed
  'set_recording' tool -> 'start_recording' (regenerated mcp-tools.mdx)
- cua-driver.ts: exclude 'permissions' from the generated CLI reference; it's
  documented on its own macos-permissions page

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Linux visual regression artifacts

Matrix jobs now run independently. Download visual artifacts from this workflow run.
Each background-GUI job uploads a .gif of the interaction plus two annotated PNGs (<app>.png raw, <app>-atspi.png with AT-SPI element boxes); the cua-driver-linux-som-overlays artifact adds <app>-som.png cua Set-of-Marks overlays:

  • cua-driver-linux-cursor-click-gif
  • cua-driver-linux-background-terminal-gif
  • cua-driver-linux-parallel-drag-xserver
  • cua-driver-linux-background-gui-chromium
  • cua-driver-linux-background-gui-tk
  • cua-driver-linux-background-gui-gtk3-gedit
  • cua-driver-linux-background-gui-gtk3-mousepad
  • cua-driver-linux-background-gui-gtk3-scite
  • cua-driver-linux-background-gui-gtk4-characters
  • cua-driver-linux-background-gui-qt5-manuskript
  • cua-driver-linux-background-gui-qt5-klog
  • cua-driver-linux-background-gui-qt5-openambit
  • cua-driver-linux-background-gui-qt6-kate
  • cua-driver-linux-background-gui-qt6-kcalc
  • cua-driver-linux-background-gui-qt6-okular
  • cua-driver-linux-background-gui-qt6-qownnotes
  • cua-driver-linux-background-gui-electron-zettlr
  • cua-driver-linux-background-gui-electron-joplin
  • cua-driver-linux-background-gui-electron-logseq
  • cua-driver-linux-som-overlays

Open workflow run and download artifacts

@f-trycua
f-trycua merged commit 0696256 into main Jul 1, 2026
69 of 72 checks passed
@f-trycua
f-trycua deleted the docs/cua-driver-reference-autogen branch July 1, 2026 15:10
f-trycua added a commit that referenced this pull request Jul 1, 2026
Now that #2088 has merged, the 'Action response shape' section lives in
mcp-tool-notes.mdx (moved out of the auto-generated mcp-tools.mdx). Point the
capture-and-dispatch-modalities link at its new home.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s
f-trycua added a commit that referenced this pull request Jul 1, 2026
* docs(cua-driver): fix macOS audit findings — 42 not 391, 0.7.0, permissions status

Iteration 1 live-audit fixes (verified against cua-driver 0.7.0):
- tutorial: result was reported as 391, contradicting its own step 4 (42)
- install: --version/doctor showed 0.5.x; live is 0.7.0
- install: pretty ✅ TCC output belongs to 'permissions status', not
  'check_permissions' (which returns JSON)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

* docs(cua-driver): fix consistency findings — phantom tools, anchors, axes, mcp-config

Iteration 1 cross-doc consistency fixes (verified vs live cua-driver 0.7.0):
- remove phantom 'screenshot' tool refs (no such tool among the 38)
- fix action-response-shape anchor to mcp-tool-notes
- explanation index: three axes -> four (adds the action-rung axis)
- demonstrations: video is not recorded 'by default'
- connect-your-agent: Pi examples need 'call'; mcp-config claude example matches
  live output (--scope user, no compat flag)

Source/generator-level findings (type_text_chars, manifest, flag docs) recorded
in DOCS_AUDIT.md for a coordinated fix with cua#2088.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

* docs(cua-driver): fix how-to + recipe findings — permissions status, versions, autostart, cursor-palette

Iteration 2 (macOS how-to guides + recipes, verified vs 0.7.0):
- recipes: 'call check_permissions' (JSON) -> 'permissions status' (matches shown
  output); stale 0.5.x placeholder -> 0.7.0
- keep-running: macOS autostart helper is repo-relative and breaks for
  curl-installed users; reframed around the plist
- personalize-cursor: document the live --cursor-palette launch flag

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

* docs: note Azure resource-group for audit VM cleanup

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

* docs(cua-driver): fix Linux findings — libXi prereq, headless gap, ffmpeg, systemd target

Iteration 3 (Linux, live-verified on fresh Azure Ubuntu 22.04):
- install (Linux): [blocker] binary won't launch without libXi.so.6; add
  'sudo apt install libxi6 at-spi2-core' prereq + sudo caveat + headless-desktop
  note; drop the phantom ffmpeg claim from the doctor sentence
- keep-running (Linux): headless boxes need WantedBy=default.target

Recorded (generator fix, cua#2088): mcp-tools tool count is platform-specific —
Linux exposes 43 (5 Linux-only tools incl type_text_chars), macOS 38.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

* docs(cua-driver): refresh update.mdx sample versions 0.3.x -> 0.7.0

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

* docs(cua-driver): fix Windows findings + finalize audit summary

Iteration 4 (Windows, live on Azure Server 2022 via run-command/Session 0):
- install (Windows): note the installer registers the cua-driver-serve autostart
  task + its interactive requirement
- keep-running (Windows): autostart from a non-interactive/SSH context fails with
  a cryptic SID error — use RDP/local console

Windows list-tools = 39 (macOS 38 / Linux 43) — reinforces the platform-specific
tool-surface finding for cua#2088. Full audit summary in DOCS_AUDIT.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

* chore: drop working audit log (kept out of the docs PR)

* docs(cua-driver): unify inbound link text to the choose-a-modality title

The page title is 'Choose an Action Rung and Dispatch Mode' but several docs
linked it as 'Choose a capture and dispatch mode'. Unify to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

* docs(cua-driver): address CodeRabbit — revert anchor, fix permission-grant recipe

- capture-and-dispatch-modalities: mcp-tool-notes doesn't exist on main (it's
  introduced by #2088), so point action-response-shape back to mcp-tools
- fill-a-form recipe: 'permissions status' is read-only and won't trigger the
  prompts the step tells you to approve — use 'permissions grant' first

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

* docs(cua-driver): point action-response-shape anchor to mcp-tool-notes

Now that #2088 has merged, the 'Action response shape' section lives in
mcp-tool-notes.mdx (moved out of the auto-generated mcp-tools.mdx). Point the
capture-and-dispatch-modalities link at its new home.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Th8TxivbUjS6NUT2cKVo6s

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant