import type { TaskStateGitManifestV1 } from "./types.js";
import { type GitRunResult } from "./git-io.js";
export type TaskStateBranchLayout = {
    ref: string;
    tipSha: string;
    manifest: TaskStateGitManifestV1;
    eventSegmentPaths: string[];
};
export declare function readTaskStateBranchLayout(cwd: string, ref: string, tipSha: string): {
    ok: true;
    layout: TaskStateBranchLayout;
} | {
    ok: false;
    code: string;
    message: string;
};
export declare function readEventSegmentsJsonl(cwd: string, ref: string, segmentPaths: string[]): {
    ok: true;
    lines: string[];
} | {
    ok: false;
    code: string;
    message: string;
};
export declare function segmentPathsThroughHead(manifest: TaskStateGitManifestV1): string[];
export declare function gitRefTipSha(cwd: string, ref: string): string | null;
export type { GitRunResult };
