Skip to content

feat: add semantic UI click and type actions - #49

Merged
linnnn89 merged 2 commits into
mainfrom
codex/ui-semantic-actions
Sep 26, 2026
Merged

linnnn89 merged 2 commits into
mainfrom
codex/ui-semantic-actions

Conversation

@linnnn89

Copy link
Copy Markdown
Owner

Summary

Adds two semantic UI action tools on top of the existing read-only UIA evidence path.

  • wincode_ui_click and wincode_ui_type (mode:"type" or mode:"setValue") act on exactly one control that a single bounded search proves unique; zero or multiple matches act on nothing.
  • Patterns and keyboard input only: no coordinate mouse simulation and no Shell-level activation, restore or raise of the target window. click and setValue need no foreground; mode:"type" requests keyboard focus on the control and re-reads it, refusing with FOCUS_FAILED (sending no text) when that cannot be confirmed.
  • inspectionVersion 3 stops an older helper from reporting a requested action as a successful inspection: the Gateway rejects actions from a v2 helper instead of trusting success:true.
  • Results report actionMethod, actionTarget and inputLength; input text is never echoed back. Audit op records click/type/setValue.
  • Actions reuse the existing UI admission slot, mutual exclusion, timeout and helper reclamation; a request that expires during finalization still returns the real outcome of an action that already ran.
  • Skill and docs prefer mode:"setValue" for background writes and require user approval before any foreground focus, so focus is never taken from a game, chat or meeting the user is actively using. ACTION_FAILED is documented as possibly partially completed rather than "nothing happened".

Test plan

  • npm run check — 18 stages including delivery verification: passed
  • npm run test:ui — 39 tests including the new real-WPF end-to-end case: passed
  • New tests/ui-action-mcp.test.ts covers boundary rejection before any helper launch, the v2-helper version gate, and real fixture side effects (click, toggle, keyboard typing with clear, setValue including clearing via an empty string), with ambiguous, disabled, missing and read-only targets verified to leave application state unchanged.

- Host: click/type/setValue use UIA control patterns and keyboard input only, with single-target proof, disabled/read-only refusal and a focus re-check before any text is sent; inspectionVersion 3 stops an older helper from reporting an action as a successful inspection.

- Gateway: wincode_ui_click and wincode_ui_type (19 published tools), contract validation before any helper launch, audit op records the action name.

- Skill and docs: describe the actions, prefer mode="setValue" for background writes, and require user approval before any foreground focus.

- Tests: real WPF fixture end-to-end side effects plus boundary and version gates.
The gateway acceptance script asserted 17 published tools and the architecture note carried the same stale count; the UI action tools make 19.
@linnnn89
linnnn89 merged commit 39e097d into main Sep 26, 2026
7 of 8 checks passed
@linnnn89
linnnn89 deleted the codex/ui-semantic-actions branch September 26, 2026 16:06
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