* 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
})
| 471 | * packages/desktop/computer-use-mcp/COORDINATES.md. |
| 472 | */ |
| 473 | async screenshot(opts: { |
| 474 | allowedBundleIds: string[] |
| 475 | displayId?: number |
| 476 | }): Promise<ScreenshotResult> { |
| 477 | const d = cu.display.getSize(opts.displayId) |
| 478 | const [targetW, targetH] = computeTargetDims( |
| 479 | d.width, |
| 480 | d.height, |
| 481 | d.scaleFactor, |
| 482 | ) |
| 483 | return drainRunLoop(() => |
| 484 | cu.screenshot.captureExcluding( |
| 485 | withoutTerminal(opts.allowedBundleIds), |
| 486 | SCREENSHOT_JPEG_QUALITY, |
| 487 | targetW, |
| 488 | targetH, |
| 489 | opts.displayId, |
| 490 | ), |
| 491 | ) |
| 492 | }, |
| 493 | |
| 494 | async zoom( |
| 495 | regionLogical: { x: number; y: number; w: number; h: number }, |
nothing calls this directly
no test coverage detected