/**
 * ApiGatewayArtifactWriter — uploads AILF run artifacts via the API Gateway.
 *
 * Used when the CLI runs locally without GCS credentials. The Gateway signs a
 * PUT URL (scoped to a single GCS object) and the writer PUTs JSON directly
 * to GCS so Vercel stays out of the data path.
 *
 * Endpoints:
 *   - Bulk:      GET  {apiBaseUrl}/v1/runs/{runId}/artifacts/{type}/upload-url
 *   - Per-entry: GET  {apiBaseUrl}/v1/runs/{runId}/artifacts/{type}/{entryKey}/upload-url
 *   - Manifest:  GET  {apiBaseUrl}/v1/runs/{runId}/artifacts/upload-url
 *
 * ## W0049 API surface
 *
 * - `emit(type, association, payload)` — canonical single-shot write. Uses
 *   the registry to resolve `layout` and the signing endpoint.
 * - `appendNdjson` — NOT IMPLEMENTED. The API Gateway has no batch-signing
 *   endpoint yet (W0052), and per-object signing would issue one sign call
 *   per row, which blows the Vercel Function budget. Throws
 *   `NotImplementedError` so the gap is explicit rather than a silent no-op.
 * - `writeBulk` / `writePerEntry` — @deprecated legacy surface; removal in W0052.
 *
 * Design principles:
 * - P5: Non-blocking — any non-structural failure returns null and warns.
 * - Stateless — no client state between calls.
 *
 * @see docs/decisions/D0032-run-anchored-artifact-store.md
 * @see docs/decisions/D0033-unified-run-anchored-artifact-capture.md
 */
import { type ArtifactEntry, type ArtifactRef, type ArtifactType, type ArtifactWriter, type AssociationValues, type RunId, type RunManifest, type WriteSource } from "../_vendor/ailf-core/index.d.ts";
import { type UploadMetricsSink } from "./upload-metrics.js";
export interface ApiGatewayArtifactWriterOptions {
    /** Base URL of the API gateway (e.g., "https://ailf-api.sanity.build"). */
    apiBaseUrl: string;
    /** AILF API key with the `artifact:write` scope. */
    apiKey: string;
    /** GCS bucket name — included in the returned ArtifactRef. */
    bucket: string;
    /**
     * W0056 spike — optional metrics sink that receives per-phase timing events.
     * Defaults to a no-op so the hot path stays free when metrics are off.
     */
    metrics?: UploadMetricsSink;
    /**
     * Identifies what kind of execution context owns this writer instance.
     * The D0050 guard refuses to emit a descriptor whose `writePolicy` is
     * different from this value. `"pipeline"` (the default) is for writers
     * driven by an `ailf run` pipeline; `"post-hoc"` is for writers driven
     * by deferred commands like `ailf interpret` that emit descriptors
     * declared `writePolicy: "post-hoc"` (D0050).
     */
    writerSource?: WriteSource;
}
export declare class ApiGatewayArtifactWriter implements ArtifactWriter {
    private readonly options;
    private readonly metrics;
    private readonly writerSource;
    constructor(options: ApiGatewayArtifactWriterOptions);
    emit<T extends ArtifactType>(type: T, association: AssociationValues, payload: unknown): Promise<ArtifactRef | null>;
    appendNdjson(): Promise<ArtifactRef | null>;
    writeManifest(runId: RunId, manifest: RunManifest): Promise<ArtifactRef | null>;
    /** @deprecated Use `emit()` instead. */
    writeBulk(type: ArtifactType, runId: RunId, data: unknown): Promise<ArtifactRef | null>;
    /** @deprecated Use `emit()` per entry instead. */
    writePerEntry(type: ArtifactType, runId: RunId, entries: readonly ArtifactEntry[]): Promise<ArtifactRef | null>;
    private putJson;
    private putJsonRaw;
    private fetchSignedUrl;
}
