SemanticInspectionSnapshot class final
Machine-readable, redaction-aware semantic inspection snapshot.
This is the v0 protocol shape for tests, debug capture, and future automation/agent adapters that need the meaning tree without scraping rendered terminal cells.
Constructors
-
SemanticInspectionSnapshot.fromJson(Map<
String, Object?> json) -
Parses a JSON semantic inspection snapshot.
factory
- SemanticInspectionSnapshot.fromTree(SemanticTree tree, {int schemaVersion = currentSchemaVersion})
-
factory
Properties
- actionCount → int
-
final
- focusedNodeId → String?
-
Id of the node that holds focus, the deepest node on the focus path (see
SemanticTree.focusedNode), or null when no node is focused. A snapshot
parsed from JSON keeps the producer's id while that node is in the tree.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- nodeCount → int
-
final
-
nodes
→ Iterable<
SemanticInspectionNode> -
no setter
-
roleCounts
→ Map<
String, int> -
final
- root → SemanticInspectionNode
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schemaVersion → int
-
final
Methods
-
debugTree(
{bool includeState = true}) → String - Returns a deterministic, redaction-aware tree summary for humans.
-
nodeById(
String id) → SemanticInspectionNode? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
single(
{String? id, String? role, String? label, String? labelContains, Object? value, String? action, bool? focused, bool? selected, bool? enabled, Map< String, Object?> stateContains = const <String, Object?>{}}) → SemanticInspectionNode -
toJson(
) → Map< String, Object?> -
toJsonCapped(
{required int maxNodes, Map< String, Object?> ? augment(SemanticInspectionNode node)?}) → Map<String, Object?> -
Like toJson but bounds the tree to at most
maxNodesnodes — dropped subtrees carrychildrenTruncatedand the envelope carriestruncated: true. For token-limited consumers (the MCPget_uitool); the wire/serve path uses the unbounded toJson.roleCounts/nodeCountstill describe the full tree so a consumer knows what it didn't see.augmentis an optional per-node hook: its returned map (if any) is merged into that node's JSON. A generic extension point — the caller owns what it adds (e.g. the MCP server injects a normalizedvalueSchema); this keeps such consumer-specific fields out of the core node model while still respecting the budget walk. -
toSemanticTree(
) → SemanticTree - Reconstructs a SemanticTree from this snapshot.
-
toString(
) → String -
A string representation of this object.
override
-
where(
{String? id, String? role, String? label, String? labelContains, Object? value, String? action, bool? focused, bool? selected, bool? enabled, Map< String, Object?> stateContains = const <String, Object?>{}}) → Iterable<SemanticInspectionNode>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
isSchemaVersionCompatible(
int schemaVersion) → bool
Constants
- currentSchemaVersion → const int
- Current semantic inspection protocol version emitted by Fleury.
- minimumCompatibleSchemaVersion → const int
- Oldest semantic inspection protocol version this reader accepts.
-
stableJsonFields
→ const Set<
String> - Stable top-level JSON keys for schema v1.