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.

204 lines • 7.16 kB
import { E as PlatformSelector, c as DaemonServerMode, f as LeaseBackend, l as DaemonTransportPreference, v as SessionIsolationMode, w as DeviceTarget, y as SessionRuntimeHints } from "./sdk-contracts.js"; //#region packages/contracts/src/companion-tunnel-scope.d.ts /** * The tenant, run, and lease identity shared by public command options and the * companion tunnel in `@agent-device/react-native`. */ type CompanionTunnelScope = { tenantId: string; runId: string; leaseId: string; }; /** The companion-tunnel scope as Metro's bridge names it. */ type MetroBridgeScope = CompanionTunnelScope; //#endregion //#region packages/contracts/src/metro.d.ts type MetroPrepareKind = 'auto' | 'react-native' | 'expo' | 'repack'; /** A prepare kind after resolution: `auto` is a request, never an outcome. */ type ResolvedMetroKind = Exclude<MetroPrepareKind, 'auto'>; type MetroBridgeResult = { enabled: boolean; baseUrl: string; statusUrl: string; bundleUrl: string; iosRuntime: SessionRuntimeHints; androidRuntime: SessionRuntimeHints; upstream: { bundleUrl: string; host: string; port: number; statusUrl: string; }; probe: { reachable: boolean; statusCode: number; latencyMs: number; detail: string; }; }; type PrepareMetroRuntimeResult = { projectRoot: string; kind: ResolvedMetroKind; dependenciesInstalled: boolean; packageManager: string | null; started: boolean; reused: boolean; pid: number; logPath: string; statusUrl: string; runtimeFilePath: string | null; iosRuntime: SessionRuntimeHints; androidRuntime: SessionRuntimeHints; bridge: MetroBridgeResult | null; }; /** * `transport` says which channel delivered the reload: `http` for the classic GET /reload route, * `message-socket` for the /message websocket broadcast used when the server has no HTTP reload * route (Expo). `status`/`body` always describe the HTTP probe; on the websocket path `reloadUrl` * is the ws(s) message-socket URL. */ type ReloadMetroResult = { reloaded: true; reloadUrl: string; status: number; body: string; transport: 'http' | 'message-socket'; }; type MetroPrepareOptions = { projectRoot?: string; kind?: MetroPrepareKind; publicBaseUrl?: string; proxyBaseUrl?: string; bearerToken?: string; bridgeScope?: MetroBridgeScope; launchUrl?: string; companionProfileKey?: string; companionConsumerKey?: string; port?: number; listenHost?: string; statusHost?: string; startupTimeoutMs?: number; probeTimeoutMs?: number; reuseExisting?: boolean; installDependenciesIfNeeded?: boolean; runtimeFilePath?: string; logPath?: string; }; type MetroReloadOptions = { metroHost?: string; metroPort?: number; bundleUrl?: string; timeoutMs?: number; }; type MetroPrepareResult = PrepareMetroRuntimeResult; type MetroReloadResult = ReloadMetroResult; //#endregion //#region packages/contracts/src/remote-config-fields.d.ts /** * Screen orientation a hosted provider session starts in. Distinct from `DeviceRotation` * (`contracts/device-rotation.ts`): that is a four-way runtime rotation command, this is the * two-way session-creation capability hosted providers accept. */ declare const PROVIDER_DEVICE_ORIENTATIONS: readonly ['portrait', 'landscape']; type ProviderDeviceOrientation = (typeof PROVIDER_DEVICE_ORIENTATIONS)[number]; /** Device pool a hosted provider session is created in: physical devices or emulators/simulators. */ declare const PROVIDER_DEVICE_TYPES: readonly ['real', 'virtual']; type ProviderDeviceType = (typeof PROVIDER_DEVICE_TYPES)[number]; type CloudProviderProfileFields = { providerApp?: string; providerOsVersion?: string; providerDeviceType?: ProviderDeviceType; providerProject?: string; providerBuild?: string; providerSessionName?: string; providerDeviceOrientation?: ProviderDeviceOrientation; providerGeoLocation?: string; providerTimezone?: string; providerAppiumVersion?: string; providerLanguage?: string; providerLocale?: string; providerNetworkProfile?: string; providerCustomNetwork?: string; providerNoResignApp?: boolean; /** * Asks a provider that supports it to capture session network traffic and deliver it as a HAR * artifact. */ providerNetworkLogs?: boolean; /** With `providerNetworkLogs`: comma-separated tunnel selectors replacing the default capture list. */ providerNetworkHosts?: string; awsProjectArn?: string; awsDeviceArn?: string; awsAppArn?: string; awsRegion?: string; awsInteractionMode?: 'INTERACTIVE' | 'NO_VIDEO' | 'VIDEO_ONLY'; }; type RemoteConfigMetroOptions = { metroProjectRoot?: string; metroKind?: MetroPrepareKind; metroPublicBaseUrl?: string; metroProxyBaseUrl?: string; metroBearerToken?: string; metroPreparePort?: number; metroListenHost?: string; metroStatusHost?: string; metroStartupTimeoutMs?: number; metroProbeTimeoutMs?: number; metroRuntimeFile?: string; metroNoReuseExisting?: boolean; metroNoInstallDeps?: boolean; launchUrl?: string; }; /** * How to reach a daemon and which lease/tenant the request belongs to. * * Sibling of `CloudProviderProfileFields` above, and here for the same reason: `remote/` owns * reading and validating a profile, but the field vocabulary is a contract that zones below * `remote/` are stated in terms of — the public API config is composed from both groups. Leaving * this one in `remote/` made every consumer of that composition declare itself in terms of a * rank-4 zone. */ type RemoteConnectionProfileFields = { stateDir?: string; daemonBaseUrl?: string; daemonAuthToken?: string; daemonTransport?: DaemonTransportPreference; daemonServerMode?: DaemonServerMode; tenant?: string; sessionIsolation?: SessionIsolationMode; runId?: string; leaseId?: string; leaseBackend?: LeaseBackend; leaseProvider?: string; deviceKey?: string; clientId?: string; }; /** A resolved remote-config profile: the field groups above plus the device-selection fields. */ type RemoteConfigProfile = RemoteConfigMetroOptions & CloudProviderProfileFields & RemoteConnectionProfileFields & { platform?: PlatformSelector; target?: DeviceTarget; device?: string; udid?: string; serial?: string; osVersion?: string; imageTag?: string; deviceMode?: string; deviceBaseline?: string; physical?: boolean; iosSimulatorDeviceSet?: string; androidDeviceAllowlist?: string; session?: string; }; //#endregion //#region packages/remote/src/remote-config-schema.d.ts type RemoteConfigProfileOptions = { configPath: string; cwd: string; env?: Record<string, string | undefined>; }; type ResolvedRemoteConfigProfile = { resolvedPath: string; profile: RemoteConfigProfile; }; //#endregion export { RemoteConfigProfile as a, MetroPrepareOptions as c, MetroReloadResult as d, PrepareMetroRuntimeResult as f, RemoteConfigMetroOptions as i, MetroPrepareResult as l, MetroBridgeScope as m, ResolvedRemoteConfigProfile as n, RemoteConnectionProfileFields as o, ReloadMetroResult as p, CloudProviderProfileFields as r, MetroPrepareKind as s, RemoteConfigProfileOptions as t, MetroReloadOptions as u };