/** * Extract the first JSON object from arbitrary LLM output. * * Even with a strict "reply with JSON only" prompt, models occasionally wrap * the payload in ```json fences, prepend "Here you go:", or leak trailing * prose. This helper isolates the first balanced `{...}` block and parses it, * stripping optional ```json / ``` fences first. * * Throws if no valid object is present. Consumers that want a soft failure * should wrap it in try/catch — that's usually the right shape when using * this from inside an `AgentTool.execute` (return the parse error as the * tool-result string so the model re-asks the user). */ export declare function extractFirstJsonObject(raw: string | null | undefined): T; /** Same as `extractFirstJsonObject`, but returns `null` on any parse failure. */ export declare function tryExtractFirstJsonObject(raw: string | null | undefined): T | null; //# sourceMappingURL=llm_json.d.ts.map