( client: AgentDeviceClient, flags: CliFlags, )
| 87 | }; |
| 88 | |
| 89 | function 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 | |
| 113 | function resolveClientBackendPlatform(flags: CliFlags): AgentDeviceBackend['platform'] { |
| 114 | switch (flags.platform) { |
no test coverage detected