import { TIKTOK_SEARCH_PLAN_VERSION, TIKTOK_PRODUCT_IDENTITY_VERSION, type TikTokSearchPlanValidation, type TikTokSearchPlan } from "./tiktok-search-plan.js"; import { type ProductIdentityImage } from "./tiktok-product-identity-input.js"; export declare const TIKTOK_QUERY_TRANSLATION_VERSION = "tiktok-query-translation-v1"; export declare const TIKTOK_QUERY_TRANSLATION_TIMEOUT_MS = 55000; export declare const TIKTOK_VISUAL_TRANSLATION_TIMEOUT_MS = 120000; export type TikTokQueryTranslation = { originalQuery: string; query: string; market: string; targetLanguage: string; searchPlan?: TikTokSearchPlan; }; export type TikTokQueryTranslationJob = { id: string; status: "running" | "completed" | "failed"; translation?: TikTokQueryTranslation; error?: string; code?: string; validation?: TikTokSearchPlanValidation; }; type TranslationInput = { searchStrategy?: "commerce-hit-v1"; } & Pick & { searchPlanVersion?: typeof TIKTOK_SEARCH_PLAN_VERSION; productIdentityVersion?: typeof TIKTOK_PRODUCT_IDENTITY_VERSION; productImages?: ProductIdentityImage[]; inputDigest?: string; }; export type QueryTranslationCodex = (prompt: string, outputSchema: Record, signal: AbortSignal, images?: string[]) => Promise; export declare class TikTokQueryTranslationError extends Error { readonly status: number; readonly code: string; readonly validation?: TikTokSearchPlanValidation | undefined; constructor(status: number, code: string, message: string, validation?: TikTokSearchPlanValidation | undefined); } export declare function normalizeTikTokQueryTranslation(input: unknown): TranslationInput; export declare function tikTokQueryTranslationPrompt(input: TranslationInput): string; export declare const tikTokQueryTranslationSchema: Record; export declare const tikTokProductIdentitySchema: Record; export declare function tikTokProductIdentityPrompt(input: TranslationInput): string; /** One job owns the lane through cleanup; only a returned invalid plan permits one serial repair. */ export declare class TikTokQueryTranslator { private codex; private options; private cache; private identityCache; private jobs; private active; private stopping; constructor(codex?: QueryTranslationCodex, options?: { timeoutMs?: number; now?: () => number; }); get isActive(): boolean; /** Start once, then poll by ID using short relay requests; a read never starts or retries a model. */ start(input: unknown): TikTokQueryTranslationJob; get(id: string): TikTokQueryTranslationJob | null; private pruneJobs; cancel(): Promise; translate(input: unknown): Promise; } export {};