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

Function resolveLinuxSurface

src/platforms/linux/snapshot.ts:12–23  ·  view source on GitHub ↗

* Map the session-level surface to an AT-SPI2 surface. * Linux supports 'desktop' and 'frontmost-app'. The 'app' surface * (used for in-app XCTest sessions) is treated as 'frontmost-app' on Linux. * The 'menubar' surface is not yet supported; it falls back to 'desktop'.

(surface: SessionSurface | undefined)

Source from the content-addressed store, hash-verified

10 * The 'menubar' surface is not yet supported; it falls back to 'desktop'.
11 */
12function resolveLinuxSurface(surface: SessionSurface | undefined): SnapshotSurface {
13 if (surface === 'desktop') return 'desktop';
14 if (surface === 'frontmost-app' || surface === 'app') return 'frontmost-app';
15 if (surface === 'menubar') {
16 emitDiagnostic({
17 level: 'warn',
18 phase: 'linux_snapshot',
19 data: { message: 'menubar surface is not supported on Linux, falling back to desktop' },
20 });
21 }
22 return 'desktop';
23}
24
25export async function snapshotLinux(surface: SessionSurface | undefined): Promise<{
26 nodes: RawSnapshotNode[];

Callers 1

snapshotLinuxFunction · 0.85

Calls 1

emitDiagnosticFunction · 0.90

Tested by

no test coverage detected