Kuang Grade Mark Eleven: Selector & Set-of-Marks Recipes
1. Golden Operational Sequence (Preferential Tool Hierarchy)
To maximize execution speed, minimize token burn, and eliminate bot shadowbans, ALWAYS follow this 3-tier sequence:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TIER 1 (FIRST CHOICE): Grounded Markdown (`observe(as="markdown")`) β
β β’ Downsamples page to clean text with inline [#ID] marks. β
β β’ You can immediately call `act(id)` (click) or `act(id, action="type", text="β¦")`.β
β β’ ZERO image tokens burned, 100% hardware trusted (isTrusted: true). β
β β’ Pages large output via `budget` + `next_cursor`. See partition 4. β
β Legacy `get_page_markdown()` is a hidden alias of this projection. β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β TIER 2 (FALLBACK): Set-of-Marks (`take_screenshot(marks:true)`) β
β β’ Use ONLY when visual layout, complex maps, or CAPTCHAs require vision.β
β β’ Downscaled 640px JPEG (~15x lighter than full PNG). β
β β’ Mark IDs match the markdown marks identically. β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β TIER 3 (USE DELIBERATELY): Script Inspection (`evaluate_javascript`) β
β β’ A powerful tool: arbitrary page JS that can read AND mutate. β
β Reach for it deliberately β observe/extract cover most reads β
β and act covers clicks and typing. β
β β’ Heavy injected JS is a bot-detection signal (untrusted events), β
β so keep it purposeful, not routine. β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2. Set-of-Marks (SoM) Visual Grounding
Mark Eleven features a multi-layered Set-of-Marks visual overlay system.
Color Coding
- Cyan Badges (
#06b6d4): Static structural anchors (navbars, search inputs, headers, primary buttons). These IDs are session-sticky and never scramble on layout shifts. - Neon Yellow Badges (
#eab308): Dynamic page content (search results, live table rows, product cards). - Muted Gray Badges (
#a1a1aa): Disabled elements (do not click).
Inspection Tools
observe(as="markdown"): Page text with inline[#ID]marks stamped directly on buttons, links, and inputs.take_screenshot(marks:true, detail="economy"): Downscaled 640px JPEG Set-of-Marks screenshot (~15x lighter than PNG). Recommended for vision.take_screenshot(marks:true, detail="full"): Full-resolution PNG with numbered badges + marks lookup table.observe(as="som")(ortake_screenshot(marks:true, detail="markdown")): Marks table only with NO image. Ideal for fast coordinate checks or text-only models (~15ms, 0 image tokens).
Interaction
- Call
act(mark_id, action="click"): Dispatches human-like BΓ©zier cursor movement and hardware click (isTrusted: true). Coordinates are dynamically re-calculated from the live DOM node, tracking layout shifts automatically. - Call
act(mark_id, action="type", text="β¦"): Clicks the input badge and types with realistic Gaussian cadence (isTrusted: true). - No badge? The same tool addresses a target three ways:
act(selector="β¦")oract(x=β¦, y=β¦). Mark ids are preferred; selectors and coordinates are escape hatches.
Marks are Refs
The badge index is also the ref consumed by the primitive layer: find(...) returns
rows carrying the mark id, and act(mark_id=β¦) accepts the same number (it re-resolves the
live centre and can attach post-conditions). See partition 4 β Orthogonal Primitives &
Workflow Recipes for act, wait_for, expect, find, extract, collect_all,
page_state/diff, export_har and the context_* profiles.
Off-screen Marks
On long or virtualized lists pass include_offscreen=true to
take_screenshot(marks:true) / observe(...)
so below-the-fold rows are numbered too β act scrolls the element into view before
clicking. To harvest the whole list in one call use collect_all(..., scroll="window").