@expo/hub-client 1.12.0 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/screenshot.d.ts.map +1 -1
- package/dist/screenshot.mjs +29 -1
- package/dist/screenshot.mjs.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +1 -1
- package/src/screenshot.ts +43 -2
- package/src/types.ts +16 -0
package/README.md
CHANGED
|
@@ -380,9 +380,11 @@ client.setOrientation("landscape_left");
|
|
|
380
380
|
client.reload(); // reload the running React Native bundle
|
|
381
381
|
client.setAppearance("dark"); // 'light' | 'dark'; read it back from client.appearance
|
|
382
382
|
|
|
383
|
-
// { blob, artifact }, or null when capture fails. `artifact` is the session artifact
|
|
384
|
-
// { status: 'saved' } | { status: 'disabled' } | { status: 'failed', error?: string }
|
|
385
|
-
// (null for a backend that does not report one).
|
|
383
|
+
// { blob, artifact, metadata? }, or null when capture fails. `artifact` is the session artifact
|
|
384
|
+
// outcome: { status: 'saved' } | { status: 'disabled' } | { status: 'failed', error?: string }
|
|
385
|
+
// | null (null for a backend that does not report one). `metadata` is the capture's
|
|
386
|
+
// { width, height, displayRotation, screen? }; it is absent on older servers, and a zero width
|
|
387
|
+
// or height or a null displayRotation means unknown.
|
|
386
388
|
const capture = await client.screenshot();
|
|
387
389
|
if (capture?.artifact?.status === "failed")
|
|
388
390
|
console.warn("not saved to session artifacts", capture.artifact.error);
|
package/dist/screenshot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../src/screenshot.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../src/screenshot.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,iBAAiB,EAA2B,MAAM,SAAS,CAAC;AAEnG,KAAK,eAAe,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEhF,iJAAiJ;AACjJ,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EACtB,SAAS,GAAE,eAAuB,GACjC,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAgBnC"}
|
package/dist/screenshot.mjs
CHANGED
|
@@ -7,9 +7,13 @@ import { apiUrl } from "./android-api-url.mjs";
|
|
|
7
7
|
cache: "no-store"
|
|
8
8
|
});
|
|
9
9
|
if (!response.ok) return null;
|
|
10
|
+
const metadata = screenshotMetadata(response.headers);
|
|
10
11
|
return {
|
|
11
12
|
blob: await response.blob(),
|
|
12
|
-
artifact: screenshotArtifact(response.headers)
|
|
13
|
+
artifact: screenshotArtifact(response.headers),
|
|
14
|
+
...metadata ? {
|
|
15
|
+
metadata
|
|
16
|
+
} : {}
|
|
13
17
|
};
|
|
14
18
|
} catch {
|
|
15
19
|
return null;
|
|
@@ -33,5 +37,29 @@ function screenshotArtifact(headers) {
|
|
|
33
37
|
console.warn(`Ignoring unknown X-Expo-Screenshot-Artifact value: ${status}`);
|
|
34
38
|
return null;
|
|
35
39
|
}
|
|
40
|
+
function screenshotMetadata(headers) {
|
|
41
|
+
const header = headers.get("X-Expo-Screenshot-Metadata");
|
|
42
|
+
if (!header || header.length > 1024) return;
|
|
43
|
+
try {
|
|
44
|
+
const value = JSON.parse(header);
|
|
45
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return;
|
|
46
|
+
const data = value;
|
|
47
|
+
const nonnegative = (value)=>typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
48
|
+
if (!nonnegative(data.width) || !nonnegative(data.height) || data.screen !== undefined && data.screen !== "inner" && data.screen !== "outer") return;
|
|
49
|
+
const rotation = data.displayRotation;
|
|
50
|
+
if (rotation !== null && rotation !== "portrait" && rotation !== "portrait-upside-down" && rotation !== "landscape-left" && rotation !== "landscape-right") return;
|
|
51
|
+
return {
|
|
52
|
+
width: data.width,
|
|
53
|
+
height: data.height,
|
|
54
|
+
...data.screen === undefined ? {} : {
|
|
55
|
+
screen: data.screen
|
|
56
|
+
},
|
|
57
|
+
displayRotation: rotation
|
|
58
|
+
};
|
|
59
|
+
} catch {
|
|
60
|
+
// Optional metadata must never prevent an otherwise successful PNG download.
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
36
64
|
|
|
37
65
|
//# sourceMappingURL=screenshot.mjs.map
|
package/dist/screenshot.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/screenshot.ts"],"sourcesContent":["import { apiUrl } from \"./android-api-url\";\nimport { type ScreenshotArtifact, type ScreenshotCapture } from \"./types\";\n\ntype ScreenshotFetch = (input: string, init?: RequestInit) => Promise<Response>;\n\n/** Capture a still PNG through serve-sim's or serve-emu's POST-only screenshot endpoint, along with whether it reached the session artifacts. */\nexport async function fetchScreenshot(\n baseUrl: string,\n device?: string | null,\n fetchImpl: ScreenshotFetch = fetch,\n): Promise<ScreenshotCapture | null> {\n const url = `${apiUrl(baseUrl, \"/api/screenshot\")}${\n device ? `?device=${encodeURIComponent(device)}` : \"\"\n }`;\n try {\n const response = await fetchImpl(url, { method: \"POST\", cache: \"no-store\" });\n if (!response.ok) return null;\n return {
|
|
1
|
+
{"version":3,"sources":["../src/screenshot.ts"],"sourcesContent":["import { apiUrl } from \"./android-api-url\";\nimport { type ScreenshotArtifact, type ScreenshotCapture, type ScreenshotMetadata } from \"./types\";\n\ntype ScreenshotFetch = (input: string, init?: RequestInit) => Promise<Response>;\n\n/** Capture a still PNG through serve-sim's or serve-emu's POST-only screenshot endpoint, along with whether it reached the session artifacts. */\nexport async function fetchScreenshot(\n baseUrl: string,\n device?: string | null,\n fetchImpl: ScreenshotFetch = fetch,\n): Promise<ScreenshotCapture | null> {\n const url = `${apiUrl(baseUrl, \"/api/screenshot\")}${\n device ? `?device=${encodeURIComponent(device)}` : \"\"\n }`;\n try {\n const response = await fetchImpl(url, { method: \"POST\", cache: \"no-store\" });\n if (!response.ok) return null;\n const metadata = screenshotMetadata(response.headers);\n return {\n blob: await response.blob(),\n artifact: screenshotArtifact(response.headers),\n ...(metadata ? { metadata } : {}),\n };\n } catch {\n return null;\n }\n}\n\nfunction screenshotArtifact(headers: Headers): ScreenshotArtifact | null {\n const status = headers.get(\"X-Expo-Screenshot-Artifact\");\n if (status === null) return null;\n if (status === \"failed\") {\n const error = headers.get(\"X-Expo-Screenshot-Artifact-Error\")?.trim();\n return error ? { status, error } : { status };\n }\n if (status === \"saved\" || status === \"disabled\") return { status };\n console.warn(`Ignoring unknown X-Expo-Screenshot-Artifact value: ${status}`);\n return null;\n}\n\nfunction screenshotMetadata(headers: Headers): ScreenshotMetadata | undefined {\n const header = headers.get(\"X-Expo-Screenshot-Metadata\");\n if (!header || header.length > 1024) return;\n try {\n const value: unknown = JSON.parse(header);\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return;\n const data = value as Record<string, unknown>;\n const nonnegative = (value: unknown): value is number =>\n typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0;\n if (\n !nonnegative(data.width) ||\n !nonnegative(data.height) ||\n (data.screen !== undefined && data.screen !== \"inner\" && data.screen !== \"outer\")\n )\n return;\n const rotation = data.displayRotation;\n if (\n rotation !== null &&\n rotation !== \"portrait\" &&\n rotation !== \"portrait-upside-down\" &&\n rotation !== \"landscape-left\" &&\n rotation !== \"landscape-right\"\n )\n return;\n return {\n width: data.width,\n height: data.height,\n ...(data.screen === undefined ? {} : { screen: data.screen }),\n displayRotation: rotation,\n };\n } catch {\n // Optional metadata must never prevent an otherwise successful PNG download.\n return;\n }\n}\n"],"names":["apiUrl","fetchScreenshot","baseUrl","device","fetchImpl","fetch","url","encodeURIComponent","response","method","cache","ok","metadata","screenshotMetadata","headers","blob","artifact","screenshotArtifact","status","get","error","trim","console","warn","header","length","value","JSON","parse","Array","isArray","data","nonnegative","Number","isSafeInteger","width","height","screen","undefined","rotation","displayRotation"],"mappings":"AAAA,SAASA,MAAM,QAAQ,wBAAoB;AAK3C,+IAA+I,GAC/I,OAAO,eAAeC,gBACpBC,OAAe,EACfC,MAAsB,EACtBC,YAA6BC,KAAK;IAElC,MAAMC,MAAM,GAAGN,OAAOE,SAAS,qBAC7BC,SAAS,CAAC,QAAQ,EAAEI,mBAAmBJ,SAAS,GAAG,IACnD;IACF,IAAI;QACF,MAAMK,WAAW,MAAMJ,UAAUE,KAAK;YAAEG,QAAQ;YAAQC,OAAO;QAAW;QAC1E,IAAI,CAACF,SAASG,EAAE,EAAE,OAAO;QACzB,MAAMC,WAAWC,mBAAmBL,SAASM,OAAO;QACpD,OAAO;YACLC,MAAM,MAAMP,SAASO,IAAI;YACzBC,UAAUC,mBAAmBT,SAASM,OAAO;YAC7C,GAAIF,WAAW;gBAAEA;YAAS,IAAI,CAAC,CAAC;QAClC;IACF,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA,SAASK,mBAAmBH,OAAgB;IAC1C,MAAMI,SAASJ,QAAQK,GAAG,CAAC;IAC3B,IAAID,WAAW,MAAM,OAAO;IAC5B,IAAIA,WAAW,UAAU;QACvB,MAAME,QAAQN,QAAQK,GAAG,CAAC,qCAAqCE;QAC/D,OAAOD,QAAQ;YAAEF;YAAQE;QAAM,IAAI;YAAEF;QAAO;IAC9C;IACA,IAAIA,WAAW,WAAWA,WAAW,YAAY,OAAO;QAAEA;IAAO;IACjEI,QAAQC,IAAI,CAAC,CAAC,mDAAmD,EAAEL,QAAQ;IAC3E,OAAO;AACT;AAEA,SAASL,mBAAmBC,OAAgB;IAC1C,MAAMU,SAASV,QAAQK,GAAG,CAAC;IAC3B,IAAI,CAACK,UAAUA,OAAOC,MAAM,GAAG,MAAM;IACrC,IAAI;QACF,MAAMC,QAAiBC,KAAKC,KAAK,CAACJ;QAClC,IAAI,OAAOE,UAAU,YAAYA,UAAU,QAAQG,MAAMC,OAAO,CAACJ,QAAQ;QACzE,MAAMK,OAAOL;QACb,MAAMM,cAAc,CAACN,QACnB,OAAOA,UAAU,YAAYO,OAAOC,aAAa,CAACR,UAAUA,SAAS;QACvE,IACE,CAACM,YAAYD,KAAKI,KAAK,KACvB,CAACH,YAAYD,KAAKK,MAAM,KACvBL,KAAKM,MAAM,KAAKC,aAAaP,KAAKM,MAAM,KAAK,WAAWN,KAAKM,MAAM,KAAK,SAEzE;QACF,MAAME,WAAWR,KAAKS,eAAe;QACrC,IACED,aAAa,QACbA,aAAa,cACbA,aAAa,0BACbA,aAAa,oBACbA,aAAa,mBAEb;QACF,OAAO;YACLJ,OAAOJ,KAAKI,KAAK;YACjBC,QAAQL,KAAKK,MAAM;YACnB,GAAIL,KAAKM,MAAM,KAAKC,YAAY,CAAC,IAAI;gBAAED,QAAQN,KAAKM,MAAM;YAAC,CAAC;YAC5DG,iBAAiBD;QACnB;IACF,EAAE,OAAM;QACN,6EAA6E;QAC7E;IACF;AACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -767,6 +767,14 @@ export type ScreenshotArtifact = {
|
|
|
767
767
|
/** Why the save failed, when the backend says. */
|
|
768
768
|
error?: string;
|
|
769
769
|
};
|
|
770
|
+
/** Capture-source metadata. Zero numeric values and null rotation mean unknown. */
|
|
771
|
+
export type ScreenshotMetadata = {
|
|
772
|
+
width: number;
|
|
773
|
+
height: number;
|
|
774
|
+
displayRotation: "portrait" | "portrait-upside-down" | "landscape-left" | "landscape-right" | null;
|
|
775
|
+
/** Two-panel device identity; omitted on single-display devices or when unknown. */
|
|
776
|
+
screen?: "inner" | "outer";
|
|
777
|
+
};
|
|
770
778
|
/**
|
|
771
779
|
* A still PNG of the device and its session artifact outcome. `artifact` is
|
|
772
780
|
* `null` when the backend sent no header, as older serve-sim and serve-emu
|
|
@@ -775,6 +783,8 @@ export type ScreenshotArtifact = {
|
|
|
775
783
|
export type ScreenshotCapture = {
|
|
776
784
|
blob: Blob;
|
|
777
785
|
artifact: ScreenshotArtifact | null;
|
|
786
|
+
/** Absent on older servers or when metadata is not recognized. */
|
|
787
|
+
metadata?: ScreenshotMetadata;
|
|
778
788
|
};
|
|
779
789
|
/**
|
|
780
790
|
* The live state + controls for one device connection. Returned by the hook and
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,SAAS,CAAC;AAE/C,8DAA8D;AAC9D,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE3D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,YAAY,GAAG,cAAc,GAAG,WAAW,GAAG,OAAO,CAAC;AAE9F,wFAAwF;AACxF,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,sBAAsB,GACtB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhD;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;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BAAgB,GAChB,YAAY,CACf,CAAC;AAEF,sFAAsF;AACtF,MAAM,WAAW,iBAAiB;IAChC,8EAA8E;IAC9E,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,MAAM,EAAE,YAAY,CAAC;IACrB,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,0FAA0F;IAC1F,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3C,gFAAgF;IAChF,YAAY,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC7C,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,qFAAqF;AACrF,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IAC/E,MAAM,EAAE,kBAAkB,CAAC;CAC5B"}
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["/**\n * The common device-client interface.\n *\n * Expo Hub mirrors live simulators (serve-sim) and emulators (serve-emu) inside\n * the {@link PhoneFrame}, in place of the static `<img>` placeholder. Both\n * backends speak very different wire protocols — serve-sim streams MJPEG/H.264\n * and takes binary touch packets over its own WebSocket; serve-emu streams\n * H.264 (WebCodecs) and takes JSON gestures over a single WebSocket — so this\n * file defines one shared shape both can implement:\n *\n * - {@link DeviceClientProvider} to own the connection, with {@link useDeviceClient}\n * and {@link useDeviceClientSelector} to read its state and controls, and\n * - a **component** ({@link DeviceScreen}, see `./DeviceScreen.tsx`) that paints\n * the stream and forwards pointer/gesture input.\n *\n * Pass the result of {@link useDeviceScreenClient} to `DeviceScreen` to follow\n * screen and input changes without subscribing to metrics, FPS or logs.\n */\n\nimport { type CSSProperties } from \"react\";\n\nimport { type FoldControlCommand, type FoldPose } from \"./fold\";\n\nexport type DevicePlatform = \"ios\" | \"android\";\n\n/** Viewer-selected transport for the active device stream. */\nexport type DeviceStreamMode = \"mjpeg\" | \"h264\" | \"webrtc\";\n\n/**\n * Lifecycle of one screen session. A session is one connection (server,\n * device, token) with one surface (the flat screen, or the separate displays)\n * and one media element kind; changing any of them starts a new session.\n * idle — nothing to connect to (no base URL / disabled)\n * connecting — the session has not presented a frame yet. Consumers show\n * loading UI. Becomes `error` after 30 s without a frame,\n * while the client keeps retrying.\n * reconnecting — the session presented a frame and its stream is being\n * re-established, for example after a WebRTC reconnect, a\n * helper restart, or an Android capture-source switch. The\n * last frame stays on screen meanwhile; consumers show no\n * loading UI. Android reports `error` when the outage\n * outlives its reconnect grace period; iOS after 30 s. The\n * client keeps retrying in both cases.\n * streaming — frames are flowing\n * error — the connection failed, or its first frame did not come in time\n */\nexport type ConnectionStatus = \"idle\" | \"connecting\" | \"reconnecting\" | \"streaming\" | \"error\";\n\n/** How the device faces: serve-sim's stream config, or serve-emu's display rotation. */\nexport type DeviceOrientation =\n | \"portrait\"\n | \"portrait_upside_down\"\n | \"landscape_left\"\n | \"landscape_right\";\n\n/**\n * A display of a foldable device, named by its role so that every platform\n * uses the same identity: `cover` is the outside display that works while the\n * device is closed, `inner` the main display that folds.\n */\nexport type DeviceDisplayId = \"cover\" | \"inner\";\n\n/**\n * Native pixel size of the streamed screen — drives the PhoneFrame aspect ratio.\n * The same object names the display that it describes, so a size, an\n * orientation, and a display always change together.\n */\nexport interface ScreenSize {\n width: number;\n height: number;\n /** Last known orientation, when the backend reports it (serve-sim, serve-emu). */\n orientation?: DeviceOrientation;\n /**\n * True when frames already show the display as it faces (serve-emu), so the client never\n * turns the video. serve-sim can send raw portrait frames for a turned device instead.\n */\n framesUpright?: boolean;\n /** Native input setup failed; video can continue without touch or keyboard. */\n inputUnavailable?: boolean;\n /**\n * The display that this size and orientation describe, as native readback\n * confirmed it. Set only for a foldable that reports it (the iPhone Duo).\n */\n display?: DeviceDisplayId;\n}\n\n/**\n * Corner radii of the shown display's glass as the viewer sees it, clockwise\n * from top left, each a fraction of the displayed width. serve-sim reads them\n * from Xcode's DeviceKit profile; the iPhone Duo's cover, for example, is\n * nearly square at the hinge and round at the outer edge.\n */\nexport interface DisplayCornerRadii {\n topLeft: number;\n topRight: number;\n bottomRight: number;\n bottomLeft: number;\n}\n\n/**\n * The fold controls a device offers; `false` for a device without them. A\n * device without a hinge, a device whose hinge the backend cannot move, and\n * a device whose fold state is not reported yet all report `false`.\n */\nexport type DeviceFoldCapabilities =\n | false\n | Readonly<{\n /**\n * The hinge angles that the device accepts, in degrees, as for\n * {@link DeviceFold.angle}. `false` when the device applies poses only.\n */\n angle: Readonly<{ min: number; max: number }> | false;\n /**\n * The named poses that the device can apply, each with the hinge angle\n * that it sets. A pose that is not listed is not offered.\n */\n poses: Readonly<Partial<Record<FoldPose, Readonly<{ angle: number }>>>>;\n /** A persistent table state (Xcode's Table Mode); `DeviceFold.tableMode` is then present. */\n tableMode: boolean;\n }>;\n\n/**\n * One step of a fold command, or a rotation, as the client handles it. Each\n * event carries the command object that `setControl` queued, so a listener can\n * match a step to its request. A command can end without an event of its own:\n * while it waits in the queue, a newer command of the same control replaces it,\n * and a pose command clears the whole queue. Such a command gets `requested`\n * and nothing after it.\n */\nexport type FoldCommandEvent =\n /** `setControl` queued the command; `angle`, `pose`, and `tableMode.enabled` already preview it. */\n | { type: \"requested\"; command: FoldControlCommand }\n /**\n * The command went to the device. `display` is the display that the command\n * makes active, when the command alone decides it.\n */\n | { type: \"sent\"; command: FoldControlCommand; display?: DeviceDisplayId }\n /** The device answered the command. A rejection is followed by `failed`. */\n | { type: \"acknowledged\"; command: FoldControlCommand; ok: boolean }\n /**\n * The preview of the acknowledged commands ends, and the fold shows what the\n * device reports again. `observed` is true when the device reported the\n * requested state. It is false when the iOS simulator's native readback did\n * not reach that state within 500 ms of the command's config: the fold then\n * shows the readback, not the request.\n */\n | { type: \"confirmed\"; observed: boolean }\n /** A command failed, `error` says why, and the client dropped every unconfirmed command. */\n | { type: \"failed\"; error: string }\n /**\n * `setControl` refused a command that `capabilities.fold` does not offer,\n * before any `requested`. Commands already queued or sent go on.\n */\n | { type: \"rejected\"; command: FoldControlCommand; error: string }\n /**\n * The client left the helper session that owned the commands, for example\n * for another device or a replaced helper at the same URL. It dropped every\n * unconfirmed command without an error, and forgot `physical.pose`.\n */\n | { type: \"reset\" }\n /**\n * The viewer rotated the device, which clears its named pose, by\n * `quarterTurns` (clockwise positive): one for Rotate, or the turns to the\n * orientation that the viewer chose.\n */\n | { type: \"rotated\"; quarterTurns: number };\n\n/** The persistent table state of {@link DeviceFold}, present when `capabilities.fold.tableMode`. */\nexport interface DeviceFoldTableMode {\n /**\n * The pending request while a command awaits confirmation, then the setting\n * that the device reports; undefined until reported.\n */\n enabled?: boolean;\n /** Whether the current pose allows it to be turned on; undefined until reported. */\n available?: boolean;\n}\n\n/**\n * How the device is held, apart from its hinge angle. Present when the backend\n * reports it: the iOS adapter reports it together with `capabilities.fold`.\n * Android emulators have no physical stance to report.\n */\nexport interface DeviceFoldPhysical {\n /**\n * The pose whose stance the device holds, which a later angle change keeps\n * (Laptop stays on the table). Undefined follows `pose`; null is unknown,\n * for example after a rotation.\n */\n pose?: FoldPose | null;\n /**\n * Lying face down with Table Mode, which makes the cover display active.\n * Undefined while the backend has not reported enough to tell: a consumer\n * then keeps what it last knew instead of treating the device as face up.\n */\n faceDown?: boolean;\n}\n\n/**\n * Fold state and controls of a foldable device. Angles and poses show the\n * pending request until its `confirmed` event, then the values that the\n * device reports, which need not match the request. `DeviceClient.capabilities.fold` says which commands the\n * device accepts.\n */\nexport interface DeviceFold {\n /**\n * Hinge angle in degrees, between the display sides of the two halves: 180\n * is flat, a smaller angle folds the displays inward (0 is shut), and a\n * fold-out hinge goes past 180. Undefined until reported.\n */\n angle?: number;\n /** Named pose in effect, null for a custom angle, undefined until reported. */\n pose?: FoldPose | null;\n /** A fold command awaits the device's acknowledgement. */\n pending: boolean;\n /** The last failed fold command, cleared when the next one starts. */\n error: string | null;\n /** Present exactly when `capabilities.fold.tableMode` is true. */\n tableMode?: DeviceFoldTableMode;\n /** Present when the backend reports how the device is held. */\n physical?: DeviceFoldPhysical;\n /**\n * Send a fold command that `capabilities.fold` offers. A command that it does\n * not offer never reaches the device: `error` says why, and `observe` gets\n * `rejected`. Commands already queued or sent go on.\n */\n setControl: (command: FoldControlCommand) => void;\n /**\n * Follow every fold command and rotation of this client, whichever control\n * started it, as {@link FoldCommandEvent}s. Returns a function that stops\n * the listener. Absent when the backend reports no command lifecycle.\n */\n observe?: (listener: (event: FoldCommandEvent) => void) => () => void;\n}\n\n/**\n * One display of a device that streams each display on its own, such as the\n * iPhone Duo's cover and inner display.\n */\nexport interface DeviceDisplay {\n id: DeviceDisplayId;\n /**\n * The display that the device presents. The fold state elects it, so it\n * follows a requested fold at once. `screen.display` is the display that\n * native readback confirmed, and input addressed to a display waits for it.\n */\n active: boolean;\n /**\n * Ref callback for this display's paint target, an element of the client's\n * {@link DeviceClient.videoKind}, as for {@link DeviceClient.attachVideo}.\n * While any display has an element, the client streams each attached display\n * and parks the flat stream; `status`, `error`, `fps`, and `streamStats` then\n * follow the active display. Detaching every display resumes the flat stream.\n */\n attachVideo: (el: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement | null) => void;\n}\n\n/** A simulator/emulator the server reports as running. */\nexport interface RunningDevice {\n /** udid (iOS) / adb serial (Android). */\n id: string;\n name: string;\n /** e.g. \"iOS 27.0\" / \"Android 16\". */\n system?: string;\n platform: DevicePlatform;\n /** True for the device this connection is currently streaming. */\n current?: boolean;\n}\n\n/** A single line of device output (syslog / logcat). */\nexport interface DeviceLog {\n id: string;\n /** Short monospace source tag, e.g. `logcat` / `syslog`. */\n source: string;\n message: string;\n}\n\n/** A normalized device interaction or command reported by a device backend. */\nexport interface DeviceEvent {\n /** Stable within a device session and namespaced by the backend/device. */\n id: string;\n /** ISO timestamp reported by the backend. */\n timestamp: string;\n /** Backend event source, e.g. `hid`, `ui`, `ws`, or `rest:tap`. */\n source: string;\n /** Broad event category used for display and filtering. */\n kind: string;\n /** More specific operation within {@link kind}, when available. */\n action?: string;\n /** Whether the backend reported the operation as successful or failed. */\n status?: \"ok\" | \"error\";\n /** Human-readable, privacy-safe event summary. */\n message: string;\n /** Structured event data retained for future richer presentation. */\n details?: Record<string, unknown>;\n}\n\n/** Simulator/device-wide settings exposed by serve-sim and serve-emu. */\nexport type DeviceSettingKey =\n | \"appearance\"\n | \"network\"\n | \"liquid-glass\"\n | \"color-filter\"\n | \"text-size\"\n | \"display-size\"\n | \"reduce-motion\"\n | \"bold-text\"\n | \"increase-contrast\"\n | \"onscreen-keyboard\"\n | \"show-borders\"\n | \"reduce-transparency\"\n | \"voiceover\";\n\n/** Current backend-reported values. Missing keys are unavailable; `unsupported` keys are hidden. */\nexport type DeviceSettings = Partial<Record<DeviceSettingKey, string>>;\n\n/** Settings availability for the selected device, independent of video and app activity. */\nexport type DeviceSettingsStatus = \"idle\" | \"loading\" | \"ready\" | \"error\";\n\n/** Which emulator camera a feed drives. */\nexport type DeviceCameraFacing = \"back\" | \"front\";\n\n/** One emulator camera fed from a PNG on the host. */\nexport interface DeviceCameraFeed {\n facing: DeviceCameraFacing;\n /** True while the feed still holds the backend's \"no image set\" test card. */\n placeholder: boolean;\n width: number | null;\n height: number | null;\n bytes: number | null;\n /** Same-origin URL of the current PNG, or null when no file exists yet. Embeds the digest so a changed image refetches. */\n imageUrl: string | null;\n}\n\n/** Host-side still-image camera feeds for an Android emulator. */\nexport interface DeviceCameraStatus {\n /** True when the emulator was launched with the feed files attached. False means images are stored but never shown. */\n wiredAtLaunch: boolean;\n feeds: readonly DeviceCameraFeed[];\n}\n\n/** One live CPU, memory, and network sample for the foreground iOS app. */\nexport interface DeviceActivitySample {\n /** Milliseconds since the backend sampler started. */\n t: number;\n bundleId: string | null;\n /** Per-core CPU utilization. It can exceed 100 on multicore workloads. */\n cpuPct: number;\n memBytes: number;\n netInBytesPerSec: number;\n netOutBytesPerSec: number;\n}\n\n/** Metrics discovery and stream readiness, independent of video and sample freshness. */\nexport type DeviceActivityStatus = \"idle\" | \"loading\" | \"ready\" | \"error\";\n\n/** Rolling activity history and health for the selected device. */\nexport interface DeviceActivity {\n hostCores: number | null;\n samples: DeviceActivitySample[];\n errored: boolean;\n stale: boolean;\n}\n\n/** Viewer-local HTTP stream codec selection. */\nexport type DeviceHttpCodec = \"auto\" | \"mjpeg\" | \"h264\";\n\n/** Viewer-local WebRTC codec selection. */\nexport type DeviceWebRtcCodec = \"h264\" | \"vp9\" | \"vp8\";\n\n/** Stream transports and codecs supported by the active backend. */\nexport interface DeviceStreamCapabilities {\n modeAvailability: Record<DeviceStreamMode, boolean>;\n httpCodecs: readonly DeviceHttpCodec[];\n webRtcCodecs: readonly DeviceWebRtcCodec[];\n}\n\n/** Runtime encoder settings exposed by a backend's stream-settings endpoint. */\nexport interface DeviceStreamEncoderSettings {\n mjpegFps: number;\n mjpegQuality: number;\n maxDimension: number;\n h264Bitrate: number;\n h264Fps: number;\n}\n\n/** Android capture implementations exposed by serve-emu. */\nexport type DeviceStreamSource = \"scrcpy\" | \"grpc-screenshot\";\n\n/** Pixel delivery selected for the emulator gRPC screenshot source. */\nexport type DeviceGrpcImageMode = \"png\" | \"mmap\" | \"rgb888\";\n\n/** Host H.264 encoder used for emulator gRPC screenshots. */\nexport type DeviceGrpcEncoder = \"software\" | \"hardware\";\n\n/** Input transport used while gRPC provides emulator video. */\nexport type DeviceInputSource = \"scrcpy\" | \"grpc\";\n\n/** Authoritative source state for the selected Android device session. */\nexport interface DeviceStreamSourceStatus {\n /** Effective idle frame repeat interval; omitted by older Android servers. Zero disables repeats. */\n repeatFrameMs?: number;\n mode: DeviceStreamSource;\n grpcImageMode: DeviceGrpcImageMode;\n encoder: DeviceGrpcEncoder;\n /** Active ffmpeg encoder; null before capture starts or when using scrcpy. */\n encoderName: string | null;\n availableEncoders: readonly DeviceGrpcEncoder[];\n hardwareEncoderError?: string;\n inputSource: DeviceInputSource;\n availableInputSources: readonly DeviceInputSource[];\n availableModes: readonly DeviceStreamSource[];\n sessionGeneration: number;\n}\n\n/** Runtime encoder values the active backend can change without restarting the Hub. */\nexport type DeviceStreamSettingCapabilities =\n | false\n | Readonly<Partial<Record<keyof DeviceStreamEncoderSettings, true>>>;\n\n/** A WGS84 coordinate the Hub asks a device to report. */\nexport interface DeviceGeoFix {\n latitude: number;\n longitude: number;\n}\n\n/**\n * Location control the backend offers. `false` hides the section. Every backend that\n * offers it can set a fix; `clear` marks one that can also remove it (serve-sim only —\n * `adb emu geo fix` has no inverse).\n */\nexport type DeviceLocationCapabilities = false | Readonly<{ clear?: true }>;\n\n/**\n * Orientations that `setOrientation` can turn the device to. `false` when the backend cannot\n * turn the device to one pose or cannot report the pose it shows (an older serve-emu server);\n * `rotate` still works where the backend supports it.\n */\nexport type DeviceOrientationCapabilities =\n | false\n | Readonly<{ orientations: readonly DeviceOrientation[] }>;\n\n/**\n * Why an orientation change cannot go out now. New reasons can be added, so handle unknown\n * values.\n *\n * - `\"recording-status-unknown\"` and `\"recording\"` come from {@link DeviceClient.recordingLock}\n * (`\"status-unknown\"` and `\"recording\"`). A call is dropped silently: no request, no\n * `orientationPending` and no `orientationError`.\n * - `\"input-unavailable\"`: serve-sim sends the pose over the helper's input socket, which is not\n * admitted or reports that the simulator cannot take input. The video stream does not matter.\n * A call still tries: the input queue keeps it for a short time and then reports an\n * `orientationError`.\n */\nexport type DeviceOrientationUnavailableReason =\n | \"recording-status-unknown\"\n | \"recording\"\n | \"input-unavailable\";\n\n/** Text Paste into and Copy from the device app. `false` hides clipboard controls. */\nexport type DeviceClipboardCapabilities = false | Readonly<{ paste: boolean; copy: boolean }>;\n\n/** The clipboard action whose result the client shows. */\nexport type DeviceClipboardAction = \"paste\" | \"copy\";\n\n/** One WebRTC telemetry sample, normally collected once per second. */\nexport interface DeviceStreamStatsSample {\n atMs: number;\n /** Frames produced by the active backend WebRTC source/encoder. */\n serverFps: number | null;\n /** Video frames actually presented by the browser. */\n clientFps: number | null;\n /** Actual inbound video media bitrate, derived from `bytesReceived`. */\n clientBitrateBps: number | null;\n /** Packet loss over this sample window, expressed as a ratio from 0 to 1. */\n clientPacketLossRatio: number | null;\n /** Current inbound RTP jitter reported by the browser. */\n clientJitterMs: number | null;\n /** Mean jitter-buffer delay per emitted frame over this sample window. */\n clientJitterBufferMs: number | null;\n /** Browser-decoded frames dropped during this sample window. */\n clientDroppedFrames: number | null;\n /** Playback freezes reported during this sample window. */\n clientFreezeCount: number | null;\n /** Total time spent frozen during this sample window. */\n clientFreezeDurationMs: number | null;\n /** Current round-trip time for the browser's selected ICE candidate pair. */\n clientRoundTripMs: number | null;\n /** Whether the browser's selected ICE path is direct, relayed, or unknown. */\n clientIcePath: \"direct\" | \"relay\" | \"unknown\";\n}\n\n/** Latest server-side WebRTC encoder statistics for this viewer. */\nexport interface DeviceStreamEncoderStats {\n codec: string | null;\n encodeFps: number | null;\n targetBitrateBps: number | null;\n encodeMsPerFrame: number | null;\n framesEncoded: number | null;\n framesSent: number | null;\n framesDropped: number | null;\n packetLossRatio: number | null;\n qualityLimitationReason: string | null;\n /** Android publisher submissions per second, derived from consecutive server snapshots. */\n publisherFps: number | null;\n /** H.264 frames accepted by serve-emu's native media track. */\n publisherSubmittedFrames: number | null;\n /** Frames rejected by serve-emu's keyframe gate or native backpressure. */\n publisherDroppedFrames: number | null;\n /** Submitted H.264 payload bitrate, excluding RTP/SRTP/transport overhead and retransmits. */\n payloadBitrateBps: number | null;\n}\n\n/** Median and 95th-percentile timings in milliseconds. */\nexport interface DeviceStreamTimingQuantiles {\n p50: number | null;\n p95: number | null;\n}\n\n/** Latest gRPC screenshot producer, transport, and host-copy diagnostics. */\nexport interface DeviceGrpcCaptureStats {\n /** Selected emulator screenshot delivery strategy. */\n imageMode: DeviceGrpcImageMode | null;\n /** Emulator frame-production cadence inferred from source timestamps. */\n producerFps: number | null;\n /** Raw screenshot messages reaching serve-emu. */\n receiveFps: number | null;\n /** Valid images available to the host encoder. */\n usableImageFps: number | null;\n /** Fresh images submitted to FFmpeg, excluding deliberate idle repeats. */\n encoderInputFps: number | null;\n /** Raw screenshot notifications received from the emulator. */\n messagesReceived: number | null;\n /** Notifications selected for decoding/copying after capture pacing. */\n messagesEmitted: number | null;\n /** Pending notifications replaced by a newer frame before capture. */\n messagesCoalesced: number | null;\n sequenceGaps: number | null;\n imagePayloadBytes: number | null;\n transportBytes: number | null;\n messageBytesReceived: number | null;\n mmapFileBytesRead: number | null;\n mmapReadRetries: number | null;\n mmapTornFramesDropped: number | null;\n productionToReceiveLatencyMs: DeviceStreamTimingQuantiles;\n productionToUsableLatencyMs: DeviceStreamTimingQuantiles;\n protobufDecodeTimeMs: DeviceStreamTimingQuantiles;\n mmapReadCopyTimeMs: DeviceStreamTimingQuantiles;\n}\n\n/** Latest cumulative server-side capture and pacing counters. */\nexport interface DeviceStreamCaptureStats {\n /** Capture is intentionally suspended for a device reboot; older servers omit this. */\n rebooting?: boolean;\n screenFrames: number | null;\n idleFrames: number | null;\n offeredFrames: number | null;\n forwardedFrames: number | null;\n pumpRestarts: number | null;\n /** Null when the active capture source does not expose gRPC diagnostics. */\n grpc: DeviceGrpcCaptureStats | null;\n}\n\n/** Bounded WebRTC telemetry history owned by the device connection. */\nexport interface DeviceStreamStats {\n samples: readonly DeviceStreamStatsSample[];\n encoder: DeviceStreamEncoderStats | null;\n capture: DeviceStreamCaptureStats | null;\n /** True when the peer has not produced a successful sample for four seconds. */\n stale: boolean;\n /** True when the server-side statistics poll has not succeeded for four seconds. */\n serverStale: boolean;\n}\n\n/** A rectangle in 0..1 screen fractions, so every platform taps through `sendTouch` unchanged. */\nexport interface AccessibilityFrame {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** One accessible element of the current screen, normalized across backends. */\nexport interface AccessibilityNode {\n id: string;\n /** Never empty — the parsers drop elements that carry no name. */\n label: string;\n /** iOS role or element type; Android the class-name tail, e.g. `TextView`. */\n role: string;\n enabled: boolean;\n clickable: boolean;\n frame: AccessibilityFrame;\n}\n\nexport interface AccessibilitySnapshot {\n /** Epoch milliseconds. */\n capturedAt: number;\n nodes: readonly AccessibilityNode[];\n}\n\n/** Explicit backend feature flags used to omit unsupported inspector sections and controls. */\nexport interface DeviceCapabilities {\n deviceSettings: boolean;\n activity: boolean;\n events: boolean;\n /** Host-fed emulator camera images that the backend can read and replace. */\n camera: boolean;\n /** An accessibility tree of the current screen that the backend can read on demand. */\n accessibility: boolean;\n /** Runtime encoder settings that can be read and patched. */\n streamSettings: DeviceStreamSettingCapabilities;\n /** Simulated-location control, and whether the fix can also be removed. */\n location: DeviceLocationCapabilities;\n /** Foreground-app permissions that the backend can list and change. */\n permissions: boolean;\n /** Text clipboard actions, in order with keyboard input. */\n clipboard: DeviceClipboardCapabilities;\n /** Orientations that `setOrientation` accepts. */\n orientation: DeviceOrientationCapabilities;\n /** The fold commands that `DeviceClient.fold` accepts. */\n fold: DeviceFoldCapabilities;\n}\n\n/** How the device answers one permission of the foreground app. */\nexport type AppPermissionState = \"granted\" | \"denied\" | \"limited\" | \"undetermined\";\n\n/** One permission row. `id` is the backend name (`android.permission.CAMERA`, `camera`). */\nexport interface AppPermission {\n id: string;\n label: string;\n state: AppPermissionState;\n}\n\nexport type AppPermissionAction = \"grant\" | \"revoke\";\n\n/** The app currently in the foreground on the device. */\nexport interface ForegroundApp {\n /** Bundle identifier (iOS) / package name (Android). */\n id: string;\n /** Human-readable app label (Android `dumpsys`, iOS `CFBundleDisplayName`). */\n label?: string;\n /** Foreground process id, when known. */\n pid?: number;\n /** True when the backend detected a React Native app (serve-sim). */\n isReactNative?: boolean;\n /** Marketing version — iOS `CFBundleShortVersionString` / Android `versionName`. */\n version?: string;\n /** Build identifier — iOS `CFBundleVersion` / Android `versionCode`. */\n build?: string;\n /** App icon as a `data:` URL, when the backend can extract one. */\n iconDataUrl?: string;\n /** Fully-qualified foreground activity (Android). */\n activity?: string;\n /** Whether the app is debuggable (Android). */\n debuggable?: boolean;\n /** Minimum supported Android API level, e.g. 24 (Android). */\n minSdk?: number;\n /** `MinimumOSVersion` from Info.plist (iOS). */\n minOS?: string;\n /** `CFBundleExecutable` from Info.plist (iOS). */\n executable?: string;\n /** Path of the installed `.app` bundle on the host (iOS). */\n appPath?: string;\n}\n\n/** Hardware buttons. Implementations ignore the ones their platform lacks. */\nexport type HardwareButton =\n | \"home\"\n | \"back\"\n | \"recents\"\n | \"power\"\n | \"appSwitcher\"\n /** Dismisses the on-screen keyboard. Not a physical button; grouped here because it presses one key. */\n | \"hideKeyboard\";\n\n/**\n * Device system appearance. Binary on purpose — the Hub exposes a plain\n * light/dark toggle with no \"auto\", even where the backend supports one\n * (serve-emu's `uimode night auto`).\n */\nexport type DeviceAppearance = \"light\" | \"dark\";\n\n/** One normalized (0..1) touch sample. The hook maps it to the wire protocol. */\nexport interface TouchSample {\n phase: \"begin\" | \"move\" | \"end\";\n /**\n * The {@link DeviceDisplay} whose coordinates `x` and `y` use. Without it, the\n * sample addresses the flat stream. A gesture that begins on a display other\n * than `screen.display` is dropped until its end.\n */\n display?: DeviceDisplayId;\n /** An end that abandons unsent touch intent, e.g. conversion to a two-finger gesture. */\n cancelled?: boolean;\n /** 0..1 across the screen width. */\n x: number;\n /** 0..1 down the screen height. */\n y: number;\n /** Whether a `begin` at a screen edge may start a system edge gesture (the iOS swipe-to-home band). Defaults to true. */\n edgeGestures?: boolean;\n}\n\n/** A two-finger gesture sample (pinch/pan). Both points are normalized 0..1. */\nexport interface MultiTouchSample {\n phase: \"begin\" | \"move\" | \"end\";\n /** The display both points address, as for {@link TouchSample.display}. */\n display?: DeviceDisplayId;\n a: { x: number; y: number };\n b: { x: number; y: number };\n}\n\n/** A physical browser-keyboard event forwarded by {@link DeviceScreen}. */\nexport interface KeyboardInput {\n phase: \"down\" | \"up\";\n /** Physical browser key, e.g. `KeyA`, `ShiftLeft`, or `Enter`. */\n code: string;\n /** Layout-resolved value, e.g. `a`, `A`, `é`, or `Enter`. */\n key: string;\n /** Whether this is an auto-repeated keydown. */\n repeat: boolean;\n shiftKey?: boolean;\n metaKey?: boolean;\n ctrlKey?: boolean;\n altKey?: boolean;\n}\n\n/**\n * One HID key transition (USB HID Usage Page 0x07), e.g. produced by\n * {@link KeyboardCapture} from phone-keyboard text. Forwarded as-is over\n * serve-sim's `0x06` key channel.\n */\nexport type HidKeyEvent = { type: \"down\" | \"up\"; usage: number };\n\n/**\n * A scroll-wheel / trackpad pan over the screen, in *display* space. Deltas are\n * a fraction of the rendered display (positive `dy` scrolls content down, as a\n * physical wheel would); `x`/`y` (0..1) anchor the pan under the pointer so the\n * device pans the view beneath it (e.g. a sheet rather than the map behind it).\n */\nexport interface ScrollSample {\n /** The display the pan addresses. A scroll on a display other than `screen.display` is dropped. */\n display?: DeviceDisplayId;\n dx: number;\n dy: number;\n x: number;\n y: number;\n}\n\n/** A normalized point rendered over the device's display-aligned stream. */\nexport interface AgentInteractionPoint {\n x: number;\n y: number;\n}\n\n/** A frame within one continuous Argent touch gesture. */\nexport interface AgentInteractionFrame {\n /** Milliseconds since this segment began. */\n atMs: number;\n /** One point for touch gestures, two for pinch/rotate gestures. */\n points: AgentInteractionPoint[];\n}\n\n/** A continuous gesture within a possibly batched Argent interaction. */\nexport interface AgentInteractionSegment {\n /** Milliseconds since the outer Argent tool call. */\n startMs: number;\n frames: AgentInteractionFrame[];\n easing?: \"linear\" | \"ease-out\";\n}\n\n/** Parsed, visualization-safe geometry from an Argent MCP tool call. */\nexport interface AgentInteraction {\n id: string;\n deviceId: string;\n timestamp: string;\n segments: AgentInteractionSegment[];\n}\n\nexport interface DeviceConnectionOptions {\n /**\n * Origin (and optional base path) of a running serve-sim / serve-emu server,\n * e.g. `http://localhost:3100`. When empty/null the hook stays `idle`.\n */\n baseUrl?: string | null;\n /** Tear the connection down when false. Defaults to true. */\n enabled?: boolean;\n /**\n * Which running device (udid/serial) to stream. serve-sim selects the matching\n * helper via `/api?device=<udid>`; when omitted the first available is used.\n */\n device?: string | null;\n /**\n * Stream transport selected by the consumer. There is intentionally no\n * client-level default; products embedding Hub own their default choice.\n * Each backend adapter maps unavailable choices to one of its supported modes.\n */\n streamMode: DeviceStreamMode;\n /**\n * Session token of a Hub or serve-sim started with `--require-token`, such as an\n * EAS Simulator Preview session, for a page on another origin. The\n * client sends it as a bearer header, a WebSocket subprotocol, and `?token=`\n * where a browser cannot set a header. A page the server served itself can omit\n * it: its cookie covers every request.\n */\n token?: string | null;\n}\n\n/** Which element the implementation paints into. */\nexport type VideoSurfaceKind = \"canvas\" | \"img\" | \"video\";\n\n/** Why {@link DeviceClient.recordingLock} locks the controls. */\nexport type DeviceRecordingLockReason = \"status-unknown\" | \"recording\";\n\nexport type DeviceScreenRecordingStatus =\n | \"unknown\"\n | \"waiting\"\n | \"recording\"\n | \"finalizing\"\n | \"complete\"\n | \"failed\";\n\n/**\n * Whether a screenshot also reached the session artifacts, read from the\n * backend's `X-Expo-Screenshot-Artifact` response headers. `disabled` means the\n * backend runs outside an EAS session.\n */\nexport type ScreenshotArtifact =\n | { status: \"saved\" | \"disabled\" }\n | {\n status: \"failed\";\n /** Why the save failed, when the backend says. */\n error?: string;\n };\n\n/**\n * A still PNG of the device and its session artifact outcome. `artifact` is\n * `null` when the backend sent no header, as older serve-sim and serve-emu\n * builds do, or a value this client does not know.\n */\nexport type ScreenshotCapture = {\n blob: Blob;\n artifact: ScreenshotArtifact | null;\n};\n\n/**\n * The live state + controls for one device connection. Returned by the hook and\n * consumed by {@link DeviceScreen} (for video + input) and by the surrounding\n * Hub UI (logs panel, Home control, device lists).\n */\nexport interface DeviceClient {\n platform: DevicePlatform;\n status: ConnectionStatus;\n error: string | null;\n /**\n * Whether the current screen session (see {@link ConnectionStatus}) has\n * presented a frame. It stays true while the session reconnects, and it can\n * be true with `error` after the stream failed. Until it is true, the media\n * element shows nothing of this session; it can still hold a previous\n * session's frame. Outside `idle` and `error`, it is false exactly while\n * `status` is `connecting`.\n */\n framePresented: boolean;\n /**\n * An input-channel or hardware-keyboard setup error while video is available,\n * or null. Cleared when the input channel or setup recovers. iOS: serve-sim\n * refused the input socket (too many clients, or a full input queue) or its\n * native HID setup failed. Android: the WebRTC input socket is down.\n * Hardware-keyboard setup failures leave other input available, but Paste and\n * Copy fail until the viewer reconnects and setup succeeds.\n */\n inputError: string | null;\n /** Host recording status; unknown until metadata loads, null when no recording was requested. */\n screenRecording: DeviceScreenRecordingStatus | null;\n /**\n * Why a change could end the host recording now, or null when nothing can break it:\n * `\"status-unknown\"` until the first recording status arrives, `\"recording\"` while it is\n * waiting, recording or finalizing. Calls to `rotate`, `setOrientation`,\n * `updateStreamSettings`, `setStreamSource`, `setGrpcImageMode`, `setGrpcEncoder` and\n * `setGrpcInputSource` are silently ignored while it is set, so UIs can disable those controls\n * and explain why from this one value. An orientation choice that was still waiting when the\n * lock started is dropped the same way: it is cleared from `orientation`, without an\n * `orientationError`. Only Android reports recordings today.\n *\n * Temporary: Android's recording restarts with the encoder. Once recordings survive rotation\n * and stream changes, it is always null.\n */\n recordingLock: DeviceRecordingLockReason | null;\n /**\n * True while {@link recordingLock} is set. Once recordings survive rotation and stream\n * changes, it is always false and then deprecated.\n */\n recordingControlsLocked: boolean;\n /** Screen size once known; null while connecting. */\n screen: ScreenSize | null;\n /**\n * Fold state and controls of a foldable device, such as the iPhone Duo; null\n * for a device that does not fold. `capabilities.fold` lists the commands\n * that it accepts.\n */\n fold: DeviceFold | null;\n /**\n * The displays of a device that streams each display on its own, in the\n * device's order; null for a device with one stream.\n */\n displays: readonly DeviceDisplay[] | null;\n /**\n * URL of a 3D model of this device that the backend serves, with this\n * connection's session token. For the iPhone Duo it is Xcode's DeviceKit\n * USDZ from the host's Xcode. Null when the backend has no model for the\n * device.\n */\n deviceModelUrl: string | null;\n /**\n * The glass corners of the display that `screen` describes, for the flat\n * view, oriented with the device; null keeps the presentation's generic\n * shape for the platform. Set for the iPhone Duo, whose displays the\n * generic iPhone shape cannot express.\n */\n displayCorners: DisplayCornerRadii | null;\n /** Best-effort frames-per-second (0 when unavailable). */\n fps: number;\n /** Running devices the server exposes (may be a placeholder list). */\n devices: RunningDevice[];\n /** Rolling buffer of recent log lines (best-effort; may be empty). */\n logs: DeviceLog[];\n /**\n * Whether the log stream is currently attached. Logs are **off by default** —\n * nothing is collected until {@link attachLogs} is called.\n */\n logsEnabled: boolean;\n /** Start streaming device logs (syslog / logcat). */\n attachLogs: () => void;\n /** Stop streaming device logs; keeps the lines already collected. */\n detachLogs: () => void;\n /** Drop all collected log lines. */\n clearLogs: () => void;\n\n /** Rolling buffer of normalized touch, command, and UI-setting events. */\n events: DeviceEvent[];\n /** Whether the client is currently subscribed to/polling backend events. */\n eventsEnabled: boolean;\n /** Start observing backend events. */\n attachEvents: () => void;\n /** Stop observing events while retaining the current rows. */\n detachEvents: () => void;\n /** Clear the event rows visible in this client. */\n clearEvents: () => void;\n\n /** Live app activity, or null before the metrics endpoint is resolved. */\n activity: DeviceActivity | null;\n /**\n * `idle` while disabled or unsupported, `loading` during discovery/attachment,\n * `ready` after stream metadata or a valid sample, then `error` on failure.\n * Independent of video. Errors retain cached activity; quiet streams use `activity.stale`.\n */\n activityStatus: DeviceActivityStatus;\n\n /** Backend-supported simulator/device options and their current values. */\n deviceSettings: DeviceSettings | null;\n /** `idle` while disabled, `loading` during discovery/initial read, then `ready` or `error`.\n * Independent of video and app activity. Failed refreshes retain cached deviceSettings.\n */\n deviceSettingsStatus: DeviceSettingsStatus;\n /** Options currently being changed. Writes to other options remain available. */\n deviceSettingsPending: ReadonlySet<DeviceSettingKey>;\n /** Change one simulator/device option. Unsupported keys are ignored by each backend. */\n setDeviceSetting: (key: DeviceSettingKey, value: string) => void;\n /**\n * The device's smallest-width dp that the Display size control surfaces, or\n * null when it is unknown.\n */\n displayWidthDp: number | null;\n\n /** Emulator camera feeds, or null before the first read or when the backend has none. */\n camera: DeviceCameraStatus | null;\n /** Facings with an image write or reset in flight. */\n cameraPending: ReadonlySet<DeviceCameraFacing>;\n /** Last failed camera write, cleared when the next write starts. */\n cameraError: string | null;\n /** Replace one facing's picture with a PNG. The backend refuses other formats. */\n setCameraImage: (facing: DeviceCameraFacing, png: Blob) => void;\n /** Restore the backend's \"no image set\" card for one facing. */\n clearCameraImage: (facing: DeviceCameraFacing) => void;\n\n /** Last accessibility snapshot, or null before the first successful read. */\n accessibility: AccessibilitySnapshot | null;\n accessibilityPending: boolean;\n /** Last failed read, cleared when the next read starts. */\n accessibilityError: string | null;\n /** Read the accessibility tree of the current screen once. Backends do not stream it. */\n refreshAccessibility: () => void;\n\n /**\n * The last fix a backend confirmed applying, or null when none is known. serve-emu\n * remembers it for the life of its session (`GET /api/location`); serve-sim has no\n * read, so this client remembers what it applied and forgets on reload.\n */\n location: DeviceGeoFix | null;\n /** True while a set or clear is in flight. Another write is ignored until it settles. */\n locationPending: boolean;\n /** Last failed location write, cleared when the next write starts. */\n locationError: string | null;\n /** Point the device at one coordinate. */\n setLocation: (fix: DeviceGeoFix) => void;\n /** Remove the simulated fix. A no-op unless `capabilities.location` carries `clear`. */\n clearLocation: () => void;\n\n /** Permissions of the foreground app, or null while unknown or without a foreground app. */\n permissions: readonly AppPermission[] | null;\n /** Permission ids with a write in flight. A reset holds every id. */\n permissionsPending: ReadonlySet<string>;\n /** Last failed permission request, cleared when the next write starts or a read succeeds. */\n permissionsError: string | null;\n /** Grant or revoke one permission of the foreground app. */\n setPermission: (id: string, action: AppPermissionAction) => void;\n /** Return every permission of the foreground app to its default. */\n resetPermissions: () => void;\n /** Read the list again, for example when the section opens. */\n refreshPermissions: () => void;\n\n /**\n * Paste text into the focused field of the device app. Keys typed after the call wait until the\n * text lands. Without `text`, the device pastes its own clipboard, as Command+V does. Rejects\n * unless `capabilities.clipboard` has `paste`. The client never reads the browser clipboard; the\n * caller passes its text.\n */\n pasteText: (text?: string) => Promise<void>;\n /**\n * Press Command+C on the device after all earlier input, and resolve to the text that the app\n * copied. Rejects when the app copies no new text, and unless `capabilities.clipboard` has\n * `copy`. The client never writes the browser clipboard.\n */\n copyText: () => Promise<string>;\n /**\n * Counts the clipboard actions that started. It changes when a Paste or Copy starts, also when\n * `clipboardPending` keeps its value, so the host page can tell a new action from the previous one.\n */\n clipboardActionId: number;\n /** The latest clipboard action, retained after completion for its error and warning. */\n clipboardAction: DeviceClipboardAction | null;\n /** The latest clipboard action while it is in flight, or null. */\n clipboardPending: DeviceClipboardAction | null;\n /**\n * Why the latest clipboard action failed, cleared when the next one starts. The client and\n * `DeviceScreen` do not show it, and `DeviceScreen` ignores the rejection of its Command+V paste.\n * The host page must show it.\n */\n clipboardError: string | null;\n /**\n * A key that can still be held on the device after the latest Paste or Copy, cleared when the\n * next one starts. A failed action can also set it. After a good action the text was moved, so\n * this is not an error. The client and `DeviceScreen` do not show it; the host page must show it.\n */\n clipboardWarning: string | null;\n\n /** Backend-supported viewer transport and codec choices; null hides stream controls. */\n streamCapabilities: DeviceStreamCapabilities | null;\n /** Runtime encoder settings, available when `capabilities.streamSettings` lists any keys. */\n streamSettings: DeviceStreamEncoderSettings | null;\n streamSettingsPending: boolean;\n /** Patch one or more runtime encoder values. */\n updateStreamSettings: (patch: Partial<DeviceStreamEncoderSettings>) => void;\n /** Active Android capture source; null when the backend does not expose source switching. */\n streamSource: DeviceStreamSourceStatus | null;\n /**\n * True from a capture-source request until the replacement stream is on\n * screen (or the request fails), so controls and frame change together.\n */\n streamSourcePending: boolean;\n /** Last capture-source write failure; cleared when another write begins. */\n streamSourceError: string | null;\n /** Stage and atomically activate another Android capture source. */\n setStreamSource: (source: DeviceStreamSource) => void;\n /** Restart the gRPC source with compressed PNG or shared-memory RGB delivery. */\n setGrpcImageMode: (mode: DeviceGrpcImageMode) => void;\n /** Restart gRPC capture with software or strictly hardware H.264 encoding. */\n setGrpcEncoder: (encoder: DeviceGrpcEncoder) => void;\n /** Restart gRPC streaming with scrcpy or emulator-gRPC input delivery. */\n setGrpcInputSource: (source: DeviceInputSource) => void;\n /** Live WebRTC stream telemetry; null for HTTP/WebSocket transports. */\n streamStats: DeviceStreamStats | null;\n /** Enable telemetry polling while a consumer is displaying WebRTC statistics. */\n setStreamStatsEnabled: (enabled: boolean) => void;\n /** Requested WebRTC codec for this viewer. */\n webRtcCodec: DeviceWebRtcCodec;\n setWebRtcCodec: (codec: DeviceWebRtcCodec) => void;\n\n /** Backend feature availability. Presentation uses this to omit unsupported UI. */\n capabilities: DeviceCapabilities;\n /**\n * The app currently in the foreground, or `null` while unknown. serve-sim\n * pushes changes over its `{base}/appstate` SSE (SpringBoard log driven,\n * bootstrapped with the current frontmost app); serve-emu polls\n * `GET /api/foreground` (dumpsys). Best-effort — stays `null` on a backend\n * that can't report it (e.g. a bare serve-sim helper with no middleware).\n */\n foregroundApp: ForegroundApp | null;\n\n /** Element kind {@link DeviceScreen} should render for this client. */\n videoKind: VideoSurfaceKind;\n /**\n * Ref callback for the paint target. The hook owns the element: `canvas`\n * receives decoded H.264 frames, `img` points at MJPEG, and `video` receives\n * a WebRTC MediaStream.\n */\n attachVideo: (el: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement | null) => void;\n\n /** Forward a normalized touch/drag to the device. */\n sendTouch: (sample: TouchSample) => void;\n /** Forward a two-finger pinch/pan. Absent only on the no-op client. */\n sendMultiTouch?: (sample: MultiTouchSample) => void;\n /** Discard queued input after its browser interaction loses ownership. */\n cancelInput?: () => void;\n /**\n * Forward a physical browser-keyboard event to the device. Returns true when\n * the event was accepted, allowing {@link DeviceScreen} to suppress the\n * corresponding browser action while the streamed device has focus.\n */\n sendKey: (input: KeyboardInput) => boolean;\n /**\n * Type pre-mapped HID key events — e.g. what {@link KeyboardCapture} derives\n * from phone-keyboard text — paced so iOS doesn't coalesce a burst into lost\n * keystrokes. Present only on backends with a HID key channel (serve-sim).\n */\n sendKeyEvents?: (events: ReadonlyArray<HidKeyEvent>) => void;\n /**\n * Forward a scroll-wheel / trackpad pan as a native scroll, so the device\n * pans content exactly as it would for a physical wheel (no synthesized\n * drag). Present only on backends that support it (serve-sim).\n */\n sendScroll?: (sample: ScrollSample) => void;\n /** Press a hardware button. */\n pressButton: (button: HardwareButton) => void;\n /**\n * Reload the running React Native/Expo bundle. serve-sim injects ⌘R over the\n * helper's key channel; serve-emu injects a hardware \"R\" keypress over scrcpy.\n * A no-op if nothing is connected; harmless if the foreground app isn't RN.\n */\n reload: () => void;\n /**\n * Rotate the device to the next pose in `DEVICE_ORIENTATIONS` order, or clockwise on an\n * iPhone Duo, as Xcode's Device Hub turns it. serve-sim sends it\n * over the helper's orientation channel; serve-emu locks it via `POST /api/orientation`,\n * like {@link setOrientation}. A serve-emu server that does not report its pose gets the\n * opposite of the frame's portrait or landscape aspect. A no-op if nothing is connected.\n */\n rotate: () => void;\n /**\n * The pose the device is turned to: the last choice from {@link setOrientation} while it is\n * pending and until the backend reports again, then the backend's report. Null when the\n * backend reports no pose, also after a {@link rotate}; `capabilities.orientation` is then\n * `false`. Unlike `screen.orientation`, it can lead the video frames.\n */\n orientation: DeviceOrientation | null;\n /**\n * True while the backend has not answered a {@link setOrientation} choice: serve-sim has not\n * sent it yet, or serve-emu has not answered its `POST /api/orientation`.\n */\n orientationPending: boolean;\n /** Last failed orientation change, cleared when the next one starts. */\n orientationError: string | null;\n /**\n * Why {@link rotate} and {@link setOrientation} cannot turn the device now, or null when they\n * can. Disable orientation controls while it is set. Android reports\n * `\"recording-status-unknown\"` or `\"recording\"` while {@link recordingLock} is set, and those\n * calls are dropped silently. iOS reports `\"input-unavailable\"` while the helper input socket\n * cannot take input, and those calls still try and can fail with an `orientationError`. See\n * {@link DeviceOrientationUnavailableReason} for each reason.\n */\n // @ref LLP 0013#orientation — iOS sends the pose over the input socket, Android over HTTP\n orientationUnavailable: DeviceOrientationUnavailableReason | null;\n /**\n * Turn the device to one orientation, and show it in {@link orientation} at once.\n * serve-sim sends it over the helper's orientation channel, and a later {@link rotate}\n * continues the cycle from it; serve-emu locks the matching user rotation via\n * `POST /api/orientation`, one request at a time, so the last choice wins and only its\n * answer or failure is shown. Ignores values missing from `capabilities.orientation`. A\n * foreground app that does not support the orientation can keep its layout.\n */\n setOrientation: (orientation: DeviceOrientation) => void;\n /**\n * Capture a still PNG of the device via the backend's `POST /api/screenshot`\n * (serve-emu `adb screencap` / serve-sim `simctl io screenshot`), resolving\n * to the PNG and its session artifact outcome, or `null` if capture fails or\n * nothing is connected. The caller decides what to do with it (e.g. trigger\n * a file download).\n */\n screenshot: () => Promise<ScreenshotCapture | null>;\n\n /**\n * Current device system appearance (dark/light), or `null` while unknown or on\n * a backend that can't report it (e.g. a bare serve-sim helper with no\n * middleware). Read once the connection resolves; updated by {@link setAppearance}.\n */\n appearance: DeviceAppearance | null;\n /**\n * Set the device's system appearance. serve-sim runs `simctl ui <udid>\n * appearance <mode>` (over the middleware exec-ws); serve-emu posts `uimode\n * night yes|no`. No-op on a backend that can't set it.\n */\n setAppearance: (mode: DeviceAppearance) => void;\n\n /**\n * Whether Simulator currently treats the Mac keyboard as connected to the\n * guest. iOS only; null while the helper is unavailable or on Android. The\n * Hub preserves the selected mode on desktop admission; touch admission\n * disconnects it so the on-screen keyboard can show.\n */\n hardwareKeyboardConnected: boolean | null;\n /**\n * Connect or disconnect the Mac keyboard from the iOS guest (serve-sim's\n * `hardware-keyboard` simulator setting, over the middleware exec channel).\n */\n setHardwareKeyboardConnected: (connected: boolean) => void;\n /** Toggle the iOS on-screen software keyboard without changing the hardware connection. */\n toggleSoftwareKeyboard: () => void;\n}\n\n/** A platform implementation of the connection half of the interface. */\nexport type DeviceClientHook = (options: DeviceConnectionOptions) => DeviceClient;\n\n/**\n * The client fields read by DeviceScreen, including the fold for its\n * Option+Shift pose shortcuts. Full DeviceClient values remain valid inputs.\n */\nexport type DeviceScreenClient = Pick<\n DeviceClient,\n | \"videoKind\"\n | \"attachVideo\"\n | \"sendTouch\"\n | \"sendMultiTouch\"\n | \"cancelInput\"\n | \"sendScroll\"\n | \"sendKey\"\n | \"fold\"\n | \"pasteText\"\n | \"capabilities\"\n | \"screen\"\n | \"status\"\n | \"error\"\n | \"framePresented\"\n | \"inputError\"\n>;\n\n/** Props for the shared {@link DeviceScreen} component rendered inside PhoneFrame. */\nexport interface DeviceScreenProps {\n /** Keep a mobile viewer’s capture input focused while touching the stream. */\n preserveKeyboardFocus?: boolean;\n client: DeviceClient;\n /** Host-owned browser clipboard Copy. Without it, Command+C stays native keys. */\n onCopy?: () => Promise<void>;\n /** Last active Argent gesture for the streamed device; removed after its idle timeout. */\n agentInteraction?: AgentInteraction | null;\n /** Corner radius for the video surface (matches the PhoneFrame placeholder). */\n borderRadius?: CSSProperties[\"borderRadius\"];\n /** Apply the iOS `corner-shape: squircle`. */\n squircle?: boolean;\n}\n\n/** The built-in screen also accepts the inputs returned by useDeviceScreenClient. */\nexport interface DeviceScreenInputProps extends Omit<DeviceScreenProps, \"client\"> {\n client: DeviceScreenClient;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;CAiBC,GAytCD,mFAAmF,GACnF,WAEC"}
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["/**\n * The common device-client interface.\n *\n * Expo Hub mirrors live simulators (serve-sim) and emulators (serve-emu) inside\n * the {@link PhoneFrame}, in place of the static `<img>` placeholder. Both\n * backends speak very different wire protocols — serve-sim streams MJPEG/H.264\n * and takes binary touch packets over its own WebSocket; serve-emu streams\n * H.264 (WebCodecs) and takes JSON gestures over a single WebSocket — so this\n * file defines one shared shape both can implement:\n *\n * - {@link DeviceClientProvider} to own the connection, with {@link useDeviceClient}\n * and {@link useDeviceClientSelector} to read its state and controls, and\n * - a **component** ({@link DeviceScreen}, see `./DeviceScreen.tsx`) that paints\n * the stream and forwards pointer/gesture input.\n *\n * Pass the result of {@link useDeviceScreenClient} to `DeviceScreen` to follow\n * screen and input changes without subscribing to metrics, FPS or logs.\n */\n\nimport { type CSSProperties } from \"react\";\n\nimport { type FoldControlCommand, type FoldPose } from \"./fold\";\n\nexport type DevicePlatform = \"ios\" | \"android\";\n\n/** Viewer-selected transport for the active device stream. */\nexport type DeviceStreamMode = \"mjpeg\" | \"h264\" | \"webrtc\";\n\n/**\n * Lifecycle of one screen session. A session is one connection (server,\n * device, token) with one surface (the flat screen, or the separate displays)\n * and one media element kind; changing any of them starts a new session.\n * idle — nothing to connect to (no base URL / disabled)\n * connecting — the session has not presented a frame yet. Consumers show\n * loading UI. Becomes `error` after 30 s without a frame,\n * while the client keeps retrying.\n * reconnecting — the session presented a frame and its stream is being\n * re-established, for example after a WebRTC reconnect, a\n * helper restart, or an Android capture-source switch. The\n * last frame stays on screen meanwhile; consumers show no\n * loading UI. Android reports `error` when the outage\n * outlives its reconnect grace period; iOS after 30 s. The\n * client keeps retrying in both cases.\n * streaming — frames are flowing\n * error — the connection failed, or its first frame did not come in time\n */\nexport type ConnectionStatus = \"idle\" | \"connecting\" | \"reconnecting\" | \"streaming\" | \"error\";\n\n/** How the device faces: serve-sim's stream config, or serve-emu's display rotation. */\nexport type DeviceOrientation =\n | \"portrait\"\n | \"portrait_upside_down\"\n | \"landscape_left\"\n | \"landscape_right\";\n\n/**\n * A display of a foldable device, named by its role so that every platform\n * uses the same identity: `cover` is the outside display that works while the\n * device is closed, `inner` the main display that folds.\n */\nexport type DeviceDisplayId = \"cover\" | \"inner\";\n\n/**\n * Native pixel size of the streamed screen — drives the PhoneFrame aspect ratio.\n * The same object names the display that it describes, so a size, an\n * orientation, and a display always change together.\n */\nexport interface ScreenSize {\n width: number;\n height: number;\n /** Last known orientation, when the backend reports it (serve-sim, serve-emu). */\n orientation?: DeviceOrientation;\n /**\n * True when frames already show the display as it faces (serve-emu), so the client never\n * turns the video. serve-sim can send raw portrait frames for a turned device instead.\n */\n framesUpright?: boolean;\n /** Native input setup failed; video can continue without touch or keyboard. */\n inputUnavailable?: boolean;\n /**\n * The display that this size and orientation describe, as native readback\n * confirmed it. Set only for a foldable that reports it (the iPhone Duo).\n */\n display?: DeviceDisplayId;\n}\n\n/**\n * Corner radii of the shown display's glass as the viewer sees it, clockwise\n * from top left, each a fraction of the displayed width. serve-sim reads them\n * from Xcode's DeviceKit profile; the iPhone Duo's cover, for example, is\n * nearly square at the hinge and round at the outer edge.\n */\nexport interface DisplayCornerRadii {\n topLeft: number;\n topRight: number;\n bottomRight: number;\n bottomLeft: number;\n}\n\n/**\n * The fold controls a device offers; `false` for a device without them. A\n * device without a hinge, a device whose hinge the backend cannot move, and\n * a device whose fold state is not reported yet all report `false`.\n */\nexport type DeviceFoldCapabilities =\n | false\n | Readonly<{\n /**\n * The hinge angles that the device accepts, in degrees, as for\n * {@link DeviceFold.angle}. `false` when the device applies poses only.\n */\n angle: Readonly<{ min: number; max: number }> | false;\n /**\n * The named poses that the device can apply, each with the hinge angle\n * that it sets. A pose that is not listed is not offered.\n */\n poses: Readonly<Partial<Record<FoldPose, Readonly<{ angle: number }>>>>;\n /** A persistent table state (Xcode's Table Mode); `DeviceFold.tableMode` is then present. */\n tableMode: boolean;\n }>;\n\n/**\n * One step of a fold command, or a rotation, as the client handles it. Each\n * event carries the command object that `setControl` queued, so a listener can\n * match a step to its request. A command can end without an event of its own:\n * while it waits in the queue, a newer command of the same control replaces it,\n * and a pose command clears the whole queue. Such a command gets `requested`\n * and nothing after it.\n */\nexport type FoldCommandEvent =\n /** `setControl` queued the command; `angle`, `pose`, and `tableMode.enabled` already preview it. */\n | { type: \"requested\"; command: FoldControlCommand }\n /**\n * The command went to the device. `display` is the display that the command\n * makes active, when the command alone decides it.\n */\n | { type: \"sent\"; command: FoldControlCommand; display?: DeviceDisplayId }\n /** The device answered the command. A rejection is followed by `failed`. */\n | { type: \"acknowledged\"; command: FoldControlCommand; ok: boolean }\n /**\n * The preview of the acknowledged commands ends, and the fold shows what the\n * device reports again. `observed` is true when the device reported the\n * requested state. It is false when the iOS simulator's native readback did\n * not reach that state within 500 ms of the command's config: the fold then\n * shows the readback, not the request.\n */\n | { type: \"confirmed\"; observed: boolean }\n /** A command failed, `error` says why, and the client dropped every unconfirmed command. */\n | { type: \"failed\"; error: string }\n /**\n * `setControl` refused a command that `capabilities.fold` does not offer,\n * before any `requested`. Commands already queued or sent go on.\n */\n | { type: \"rejected\"; command: FoldControlCommand; error: string }\n /**\n * The client left the helper session that owned the commands, for example\n * for another device or a replaced helper at the same URL. It dropped every\n * unconfirmed command without an error, and forgot `physical.pose`.\n */\n | { type: \"reset\" }\n /**\n * The viewer rotated the device, which clears its named pose, by\n * `quarterTurns` (clockwise positive): one for Rotate, or the turns to the\n * orientation that the viewer chose.\n */\n | { type: \"rotated\"; quarterTurns: number };\n\n/** The persistent table state of {@link DeviceFold}, present when `capabilities.fold.tableMode`. */\nexport interface DeviceFoldTableMode {\n /**\n * The pending request while a command awaits confirmation, then the setting\n * that the device reports; undefined until reported.\n */\n enabled?: boolean;\n /** Whether the current pose allows it to be turned on; undefined until reported. */\n available?: boolean;\n}\n\n/**\n * How the device is held, apart from its hinge angle. Present when the backend\n * reports it: the iOS adapter reports it together with `capabilities.fold`.\n * Android emulators have no physical stance to report.\n */\nexport interface DeviceFoldPhysical {\n /**\n * The pose whose stance the device holds, which a later angle change keeps\n * (Laptop stays on the table). Undefined follows `pose`; null is unknown,\n * for example after a rotation.\n */\n pose?: FoldPose | null;\n /**\n * Lying face down with Table Mode, which makes the cover display active.\n * Undefined while the backend has not reported enough to tell: a consumer\n * then keeps what it last knew instead of treating the device as face up.\n */\n faceDown?: boolean;\n}\n\n/**\n * Fold state and controls of a foldable device. Angles and poses show the\n * pending request until its `confirmed` event, then the values that the\n * device reports, which need not match the request. `DeviceClient.capabilities.fold` says which commands the\n * device accepts.\n */\nexport interface DeviceFold {\n /**\n * Hinge angle in degrees, between the display sides of the two halves: 180\n * is flat, a smaller angle folds the displays inward (0 is shut), and a\n * fold-out hinge goes past 180. Undefined until reported.\n */\n angle?: number;\n /** Named pose in effect, null for a custom angle, undefined until reported. */\n pose?: FoldPose | null;\n /** A fold command awaits the device's acknowledgement. */\n pending: boolean;\n /** The last failed fold command, cleared when the next one starts. */\n error: string | null;\n /** Present exactly when `capabilities.fold.tableMode` is true. */\n tableMode?: DeviceFoldTableMode;\n /** Present when the backend reports how the device is held. */\n physical?: DeviceFoldPhysical;\n /**\n * Send a fold command that `capabilities.fold` offers. A command that it does\n * not offer never reaches the device: `error` says why, and `observe` gets\n * `rejected`. Commands already queued or sent go on.\n */\n setControl: (command: FoldControlCommand) => void;\n /**\n * Follow every fold command and rotation of this client, whichever control\n * started it, as {@link FoldCommandEvent}s. Returns a function that stops\n * the listener. Absent when the backend reports no command lifecycle.\n */\n observe?: (listener: (event: FoldCommandEvent) => void) => () => void;\n}\n\n/**\n * One display of a device that streams each display on its own, such as the\n * iPhone Duo's cover and inner display.\n */\nexport interface DeviceDisplay {\n id: DeviceDisplayId;\n /**\n * The display that the device presents. The fold state elects it, so it\n * follows a requested fold at once. `screen.display` is the display that\n * native readback confirmed, and input addressed to a display waits for it.\n */\n active: boolean;\n /**\n * Ref callback for this display's paint target, an element of the client's\n * {@link DeviceClient.videoKind}, as for {@link DeviceClient.attachVideo}.\n * While any display has an element, the client streams each attached display\n * and parks the flat stream; `status`, `error`, `fps`, and `streamStats` then\n * follow the active display. Detaching every display resumes the flat stream.\n */\n attachVideo: (el: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement | null) => void;\n}\n\n/** A simulator/emulator the server reports as running. */\nexport interface RunningDevice {\n /** udid (iOS) / adb serial (Android). */\n id: string;\n name: string;\n /** e.g. \"iOS 27.0\" / \"Android 16\". */\n system?: string;\n platform: DevicePlatform;\n /** True for the device this connection is currently streaming. */\n current?: boolean;\n}\n\n/** A single line of device output (syslog / logcat). */\nexport interface DeviceLog {\n id: string;\n /** Short monospace source tag, e.g. `logcat` / `syslog`. */\n source: string;\n message: string;\n}\n\n/** A normalized device interaction or command reported by a device backend. */\nexport interface DeviceEvent {\n /** Stable within a device session and namespaced by the backend/device. */\n id: string;\n /** ISO timestamp reported by the backend. */\n timestamp: string;\n /** Backend event source, e.g. `hid`, `ui`, `ws`, or `rest:tap`. */\n source: string;\n /** Broad event category used for display and filtering. */\n kind: string;\n /** More specific operation within {@link kind}, when available. */\n action?: string;\n /** Whether the backend reported the operation as successful or failed. */\n status?: \"ok\" | \"error\";\n /** Human-readable, privacy-safe event summary. */\n message: string;\n /** Structured event data retained for future richer presentation. */\n details?: Record<string, unknown>;\n}\n\n/** Simulator/device-wide settings exposed by serve-sim and serve-emu. */\nexport type DeviceSettingKey =\n | \"appearance\"\n | \"network\"\n | \"liquid-glass\"\n | \"color-filter\"\n | \"text-size\"\n | \"display-size\"\n | \"reduce-motion\"\n | \"bold-text\"\n | \"increase-contrast\"\n | \"onscreen-keyboard\"\n | \"show-borders\"\n | \"reduce-transparency\"\n | \"voiceover\";\n\n/** Current backend-reported values. Missing keys are unavailable; `unsupported` keys are hidden. */\nexport type DeviceSettings = Partial<Record<DeviceSettingKey, string>>;\n\n/** Settings availability for the selected device, independent of video and app activity. */\nexport type DeviceSettingsStatus = \"idle\" | \"loading\" | \"ready\" | \"error\";\n\n/** Which emulator camera a feed drives. */\nexport type DeviceCameraFacing = \"back\" | \"front\";\n\n/** One emulator camera fed from a PNG on the host. */\nexport interface DeviceCameraFeed {\n facing: DeviceCameraFacing;\n /** True while the feed still holds the backend's \"no image set\" test card. */\n placeholder: boolean;\n width: number | null;\n height: number | null;\n bytes: number | null;\n /** Same-origin URL of the current PNG, or null when no file exists yet. Embeds the digest so a changed image refetches. */\n imageUrl: string | null;\n}\n\n/** Host-side still-image camera feeds for an Android emulator. */\nexport interface DeviceCameraStatus {\n /** True when the emulator was launched with the feed files attached. False means images are stored but never shown. */\n wiredAtLaunch: boolean;\n feeds: readonly DeviceCameraFeed[];\n}\n\n/** One live CPU, memory, and network sample for the foreground iOS app. */\nexport interface DeviceActivitySample {\n /** Milliseconds since the backend sampler started. */\n t: number;\n bundleId: string | null;\n /** Per-core CPU utilization. It can exceed 100 on multicore workloads. */\n cpuPct: number;\n memBytes: number;\n netInBytesPerSec: number;\n netOutBytesPerSec: number;\n}\n\n/** Metrics discovery and stream readiness, independent of video and sample freshness. */\nexport type DeviceActivityStatus = \"idle\" | \"loading\" | \"ready\" | \"error\";\n\n/** Rolling activity history and health for the selected device. */\nexport interface DeviceActivity {\n hostCores: number | null;\n samples: DeviceActivitySample[];\n errored: boolean;\n stale: boolean;\n}\n\n/** Viewer-local HTTP stream codec selection. */\nexport type DeviceHttpCodec = \"auto\" | \"mjpeg\" | \"h264\";\n\n/** Viewer-local WebRTC codec selection. */\nexport type DeviceWebRtcCodec = \"h264\" | \"vp9\" | \"vp8\";\n\n/** Stream transports and codecs supported by the active backend. */\nexport interface DeviceStreamCapabilities {\n modeAvailability: Record<DeviceStreamMode, boolean>;\n httpCodecs: readonly DeviceHttpCodec[];\n webRtcCodecs: readonly DeviceWebRtcCodec[];\n}\n\n/** Runtime encoder settings exposed by a backend's stream-settings endpoint. */\nexport interface DeviceStreamEncoderSettings {\n mjpegFps: number;\n mjpegQuality: number;\n maxDimension: number;\n h264Bitrate: number;\n h264Fps: number;\n}\n\n/** Android capture implementations exposed by serve-emu. */\nexport type DeviceStreamSource = \"scrcpy\" | \"grpc-screenshot\";\n\n/** Pixel delivery selected for the emulator gRPC screenshot source. */\nexport type DeviceGrpcImageMode = \"png\" | \"mmap\" | \"rgb888\";\n\n/** Host H.264 encoder used for emulator gRPC screenshots. */\nexport type DeviceGrpcEncoder = \"software\" | \"hardware\";\n\n/** Input transport used while gRPC provides emulator video. */\nexport type DeviceInputSource = \"scrcpy\" | \"grpc\";\n\n/** Authoritative source state for the selected Android device session. */\nexport interface DeviceStreamSourceStatus {\n /** Effective idle frame repeat interval; omitted by older Android servers. Zero disables repeats. */\n repeatFrameMs?: number;\n mode: DeviceStreamSource;\n grpcImageMode: DeviceGrpcImageMode;\n encoder: DeviceGrpcEncoder;\n /** Active ffmpeg encoder; null before capture starts or when using scrcpy. */\n encoderName: string | null;\n availableEncoders: readonly DeviceGrpcEncoder[];\n hardwareEncoderError?: string;\n inputSource: DeviceInputSource;\n availableInputSources: readonly DeviceInputSource[];\n availableModes: readonly DeviceStreamSource[];\n sessionGeneration: number;\n}\n\n/** Runtime encoder values the active backend can change without restarting the Hub. */\nexport type DeviceStreamSettingCapabilities =\n | false\n | Readonly<Partial<Record<keyof DeviceStreamEncoderSettings, true>>>;\n\n/** A WGS84 coordinate the Hub asks a device to report. */\nexport interface DeviceGeoFix {\n latitude: number;\n longitude: number;\n}\n\n/**\n * Location control the backend offers. `false` hides the section. Every backend that\n * offers it can set a fix; `clear` marks one that can also remove it (serve-sim only —\n * `adb emu geo fix` has no inverse).\n */\nexport type DeviceLocationCapabilities = false | Readonly<{ clear?: true }>;\n\n/**\n * Orientations that `setOrientation` can turn the device to. `false` when the backend cannot\n * turn the device to one pose or cannot report the pose it shows (an older serve-emu server);\n * `rotate` still works where the backend supports it.\n */\nexport type DeviceOrientationCapabilities =\n | false\n | Readonly<{ orientations: readonly DeviceOrientation[] }>;\n\n/**\n * Why an orientation change cannot go out now. New reasons can be added, so handle unknown\n * values.\n *\n * - `\"recording-status-unknown\"` and `\"recording\"` come from {@link DeviceClient.recordingLock}\n * (`\"status-unknown\"` and `\"recording\"`). A call is dropped silently: no request, no\n * `orientationPending` and no `orientationError`.\n * - `\"input-unavailable\"`: serve-sim sends the pose over the helper's input socket, which is not\n * admitted or reports that the simulator cannot take input. The video stream does not matter.\n * A call still tries: the input queue keeps it for a short time and then reports an\n * `orientationError`.\n */\nexport type DeviceOrientationUnavailableReason =\n | \"recording-status-unknown\"\n | \"recording\"\n | \"input-unavailable\";\n\n/** Text Paste into and Copy from the device app. `false` hides clipboard controls. */\nexport type DeviceClipboardCapabilities = false | Readonly<{ paste: boolean; copy: boolean }>;\n\n/** The clipboard action whose result the client shows. */\nexport type DeviceClipboardAction = \"paste\" | \"copy\";\n\n/** One WebRTC telemetry sample, normally collected once per second. */\nexport interface DeviceStreamStatsSample {\n atMs: number;\n /** Frames produced by the active backend WebRTC source/encoder. */\n serverFps: number | null;\n /** Video frames actually presented by the browser. */\n clientFps: number | null;\n /** Actual inbound video media bitrate, derived from `bytesReceived`. */\n clientBitrateBps: number | null;\n /** Packet loss over this sample window, expressed as a ratio from 0 to 1. */\n clientPacketLossRatio: number | null;\n /** Current inbound RTP jitter reported by the browser. */\n clientJitterMs: number | null;\n /** Mean jitter-buffer delay per emitted frame over this sample window. */\n clientJitterBufferMs: number | null;\n /** Browser-decoded frames dropped during this sample window. */\n clientDroppedFrames: number | null;\n /** Playback freezes reported during this sample window. */\n clientFreezeCount: number | null;\n /** Total time spent frozen during this sample window. */\n clientFreezeDurationMs: number | null;\n /** Current round-trip time for the browser's selected ICE candidate pair. */\n clientRoundTripMs: number | null;\n /** Whether the browser's selected ICE path is direct, relayed, or unknown. */\n clientIcePath: \"direct\" | \"relay\" | \"unknown\";\n}\n\n/** Latest server-side WebRTC encoder statistics for this viewer. */\nexport interface DeviceStreamEncoderStats {\n codec: string | null;\n encodeFps: number | null;\n targetBitrateBps: number | null;\n encodeMsPerFrame: number | null;\n framesEncoded: number | null;\n framesSent: number | null;\n framesDropped: number | null;\n packetLossRatio: number | null;\n qualityLimitationReason: string | null;\n /** Android publisher submissions per second, derived from consecutive server snapshots. */\n publisherFps: number | null;\n /** H.264 frames accepted by serve-emu's native media track. */\n publisherSubmittedFrames: number | null;\n /** Frames rejected by serve-emu's keyframe gate or native backpressure. */\n publisherDroppedFrames: number | null;\n /** Submitted H.264 payload bitrate, excluding RTP/SRTP/transport overhead and retransmits. */\n payloadBitrateBps: number | null;\n}\n\n/** Median and 95th-percentile timings in milliseconds. */\nexport interface DeviceStreamTimingQuantiles {\n p50: number | null;\n p95: number | null;\n}\n\n/** Latest gRPC screenshot producer, transport, and host-copy diagnostics. */\nexport interface DeviceGrpcCaptureStats {\n /** Selected emulator screenshot delivery strategy. */\n imageMode: DeviceGrpcImageMode | null;\n /** Emulator frame-production cadence inferred from source timestamps. */\n producerFps: number | null;\n /** Raw screenshot messages reaching serve-emu. */\n receiveFps: number | null;\n /** Valid images available to the host encoder. */\n usableImageFps: number | null;\n /** Fresh images submitted to FFmpeg, excluding deliberate idle repeats. */\n encoderInputFps: number | null;\n /** Raw screenshot notifications received from the emulator. */\n messagesReceived: number | null;\n /** Notifications selected for decoding/copying after capture pacing. */\n messagesEmitted: number | null;\n /** Pending notifications replaced by a newer frame before capture. */\n messagesCoalesced: number | null;\n sequenceGaps: number | null;\n imagePayloadBytes: number | null;\n transportBytes: number | null;\n messageBytesReceived: number | null;\n mmapFileBytesRead: number | null;\n mmapReadRetries: number | null;\n mmapTornFramesDropped: number | null;\n productionToReceiveLatencyMs: DeviceStreamTimingQuantiles;\n productionToUsableLatencyMs: DeviceStreamTimingQuantiles;\n protobufDecodeTimeMs: DeviceStreamTimingQuantiles;\n mmapReadCopyTimeMs: DeviceStreamTimingQuantiles;\n}\n\n/** Latest cumulative server-side capture and pacing counters. */\nexport interface DeviceStreamCaptureStats {\n /** Capture is intentionally suspended for a device reboot; older servers omit this. */\n rebooting?: boolean;\n screenFrames: number | null;\n idleFrames: number | null;\n offeredFrames: number | null;\n forwardedFrames: number | null;\n pumpRestarts: number | null;\n /** Null when the active capture source does not expose gRPC diagnostics. */\n grpc: DeviceGrpcCaptureStats | null;\n}\n\n/** Bounded WebRTC telemetry history owned by the device connection. */\nexport interface DeviceStreamStats {\n samples: readonly DeviceStreamStatsSample[];\n encoder: DeviceStreamEncoderStats | null;\n capture: DeviceStreamCaptureStats | null;\n /** True when the peer has not produced a successful sample for four seconds. */\n stale: boolean;\n /** True when the server-side statistics poll has not succeeded for four seconds. */\n serverStale: boolean;\n}\n\n/** A rectangle in 0..1 screen fractions, so every platform taps through `sendTouch` unchanged. */\nexport interface AccessibilityFrame {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** One accessible element of the current screen, normalized across backends. */\nexport interface AccessibilityNode {\n id: string;\n /** Never empty — the parsers drop elements that carry no name. */\n label: string;\n /** iOS role or element type; Android the class-name tail, e.g. `TextView`. */\n role: string;\n enabled: boolean;\n clickable: boolean;\n frame: AccessibilityFrame;\n}\n\nexport interface AccessibilitySnapshot {\n /** Epoch milliseconds. */\n capturedAt: number;\n nodes: readonly AccessibilityNode[];\n}\n\n/** Explicit backend feature flags used to omit unsupported inspector sections and controls. */\nexport interface DeviceCapabilities {\n deviceSettings: boolean;\n activity: boolean;\n events: boolean;\n /** Host-fed emulator camera images that the backend can read and replace. */\n camera: boolean;\n /** An accessibility tree of the current screen that the backend can read on demand. */\n accessibility: boolean;\n /** Runtime encoder settings that can be read and patched. */\n streamSettings: DeviceStreamSettingCapabilities;\n /** Simulated-location control, and whether the fix can also be removed. */\n location: DeviceLocationCapabilities;\n /** Foreground-app permissions that the backend can list and change. */\n permissions: boolean;\n /** Text clipboard actions, in order with keyboard input. */\n clipboard: DeviceClipboardCapabilities;\n /** Orientations that `setOrientation` accepts. */\n orientation: DeviceOrientationCapabilities;\n /** The fold commands that `DeviceClient.fold` accepts. */\n fold: DeviceFoldCapabilities;\n}\n\n/** How the device answers one permission of the foreground app. */\nexport type AppPermissionState = \"granted\" | \"denied\" | \"limited\" | \"undetermined\";\n\n/** One permission row. `id` is the backend name (`android.permission.CAMERA`, `camera`). */\nexport interface AppPermission {\n id: string;\n label: string;\n state: AppPermissionState;\n}\n\nexport type AppPermissionAction = \"grant\" | \"revoke\";\n\n/** The app currently in the foreground on the device. */\nexport interface ForegroundApp {\n /** Bundle identifier (iOS) / package name (Android). */\n id: string;\n /** Human-readable app label (Android `dumpsys`, iOS `CFBundleDisplayName`). */\n label?: string;\n /** Foreground process id, when known. */\n pid?: number;\n /** True when the backend detected a React Native app (serve-sim). */\n isReactNative?: boolean;\n /** Marketing version — iOS `CFBundleShortVersionString` / Android `versionName`. */\n version?: string;\n /** Build identifier — iOS `CFBundleVersion` / Android `versionCode`. */\n build?: string;\n /** App icon as a `data:` URL, when the backend can extract one. */\n iconDataUrl?: string;\n /** Fully-qualified foreground activity (Android). */\n activity?: string;\n /** Whether the app is debuggable (Android). */\n debuggable?: boolean;\n /** Minimum supported Android API level, e.g. 24 (Android). */\n minSdk?: number;\n /** `MinimumOSVersion` from Info.plist (iOS). */\n minOS?: string;\n /** `CFBundleExecutable` from Info.plist (iOS). */\n executable?: string;\n /** Path of the installed `.app` bundle on the host (iOS). */\n appPath?: string;\n}\n\n/** Hardware buttons. Implementations ignore the ones their platform lacks. */\nexport type HardwareButton =\n | \"home\"\n | \"back\"\n | \"recents\"\n | \"power\"\n | \"appSwitcher\"\n /** Dismisses the on-screen keyboard. Not a physical button; grouped here because it presses one key. */\n | \"hideKeyboard\";\n\n/**\n * Device system appearance. Binary on purpose — the Hub exposes a plain\n * light/dark toggle with no \"auto\", even where the backend supports one\n * (serve-emu's `uimode night auto`).\n */\nexport type DeviceAppearance = \"light\" | \"dark\";\n\n/** One normalized (0..1) touch sample. The hook maps it to the wire protocol. */\nexport interface TouchSample {\n phase: \"begin\" | \"move\" | \"end\";\n /**\n * The {@link DeviceDisplay} whose coordinates `x` and `y` use. Without it, the\n * sample addresses the flat stream. A gesture that begins on a display other\n * than `screen.display` is dropped until its end.\n */\n display?: DeviceDisplayId;\n /** An end that abandons unsent touch intent, e.g. conversion to a two-finger gesture. */\n cancelled?: boolean;\n /** 0..1 across the screen width. */\n x: number;\n /** 0..1 down the screen height. */\n y: number;\n /** Whether a `begin` at a screen edge may start a system edge gesture (the iOS swipe-to-home band). Defaults to true. */\n edgeGestures?: boolean;\n}\n\n/** A two-finger gesture sample (pinch/pan). Both points are normalized 0..1. */\nexport interface MultiTouchSample {\n phase: \"begin\" | \"move\" | \"end\";\n /** The display both points address, as for {@link TouchSample.display}. */\n display?: DeviceDisplayId;\n a: { x: number; y: number };\n b: { x: number; y: number };\n}\n\n/** A physical browser-keyboard event forwarded by {@link DeviceScreen}. */\nexport interface KeyboardInput {\n phase: \"down\" | \"up\";\n /** Physical browser key, e.g. `KeyA`, `ShiftLeft`, or `Enter`. */\n code: string;\n /** Layout-resolved value, e.g. `a`, `A`, `é`, or `Enter`. */\n key: string;\n /** Whether this is an auto-repeated keydown. */\n repeat: boolean;\n shiftKey?: boolean;\n metaKey?: boolean;\n ctrlKey?: boolean;\n altKey?: boolean;\n}\n\n/**\n * One HID key transition (USB HID Usage Page 0x07), e.g. produced by\n * {@link KeyboardCapture} from phone-keyboard text. Forwarded as-is over\n * serve-sim's `0x06` key channel.\n */\nexport type HidKeyEvent = { type: \"down\" | \"up\"; usage: number };\n\n/**\n * A scroll-wheel / trackpad pan over the screen, in *display* space. Deltas are\n * a fraction of the rendered display (positive `dy` scrolls content down, as a\n * physical wheel would); `x`/`y` (0..1) anchor the pan under the pointer so the\n * device pans the view beneath it (e.g. a sheet rather than the map behind it).\n */\nexport interface ScrollSample {\n /** The display the pan addresses. A scroll on a display other than `screen.display` is dropped. */\n display?: DeviceDisplayId;\n dx: number;\n dy: number;\n x: number;\n y: number;\n}\n\n/** A normalized point rendered over the device's display-aligned stream. */\nexport interface AgentInteractionPoint {\n x: number;\n y: number;\n}\n\n/** A frame within one continuous Argent touch gesture. */\nexport interface AgentInteractionFrame {\n /** Milliseconds since this segment began. */\n atMs: number;\n /** One point for touch gestures, two for pinch/rotate gestures. */\n points: AgentInteractionPoint[];\n}\n\n/** A continuous gesture within a possibly batched Argent interaction. */\nexport interface AgentInteractionSegment {\n /** Milliseconds since the outer Argent tool call. */\n startMs: number;\n frames: AgentInteractionFrame[];\n easing?: \"linear\" | \"ease-out\";\n}\n\n/** Parsed, visualization-safe geometry from an Argent MCP tool call. */\nexport interface AgentInteraction {\n id: string;\n deviceId: string;\n timestamp: string;\n segments: AgentInteractionSegment[];\n}\n\nexport interface DeviceConnectionOptions {\n /**\n * Origin (and optional base path) of a running serve-sim / serve-emu server,\n * e.g. `http://localhost:3100`. When empty/null the hook stays `idle`.\n */\n baseUrl?: string | null;\n /** Tear the connection down when false. Defaults to true. */\n enabled?: boolean;\n /**\n * Which running device (udid/serial) to stream. serve-sim selects the matching\n * helper via `/api?device=<udid>`; when omitted the first available is used.\n */\n device?: string | null;\n /**\n * Stream transport selected by the consumer. There is intentionally no\n * client-level default; products embedding Hub own their default choice.\n * Each backend adapter maps unavailable choices to one of its supported modes.\n */\n streamMode: DeviceStreamMode;\n /**\n * Session token of a Hub or serve-sim started with `--require-token`, such as an\n * EAS Simulator Preview session, for a page on another origin. The\n * client sends it as a bearer header, a WebSocket subprotocol, and `?token=`\n * where a browser cannot set a header. A page the server served itself can omit\n * it: its cookie covers every request.\n */\n token?: string | null;\n}\n\n/** Which element the implementation paints into. */\nexport type VideoSurfaceKind = \"canvas\" | \"img\" | \"video\";\n\n/** Why {@link DeviceClient.recordingLock} locks the controls. */\nexport type DeviceRecordingLockReason = \"status-unknown\" | \"recording\";\n\nexport type DeviceScreenRecordingStatus =\n | \"unknown\"\n | \"waiting\"\n | \"recording\"\n | \"finalizing\"\n | \"complete\"\n | \"failed\";\n\n/**\n * Whether a screenshot also reached the session artifacts, read from the\n * backend's `X-Expo-Screenshot-Artifact` response headers. `disabled` means the\n * backend runs outside an EAS session.\n */\nexport type ScreenshotArtifact =\n | { status: \"saved\" | \"disabled\" }\n | {\n status: \"failed\";\n /** Why the save failed, when the backend says. */\n error?: string;\n };\n\n/** Capture-source metadata. Zero numeric values and null rotation mean unknown. */\nexport type ScreenshotMetadata = {\n width: number;\n height: number;\n displayRotation:\n | \"portrait\"\n | \"portrait-upside-down\"\n | \"landscape-left\"\n | \"landscape-right\"\n | null;\n /** Two-panel device identity; omitted on single-display devices or when unknown. */\n screen?: \"inner\" | \"outer\";\n};\n\n/**\n * A still PNG of the device and its session artifact outcome. `artifact` is\n * `null` when the backend sent no header, as older serve-sim and serve-emu\n * builds do, or a value this client does not know.\n */\nexport type ScreenshotCapture = {\n blob: Blob;\n artifact: ScreenshotArtifact | null;\n /** Absent on older servers or when metadata is not recognized. */\n metadata?: ScreenshotMetadata;\n};\n\n/**\n * The live state + controls for one device connection. Returned by the hook and\n * consumed by {@link DeviceScreen} (for video + input) and by the surrounding\n * Hub UI (logs panel, Home control, device lists).\n */\nexport interface DeviceClient {\n platform: DevicePlatform;\n status: ConnectionStatus;\n error: string | null;\n /**\n * Whether the current screen session (see {@link ConnectionStatus}) has\n * presented a frame. It stays true while the session reconnects, and it can\n * be true with `error` after the stream failed. Until it is true, the media\n * element shows nothing of this session; it can still hold a previous\n * session's frame. Outside `idle` and `error`, it is false exactly while\n * `status` is `connecting`.\n */\n framePresented: boolean;\n /**\n * An input-channel or hardware-keyboard setup error while video is available,\n * or null. Cleared when the input channel or setup recovers. iOS: serve-sim\n * refused the input socket (too many clients, or a full input queue) or its\n * native HID setup failed. Android: the WebRTC input socket is down.\n * Hardware-keyboard setup failures leave other input available, but Paste and\n * Copy fail until the viewer reconnects and setup succeeds.\n */\n inputError: string | null;\n /** Host recording status; unknown until metadata loads, null when no recording was requested. */\n screenRecording: DeviceScreenRecordingStatus | null;\n /**\n * Why a change could end the host recording now, or null when nothing can break it:\n * `\"status-unknown\"` until the first recording status arrives, `\"recording\"` while it is\n * waiting, recording or finalizing. Calls to `rotate`, `setOrientation`,\n * `updateStreamSettings`, `setStreamSource`, `setGrpcImageMode`, `setGrpcEncoder` and\n * `setGrpcInputSource` are silently ignored while it is set, so UIs can disable those controls\n * and explain why from this one value. An orientation choice that was still waiting when the\n * lock started is dropped the same way: it is cleared from `orientation`, without an\n * `orientationError`. Only Android reports recordings today.\n *\n * Temporary: Android's recording restarts with the encoder. Once recordings survive rotation\n * and stream changes, it is always null.\n */\n recordingLock: DeviceRecordingLockReason | null;\n /**\n * True while {@link recordingLock} is set. Once recordings survive rotation and stream\n * changes, it is always false and then deprecated.\n */\n recordingControlsLocked: boolean;\n /** Screen size once known; null while connecting. */\n screen: ScreenSize | null;\n /**\n * Fold state and controls of a foldable device, such as the iPhone Duo; null\n * for a device that does not fold. `capabilities.fold` lists the commands\n * that it accepts.\n */\n fold: DeviceFold | null;\n /**\n * The displays of a device that streams each display on its own, in the\n * device's order; null for a device with one stream.\n */\n displays: readonly DeviceDisplay[] | null;\n /**\n * URL of a 3D model of this device that the backend serves, with this\n * connection's session token. For the iPhone Duo it is Xcode's DeviceKit\n * USDZ from the host's Xcode. Null when the backend has no model for the\n * device.\n */\n deviceModelUrl: string | null;\n /**\n * The glass corners of the display that `screen` describes, for the flat\n * view, oriented with the device; null keeps the presentation's generic\n * shape for the platform. Set for the iPhone Duo, whose displays the\n * generic iPhone shape cannot express.\n */\n displayCorners: DisplayCornerRadii | null;\n /** Best-effort frames-per-second (0 when unavailable). */\n fps: number;\n /** Running devices the server exposes (may be a placeholder list). */\n devices: RunningDevice[];\n /** Rolling buffer of recent log lines (best-effort; may be empty). */\n logs: DeviceLog[];\n /**\n * Whether the log stream is currently attached. Logs are **off by default** —\n * nothing is collected until {@link attachLogs} is called.\n */\n logsEnabled: boolean;\n /** Start streaming device logs (syslog / logcat). */\n attachLogs: () => void;\n /** Stop streaming device logs; keeps the lines already collected. */\n detachLogs: () => void;\n /** Drop all collected log lines. */\n clearLogs: () => void;\n\n /** Rolling buffer of normalized touch, command, and UI-setting events. */\n events: DeviceEvent[];\n /** Whether the client is currently subscribed to/polling backend events. */\n eventsEnabled: boolean;\n /** Start observing backend events. */\n attachEvents: () => void;\n /** Stop observing events while retaining the current rows. */\n detachEvents: () => void;\n /** Clear the event rows visible in this client. */\n clearEvents: () => void;\n\n /** Live app activity, or null before the metrics endpoint is resolved. */\n activity: DeviceActivity | null;\n /**\n * `idle` while disabled or unsupported, `loading` during discovery/attachment,\n * `ready` after stream metadata or a valid sample, then `error` on failure.\n * Independent of video. Errors retain cached activity; quiet streams use `activity.stale`.\n */\n activityStatus: DeviceActivityStatus;\n\n /** Backend-supported simulator/device options and their current values. */\n deviceSettings: DeviceSettings | null;\n /** `idle` while disabled, `loading` during discovery/initial read, then `ready` or `error`.\n * Independent of video and app activity. Failed refreshes retain cached deviceSettings.\n */\n deviceSettingsStatus: DeviceSettingsStatus;\n /** Options currently being changed. Writes to other options remain available. */\n deviceSettingsPending: ReadonlySet<DeviceSettingKey>;\n /** Change one simulator/device option. Unsupported keys are ignored by each backend. */\n setDeviceSetting: (key: DeviceSettingKey, value: string) => void;\n /**\n * The device's smallest-width dp that the Display size control surfaces, or\n * null when it is unknown.\n */\n displayWidthDp: number | null;\n\n /** Emulator camera feeds, or null before the first read or when the backend has none. */\n camera: DeviceCameraStatus | null;\n /** Facings with an image write or reset in flight. */\n cameraPending: ReadonlySet<DeviceCameraFacing>;\n /** Last failed camera write, cleared when the next write starts. */\n cameraError: string | null;\n /** Replace one facing's picture with a PNG. The backend refuses other formats. */\n setCameraImage: (facing: DeviceCameraFacing, png: Blob) => void;\n /** Restore the backend's \"no image set\" card for one facing. */\n clearCameraImage: (facing: DeviceCameraFacing) => void;\n\n /** Last accessibility snapshot, or null before the first successful read. */\n accessibility: AccessibilitySnapshot | null;\n accessibilityPending: boolean;\n /** Last failed read, cleared when the next read starts. */\n accessibilityError: string | null;\n /** Read the accessibility tree of the current screen once. Backends do not stream it. */\n refreshAccessibility: () => void;\n\n /**\n * The last fix a backend confirmed applying, or null when none is known. serve-emu\n * remembers it for the life of its session (`GET /api/location`); serve-sim has no\n * read, so this client remembers what it applied and forgets on reload.\n */\n location: DeviceGeoFix | null;\n /** True while a set or clear is in flight. Another write is ignored until it settles. */\n locationPending: boolean;\n /** Last failed location write, cleared when the next write starts. */\n locationError: string | null;\n /** Point the device at one coordinate. */\n setLocation: (fix: DeviceGeoFix) => void;\n /** Remove the simulated fix. A no-op unless `capabilities.location` carries `clear`. */\n clearLocation: () => void;\n\n /** Permissions of the foreground app, or null while unknown or without a foreground app. */\n permissions: readonly AppPermission[] | null;\n /** Permission ids with a write in flight. A reset holds every id. */\n permissionsPending: ReadonlySet<string>;\n /** Last failed permission request, cleared when the next write starts or a read succeeds. */\n permissionsError: string | null;\n /** Grant or revoke one permission of the foreground app. */\n setPermission: (id: string, action: AppPermissionAction) => void;\n /** Return every permission of the foreground app to its default. */\n resetPermissions: () => void;\n /** Read the list again, for example when the section opens. */\n refreshPermissions: () => void;\n\n /**\n * Paste text into the focused field of the device app. Keys typed after the call wait until the\n * text lands. Without `text`, the device pastes its own clipboard, as Command+V does. Rejects\n * unless `capabilities.clipboard` has `paste`. The client never reads the browser clipboard; the\n * caller passes its text.\n */\n pasteText: (text?: string) => Promise<void>;\n /**\n * Press Command+C on the device after all earlier input, and resolve to the text that the app\n * copied. Rejects when the app copies no new text, and unless `capabilities.clipboard` has\n * `copy`. The client never writes the browser clipboard.\n */\n copyText: () => Promise<string>;\n /**\n * Counts the clipboard actions that started. It changes when a Paste or Copy starts, also when\n * `clipboardPending` keeps its value, so the host page can tell a new action from the previous one.\n */\n clipboardActionId: number;\n /** The latest clipboard action, retained after completion for its error and warning. */\n clipboardAction: DeviceClipboardAction | null;\n /** The latest clipboard action while it is in flight, or null. */\n clipboardPending: DeviceClipboardAction | null;\n /**\n * Why the latest clipboard action failed, cleared when the next one starts. The client and\n * `DeviceScreen` do not show it, and `DeviceScreen` ignores the rejection of its Command+V paste.\n * The host page must show it.\n */\n clipboardError: string | null;\n /**\n * A key that can still be held on the device after the latest Paste or Copy, cleared when the\n * next one starts. A failed action can also set it. After a good action the text was moved, so\n * this is not an error. The client and `DeviceScreen` do not show it; the host page must show it.\n */\n clipboardWarning: string | null;\n\n /** Backend-supported viewer transport and codec choices; null hides stream controls. */\n streamCapabilities: DeviceStreamCapabilities | null;\n /** Runtime encoder settings, available when `capabilities.streamSettings` lists any keys. */\n streamSettings: DeviceStreamEncoderSettings | null;\n streamSettingsPending: boolean;\n /** Patch one or more runtime encoder values. */\n updateStreamSettings: (patch: Partial<DeviceStreamEncoderSettings>) => void;\n /** Active Android capture source; null when the backend does not expose source switching. */\n streamSource: DeviceStreamSourceStatus | null;\n /**\n * True from a capture-source request until the replacement stream is on\n * screen (or the request fails), so controls and frame change together.\n */\n streamSourcePending: boolean;\n /** Last capture-source write failure; cleared when another write begins. */\n streamSourceError: string | null;\n /** Stage and atomically activate another Android capture source. */\n setStreamSource: (source: DeviceStreamSource) => void;\n /** Restart the gRPC source with compressed PNG or shared-memory RGB delivery. */\n setGrpcImageMode: (mode: DeviceGrpcImageMode) => void;\n /** Restart gRPC capture with software or strictly hardware H.264 encoding. */\n setGrpcEncoder: (encoder: DeviceGrpcEncoder) => void;\n /** Restart gRPC streaming with scrcpy or emulator-gRPC input delivery. */\n setGrpcInputSource: (source: DeviceInputSource) => void;\n /** Live WebRTC stream telemetry; null for HTTP/WebSocket transports. */\n streamStats: DeviceStreamStats | null;\n /** Enable telemetry polling while a consumer is displaying WebRTC statistics. */\n setStreamStatsEnabled: (enabled: boolean) => void;\n /** Requested WebRTC codec for this viewer. */\n webRtcCodec: DeviceWebRtcCodec;\n setWebRtcCodec: (codec: DeviceWebRtcCodec) => void;\n\n /** Backend feature availability. Presentation uses this to omit unsupported UI. */\n capabilities: DeviceCapabilities;\n /**\n * The app currently in the foreground, or `null` while unknown. serve-sim\n * pushes changes over its `{base}/appstate` SSE (SpringBoard log driven,\n * bootstrapped with the current frontmost app); serve-emu polls\n * `GET /api/foreground` (dumpsys). Best-effort — stays `null` on a backend\n * that can't report it (e.g. a bare serve-sim helper with no middleware).\n */\n foregroundApp: ForegroundApp | null;\n\n /** Element kind {@link DeviceScreen} should render for this client. */\n videoKind: VideoSurfaceKind;\n /**\n * Ref callback for the paint target. The hook owns the element: `canvas`\n * receives decoded H.264 frames, `img` points at MJPEG, and `video` receives\n * a WebRTC MediaStream.\n */\n attachVideo: (el: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement | null) => void;\n\n /** Forward a normalized touch/drag to the device. */\n sendTouch: (sample: TouchSample) => void;\n /** Forward a two-finger pinch/pan. Absent only on the no-op client. */\n sendMultiTouch?: (sample: MultiTouchSample) => void;\n /** Discard queued input after its browser interaction loses ownership. */\n cancelInput?: () => void;\n /**\n * Forward a physical browser-keyboard event to the device. Returns true when\n * the event was accepted, allowing {@link DeviceScreen} to suppress the\n * corresponding browser action while the streamed device has focus.\n */\n sendKey: (input: KeyboardInput) => boolean;\n /**\n * Type pre-mapped HID key events — e.g. what {@link KeyboardCapture} derives\n * from phone-keyboard text — paced so iOS doesn't coalesce a burst into lost\n * keystrokes. Present only on backends with a HID key channel (serve-sim).\n */\n sendKeyEvents?: (events: ReadonlyArray<HidKeyEvent>) => void;\n /**\n * Forward a scroll-wheel / trackpad pan as a native scroll, so the device\n * pans content exactly as it would for a physical wheel (no synthesized\n * drag). Present only on backends that support it (serve-sim).\n */\n sendScroll?: (sample: ScrollSample) => void;\n /** Press a hardware button. */\n pressButton: (button: HardwareButton) => void;\n /**\n * Reload the running React Native/Expo bundle. serve-sim injects ⌘R over the\n * helper's key channel; serve-emu injects a hardware \"R\" keypress over scrcpy.\n * A no-op if nothing is connected; harmless if the foreground app isn't RN.\n */\n reload: () => void;\n /**\n * Rotate the device to the next pose in `DEVICE_ORIENTATIONS` order, or clockwise on an\n * iPhone Duo, as Xcode's Device Hub turns it. serve-sim sends it\n * over the helper's orientation channel; serve-emu locks it via `POST /api/orientation`,\n * like {@link setOrientation}. A serve-emu server that does not report its pose gets the\n * opposite of the frame's portrait or landscape aspect. A no-op if nothing is connected.\n */\n rotate: () => void;\n /**\n * The pose the device is turned to: the last choice from {@link setOrientation} while it is\n * pending and until the backend reports again, then the backend's report. Null when the\n * backend reports no pose, also after a {@link rotate}; `capabilities.orientation` is then\n * `false`. Unlike `screen.orientation`, it can lead the video frames.\n */\n orientation: DeviceOrientation | null;\n /**\n * True while the backend has not answered a {@link setOrientation} choice: serve-sim has not\n * sent it yet, or serve-emu has not answered its `POST /api/orientation`.\n */\n orientationPending: boolean;\n /** Last failed orientation change, cleared when the next one starts. */\n orientationError: string | null;\n /**\n * Why {@link rotate} and {@link setOrientation} cannot turn the device now, or null when they\n * can. Disable orientation controls while it is set. Android reports\n * `\"recording-status-unknown\"` or `\"recording\"` while {@link recordingLock} is set, and those\n * calls are dropped silently. iOS reports `\"input-unavailable\"` while the helper input socket\n * cannot take input, and those calls still try and can fail with an `orientationError`. See\n * {@link DeviceOrientationUnavailableReason} for each reason.\n */\n // @ref LLP 0013#orientation — iOS sends the pose over the input socket, Android over HTTP\n orientationUnavailable: DeviceOrientationUnavailableReason | null;\n /**\n * Turn the device to one orientation, and show it in {@link orientation} at once.\n * serve-sim sends it over the helper's orientation channel, and a later {@link rotate}\n * continues the cycle from it; serve-emu locks the matching user rotation via\n * `POST /api/orientation`, one request at a time, so the last choice wins and only its\n * answer or failure is shown. Ignores values missing from `capabilities.orientation`. A\n * foreground app that does not support the orientation can keep its layout.\n */\n setOrientation: (orientation: DeviceOrientation) => void;\n /**\n * Capture a still PNG of the device via the backend's `POST /api/screenshot`\n * (serve-emu `adb screencap` / serve-sim `simctl io screenshot`), resolving\n * to the PNG and its session artifact outcome, or `null` if capture fails or\n * nothing is connected. The caller decides what to do with it (e.g. trigger\n * a file download).\n */\n screenshot: () => Promise<ScreenshotCapture | null>;\n\n /**\n * Current device system appearance (dark/light), or `null` while unknown or on\n * a backend that can't report it (e.g. a bare serve-sim helper with no\n * middleware). Read once the connection resolves; updated by {@link setAppearance}.\n */\n appearance: DeviceAppearance | null;\n /**\n * Set the device's system appearance. serve-sim runs `simctl ui <udid>\n * appearance <mode>` (over the middleware exec-ws); serve-emu posts `uimode\n * night yes|no`. No-op on a backend that can't set it.\n */\n setAppearance: (mode: DeviceAppearance) => void;\n\n /**\n * Whether Simulator currently treats the Mac keyboard as connected to the\n * guest. iOS only; null while the helper is unavailable or on Android. The\n * Hub preserves the selected mode on desktop admission; touch admission\n * disconnects it so the on-screen keyboard can show.\n */\n hardwareKeyboardConnected: boolean | null;\n /**\n * Connect or disconnect the Mac keyboard from the iOS guest (serve-sim's\n * `hardware-keyboard` simulator setting, over the middleware exec channel).\n */\n setHardwareKeyboardConnected: (connected: boolean) => void;\n /** Toggle the iOS on-screen software keyboard without changing the hardware connection. */\n toggleSoftwareKeyboard: () => void;\n}\n\n/** A platform implementation of the connection half of the interface. */\nexport type DeviceClientHook = (options: DeviceConnectionOptions) => DeviceClient;\n\n/**\n * The client fields read by DeviceScreen, including the fold for its\n * Option+Shift pose shortcuts. Full DeviceClient values remain valid inputs.\n */\nexport type DeviceScreenClient = Pick<\n DeviceClient,\n | \"videoKind\"\n | \"attachVideo\"\n | \"sendTouch\"\n | \"sendMultiTouch\"\n | \"cancelInput\"\n | \"sendScroll\"\n | \"sendKey\"\n | \"fold\"\n | \"pasteText\"\n | \"capabilities\"\n | \"screen\"\n | \"status\"\n | \"error\"\n | \"framePresented\"\n | \"inputError\"\n>;\n\n/** Props for the shared {@link DeviceScreen} component rendered inside PhoneFrame. */\nexport interface DeviceScreenProps {\n /** Keep a mobile viewer’s capture input focused while touching the stream. */\n preserveKeyboardFocus?: boolean;\n client: DeviceClient;\n /** Host-owned browser clipboard Copy. Without it, Command+C stays native keys. */\n onCopy?: () => Promise<void>;\n /** Last active Argent gesture for the streamed device; removed after its idle timeout. */\n agentInteraction?: AgentInteraction | null;\n /** Corner radius for the video surface (matches the PhoneFrame placeholder). */\n borderRadius?: CSSProperties[\"borderRadius\"];\n /** Apply the iOS `corner-shape: squircle`. */\n squircle?: boolean;\n}\n\n/** The built-in screen also accepts the inputs returned by useDeviceScreenClient. */\nexport interface DeviceScreenInputProps extends Omit<DeviceScreenProps, \"client\"> {\n client: DeviceScreenClient;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;CAiBC,GAyuCD,mFAAmF,GACnF,WAEC"}
|
package/package.json
CHANGED
package/src/screenshot.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { apiUrl } from "./android-api-url";
|
|
2
|
-
import { type ScreenshotArtifact, type ScreenshotCapture } from "./types";
|
|
2
|
+
import { type ScreenshotArtifact, type ScreenshotCapture, type ScreenshotMetadata } from "./types";
|
|
3
3
|
|
|
4
4
|
type ScreenshotFetch = (input: string, init?: RequestInit) => Promise<Response>;
|
|
5
5
|
|
|
@@ -15,7 +15,12 @@ export async function fetchScreenshot(
|
|
|
15
15
|
try {
|
|
16
16
|
const response = await fetchImpl(url, { method: "POST", cache: "no-store" });
|
|
17
17
|
if (!response.ok) return null;
|
|
18
|
-
|
|
18
|
+
const metadata = screenshotMetadata(response.headers);
|
|
19
|
+
return {
|
|
20
|
+
blob: await response.blob(),
|
|
21
|
+
artifact: screenshotArtifact(response.headers),
|
|
22
|
+
...(metadata ? { metadata } : {}),
|
|
23
|
+
};
|
|
19
24
|
} catch {
|
|
20
25
|
return null;
|
|
21
26
|
}
|
|
@@ -32,3 +37,39 @@ function screenshotArtifact(headers: Headers): ScreenshotArtifact | null {
|
|
|
32
37
|
console.warn(`Ignoring unknown X-Expo-Screenshot-Artifact value: ${status}`);
|
|
33
38
|
return null;
|
|
34
39
|
}
|
|
40
|
+
|
|
41
|
+
function screenshotMetadata(headers: Headers): ScreenshotMetadata | undefined {
|
|
42
|
+
const header = headers.get("X-Expo-Screenshot-Metadata");
|
|
43
|
+
if (!header || header.length > 1024) return;
|
|
44
|
+
try {
|
|
45
|
+
const value: unknown = JSON.parse(header);
|
|
46
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return;
|
|
47
|
+
const data = value as Record<string, unknown>;
|
|
48
|
+
const nonnegative = (value: unknown): value is number =>
|
|
49
|
+
typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
50
|
+
if (
|
|
51
|
+
!nonnegative(data.width) ||
|
|
52
|
+
!nonnegative(data.height) ||
|
|
53
|
+
(data.screen !== undefined && data.screen !== "inner" && data.screen !== "outer")
|
|
54
|
+
)
|
|
55
|
+
return;
|
|
56
|
+
const rotation = data.displayRotation;
|
|
57
|
+
if (
|
|
58
|
+
rotation !== null &&
|
|
59
|
+
rotation !== "portrait" &&
|
|
60
|
+
rotation !== "portrait-upside-down" &&
|
|
61
|
+
rotation !== "landscape-left" &&
|
|
62
|
+
rotation !== "landscape-right"
|
|
63
|
+
)
|
|
64
|
+
return;
|
|
65
|
+
return {
|
|
66
|
+
width: data.width,
|
|
67
|
+
height: data.height,
|
|
68
|
+
...(data.screen === undefined ? {} : { screen: data.screen }),
|
|
69
|
+
displayRotation: rotation,
|
|
70
|
+
};
|
|
71
|
+
} catch {
|
|
72
|
+
// Optional metadata must never prevent an otherwise successful PNG download.
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -831,6 +831,20 @@ export type ScreenshotArtifact =
|
|
|
831
831
|
error?: string;
|
|
832
832
|
};
|
|
833
833
|
|
|
834
|
+
/** Capture-source metadata. Zero numeric values and null rotation mean unknown. */
|
|
835
|
+
export type ScreenshotMetadata = {
|
|
836
|
+
width: number;
|
|
837
|
+
height: number;
|
|
838
|
+
displayRotation:
|
|
839
|
+
| "portrait"
|
|
840
|
+
| "portrait-upside-down"
|
|
841
|
+
| "landscape-left"
|
|
842
|
+
| "landscape-right"
|
|
843
|
+
| null;
|
|
844
|
+
/** Two-panel device identity; omitted on single-display devices or when unknown. */
|
|
845
|
+
screen?: "inner" | "outer";
|
|
846
|
+
};
|
|
847
|
+
|
|
834
848
|
/**
|
|
835
849
|
* A still PNG of the device and its session artifact outcome. `artifact` is
|
|
836
850
|
* `null` when the backend sent no header, as older serve-sim and serve-emu
|
|
@@ -839,6 +853,8 @@ export type ScreenshotArtifact =
|
|
|
839
853
|
export type ScreenshotCapture = {
|
|
840
854
|
blob: Blob;
|
|
841
855
|
artifact: ScreenshotArtifact | null;
|
|
856
|
+
/** Absent on older servers or when metadata is not recognized. */
|
|
857
|
+
metadata?: ScreenshotMetadata;
|
|
842
858
|
};
|
|
843
859
|
|
|
844
860
|
/**
|