core/runtime/mission_runner library

Classes

MissionCancelToken
External cancellation handle. reason is the wire failure_reason the terminal frame reports: cancelled for a backend cancel or a preemption, user_interrupted when a person touched the app (RN / Android interruptActive). The first reason wins.
MissionRunner
Orchestrates a MissionMessage end-to-end: walks steps in order, finds targets, dispatches to the right executor, verifies side effects, retries on failure, emits protocol events for both lifecycle (status) and outcome (verification).
MissionRunResult
Terminal outcome of a MissionRunner.run call.

Functions

raceCancel<T>(Future<T> work, CancelSignal signal, T onCancel(), {Duration poll = const Duration(milliseconds: 20)}) → Future<T>
Race work against signal (Android raceCancel): completes with work's value, or with onCancel's the moment signal fires — whichever is first. The abandoned work keeps running but is inert: every executor checkpoints the same signal before its next live-UI action. The signal is polled every poll (CancelSignal has no listener API).

Typedefs

HighlightCallback = void Function(UiNode target)
Draws the highlight for a mission's highlight / scroll_and_highlight step on target (the re-found, settled node).
MissionFindCandidatesListener = void Function(FindCandidatesResponseMessage msg)
MissionInfoQueryListener = void Function(InfoQueryResponseMessage msg)
MissionPhaseListener = void Function(MissionPhaseMessage msg)
MissionStatusListener = void Function(MissionStatusMessage msg)
MissionVerificationListener = void Function(VerificationResultMessage msg)
RollbackCallback = Future<void> Function(MissionRunResult result)
ScrollerResolver = Scroller? Function(MissionStep step, UiSnapshot snapshot)
Given a step (typically scroll_to / scroll_and_highlight) and the current snapshot, return the Scroller the step should drive — or null when no scrollable can be resolved.
SnapshotFactory = UiSnapshot? Function()
StepHighlightCallback = void Function(UiNode target, MissionStep step, String missionId)
Richer highlight hook: also receives the step (for duration_ms) and the mission id (an internal hl_ mission draws through the standalone path). When set it replaces HighlightCallback for drawing.