import type { DeviceEvaluation, DeviceEventResponse, DeviceInsightResponse, DeviceSeedResponse } from "./types.js"; export type AiUsedSignalState = "Risk" | "No Risk" | "Not Run"; export type AiUsedSignalConfidence = "low" | "medium" | "high"; export type AiEvidenceSource = "insight" | "risk_reason" | "device_flag" | "runtime_signal"; export type AiEvidenceCategory = "control_plane" | "behavioral" | "perception_loop" | "instrumentation" | "environment" | "web_spoofing"; export type SignalCoverageGapCategory = "control_plane" | "behavioral" | "perception_loop" | "instrumentation" | "environment_correlation"; /** Evidence item used when evaluating the derived AI-used signal. */ export interface AiEvidence { id: string; category: AiEvidenceCategory; label: string; source: AiEvidenceSource; detail: string; matchedProfiles: string[]; } /** Coverage gap item used when evaluating the derived AI-used signal. */ export interface SignalCoverageGap { id: string; category: SignalCoverageGapCategory; title: string; whyMissing: string; howToIdentify: string; applicableProfiles: string[]; } /** Derived AI-used signal summary returned from Trulioo device data. */ export interface AiUsedSignal { signal: "AI Used"; state: AiUsedSignalState; confidence: AiUsedSignalConfidence; evidenceCount: number; matchedProfiles: string[]; reasons: string[]; evidence: AiEvidence[]; signalCoverageGaps: SignalCoverageGap[]; } /** Browser automation signals that can contribute to AI-used evaluation on Web. */ export interface WebBrowserAutomationSignals { navigatorWebdriverValue?: boolean | null; navigatorWebdriverDescriptorLocation?: "instance" | "prototype" | "missing"; userAgentContainsHeadless?: boolean; chromeRuntimePresent?: boolean; suspiciousGlobalKeys?: string[]; } /** Interaction signals that can contribute to AI-used evaluation on Web. */ export interface WebInteractionSignals { pointerMoveCount?: number; pointerDownCount?: number; trustedClickCount?: number; pointerTravelPx?: number; pointerDirectionChanges?: number; pointerPathEfficiency?: number | null; pointerMoveIntervalAverageMs?: number | null; pointerMoveIntervalStdDevMs?: number | null; keydownCount?: number; submitHoverDurationMs?: number | null; submitPointerMoveCount?: number; submitKeydownCount?: number; submitFocusDurationMs?: number | null; submitClickTrusted?: boolean; submitClickPointerType?: string; submitClickOffsetFromCenterPx?: number | null; formFieldFocusCount?: number; formFieldCountTouched?: number; formInputEventCount?: number; formCorrectionCount?: number; formValueReplacementCount?: number; formFillDurationMs?: number | null; formFieldOrderSignature?: string; } /** Optional runtime signals that can be combined with normalized device data. */ export interface AiRuntimeSignals { browserAutomation?: WebBrowserAutomationSignals; interaction?: WebInteractionSignals; } /** Input accepted by `evaluateAiUsedSignal(...)` when evaluating normalized device data plus optional runtime signals. */ export interface AiEvaluationInput { platform?: string; device?: Record | null; insights?: DeviceInsightResponse[]; evaluation?: DeviceEvaluation | null; runtimeSignals?: AiRuntimeSignals | null; } /** * Evaluates the derived AI-used signal from a normalized device-seed response. * * @param seed Normalized device-seed response. * @returns Derived AI-used signal summary. */ export declare function evaluateAiUsedSignalFromSeed(seed: DeviceSeedResponse): AiUsedSignal; /** * Evaluates the derived AI-used signal from a polled device-event response. * * @param event Device-event response. * @returns Derived AI-used signal summary. */ export declare function evaluateAiUsedSignalFromEvent(event: DeviceEventResponse): AiUsedSignal; /** * Evaluates the derived AI-used signal from normalized device data plus optional runtime signals. * * @param input Evaluation input containing normalized device data and optional runtime signals. * @returns Derived AI-used signal summary. */ export declare function evaluateAiUsedSignal(input: AiEvaluationInput): AiUsedSignal;