Files
Adcent 24c05c128c [codex] Implement browser interaction commands (#351)
* Add browser click interaction tests

* Expand browser click interaction coverage

* [packages/cli-v2]feat: implement browser click command with shared element resolution

Add full browser click implementation with CDP mouse event dispatch,
selector/coordinate parsing, --button/--count/--new-tab flags, navigation
detection, and XPath support. Extract element resolution into a shared
browser::element utility for reuse by future interaction commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [packages/cli-v2]fix: use shared resolver for --new-tab href check and add click to help

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add browser type interaction tests

* [packages/cli-v2]feat: implement browser type command

Keystroke-by-keystroke text input via CDP Input.dispatchKeyEvent.
Resolves element through shared element utility, focuses and positions
cursor at end before typing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [packages/cli-v2]fix: populate context URL/title and use char count in browser type

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add browser fill interaction tests

* [packages/cli-v2]feat: implement browser fill command

Direct value setting via native input setter with synthetic input event
dispatch. No keystroke simulation — replaces existing value entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [packages/cli-v2]fix: pick native value setter based on element type in browser fill

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add textarea fill regression test

* Add browser select interaction tests

* [packages/cli-v2]feat: implement browser select command

Select dropdown options by value or visible text (--by-text flag).
Dispatches input and change events after selection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [packages/cli-v2]fix: use resolved node for select instead of re-querying with querySelector

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Format interaction files for lint

* [packages/cli-v2]fix: scroll into view before click and replace fixed navigation delay

Scroll elements into the viewport via DOM.scrollIntoViewIfNeeded before
computing bounding-box coordinates, so clicks on off-screen elements
land correctly. Replace the hardcoded 500ms post-click sleep with a
polling loop that detects URL changes at 50ms intervals (2s timeout),
avoiding unnecessary delays for non-navigating clicks and catching
slow SPA transitions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 08:36:54 +08:00

560 B