80 Commits
Author SHA1 Message Date
Donny/강동윤andClaude Opus 5.5 a2d0363128 feat(desktop): add the @e2e-dev/desktop engine on agent-desktop (#1953)
* feat(desktop): add the @e2e-dev/desktop engine on agent-desktop

A desktop engine for native and Electron apps, built on agent-desktop
(vercel-labs, Apache-2.0), which reads and drives apps through the OS
accessibility tree. macOS is the tested platform; this is rollout phase 1
of the ENG-1352 proposal.

- The engine downloads the pinned agent-desktop 1.3.1 release in prepare
  and checks its SHA-256; the npm package is not a dependency because its
  postinstall would fail check:install-scripts.
- Fill text reaches agent-desktop on stdin, never in its arguments.
  Screenshots are cropped to the window and paint every secure field black,
  and are withheld when a secure field has no bounds or the snapshot was
  partial.
- Node ids stay stable across observations, so the agent gets diffs.
- The engine quits only the process it launched, checked by its process
  instance.
- apps/desktop-testbed holds an AppKit sign-in form with deterministic and
  agentic suites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop): accept the remaining budget in the fill arguments

The timeout agent-desktop gets is what is left of the operation's
deadline, so it can be a millisecond under the full budget on a slow
runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): report field values whole and keep a typed-into field's id

locate answers single-node reads, which the contract says carry the whole
value; the harness cuts what the agent sees. An unnamed field's identity no
longer includes its value, so typing into it is a change, not a remove and
an add. An image is projected as the contract role image, which both
locator spellings resolve to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): withhold a capture with a border instead of masking it in place

A capture within four pixels of the window was taken as the window, so a
two-pixel border shifted every mask. Only a pixel of rounding is accepted
now, any other capture is cropped to its opaque box, and each mask reaches
two pixels past its field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): give a read exactly its budget

The 500 ms floor exists so a click that landed is not reported as cut off;
a read has no such reason and now stops at the operation's deadline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): keep agent-desktop out of the replay cache and report install failures

E2E_CACHE_DIR names the replay cache, which a project may commit, so the
binary goes to the OS cache directory only, found from the run's
environment. A network or tar failure in prepare is now
AGENT_DESKTOP_INSTALL_FAILED, as the docs say.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): offer doubleTap only with headed, and say what app.open and settle do

agent-desktop double-clicks with the real pointer only, so doubleTap is
declared with headed: true and sent with --headed. The docs said app.open()
quits the app if it runs; it quits only the copy the engine launched. settle
is a fixed wait, not a check that the UI is still.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): drive only the launched process, and keep ids and the select ladder honest

- Every read and scoped command goes to a window of the process the engine
  launched; before app.open() or after the app quit, the engine reads and
  drives nothing, so a developer's own copy is never touched.
- With appPath, the launched executable must come from that bundle; another
  copy registered under the same bundle id fails the open.
- quit keeps the process as the engine's own until it is known to be gone,
  so a failed lookup is reported and dispose tries again.
- Node identities are scoped to their window and retired once gone or
  ambiguous, so neither a twin nor another window's control inherits an id.
- The select ladder passes the label after --, reports a stale ref as
  NODE_STALE, and stops once any command of a way reached the app.
- A press on a control that refuses focus is refused unless it holds focus.
- A root swipe after a restart reads the window again.
- app.open() waits at most 30 s for a readable window, reports any other
  read failure as it is, and is cancelled with its operation.
- A screenshot is withheld when the window read after the capture differs
  in its secure fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): read placeholders, mixed checkboxes, and depth-cut trees as agent-desktop reports them

- A placeholder comes from agent-desktop's own placeholder field; the hint
  is kept as an attribute of its own.
- A mixed checkbox reports no checked state, so check() and uncheck() always
  reach the control instead of returning early.
- A node that counts children it did not list (the depth limit) marks the
  tree as cut short, so a screenshot from it is withheld.
- Siblings that share a developer id (AppKit menu items) tell themselves
  apart by name and keep their ids; a status with a developer id keeps its
  id while its text changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): launch an appPath by path and keep every process a launch started

- An appPath bundle is opened by its path (open -n), and the new process
  running from it is taken as the engine's own; launching by bundle id let
  LaunchServices pick another copy with the same id.
- A launch that failed after the app started still leaves the engine owning
  the new process, so the end of the attempt quits it.
- A window is the engine's only when its process instance matches too, so a
  later process given the same pid is never read or driven.
- An app list that is incomplete keeps the process the engine's, to quit
  again in dispose.
- A point action finds the window where it is now, so it works right after
  app.open() and after the window moved.
- A type or fill after a clear that changed the field fails as
  ACTION_MAY_HAVE_COMMITTED, never as a retryable stale ref.
- A screen larger than the binding cap keeps every node it just read.
- The launch wait is 10 s, and each read in it gets what is left of it.
- A bundle id that names no app says so, instead of asking for app.open().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop): refuse an archive with the wrong SHA-256 and cache nothing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(desktop): say app.open brings the app forward, and that only macOS is tested

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): never take another copy as the launched one, and aim point actions at their window

- A launch agent-desktop refused takes no process as its own, and a copy is
  attributed to a launch by id only against a whole app list from before it,
  so cleanup never kills the developer's copy.
- A launch whose outcome is unknown is kept pending and settled by the next
  quit under its own budget, so a timed-out launch still has its app quit.
- A point action goes to the window it was observed in, wherever it is now,
  refuses a point outside that window, and brings it forward before the
  physical click.
- In the select ladder, ELEMENT_NOT_FOUND from select (no such option) goes
  on to the next way; from a command on the list itself it is NODE_STALE.
- A root swipe scrolls the window as it is now.
- With both appPath and bundleId, the appPath build is launched and its
  bundle id must match.
- An open that runs out of its own budget is OPERATION_TIMEOUT; only the full
  launch wait reports an unreadable window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop-testbed): check the saved screenshot for the password field's mask

The test checked only that the file was a PNG, which an unmasked capture
also is. It now decodes the image and requires the solid black bar the
password field's mask paints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(desktop): say which app launches when appPath and bundleId are both set

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): report a read agent-desktop timed out as OPERATION_TIMEOUT

TIMEOUT was NOT_ACTIONABLE for reads as well as inputs, so a snapshot that
ran out of time skipped the launch wait's timeout handling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): tell the launched process apart by a token, and measure points in their window

- Every launch passes a one-time token in the app's environment
  (launch --env, open --env), and a process is the engine's own only when
  ps -E shows that token. Guessing from the app list before and after a
  launch could take, and kill, a copy the developer or another worker
  started at the same time.
- A launch whose outcome is unknown is settled by the next quit, which looks
  for the token for up to 3 s and reports a failure when it finds none.
- A point is measured in the window of the newest screen observe or locate
  handed out, and sent unrounded, so it never lands past the window's edge.
- check and uncheck always go to agent-desktop, which reads the live state.
- One window's node ids stay while another window is read.
- The launch wait's commands share its deadline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop): pin option and app validation and the headed-only actions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop-testbed): measure the password mask at the capture's scale

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): keep identities from colliding, and never drop a secure node

- A node identity is a tagged tuple, so a developer id and a name can never
  spell another control's identity (`shared` + `Edit:` against `shared:Edit`),
  which let one control take another's binding.
- A secure node is never dropped as a wrapper, so its bounds are masked.
- A binding records the window its node was read in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): press keys only into a focused control, type keystrokes, and check the launched process's token

- A press on a control needs its focus to succeed and to hold, and goes into
  the control's own window; before, a refused focus sent the key to
  whatever window had focus.
- The keyboard capability is declared with headed only and types with
  --headed: without physical input agent-desktop sets the text, and the
  contract asks for keystrokes the app's handlers see.
- The process agent-desktop reports for a launch must carry the launch's
  token; a launcher that handed over to a copy already running (a Linux
  desktop file) fails the open and never drives or quits that copy.
- A select that finds no such option never falls through to set-value,
  which would type the label in as free text; a menu left open after a
  missing option is reported as a changed app.
- A read tries the launched app's windows in turn, past a panel
  accessibility cannot read.
- No app bundle is opened once the operation's budget is spent.
- doctor fails an appPath with no Contents/Info.plist.
- The unused latest-screen field is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop-testbed): require a mask the size of the password field, not one black row

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(desktop): ship a NOTICE like every other published package

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(desktop): say typing into whatever has focus needs headed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): withhold masks with no area, and give controls their title as text

- A secure field whose box has no area masks nothing, so the screenshot is
  withheld.
- A control reports its title as its text, as on a device, so
  textContent() reads a button's title; an input's name is a label, so it
  gets none.
- A binding keeps its node's box, to find a look-alike again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): find a pressed look-alike by its place, keep unresolved launches, and test on the host's ps

- A press checks focus on the control found again by role and box, since a
  look-alike has a new id in every read; the key is resolved before focus
  moves, and a node read in no window is refused.
- An environment that cannot be read (a macOS system app under SIP, a
  failed lookup) is no evidence: agent-desktop's report of the process it
  launched stands, so system apps open again and are quit at the end.
- A pending launch stays until it is claimed or a whole wait finds none.
- A window row is the engine's only with the launched process instance.
- A screenshot finds secure fields in whole reads of the window, even with
  interactive snapshots, which leave out a secure node with no action.
- A menu read in part never reports an option missing.
- The unit tests read process environments the host's way (ps -E or
  /proc), so they pass on the Linux CI runner, and remove the fake's
  scenario directories.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop): dispose every surface a test creates, so no state directory is left behind

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(desktop): drop Electron, so the engine targets native apps only

Electron apps are out of scope for this engine. Remove the paths that
existed only for them: the headed type fallback for a field the
accessibility API cannot set (Electron on Linux), and the expand and
menu-click steps of the select ladder (Electron on Windows and macOS).
A select now tries `select`, then sets the value of a list that takes
none (WinForms), and reports an option `select` cannot find as missing.

The Electron snapshot fixtures go too; the wrapper and shared-id tests
use the AppKit sign-in form and an inline AppKit menu. Docs, the
README, package metadata, and the skill now say native apps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(desktop): match the workspace's vitest 5.1.1

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(desktop): apply the review of #1953

macOS only. prepare and init refuse any other OS: on Windows and Linux
some actions need physical input and GTK's password field is not
reported as secure, so masking would fail open. A config with a desktop
target still loads elsewhere.

The app under test and agent-desktop get only HOME, USER, LOGNAME,
SHELL, PATH, TMPDIR, LANG, LC_*, and __CF_USER_TEXT_ENCODING of the
run's environment, so secrets, model keys, and CI tokens never reach
them. `open` and NSWorkspace both handed the caller's whole environment
to the app.

The app launches in the background (`open -g`, `launch` without
`--activate`) unless headed, so typing at the Mac no longer lands in it.
An app that shows no window after 2 s is brought forward once.
Every launch passes -ApplePersistenceIgnoreState YES.

An appPath app whose environment cannot be read (a system app, a build
signed with `restrict`) is now claimed as the single new copy that was
not running before the launch, instead of polling until the test timed
out and leaving the app running. A launch reported for a copy that ran
before it is refused. An open that finds no process fails within 10 s.

select no longer falls back to set-value, which could type a missing
option into an editable combo box. press sends a key only when the
control's window is the app's key window, and finds the control again by
its stable id. locate fails on a truncated read with no match instead of
proving absence. The reads a screenshot's mask takes hand out no ids.
The window's own Close, Minimize, Zoom, and Full Screen buttons are left
out of the tree. desktop.useWindow() picks the window screen reads.

Stale state directories of killed workers are swept at init. The cached
agent-desktop is reused only when a verified unpack stamped it and its
executable and helper are intact. doctor says the permission checks need
the first run. A pending launch whose lookup timed out stays pending.

Tests: the screenshot-moved test now uses the window the fake lists, and
a steady capture is checked to succeed. Each fix has a test that fails
without it (checked by mutation). The testbed checks the password
field's own box is black and the field beside it is not, and
test:desktop-testbed builds the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): keep launches pending after open, and fix four review gaps

A fresh-context review of f0d1bb69f found these, each now with a test:

- openBundle: a failure after `open` ran (a list-apps error, or the
  budget running out while looking) was read as "nothing was sent", so
  the copy `open` started was never quit. Any failure after `open` is
  now ACTION_MAY_HAVE_COMMITTED and leaves the launch pending.
- An app that quits right after launch now fails the open at once,
  before the engine brings its bundle forward, which would have started
  a copy the engine does not own.
- A node inside a look-alike container is no longer marked stable: its
  id is built on its parent's, which is new in every snapshot, so press
  finds it by place again.
- Only a title-bar-sized button (at most 20 points) with a window
  control's name is left out; an app's own Close button stays.
- A window chosen with desktop.useWindow() that closed is now
  INVALID_STATE, not an empty screen a negative assertion would pass on.
- The release cache is swapped by rename instead of deleted first, and
  doctor checks the stamped copy, not only that the file exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): send keys and close select menus in the background, and quit apps killed workers left

Found in live runs on an unlocked Mac:

- A key press never reached an app in the background: agent-desktop
  sends a key to a named window only while that window is active, and
  answered STALE_REF, which the harness retried until the step timed out.
  The key now goes to the process by its app name, once the engine saw
  its copy is the only one with that name; with another copy running,
  press fails at once with NOT_ACTIONABLE and says to use headed.
- selectOption of a missing option on a pop-up button opened its menu,
  waited out the whole action budget, and left the menu open. select now
  waits at most 3 s; a menu it left open is closed with Escape and the
  option reported missing (NOT_ACTIONABLE), the list unchanged.
- A worker that was killed left its app running. Each worker records
  the app it launched and its token; the next run's sweep quits that app
  while its environment still shows the token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): sweep a state directory whose launch record was cut short

A worker killed while writing app.json left half a JSON record. The sweep
parsed it inside the promise's success handler, so the SyntaxError escaped
and every later init failed on the same stale directory. A record that does
not parse now names no process and the directory still goes, and the record
is written to a side file and renamed into place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): keep the state directory when dispose could not quit the app

dispose removed the state directory even when its quit failed, and app.json
went with it, so the next run's sweep had no pid and token to quit the
leaked app by. The directory now stays while the engine still owns a process
it could not quit; the owner file names a worker that is gone by then, so the
sweep removes the directory after it quits the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): claim a copy with no readable token only from whole app lists

Two paths took a process as the launch's own on evidence an incomplete app
list cannot give, and the engine later kills what it owns:

- launch by bundle id accepted agent-desktop's reported pid when its
  environment could not be read and the list before the launch was partial,
  so a copy already running could not be ruled out;
- claim() took the single new unreadable copy from a list after the launch
  that left copies out, where a second new one could hide.

The first now refuses the launch and leaves the process alone. The second
reports that it cannot tell; quit keeps the launch pending as it does for a
lookup that ran out of time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): give a background key only what is left of its budget

sendKey built its command options once, so the key sent by the app's name,
after a refused window press and a list of the apps, still carried the budget
the operation had at its start and could run past the deadline. The options
are now built for each command from the time left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): keep a select whose menu was left open as possibly committed

After a select that may have reached the app, closing a menu the app had
open was taken as proof that the option was missing and nothing was chosen,
and reported as NOT_ACTIONABLE. An open menu shows neither: it does not say
which control opened it. The failure now stays ACTION_MAY_HAVE_COMMITTED,
naming the option the list may lack, after the menu is closed. A failure to
close the menu (Escape refused while another copy runs) no longer replaces
the select's own error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): measure a point from the window useWindow() chose

performAt measured a point from the window the last read used. After
desktop.useWindow() picked another window, the next tapAt still brought the
old window forward and clicked there. Choosing a window, or going back to the
focused one, now drops that window, so the next point action measures from
the window in use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): read no empty screen from an app that cannot be read

capture() skipped every window it could not snapshot and returned no screen,
so observe showed an empty window and locate found nothing. While the screen
is locked, or after the app crashed, not.toBeVisible() then passed. Opus
reproduced it against the testbed app on a locked Mac.

Now:
- listed windows none of which could be read are a retryable NODE_STALE,
  so a locator reads again until its deadline;
- a chosen window whose snapshot says it is gone is INVALID_STATE, like
  one missing from the list;
- an app whose process is gone is INVALID_STATE.

An app with no window at all still reads as an empty screen. The launch's
readiness wait treats the new errors as a window not readable yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): count no matches in a window read in part

locate() refused a partial read only when nothing matched, and then with a
non-retryable ENGINE_FAILURE. One visible match in a read cut short still
counted as exactly one, though a second could sit in the part left out, so
a strict action or toHaveCount(1) could pass on it. And a locator for a
control not there yet failed at once instead of polling.

A partial read is now a retryable NODE_STALE whatever it matched, so the
locator reads again until its deadline. The docs say so for a window deeper
than the 24 levels a snapshot reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(desktop): correct getByText on buttons, and macOS-only metadata

- The desktop page said getByText cannot find a button by its title. The
  projection gives a button its title as text too, so it can; getByRole is
  what limits a match to the button.
- The package keywords listed windows and linux, which the engine refuses.
- CONTRIBUTING said a contract change bumps both engines; there are three.
- @e2e-dev/desktop moves to its alphabetical place in the docs package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop): cover the appPath launch and a successful install

Every surface test launched by bundle id, so a change to the open -g -n
arguments, the claim of the copy carrying the token, or its quit would not
fail a test; and the binary tests covered only failed installs.

- An appPath test puts a fake open first on PATH: it records its arguments
  and starts a process with the variable --env names, which the engine
  claims, reads, and quits.
- An install test serves an archive of its own through a digests table
  installPinned now takes (the pinned one by default), installs it twice
  at once, and checks the stamp, that nothing is left beside the entry, and
  that a third install fetches nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): find the app's running copies the way agent-desktop launches it

runningCopies() and claim() listed every app and kept the ones whose
bundle id or name equalled the target exactly. agent-desktop reports the
localized name (Calculator is 계산기 on a Korean Mac) and matches a launch
target in any case, so a copy the launch could hand over to was left out of
the list before it. A copy whose environment cannot be read was then taken
as the launch's own and killed at the end of the test; and a copy a launch
of unknown outcome started was never found, and left running.

Both now ask list-apps --app <target>, which matches the way the launch and
quit() do, and count every process it returns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop): stop the fake apps before removing the list of them

afterEach ran cleanupFakes() first, which deletes the file fake.spawned()
reads, so the processes a test left running were never killed and stayed
for their 60 s timer. They are now killed first; no stand-in process is left
after the suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): report an open LaunchServices refused as starting nothing

openBundle wrapped every failure of open as ACTION_MAY_HAVE_COMMITTED, so a
bundle LaunchServices refused (a missing executable, a bad signature) left the
launch pending. The end of the attempt then looked for its process for 3 s
and failed a second time, telling the user to quit an app that never
started. The error also quoted the whole open command line.

An open that exits with an error, or cannot run, is now ENGINE_FAILURE with
open's own message, and nothing is left to look for. Only an open the budget
or a cancellation stopped stays possibly committed. The appPath tests share
a helper that puts a stand-in open on PATH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): record the launch token before the launch, and sweep by it

app.json was written only once the launch's process id was known. A worker
killed during the launch (which can wait up to 10 s for its process), or a
launch whose process was never found, left no record, and dispose then
deleted the state directory too. The next run could not find the app.

The record now holds the launch token and is written before anything is
sent. dispose keeps it while a launch is pending, as it does for an app that
would not quit. The sweep quits every process whose environment carries the
token, found by listing the processes, so it needs no process id and
cannot reach a process that took one over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): act on no node read outside the window useWindow() chose

useWindow() changed the window every read used but kept the nodes read
before, so an action on a ref from the old window still reached its control
after a test chose another. Such a ref is now NODE_STALE, which the harness
answers by locating the node again in the window in use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): read no empty screen from an app whose process id was reused

With no window of the launched process listed, capture() checked only that
its process id was alive. Once the app quits, macOS can give that id to
another process, so the read showed an empty screen and a negative assertion
could pass. The app list must now show the same process instance; a list
that left copies out is a retryable NODE_STALE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): make doctor check an appPath bundle the way init does

doctor passed any bundle with a Contents/Info.plist, while init also needs a
CFBundleIdentifier in it, equal to app.bundleId when that is set. A bundle
doctor passed could then fail init, and a plist with no bundle id failed init
with plutil's raw error. Both now use one check, which reports a missing or
mismatched bundle id as the problem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): never move another install's verified release out of the cache

download() checked whether the cache entry was usable and, if not, moved it
aside before renaming its own unpack in. Two installs that both found no
usable entry could interleave: the second moved aside the release the first
had just put in place, and a worker starting between its two renames found
no executable. The unpack is now renamed into place first. A rename onto an
existing entry fails, and then the entry is used if it checks out, and moved
aside only if it does not.

The race has no deterministic test; a new test covers replacing a damaged
entry, the path this reorders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(desktop): say when two desktop targets share a run, and what reads empty

- The workers line said two desktop targets can run at the same time
  while telling headed runs to set workers: 1, which is what stops them.
  It now says they do, and why headed runs set workers: 1.
- The Reading row and capture()'s comment said a window is never read as
  an empty screen, but an app with no window open still is, on purpose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(desktop-testbed): pin ai to the version every other workspace uses

The testbed pinned ai 7.0.173 while the rest of the repo pins 7.0.177, which
put a second copy of ai and its gateway and provider packages in the
lockfile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): report an open cancelled mid-launch as CANCELLED

An abort while open ran, or while the engine looked for the process it
started, came out as ACTION_MAY_HAVE_COMMITTED, where every other path of
the engine reports CANCELLED. It is now CANCELLED; the launch stays pending
as before, so the end of the attempt still looks for the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): settle a pending launch by its last lookup and by its token

quit() dropped a pending launch, and dispose its record, once any lookup in
its wait had a whole answer. Two cases lost an app that was still starting:

- an early complete list with no match, followed by partial ones that could
  hide the app once it registered;
- a process carrying the launch's token that the app list did not show yet.

Now only the wait's last answer counts; a lookup that ran out of time is no
answer. Before giving up, quit looks for processes carrying the token and
quits them. The launch stays pending, and its record kept, unless the last
answer was whole and found nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): run launches and quits of one surface one at a time

Two overlapping app.open() calls could both quit, then both launch, writing
into the one process id and launch record the engine keeps; they even shared
the app.json.partial file. The end of the attempt then quit only one copy.
restart, closeApp, endAttempt, and dispose now wait for the launch or quit
running before them. restart's budget counts from the call, so the wait is
part of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): measure a headed click from where the window is after focus

performAt read the window's bounds, brought the window forward, and clicked
at the bounds read before. A window that moved as it came forward (onto
another space, out from under the menu bar) took the click somewhere else,
possibly another app. The window is now read again after focus-window, and
the point is checked against and measured from its bounds then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): repair a damaged cache entry under a lock

12c8f64d0 renamed a fresh unpack into place first, which keeps a run from
moving aside a release another run just installed only when there was no
entry. Two runs that both found an entry damaged could still interleave: the
second moved aside the copy the first had just put in place. Its commit
message and comment claimed more than that.

Replacing an entry now holds a lock directory that names its owner's process
id, and checks the entry again under it. A lock whose owner is gone, or that
got no owner and is 10 s old, is taken over; one held for 60 s fails the
install with AGENT_DESKTOP_INSTALL_FAILED.

Tests repair one damaged entry from three runs at once and take over a lock a
dead process left. The interleaving itself has no deterministic test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): refuse getByPlaceholder, which macOS gives nothing to match

agent-desktop's macOS adapter reports no placeholder for a field; AppKit
folds it into the accessible name of a field with no label. A placeholder
query therefore matched nothing, and not.toBeVisible() or toHaveCount(0) on
it passed with the field on screen. locate() now refuses any expression that
uses a placeholder query with UNSUPPORTED_CAPABILITY, naming getByRole as
the way to find the field, and the docs say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(desktop): let desktop({ maxDepth }) set how deep a read goes

A read cut short at the fixed 24-level depth makes every locator on that
window read again until its timeout, since a match could sit below it. An
app nested deeper could not be tested with locators at all. maxDepth, from
1 to 255 (agent-desktop's limit), defaults to 24 and raises it; the partial
read error names the option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): accept the verified cache copy a run published mid-repair, and keep a launch record when its process lookup fails

A run that finds no cache entry publishes without the lock, so it can fill the gap a locked repair makes between its two renames; the repair then failed with ENOTEMPTY although the cache held a verified release. The repair now accepts a usable copy there.

A failed process listing was read as an empty one, so the stale-worker sweep deleted the record that names the app a killed worker left running. The listing now reports failure apart from none found: the sweep keeps the owner and launch records (removing only the cached field text beside them), and an attempt's quit keeps its pending launch and retries.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(desktop): publish the agent-desktop cache without a lock, keeping a verified winner

The fast path renamed a fresh unpack into place without the lock that the
repair of a damaged entry held. A run that published while a repair had
moved the damaged entry aside made the repair's own rename fail with
ENOTEMPTY, though the cache now held a checked release (seen on the Node
22.22.3 and Node 26 CI jobs). The lock's stale-owner takeover could also
remove a lock another waiter had just taken.

Every run publishes a copy of the same checked release, so the lock is
gone: a rename that collides with an entry accepts it once it is checked,
a damaged entry is moved aside by one rename that only one run wins, and a
whole copy moved aside by a run that saw the entry damaged earlier goes
back. Two tests hold one run at each of those points while another installs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop): show a whole cache entry without the right stamp is downloaded again

The stamp test's entry had no executable or macOS helper, so it was
downloaded again even with the stamp check removed. The entry now has
both, and a missing stamp and one for another release each force a
download.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): take a launched process as the engine's own only by its launch token

When no environment could be read, a launch took the one new copy of the
app as its own, and a cleanup after an uncertain launch could quit it.
Being new does not show this launch started it: a copy the developer
opened at the same moment is new too, and was killed in a scripted probe.

A copy is now claimed only when it carries the launch token. agent-desktop's
launch, which reports the process it started, still stands for an app
launched by bundleId. An appPath to a bundle whose environment macOS hides
(an Apple platform app, a build signed with the restrict flag) is refused
by init and doctor, which name the bundleId to use instead, so open never
starts a copy the engine could not find again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): keep a launch record until cleanup confirms its process is gone

A process lookup that failed read as an empty list: the sweep then
deleted a killed worker's launch record, and the next sweep left the app
running though the lookup worked again. The record held only the token,
so a process the worker had identified, whose environment cannot be read,
could not be found by a later run. A dispose whose quit failed kept the
whole state directory, with the text agent-desktop keeps of the fields.

A failed lookup is now no answer: the pending quit fails and keeps the
launch, and the sweep keeps the record. A kill waits for the process to
exit before the record goes. Once a process is shown to be the launch's,
the record also names its id and start time, so a later run quits it
without reading its environment, and never a later process given that id.
Dispose and the sweep keep only the owner file and the record, and remove
the field text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): never bring a background app forward to ask it for a window

An app launched in the background that showed no window for 2 s was
brought forward with a second open by path, bundle id, or name. That open
did not name the process the engine launched, so LaunchServices could
bring another copy forward, and it took the keyboard the guide promised
to leave alone.

The background launch now stays in the background. An app that opens no
window there fails the open with a message that it needs
desktop({ headed: true }), whose launch brings the app it starts forward.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): send a key only to the launched process's window, never by app name

agent-desktop refuses a key for a named window that is not active, which
an app in the background never is. The engine then sent the key by the
app's name once a list of the apps showed its copy alone, even a list
agent-desktop marked incomplete. The name does not pin the process, so a
copy that started between the list and the key could get it.

The fallback is gone: a refused key fails as NOT_ACTIONABLE, and nothing
is sent. Since a key then reaches an app in the background only by chance,
press joins the actions only headed offers, so a locator press without
headed fails as unsupported before it moves focus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): never retry a press whose focus already moved

A locator press focuses the control, reads its window to check the
control kept focus, then sends the key. A stale read after the focus was
retryable, so the locator ran the whole press again and focused the
control a second time, which an app's focus handler sees. A retryable
failure after the focus is now ACTION_MAY_HAVE_COMMITTED; one before it
stays retryable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop): show a select that may have reached the app stays possibly committed

Removing the delivery check from the select's ELEMENT_NOT_FOUND mapping
left every select test green. A select whose failure agent-desktop marks
delivered_unverified must stay ACTION_MAY_HAVE_COMMITTED, not "no option".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 14:34:19 +00:00
Donny/강동윤andClaude Sonnet 5.5 d88aa99e0f docs: add a Next.js guide page (#1952)
* docs: add a Next.js guide page

One page takes a Next.js developer from `e2e init` to CI: `next dev`
locally and `next start` on the build in CI from one config, the port,
`reuseExisting`, and the Next.js problems (`allowedDevOrigins` on
127.0.0.1, the route announcer that `getByRole('alert')` also matches, a
webpack watcher that reads `.e2e/`), plus the `create-next-app` starter
and the Vercel template. The hydration accordion moves here from web.mdx;
web, cache, and example-projects link to the page, with ja and zh
translations, and the e2e skill's setup reference carries the same
guidance.

Refs ENG-1378

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: move the Next.js page into a Frameworks group

Next.js is not a platform like web, mobile, or desktop, so the page moves
to docs/frameworks/nextjs.mdx under a new Frameworks navigation group. The
web page no longer points at it from the app URL paragraph.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:14:53 +00:00
9602daa960 feat(notte): add @e2e-dev/notte, a browser provider for Notte cloud browsers (#1726)
* feat(notte): add @e2e-dev/notte, a browser provider for Notte cloud browsers

notte() runs each test attempt in its own Notte cloud browser session and
stops it when the attempt ends. It leases in attempt scope only: a Notte
session refuses Target.createBrowserContext, which worker scope needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(notte): downloads, sweep, and console links, verified on the testbed

- downloads.read copies each download from the session's file storage,
  found by the site's suggested name. @e2e-dev/web now passes that name to
  providers as BrowserDownloadContext.suggestedFilename (optional,
  additive).
- sweep stops the sessions of workers that died, found through per-session
  marker files under the system temp directory, since Notte sessions have
  no tags.
- The progress line links the session's console page instead of the
  token-bearing viewer URL.
- A start response without cdp_url falls back to the session's debug info.
- apps/testbed gets e2e.notte.config.ts and test:notte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(notte): address review: fail-closed ledger, required suggestedFilename, paged downloads, shared sweep helper

* docs(notte): add notte() to the security table and skill setup

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-11-17 19:38:50 +00:00
Kayaan TharaniandOskar Kwaśniewski f659d64d80 feat(revyl): add @e2e-dev/revyl for mobile tests on Revyl devices (#1708)
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-11-17 20:55:14 +02:00
Donough Liu 29a0261775 feat(moli): add managed local browser provider (#1843)
Manage local Moli CDP browsers through the web engine's BrowserProvider API.
Each worker gets an available loopback port, layout and resource loading,
startup cancellation, and process cleanup when its lease ends.

Wire the testbed, documentation, consumer skill, build and test commands,
and a patch changeset for @e2e-dev/moli.

Keep process-group shutdown active after an executable wrapper exits,
and surface process-inspection failures in the provider tests.

Verified locally:
- pnpm check
- 16 Moli provider unit tests
- Testbed on two workers: 16 passed, 1 expected skip; both browsers released
- Empty and whitespace CDP URLs use managed browsers; padded URLs attach
  without stopping the existing server
- MCP login, secret fill, assertions, and screenshot
- Packed packages installed, typechecked, and run in an isolated project
2026-11-17 07:03:27 +00:00
Kacper Kapuściak eb7445469e docs(ci): rename the Vercel page to Vercel Previews (#1847)
* docs(ci): rename the Vercel page to Vercel previews

* docs(ci): move the Vercel previews page to /ci/vercel-previews

* docs(ci): capitalize Vercel Previews

* docs(ci): drop the redirect, the page is not shipped
2026-11-16 15:39:05 +00:00
Kacper Kapuściak cdd10b8602 docs(ci): test Vercel deployments before production promotion (#1844) 2026-11-16 15:11:49 +00:00
dbe3dc54a9 feat(core): add launch, SessionState, and createAgent to @e2e-dev/core (#1734)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-11-16 09:38:07 +01:00
Brendan Irvine-BroqueandOskar Kwaśniewski 352b774b33 feat(browser-run): add Cloudflare hosted browsers (#1634)
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-11-13 08:46:31 +00:00
Oskar Kwaśniewskiandcubic-dev-ai[bot] f0b9fb378e docs: add community packages page (#1718)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-11-12 17:19:05 +00:00
Tomas Varga ae5d121514 feat(e2b): run Android and web targets in E2B sandboxes (#1598) 2026-11-09 19:08:27 +01:00
Kacper Kapuściak f9109d7f9d docs(ci): add a GitLab CI/CD page (#1643)
* docs(ci): add a GitLab CI/CD page

* docs(ci): pin the CI device, bound the emulator boot, and note GitLab masking rules

* docs(ci): add the GitLab job to an existing pipeline, set the key with glab

* docs(ci): note --pass-with-no-tests for GitLab shards

* docs(ci): give each GitLab Android job its own emulator port, list the JDK
2026-11-09 12:17:55 +00:00
Oskar Kwaśniewski 5f46d20aa9 docs(migrate): add an Appium migration guide (#1597) 2026-11-07 12:43:39 +01:00
Kacper Kapuściak b956f9f207 docs: explain when to use agentic or deterministic tests (#1583)
* docs: explain agentic and deterministic testing

* docs: refine agentic and deterministic testing guidance

* docs: clarify when to use agentic and deterministic tests

* docs: cover agentic assertions alongside actions

* improveoments

* docs: drop the sidebar icon from the agentic page

* docs: mention monitoring with real data

* docs: clarify what agent assertions check

* docs: clarify the agentic assertions heading

* docs: point agentic monitoring at test accounts and locator checks
2026-11-06 09:01:45 +00:00
Nathan Walker 65ebc7d47b docs(mobile): NativeScript test ids and a Norrix CI page (#1567) 2026-11-05 11:58:25 +01:00
Oskar Kwaśniewski 0c0469605a chore: replace e2e.tester.army with e2e.com (#1572) 2026-11-05 09:23:45 +01:00
Oskar Kwaśniewski 3f43edd166 feat(engine): engine protocol for out-of-process engines (#1232)
* feat(engine): engine protocol for out-of-process engines

The engine contract as LSP-style JSON-RPC: connectEngine turns a server
into an engine handle, serveEngine serves any defineEngine handle, and
spawn, socket, and loopback transports reach it. Abort reasons, errors,
and pixels cross intact; the manifest has a JSON schema for servers in
other languages. E2E_ENGINE_LOOPBACK=1 runs every engine through the
protocol in process; the testbed runs that way in CI.

* feat(engine): run every in-process engine over the protocol, drop E2E_ENGINE_LOOPBACK

* refactor(engine): drive engine protocol from one method table

- one METHODS table feeds describeEngine, server and client
- client builds the engine from the manifest, defineEngine validates it
- harness holds only protocol clients (EngineClientHandle)
- signals scoped to attempts, drop $/release
- worker connections queue for MCP session handover
- track attempts for servers without startAttempt
- locate/stopVideo return arrays, keyboard/type takes options

* feat(engine): let connectEngine answer session hooks on the client

Host-side relaunch (simctl) without wrapping the client in defineEngine,
which made the harness serve it over loopback a second time.

* docs(engine): group engine docs into one Engines section

New Engines overview and Engine servers guide; the protocol reference
keeps signatures, messages and errors.

* docs(engine): complete config examples, drop leftover OG card

* fix(engine): harden protocol from review

- bound finish/dispose hooks by their budget, always close transport
- late endAttempt retires only its own attempt (client and server)
- reject malformed error responses instead of throwing from stream
- resolve a secret once; server derives redacted forms via attempt/deriveSecret
- carry error stack, errno, and causes across the wire
- serveEngine always answers startAttempt/endAttempt, so signals are freed without hooks
- detach signal listeners when a connection closes
- refuse a server speaking another protocol version
- docs: platform in connectEngine examples, message and error updates

* fix(engine): fixed diagnostic for malformed error response
2026-10-31 10:28:53 +01:00
Oskar Kwaśniewski 0e02aba0a7 docs(acp): move coding agent docs under subscriptions (#1488) 2026-10-30 20:46:06 +01:00
Manuel LopezandOskar Kwaśniewski 64432f1089 feat(browserstack): add @e2e-dev/browserstack device provider (#1307)
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-10-30 13:58:48 +01:00
Krzysztof Moch b81b7d7599 docs(migrate): add a TesterArmy migration guide (#1411) 2026-10-30 12:38:59 +01:00
Kacper Kapuściak d30114a1ca docs: move the page objects page to /page-object-model (#1444) 2026-10-29 11:15:27 +00:00
Kacper Kapuściak 8537abc7db docs(migrate): add an overview page for the migration guides (#1441)
* docs(migrate): add an overview page for the migration guides

* docs(migrate): apply review fixes to the overview page

* docs(migrate): note JavaScript tests on the overview page
2026-10-29 08:27:06 +00:00
ffed34e94b feat(acp): run agent steps on your own coding agent over ACP (#960)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
Co-authored-by: Krzysztof Moch <krzysmoch.programs@gmail.com>
2026-10-28 20:32:09 -07:00
Kacper Kapuściak 6fa99ea505 docs: add a self-healing tests deep dive (#1430)
* docs: add a self-healing tests deep dive

* docs: qualify when a healed step is saved
2026-10-28 14:31:35 +00:00
Kacper Kapuściak 1a7a331b41 chore(docs): remove unused Mintlify tooling (#1408) 2026-10-27 08:57:58 +00:00
Kacper Kapuściak bc763b188e docs: add a Writing fixtures guide (#1341)
* docs: add a Writing fixtures guide

* docs: list Writing fixtures after Project tools and fold its long example

* docs: show fixtures creating test data and leave sign-in to saved sessions

* docs: create fixture data with agent.act instead of a test API

* docs: cut the Writing fixtures page to the essentials

* docs: import expect from e2e in the fixtures example
2026-10-23 17:33:06 +00:00
Oskar Kwaśniewski da13624d31 feat(runner): run only the tests a pull request can affect (#1206) 2026-10-23 12:29:15 -05:00
Kacper Kapuściak 9a519c13dd docs: add a page objects page (#1340)
* docs: add a page objects page

* docs: reword the page objects intro

* docs: keep the page objects intro generic
2026-10-23 16:58:40 +00:00
Oskar Kwaśniewski 24fc856de6 docs(testmu): merge the device and browser pages into one (#1330) 2026-10-22 08:46:30 -04:00
92f8cb07bf feat(testmu): hosted Chrome and Edge for the web engine with testmuBrowsers() (#1200)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: SahilSawLT <sahilsaw@lambdatest.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-10-21 08:57:19 -04:00
Kacper Kapuściak d7c6b5e5a4 docs(ci): move the CI guide to Get started as Setting up CI (#1290)
* docs(ci): move the CI guide to Get started as Setting up CI

* docs(ci): keep Continuous integration as the title, Setting up CI in the sidebar

* docs(quickstart): keep the code-branch icon on the CI card
2026-10-20 18:48:24 +00:00
Kacper Kapuściak 71bbb23e85 docs: move the MCP server guide off Mintlify's reserved /mcp path (#1278)
Mintlify hosts its own MCP server at <docs url>/mcp, and that endpoint
wins over a page with the same slug, so /docs/mcp served JSON instead of
the guide. Rename the page to mcp-server and point every link at it.
2026-10-20 09:13:25 +00:00
88ed71768a feat(testmu): add @e2e-dev/testmu device provider (#772)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Anurag Sharma <38938168+anurag-lambdatest@users.noreply.github.com>
Co-authored-by: SahilSawLT <sahilsaw@lambdatest.com>
2026-10-16 12:31:13 +02:00
Oskar Kwaśniewski b41afa262e feat(lightpanda): add @e2e-dev/lightpanda, a browser provider for the Lightpanda headless browser (#1163) 2026-10-15 21:42:22 +02:00
Oskar Kwaśniewski 6b068e6c08 docs: add MCP server guide page (#1185) 2026-10-15 20:41:28 +02:00
Mehmet Enes c807f94806 feat(limrun): add hosted device provider and app-flow example (#988) 2026-10-12 08:32:51 +00:00
Kacper Kapuściak 3f2f8fdecf docs: credit TesterArmy beside Mintlify in the footer (#1007)
The footer reads "Built by TesterArmy | Powered by Mintlify" on one line,
GitHub alone on the left; on a phone the Mintlify credit takes a second,
right-aligned line. Mintlify's footer takes no markup, so the credit is a
website social restyled in style.css with the brand kit's mark and wordmark
(images/footer/). Each image is two url() layers, one path for mint dev
and one for production's /docs prefix, since Mintlify inlines the
stylesheet into the page.
2026-10-09 13:23:17 +00:00
Kacper Kapuściak 521988496e docs(security): split the security page into a short guide and a rules reference (#1008)
The guide answers what most readers ask: how secrets stay out of the model,
what can still leak, and what runs with your permissions. Every rule moves to
docs/reference/security.mdx. smol host-loopback access moves to the smol
page's warning. Fixes facts that no longer matched src/: defineTool errors are
INVALID_CONFIG, the CI cache default skips a cache.store, start-screen replay
matches routes, and outbound connections now list login, models, init, and the
smol image pull.
2026-10-09 13:13:28 +00:00
Kacper Kapuściak c994aa6fbb docs: move Caching to the top of Features (#1003) 2026-10-09 11:22:44 +00:00
BinBin He 06bb72653f feat(smol): @e2e-dev/smol, browsers and the app under test in branchable smol machines microVMs (#956) 2026-10-08 23:09:51 +02:00
Kacper Kapuściak 9a32bd4d46 docs: group cross-target pages under Features (#990) 2026-10-08 22:09:32 +02:00
Oskar Kwaśniewski 5137778251 feat(expect): toHaveScreenshot visual comparison on web, iOS, and Android (#977) 2026-10-08 19:17:12 +02:00
Matt Van HornandOskar Kwaśniewski 2f60b547f4 feat(runner): expose list() on the e2e/runner subpath (#978)
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-10-08 16:01:30 +02:00
Kacper Kapuściak 00c6bba4e7 docs(ci): give each CI service its own sidebar page (#964) 2026-10-07 20:01:56 +02:00
Kacper Kapuściak 63482bd6fe docs: reorganize the sidebar into platforms and a deep dive (#870) 2026-10-05 20:39:06 +02:00
Kacper Kapuściak 357f844970 docs: drop the redundant Example projects nav group (#861) 2026-10-05 15:09:49 +02:00
Kacper Kapuściak 7149587674 docs: link standalone examples from technology cards (#853) 2026-10-05 13:22:44 +02:00
Gustavo CostaandOskar Kwaśniewski d1f2089081 feat(decision): act and assert through an AI SDK decision model (#775)
* feat(decision): add Clef and Jev executors on the System One choice API

* feat(decision): default Clef transport to clef-flash

* feat(decision): generalize to decision models, address review

* fix(decision): reject non-string decision choices

* fix(decision): skip empty select labels and blank destinations

An empty option label or whitespace-only destination offered as a choice fails at dispatch with INVALID_ARGUMENT and aborts the step instead of letting the model re-aim. Omit them at enumeration. Also qualify the uncertain-action docs: blocking stops the selected action, while earlier confident actions in the step have already run.

* feat(decision): add opt-in vision for Clef, Jev stays text-only

The executor stays text-only by default. With vision true and a transport that declares it, masked viewport pixels ride along as System One images data URLs. Clef declares vision; Jev never receives pixels. Withheld or tainted viewports fall back to semantic text.

* docs(decision): qualify vision cost to calls carrying pixels

* fix(decision): untainted pixel fixtures and honest skill pixels line

The test helper takes a tainted flag so the image-send tests use the only state the runner returns pixels in; tainted captures stay withheld observations. The skill no longer claims pixels are unavailable: screenshots may inform node choices with vision true, without adding point actions.

* bench(testbed): luna vs clef-flash harness and first numbers

Same todo flow under two configs: default agent on gpt-6-luna via OpenCodeX and decisionExecutor on clef-flash. Luna side passed in 23s with 6 model calls; clef-flash pending credentials. Includes the probe script, the docs section, and the flow screenshot.

* docs(decision): fill clef-flash benchmark row

Two no-cache runs both blocked uncertain on the first action (a25 at p=0.619, conf=0.387 against the default 0.9 gates), answering in about a second with 1,543 input tokens.

* docs(decision): benchmark aggregates over 5 runs per side

Luna completed 5/5 flows at ~14s and ~25k input tokens per run; clef-flash blocked uncertain 5/5 at ~1s and ~1.5k tokens per run.

* bench(testbed): parametrized flow, gate sweep, wire-shape finding

Params fix the missing type choices; gates 0.6/0.5 and 0.51/0.3 still block. Direct experiment shows hierarchical structured questions take clef-flash from 0.57 to 0.89 confidence on the same screen.

* feat(decision): hierarchical operation-then-target on structured transports

Structured transports (Clef, Jev) now decide the operation first and the target within it, with object instructions and element records. Flat endpoints keep the single string choice. Live benchmark: first operation 0.909/0.802, first target 0.940/0.775, up from 0.747/0.558 flat.

* docs(decision): compare luna vs clef-flash vs clef with measured cost

* feat(decision): run decisions through AI SDK evaluate, gates opt-in

decisionExecutor now accepts any AI SDK evaluation model that answers
choice questions, such as typeSafeAi.evaluationModel('jev-latest'), and
decides through experimental_evaluate (one choice question per decision,
no retries, so the call budget stays exact). ai is an optional peer that
loads only on that path. evaluationModel() exposes clef(), jev(), and
systemOne() transports to experimental_evaluate, which covers Clef until
it has an AI SDK provider.

The official TypeSafe provider rounds probabilities to two places, so a
long distribution can sum to 0.99: validation now allows half a unit per
rounded option, the AI SDK rule, and jev() declares the two places.

Probability and confidence gates are off by default and stay
configurable. Measuring clef-flash without them surfaced three executor
bugs, each fixed here:
- a lone target is dispatched without a one-option question, which the
  choice API rejects with HTTP 422;
- acting decisions receive the step's action history, and the repeat
  guard counts the same action on the same screen across the whole step,
  so an A-B oscillation blocks instead of burning the call budget;
- the operation and target questions state that typed text is not saved
  until it is submitted.
The structured path also checks the call budget before the target
request (review feedback).

Testbed todo flow, 5 no-cache runs each: clef-flash 5/5 (9.3s mean, 12
calls), clef 5/5 (11.5s, 12 calls), luna unchanged at 5/5 (14.9s).

* bench(testbed): Laya through systemOne

Laya serves the System One API and accepts structured values, so it runs
through systemOne({ structured: true }) unchanged. On the todo flow its
first operation question chose unsupported at 0.29 / 0.10 on four runs,
answered by the multilingual checkpoint its router picked for an English
prompt; the fifth run and further probes hit insufficient_credits.

* fix(decision): address review on rounding, history, and evaluation ids

- validateDecision accepts a rounded distribution only when 1 lies between
  the sums of each value's rounding interval, clipped to [0, 1]; a summed
  per-option tolerance exceeded 1 with many options and admitted two
  options at probability 1.
- Decisions send the 20 most recent history entries, each clipped to 240
  characters, so long steps and large params stay within request limits.
- evaluationModel() builds its answer, confidence, and criteria maps with
  null prototypes, so an id such as __proto__ stays an own entry.
- @ai-sdk/provider moves to dependencies: the public declarations import
  its evaluation types. ai stays an optional peer.

* bench(testbed): pin Laya's English checkpoint

Laya's router sent the full English prompt to its multilingual checkpoint.
The API accepts model 'english' to pin the English one (its routing
metadata reports the explicit model), so the bench config sends it.

* docs(decision): benchmark Laya locally on M1, both checkpoints 0/5

* docs(decision): reconcile laya narrative with run evidence, money not tokens

* feat(decision): caller-overridable transport flags on clef() and jev()

* feat(decision): AI SDK evaluate executor with element table and text model

* fix(decision): empty-tree check and provider pin

* fix(decision): address review on secrets, options, errors, and docs

Answers the cubic threads on the evaluate-only executor: terminal checks reject an incomplete screen instead of judging it, secret markers are stripped at any depth, hidden/disabled options are never offered, select options share the 255-choice cap, select criteria name the option, out-of-range probabilities fail, text-model errors mirror the decision mapping, and the README/docs describe the evaluate-only API.

* fix(decision): count dropped select options and fix README

Counts enabled options inside rows dropped past the element cap as omitted, adds the E2EConfig type import to the README example, and qualifies when type is offered.

* fix(decision): settle terminal claims by the check and match codebase style

The second rejected done/failed claim now ends by the check verdict (fails -> ACTION_FAILED, anything else -> blocked), and the completion check honors the gates. The decision state carries the last 10 actions, check targets show their checked state, checked radios are never toggled, and options dropped by the per-question cap stay out of omitted. The docs example opens /todos in test code since navigate is not offered. Single quotes, template literals, and split long lines across the package.

* fix(decision): show filled fields to verdicts and pin the history window

Verdict views (assert and the completion check) build the element table with typing enabled, so a field the step filled keeps its row and value even when the step itself cannot type. The history test now asserts the window holds the newest ten actions.

* fix(decision): let completion checks see results and name the text key

Page text keeps a named node's text when it differs from the name, as formatNode does, so a status named Greeting that says Welcome back, admin! reaches the verdict. The completion check now asks whether the task is complete and sees the non-secret params and the actions with their typed values; rejected claims stay out. The text prompt names the single text key, asks for no code fence, and prefixes the request so JSON-object response modes accept it.

* fix(decision): keep secret handles out of replayed history and mark check inputs as data

Replayed summaries name a filled secret handle; seeding the history now replaces declared secret names with <secret>, so names reach the model only as secret question criteria. The completion check treats action descriptions, typed values, and params as data, and the guide says the check sees only non-secret values.

* fix(decision): redact only the handle in replayed secret-fill summaries

Matching the declared secret name anywhere in a replayed summary also erased labels and values equal to it, and missed handles the runner cut at 40 characters. Only the quoted handle after fill secret at the start of the summary becomes <secret> now.

* docs(decision): describe the one-request fan-out in the guide intro

* fix(decision): count a scroll that changes what is in view as progress

The fingerprint behind the stall guard hashed node content but not position, so a scroll that only moved the viewport read as page unchanged and the third one blocked the step. It now also hashes whether each node meets the viewport (membership, not coordinates), so a scroll that brings other nodes into view resets the count while one that moves nothing, as at the page bottom, still trips the guard.

* chore: prune @pnpm/exe from the lockfile after merging main

* fix(decision): match the supported Node range in engines

---------

Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-10-04 10:08:55 +02:00
Kacper Kapuściak 37497dc750 docs: split Writing tests into Goals, Assertions, and Locators pages (#780) 2026-10-03 11:02:56 +02:00
Oskar Kwaśniewski 9d61e2130f docs(mobile): document physical devices (#768)
* docs(mobile): document physical devices

Closes #766

* docs(mobile): phone requirements in setup and README

* docs(mobile): move physical devices to its own page
2026-10-02 19:43:00 +02:00