GlintSession class

Per-connection state: a pool of attached apps (one per device) plus the active one every tool reads through. Getters delegate to the active AppSession; accessing them with nothing attached throws SessionNotAttachedError. actionLog is always available — survives detach so cross-attach history stays queryable.

Constructors

GlintSession({GlintConfig? config, UsageRecorder? usage, AttachHistory? attachHistory, FlutterRuntime runtimeFactory()?})

Properties

actionLog → ActionLog
final
active → AppSession?
no setter
appLogs → AppLogBuffer
no setter
apps → List<AppSession>
Every attached app, most recently attached first.
no setter
attachedBundleId ↔ String?
Bundle id / package of the active app, when known — used by kill_app.
getter/setter pair
attachHistory → AttachHistory
Persistent app↔device↔project history so attach can relaunch from cold.
final
backend → InteractionBackend
no setter
buttonEnricher → ButtonFactsEnricher
no setter
config → GlintConfig
final
device → DeviceTarget
no setter
explore → ExploreRecorder
The per-app screen graph built from every scene read and gesture, kept under the data dir.
latefinal
flagEnricher → SemanticsFlagEnricher
no setter
hashCode → int
The hash code for this object.
no setterinherited
iconEnricher → IconEnricher
no setter
imageEnricher → ImageEnricher
no setter
inertEnricher → InertEnricher
no setter
inputEnricher → InputEnricher
no setter
inspector → InspectorClient
no setter
interactor → Interactor
no setter
isAttached → bool
no setter
isDeviceMode → bool
no setter
linkEnricher → LinkEnricher
no setter
mapEnricher → MapEnricher
no setter
nativeReader → NativeReader?
Null when the active device is not an iOS simulator.
no setter
no setter
opaqueEnricher → OpaqueWidgetEnricher
no setter
overlayEnricher → OverlayEnricher
no setter
pagedEnricher → PagedViewportEnricher
no setter
progressNotifier ↔ void Function(ProgressNotification)?
The progress sender for the running call: it keeps progress values growing and counts as a heartbeat.
getter/setter pair
rawProgressNotifier ↔ void Function(ProgressNotification)?
Forwards ProgressNotifications to the client; wired by the server.
getter/setter pair
reader → SceneReader
no setter
readinessGate → ReadinessGate
no setter
reconnectCount → int
no setter
resolver → CoordinateResolver
no setter
runtime → FlutterRuntime
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sceneMode ↔ SceneMode
getter/setter pair
semanticizer → Semanticizer
no setter
sessions → SessionManager
final
settleDetector → SettleDetector
no setter
tabEnricher → TabLabelEnricher
no setter
toggleEnricher → ToggleEnricher
no setter
updateNoticeShown ↔ bool
Whether attach already told the agent a newer glint is out, so it says so once per session.
getter/setter pair
usage → UsageRecorder
final
usageReporter ↔ UsageReporter
latefinal
watches → WatchRegistry
Conditions the agent asked to be told about while it does something else, written to an events file.
latefinal

Methods

activate(AppSession app) → void
appFor(String deviceId) → AppSession?
appForVm(Uri vmUri) → AppSession?
The pooled session already bound to vmUri, if any.
applyShowTouches() → Future<Map<AppSession, TouchesOutcome>>
Applies config.showTouches to every live Flutter app that is not observe-only, and to device-mode Android emulators, which draw touches themselves; other device-mode apps are skipped.
appsJson() → List<Map<String, Object?>>
attach({required Uri vmUri, required DeviceTarget device, bool rebuild = false, bool observe = false}) → Future<AppSession>
Attach (or switch to) the app at vmUri on device. A pooled session bound to the same VM is activated as-is; a different app on the same device replaces the old entry. Other pooled apps stay connected. rebuild replaces even a live session of the same app, to move it to another input backend.
attachDevice({required DeviceTarget device}) → Future<AppSession>
Attach in device mode — bind an OS-level device with no Flutter VM. Only backend + device are live; Flutter perception (scene reader, resolver, interactor) is not. Drive via screenshots + coordinate taps.
clearLaunchedApp(String deviceId) → void
detach({String? deviceId}) → Future<void>
Detach one app (the active one by default) and drop it from the pool. When exactly one other app remains it becomes active.
detachAll() → Future<void>
findApp(String target) → AppSession?
One session for target, or null when none / several match.
focusedFieldInfo() → Future<({bool formatted, String text})?>
The focused field's text, and whether its own input formatters may rewrite what is typed (the newline filter every single-line field gets does not count); null when no text field has focus.
focusedFieldText() → Future<String?>
Text of the focused EditableText, or null when no text field has focus. A leading "1" marker separates "no field" (empty) from "focused but empty" ("1").
hasApp(String deviceId) → bool
killLaunchedApps() → Future<void>
Kills every flutter run process glint started. Called from the server shutdown path so a dying glint never orphans its children.
launchedAppFor(String deviceId) → Process?
lifecycleState() → Future<String?>
One of: resumed, inactive, paused, detached, hidden. Null when unset.
markOwnedApp(Iterable<String?> appIds) → void
matchApps(String target) → List<AppSession>
Sessions matching target (device id, app name/package/bundle id, or a device-name prefix). An exact device-id or full-label hit wins alone.
modelImage(String path, {int? maxSize}) → Future<({String coordinates, ModelImage image})>
path shrunk for the model per the screenshot settings, with how its pixels map to tap x,y; maxSize overrides the configured cap.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ownsApp(String appId) → bool
ownsDevice(String deviceId) → bool
probeScrollAnchor() → Future<ScrollAnchor?>
Reference point inside the primary scrollable, for scroll-displacement detection: (glintId, logicalCenter). A fully-realized scrollable (SingleChildScrollView) has an identical tree at every offset, so we measure a descendant's physical shift instead. Null when there's no scrollable or no resolvable descendant.
probeViewport() → Future<({double dpr, double logicalH, double logicalW})>
Logical viewport size + DPR, probed via geometry resolver on any addressable node. Used by direction-based scroll tools.
registerLaunchedApp(String deviceId, Process process) → void
scrollAnchorAt(Scene scene, SemanticScene semantic, double x, double y) → Future<ScrollAnchor?>
The anchor of the innermost scrollable whose viewport contains logical point x, y; null when the point is over no scrollable.
scrollAnchorIn(Scene scene, SemanticScene semantic) → Future<ScrollAnchor?>
probeScrollAnchor against a scene + semantic view the caller holds; the anchor is scrolled content, never the viewport itself, whose center stays put.
semanticize(Scene scene, {SceneDetail detail = SceneDetail.full}) → Future<SemanticScene>
Semanticize + enrich an already-read scene to detail. The caller still owns the scene's dispose.
takeLogNote(String deviceId) → String?
The warning for deviceId when its last re-attach could not continue the earlier app logs.
toString() → String
A string representation of this object.
inherited
uiState() → Future<({String? brightness, String? focusedType, double keyboardBottomPx, String? locale, String? orientation})>
Focused widget type + keyboard inset + orientation + brightness + locale.
viewportIn(Scene scene) → Future<({double dpr, double logicalH, double logicalW})>
probeViewport against a scene the caller already holds. The implicit view answers without a node; a selected node is the fallback.
withApp<T>(AppSession target, Future<T> body()) → Future<T>
Runs body bound to target through a zone value, so concurrent calls never see each other's app.
withScene<T>(Future<T> use(SemanticScene scene), {SceneDetail detail = SceneDetail.full}) → Future<T>
The single perceive entry: read the scene, semanticize, enrich to detail, hand it to use, then dispose. Callers never re-assemble the pipeline themselves.

Operators

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