MCPcopy Index your code
hub / github.com/callstack/agent-device / createClientScreenshotBackend

Function createClientScreenshotBackend

src/cli/commands/screenshot.ts:89–111  ·  view source on GitHub ↗
(
  client: AgentDeviceClient,
  flags: CliFlags,
)

Source from the content-addressed store, hash-verified

87};
88
89function createClientScreenshotBackend(
90 client: AgentDeviceClient,
91 flags: CliFlags,
92): AgentDeviceBackend {
93 return {
94 platform: resolveClientBackendPlatform(flags),
95 captureScreenshot: async (context, outPath, options) => {
96 const result = await client.capture.screenshot({
97 path: outPath,
98 session: context.session,
99 overlayRefs: options?.overlayRefs,
100 fullscreen: options?.fullscreen,
101 normalizeStatusBar: options?.normalizeStatusBar,
102 stabilize: options?.stabilize,
103 surface: options?.surface,
104 });
105 return {
106 path: result.path,
107 ...(result.overlayRefs ? { overlayRefs: result.overlayRefs } : {}),
108 };
109 },
110 };
111}
112
113function resolveClientBackendPlatform(flags: CliFlags): AgentDeviceBackend['platform'] {
114 switch (flags.platform) {

Callers 1

diffCommandFunction · 0.85

Calls 2

screenshotMethod · 0.45

Tested by

no test coverage detected