Expand description
smix-driver — the decide layer.
Wraps HttpRunnerClient (sense + act IPC) with host-side resolve
dispatch. The default path is: SDK call → driver.tap → tree() →
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.
Modules§
- phases
- Where a step’s time goes, by named phase.
- poll
- When a wait that polls has run out.
- port_
owner - Which device a runner port actually reaches. Lives with the client because that is the layer that opens the connection. Which device does this port actually reach?
- settle
- Waiting for a tap’s target to stop moving.
- still
- Is the screen still? Two frames compared on a grid.
Structs§
- ActOutcome
- What an act did, as opposed to what it attempted.
- Android
Driver - Android
Driverimpl. WrapsHttpRunnerClientconnecting to the Kotlin runner via adb-forwarded port (default 28080, configurable viaAndroidDriver::new(port)). - Capture
Span - When a captured frame’s pixels were sampled, as an interval.
- Coordinate
Space - The two coordinate spaces a tap passes through, and the orientation the synthesised event is stamped with.
- HitElement
- One element, as either side describes it.
- Http
Runner Client - IosDriver
- Driver wrapping
HttpRunnerClientwith 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. - Press
Timing - What the runner reported about when a press was actually held, paired with what the host observed about the round trip.
- Reach
- What a scroll-until-visible asks of its target; part of
ScrollUntil. What a scroll-until-visible asks of its target. - Rect
- A rectangle as the runner reports it.
- Screen
Region - Part of the screen, in whole percent of its width and height.
- Scroll
Until - What a scroll-until-visible asks for, and how long it may take.
- System
Popup - One system-popup discovered on the screen (alert / sheet / banner).
Enums§
- ActVerdict
- What an act turned out to have done.
- Chain
Coverage - What a chain of hit elements leaves out.
- Frame
Placement - Where a captured frame sits relative to the press.
- Include
Scope includescope literal — currently onlyall-windows(system popups pierce the app frame).- Orientation
- Sim device orientation. Driver-level type; SDK exposes a 1:1
MaestroOrientationmirror for maestro yaml literal alignment. - Owner
Probe - Which host-side authority can say who holds a port.
- Platform
- Platform identifier for cross-platform dispatch.
- Runner
Transport Error - Transport-level failure (network, non-2xx, malformed body). Mirrors
TS
RunnerTransportError1:1.#[non_exhaustive]because this list grows whenever a route learns to say something more precise than “no”, and every such addition would otherwise cost a major on its own. Unlike a new verb — which an external executor must handle or silently skip — a transport error a caller has not heard of degrades into its_arm, which is the same place it would have landed before. The charge is paid once here. - Screen
AtTouch - What the screen was doing when a point was touched.
- TapMode
POST /tapmode discriminator.- TapSpace
Verdict - Whether a tap may proceed, given the spaces it is about to cross.
Constants§
- DEFAULT_
SCROLL_ TIMEOUT - maestro’s
DEFAULT_TIMEOUT_IN_MILLISforscrollUntilVisible. - OCR_
RECOGNITION_ LEVEL - The recognition level every OCR caller asks for.
Traits§
- Driver
- Sense + act capabilities for a single device. Two-trait architecture
pair with
smix_sdk::DeviceControl(sim/host control in smix-sdk).
Functions§
- crown_
turn_ check - Why
rotationsturns atvelocityturns a second is not a turn, orOkwhen it is: a non-zero, finite number of turns, and a speed that is positive when one is given. - decide_
tap_ outcome - Decide before touching anything.
- front_
app_ of - The bundle id this description was taken from, read off the a11y tree’s root identifier.
- host_
now_ ms - Wall clock in milliseconds, for anchoring a press window and the captures taken alongside it to the same timeline.
- landing_
outcome - The verdict on a selector act, from what the runner said it touched.
- latin_
script_ only - Scripts the Android recogniser can read.
- locate
targetas shares of the screen: a point is itself, anocrTextthe middle of the text it reads, anything else the centre of the element it resolves to.- ocr_
locales - The locales to read with, when the caller named none.
- press_
frame_ placement - Was this frame captured while the touch was down?
- scroll_
until - Swipe
directionuntilselector’s target is reached, peruntil. - tap_
landed_ within - Did the touch land inside the element it aimed at?
- transport_
to_ failure - What a transport error means to a caller, in one place.
- verdict_
reader - The tree a landing is judged from, given the tree the aim was read from: the same one, always, and decided here and nowhere else.
Type Aliases§
- Aimed
- Where a touch aimed at a selector goes: the normalised point, the element it is aimed at, and the tree that aim was read from.
- Simctl
Driver - Back-compat alias.
SimctlDriverwas renamed toIosDriverfor cross-platform naming; this alias keeps existing importsuse smix_driver::SimctlDrivercompiling.