Closed feature request

Screenshot replies: prefer ab's fullPath/safePath contract over base64/filePath (auto-pull without the relay payload)

John Lauer · 1mo ago ·closed by John Lauer

From the #212 audit (ab 2.1.150, crr/arav-rog, 2026-09-22). nb's contract is in good shape for what ab now relies on: bridge.json verbs (87) match nbrowser_describe (87), the timeouts block is declared (default 60, screenshot/record prefixes 120) and statusVerb: nbrowser_status is there. Nothing else is needed. One small thing:

Screenshot reply shape. nbrowser_describe declares nbrowser_screenshot -> {base64, filePath?, ok} and nbrowser_screenshot_full_res -> {base64, ok}. ab's delivery contract is fullPath (+ optional safePath): a reply carrying those is auto-pulled to the CALLER's machine with localPath/localSafePath added, which is how an AI in a container reads the image without a second call. filePath does not trigger it.

The base64 path does work — ab's CLI saves any reply's base64 PNG to the caller's screenshot cache (generic since 2.1.146, resized to ≤1500 px unless the verb name ends _full_res) — so nb is better off than pup here. But sending a big base64 through the relay for every capture is the expensive way to do it; fullPath + safePath (kicad_screenshot_all is the reference) gets the same result with a streamed pull.

Also noted, not a complaint: nbrowser_screenshot with no session/tab refuses with a clear no_target explanation rather than grabbing whatever is in front of the user. That is exactly the right behaviour.

1 Reply

John Lauer · 1mo ago

Done in nb 0.16.31 (insiders). No nb verb sends a page image as base64 through the relay any more.

What changed

  • nbrowser_screenshot and nbrowser_screenshot_full_res write the PNG on the desktop and reply with fullPath (+ fullWidth/fullHeight/fullBytes). When the image is wider than 1568 px, a safePath copy at 1568 px comes too (safeWidth/safeHeight/resizeMax). nbrowser_screenshot is already 1568 px wide, so it carries no separate copy.
  • nbrowser_state {screenshot:true} and nbrowser_demo deliver their capture the same way.
  • The delivery keys are promoted to the top level of the reply, beside output. My first cut left them inside output, and ab did not pull them. Promoted, ab pulls both and adds localFullPath / localSafePath / savedTo.
  • Files are named nbrowser-<n>-<epoch ms>.png. ab takes the last number as the capture time, and my first name gave the local copies a 1970 date.
  • inline:true returns the old base64 reply for a caller that really wants it. toFile:"C:/abs/path.png" still chooses where the desktop copy is written.
  • The describe schemas, verb hints, driving skill, README and the nb dashboard all use the file contract now.

Verified on AdomLapper (ab 2.1.150 CLI)

  • nbrowser_screenshot: 1568 px fullPath, pulled to the container.
  • nbrowser_screenshot_full_res: a 2510 px fullPath plus a 1568 px safePath, both pulled. I opened the safe copy and it is the right page.
  • Full verb battery 85/85. The screenshot, full-res, state and demo checks now fail if a reply carries base64 or lacks fullPath.

Thanks also for the note on no_target. That refusal stays.

John Lauer closed this · 1mo ago

Log in to reply.