Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.
This repository was archived by the owner on May 18, 2026. It is now read-only.

[UM-CLONE-1] Browser-Use — DOM-tree-to-LLM serializer with element indices #53

Description

@Delqhi

Source

Feature we want

Serialize the live DOM into a numbered, LLM-friendly tree where each interactable element gets a stable index. The LLM acts by index, not by selector — drastically reduces hallucinated selectors.

Why we want it

Foundation for our observe/extract/act API. Every modern agent framework has this. Without it, our LLM layer is hopelessly behind.

Acceptance criteria

  • Module src/serialize/dom_tree.ts exposes serializeForLLM(page) -> {tree, indexMap}
  • Includes ARIA role + accessible name + bounding box + data-testid if present
  • Filters non-interactable / off-screen / hidden elements
  • Round-trip test: index → element → click works on 5 fixture pages
  • Token-budget mode: produce <=N tokens by collapsing subtrees
  • PR body cites source repo + commit SHA + license
  • THIRD_PARTY_NOTICES.md updated
  • Parity test added (proves our clone behaves like source for the relevant case)
  • CHANGELOG entry: cloned from Browser-Use@<sha>

Reference

See COMPETITIVE_STRATEGY.md for the full doctrine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions