-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
agent-ergonomicsBetter agent/automation experienceBetter agent/automation experience
Description
Summary
Add a --text flag to ls and find that shows inline visible text previews per element using .innerText (rendered text only, respects CSS display:none and visibility:hidden).
Problem
When agents scan a page, they must cat each element individually to see what text it contains. For a page with 50 links, that's 50 tool calls just to read link labels.
Solution
ls --text and find --text
Shows a truncated, dimmed text preview inline with each element:
[x] link read_more "Read more about our product..." (142) href=https://...
[x] button submit_btn "Submit Application"
cat — VisibleText property
cat now shows both:
- Text: —
.textContent(all descendant text, including hidden) - VisibleText: —
.innerText(only rendered text, respects CSS visibility)
VisibleText is only shown when it differs from Text, to avoid redundancy.
Configurable preview length
--textlen N (default 80 chars). Truncated output shows ... and total char count.
Combinable with existing flags
ls --text --meta # text + DOM properties
find --type link --text --meta # URLs + link text
ls --text --textlen 30 # shorter previews
Implementation
- New
getInnerText()CDP method using.innerText --text/--textlenflags onlsandfind- VisibleText section in
catoutput - Updated MCP tool definitions for
domshell_ls,domshell_find,domshell_cat
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agent-ergonomicsBetter agent/automation experienceBetter agent/automation experience