/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ /** * Attempts to parse a potentially incomplete JSON string into a partial object. * * Useful for progressive rendering of streamed JSON output from AI providers. * Each call returns the most complete object that can be parsed from the * accumulated text so far. * * Strategy: * 1. Try JSON.parse directly (handles complete JSON) * 2. If that fails, scan the object while tracking brackets/strings, then * strip trailing incomplete tokens and close any still-open delimiters * * @param text - The (possibly incomplete) JSON string * @returns The parsed partial object, or undefined if text is too incomplete */ export declare function parsePartialJson(text: string): Record | undefined; //# sourceMappingURL=parsePartialJson.d.ts.map