ai11y docs
    Preparing search index...

    Module @ai11y/core

    @ai11y/core

    Framework-agnostic core. Your app exposes UI via markers (elements with data-ai-id, data-ai-label, optional data-ai-intent). The API is describe → plan → act.

    • createClient(options?) — Returns { describe, act, track, reportError }. Options: onNavigate?: (route: string) => void.
    • describe() — Returns Ai11yContext: markers, route, state, optional error. Scans the DOM for marked elements and which are in view.
    • act(instruction) — Executes one instruction: click, navigate, highlight, scroll, or fillInput.
    • plan(ui, input, config?, messages?) — Runs the agent (LLM or rule-based) and returns Promise<{ reply, instructions }>.

    JavaScript example:

    import { createClient, plan } from "@ai11y/core";

    const client = createClient({
    onNavigate: (route) => window.history.pushState({}, "", route),
    });

    const ui = client.describe();
    const { reply, instructions } = await plan(ui, "click the save button");
    for (const instruction of instructions ?? []) {
    client.act(instruction);
    }

    Types (Ai11yContext, Instruction, AgentResponse, etc.) and DOM helpers (clickMarker, highlightMarker, navigateToRoute, etc.) are exported from the main entry. See generated docs for full reference.

    Interfaces

    AgentAdapterConfig
    AgentConfig
    AgentRequest
    AgentResponse
    Ai11yClient
    Ai11yContext
    Ai11yError
    Ai11yEvent
    Ai11yState
    ConversationMessage
    HighlightOptions
    LLMAgentConfig
    Marker
    ToolDefinition

    Type Aliases

    AgentMode
    Instruction
    ToolExecutor

    Variables

    ATTRIBUTE_ID
    ATTRIBUTE_INTENT
    ATTRIBUTE_LABEL
    ATTRIBUTE_SENSITIVE

    Functions

    clearContext
    clearEvents
    clearState
    clickMarker
    createClient
    fillInputMarker
    formatMarkerId
    getAllMarkersSelector
    getContext
    getError
    getEvents
    getMarkerId
    getMarkerIntent
    getMarkerLabel
    getMarkers
    getMarkerSelector
    getRoute
    getState
    getSubscriberCount
    highlightMarker
    notify
    plan
    runAgentAdapter
    runLLMAgent
    runRuleBasedAgent
    scrollToMarker
    setError
    setRoute
    setState
    subscribe
    subscribeToStore
    track