fix(cli): report observe-web-session progress on stderr

MCP passes progress to observeWebSession, but the CLI did not, so a
caller of `rea observe-web-session` never saw the armed observation
window it must wait for before acting. Three CLI commands also each
wrote their own copy of the same stderr progress line.

One cliProgress module now owns the stderr progress line and reporter.
observe-web-session uses it, as do web runtime, JavaScript application
and desktop capture progress. The CDP session also stops reporting
readiness once collection is no longer active, so a stopped capture does
not invite the external action.

Fixes #8141
Supersedes #8149

Based on #8149; the desktop capture copy now shares the line writer too.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
wunianze666-netizenandgensokyo-dev authored and Ysopwnable committed 2026-11-14 14:16:39 +01:00
1 parent fee267759d
commit 3e95d22dd4
8 files changed
+294 -21

No files matched your search

+11
View File
@@ -320,6 +320,17 @@ rea discover-webmcp-tools http://127.0.0.1:9222 TARGET_ID \
--json
```
The `observe-web-session` CLI writes JSON progress lines to stderr, leaving
stdout for the final Evidence or failure. Wait for `rea_progress` with
`phase: "browser_observation"`, `completed: 1` and `total: 2` before performing
the external action. After the window ends successfully, `completed: 2` and
`terminal: true` report its end. Failed preparation does not announce arming;
a failed or cancelled observation does not fabricate a successful end event.
MCP exposes the same provider progress through its progress notifications.
If navigation leaves the selected scope, or the target detaches or terminates
during preparation, the ended window can be reported without an armed event.
Only the explicit armed event invites the caller to perform its action.
### WebMCP discovery prerequisites
`discover_webmcp_tools` reports only what the attached browser's experimental