/**
 * Image archive module: upload pruned images to S3 or TOS (Volcengine Object
 * Storage) before they are replaced with placeholders in the JSONL transcript.
 *
 * Each archived image gets a unique placeholder PNG with the archive ID
 * embedded in a PNG tEXt metadata chunk, enabling precise restoration without
 * relying on positional assumptions.
 *
 * Archive records are appended to a sidecar JSONL file alongside the
 * transcript, keeping the transcript structure untouched.
 *
 * Configuration lives in `config.json` under the `imageArchive` key.
 * When absent, archiving is disabled and the pruner falls back to the
 * standard static placeholder.
 */
export interface ArchiveResult {
    archiveId: string;
    url: string;
    placeholderBase64: string;
    sha256: string;
    mediaType: string;
    originalSizeBytes: number;
    sessionId: string;
    archivedAt: string;
}
export interface SidecarRecord {
    archiveId: string;
    url: string;
    sha256: string;
    mediaType: string;
    originalSizeBytes: number;
    sessionId: string;
    transcriptPath: string;
    archivedAt: string;
}
export declare function resetArchiveConfigCache(): void;
/** Returns true when image archiving is configured and ready. */
export declare function isArchiveEnabled(): boolean;
/**
 * Generate a 1x1 transparent PNG with the archive ID embedded in a tEXt
 * metadata chunk.  The resulting PNG is ~100 bytes — negligible overhead.
 */
export declare function generatePlaceholderPng(archiveId: string): string;
/**
 * Extract the `vc-archive-id` value from a placeholder PNG's tEXt chunk.
 * Returns null if the PNG doesn't contain our marker.
 */
export declare function extractArchiveId(pngBase64: string): string | null;
/** Exported for testing: returns the number of pending failed uploads. */
export declare function countPendingFailedUploads(): number;
/**
 * Prepare an archive entry and start a background upload.
 *
 * Returns the archive result (including the custom placeholder) immediately
 * without waiting for the upload.  The upload runs fire-and-forget in the
 * background:
 *
 * - On **success**: the uploaded archive ID is logged and any previously
 *   failed uploads in the local fallback directory are drained.
 * - On **failure**: the original image bytes are saved to
 *   `<configDir>/failed-uploads/` alongside a `.meta.json` sidecar so the
 *   image can be retried on the next successful upload.
 *
 * Returns null only when archiving is not configured.
 */
export declare function archiveImage(base64Data: string, mediaType: string, sessionId: string): ArchiveResult | null;
/**
 * Append an archive record to the sidecar JSONL file.  Creates the file if
 * it does not exist.  Uses synchronous I/O so the caller is not blocked by
 * a promise — the sidecar is a small local append, not a network operation.
 */
export declare function appendToSidecar(sidecarPath: string, result: ArchiveResult, transcriptPath: string): void;
//# sourceMappingURL=image-archive.d.ts.map