VoiceLoop class

Wires the voice agent loop together end-to-end.

Constructors

VoiceLoop({required SendPayload send, required SnapshotFactory captureSnapshot, ScrollerResolver? scrollerResolver, HighlightCallback? highlightCallback, BackHandler? onBack, NavStack? navStack, HighlightDispatcher? standaloneHighlightDispatcher, RequestSnapshotCallback? onRequestSnapshot, MissionStatusListener? onMissionStatus, void afterStep()?, StepVerifier verifier = const Verifier(), Explorer explorer = const Explorer(), MissionOutcomeListener? onMissionTelemetry, StepOutcomeListener? onStepTelemetry, NearMissListener? onNearMiss, Duration stepTimeout = const Duration(seconds: 30), Duration missionTimeout = const Duration(minutes: 3), int retriesPerStep = 2, Duration retryDelay = const Duration(milliseconds: 450), Duration postExecuteSettle = const Duration(milliseconds: 400)})

Properties

activeMissionIds → Iterable<String>
no setter
hashCode → int
The hash code for this object.
no setterinherited
isBusy → bool
no setter
lastMissionId → String?
The mission (or internal hl_ highlight) dispatched most recently — queued, running or finished. Names the user_interaction frame when a touch interrupted nothing but the agent's UI was still on screen.
no setter
onMissionStatus → MissionStatusListener?
Host-side observer for mission lifecycle events.
final
onRequestSnapshot → RequestSnapshotCallback?
See RequestSnapshotCallback.
final
runner ↔ MissionRunner
The runner this loop owns.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
send → SendPayload
final
standaloneHighlightDispatcher → HighlightDispatcher?
See HighlightDispatcher.
final

Methods

cancelAllMissions() → void
Withdraw every running and queued mission (kill-switch flip, teardown).
dispose() → void
Cancel every in-flight mission and clear state.
handlePayload(Uint8List bytes) → Future<void>
Feed bytes from the LiveKit data-channel onData callback here.
interruptActive(String reason) → String?
Abort the RUNNING mission or highlight with a wire failure_reason (RN / Android interruptActive): it reports cancelled with that reason. Returns its id, or null when nothing was running.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendWire(Map<String, dynamic> json) → void
Send one outbound frame through the runtime's queue and policy guard.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fitResponseFrame(Map<String, dynamic> json, int maxBytes) → Map<String, dynamic>?
Shrink a request/response frame the backend is WAITING on so it fits maxBytes, instead of letting the transport cap drop it: find_candidates_response sheds its lowest-ranked (trailing) candidates, info_query_response shortens value. Null for any other type, or when even the minimal frame cannot fit (the queue then substitutes a failure).
redactForLog(Map<String, dynamic> json) → Map<String, dynamic>
A copy of an inbound frame safe for the (debug-only) wire log: the value of every set_text / type step (params.text) is replaced by <redacted len=N>. Whether the target is a PIN / password field is only known later, on the device, so every typed value is redacted.

Constants

kHighlightMissionPrefix → const String
Id prefix of the internal highlight missions.