export interface SafeParseResult { ok: boolean; value?: T | undefined; error?: string | undefined; } export declare function safeParse(input: string, maxBytes?: number): SafeParseResult; export declare function safeStringify(value: unknown, pretty?: boolean): string; /** * Attempt to parse JSON5-style input and return a valid JSON string. * Handles trailing commas, line/block comments, and unquoted keys * that are common in provider output. * * Returns the sanitized string if it parses successfully as JSON, * or `null` if the input cannot be made valid. Callers use this to * decide whether to proceed with the parsed result or fall back to * raw handling. */ export declare function sanitizeJsonString(s: string): string | null; /** * Strip a Markdown code-fence wrapper from a payload. * * Models occasionally return tool-call arguments wrapped in ```json fences * (or embedded in prose around one) instead of bare JSON. Returns the inner * content when the input starts with a fence (closing fence optional, so a * truncated stream still unwraps) or contains one complete fenced block; * returns null when no fence is present. Callers should only invoke this * after a direct parse failed, so fences inside legitimate string values are * never touched. */ export declare function stripCodeFences(s: string): string | null; //# sourceMappingURL=safe-json.d.ts.map