Files
bb034f384c fix(cli): reject unmet preconditions in upload, har stop, diff snapshot and diff url (#2689)
* fix(cli): reject unmet preconditions in upload, har stop, diff snapshot and diff url

upload resolves relative paths in the CLI against its own cwd, fails with file_not_found for a missing file (warns for provider browsers) and with not_file_input for other targets.
network har stop fails with no_har_recording when no recording is active, e.g. after a browser restart.
diff snapshot without --baseline compares against the last snapshot of the page session, or fails with no_baseline.
diff url returns the snapshot diff the renderer reads, honours --screenshot, --full, --selector, --compact and --depth.

Co-Authored-By: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com>
Co-Authored-By: Mohammad-Maraqa <154911866+Mohammad-Maraqa@users.noreply.github.com>
Co-Authored-By: cavalcanticampos <64264987+cavalcanticampos@users.noreply.github.com>
Co-Authored-By: hyunjinee <63354527+hyunjinee@users.noreply.github.com>

* docs: describe upload paths, har stop and diff snapshot preconditions

* docs: record upload and diff snapshot prose edits in the docs baseline

* fix(cli): keep the diff snapshot baseline's options, pass directories to upload, warn for remote browsers

A bare diff snapshot captures with the options and frame of the last snapshot; an option that differs fails with baseline_mismatch. diff snapshot accepts -i and -u.
upload accepts directories (webkitdirectory), expands ~, and only warns when the browser is on another machine (provider or non-loopback --cdp).
diff snapshot --baseline resolves against the CLI cwd and fails with file_not_found when the file is missing.
diff url --full without --screenshot is rejected.
Messages and docs name the daemon restart as what discards a HAR recording, and MCP tool descriptions are regenerated.

* fix(upload): record the attached target for every session connection

A session whose settings carry --cdp, auto-connect or a provider attached without recording the target, so upload treated a remote browser as local and rejected paths missing on this host. The target is now derived from the connection after every settings-driven launch. Also: diff snapshot baseline_mismatch names both the requested and the last snapshot values, the MCP diff_snapshot tool accepts urls, the directory upload test waits for the input to be populated, and docs say the implicit baseline is per tab.

* fix(cli): keep the diff snapshot baseline per tab and box the launch future

The implicit baseline of diff snapshot is kept per tab and dropped when the tab closes, so a snapshot on one tab no longer discards another's. The launch wrapper boxes the inner launch future so it stays out of the caller's future size.

* fix(security): keep page text out of upload errors and inside content boundaries

not_file_input names the node only through a fixed tag list and input type list. Snapshot diff output, including diff url, goes through the same boundary and truncation path as other page content.

* test(cli): compare resolved paths without assuming forward slashes

std::path::absolute emits backslashes on Windows, so expected paths are built with Path::join and the HAR test checks the file name.

---------

Co-authored-by: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com>
Co-authored-by: Mohammad-Maraqa <154911866+Mohammad-Maraqa@users.noreply.github.com>
Co-authored-by: cavalcanticampos <64264987+cavalcanticampos@users.noreply.github.com>
Co-authored-by: hyunjinee <63354527+hyunjinee@users.noreply.github.com>
2026-11-21 04:59:02 -03:00
..
2026-11-12 15:37:54 -06:00
2026-11-12 15:37:54 -06:00
2026-11-12 15:37:54 -06:00
2026-11-12 15:37:54 -06:00