@agenteract/dom
v0.2.0
Published
DOM utilities for Agenteract
Downloads
36
Maintainers
Readme
@agenteract/dom
DOM utilities for web applications using Agenteract.
Agenteract is an experimental bridge that lets coding agents view and interact with running applications — React Native / Expo, React, Flutter, Kotlin Multiplatform, and SwiftUI.
Installation
npm install @agenteract/domWhat it does
Provides getDomHierarchy() — walks the live DOM and returns a pruned, semantic tree of the page structure. Nodes are included if they have a data-testid, aria-label, text content, or children that match. Script and style tags are excluded.
Used by @agenteract/react to report the current DOM state to the Agenteract bridge.
API
import { getDomHierarchy } from '@agenteract/dom';
const hierarchy = getDomHierarchy();
// Returns a nested tree of:
// { name, testID, accessibilityLabel, text, children }Each node represents a DOM element with:
name— tag name (e.g."div","button")testID— value ofdata-testidattributeaccessibilityLabel— value ofaria-labelattributetext— text content (for single text-node elements, inputs, selects)children— array of child nodes
Full documentation
See the Agenteract README for full setup guides, configuration reference, and platform-specific instructions.
License
MIT
