/**
 * Runtime Context Types
 *
 * The RuntimeContext represents the current state of the page, session, viewport,
 * and other environmental factors that can be used for adaptive decision-making.
 */
/**
 * Page context - information about the current page.
 */
export interface PageContext {
    /** Current page URL */
    url: string;
    /** Matched route pattern from RouteFilter (e.g., "/products/:id") */
    routeId?: string;
    /** Document title */
    title?: string;
    /** Page locale (e.g., "en-US") */
    locale?: string;
}
/**
 * Page history entry for session tracking.
 */
export interface PageHistoryEntry {
    /** Page URL */
    url: string;
    /** Timestamp when page was visited */
    ts: number;
}
/**
 * Session context - information about the current session.
 */
export interface SessionContext {
    /** Unique session ID (from PostHog) */
    sessionId: string;
    /** Session start timestamp */
    startTs: number;
    /** Page history within this session */
    pageHistory?: PageHistoryEntry[];
}
/**
 * Viewport context - information about the viewport size.
 */
export interface ViewportContext {
    /** Viewport width in pixels */
    width: number;
    /** Viewport height in pixels */
    height: number;
}
/**
 * Surface taxonomy — what kind of host the SDK is running inside.
 *
 * - ``type`` and ``host`` come from ``bootstrap-init.ts`` and are static
 *   after init (with one exception: an async MCP handshake can upgrade
 *   ``type`` from ``'web'`` to ``'mcp-app'``).
 * - ``device`` is derived from viewport width and updates on resize.
 * - ``mode`` is the precomputed canvas-render classification used by
 *   ``SyntroCanvasOverlay`` to pick between drawer / bottom sheet /
 *   inline tiles. ``surface_type`` takes precedence over device width:
 *   any agent surface (telegram, mcp-app) becomes ``'agent'``.
 *
 * The same ``type`` and ``device`` values are also shipped to
 * GrowthBook as targeting attributes (``surface_type``, ``device_type``,
 * ``surface_host``), so segments can target on them.
 */
export interface SurfaceContext {
    /** Host environment classification — static after MCP handshake. */
    type: 'web' | 'telegram' | 'mcp-app';
    /** Platform identifier. ``'web'`` for browsers, the Telegram WebApp
     *  ``platform`` value (``ios`` / ``android`` / ``tdesktop`` / ...) for
     *  Telegram, the MCP host ``name`` (``claude-desktop`` / ``claude-ai``
     *  / ``vscode-copilot`` / ...) for MCP apps. */
    host: string;
    /** Viewport-derived device class. Updates on resize. */
    device: 'mobile' | 'tablet' | 'desktop';
    /** Canvas render mode derived from ``type`` × ``device``.
     *  - ``'agent'`` — telegram or mcp-app, any device
     *  - ``'mobile'`` — web on a mobile viewport
     *  - ``'desktop'`` — web on tablet or desktop viewport */
    mode: 'agent' | 'mobile' | 'desktop';
}
/**
 * Bounding box for anchor elements.
 */
export interface BoundingBox {
    x: number;
    y: number;
    w: number;
    h: number;
}
/**
 * Anchor state - tracks visibility and position of anchored elements.
 */
export interface AnchorState {
    /** Anchor element ID */
    anchorId: string;
    /** Whether the element is present in the DOM */
    present: boolean;
    /** Whether the element is visible in the viewport */
    visible?: boolean;
    /** Element's bounding box (when visible) */
    boundingBox?: BoundingBox;
}
/**
 * Augmentation data from ML models (Phase 3).
 * Placeholder for future implementation.
 */
export interface Augmentation {
    /** Augmentation confidence scores by field name */
    [field: string]: number | string | boolean | undefined;
}
/**
 * The complete runtime context available to adaptives.
 */
export interface RuntimeContext {
    /** Current page information */
    page: PageContext;
    /** Current session information */
    session: SessionContext;
    /** Current viewport size */
    viewport: ViewportContext;
    /** Surface classification — host type + device + render mode */
    surface: SurfaceContext;
    /** Tracked anchor element states (optional) */
    anchors?: AnchorState[];
    /** ML-derived augmentation data (Phase 3) */
    augmented?: Augmentation;
}
/**
 * Callback for context changes.
 */
export type ContextChangeCallback = (context: RuntimeContext, previousContext: RuntimeContext) => void;
/**
 * Unsubscribe function returned by subscribe().
 */
export type Unsubscribe = () => void;
