export interface SoftwareInfo { name: string; version: string; } export interface PlatformInfo { platform_id: string; role: string; software: SoftwareInfo; } export interface IdentityInfo { namespace: string; value_hash: string; confidence?: number; quarantined?: Record; } export interface ConsentScope { intent_based_monetization: boolean; agent_participation: boolean; measurement: boolean; } export interface ConsentConstraints { allow_identity_downstream: boolean; } export interface ConsentInfo { status: string; source?: string; scope: ConsentScope; constraints: ConsentConstraints; } export interface Message { role: string; content: string; id?: string; } export interface InputInfo { query_text: string; messages?: Message[]; } export interface LocationInfo { city?: string; state?: string; state_code?: string; country?: string; country_code?: string; zipcode?: string; latitude?: number; longitude?: number; } export interface SessionInfo { id?: string; turn_index: number; } export interface SurfaceInfo { channel: string; interaction_mode: string; platform: string; form_factor?: string; os?: string; app_id?: string; app_version?: string; device_type?: string; browser?: string; browser_version?: string; locale?: string; country?: string; publisher?: string; ua_hash?: string; } export interface InteractionInfo { session?: SessionInfo; surface: SurfaceInfo; input: InputInfo; context?: { location?: LocationInfo; page?: { url?: string; origin?: string; referrer?: string; host?: string; }; }; } export interface IntentSignalInfo { type: string; decision_phase: string; subtype?: string; confidence?: number; commercial_score?: number; } export interface SignalSourceInfo { type: string; name: string; version: string; calibration_version?: string; trust_tier?: string; } export interface ProvidedSignalsInfo { source: SignalSourceInfo; intent: IntentSignalInfo; iab_content?: Record; context?: Record; } export interface ClassificationInput { type: 'interaction' | 'provided_signals'; interaction?: InteractionInfo; signals?: ProvidedSignalsInfo; } export interface PolicyHints { latency_budget_ms?: number; preferred_pricing_model?: string; } export interface NormalizedScores { confidence?: number; commercial_score?: number; } export interface SignalValidation { status?: string; trust_tier_applied?: string; normalized_scores?: NormalizedScores; drift_risk?: string; reason?: string; } export interface Policy { consent_eligibility?: string; monetization_eligibility?: string; decision_basis?: string; reason?: string; applied_thresholds?: Record; sensitivity?: string; regulated_vertical?: boolean; opportunity?: Record; } export interface AuctionFloor { amount: number; currency: string; } export interface AuctionConfig { enabled?: boolean; floor?: AuctionFloor; } export interface Monetization { enabled?: boolean; pricing_model?: string; auction?: AuctionConfig; } export interface PlatformRequest { spec_version: string; message_id: string; timestamp: string; platform: PlatformInfo; identity: IdentityInfo; consent: ConsentInfo; classification_input: ClassificationInput; policy_hints?: PolicyHints; signal_validation?: SignalValidation; policy?: Policy; monetization?: Monetization; } export interface Product { product_id: string; product_link: string; product_url?: string; product_name: string; product_description?: string; product_price?: string | number; product_discount?: string | number; product_currency?: string; product_discount_type?: string; product_cta_label?: string; product_image_url?: string; product_features?: string[]; } export interface Creative { brand_name: string; domain?: string; headline: string; description: string; cta_text: string; follow_up_suggestion?: string; logo_url?: string; image_urls?: string[]; landing_page_url: string; products?: Product[]; } export interface Recommendation { format: 'weave' | 'tail' | 'product_card' | 'bridge'; disclosure: string; creative: Creative; offerId?: string; } export interface Delegation { available?: boolean; mode?: 'optional' | 'recommended' | 'required'; trigger?: 'user_action' | 'explicit_consent' | 'operator_initiated'; cta_text?: string; brand_id?: string; brand_name?: string; mcp_endpoint?: string; eligibility_reason?: string; delegate_reason?: string; session_goal?: string; desired_outcome_type?: 'purchase' | 'lead_capture' | 'quote_request' | 'demo_booking' | 'plan_selection' | 'support_resolution'; required_user_inputs?: string[]; required_consent_types?: string[]; success_outcome?: string; fallback_message?: string; session_mode?: string; delegation_session_id?: string; status?: string; capabilities?: Array>; allowed_data_types?: string[]; consent_requirements?: Array>; auth_model?: string; handoff_protocol?: Record; supported_actions?: Array>; metadata?: Record; } export interface Tracking { exposure_url?: string; followup_exposure_url?: string; click_url?: string; conversion_url?: string; followup_engagement_url?: string; } export interface Error { code: string; message: string; } export interface PlatformResponse { spec_version: string; recommendation_id: string; timestamp: string; status: 'generated' | 'no_match' | 'error'; ttl_ms: number; recommendation?: Recommendation; delegation?: Delegation; tracking?: Tracking; error?: Error; ext?: Record; } export type RecommendationReportReason = 'irrelevant' | 'misleading' | 'inappropriate' | 'broken_link' | 'other'; export interface RecommendationReportPayload { recommendation: PlatformResponse; recommendation_id: string; reason: RecommendationReportReason; session_id?: string; } export interface DelegationActivationPayload { recommendation_id: string; delegation_session_id?: string; session_id?: string; brand_id?: string; brand_name?: string; mcp_endpoint?: string; eligibility_reason?: string; delegate_reason?: string; session_goal?: string; desired_outcome_type?: 'purchase' | 'lead_capture' | 'quote_request' | 'demo_booking' | 'plan_selection' | 'support_resolution'; required_user_inputs?: string[]; required_consent_types?: string[]; success_outcome?: string; fallback_message?: string; session_mode?: string; status?: string; capabilities?: Array>; allowed_data_types?: string[]; consent_requirements?: Array>; auth_model?: string; handoff_protocol?: Record; supported_actions?: Array>; metadata?: Record; platform_response: PlatformResponse; } export interface ActiveDelegationSession { delegation_session_id: string; recommendation_id: string; session_id: string; brand_agent_id?: string; brand_id?: string; brand_name: string; mcp_endpoint: string; status: 'active' | 'stopped' | 'completed' | 'expired' | 'failed'; activated_at: string; last_activity_at: string; expires_at: string; eligibility_reason?: string; delegate_reason?: string; session_goal?: string; desired_outcome_type?: 'purchase' | 'lead_capture' | 'quote_request' | 'demo_booking' | 'plan_selection' | 'support_resolution'; required_user_inputs?: string[]; required_consent_types?: string[]; success_outcome?: string; fallback_message?: string; capabilities?: Array>; allowed_data_types?: string[]; consent_requirements?: Array>; auth_model?: string; handoff_protocol?: Record; supported_actions?: Array>; metadata?: Record; } export interface AdMeshTheme { mode: 'light' | 'dark'; accentColor?: string; primaryColor?: string; secondaryColor?: string; backgroundColor?: string; surfaceColor?: string; borderColor?: string; textColor?: string; textSecondaryColor?: string; /** Maps to publisher `send_button_text_color` */ primaryTextColor?: string; fontFamily?: string; fontSize?: { small?: string; base?: string; large?: string; title?: string; }; borderRadius?: string; spacing?: { small?: string; medium?: string; large?: string; }; shadows?: { small?: string; medium?: string; large?: string; }; icons?: { expandIcon?: string | React.ReactNode; collapseIcon?: string | React.ReactNode; starIcon?: string | React.ReactNode; checkIcon?: string | React.ReactNode; arrowIcon?: string | React.ReactNode; }; gradients?: { primary?: string; secondary?: string; accent?: string; }; components?: { card?: React.CSSProperties; button?: React.CSSProperties; expandableUnit?: React.CSSProperties; productCard?: React.CSSProperties; compareTable?: React.CSSProperties; citationUnit?: React.CSSProperties; inlineRecommendation?: React.CSSProperties; }; disableDefaultStyles?: boolean; } export interface AdMeshSDKConfig { apiKey: string; theme?: AdMeshTheme; apiBaseUrl?: string; /** Set true when requests originate from the browser extension */ extension?: boolean; /** Optional override for extension source domain header */ extensionSourceDomain?: string; /** Optional user identifier forwarded to ACIE/aip context flows */ userId?: string; } export interface ShowRecommendationsOptions { query: string; containerId: string; theme?: AdMeshTheme; followups_container_id?: string; sessionId: string; messageId: string; platformSurface?: string; model?: string; messages?: Array<{ role: string; content: string; }>; locale?: string; location?: { city?: string; state?: string; stateCode?: string; country?: string; countryCode?: string; zipcode?: string; latitude?: number; longitude?: number; }; userId?: string; /** Legacy bridge CTA callback; prefer onStartDelegation */ onPasteToInput?: (content: string) => void; /** Called when the SDK needs host approval before starting a delegated brand flow */ onDelegationConsent?: (recommendation: PlatformResponse) => boolean | Promise; /** Called with normalized delegation payload after consent and engagement tracking */ onDelegationActivated?: (payload: DelegationActivationPayload) => void | Promise; /** Called after consent is granted so the host can create/open the delegation session */ onStartDelegation?: (recommendation: PlatformResponse) => void | Promise; /** Callback to execute query when follow-up is selected (required for follow-up functionality) */ onExecuteQuery?: (query: string) => void | Promise; } export interface AdMeshRecommendationResponse { sessionId: string; messageId: string; recommendations: PlatformResponse[]; } export interface TrackingData { recommendationId: string; admeshLink: string; userId?: string; sessionId?: string; productId?: string; revenue?: number; conversionType?: string; metadata?: Record; } export interface UseAdMeshTrackerReturn { trackClick: (data: TrackingData) => Promise; trackConversion: (data: TrackingData) => Promise; trackView: (data: TrackingData) => Promise; isTracking: boolean; error: string | null; } export type AdMeshLayoutType = 'product' | 'inline' | 'tail' | 'ecommerce'; export interface AdMeshLayoutProps { recommendations: PlatformResponse[]; theme?: AdMeshTheme; className?: string; style?: React.CSSProperties; sessionId?: string; onDelegationConsent?: (recommendation: PlatformResponse) => boolean | Promise; onDelegationActivated?: (payload: DelegationActivationPayload) => void | Promise; onStartDelegation?: (recommendation: PlatformResponse) => void | Promise; } export type ChatMessageRole = 'user' | 'assistant' | 'system'; export type ChatPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'; export type ChatSize = 'sm' | 'md' | 'lg' | 'xl'; export type ChatDisplayMode = 'widget' | 'fullscreen' | 'embedded'; export interface ChatMessage { id: string; role: ChatMessageRole; content: string; timestamp: Date; recommendations?: PlatformResponse[]; isTyping?: boolean; userQuery?: string; } export interface AdMeshChatConfig { position: ChatPosition; size: ChatSize; displayMode: ChatDisplayMode; autoOpen?: boolean; showWelcomeMessage?: boolean; welcomeMessage?: string; placeholder?: string; maxMessages?: number; enableTypingIndicator?: boolean; enableSuggestions?: boolean; suggestions?: string[]; showInputField?: boolean; } export interface AdMeshChatInputProps { value: string; onChange: (value: string) => void; onSubmit: (message: string) => void; placeholder?: string; disabled?: boolean; suggestions?: string[]; className?: string; theme?: AdMeshTheme; onSendMessage?: (message: string) => void; } export interface AdMeshChatMessageProps { message: ChatMessage; theme?: AdMeshTheme; className?: string; style?: React.CSSProperties; } export interface AdMeshChatInterfaceProps { messages: ChatMessage[]; config: AdMeshChatConfig; theme?: AdMeshTheme; onSendMessage: (message: string) => void; className?: string; isLoading?: boolean; style?: React.CSSProperties; } export interface AdMeshTailAdProps { recommendations: PlatformResponse[]; theme?: AdMeshTheme; className?: string; style?: React.CSSProperties; sessionId?: string; triggerExposureUrl?: boolean; } export type BadgeType = 'Top Match' | 'Free Tier' | 'AI Powered' | 'Popular' | 'New' | 'Trial Available'; export type BadgeVariant = 'primary' | 'secondary' | 'success' | 'warning'; export type BadgeSize = 'sm' | 'md' | 'lg'; export interface AdMeshBadgeProps { type: BadgeType; variant?: BadgeVariant; size?: BadgeSize; className?: string; style?: React.CSSProperties; } export interface AdMeshLinkTrackerProps { recommendationId: string; admeshLink: string; productId?: string; children: React.ReactNode; trackingData?: Record; className?: string; style?: React.CSSProperties; } export interface AdMeshConfig { trackingEnabled?: boolean; defaultTheme?: AdMeshTheme; } //# sourceMappingURL=index.d.ts.map