import type { CanonicalStateEventV1 } from "../task-state-events/canonical-state-events.js";
import type { TaskStateProjectionV1 } from "../task-state-events/projection-types.js";
export type PublishTaskStateEventsInput = {
    workspacePath: string;
    branch?: string;
    events: CanonicalStateEventV1[];
    /** Tip SHA the writer observed before building events (after fetch). */
    expectedHeadSha: string;
    /** Per-task version the writer observed for every task touched by `events`. */
    expectedTaskVersions: Record<string, number>;
    maxAttempts?: number;
    push?: boolean;
};
export type PublishTaskStateEventsSuccess = {
    ok: true;
    headSha: string;
    publishedEvents: CanonicalStateEventV1[];
    attempts: number;
    branch: string;
};
export type PublishTaskStateEventsFailure = {
    ok: false;
    code: string;
    message: string;
    data?: Record<string, unknown>;
};
export type PublishTaskStateEventsResult = PublishTaskStateEventsSuccess | PublishTaskStateEventsFailure;
export declare function taskIdsTouchedByEvent(event: CanonicalStateEventV1): string[];
export declare function taskVersionMapFromProjection(projection: TaskStateProjectionV1): Map<string, number>;
export declare function detectTaskVersionConflict(input: {
    expectedTaskVersions: Record<string, number>;
    remoteVersions: Map<string, number>;
    events: CanonicalStateEventV1[];
}): {
    taskId: string;
    expected: number;
    actual: number;
} | null;
export declare function assignEventSequences(drafts: CanonicalStateEventV1[], head: {
    latestSequence: number;
    latestEventId: string | null;
}): CanonicalStateEventV1[];
export declare function publishTaskStateEvents(input: PublishTaskStateEventsInput): Promise<PublishTaskStateEventsResult>;
/** Git-backed canonical event log publisher (Phase 115 S5.1). */
export declare class GitTaskEventStore {
    private readonly workspacePath;
    private readonly branch;
    constructor(workspacePath: string, branch?: string);
    publish(input: Omit<PublishTaskStateEventsInput, "workspacePath" | "branch">): Promise<PublishTaskStateEventsResult>;
}
