UNPKG

agent-device

Version:

Open source device layer for AI coding agents: a CLI, MCP server, and typed Node.js API to control mobile, web, TV, and desktop apps on devices and simulators, locally or in the cloud.

658 lines • 28.6 kB
import { A as IosSnapshotObservation, B as SnapshotNode, D as PublicPlatform, F as Rect, G as SnapshotQualityVerdict, I as ScreenshotOverlayRef, L as SnapshotCaptureScale, W as SnapshotQualityNote, n as DaemonArtifactType, q as SnapshotViewportSize } from "./sdk-contracts.js"; import { v as SettleObservation, x as SnapshotState } from "./sdk-selectors.js"; //#region packages/contracts/src/session-surface.d.ts declare const SESSION_SURFACES: readonly ['app', 'frontmost-app', 'desktop', 'menubar']; type SessionSurface = (typeof SESSION_SURFACES)[number]; //#endregion //#region packages/contracts/src/back-mode.d.ts declare const BACK_MODES: readonly ['in-app', 'system']; type BackMode = (typeof BACK_MODES)[number]; //#endregion //#region packages/contracts/src/scroll-gesture.d.ts declare const SCROLL_INPUT_DIRECTIONS: readonly ['up', 'down', 'left', 'right', 'top', 'bottom']; type ScrollInputDirection = (typeof SCROLL_INPUT_DIRECTIONS)[number]; declare const SCROLL_DIRECTIONS: readonly ['up', 'down', 'left', 'right']; type ScrollDirection = (typeof SCROLL_DIRECTIONS)[number]; declare const SWIPE_PRESETS: readonly ['left', 'right', 'left-edge', 'right-edge']; type SwipePreset = (typeof SWIPE_PRESETS)[number]; declare const SWIPE_PATTERNS: readonly ['one-way', 'ping-pong']; type SwipePattern = (typeof SWIPE_PATTERNS)[number]; type TransformGestureParams = { x: number; y: number; dx: number; dy: number; scale: number; degrees: number; durationMs?: number; }; //#endregion //#region packages/contracts/src/screenshot.d.ts declare const SCREENSHOT_SCREEN_MASKS: readonly ['black']; type ScreenshotScreenMask = (typeof SCREENSHOT_SCREEN_MASKS)[number]; /** The capture paths a screenshot can name instead of the platform default. */ declare const SCREENSHOT_CAPTURE_BACKENDS: readonly ['runner']; type ScreenshotCaptureBackend = (typeof SCREENSHOT_CAPTURE_BACKENDS)[number]; type ScreenshotRequestFlags = { out?: string; overlayRefs?: boolean; screenshotCropOn?: string; screenshotPixelDensity?: number; screenshotScreenMask?: ScreenshotScreenMask; screenshotFullscreen?: boolean; screenshotScale?: number; screenshotNoStabilize?: boolean; screenshotNormalizeStatusBar?: boolean; screenshotCaptureBackend?: ScreenshotCaptureBackend; }; //#endregion //#region packages/contracts/src/snapshot-diagnostics.d.ts type SnapshotTimingStats = { count: number; p50Ms: number; p95Ms: number; maxMs: number; slowThresholdMs: number; platform?: PublicPlatform; /** * Captures per producer that served them, keyed by producer id such as `simulator-ax-bridge` or * `apple-runner`. A capture with no known producer counts under its channel, such as `xctest`. */ backends?: Record<string, number>; }; type SnapshotDiagnosticsSummary = { stats: SnapshotTimingStats; warning?: string; }; //#endregion //#region packages/contracts/src/device-rotation.d.ts /** Single source of truth for the discriminator the Apple owner sets and the MCP schema advertises. */ declare const FOLD_SCREEN_COORDINATE_SPACE: 'native-panel'; type FoldScreenCoordinateSpace = typeof FOLD_SCREEN_COORDINATE_SPACE; declare const DEVICE_ROTATIONS: readonly ['portrait', 'portrait-upside-down', 'landscape-left', 'landscape-right']; type DeviceRotation = (typeof DEVICE_ROTATIONS)[number]; /** A rotation to lock the device in, or `auto` to hand rotation back to the sensor. */ declare const ORIENTATION_REQUESTS: readonly ["portrait", "portrait-upside-down", "landscape-left", "landscape-right", "auto"]; type OrientationRequest = (typeof ORIENTATION_REQUESTS)[number]; /** * The public positional names of the hardware keys: the volume/power/mute keys, the explicit * sleep and wake events, and the five media keys. The literals are the same ones * SYSTEM_BUTTON_LABELS carries for these buttons; the label owner's type-level check and the * contracts tests refuse drift between the two lists. */ type HardwareButtonName = 'volume-up' | 'volume-down' | 'power' | 'mute' | 'sleep' | 'wake' | 'media-play-pause' | 'media-next' | 'media-previous' | 'media-rewind' | 'media-fast-forward'; /** * The three hinge poses a foldable Apple device can be put in, named after what an agent sees * rather than after Apple's `UIHinge.Status` cases: `closed` lights the outer panel only, * `half-open` and `open` light the inner panel. Device Hub calls them Closed, Book, and Open; * `UIHinge.Status` calls them `.closed`, `.partiallyOpen`, and `.fullyOpen`. */ declare const FOLD_POSES: readonly ['closed', 'half-open', 'open']; type FoldPose = (typeof FOLD_POSES)[number]; type FoldKeyframe = Readonly<{ atMs: number; angle: number; }>; type SetFoldPoseInput = Readonly<{ pose: FoldPose; keyframes?: never; }> | Readonly<{ keyframes: readonly FoldKeyframe[]; pose?: never; }>; //#endregion //#region packages/contracts/src/scroll-command.d.ts type ScrollReleaseBehavior = 'controlled' | 'inertial'; /** * What a directional scroll actually SAW after its gesture, which is the only evidence that can * back the distance the same response reports (#2714). * * - `'moved'`: the post-gesture surface differs from the pre-gesture one, so content did move. * - `'at-edge'`: the surface is identical and the resolved container names no hidden content in * that direction — the scroll was a legitimate no-op at the end of the content. * - `'unchanged'`: the surface is identical and the direction has no end-of-content signal to read * (a horizontal scroll: the hidden-content analyzer only covers the vertical axis), so the * response says what it measured without guessing which of the two it was. * - `'unobserved'`: nothing comparable was available, so the distance rests on the gesture plan * alone. Callers that need the effect confirmed ask for a capture or a `--settle` observation. * * A directional scroll that measures an unchanged surface WITH hidden content still in that * direction does not answer at all: it fails with `scroll_no_progress`. */ type ScrollMovementObservation = 'moved' | 'at-edge' | 'unchanged' | 'unobserved'; type ScrollDistanceOptions = { amount?: number; pixels?: number; }; type ScrollTimingOptions = { durationMs?: number; }; type ScrollCommandOptions = ScrollDistanceOptions & ScrollTimingOptions; /** * The scroll container the caller resolved from the current tree, in the snapshot's absolute space. * An owner that plans its own swipe keeps both endpoints inside it (#2714); an owner without that * planner ignores it. */ type ScrollContainerTarget = { containerRect?: Rect; }; type ScrollExecutionOptions = ScrollCommandOptions & ScrollContainerTarget & { releaseBehavior?: ScrollReleaseBehavior; }; /** * `scroll` — the generic-route result built by `buildDispatchedScrollResult` * (src/core/dispatch-scroll.ts): the resolved direction, the edge-pass * bookkeeping for `top`/`bottom` scrolls, the honored distance/timing echo, * and the success message. Platform leaves add gesture-plan coordinates * (`x1`/`y1`/`x2`/`y2`, reference frame) on top; the output schema stays * non-strict so those additive fields validate. The one field the dispatcher * itself may add: `settle`, the opt-in `--settle` observation (#1638), * attached after the command — same shape as `BackCommandResult`. */ type ScrollCommandResult = { direction: ScrollDirection; /** Set for `top`/`bottom` requests: the extreme being scrolled to. */ edge?: 'top' | 'bottom'; /** Set for `--until` requests: the selector the passes stopped on. */ until?: string; /** Edge and until scrolls only: how many scroll-and-check passes ran. */ passes?: number; amount?: number; pixels?: number; durationMs?: number; message?: string; settle?: SettleObservation; /** * The observation that gated this response's distance claim. See * {@link ScrollMovementObservation}: `scroll` answers with what it measured after the gesture, * and only `'moved'` and `'at-edge'` confirm the surface's fate. Absent on the tiers that verify * per pass instead of per gesture (`scroll top`/`bottom` and `--until`), and on platforms whose * scroll owner never dispatches a swipe (the Linux wheel). */ movement?: ScrollMovementObservation; /** * Set only when an on-screen keyboard made the owner clip the swipe into the band above it * (#2500). Absent means the swipe was not clipped, which is not the same claim as `false`: a * platform that never runs the clip has nothing to report. The platform leaf's `referenceHeight` * names the shortened axis the reported `pixels` were planned against, and `keyboardMinY` names * where the keyboard began. A surface the owner refused to swipe at all fails instead, under the * `scroll_keyboard_occludes_surface` reason. */ keyboardAvoided?: true; /** The keyboard's edge in the same unit as the gesture coordinates, when the swipe was clipped. */ keyboardMinY?: number; }; //#endregion //#region packages/contracts/src/tv-remote.d.ts declare const TV_REMOTE_BUTTON_DEFINITIONS: { readonly up: { readonly aliases: readonly []; readonly androidKeyevent: 'KEYCODE_DPAD_UP'; readonly appleRemoteButton: 'up'; readonly vegaKey: 'KEY_UP'; }; readonly down: { readonly aliases: readonly []; readonly androidKeyevent: 'KEYCODE_DPAD_DOWN'; readonly appleRemoteButton: 'down'; readonly vegaKey: 'KEY_DOWN'; }; readonly left: { readonly aliases: readonly []; readonly androidKeyevent: 'KEYCODE_DPAD_LEFT'; readonly appleRemoteButton: 'left'; readonly vegaKey: 'KEY_LEFT'; }; readonly right: { readonly aliases: readonly []; readonly androidKeyevent: 'KEYCODE_DPAD_RIGHT'; readonly appleRemoteButton: 'right'; readonly vegaKey: 'KEY_RIGHT'; }; readonly select: { readonly aliases: readonly ["ok", "center", "enter"]; readonly androidKeyevent: 'KEYCODE_DPAD_CENTER'; readonly appleRemoteButton: 'select'; readonly vegaKey: 'KEY_ENTER'; }; readonly menu: { readonly aliases: readonly []; readonly androidKeyevent: 'KEYCODE_MENU'; readonly appleRemoteButton: 'menu'; readonly vegaKey: 'KEY_MENU'; }; readonly home: { readonly aliases: readonly []; readonly androidKeyevent: 'KEYCODE_HOME'; readonly appleRemoteButton: 'home'; readonly vegaKey: 'KEY_HOMEPAGE'; }; readonly back: { readonly aliases: readonly []; readonly androidKeyevent: 'KEYCODE_BACK'; readonly appleRemoteButton: 'menu'; readonly vegaKey: 'KEY_BACK'; }; readonly 'volume-up': { readonly aliases: readonly []; readonly androidKeyevent: '24'; }; readonly 'volume-down': { readonly aliases: readonly []; readonly androidKeyevent: '25'; }; readonly mute: { readonly aliases: readonly []; readonly androidKeyevent: '164'; }; readonly power: { readonly aliases: readonly []; readonly androidKeyevent: '26'; }; readonly sleep: { readonly aliases: readonly []; readonly androidKeyevent: '223'; }; readonly wake: { readonly aliases: readonly []; readonly androidKeyevent: '224'; }; readonly 'media-play-pause': { readonly aliases: readonly []; readonly androidKeyevent: '85'; }; readonly 'media-play': { readonly aliases: readonly []; readonly androidKeyevent: '126'; }; readonly 'media-pause': { readonly aliases: readonly []; readonly androidKeyevent: '127'; }; readonly 'media-stop': { readonly aliases: readonly []; readonly androidKeyevent: '86'; }; readonly 'media-next': { readonly aliases: readonly []; readonly androidKeyevent: '87'; }; readonly 'media-previous': { readonly aliases: readonly []; readonly androidKeyevent: '88'; }; readonly 'media-rewind': { readonly aliases: readonly []; readonly androidKeyevent: '89'; }; readonly 'media-fast-forward': { readonly aliases: readonly []; readonly androidKeyevent: '90'; }; readonly 'channel-up': { readonly aliases: readonly []; readonly androidKeyevent: '166'; }; readonly 'channel-down': { readonly aliases: readonly []; readonly androidKeyevent: '167'; }; readonly 'last-channel': { readonly aliases: readonly []; readonly androidKeyevent: '229'; }; readonly guide: { readonly aliases: readonly []; readonly androidKeyevent: '172'; }; readonly info: { readonly aliases: readonly []; readonly androidKeyevent: '165'; }; readonly captions: { readonly aliases: readonly []; readonly androidKeyevent: '175'; }; readonly 'tv-input': { readonly aliases: readonly []; readonly androidKeyevent: '178'; }; readonly 'color-red': { readonly aliases: readonly []; readonly androidKeyevent: '183'; }; readonly 'color-green': { readonly aliases: readonly []; readonly androidKeyevent: '184'; }; readonly 'color-yellow': { readonly aliases: readonly []; readonly androidKeyevent: '185'; }; readonly 'color-blue': { readonly aliases: readonly []; readonly androidKeyevent: '186'; }; }; declare const TV_REMOTE_BUTTONS: (keyof typeof TV_REMOTE_BUTTON_DEFINITIONS)[]; type NamedTvRemoteButton = (typeof TV_REMOTE_BUTTONS)[number]; type TvRemoteButton = NamedTvRemoteButton | `android-keycode:${number}`; //#endregion //#region packages/contracts/src/settings-catalog.d.ts /** * Every `settings` setting, declared once: its accepted forms, where its app comes from, whether * naming an app can mean anything on each target family, and its help. Usage, parsing, app scope, * and help are derived from this table. Which target serves a setting is not declared here: each * runtime owner states that in its own settings facts, because owners that share a device shape * (a local iOS simulator and a Limrun iOS session) serve different settings. * * This module has no runtime imports, so the public client types can name it. */ declare const PERMISSION_ACTIONS: readonly ['grant', 'deny', 'reset']; declare const PERMISSION_MODES: readonly ['full', 'limited']; /** The app-scoped targets, the only ones `parsePermissionTarget` accepts. */ declare const MOBILE_PERMISSION_TARGETS: readonly ['all', 'camera', 'microphone', 'photos', 'contacts', 'contacts-limited', 'notifications', 'calendar', 'location', 'location-always', 'media-library', 'motion', 'reminders', 'siri']; declare const MACOS_PERMISSION_TARGETS: readonly ['accessibility', 'screen-recording', 'input-monitoring']; declare const TEXT_SIZE_CATEGORIES: readonly ['extra-small', 'small', 'medium', 'large', 'extra-large', 'extra-extra-large', 'extra-extra-extra-large', 'accessibility-medium', 'accessibility-large', 'accessibility-extra-large', 'accessibility-extra-extra-large', 'accessibility-extra-extra-extra-large']; type PermissionAction = (typeof PERMISSION_ACTIONS)[number]; type PermissionMode = (typeof PERMISSION_MODES)[number]; type TextSizeCategory = (typeof TEXT_SIZE_CATEGORIES)[number]; declare const SETTINGS: { readonly wifi: { readonly forms: readonly [{ readonly kind: 'on-off'; }]; readonly help: 'Android switches Wi-Fi with svc wifi; an Apple simulator overrides only its status bar.'; }; readonly bluetooth: { readonly forms: readonly [{ readonly kind: 'on-off'; }]; readonly app: 'input'; readonly appScope: { readonly mobile: 'device-level'; }; readonly help: 'Android over adb turns its Bluetooth adapter on or off with svc bluetooth, from Android 8.1. It reports the bluetooth state the device holds afterwards, or fails with bluetooth-not-applied or bluetooth-unreadable. A device without an adapter refuses with android_bluetooth_adapter_missing, and an adapter on a build older than 8.1 with android_bluetooth_command_unavailable, before anything changes. --app is refused.'; }; readonly airplane: { readonly forms: readonly [{ readonly kind: 'on-off'; }]; readonly help: 'Android applies it through the connectivity service (Android 11+) and reports the airplaneMode that service holds; older builds fail without changing anything. An Apple simulator overrides only its status bar.'; }; readonly 'mobile-data': { readonly forms: readonly [{ readonly kind: 'on-off'; }]; readonly app: 'input'; readonly appScope: { readonly mobile: 'device-level'; }; readonly help: 'Android only. Runs svc data and reports the stored mobileData state, or fails with mobile-data-not-applied or mobile-data-unreadable. Multi-SIM read-back is not covered yet, and --app is refused.'; }; readonly location: { readonly forms: readonly [{ readonly kind: 'on-off'; readonly appScope: { readonly apple: 'app-scoped'; readonly mobile: 'device-level'; }; }, { readonly kind: 'coordinates'; readonly appScope: { readonly apple: 'device-level'; readonly mobile: 'device-level'; }; }]; readonly app: 'input'; readonly help: "on|off writes Android's device-wide location_mode, and on an Apple simulator grants or revokes the app's location permission. set <lat> <lon> moves the device's own coordinates on Apple simulators and Android emulators."; }; readonly animations: { readonly forms: readonly [{ readonly kind: 'on-off'; }]; readonly help: 'Android sets its window, transition, and animator duration scales to 1 or 0.'; }; readonly appearance: { readonly forms: readonly [{ readonly kind: 'choice'; readonly states: readonly ["light", "dark", "toggle"]; }]; readonly help: 'Switches to light or dark mode, or toggles it, on Android, Apple simulators, and the macOS host.'; }; readonly 'text-size': { readonly forms: readonly [{ readonly kind: 'choice'; readonly states: readonly ["extra-small", "small", "medium", "large", "extra-large", "extra-extra-large", "extra-extra-extra-large", "accessibility-medium", "accessibility-large", "accessibility-extra-large", "accessibility-extra-extra-large", "accessibility-extra-extra-extra-large"]; }]; readonly readable: true; readonly help: 'Reads the preferred text size without a category and applies one with it, on iPhone and iPad simulators (simctl content size) and Android (system font_scale). Android has no ladder of its own: a read names the nearest rung and reports the multiplier as platformValue. A running app adopts a new size at its next configuration change, so relaunch it.'; }; readonly faceid: { readonly forms: readonly [{ readonly kind: 'choice'; readonly states: readonly ["match", "nonmatch", "enroll", "unenroll"]; }]; readonly help: 'Simulates Face ID on iPhone and iPad simulators.'; }; readonly touchid: { readonly forms: readonly [{ readonly kind: 'choice'; readonly states: readonly ["match", "nonmatch", "enroll", "unenroll"]; }]; readonly help: 'Simulates Touch ID on iPhone and iPad simulators.'; }; readonly fingerprint: { readonly forms: readonly [{ readonly kind: 'choice'; readonly states: readonly ["match", "nonmatch"]; }]; readonly help: 'Simulates a fingerprint touch on Android emulators, and on devices that expose cmd fingerprint.'; }; readonly 'clear-app-state': { readonly forms: readonly [{ readonly kind: 'app-id'; }]; readonly app: 'positional'; readonly appRequired: true; readonly appScope: { readonly apple: 'app-scoped'; readonly mobile: 'app-scoped'; }; readonly help: 'Clears the data of the positional app, the --app app, or the session app, and refuses two different apps. It leaves the keychain alone. An app with no data container, such as a simulator system app, refuses with app-no-data-container.'; }; readonly 'reset-keychain': { readonly forms: readonly [{ readonly kind: 'choice'; readonly states: readonly ["clear"]; }]; readonly help: 'Resets the whole iOS simulator keychain, for every app on it: simctl has no per-app reset. A fresh-install reset needs this and clear-app-state; relaunch the app afterwards to see it signed out.'; }; readonly permission: { readonly forms: readonly [{ readonly kind: 'permission'; readonly actions: readonly ["grant", "deny", "reset"]; readonly targets: readonly ["all", "camera", "microphone", "photos", "contacts", "contacts-limited", "notifications", "calendar", "location", "location-always", "media-library", "motion", "reminders", "siri"]; readonly modes: readonly ["full", "limited"]; }, { readonly kind: 'permission'; readonly actions: readonly ["grant", "reset"]; readonly targets: readonly ["accessibility", "screen-recording", "input-monitoring"]; }]; readonly app: 'input'; readonly appScope: { readonly apple: 'app-scoped'; readonly mobile: 'app-scoped'; readonly 'macos-host': 'device-level'; }; readonly help: 'Changes a permission of the --app app or the session app. An iOS simulator, local or Limrun, resolves --app to an installed bundle id or display name, and Android to an installed package. On Android, deny|reset of a held permission kills a running app; the response reports priorGrantState and warns, and open <app> --relaunch restores it. Android needs a resolvable foreground user and changes nothing without one. On the macOS host, grant|reset change the host TCC grants for the three desktop targets and take no --app.'; }; }; type SettingName = keyof typeof SETTINGS; /** The settings whose definition is `readable`. */ type ReadableSetting = { [Name in SettingName]: (typeof SETTINGS)[Name] extends { readable: true; } ? Name : never; }[SettingName]; //#endregion //#region packages/contracts/src/snapshot-types.d.ts type ScreenshotResultData = { path?: string; width?: number; height?: number; logicalWidth?: number; logicalHeight?: number; pixelDensity?: number; /** Display rotation the capture was rendered in; absent when the target reports none. */ displayRotation?: DeviceRotation; overlayRefs?: ScreenshotOverlayRef[]; warnings?: string[]; }; /** What a platform interactor's snapshot capture returns, before the daemon builds `SnapshotState`. */ type InteractorSnapshotCapture = { nodes?: SnapshotNode[]; truncated?: boolean; backend?: string; snapshot?: SnapshotState; appName?: string; appBundleId?: string; snapshotDiagnostics?: SnapshotDiagnosticsSummary; /** * The box the node rects are measured in, as the producer measured it (#3182). Absent means the * producer measured no box; see {@link SnapshotViewportSize} for what each producer measures. */ viewport?: SnapshotViewportSize; /** See {@link SnapshotCaptureScale}. Absent means the producer published no scale. */ captureScale?: SnapshotCaptureScale; analysis?: { rawNodeCount: number; maxDepth: number; }; androidSnapshot?: AndroidSnapshotBackendMetadata; freshness?: { action: string; retryCount: number; staleAfterRetries: boolean; reason?: 'empty-interactive' | 'sharp-drop' | 'stuck-route'; }; quality?: SnapshotQualityVerdict; qualityNotes?: SnapshotQualityNote[]; warnings?: string[]; observation?: IosSnapshotObservation; }; type AndroidSnapshotBackendMetadata = { backend: 'android-helper'; /** * Physical pixels per density-independent pixel of the display the bounds are measured on, as * the helper's `DisplayMetrics` report it (2.625 on a 420 dpi phone). Node rects and the points * `press` takes stay in physical pixels; a consumer that lays out in dp divides by it. Absent on * an older helper. */ pixelDensity?: number; helperVersion?: string; helperApiVersion?: string; helperTransport?: string; helperSessionReused?: boolean; installReason?: string; waitForIdleTimeoutMs?: number; waitForIdleQuietMs?: number; timeoutMs?: number; maxDepth?: number; maxNodes?: number; rootPresent?: boolean; /** This capture cleared the platform accessibility node cache through UiAutomation.clearCache(). */ cacheInvalidated?: boolean; captureMode?: string; systemSurfaceOnly?: boolean; /** * Package of the foreground application window the snapshot helper captured: active or focused, * at the highest layer, and not owned by the system. Absent when the helper saw none. */ foregroundWindowPackage?: string; windowCount?: number; /** * `AccessibilityWindowInfo` types of the listed windows the helper could not serialize because * reading their root returned null or threw (`2` is an input method window); `windowCount` counts * only the roots it serialized. Empty when every listed window was read. Absent on an older helper. */ missingRootWindowTypes?: number[]; nodeCount?: number; helperTruncated?: boolean; elapsedMs?: number; presentationFailure?: { phase: 'deadline' | 'complexity' | 'regular-invariant'; workUnits: number; maxWorkUnits?: number; }; /** API 23 exposes no sibling drawing order, so same-window occlusion fails conservative. */ occlusionScanUnavailable?: boolean; }; type FindLocator = 'any' | 'text' | 'label' | 'value' | 'role' | 'id'; //#endregion //#region packages/contracts/src/cloud-artifacts.d.ts declare const CLOUD_ARTIFACT_KINDS: readonly ['video', 'appium-log', 'device-log', 'automation-log', 'network', 'provider-session', 'raw']; type CloudArtifactKind = (typeof CLOUD_ARTIFACT_KINDS)[number]; type CloudArtifactAvailability = 'ready' | 'pending' | 'unavailable' | 'expired'; type CloudArtifact = { provider: string; kind: CloudArtifactKind; name: string; url?: string; providerSessionId?: string; providerArtifactId?: string; contentType?: string; extension?: string; availability?: CloudArtifactAvailability; metadata?: Record<string, unknown>; }; type CloudArtifactsStatus = 'ready' | 'pending' | 'unavailable'; type CloudArtifactsResult = { provider: string; status: CloudArtifactsStatus; cloudArtifacts: CloudArtifact[]; providerSessionId?: string; message?: string; }; type DaemonArtifactInventoryEntry = { id: string; artifactType?: DaemonArtifactType; filename: string; mimeType: string; sizeBytes: number; createdAt: string; expiresAt: string; /** Display rotation a screenshot was rendered in; absent when the capture reported none. */ displayRotation?: DeviceRotation; /** * Public name of the session that produced the artifact, without a tenant prefix. Present on an * artifact the daemon registered outside a request reply, such as a recording kept when its * leased session was torn down. */ sessionName?: string; }; type DaemonArtifactsResult = { source: 'daemon'; status: 'ready'; artifacts: DaemonArtifactInventoryEntry[]; message?: string; }; type AgentArtifactsResult = CloudArtifactsResult | DaemonArtifactsResult; type CloudArtifactsQuery = { provider?: string; leaseId?: string; providerSessionId?: string; }; type CloudProviderSessionResult = { provider?: string; providerSessionId?: string; cloudArtifacts?: CloudArtifactsResult; } & Record<string, unknown>; /** * Return undefined only when this provider implementation does not handle the query. * Return a CloudArtifactsResult with status "unavailable" when the provider handled the * query but artifact retrieval failed, and "pending" when artifacts are not finalized yet. */ type CloudArtifactProvider = { listCloudArtifacts?: (query: CloudArtifactsQuery) => Promise<CloudArtifactsResult | undefined>; }; //#endregion export { ScrollDirection as A, HardwareButtonName as C, ScreenshotCaptureBackend as D, SnapshotDiagnosticsSummary as E, BackMode as F, SessionSurface as I, SwipePattern as M, SwipePreset as N, ScreenshotRequestFlags as O, TransformGestureParams as P, FoldScreenCoordinateSpace as S, SetFoldPoseInput as T, TvRemoteButton as _, AndroidSnapshotBackendMetadata as a, DeviceRotation as b, ScreenshotResultData as c, PermissionAction as d, PermissionMode as f, TextSizeCategory as g, SettingName as h, CloudProviderSessionResult as i, ScrollInputDirection as j, ScreenshotScreenMask as k, MACOS_PERMISSION_TARGETS as l, SETTINGS as m, CloudArtifactProvider as n, FindLocator as o, ReadableSetting as p, CloudArtifactsResult as r, InteractorSnapshotCapture as s, AgentArtifactsResult as t, MOBILE_PERMISSION_TARGETS as u, ScrollCommandResult as v, OrientationRequest as w, FoldPose as x, ScrollExecutionOptions as y };