ai_flutter_agent library

Classes

ActionDescriptor
Describes an action the LLM wants to execute on the UI.
ActionDispatcher
Dispatches ActionDescriptors to their handlers after resolving target nodes.
ActionRegistry
Manages the set of actions available to the agent.
AgentCallbacks
Callback hooks for observing AgentCore execution.
AgentConfig
Configuration for the AgentCore.
AgentCore
Main orchestrator for the Flutter Agent framework.
AgentOverlayState
AgentOverlayWidget
Widget wrapper that ensures semantics are enabled for the agent.
AgentState
Mutable state of the running AgentCore.
AuditEntry
Audit log entry recording a single agent action.
AuditLog
Records all actions executed by the agent for auditing and debugging.
AutoApproveConsentHandler
Always-approve consent handler for testing or trusted environments.
AutoDenyConsentHandler
Always-deny consent handler for locked-down environments.
BuiltInActions
Registers standard built-in actions that map to Flutter SemanticsActions.
ConsentHandler
Strategy for requesting user consent before agent actions.
ConversationHistory
Manages multi-turn conversation history for LLM interactions.
CustomPromptTemplate
User-customizable prompt template with placeholder substitution.
DebugEvent
A single debug event with metadata.
DebugLogStream
Streams agent debug events for UI binding.
DefaultPromptTemplate
Default prompt template matching the original Planner.buildPrompt() format.
ExecutionResult
Result of executing a single action.
Executor
Executes ActionDescriptors against the ActionRegistry.
IsolateLLMClient
Wraps any LLMClient to execute LLM requests in a Dart Isolate.
LLMClient
Abstract interface for LLM communication.
Macro
A named, replayable sequence of actions.
MacroRecorder
Records a sequence of ActionDescriptors as a replayable macro.
MacroStore
Stores and retrieves macros as JSON strings.
NodeResolver
Resolves WidgetDescriptor nodes from a tree using a Selector.
OpenAILLMClient
OpenAI API implementation of LLMClient.
Planner
Constructs LLM prompts from the current UI state and parses responses.
PromptTemplate
Abstract interface for prompt formatting strategies.
RetryExecutor
Executes an async function with automatic retry and exponential backoff.
Selector
Defines how to locate a target node in the semantics tree.
SemanticsActionExecutor
Bridge between agent actions and Flutter's semantics performAction API.
SemanticTreeWalker
Traverses Flutter's live SemanticsNode tree and produces a WidgetDescriptor tree for the agent.
SensitiveDataMasker
Masks sensitive data in WidgetDescriptor trees before sending to LLM.
StreamingLLMClient
Extension of LLMClient that supports streaming responses.
VerificationDetail
Structured diff result showing exactly what changed between two UI trees.
Verifier
Verifies that agent actions had the intended effect on the UI.
WidgetDescriptor
Represents a single node in the UI semantics tree.

Enums

AgentStatus
Represents the current status of the agent.
DebugEventType
Types of debug events.
SelectorType
Strategy for locating a target SemanticsNode.
VerificationResult
Result of a post-action verification check.

Typedefs

ActionFunction = Future<void> Function(Map<String, dynamic> args)
Callback signature for registered actions.

Exceptions / Errors

LLMException
Exception thrown when LLM communication fails.
UnregisteredActionException
Thrown when attempting to execute an action not in the registry (whitelist).
UnsupportedActionException
Thrown when an unsupported action name is requested.