Raw LLM output that may contain JSON
Extracted JSON string, or null if no valid JSON found
extractJson('```json\n{"key": "value"}\n```') // '{"key": "value"}'
extractJson('<thinking>hmm</thinking>\n{"a":1}') // '{"a":1}'
extractJson('no json here') // null
Extract JSON from raw LLM output text.
Tries multiple extraction strategies in priority order:
json ...or...)<thinking>blocks, then retry{...}or[...]via greedy brace/bracket matching