Computer use for the Pi coding agent — Windows apps, browsers and desktops through native UI trees, screenshots and real input.
TypeScript accessibilityagent-toolsai-agentbrowser-automationcomputer-usecuadesktop-automationelectronpipi-coding-agentpi-extensionpi-packageplaywrighttypescriptui-automationvisionwebview2windowswindows-automationwsl
Docs: browser screenshots without a visible flash (LPT-968)
alexshpunt-clanker[bot]9c6ce31084c5
diff --git a/docs/computer-resources.md b/docs/computer-resources.mdindex 1fa2b9b..e157e86 100644--- a/docs/computer-resources.md+++ b/docs/computer-resources.md@@ -195,6 +195,12 @@ Web pages run through [Playwright](https://playwright.dev/). The browser windowEach page snapshot lists the tabs (`Tab t1 (active): title | url | load state`), `Event:` lines for opened or closed tabs and dialogs, `Download` lines and `Log` lines for console errors, page errors, failed requests and HTTP errors since the previous snapshot. Input, snapshots and screenshots use only the active tab; a popup never becomes active by itself, so use `computer_browser` `switch_tab`. A JavaScript dialog stays open until `computer_browser` `dialog` answers it, and other page actions refuse until then. Downloads land in the browser's temporary directory, which closing the session deletes; copy what you need. `evaluate` returns its result as JSON, cut at 20,000 characters; reaching the time limit is `unknown`. A Playwright timeout or lost connection is `unknown`; read a fresh snapshot.+### Screenshots without a flash++A visible Chromium window shrinks for a moment while Chrome takes a screenshot with a clip or scale of its own, so the human would see a flash on every element crop and every page action's pixel comparison. The browser worker therefore takes one plain viewport screenshot, which does not move the window, and the host derives the image from it: an element crop is cut from it at the element's pixels, and the page image used by the change list is scaled to one pixel per CSS pixel (exactly `innerWidth` x `innerHeight`). The image the agent gets and its coordinates stay the same; an element crop is the same size as Chrome's own, and its pixels match except for slight resampling at fractional device pixels.++The worker falls back to Chrome's own screenshot, which can flash, when the derived image would not be exact: an element that is not wholly inside the viewport (for example taller than the window), a pinch-zoomed page, or a page that scrolls or resizes during the capture. Firefox does not flash and takes the same path.+### Attach to a running browserIn YOLO, `computer_open` at a window address attaches Playwright to a Chromium-based browser that is already running. The window's processes decide the route: