Expand description
smix-runner-client — HTTP IPC client to swift-bridge/SmixRunnerCore.
Allows reqwest + tokio + thiserror + tracing deps.
Wire-level 1:1 compatibility with the Swift side — any route shape /
query param / response body shape change must be done in lockstep with
swift-bridge/Sources/SmixRunnerCore.
§Routes
GET /health— connectivity probe (memoized viaHttpRunnerClient::ensure_reachable)GET /tree?include=— full a11y tree dump (returnsA11yNode)GET /system-popups?include=— list ofSystemPopupPOST /tap {selector, mode, include?}— selector → element tapPOST /tap-at-norm-coord {nx, ny}— Apple native event chain coord tapPOST /find {selector, include?}— boolean existence checkPOST /fill {selector, text, include?}— fill text into inputPOST /clear {selector, include?}— clear inputPOST /press-key {key}— press named key (Return/Tab/etc.)POST /scroll {selector, direction, include?}— scroll-until-visiblePOST /swipe-once {direction}— single swipe gesture (no probe loop)POST /foreground {bundleId}— bring app to foregroundPOST /hide-keyboard— swipe-down to dismiss keyboardPOST /back— back gesturePOST /record/start— begin recording AX notificationsGET /record/poll— drain recorded eventsPOST /record/stop— stop recording, drain final events
Per CLAUDE.md §9 #4 — never expose raw URL / sleep / xpath surfaces. All operations go through the typed methods below.
Structs§
- Diagnostic
Dump Response POST /diagnostic/dumpresponse body (v1.0.7 §D5).- Find
Request POST /findrequest body.- Find
Response POST /findresponse body.- Health
Process Info - v1.0.4 — pid + alive flag for a watched process. Additive to
HealthResponse. - Health
Response - Extended
GET /healthresponse body (v1.0.2 additive). - Health
Test Host Info - v1.0.4 — xcodebuild test-host health with restart accounting.
- Http
Runner Client - HTTP client to the swift-side SmixRunnerCore. Async (tokio-based).
Constructed once per Cell;
ensure_reachablememoizes a successful/healthprobe so subsequent calls don’t re-probe. - Keyboard
Stages - Per-stage timing returned by
/fill//clear//press-key. - 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. - Record
Events Response GET /record/poll/POST /record/stopresponse body.- Recorded
Event - One recorder event captured by
/record/start→/record/pollflow. - Request
Context - Per-request context carried across the wire via the
App-Bundle-IdandApp-ActivateHTTP headers. Client sets these viaHttpRunnerClient::with_target_bundle_id/with_auto_activate, or per-call by cloning the client with a modified context. The runner side reads them intoSmixRunnerServer.currentContext(task-local) and passes toresolveApp()in every app-touching handler. - Runner
Include Opts includescope query param shared by/tree//tap//fill//clear//find//scroll//system-popups. URL-only.- Runner
Keyboard Result POST /fill/POST /clear/POST /press-keyresponse body.- Runner
Scroll NotMatched POST /scrollreturned200 / matched:false / swipes:N— scroll exhausted N swipes without surfacing the target. Mirrors TSRunnerScrollNotMatched.- Runner
Swipe Once Failure POST /swipe-oncereturned200 / ok:false / vanished_during_swipe. Mirrors TSRunnerSwipeOnceFailure.- Scroll
Response POST /scrollresponse body.- Session
AppLifecycle Request - v1.0.8 §D1 — request body shared by
POST /session/terminate-appandPOST /session/launch-app. Both endpoints take just the session id. - Session
AppLifecycle Response - v1.0.8 §D1 — response for
POST /session/terminate-appandPOST /session/launch-app. Runner reports wall time for observability; the whole point of splitting terminate + launch from/session/relaunch-appis to let the SDK insert a host-sideSimctlClient::clear_app_sandboxcall between them, eliminating the “Insight quit unexpectedly” ReportCrash dialog that even v1.0.4 §D12’s in-placesimctlwipe still tripped. - Session
Close AllResponse POST /session/close-all— v1.0.4 §D5 support forsmix runner cycle. Runner-side clears every open session and returns the count that was cleared.- Session
Close Request POST /session/closerequest body.- Session
Close Response POST /session/closeresponse body.- Session
List Response POST /session/listresponse body (v1.0.5 §D1).- Session
Open Request POST /session/openrequest body.- Session
Open Response POST /session/openresponse body.- Session
Relaunch AppRequest POST /session/relaunch-apprequest body (v1.0.4 §D14).- Session
Relaunch AppResponse POST /session/relaunch-appresponse body.- Session
Renew Activation Request POST /session/renew-activationrequest body.- Session
Renew Activation Response POST /session/renew-activationresponse body.- Session
Summary - v1.0.5 §D1 — one entry in
POST /session/listresponse. - System
Popup - One system-popup discovered on the screen (alert / sheet / banner).
- System
Popup Action Request POST /system-popup-actionrequest body (v4.2 c2 — G9 act side).- System
Popup Action Response POST /system-popup-actionresponse body.- System
Popup Button - One button on a
SystemPopup. - System
Popups Response GET /system-popupsresponse body.- TapAt
Norm Coord Request POST /tap-at-norm-coordrequest body.- TapNot
Found Error POST /tapreturned404 / not_found— element matched no node. Mirrors TSTapNotFoundError.- TapRequest
POST /taprequest body.- TapResult
POST /tapresponse body.- TapStages
POST /tapper-stage timing in milliseconds.- Wire
Subprocess Record - v1.0.7 §D3 — one entry in the subprocess ring buffer.
Enums§
- Include
Scope includescope literal — currently onlyall-windows(system popups pierce the app frame).- Input
Dispatch Mode - Input dispatch mode for the
Input-Dispatch-Modeheader. Runner-side interpretation lives inSmixRunnerCore/FillRoute.swift. - Runner
Scroll Selector - Reduced selector shape used by
/scroll(text-or-id only; complex selectors are host-side-resolved before reaching the runner). - Runner
Transport Error - Transport-level failure (network, non-2xx, malformed body). Mirrors
TS
RunnerTransportError1:1. - SimHealth
Wire State - v1.0.4 §D7 — Session state exposed to SDK consumers via the
X-Sim-Healthresponse header on every runner response. - TapMode
POST /tapmode discriminator.