import { UnionToIntersection } from "type-fest"; import { ApiQueries, ApiResponses } from "../schema"; export declare const ALL_COUNTRY_CODES: readonly ["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CD", "CG", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "UM", "US", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]; export declare const ALL_CURRENCY_CODES: readonly ["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS", "VES", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XUA", "YER", "ZAR", "ZMW", "ZWL"]; export interface Mutation { } export interface Effect { } export type TimeInterval = number; export type Timestamp = number; export type Nullable = T | null; export type Url = string; export interface ListQuery> { filters?: F; } export interface ListResponse { results: T[]; } export interface PhysicalLocation { address?: { streetAddress?: string; secondaryAddress?: string; city?: string; postalCode?: string; state?: string; country?: string; }; coordinates?: { latitude: number; longitude: number; }; countryCode?: IsoCountry; uule?: string; } export type UpdatableResponse = UpdatableResponseUpdate | UpdatableResponseComplete; interface UpdatableResponseBase { kind: "insert" | "sync" | "append" | "complete"; statusLog: StatusUpdate[]; data: Data | null; } interface UpdatableResponseUpdate extends UpdatableResponseBase { kind: "insert" | "sync" | "append"; data: null; } interface UpdatableResponseComplete extends UpdatableResponseBase { kind: "complete"; data: Data; } export interface ResearchResponseData { summary: MarkdownString | null; category: string | null; products: ResearchedProductV2[]; productGroups: ProductGroup[]; relatedProducts: ResearchedProductV2[]; research: ResearchData[]; } export type ResearchResponse = UpdatableResponse; export type ExtractUpdatableResponseDataType = UpdatableResponseType extends UpdatableResponse ? DataType : never; export type StatusUpdate = StatusUpdateUpdate | StatusUpdateError; interface StatusUpdateBase { kind: "update" | "error"; statusMessageId?: string; statusMessage: string; statusData: T; } interface StatusUpdateUpdate extends StatusUpdateBase { kind: "update"; } interface StatusUpdateError extends StatusUpdateBase { kind: "error"; } interface BaseStatusMessageData { kind: string; data: Record; } export interface TextStatusMessageData extends BaseStatusMessageData { kind: "text"; data: { text: string; }; } interface BaseResearchData { kind: string; id: string; url: Url; domain: string; imageUrls: Url[] | null; thumbnailUrl: Url | null; title: string | null; subscriptionPlan?: UserSubscriptionPlan; subscriptionLocked?: boolean; } export interface EditorialResearchData extends BaseResearchData { kind: "editorial"; sourceName: string | null; } export interface SocialResearchData extends BaseResearchData { kind: "social"; username: string | null; userImageUrl: Url | null; networkName: string | null; communityName: string | null; body: string | null; upvotes: number | null; downvotes: number | null; replyCount: number | null; parent: SocialResearchData | null; } export interface VideoResearchData extends BaseResearchData { kind: "video"; channelName: string | null; channelImageUrl: Url | null; views: number | null; length: TimeInterval | null; upvotes: number | null; downvotes: number | null; } export interface ReviewResearchData extends BaseResearchData { kind: "review"; reviewerName: string | null; body: string | null; rating: Rating | null; } export type ResearchData = EditorialResearchData | SocialResearchData | VideoResearchData | ReviewResearchData; export interface SummaryStatusMessageData extends BaseStatusMessageData { kind: "summary"; data: { text: MarkdownFragmentString | null; research: ResearchData[]; }; } export interface DeltaStatusMessageData extends BaseStatusMessageData { kind: "delta"; data: { targetId: string; delta: MarkdownFragmentString; }; } export interface QueryPlanStatusMessageData extends BaseStatusMessageData { kind: "queryPlan"; data: { sourceType: "reddit" | "editorial" | "educational"; queries: string[]; }[]; } export interface SourceStatusMessageData extends BaseStatusMessageData { kind: "source"; data: { sourceName: string | null; title: string; domain: string; url: string; thumbnailUrl: string | null; subscriptionPlan?: UserSubscriptionPlan; subscriptionLocked?: boolean; }[]; } export interface SocialPostStatusMessageData extends BaseStatusMessageData { kind: "socialPost"; data: { networkName: string | null; communityName: string | null; title: string; domain: string; url: string; author: string; upvotes: number; downvotes: number; }[]; } export interface ResearchNoteStatusMessageData extends BaseStatusMessageData { kind: "researchNote"; data: { sourceName: string | null; title: string; text: string; urls: string[]; thumbnailUrl: string | null; subscriptionPlan?: UserSubscriptionPlan; subscriptionLocked?: boolean; }[]; } export interface ResearchProductCardsUpdateStatusMessageData extends BaseStatusMessageData { kind: "researchProductCardsUpdate"; data: StreamingResearchedProductV2[]; } export interface ProductGroupsUpdateStatusMessageData extends BaseStatusMessageData { kind: "productGroupsUpdate"; data: ProductGroup[]; } export type StatusMessageData = TextStatusMessageData | SummaryStatusMessageData | DeltaStatusMessageData | QueryPlanStatusMessageData | SourceStatusMessageData | SocialPostStatusMessageData | ResearchNoteStatusMessageData | ResearchProductCardsUpdateStatusMessageData | ProductGroupsUpdateStatusMessageData | null; export type IsoCountry = (typeof ALL_COUNTRY_CODES)[number]; export interface Money { amount: MoneyAmount; currency: IsoCurrency | IsoNoCurrency; } export type MoneyAmount = number; export type IsoCurrency = (typeof ALL_CURRENCY_CODES)[number]; export type IsoNoCurrency = "XXX"; export type IsoTestCurrency = "XTS"; export type AnyCurrency = IsoCurrency | IsoTestCurrency | IsoNoCurrency; export type BadgeStates = "yes" | "no" | "maybe" | "low_data"; export type MarkdownString = string; export type MarkdownFragmentString = string; export type PersonalizationNamespace = "settings"; export interface PersonalizationBase> { namespace: Namespace; data: Data | Record; } export type PersonalizationSettingsData = { sources?: string | null; stores?: string | null; genderCategory?: "mens" | "womens" | "unisex" | null; notifications?: { proUpdates?: boolean | null; deals?: boolean | null; priceDrops?: boolean | null; } | null; country?: IsoCountry | null; }; export type PersonalizationSettings = PersonalizationBase<"settings", PersonalizationSettingsData>; export type Personalization = PersonalizationSettings; export type PriceType = "list" | "buy" | "new" | "used" | "refurbished"; export type TimestampedPrice = [Timestamp, MoneyAmount | null]; export interface PushNotificationToken { type: "expo" | "android" | "ios"; token: string; installId: string; } export interface Rating { count: number; value: number; range: { min: number; max: number; }; } export interface ResearchedProduct { name: string; nameFromApi: string | null; brand: string | null; price: Money | null; url: Url | null; affiliateUrl: Url | null; affiliatePages: { price: Money | null; url: Url | null; affiliateUrl: Url | null; rating?: Rating | null; gtins?: string[]; }[]; imageUrls: Url[]; } export interface ResearchReference { index: number; title: string; text: string; url: Url; date: Timestamp | null; } export interface ResearchedProductV2 { name: string; award: string | null; description: string | null; googleProductId: string | null; googleShoppingImmersiveUrls?: Url[]; storePages: { price: Money | null; stablePrice: Money | null; url: Url | null; affiliateUrl: Url | null; favicon: Url | null; storeDisplayName?: string | null; shippingInfo?: string | null; returnInfo?: string | null; stockStatus?: string | null; gtins?: string[]; rating?: Rating | null; }[]; rating?: Rating | null; imageUrls: Url[]; references: ResearchReference[]; } export type StreamingResearchedProductV2 = Pick & Partial>; export interface ProductGroup { name: string; key: string | null; query: string | null; header: string | null; imageUrl: Url | null; products: Product[]; references: ResearchReference[]; } export interface ProductDeal { query: string; product: ResearchedProductV2; } export interface BaseMessageProps { id: string; created: number; ignore?: boolean; error?: string; reference_message_id?: string; } export interface MessageRow { version: string; data: Message; origin: "client" | "agent"; } export type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage; export interface SystemMessage extends BaseMessageProps { role: "system"; content: string; } export interface UserMessage extends BaseMessageProps { role: "user"; content: string; } interface BaseAssistantMessage extends BaseMessageProps { role: "assistant"; } export interface AssistantContentMessage extends BaseAssistantMessage { content: string; } export interface AssistantToolCallMessage extends BaseAssistantMessage { content?: string; tool_calls: ToolCall[]; } export type AssistantMessage = AssistantContentMessage | AssistantToolCallMessage; type BaseToolCall> = { id: string; type: "function"; function: { type: T; name: N; args: ToolParams; }; }; type ToolTypeCallMap = { [T in ToolType]: { [N in ToolTypeName]: BaseToolCall; }; }; type ToolCallMap = UnionToIntersection; export type ToolCall = ToolCallMap[keyof ToolCallMap]; export interface ToolMessage extends BaseMessageProps { role: "tool"; tool_call_id: string; content: ToolContent; } interface BaseToolContent> { type: T; name: N; result: ToolResponse; } type ToolTypeContentMap = { [T in ToolType]: { [N in ToolTypeName]: BaseToolContent; }; }; type ToolContentMap = UnionToIntersection; export type ToolContent = ToolContentMap[keyof ToolContentMap]; export type ToolType = "query" | "render"; export type ToolTypeName = T extends "query" ? ApiToolName : T extends "render" ? RenderToolName : never; export type ToolName = ToolTypeName; declare const API_TOOL_NAMES: ("browseTheWeb" | "findProductsV2" | "findSimilarProducts" | "localServices" | "priceHistoryLists" | "productTradeoffs" | "refineUserRequest" | "researchBestProductsV2" | "researchDeals" | "researchProductComparison" | "researchProductReview")[]; export type ApiToolName = keyof Pick; declare const RENDER_TOOL_NAMES: readonly []; export type RenderToolName = (typeof RENDER_TOOL_NAMES)[number]; export type ToolParams = N extends ApiToolName ? ApiToolParams : N extends RenderToolName ? RenderToolParams : never; export type ApiToolParams = ApiQueries[N][string]; export interface RenderToolParamsMap { } export type RenderToolParams = RenderToolParamsMap[N]; export type ToolResponse = N extends ApiToolName ? ApiToolResponse : N extends RenderToolName ? RenderToolResponse : never; export type ApiToolResponse = NonNullable; export interface RenderToolResponseMap extends Record { } export type RenderToolResponse = RenderToolResponseMap[N]; export type UserSubscriptionPlan = "free" | "pro"; export {}; //# sourceMappingURL=builtins.d.ts.map