import type { RetrievalReference } from "@oscharko-dev/keiko-contracts";
import { QualityIntelligence } from "@oscharko-dev/keiko-contracts";
type CapsuleEnvelope = QualityIntelligence.QualityIntelligenceLocalKnowledgeCapsuleEnvelope;
export type QiHandoffErrorCode = "EMPTY_REFERENCE" | "EMPTY_HASH_TABLE" | "INVALID_INTEGRITY_HASH" | "INVALID_REGISTERED_AT" | "MISSING_INTEGRITY_HASH";
export declare class QiHandoffError extends Error {
    readonly code: QiHandoffErrorCode;
    constructor(code: QiHandoffErrorCode, message: string);
}
export interface BuildCapsuleEnvelopesInput {
    /** ISO 8601 UTC timestamp the consumer captured for envelope provenance. */
    readonly registeredAt: string;
    /** Retrieval references from `keiko-local-knowledge` for a single capsule query. */
    readonly references: readonly RetrievalReference[];
    /**
     * SHA-256 hex digest table keyed by the citation chunkId. The adapter rejects any
     * reference whose chunkId has no matching digest with `MISSING_INTEGRITY_HASH`.
     */
    readonly integrityHashByChunkId: Readonly<Record<string, string>>;
    /**
     * Caller-pre-validated id prefix. Each envelope id is `${idPrefix}:${chunkId}`. The
     * contract validator (asQualityIntelligenceSourceEnvelopeId) rejects forbidden
     * fragments — callers must guarantee the prefix passes those rules.
     */
    readonly idPrefix: string;
}
/**
 * Convert a list of `RetrievalReference` into local-knowledge-capsule envelopes. Pure.
 *
 * Each envelope's `localRef` is the citation chunkId (an opaque local-knowledge
 * identifier, never a URL or a path). The envelope display label combines the
 * capsule's `safeDisplayName` with the chunkId so the audit ledger has a
 * non-secret descriptor.
 */
export declare const buildCapsuleSourceEnvelopes: (input: BuildCapsuleEnvelopesInput) => readonly CapsuleEnvelope[];
export {};
//# sourceMappingURL=qiHandoff.d.ts.map