import type { TaskStateEventV1 } from "./event-payloads.js";
import type { TaskStateProjectionV1 } from "./projection-types.js";
export type TaskStateEventAdmissionErrorCode = "unsupported-schema-version" | "unknown-event-kind" | "schema-validation-failed" | "duplicate-idempotency-key" | "invalid-lifecycle-transition" | "duplicate-task-id" | "task-not-found" | "replay-conflict";
export type TaskStateEventAdmissionError = {
    code: TaskStateEventAdmissionErrorCode;
    message: string;
    details?: string[];
};
export type TaskStateEventAdmissionContext = {
    /** Events already admitted to the canonical stream (in sequence order). */
    priorEvents?: TaskStateEventV1[];
    /** When the branch stores a bootstrap snapshot with no tail events yet, seed replay from snapshot. */
    initialProjection?: TaskStateProjectionV1;
};
/**
 * Fail malformed or unsupported events before they enter canonical history.
 */
export declare function admitTaskStateEvent(input: unknown, context?: TaskStateEventAdmissionContext): {
    ok: true;
    event: TaskStateEventV1;
} | {
    ok: false;
    error: TaskStateEventAdmissionError;
};
/** Admit a batch in deterministic sequence order (mutates nothing; validates append chain). */
export declare function admitTaskStateEventStream(inputs: unknown[], options?: {
    priorEvents?: TaskStateEventV1[];
    initialProjection?: TaskStateProjectionV1;
}): {
    ok: true;
    events: TaskStateEventV1[];
} | {
    ok: false;
    error: TaskStateEventAdmissionError;
};
