leonard_flutter library

Classes

CoreExtension
Host-installed extension contributing the 13 core.* action tools (PRD §12.1).
CoreToolErrorCode
Stable error codes returned by core tools as the prefix of ToolResult.error. The format is '<code>: <human message>'.
ErrorEntry
A single recorded runtime error.
FrameworkBusySnapshot
Immutable snapshot of framework-level "busy" signals captured by LeonardBinding.frameworkBusySnapshot().
InteractiveSemanticsAuditor
Walks the live widget tree and emits a warning for each candidate interactable widget whose ancestor chain lacks a label-bearing Semantics annotation. Connect-time diagnostic; not invoked per turn.
InteractiveSemanticsWarning
Diagnostic record produced by InteractiveSemanticsAuditor when a candidate interactable widget lacks an enclosing semantics annotation.
LeonardApp
High-level entry point for Flutter apps that want LeonardBinding installed before any user code constructs Flutter-aware objects (e.g. GoRouter, MaterialApp).
LeonardAppConfig
Carrier returned from LeonardApp.build: the extensions to register with the binding (debug/profile only; ignored in release) and the root widget to hand to runApp.
LeonardAppContext
Context handed to LeonardApp.build. In release, binding is null and onTeardown is a no-op; user code can branch on isProductionMode to skip dev-only wiring.
LeonardBinding
LeonardExtension
EXPERIMENTAL — v1 extension contract (PRD §7).
ScreenshotConfig
Default-enabled flags for ext.leonard.core.screenshot, keyed by model capability. Read by the harness per turn.
ScreenshotResult
A PNG screenshot and the view metadata exposed on Leonard's wire protocol.
SemanticsCapture
Walks Flutter's semantics tree and emits compact JSON-friendly records describing visible, interactive nodes.
SemanticsSnapshot
One semantics capture: the emitted node records and the route layers read in the same walk.

Constants

kDefaultErrorBufferCapacity → const int
Reserved prefix. Format: ext.leonard.<core_or_extension_namespace>.<suffix>. core is reserved for host-owned extensions. Default capacity of the runtime error ring buffer (PRD §6.1).
kExtensionGuideFixPointer → const String
Canonical fix-pointer message — referenced verbatim by tests and surfaced to users in every warning record.
kLeonardExtensionPrefix → const String
Prefix owned by Leonard for every VM-service extension.
kLeonardProtocolVersion → const String
Current Leonard handshake protocol version.

Functions

captureScreenshot() → Future<ScreenshotResult>
Captures the first Flutter view through the stock inspector implementation.

Exceptions / Errors

CoreToolError
Helper exception type for core-tool error reporting.
ScreenshotUnavailable
Mapped by the extension handler to JSON-RPC error code 1.