MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / screenshot

Function screenshot

src/utils/computerUse/executor.ts:473–492  ·  view source on GitHub ↗

* 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
    })

Source from the content-addressed store, hash-verified

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 },

Callers

nothing calls this directly

Calls 5

computeTargetDimsFunction · 0.85
drainRunLoopFunction · 0.85
withoutTerminalFunction · 0.85
getSizeMethod · 0.65
captureExcludingMethod · 0.65

Tested by

no test coverage detected