/**
 * api-client/api-client.ts — Typed HTTP client for the AILF API.
 *
 * Handles all communication with the AILF API: submission, polling,
 * report fetching, and task validation. Uses Node's built-in `fetch`
 * (Node 22+) — no external HTTP dependencies.
 *
 * The client is intentionally thin: it builds HTTP requests, parses
 * responses into typed objects, and translates HTTP errors into typed
 * error classes. It does NOT contain business logic.
 *
 * @see packages/api/src/routes/ — server-side route handlers
 * @see docs/design-docs/cli-as-api-client.md — design doc
 */
import { type PipelineRequest } from "../../_vendor/ailf-core/index.d.ts";
import type { ApiClientOptions, JobResponse, SubmitResponse, ValidationResponse, WaitOptions } from "./types.js";
export declare class ApiClient {
    private readonly apiKey;
    private readonly baseUrl;
    constructor(options: ApiClientOptions);
    /**
     * POST /v1/pipeline — submit an evaluation and return the job info.
     *
     * Returns HTTP 202 on success with a `SubmitResponse` containing the
     * `jobId` and `statusUrl` for polling.
     */
    submitPipeline(request: PipelineRequest): Promise<SubmitResponse>;
    /**
     * GET /v1/jobs/:id — fetch job status.
     *
     * Supports long-polling via the `Prefer: wait=N` header. When
     * `longPollSeconds` is set, the server holds the connection open
     * for up to N seconds (max 25) waiting for a status change.
     */
    getJob(jobId: string, options?: {
        longPollSeconds?: number;
    }): Promise<JobResponse>;
    /**
     * Poll until the job reaches a terminal state (completed, failed,
     * timed-out) or the timeout is exceeded.
     *
     * Uses long-polling for efficiency — the server holds the connection
     * instead of the client sleeping between requests.
     */
    waitForCompletion(jobId: string, options?: WaitOptions): Promise<JobResponse>;
    /**
     * GET /v1/reports/:id/markdown — fetch the rendered markdown report.
     *
     * Returns the raw markdown string. Throws on 404 or error.
     */
    getReportMarkdown(reportId: string): Promise<string>;
    /**
     * POST /v1/validate/task — validate task definitions against the API.
     *
     * Returns a structured validation result. Does not throw on invalid
     * tasks — the caller checks `response.valid`.
     */
    validateTasks(tasks: unknown[]): Promise<ValidationResponse>;
    private get;
    private post;
    /**
     * Build standard headers. Auth is always included.
     */
    private headers;
    /**
     * Fetch with retry on transient network errors.
     * Retries up to MAX_RETRY_ATTEMPTS with exponential backoff.
     * Only retries on network errors (TypeError from fetch), not HTTP errors.
     */
    private fetchWithRetry;
    /**
     * Parse a non-OK HTTP response and throw the appropriate typed error.
     */
    private handleErrorResponse;
}
