core/runtime/mission_runner library
Classes
- MissionCancelToken
- External cancellation handle.
- 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
workagainstsignal(AndroidraceCancel): completes withwork's value, or withonCancel's the momentsignalfires — 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 everypoll(CancelSignal has no listener API).
Typedefs
- HighlightCallback = void Function(UiNode target)
-
Draws the highlight for a mission's
highlight/scroll_and_highlightstep ontarget(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 internalhl_mission draws through the standalone path). When set it replaces HighlightCallback for drawing.