@vowel.to/client / index / AutomationAdapter
Interface: AutomationAdapter
Defined in: lib/vowel/types/types.ts:192
Automation adapter interface for voice-controlled page interaction
Handles WHAT to do on the current page. This adapter is responsible for searching, clicking, typing, and other DOM interactions based on voice commands.
Example
// Direct automation in SPAs
const automationAdapter = new DirectAutomationAdapter();
// Controlled automation for traditional sites
const automationAdapter = new ControlledAutomationAdapter('vowel-automation');Methods
searchElements()
searchElements(query, options?): Promise<AutomationSearchResults>;Defined in: lib/vowel/types/types.ts:199
Search for elements on the page
Parameters
| Parameter | Type | Description |
|---|---|---|
query | string | Search query (e.g., "add to cart button") |
options? | AutomationSearchOptions | Search options |
Returns
Promise<AutomationSearchResults>
Search results with element IDs
getPageSnapshot()
getPageSnapshot(): Promise<string>;Defined in: lib/vowel/types/types.ts:205
Get a snapshot of the current page structure
Returns
Promise<string>
Page snapshot as text (ARIA tree format)
clickElement()
clickElement(id, reason?): Promise<AutomationActionResult>;Defined in: lib/vowel/types/types.ts:213
Click an element by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Element ID from search results |
reason? | string | Optional explanation of why this element is being clicked (shown to user via floating cursor) |
Returns
Promise<AutomationActionResult>
Action result
typeIntoElement()
typeIntoElement(
id,
text,
reason?): Promise<AutomationActionResult>;Defined in: lib/vowel/types/types.ts:222
Type text into an input element
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Element ID from search results |
text | string | Text to type |
reason? | string | Optional explanation of why text is being entered (shown to user via floating cursor) |
Returns
Promise<AutomationActionResult>
Action result
focusElement()
focusElement(id, reason?): Promise<AutomationActionResult>;Defined in: lib/vowel/types/types.ts:230
Focus an element
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Element ID from search results |
reason? | string | Optional explanation of why this element is being focused (shown to user via floating cursor) |
Returns
Promise<AutomationActionResult>
Action result
scrollToElement()
scrollToElement(id, reason?): Promise<AutomationActionResult>;Defined in: lib/vowel/types/types.ts:238
Scroll to an element
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Element ID from search results |
reason? | string | Optional explanation of why scrolling to this element (shown to user via floating cursor) |
Returns
Promise<AutomationActionResult>
Action result
pressKey()
pressKey(key, reason?): Promise<AutomationActionResult>;Defined in: lib/vowel/types/types.ts:246
Press a key (e.g., Enter, Escape)
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Key name |
reason? | string | Optional explanation of why this key is being pressed (shown to user via floating cursor) |
Returns
Promise<AutomationActionResult>
Action result