import type { ContextPack } from "@oscharko-dev/keiko-contracts";
import { QualityIntelligence } from "@oscharko-dev/keiko-contracts";
import { type SourceMixPlan } from "./sourceMixPlanning.js";
type RepoEnvelope = QualityIntelligence.QualityIntelligenceRepositoryContextEnvelope;
export type WorkspaceAdapterErrorCode = "ABSOLUTE_PATH" | "PATH_TRAVERSAL" | "EMPTY_PATH" | "INVALID_INTEGRITY_HASH" | "INVALID_REGISTERED_AT";
export declare class WorkspaceAdapterError extends Error {
    readonly code: WorkspaceAdapterErrorCode;
    constructor(code: WorkspaceAdapterErrorCode, message: string);
}
export interface BuildWorkspaceEnvelopesInput {
    /**
     * Display-only label naming the workspace (e.g. "main", "feature/foo"). Not a path,
     * not a URL; carried only into envelope `displayLabel` and `provenance.origin`.
     */
    readonly workspaceLabel: string;
    /**
     * ISO 8601 UTC timestamp the consumer captured when assembling the pack. The QI
     * ingestion sub-namespace deliberately refuses to read the clock so callers stay
     * deterministic.
     */
    readonly registeredAt: string;
    readonly contextPack: ContextPack;
    /**
     * Caller-supplied SHA-256 hex digest table keyed by the context-entry path. The
     * adapter rejects any entry without a matching digest with `INVALID_INTEGRITY_HASH`.
     */
    readonly integrityHashByEntryPath: Readonly<Record<string, string>>;
    /**
     * Optional id-prefix the caller pre-allocates (e.g. "qi-src-ws-1234"). Each envelope's
     * id is `${idPrefix}:${entry.path}`; the contract validator (asQualityIntelligence-
     * SourceEnvelopeId) rejects forbidden fragments — callers must pre-validate the
     * prefix.
     */
    readonly idPrefix: string;
}
/**
 * Convert a workspace `ContextPack` into a list of repository-context source envelopes,
 * one per context entry. Pure, no IO.
 *
 * Rejects:
 *   * absolute paths or paths containing `..` segments
 *   * missing or non-hex-64 integrity hashes
 *   * malformed `registeredAt` timestamps
 */
export declare const buildWorkspaceSourceEnvelopes: (input: BuildWorkspaceEnvelopesInput) => readonly RepoEnvelope[];
/**
 * Convenience: build envelopes AND run the deterministic mix planner so the consumer
 * gets the policy-ordered planner output in a single call. Pure.
 */
export declare const workspaceSourceMixPolicy: (input: BuildWorkspaceEnvelopesInput) => {
    readonly envelopes: readonly RepoEnvelope[];
    readonly plan: SourceMixPlan;
};
export {};
//# sourceMappingURL=workspaceAdapter.d.ts.map