import { VoiceFunction } from '../_types/sharedTypes'; /** * This class bridges AI commands with web UI elements by generating functions that serve as tools for the AI model. * Each discovered UI element is converted into an AI-executable function that the model can use to interact with the interface. * * Key Implementation Requirements: * 1. UI Element Discovery: * - Must discover all interactive elements (buttons, links, inputs, etc.) * - Must handle element labeling through multiple strategies (aria-labels, text content, associated labels) * - Must provide context-aware element descriptions (section, form context) should also include all user command (ex: for a button it should say something like click, navigate, go to, visit...) * * 2. Event Simulation: * - Must simulate realistic user interactions (clicks, focus, keyboard events,...) * - Must handle complex interactions (drag-and-drop, form inputs) * - Must support all input types (text, checkbox, radio, select, date, range,...) * - Must maintain proper event bubbling and propagation * * 3. Framework Agnosticism: * - Must support multiple routing systems (Next.js, React Router, vanilla, and much more) * - Must handle both client-side and server-side navigation * - Must append sista=ai parameter to all navigation URLs for auto-start functionality (which will trigger the AI to start when changing URLs) * - Must work with various UI frameworks and custom components * * 4. Function Generation: * - Must create standardized function names through StringFormatterUtils * - Must generate natural language descriptions for AI model understanding * - Must handle duplicate function names and element labels * - Must provide parameter descriptions for complex interactions * - Each function must be structured as a VoiceFunction object * * 5. Error Handling: * - Must handle all UI operation errors gracefully * - Must provide fallbacks for unsupported operations * - Must maintain element state during interactions */ export declare class ToolsAutomatedDiscovery { private static instance; private continuousScrollFunctions; private pageScrollFunctions; private allNavigationFunctions; private exitAgentFunction; private radioButtonsFunctions; private checkboxesFunctions; private dropdownsFunctions; private slidersFunctions; private dateInputsFunctions; private navigationFunctions; private clickFunctions; private tabsFunctions; private newTabNavigationFunction; private textsFunctions; private togglesFunctions; private knowledgeBaseSearchFunction; private scrollsFunctions; private browserBackNavigationFunction; private constructor(); static getInstance(): ToolsAutomatedDiscovery; getSistaFrontendTools(): VoiceFunction[]; private discoverAndGenerateToolsFromInteractiveElements; }