/**
 * Scorecard extractor — pulls the scorecard JSON object out of arbitrary
 * Claude-CLI output. Tolerates three output shapes the model produces in
 * practice:
 *
 *   1. Pure JSON: `{...}`
 *   2. Fenced JSON: ` ```json\n{...}\n``` ` or ` ```\n{...}\n``` `
 *   3. Prose-prefixed/wrapped JSON: `Sure, here's the result: {...}` or
 *      `Some intro\n```json\n{...}\n```\nDone.`
 *
 * The third case is what bit eval-agent-mcp-access smoke 4 — see
 * `.indusk/planning/eval-scorecard-format-fix/brief.md`.
 */
/**
 * Extract a balanced JSON object from arbitrary text. Returns the JSON
 * substring (just the `{...}` part) or null if no balanced object exists.
 *
 * Strategy order:
 *   1. If the text trims to a string starting with `{`, try parsing as-is.
 *   2. If a markdown code fence wraps the JSON, extract from inside the fence.
 *   3. Otherwise scan for the first `{` and find its matching `}` by
 *      tracking nesting depth and string-literal state (so braces inside
 *      string values don't fool the depth counter).
 *
 * The caller is responsible for `JSON.parse`-ing the returned substring.
 * This function only locates the JSON; it doesn't validate it.
 */
export declare function extractScorecardJson(text: string): string | null;
/**
 * Defensive accessor for `scorecard.questions`. Returns the array if the
 * field is array-shaped; returns `[]` for any other shape (missing, null,
 * boolean, number, object-keyed-by-id, etc.). The model occasionally invents
 * its own scorecard schema and puts non-arrays here — the wrapper must not
 * crash when that happens.
 *
 * Use this everywhere the wrapper iterates `scorecard.questions`. Never
 * iterate the field directly (with `?? []` or otherwise) — `?? []` only
 * catches null/undefined, not falsy-but-not-nullish values like `false`,
 * `0`, `""`, or non-array objects.
 *
 * Surfaced bugs this prevents:
 *   - `for (const q of scorecard.questions)` when `questions` is missing
 *   - `for (const q of scorecard.questions ?? [])` when `questions` is `{}`
 *     (e.g., model returned `questions: { conventions: {...} }` keyed by id)
 */
export declare function getScorecardQuestions<T>(scorecard: {
    questions?: unknown;
}): T[];
/**
 * Build an error message for the case where scorecard parsing failed.
 * Includes the underlying error and a snippet of the raw stdout so post-
 * mortem debugging is possible from `results.log` alone, without re-running.
 */
export declare function formatParseError(err: unknown, rawStdout: string): string;
