import { type VerifyResult } from "./run.js"; export declare const EXPORT_SCHEMA = "humanish.export-result.v1"; /** Past this the file stops being a thing you attach to an email. Declared, never silent. */ export declare const DEFAULT_EXPORT_MAX_BYTES: number; export interface ExportResult { schema: typeof EXPORT_SCHEMA; ok: true; cwd: string; runId: string; format?: "bundle"; /** Repo-relative path of the file written. */ path: string; bytes: number; embeddedImages: number; shareSafety: VerifyResult["shareSafety"]; /** True when --local-only exported a bundle that is not share_ready; the file carries a banner. */ watermarked: boolean; warnings: string[]; } export interface ExportFailure { schema: typeof EXPORT_SCHEMA; ok: false; cwd: string; run: string; shareSafety?: VerifyResult["shareSafety"]; error: { code: "HUMANISH_EXPORT_RUN_NOT_FOUND" | "HUMANISH_EXPORT_VERIFY_FAILED" | "HUMANISH_EXPORT_SHARE_SAFETY_BLOCKED" | "HUMANISH_EXPORT_NO_OBSERVER" | "HUMANISH_EXPORT_TOO_LARGE" | "HUMANISH_EXPORT_INVALID_OPTIONS" | "HUMANISH_EXPORT_OUTPUT_EXISTS" | "HUMANISH_EXPORT_BUNDLE_REFUSED"; message: string; }; } export interface ExportOptions { format?: "html" | "bundle"; redactScreenshots?: boolean; out?: string; localOnly?: boolean; maxBytes?: number; } export interface ExportDeps { /** Injected in tests: a fake verify with a chosen shareSafety, no full bundle needed. */ verify?: (cwd: string, run: string) => Promise; /** Injected in tests: renders observer/index.html for a run that has none. Defaults to renderObserver. */ render?: (cwd: string, run: string) => Promise<{ ok: boolean; }>; } /** The banner a --local-only export carries. Plain HTML, before the app root, so it renders with JS off. */ export declare function localOnlyBanner(reasons: string[]): string; export declare function exportRun(cwdInput: string, runInput: string, options?: ExportOptions, deps?: ExportDeps): Promise; export declare function formatExportHuman(result: ExportResult | ExportFailure): string;