/** * Balanced-Bracket JSON Scanning * * LLM responses often embed JSON with nested objects/arrays. Regex-based extraction * that stops at the first closing bracket it meets truncates on any inner nesting * (e.g. `{"a": {"b": 1}, "c": 2}` truncates to `{"a": {"b": 1}` — unbalanced). These * helpers instead walk the string tracking bracket depth and skip over string-literal * contents (including escaped quotes), so braces/brackets inside free-text field * values don't miscount depth. */ /** * Finds the index of the bracket matching the one at `openIndex` (must be `{` or `[` * in `content`), skipping over string-literal contents. Returns null if `openIndex` * isn't an opening bracket or no match is found before the end of the string. */ export declare function findMatchingBracketEnd(content: string, openIndex: number): null | number; /** * Walks backward from `fromIndex` to find the `{` that encloses it, balancing any * `}`/`{` pairs met along the way. Returns null if no enclosing brace is found. */ export declare function findEnclosingBraceStart(content: string, fromIndex: number): null | number; //# sourceMappingURL=balanced-json.d.ts.map