/**
 * ADR-PIPELINE-094 Decision 6 — Phase 1 diligence-agent error capture.
 *
 * Persists agent invocation failures from the enterprise simulation passes
 * (Phase 1) to `<runDir>/agent-errors.json` and emits a 200-char excerpt for
 * `status.json.phase1.failed_agents[]`. Pre-094 these errors were dropped on
 * the floor — autochain.log only said "errored", which made the originating
 * `4ed715bf` run's 4 of 12 agent failures untriageable.
 *
 * The persistence is best-effort: never throws, never blocks the pipeline
 * on an I/O failure.
 */
import type { PassOutput } from './types.js';
/** Single failed-agent entry written to agent-errors.json. */
export interface FailedAgentEntry {
    readonly domain: string;
    readonly agent: string;
    readonly role: string;
    readonly pass: number;
    readonly status: number;
    readonly duration_ms: number;
    readonly timestamp: string;
    readonly error: {
        readonly type: string;
        readonly message: string;
        readonly stack_excerpt?: string;
        readonly tier: 'cloud' | 'local' | 'unknown';
        readonly first_byte_ms?: number;
    };
}
/** Top-level shape of `<runDir>/agent-errors.json`. */
export interface AgentErrorsFile {
    readonly trace_id: string;
    readonly captured_at: string;
    readonly total_failures: number;
    readonly failures: ReadonlyArray<FailedAgentEntry>;
}
/** 200-char excerpt entry for status.json. */
export interface StatusFailedAgentSummary {
    readonly domain: string;
    readonly agent: string;
    readonly role: string;
    readonly tier: string;
    readonly error_excerpt: string;
}
/**
 * Selects failures from a list of pass outputs. A failure is any
 * `AgentInvocationResult` with `error` populated OR `status >= 400`.
 */
export declare function collectFailedAgents(passOutputs: ReadonlyArray<PassOutput>): FailedAgentEntry[];
/**
 * Persists `<runDir>/agent-errors.json`. No-op when there are no failures.
 * Never throws — I/O errors emit a stderr line and return.
 *
 * @param runDir absolute path to the simulation run directory
 * @param traceId the run's trace ID (mirrored into the file for joinability)
 * @param passOutputs all enterprise passes; failures are pulled from each
 */
export declare function persistAgentErrors(runDir: string, traceId: string, passOutputs: ReadonlyArray<PassOutput>): void;
/**
 * Builds the `phase1.failed_agents[]` summary array for status.json.
 * Truncates each error message to 200 chars per ADR-094 D6.
 */
export declare function buildFailedAgentsForStatus(passOutputs: ReadonlyArray<PassOutput>): StatusFailedAgentSummary[];
/**
 * ADR-094 D6 — patch `status.json` at `<runDir>/status.json` with the
 * `phase1.failed_agents[]` summary so `agentics status` and the
 * `agentics-status` MCP tool can surface failures without re-reading
 * `agent-errors.json`. Mirrors the ADR-089 §6 / Phase-2 preflight pattern
 * already in `swarm-orchestrator.ts:writePhase2PreflightToStatus`.
 *
 * Best-effort: if status.json does not exist (shell-mode runs that don't
 * pre-create it), or write fails, returns silently. Never throws.
 */
export declare function writeFailedAgentsToStatus(runDir: string, passOutputs: ReadonlyArray<PassOutput>): void;
//# sourceMappingURL=agent-error-capture.d.ts.map