Skip to main content

Crate smix_driver

Crate smix_driver 

Source
Expand description

smix-driver — decide layer (CLAUDE.md §12.1 middle).

Wraps HttpRunnerClient (sense + act IPC) with host-side resolve dispatch. The default path is: SDK call → driver.taptree()resolve_selector() → centroid → runner.tap_at_norm_coord() (Apple native event chain).

§Failure model

All methods return Result<T, ExpectationFailure> — AI-readable rendering lives in smix-error.

§Implicit wait

tap includes a 5s poll-and-retry loop: if the first resolve_selector returns None, sleep 250 ms then re-fetch tree + re-resolve, up to a 5s total budget. Once a candidate is found we tap the same frame to avoid a split-fetch race.

Structs§

AndroidDriver
Android Driver impl. Wraps HttpRunnerClient connecting to the Kotlin runner via adb-forwarded port (default 28080, configurable via AndroidDriver::new(port)).
HttpRunnerClient
HTTP client to the swift-side SmixRunnerCore. Async (tokio-based). Constructed once per Cell; ensure_reachable memoizes a successful /health probe so subsequent calls don’t re-probe.
IosDriver
Driver wrapping HttpRunnerClient with host-side resolve dispatch.
OcrFrame
Normalized OCR bounding box returned by HttpRunnerClient::find_text_by_ocr. Coordinates are normalized to [0, 1] in UIKit coord space (top-left origin, y-down). Apple Vision’s native bbox is bottom-left origin + y-up — the swift handler converts before returning so all consumers see UIKit coords.
SystemPopup
One system-popup discovered on the screen (alert / sheet / banner).

Enums§

IncludeScope
include scope literal — currently only all-windows (system popups pierce the app frame).
Orientation
Sim device orientation. Driver-level type; SDK exposes a 1:1 MaestroOrientation mirror for maestro yaml literal alignment.
Platform
Platform identifier for cross-platform dispatch.
RunnerScrollSelector
Reduced selector shape used by /scroll (text-or-id only; complex selectors are host-side-resolved before reaching the runner).
RunnerTransportError
Transport-level failure (network, non-2xx, malformed body). Mirrors TS RunnerTransportError 1:1.
TapMode
POST /tap mode discriminator.

Traits§

Driver
Sense + act capabilities for a single device. Two-trait architecture pair with smix_sdk::DeviceControl (sim/host control in smix-sdk).

Type Aliases§

SimctlDriver
Back-compat alias. SimctlDriver was renamed to IosDriver for cross-platform naming; this alias keeps existing imports use smix_driver::SimctlDriver compiling.