Raxol.Agent.SemanticTree (Raxol Agent v2.6.0)

Copy Markdown View Source

Transforms a raw view tree into a semantic tree for agent consumption.

Strips layout-only keys (style, padding, margin, etc.) and keeps semantic content (value, selected, checked, items, etc.). Called on-demand from Agent.Session -- no GenServer, no caching.

Summary

Functions

Depth-first search by :id. Returns nil on miss.

Collect all nodes matching :type.

Transforms a raw view tree into a semantic tree.

Flatten all text content into a single string.

Functions

find(node, target_id)

Depth-first search by :id. Returns nil on miss.

find_by_type(node, target_type)

Collect all nodes matching :type.

from_view_tree(tree, opts \\ [])

Transforms a raw view tree into a semantic tree.

Options:

  • :focused_id - element id to mark as focused

text_content(node)

Flatten all text content into a single string.