/** * Zero-dependency JSONC (JSON with Comments) strip + parse. * * Flow definition files are hand-authored, and authors want to annotate them * with `//` line comments and `/* block *​/` comments just like jsonc/JSON5. * Standard `JSON.parse` rejects comments outright. This module strips comments * (only those OUTSIDE string literals) and trailing commas before parsing, so * a flow `.json` file may legally contain comments. * * Scope: this is used ONLY for user-authored flow definition files * (readFlowFile). It must NOT be used to parse LLM/subagent output — that path * (safeParse) stays strict by design, since model output is untrusted and we * want structural failures to surface. * * The algorithm is a single linear scan that tracks whether the cursor is * inside a string literal (respecting `\"` escapes). Comments are replaced * with spaces so that line/column numbers in any error message stay aligned * with the original source. Trailing commas before a closing brace/bracket * (like `{"a": 1,}` or `[1, 2,]`) are also removed — a common hand-editing * convenience that JSON.parse rejects. */ /** Strip JSONC comments (// line and block) and trailing commas. Exported for testing. */ export declare function stripJsonComments(input: string): string; /** * Parse a JSONC string (JSON with comments and trailing commas allowed) into a * value of type T. Throws the same SyntaxError `JSON.parse` would throw for any * other structural problem, so callers can wrap it in try/catch as usual. */ export declare function parseJsonc(input: string): T; //# sourceMappingURL=jsonc.d.ts.map