* Pre-size to `targetImageSize` output so the API transcoder's early-return * fires — no server-side resize, `scaleCoord` stays coherent. See * packages/desktop/computer-use-mcp/COORDINATES.md.
(opts: {
allowedBundleIds: string[]
displayId?: number
})
| 397 | * packages/desktop/computer-use-mcp/COORDINATES.md. |
| 398 | */ |
| 399 | async screenshot(opts: { |
| 400 | allowedBundleIds: string[] |
| 401 | displayId?: number |
| 402 | }): Promise<ScreenshotResult> { |
| 403 | const d = cu.display.getSize(opts.displayId) |
| 404 | const [targetW, targetH] = computeTargetDims( |
| 405 | d.width, |
| 406 | d.height, |
| 407 | d.scaleFactor, |
| 408 | ) |
| 409 | return drainRunLoop(() => |
| 410 | cu.screenshot.captureExcluding( |
| 411 | withoutTerminal(opts.allowedBundleIds), |
| 412 | SCREENSHOT_JPEG_QUALITY, |
| 413 | targetW, |
| 414 | targetH, |
| 415 | opts.displayId, |
| 416 | ), |
| 417 | ) |
| 418 | }, |
| 419 | |
| 420 | async zoom( |
| 421 | regionLogical: { x: number; y: number; w: number; h: number }, |
nothing calls this directly
no test coverage detected