import { type PhotonAIAction, type PhotonAIRequest, type PhotonAIResponse } from './ai-provider.types'; /** * Provider-agnostic helpers for turning a model's raw text/JSON into a * validated {@link PhotonAIResponse}, and for composing the user turn. Shared * by every built-in provider preset so the JSON-recovery and validation logic * lives in exactly one place regardless of which API produced the text. */ /** The prompt text for the user turn: serialized grid context followed by the command. Reused by every preset. */ export declare function buildUserPromptText(request: PhotonAIRequest): string; /** * Parses the model's JSON *text* into a {@link PhotonAIResponse}. Tolerant of * stray characters around the JSON object (some models wrap it), and validates * that the result carries at least an action or a reply. */ export declare function parseGenerationText(text: string): PhotonAIResponse; /** Validates and normalizes an already-parsed JSON value into a {@link PhotonAIResponse}. Used by response transformers that receive an object. */ export declare function coerceGeneration(parsed: unknown): PhotonAIResponse; /** Coerces the raw `actions` field into a validated, well-typed array — dropping any malformed entries. */ export declare function normalizeActions(raw: unknown): readonly PhotonAIAction[]; /** Last-ditch recovery: extract the first balanced `{...}` object from noisy model text. Returns `undefined` when none parses. */ export declare function tryRecoverJsonObject(text: string): unknown; //# sourceMappingURL=response-parsing.d.ts.map