import type { BatchTranslationProvider } from './web-translation-providers'; /** * The OpenAI-compatible endpoint m-one-ui's "Fix with AI" speaks (m-one-ui * CONTEXT.md AiProvider): a base URL ending in `/v1`, a token, a model id. * * Deliberately duplicates m-one-ui's `ai-translation.ts` rather than sharing * it: `@magmonium/cli` is published as plain source, so a workspace * dependency would mean bundling it to publish (m-one-ui ADR 0007). */ export interface AiProviderConfig { baseUrl: string; /** Empty for a local server that takes no key. */ token?: string; model: string; } /** * Whether every placeholder in the source survives verbatim. A translated * name (`<$seite>`) or a respaced one (`< $page>`) renders as literal text, * because nothing fills it. */ export declare function keepsPlaceholders(source: string, text: string): boolean; /** * The `{lang: text}` object out of a reply, fenced or bare, whole or cut off. * Languages not asked for, non-strings and texts that lose a placeholder are * left out — the caller hands those to the web providers. */ export declare function parseAiTranslationReply(reply: string, source: string, targets: readonly string[]): Record; export declare class AiProviderTranslator implements BatchTranslationProvider { private readonly config; readonly name = "ai-provider"; private readonly logger; /** Set on a refusal no retry fixes (bad key, wrong URL) — later calls skip. */ private disabled; constructor(config: AiProviderConfig, verbose?: boolean); /** * The target languages in request-sized chunks, a few at once. One reply * for every language outruns the timeout or gets cut off, and a single * broken chunk would then cost the whole set. */ translateBatch(text: string, fromLang: string, langCodes: string[]): Promise>; private translateChunk; private chat; } //# sourceMappingURL=ai-provider-translator.d.ts.map