/**
 * UploadMetrics — spike instrumentation for W0056 (faster artifact upload).
 *
 * Captures per-operation timing on the artifact-upload path so the spike has
 * a measured baseline: artifact count, total bytes, wall-clock, and the
 * sign-RTT vs. PUT split. Gated on `AILF_UPLOAD_METRICS=1` in the composition
 * root — a no-op when off.
 *
 * Design:
 * - `UploadMetricsSink` is the narrow interface that writers depend on.
 * - `UploadMetrics` is the in-process implementation that buffers events
 *   and emits both a stderr summary table and an NDJSON detail file.
 * - `summarize()` is called by `InstrumentedArtifactWriter` once, after
 *   `writeManifest` succeeds (the natural end-of-run signal).
 *
 * This file is a spike deliverable — the API is intentionally ad hoc and
 * may be promoted to `packages/core/src/ports/` if we ship anything.
 */
import type { Logger } from "../_vendor/ailf-core/index.d.ts";
export type UploadPhase = "sign" | "put" | "compose" | "emit" | "ndjson-part" | "manifest";
export interface UploadMetricEvent {
    /** ISO timestamp the event was recorded. */
    ts: string;
    /** Phase being measured — writers record `sign`/`put`/`compose` at the call site; the decorator records `emit`/`ndjson-part`/`manifest` end-to-end. */
    phase: UploadPhase;
    /** Writer class that produced the event (e.g. "ApiGatewayArtifactWriter"). */
    writer: string;
    /** Artifact type (or `"manifest"`). */
    type: string;
    /** Wall-clock for the phase, in milliseconds. */
    ms: number;
    /** Body size in bytes, when applicable. */
    bytes?: number;
    /** True when the underlying call resolved without throwing / without a non-2xx response. */
    success: boolean;
}
export interface UploadMetricsSink {
    record(event: Omit<UploadMetricEvent, "ts">): void;
}
/**
 * No-op sink — writers default to this when metrics are off, so the
 * instrumentation call sites remain uniform whether or not the collector is
 * active.
 */
export declare const NO_OP_UPLOAD_METRICS: UploadMetricsSink;
export interface UploadMetricsOptions {
    /** Logger used for the summary table. */
    logger: Logger;
    /** Absolute path where the NDJSON detail file is written. Skipped when undefined. */
    detailFile?: string;
}
export declare class UploadMetrics implements UploadMetricsSink {
    private readonly options;
    private readonly events;
    private summarized;
    constructor(options: UploadMetricsOptions);
    record(event: Omit<UploadMetricEvent, "ts">): void;
    summarize(): Promise<void>;
    /** Exposed for tests — returns a copy. */
    snapshot(): readonly UploadMetricEvent[];
}
export declare function buildSummaryTable(events: readonly UploadMetricEvent[]): string;
