import { z } from "zod";
export declare const creationSourceSchema: z.ZodObject<{
    runId: z.ZodString;
    component: z.ZodEnum<{
        orchestrator: "orchestrator";
        detector: "detector";
        classifier: "classifier";
        store: "store";
        migration: "migration";
        import: "import";
        manual: "manual";
    }>;
    componentId: z.ZodOptional<z.ZodString>;
}, z.core.$strict>;
export type CreationSource = z.infer<typeof creationSourceSchema>;
export declare const recordEnvelopeSchema: z.ZodObject<{
    schemaVersion: z.ZodString;
    id: z.ZodString;
    creationSource: z.ZodObject<{
        runId: z.ZodString;
        component: z.ZodEnum<{
            orchestrator: "orchestrator";
            detector: "detector";
            classifier: "classifier";
            store: "store";
            migration: "migration";
            import: "import";
            manual: "manual";
        }>;
        componentId: z.ZodOptional<z.ZodString>;
    }, z.core.$strict>;
}, z.core.$strict>;
export type RecordEnvelope = z.infer<typeof recordEnvelopeSchema>;
export type SchemaErrorCode = "validation" | "unsupported-version" | "unknown-field";
export declare class SchemaError extends Error {
    readonly path: string;
    readonly reason: string;
    readonly code: SchemaErrorCode;
    constructor(path: string, reason: string, code: SchemaErrorCode);
}
export interface RecordCodec<T> {
    readonly schema: z.ZodType<T>;
    readonly currentVersion: string;
    readonly supportedVersions: readonly string[];
}
export declare function defineRecordCodec<T>(config: {
    schema: z.ZodType<T>;
    currentVersion: string;
    supportedVersions?: readonly string[];
}): RecordCodec<T>;
export declare function parseRecord<T>(codec: RecordCodec<T>, value: unknown): T;
//# sourceMappingURL=envelope.d.ts.map