Skip to content

Add canonical computer-use action schema (Anthropic/OpenAI -> AC_*)#362

Merged
JE-Chen merged 1 commit into
devfrom
feat/cua-action-batch
Jun 23, 2026
Merged

Add canonical computer-use action schema (Anthropic/OpenAI -> AC_*)#362
JE-Chen merged 1 commit into
devfrom
feat/cua-action-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 23, 2026

Copy link
Copy Markdown
Member

tool_use_schema exports AC_* signatures and coordinate_space rescales — neither normalizes an inbound action payload. Anthropic emits {action:"left_click", coordinate:[x,y]}, OpenAI CUA emits {type:"click", x, y, button}; there was no adapter mapping these onto a canonical action and then onto a runnable AC_* command.

  • from_anthropic / from_openai_cua: map each provider's payload to a canonical {type, x, y, text, …} (click / double / right / middle / move / type / key / scroll / screenshot).
  • to_ac_command: canonical -> [command_name, params] (AC_click_mouse / AC_set_mouse_position / AC_write / AC_hotkey / AC_mouse_scroll / AC_screenshot), with an optional scale callable for model->physical coordinates; unmapped types raise AutoControlActionException.
  • AC_cua_command(payload, source) returns {canonical, command}. Pure-stdlib dict mapping, fully headless-testable. Wired through all 5 layers + headless test + EN/Zh docs + WHATS_NEW. Qt-free.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 45 complexity · 0 duplication

Metric Results
Complexity 45
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 10ab6d7 into dev Jun 23, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/cua-action-batch branch June 23, 2026 04:52
@sonarqubecloud

Copy link
Copy Markdown

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