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

Function screenshot

src/utils/computerUse/executor.ts:399–418  ·  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

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

Callers

nothing calls this directly

Calls 3

computeTargetDimsFunction · 0.85
drainRunLoopFunction · 0.85
withoutTerminalFunction · 0.85

Tested by

no test coverage detected