Skip to content

feat(extension): jev_observe / jev_act for reins do (2/3) - #42

Merged
karngyan merged 6 commits into
mainfrom
feat/reins-do-extension
Sep 28, 2026
Merged

karngyan merged 6 commits into
mainfrom
feat/reins-do-extension

Conversation

@karngyan

@karngyan karngyan commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Part 2 of 3 for reins do (stacked on #41; #43 builds on this).

Why

Jev needs two things from the page, and both have to be fast:

  • a compact list of what's on screen, with stable ids;
  • a way to act on one of those ids without the usual selector round trips.

What

  • jev_observe: a page snapshot ported from browser-use/jev-ultrafast (MIT). It returns:

    • visible viewport text (capped);
    • actionable controls with labels, roles and states;
    • scroll/wait controls;
    • any open JS dialog.

    Nodes are cached page-side in a Symbol.for("reins.jev") map. Password and hidden values are never included, and a browser test asserts it with a real value in a password field.

  • jev_act: click, type, select, scroll or wait on a cached node. It reuses the existing actionability checks (actionPoint/actionablePoint now accept a node and a timeout; pressAt was extracted from cdpClick).

  • Dialogs: tracked via Page.javascriptDialogOpening/Closed.

    • jev_act races its work against a dialog opening, so a click that opens confirm() returns right away instead of hanging.
    • A dialog that was already open before the press is reported as stale, since nothing happened.
    • A press cut short by a dialog sends no further input after the dialog is dismissed.
  • Tiers: both methods need tier full in METHOD_TIERS.

Testing

  • Real-browser suite (pointer.browser.test.ts, headless Chrome): a Jev fixture page covering the leak test (#pw holding "hunter2", hidden "secret"), a confirm-dialog click, and forwarding of CDP events.
  • Unit tests cover the schemas and the dialog race.

🤖 Generated with Claude Code

karngyan and others added 6 commits September 28, 2026 21:38
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e stale

A click whose handler opens alert/confirm/prompt froze jevAct: the press
response, the probe read and settle all block on a dialog, so the act sat
until the daemon's per-call timeout. jevAct now races the act against a
per-tab dialog waiter fed by Page.javascriptDialogOpening; if the dialog
wins, the press happened, so it returns ok and the next observe reports
the dialog. Transport failures from actionablePoint are rethrown instead
of being reported as a stale element.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…end no input

A dialog opened by the page before jev_act's first mutating command now
returns stale ("a dialog opened before the action") instead of ok, since
nothing happened. When a dialog wins the race after the press, the act is
marked abandoned so that, once the dialog is answered and the frozen
command resumes, it sends no selectAll, insertText or settle against
whatever is focused by then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@karngyan
karngyan force-pushed the feat/reins-do-extension branch from 0d10e11 to d8171a0 Compare September 28, 2026 16:09
@karngyan
karngyan merged commit dcea757 into main Sep 28, 2026
2 checks passed
@karngyan
karngyan deleted the feat/reins-do-extension branch September 28, 2026 16:34
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