LLMs Technical Reviews

How is the page represented to the model?

DOM serialization, accessibility tree, screenshots, set-of-marks/element indexes; size limits and pruning.

Verdict

For web pages, browser-use gives the model the most: merged DOM and accessibility text with stable ids, plus a screenshot every step. The Jev-based projects send the smallest text-only states, and Cua, agent-desktop and jev-use read the operating system’s accessibility tree for native apps.

DOM or AX text plus screenshots. browser-use merges DOMSnapshot, the DOM and the AX tree into [index]<tag> lines keyed by backend_node_id, capped at 40,000 characters. Skyvern stamps a unique_id on each interactable element and adds up to ten scrolled screenshots. Its set-of-marks overlay is switched off.

Text-only outlines for an LLM. Stagehand and HyperAgent tag accessibility lines with frame-backendNodeId ids. HyperAgent’s screenshot overlay is off by default. dsh-browser sends a content-script snapshot of at most 60 elements whose ids survive re-snapshots, so follow-up results are deltas. browser-harness has no perception layer: the calling agent queries Accessibility.getFullAXTree itself.

Small states for Jev choice questions. Jev Ultrafast returns at most 250 controls and 6,000 characters of text. jev-browser scans the DOM rather than the AX tree and prunes to 240 elements and a 1,500-character excerpt. Ulka builds candidates from Accessibility.getFullAXTree over CDP and scans the DOM only when no tree comes back. typesafe-computer-use merges Vision OCR with an AX walk into at most 255 items. Workflow Use shows no page to a model at replay time.

Native accessibility trees. Cua returns a screenshot, tree_markdown and element tokens. agent-desktop returns a JSON macOS AX tree with refs such as @s8f3k2p9:e14. jev-use walks the front app’s AX tree, skips secure fields and trims to about 250 options, with no vision fallback.

Outliers. mobile-jev reads an Android accessibility tree from Mobilerun’s /ui-state with path ids such as ui.0.3. openjev-sglang does not apply: it answers Jev questions and never sees a page.

Pick: browser-use or Skyvern for visual, ambiguous pages where screenshot tokens pay off. Pick: Stagehand, HyperAgent or dsh-browser for cheap text-only prompts. Pick: Cua, agent-desktop or jev-use when the target is a native app, not a web page.

Per-project answers

browser-use/browser-use

answered

DOM Serialization. The agent represents pages through SerializedDOMState (browser_use/dom/views.py:935), which wraps a tree of SimplifiedNode objects built from three CDP sources: DOMSnapshot.captureSnapshot, the full accessibility tree via accessibility.GetFullAXTree, and the DOM document structure (browser_use/dom/service.py:6-25). The DomService class orchestrates this, combining snapshot bounds, AX node properties, and DOM nodes into EnhancedDOMTreeNode objects with sibling/shadow-root/iframe support. Cross-origin iframes with dimensions ≥ 10px each side are included (browser_use/dom/service.py:40-42).

Serialization to text. DOMTreeSerializer.serialize_accessible_elements() (browser_use/dom/serializer/serializer.py:114-165) runs a pipeline: (1) create a simplified tree by filtering non-content elements (style, script, SVG decorative children) and detecting interactive elements; (2) paint-order filtering to skip elements visually occluded; (3) tree optimization (remove unnecessary parents); (4) bounding-box filtering that excludes children contained within propagating parents (a, button, div[role=button]) at 99% containment threshold; (5) assign numeric interactive indices to clickable/scrollable elements. The final serialize_tree() (browser_use/dom/serializer/serializer.py:989) renders a compact text format: [index]<tagname attr="val" /> for interactive elements, ordinary <tagname> for containers, |scroll element| markers for scrollable containers, |SHADOW(open/closed)| for shadow-DOM hosts, text nodes inline, and iframes with hidden-element hints showing scroll distances. Compound controls (date pickers, range sliders, file inputs, select dropdowns) get synthetic compound_components=... attributes with sub-role information (browser_use/dom/serializer/serializer.py:1059-1100).

Element indices (set-of-marks). Interactive elements get sequentially numbered indices stored in a DOMSelectorMap (dict of int → EnhancedDOMTreeNode). The LLM sees [1]<button type="submit"> and uses that index to click. New elements since the last step are marked with a * prefix. max_clickable_elements_length caps serialized text at 40000 chars (browser_use/agent/views.py:92).

Screenshots. A PNG screenshot is always captured every step via BrowserSession.get_browser_state_summary(include_screenshot=True) (browser_use/agent/service.py:1096-1099). When use_vision is enabled, the screenshot is sent as an image content part to the LLM. For Claude Sonnet models, screenshots are auto-resized to 1400×850 to fit context windows (browser_use/agent/service.py:247-250). Configurable via llm_screenshot_size parameter.

Accessibility tree. The AX tree provides name, role, description, properties (valuemin/max/now, expanded, pressed, invalid, etc.) per element. These feed into ClickableElementDetector.is_interactive() (browser_use/dom/serializer/clickable_elements.py:6-52) which heuristically scores elements as interactive based on tag, role, JS click listeners, ARIA attributes, pointer cursor, and form-control heuristics.

Editor's note. Correction: element indexes are the CDP backend_node_id when that is unique, not a sequential counter, so they mostly stay stable between steps.

trycua/cua

answered

Page representation comes in three layers that can be used separately or together:

Screenshots. get_window_state and get_desktop_state return a PNG screenshot with its dimensions. The desktop capture has an optional max_image_dimension cap — if downscaled, the response reports screenshot_original_width/height and the desktop_capture_scale module records the ratio so subsequent desktop-frame actions are automatically scaled back to uncapped coordinates (libs/cua-driver/rust/crates/cua-driver-core/src/desktop_capture_scale.rs:32-56). Screenshots travel in the MCP envelope as SnapshotImage {mime_type, data_base64} (libs/cua-driver/rust/crates/cua-driver-contract/src/windows.rs:265-272).

Accessibility tree. get_window_state returns a tree_markdown field — a formatted text representation of the platform's accessibility tree — plus a structured elements: Vec<WindowElement> array. Each element carries an element_index used to mint per-element tokens. The walk can be bounded by max_elements, max_depth, and timeout_ms (100–120000ms). Truncated walks are flagged with truncated: true and a truncation_reason rather than failing (libs/cua-driver/rust/crates/cua-driver-contract/src/windows.rs:275-323). On browsers, the semantic snapshot composes Chrome's AX tree with pierced DOM metadata and layout evidence (libs/cua-driver/rust/crates/cua-driver-core/src/browser/semantic.rs:1-16).

Element tokens (set-of-marks). Each AX element gets a stable token formatted as s{snapshot_id:08x}:{element_index} (e.g. s00001234:42). Tokens are per-snapshot: they become stale after a new snapshot (returning the error "element_token is stale; call get_window_state again to refresh") (libs/cua-driver/rust/crates/cua-driver-core/src/element_token.rs:4-20). The browser path additionally uses page refs in the p<snapshot>:<index> namespace (libs/cua-driver/rust/crates/cua-driver-core/src/browser/tools.rs:103-110).

Visual regions (parse_visual_regions). An optional ONNX-based perception subprocess (cua-perception crate) runs a YOLO icon detector and an OCR pipeline (Paddle-style detector + recognizer) on a screenshot, returning VisualRegion items with bounds, kind (text/icon), confidence, and optionally text content. This runs as a separate child process with a length-prefixed stdio protocol (libs/cua-driver/rust/crates/cua-perception/src/runtime.rs:132-200, libs/cua-driver/rust/crates/cua-perception/src/lib.rs:28-31). Max image size is 8192px on a side, 32M pixels, 8MB wire bytes (libs/cua-driver/rust/crates/cua-perception/src/lib.rs:29-31).

browserbase/stagehand

answered

The page is represented to the model as a hybrid text snapshot combining the Chrome accessibility tree and the DOM tree. The core mechanism lives in capture.ts, which calls Accessibility.getFullAXTree via CDP for each frame's a11y tree and DOM.getDocument for the DOM structure. These are merged into a single hierarchical text outline where each element is rendered as a line like [0-18372] button: Submit — the encoded ID (frameOrdinal-backendNodeId) serves as the element index that the LLM returns when choosing an action. An xpathMap (a Record<string, string>) maps each encoded ID to an absolute XPath, which the execution layer uses to locate the element for CDP interaction.

Iframes are handled via a multi-step pipeline: buildSessionIndexes calls DOM.getDocument once per CDP session; per-frame maps are sliced from the shared index; and computeFramePrefixes walks the frame tree to compute absolute XPath prefixes for child frames. The per-frame outlines are stitched into a single combinedTree via injectSubtrees in treeFormatUtils.ts. Shadow DOM is pierced by default (pierceShadow: true).

Size limits and pruning: The DOM tree retrieval adaptively retries with shallower depths when CDP's CBOR encoder stack overflows — DOM_DEPTH_ATTEMPTS in domTree.ts tries [-1, 256, 128, 64, 32, 16, 8, 4, 2, 1], and each truncated node is hydrated individually via DOM.describeNode with its own depth fallback. Structural AX roles (generic, none, InlineTextBox) are pruned from the outline. Nodes can also be excluded via ignoreLocators.

Screenshots are optional and only used in extract() when options.screenshot: true. They are captured as raw PNG data (page.screenshot → Page.screenshot) and sent alongside the DOM text as an image content block. The screenshot is not annotated with bounding boxes or set-of-marks overlays — the AnnotatedScreenshotText constant in LLMClient.ts describes a planned annotation feature but the screenshotScripts/index.ts only exports resolveMaskRect.

Skyvern-AI/skyvern

answered

The page is represented to the model as a combination of a scraped interactive element tree and full-page screenshots (base64 PNG, potentially multiple scroll-segments). Both are sent to the LLM on every step.

DOM serialisation + accessibility tree. The scraper (skyvern/webeye/scraper/scraper.py:908-956, get_interactable_element_tree) runs a JavaScript DOM inspector that walks the page's accessible, visible, interactable elements. It annotates each with attributes (type, role, aria-*, value, placeholder, disabled, readonly, text, href, etc.), bounding rects, and a unique_id Skyvern-injected attribute (SKYVERN_ID_ATTR). The tree includes all child frames recursively (add_frame_interactable_elements, scraper.py:827–904). The resulting list is rendered as HTML (via json_to_html in scraped_page.py:63-132) and sent to the LLM — typically the "trimmed" tree where non-essential attributes and non-interactable nodes are pruned (trim_element_tree, scraper.py:1247-1250). Three tree variants exist: the full tree, the economy tree (strips SVG branches), and the lean tree (optionally compresses long hrefs/srcs).

Size limits and pruning. The tree is token-counted after rendering (scraper.py:623): if it exceeds DEFAULT_MAX_TOKENS (a tunable ceiling), the screenshot count is capped to 1. Individual elements have their attributes filtered to a reserved set (RESERVED_ATTRIBUTES, scraper.py:113–143); enriched trees include additional accessibility attributes. Hashed URLs >150 chars are replaced with a SHA-256 placeholder (json_to_html, scraped_page.py:82-88).

Screenshots. Screenshots are taken after the tree build via SkyvernFrame.take_split_screenshots (scraper.py:679-686): the page is scrolled in viewport-sized increments, capturing each segment. Screenshot count is bounded by MAX_NUM_SCREENSHOTS (default 10). When a transient popup is detected, scrolling is suppressed so the overlay survives into the next action (scraper.py:632-641). The agent can also suppress screenshots entirely via the take_screenshots=False flag.

Set-of-marks/element index. Skyvern injects a unique_id attribute into each interactable element's DOM node at scrape time. The model refers to elements by this ID (the "element_id" in actions like click/input), NOT by coordinates or CSS selectors in the prompt. The scraped page maintains an id_to_css_dict mapping these IDs to CSS selectors for Playwright resolution (scraper.py:266-282). Text content and extracted text (from get_frame_text, scraper.py:703) are also included.

browser-use/jev-ultrafast

answered

The page is represented as a structured, indexed state — never via screenshots in the model's path. The core DOM reader is snapshot.js, a ~107-line JavaScript that runs atomically inside a single Runtime.evaluate call (browser.py:188-190). It walks visible, safe controls (button, link, checkbox, combobox, textbox, searchbox, etc.; snapshot.js:24-27) and produces a numbered action list where each element has a role, accessibility-derived label, value, checked/selected/expanded state, and bounding rectangle. Text is collected from on-screen text nodes within the viewport, capped at 6000 characters (snapshot.js:82-91). The actions array is capped at 250 elements, after which scroll_up/scroll_down/wait controls are appended (snapshot.js:99-104).

A SHA-256 fingerprint over url, text, actions, and scroll detects page changes (browser.py:115-117). Freshness between observations is verified by comparing a marker — a tuple of performance.timeOrigin, URL, scroll position, viewport size, title, text, action semantics, and form control values — against the current DOM (snapshot.js:97-98). Individual elements get an integer node ID via a WeakMap cache (snapshot.js:3-7) and a guard (role, name, value, state, nearby scope text; snapshot.js:47-54) used to detect whether a specific observed node is still valid. No screenshot is sent to the model (README:97); screenshots are only captured for the human inspector (JPEG, quality 72; browser.py:193).

browser-use/browser-harness

answered

The page is represented to the model primarily through screenshots and accessibility tree data, not through DOM serialization or set-of-marks indexes. There is no built-in DOM-to-text serialization, element indexing scheme, or visual marking overlay.

  • Screenshots: capture_screenshot() in helpers.py (line 331) calls Page.captureScreenshot via CDP and returns a PNG. It supports max_dim param to downscale large screenshots (e.g. max_dim=1800 to stay under a 2000px-per-side limit some image-aware LLMs enforce). Screenshots are served to the MCP layer as a path + dimensions object from mcp_server.py:192-200. The recorder also captures JPEG frames (quality 80) after each action via _capture() in recorder.py:263-310.

  • Accessibility tree: SKILL.md documents the recommended element-finding workflow: use cdp("Accessibility.getFullAXTree")["nodes"] which returns every element's role, name, and backendDOMNodeId. Filter this in Python before printing since it runs thousands of nodes. Click coordinates come from cdp("DOM.getBoxModel", backendNodeId=n)["model"]["content"] — average the four corners for viewport-space click coordinates.

  • Raw HTML via JS: SKILL.md recommends falling back to js(...) for DOM inspection when the AX tree lacks an element (canvas, exotic widgets). There is no automatic DOM pruning or serialization logic in the harness itself — the agent decides what to fetch and how much.

  • Page metadata: page_info() in helpers.py:159-169 returns url, title, viewport dimensions, scroll position, and page scroll dimensions as JSON via Runtime.evaluate. Native dialogs override this with a {dialog: ...} object.

There is no built-in "set-of-marks" overlay, element index system, or automatic size-limiting/pruning of DOM text. The harness lets the agent fetch whatever page representation it needs, keeping the harness itself representation-agnostic.

browser-use/workflow-use

answered

The page is NOT represented to a model as a DOM tree or screenshot in this project's main deterministic path. On the semantic execution path, the SemanticExtractor runs JavaScript via CDP (page.evaluate) to query document.querySelectorAll across 50+ interactive selectors (button, input, select, textarea, [role="button"], [role="combobox"], [data-testid], etc.) and extracts bounding-box-visible elements into a dict (element_info) with fields like text_content, css_selector, hierarchical_selector (a DOM path like form > div:nth-of-type(2) > input[name="email"]), aria_label, placeholder, label_text, container_context, and position (SemanticExtractor lines 206–775). The SemanticExtractor.extract_semantic_mapping method (line 816) collects these into a mapping of visible text string → element metadata.

On the agent fallback path (which uses browser-use's agent), the model sees the full DOM via browser-use's internal EnhancedDOM representation — not built in this repo. Browser-use provides an element-index-based selector map (browser_session.get_selector_map(), used at element_finder.py:69–74) that maps integer indexes to DOM nodes with text, role, tag, and visibility flags.

CSS selectors from the recorded workflow are stored at the schema level in SelectorWorkflowSteps.cssSelector and xpath fields (schema/views.py:32–36), but are considered legacy — the preferred approach is target_text (text-based semantic targeting) plus selectorStrategies (a list of ordered fallback strategies like text_exact, role_text, xpath with priority scores, generated by SelectorGenerator). There are no screenshots or set-of-marks visual representations used; the system is entirely text/selector-based.

lahfir/agent-desktop

answered

agent-desktop does not automate web pages; it automates native desktop applications. The 'page' is a desktop app window, represented to the calling model as a tree of AccessibilityNode objects built from the OS-level accessibility tree (macOS ATK/SPI, via AXUIElementRef and batch attribute reads using AXUIElementCopyMultipleAttributeValues). Each node carries role, NodeIdentity (name, value, description, native_id), NodePresentation (states like focused/checked/disabled/hidden, available_actions, bounds, and hint), and optional ref_id. The tree is serialized as JSON inside the snapshot command's response envelope.

Pruning and size limits:

  • max_depth (default 10) clamps tree depth; --skeleton mode caps depth at 3 and marks truncated containers with children_count.
  • interactive_only removes non-interactive leaf nodes that have no ref and no children (role-based, screened by is_ref_able in ref_alloc.rs:79 which checks interactive roles plus non-ubiquitous actions).
  • compact collapses transparent wrapper nodes (single-child containers with no semantic payload).
  • subtree_truncated flag indicates budget/deadline exhaustion (no room to count children).
  • Budget/deadline capping (via LocatorTraversal.visit in traversal.rs:62-95) can cut the walk short when approaching limits.
  • Refs are allocated in depth-first order to interactive or action-bearing nodes via allocate_refs() (ref_alloc.rs:170). Ubiquitous affordances (SetFocus, RightClick, ScrollTo) do not qualify a node for a ref, preventing 'ref every node' inflation in web-runtime apps.
  • Skeleton anchors: named/described non-interactive containers at truncation boundaries receive refs as drill-down targets.
  • The RefMap has a 1 MB write-side limit (refs.rs:15 MAX_REFMAP_BYTES = 1_048_576).
  • Screenshots are available as a separate command (screenshot.rs), not embedded in the tree.
  • Structural hints are added for splitter rows to label columns.

The calling model does not see a DOM but a pruned, role-annotated accessibility tree with deterministic (per-snapshot) ref identifiers.

Editor's note. Correction: on macOS the tree comes from the AX API (AXUIElementRef, batch reads via AXUIElementCopyMultipleAttributeValues), not ATK/AT-SPI, which is the Linux accessibility stack and is not implemented here.

hyperbrowserai/HyperAgent

answered

The page is represented to the model primarily through the CDP accessibility tree, serialized as a hierarchical text tree with encoded element IDs in the format frameIndex-backendNodeId (e.g., "0-5125"). The main entry point is getA11yDOM() (src/context-providers/a11y-dom/index.ts:908), which calls Accessibility.getFullAXTree via CDP for the main frame and all iframes — same-origin iframes via contentDocumentBackendNodeId, out-of-process iframes (OOPIFs) via separate CDP sessions discovered through FrameContextManager.captureOOPIFs (src/context-providers/a11y-dom/index.ts:993). Raw AXNode arrays are converted to AccessibilityNode objects by buildHierarchicalTree() (src/context-providers/a11y-dom/build-tree.ts:71), then serialized into a simplified text tree via formatSimplifiedTree — this text is what the LLM sees in the === Elements === section of the prompt (src/agent/messages/builder.ts:63).

When enableVisualMode is true, bounding boxes are collected in batch via batchCollectBoundingBoxesWithFailures and a visual overlay is rendered by renderA11yOverlay() (src/context-providers/a11y-dom/index.ts:1187), which composites bounding boxes with encoded IDs over a CDP screenshot using Jimp. The overlay is composited with the raw screenshot via compositeScreenshot() (src/agent/tools/agent.ts:65). The composited screenshot is passed to the LLM as a base64 PNG alongside the text tree (src/agent/messages/builder.ts:69).

DOM caching is handled by domSnapshotCache — a snapshot is cached when useCache is true and visual mode is off, and invalidated on navigation/frame events via markDomSnapshotDirty() (src/context-providers/a11y-dom/dom-cache.ts). The DOM capture has 3 retry attempts for transient CDP errors (src/agent/shared/dom-capture.ts:11), with recovery for "Execution context was destroyed" / "Target closed" errors. Streaming mode (enableDomStreaming) sends frame chunks progressively via FrameChunkEvent with ordered assembly in DomChunkAggregator (src/agent/shared/dom-capture.ts:28).

awlevin/typesafe-computer-use

answered

The page is represented to the model as a numbered list of Items, each carrying text, screen coordinates, and source (OCR, accessibility tree, or both). Perception is a two-source pipeline:

OCR path: perception.py:capture() takes a screenshot via screencapture, crops to the frontmost window plus an 8pt margin and the menu bar strip, then runs macOS Vision OCR (ocrmac's recognize_text). A change-detection system compares the current capture to the previous one at 1/8 scale in 256px tiles; unchanged tiles reuse their OCR lines. Changed tiles are clustered into contiguous blobs, each re-read as a single OCR crop — up to 4 rectangles max, preferring a full re-read above 60% change. Lines below MIN_OCR_CONFIDENCE (0.3) or matching the goal echo are filtered, then merged into blocks by vertical proximity and alignment. (perception.py:84–123, 258–291, 300–319)

Accessibility tree: ax_walk.py:walk_actionable() does a bounded BFS of the frontmost app's AX tree (cap 4000 nodes, 0.6s), collecting labelled on-screen controls. Nodes with real frames wholly off the display are pruned to screen.offscreen (cap 120) — reachable via AXPress, never as click targets. The walk prunes AXMenu subtrees, nameless AXGroup layout boxes, and sub-4pt slivers. (ax_walk.py:134–212)

Merge and budget: OCR blocks and AX controls are merged by box-overlap (≥50% of the smaller box) and text-match (containment or ≥50% shared words). An OCR block centered on a button/link with no alphanumerics is treated as that control's icon and dropped. The merged list is capped at 255 items (TypeSafe's Choice ceiling) — AX-sourced items are kept first, then OCR items by confidence. (perception.py:636–701, config.py:10)

Facts code adds: date-distance hints on blocks containing dates (via dates.py), row-mates for duplicated labels, popup coverage markers, the action already tried on this screen, the focused field, the URL, and the app name. All is rendered into decide.py:base_state() for the classifier. (decide.py:128–162, 91–105)

The browser backend replaces all of the above with a single CDP Runtime.evaluate call — a JS script collects interactive DOM elements, assigns them data-tscu attribute indices, checks occlusion via elementFromPoint, and returns an ordered list with exact text, role, viewport coordinates, and visible page text blocks. No OCR, no accessibility tree, no screenshot permission needed. (browser/perceive.py:29–168, docs/browser-backend.md:1–27)

omdsh-dev/dsh-browser

answered

The page is represented as structured text only - no screenshots or accessibility tree dump. The BridgeCaps type enforces textOnly=true (protocol.ts:64-66). renderSnapshot() (snapshot.ts:363-420) produces one text block: URL, title, ready-state, main content excerpt, a numbered interactive-element inventory, and form fields. buildSnapshot() (snapshot.ts:180-306) orchestrates: collectInteractive() (extract.ts:146-155) queries the DOM against a fixed CSS selector (a[href], button, input:not([type=hidden]), ARIA roles), filtered by isVisible() (extract.ts:40-46). Elements sort dialog-first then viewport-first (snapshot.ts:195-196). Each element gets a stable numeric id via ElementIds (ids.ts:19-71), backed by WeakMap plus data-dsh-el attribute. Main text uses a readability-lite heuristic preferring main/article/largest-section-with-paragraphs (extract.ts:165-185). Three budgets cap output: maxChars (default 32,000), maxItems (default 60), maxForms (default 30) - set in protocol.ts:37-40 and passed as SnapshotBudget. Truncation notes explain cuts (snapshot.ts:355-361). Delta mode returns only changed/removed elements (snapshot.ts:268-286). Sensitive fields (password, credit-card) are masked via isSensitiveField() (privacy.ts:30-41) with real values replaced by bullets (privacy.ts:49-51).

droidrun/mobile-jev

answered

The page is represented via the Mobilerun accessibility-tree API, not a DOM or screenshot pipeline. MobilerunDevice.observe() (device.mjs:257-260) calls the Mobilerun /ui-state?filter=false endpoint, which returns an accessibility tree of the current Android screen. summarizeState() (device.mjs:88-189) walks the tree recursively via an inner visit() function that reads a11y_tree nodes, filters by isVisibleToUser !== false, clamps bounds to screen dimensions, and builds an element list. Each element carries: id (a dot-separated tree path like ui.0.1), text/label, resourceId, bounds, plus booleans for clickable, editable, scrollable, enabled, focused, password, checkable, checked, selected. Password text is replaced with "[password]" (device.mjs:124).

No screenshots are sent to the model. Jev is a text-only reasoning system; the screenshot method (device.mjs:262-267) exists only for CLI viewing and debug traces. The model receives a set-of-marks via indexed controls: buildQuestions() (policy.mjs:46-65) assigns 1-based string indices ("1", "2", …) to elements. These indices appear in the Jev questions (tap_target, scroll_target, etc.) so the model selects by index, not coordinates.

Size limits: The serialized request body must stay under 150,000 bytes (policy.mjs:217-219). App inventory is capped at 200 apps (policy.mjs:39). Text candidates from the goal are limited to 254 unique values (text.mjs:15). An elements array in the state lists each index with its label, editable, scrollable, checked state and supported operations (policy.mjs:52-63). The observation also includes a fingerprint (SHA-256 of the full content) used for change detection (device.mjs:186). A phone object carries packageName, currentApp, isEditable, keyboardVisible, and focusedElement metadata (device.mjs:165-182).

jkudish/jev-browser

answered

The page is represented to the model as a JSON state object with four parts: current page metadata, a text excerpt, interactive elements, and step history.

DOM extraction (src/navigate.ts:271-384). Elements are extracted from the live DOM — not the accessibility tree — because a11y trees under-report inputs. The CSS selector a[href], button, input, textarea, select, [role=button], [role=link], [role=searchbox], [role=textbox] captures candidates. Each is filtered by visibility (getClientRects, display, visibility), capped at 2000 raw candidates per step. Accessible label resolution follows AccName 1.2 §4.3.2: aria-labelledby, aria-label, native labels (label[for] and wrapping labels), placeholder, title. Each candidate is stamped with a data-jev-id attribute used as a CSS selector for actions.

Action-space pruning (src/lib.ts:69-149). Raw elements are filtered through buildActionSpace(): noise names (jump links, lone punctuation, generic nav text — 43 curated entries in JUNK_NAMES) and noise hrefs (#, javascript:, mailto:) are removed. Hrefs are deduplicated by destination. The cap is 240 elements total (matching Jev's 255-choice limit; src/lib.ts:4). Each surviving element gets a kind (click, type, search, submit, select, fill_password) based on tag, role, and type.

State structure (src/navigate.ts:800-810). Each step sends Jev: task (redacted), current_page (url + title), page_text_excerpt — on credential runs the fixed page-start excerpt; on normal runs the innermost open modal dialog text, or visible viewport text via a tree-walk capped at 5000 nodes — interactive_elements (id + description only), truncation flags, and history. The excerpt is capped at 1500 characters (STATE_EXCERPT_CHARS). Credential runs expand capture windows by the longest secret representation and redact all strings via redactCapped().

No screenshots are sent to the model. Screenshots are captured at the end for user display only (screenshot: final). There are no set-of-marks element indexes — the action space uses stable sequential IDs (e1, e2, etc.) mapped through data-jev-id attributes.

savka777/jev-use

answered

The page is represented exclusively through the macOS Accessibility tree — no screenshots, no DOM serialization, no set-of-marks images are captured or sent. The Desktop.capture() function (Desktop.swift:187) walks the Accessibility tree starting from the frontmost application's window (AXUIElement root), recursing through AXUIElementCopyMultipleAttributeValues to read roles, names, values, positions, enabled/hidden state, children, and DOM identifiers for every control (method read(), Desktop.swift:112-151). The walk is bounded: children lists longer than 50 nodes are pruned to the app's reported visible subset (Desktop.swift:139-144). Controls outside a clipped frame within a −200 px margin are skipped as off-screen (Desktop.swift:514-517). Unnamed text-less controls that are not recognised interactive roles are dropped (Desktop.swift:633). Secure fields (kAXSecureTextFieldSubrole) are skipped entirely (Desktop.swift:504). The walk also performs a pointer-coordinate sweep (Desktop.swift:557-573) to catch elements the tree walk missed. The result is serialised as a flat list of Element structs (index, role, label, value, place, operations) plus available apps/folders/sites/menus (Decision.swift:198-222). This is sent alongside recent actions as a JSON payload to the TypeSafe API. The model sees numbered elements in screen order (top-to-bottom, left-to-right, Desktop.swift:678-683), each described with '[index] role 'label' value...' strings. Total candidates are trimmed to stay under TypeSafe's 255-option-per-question limit (Decision.swift:82); elements are batched into multiple parallel choice questions when needed (Decision.swift:95-124). The fingerprint function (Desktop.swift:203-218) provides a cheap structural hash (window title, focused control, first 400 nodes, window position/size) used to detect screen changes between cycles.

Editor's note. Correction: in the live loop (runCycles), oversized control lists are trimmed to about 250 options, preferring labels that share words with the command; the multi-batch splitting in Decision.swift requestBody/decide is only used by the execute loop, which nothing calls.

razaanstha/ulka

answered

The page is represented primarily through a DOM-based serialization with an accessibility-tree fallback, executed as a JavaScript expression injected into the browser page via CDP's Runtime.evaluate. The OBSERVER_EXPRESSION in observer.ts:10-192 runs in-page: it walks visible interactive elements from document.body (or the topmost aria-modal dialog), extracting each control's role, label, href, value, checked, expanded, selected, focused, and other ARIA properties. The result is a PageSnapshot (defined in snapshot.ts:36-51) containing a url, title, concatenated body text (up to 6000 chars, observer.ts:184-188), a scroll state, an elements array of PageElement objects, a guards map (for later target validation), and diagnostics about omitted controls. No screenshots or set-of-marks visual overlays are sent to the model — the representation is purely structured text. Each PageElement carries an id (e.g. "e1"), a role, a label, and an operations array listing which agent actions are valid on it (observer.ts:102-107). Labels come from aria-labelledby, aria-label, <label> elements, alt text, or inner text — resolved in the in-page name() function (observer.ts:22-31). Accessibility fallback: if the DOM scan reveals contenteditable elements or focused controls not in the standard selector set, the observer switches to the AX path (accessibility.ts). AccessibilitySource.prepare() fetches Chrome's full accessibility tree via Accessibility.getFullAXTree, resolves AX backend node IDs to DOM handles, and enriches the snapshot with AX-derived roles and labels (observer.ts:299-310). Size limits and pruning: visible interactive elements get the full observation budget; offscreen controls are capped at 250 rows (observer.ts:98). The candidate pool is sorted so available controls are listed before unavailable ones (observer.ts:82). Rejected and unavailable controls are counted in diagnostics.rejected and diagnostics.unavailable. The page text field is capped at 6000 characters from a tree-walker traversal (observer.ts:184-188). Context elements (form/dialog regions) are limited to 3 per control and labels to 500 chars. A diagnostics.modalScoped boolean tells the model when interaction is scoped to a modal dialog.

Editor's note. Correction: accessibility is the primary source, not a fallback. Every observation first calls Accessibility.getFullAXTree (main and child frames), maps AX nodes to DOM elements, and builds candidates from those AX records; the DOM selector scan is used only when no AX tree is returned (diagnostics dom-fallback).

ekzhang/openjev-sglang

not applicable

OpenJev does not represent any web page or browser view to a model. It is a structured classification server: it receives text or chat-message state, appends question instructions and answer options rendered as plain text labels (A: description, B: description, etc.), and sends the result to SGLang for single-token logit readout. The project has no DOM parser, no accessibility tree, no screenshot pipeline, no set-of-marks mechanism, and no element index. The only "pruning" is a configurable input-token cap per branch (default 32,768 tokens) and a total-token budget across all branches (default 262,144 tokens), enforced in service.py:61-67 before any GPU work.

How are actions executed and how are elements targeted? →