/** * The client for `POST /api/cli/v1/judge/stream` — one vision call that grades * the verify screenshot(s) against a rubric and returns a scorecard. * * Mirrors `forge/stream.ts` in shape (same SSE plumbing, same pre-stream * status mapping, same "a truncated stream is not a confirmed failure" * discipline), but far simpler: there is no job to resume — a judge run that * dies is simply re-run — and the terminal payload is * `{ success, scorecard, model, sparks }`. */ import { type JudgeScorecard } from '@bitmagic/asset-core'; import type { Environment } from '../config/environments.js'; export interface JudgeSuccess { success: true; scorecard: JudgeScorecard; model: string; sparks: number; } export interface JudgeFailure { success: false; message: string; sparks: number; } export type JudgeOutcome = JudgeSuccess | JudgeFailure; export interface JudgeStreamDeps { fetch: typeof globalThis.fetch; /** Called for every progress frame the server sends (there are few). */ onProgress: (message: string) => void; } /** * POSTs the rubric + screenshot(s) and consumes the SSE response. A stream * that closes with no terminal frame is a truncated connection, not a * confirmed failure — nothing is saved server-side, so the remedy is simply * to run the command again. */ export declare function requestJudge(environment: Environment, accessToken: string, body: Record, deps: JudgeStreamDeps): Promise;