Skip to content

@vowel.to/client v0.3.3-beta


@vowel.to/client / index / AutomationAdapter

Interface: AutomationAdapter

Defined in: lib/vowel/types/types.ts:194

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

ts
// Direct automation in SPAs
const automationAdapter = new DirectAutomationAdapter();

// Controlled automation for traditional sites
const automationAdapter = new ControlledAutomationAdapter('vowel-automation');

Methods

searchElements()

ts
searchElements(query, options?): Promise<AutomationSearchResults>;

Defined in: lib/vowel/types/types.ts:201

Search for elements on the page

Parameters

ParameterTypeDescription
querystringSearch query (e.g., "add to cart button")
options?AutomationSearchOptionsSearch options

Returns

Promise<AutomationSearchResults>

Search results with element IDs


getPageSnapshot()

ts
getPageSnapshot(): Promise<string>;

Defined in: lib/vowel/types/types.ts:207

Get a snapshot of the current page structure

Returns

Promise<string>

Page snapshot as text (ARIA tree format)


clickElement()

ts
clickElement(id, reason?): Promise<AutomationActionResult>;

Defined in: lib/vowel/types/types.ts:215

Click an element by ID

Parameters

ParameterTypeDescription
idstringElement ID from search results
reason?stringOptional explanation of why this element is being clicked (shown to user via floating cursor)

Returns

Promise<AutomationActionResult>

Action result


typeIntoElement()

ts
typeIntoElement(
   id, 
   text, 
reason?): Promise<AutomationActionResult>;

Defined in: lib/vowel/types/types.ts:224

Type text into an input element

Parameters

ParameterTypeDescription
idstringElement ID from search results
textstringText to type
reason?stringOptional explanation of why text is being entered (shown to user via floating cursor)

Returns

Promise<AutomationActionResult>

Action result


focusElement()

ts
focusElement(id, reason?): Promise<AutomationActionResult>;

Defined in: lib/vowel/types/types.ts:232

Focus an element

Parameters

ParameterTypeDescription
idstringElement ID from search results
reason?stringOptional explanation of why this element is being focused (shown to user via floating cursor)

Returns

Promise<AutomationActionResult>

Action result


scrollToElement()

ts
scrollToElement(id, reason?): Promise<AutomationActionResult>;

Defined in: lib/vowel/types/types.ts:240

Scroll to an element

Parameters

ParameterTypeDescription
idstringElement ID from search results
reason?stringOptional explanation of why scrolling to this element (shown to user via floating cursor)

Returns

Promise<AutomationActionResult>

Action result


pressKey()

ts
pressKey(key, reason?): Promise<AutomationActionResult>;

Defined in: lib/vowel/types/types.ts:248

Press a key (e.g., Enter, Escape)

Parameters

ParameterTypeDescription
keystringKey name
reason?stringOptional explanation of why this key is being pressed (shown to user via floating cursor)

Returns

Promise<AutomationActionResult>

Action result