UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

53 lines (52 loc) • 2.19 kB
import { verifiedHelper } from "./native-helpers.js"; import { type Json } from "./protocol.js"; export { verifiedHelper }; export declare const SIMULATOR_UDID: RegExp; /** The iOS simulators booted on this Mac, from `simctl`; none elsewhere. */ export declare function bootedSimulators(): Promise<Json[]>; /** Most devices `GET /v1/simulators?all=1` lists. */ export declare const SIMULATOR_DEVICE_LIMIT = 64; /** * Every iOS simulator this Mac can run (`simctl list devices available`), booted or not, with its `state` * (`Booted`, `Shutdown`, `Booting`, `Shutting Down`): booted ones first, then the newest runtime, then by * name, at most SIMULATOR_DEVICE_LIMIT. For the phone's device picker, which boots one from here. */ export declare function simulatorDevices(): Promise<Json[]>; /** A PNG of one booted simulator's screen. */ export declare function simulatorScreenshot(udid: string): Promise<Buffer>; /** What the phone may ask a simulator to do. Boot, shutdown, launch and * URL go through simctl; touches and keys go through the Simulator app's * window with UI scripting, which needs Accessibility for the Hook's node. */ export type SimulatorAction = { action: "boot" | "shutdown" | "home" | "lock" | "screenshot-ready" | "accessibility-settings"; } | { action: "launch"; bundleId: string; } | { action: "openurl"; url: string; } | { action: "tap"; x: number; y: number; } /** A swipe or scroll: press at (x1, y1), move to (x2, y2) over `durationMs` (default 300), release. */ | { action: "drag"; x1: number; y1: number; x2: number; y2: number; durationMs?: number; } | { action: "type"; text: string; submit?: boolean; }; /** A drag's duration bounds, in ms. */ export declare const DRAG_DEFAULT_MS = 300, DRAG_MIN_MS = 50, DRAG_MAX_MS = 5000; /** The steps for the Accessibility grant, for the 403 and the docs. */ export declare function accessibilityHelp(binary: string): string; export declare function simulatorAct(udid: string, request: SimulatorAction): Promise<Json>; /** The apps a simulator has, for the launcher. */ export declare function simulatorApps(udid: string): Promise<Json[]>;