/**
 * Check run summary, annotation, and progress text builders.
 *
 * These are pure functions that produce markdown and annotation objects
 * for the GitHub Checks API. No side effects, no API calls -- just data
 * transformation from step results + log buffers to GitHub-ready output.
 *
 * Per locked decisions:
 * - Summary headline: "Job '{jobName}' failed (N/M steps passed)" or success equivalent
 * - Step table with Status | Step | Duration columns
 * - Failed steps: error + last 20 log lines in code blocks
 * - Annotations: failure/warning level, capped at 50
 * - Progress: checklist-style with emoji prefixes
 * - Size safety: 65535 byte limit with progressive truncation
 */
import type { StepLogBuffer } from './step-log-buffer.js';
/** Step result data as sent by the agent in job.status data.stepResults. */
export interface StepResultData {
    name: string;
    status: 'success' | 'failed' | 'error' | 'skipped' | 'cancelled';
    durationMs?: number;
    error?: string;
    exitCode?: number;
    timedOut?: boolean;
    continueOnError?: boolean;
}
/** Source location data from the lock file for annotation linking. */
export interface SourceLocationData {
    file: string;
    line: number;
    column: number;
}
/** A GitHub Check annotation object. */
export interface CheckAnnotation {
    path: string;
    start_line: number;
    end_line: number;
    annotation_level: 'failure' | 'warning' | 'notice';
    message: string;
    title: string;
    raw_details?: string;
}
/** Step progress entry for live updates. */
export interface StepProgressEntry {
    name: string;
    status: 'pending' | 'running' | 'success' | 'failed' | 'error' | 'skipped' | 'cancelled';
    durationMs?: number;
}
interface BuildCheckRunSummaryOptions {
    jobName: string;
    stepResults: StepResultData[];
    logBuffer: StepLogBuffer;
    runId: string;
    jobId: string;
    traceIds: {
        requestId: string;
        runId: string;
    };
    /** Total job duration in milliseconds. */
    jobDurationMs?: number;
}
interface BuildAnnotationsOptions {
    stepResults: StepResultData[];
    /** Source locations indexed by step index. Missing entries are skipped. */
    sourceLocations: Map<number, SourceLocationData>;
}
interface BuildProgressTextOptions {
    steps: StepProgressEntry[];
    traceIds: {
        requestId: string;
        runId: string;
    };
}
export { formatDuration } from '@kici-dev/shared';
/**
 * Build a rich markdown summary for a GitHub Check run output.summary field.
 *
 * Includes: headline, step table, failure details with log context, trace footer.
 * Respects the 65535 byte limit with progressive log truncation.
 */
export declare function buildCheckRunSummary(opts: BuildCheckRunSummaryOptions): string;
/**
 * Build GitHub Check annotation objects from step results and source locations.
 *
 * Returns an object with the annotations array (capped at 50) and the count
 * of remaining annotations that could not be included.
 */
export declare function buildAnnotations(opts: BuildAnnotationsOptions): {
    annotations: CheckAnnotation[];
    remainingCount: number;
};
/**
 * Build a checklist-style markdown string for live check run updates.
 *
 * Example:
 *   checkmark Install deps (1.2s)
 *   checkmark Build (3.4s)
 *   hourglass Run tests...
 *   (not yet started) Deploy
 */
export declare function buildProgressText(opts: BuildProgressTextOptions): string;
//# sourceMappingURL=check-run-summary.d.ts.map