Core Concepts
Snapshot Modes
Use action/extraction/full snapshot modes correctly for interaction and data extraction.
Snapshot pipeline (prepareSnapshot):
- Mark interactive/hidden/scrollable elements at runtime
- Serialize page HTML
- Clean with mode-specific cleaner
- Assign counters to retained elements and sync the same counters to live DOM nodes
Cleaner modes:
action: balanced context for action planningextraction: richer content for data extractionclickable: clickable elements onlyscrollable: scrollable containers onlyfull: broad HTML with scripts/styles/noise removed
All modes return compact, LLM-friendly HTML strings.
Counter semantics:
cvalues are assigned fresh on every snapshot pass.- The snapshot HTML and live DOM are synchronized to the same
cvalues. - Counter resolution reads live DOM by
conly (no snapshot session binding). - Action lookup uses strict unique match:
- no match -> target not found
- multiple matches -> target ambiguous
- Extraction lookup is tolerant:
- no match -> field value is
null - multiple matches -> extraction fails as ambiguous
- no match -> field value is
- Boundary wrappers like
os-iframe-rootandos-shadow-rootmay be unnumbered. - Inaccessible iframes and closed shadow roots are not counter-addressable.
Snapshot Modes
| Mode | Description |
|---|---|
action | Balanced context for action planning (default) |
extraction | Richer content for data extraction |
clickable | Clickable elements only |
scrollable | Scrollable containers only |
full | Broad HTML with scripts/styles/noise removed |
Covered Features
cli:snapshotsdk:snapshot
