export declare const MAX_WORKSPACE_DIFF_BYTES: number; export type WorkspaceDiffErrorReason = "git_missing" | "git_failed" | "too_large"; export declare class WorkspaceDiffError extends Error { readonly reason: WorkspaceDiffErrorReason; constructor(reason: WorkspaceDiffErrorReason, message: string, options?: { cause?: unknown; }); } /** Initialize a throwaway git repo at {@link gitDir}, commit the workspace, return the SHA. */ export declare function captureWorkspaceBaseline(workDir: string, gitDir: string): Promise; /** * Pre-execution HEAD ref for {@link computeWorkspacePatchFastPath}. Captured * before the agent runs so HEAD drift (commits/checkouts) doesn't affect the diff. */ export interface FastPathBaseline { /** 40-char hex SHA of HEAD, confirmed clean at capture time. */ readonly ref: string; } /** * Record the current HEAD SHA if the workspace is clean. * * Cleanliness is judged through the same throwaway `--git-dir` that * {@link computeWorkspacePatchFastPath} diffs through, so both sides compare * raw bytes. A workspace whose blobs were normalized on the way in (a * `.gitattributes` clean filter such as `nbstripout`, `git-crypt` or LFS) * therefore reads dirty and yields to the snapshot baseline, which is * filter-agnostic by construction. Judging cleanliness through the workspace's * own config instead would let such a repo pass as clean and then report its * pre-existing content as agent additions. * * Returns `undefined` when the workspace has uncommitted changes, has no * commits, or git is unavailable. Must be called **before** the agent runs. */ export declare function captureFastPathBaseline(workDir: string): Promise; /** * Diff the workspace against `baselineRef` through a throwaway `--git-dir` * (see {@link createIsolatedGitDir}), leaving the workspace's index and object * database untouched. * * Requires a clean pre-execution baseline from {@link captureFastPathBaseline} * and a git repository at `workDir`; throws {@link WorkspaceDiffError} * otherwise. Callers are responsible for routing to {@link computeWorkspaceDiff} * when no repository is present — this function does not fall back on its own. */ export declare function computeWorkspacePatchFastPath(workDir: string, baselineRef: string): Promise; /** Return the unified diff between {@link baselineRef} and the current workspace state. */ export declare function computeWorkspaceDiff(gitDir: string, workDir: string, baselineRef: string, options?: { maxBuffer?: number; }): Promise; //# sourceMappingURL=workspace-diff.d.ts.map