/** Outcome of an auto-commit attempt. `skipped` means a swallowed git failure. */ export type CommitOutcome = "committed" | "nothing" | "skipped"; /** * True only when `dir` is itself the root of a git worktree — not merely a * subdirectory of some larger repo. Keying on the worktree root keeps augment * from injecting snapshot commits into an unrelated parent project. Any error * (not a repo, git missing) is a definitive "no". */ export declare function isMemoryRootGitRoot(dir: string): Promise; /** * Stage and commit the memory root's markdown changes as one snapshot. Never * throws and never pushes: any git failure is logged once and swallowed so an * auto-commit can never break the write that triggered it. Returns `nothing` * when there is nothing to snapshot (no empty commits) and `skipped` on failure. * * `message` overrides the default snapshot subject so a caller that performs a * whole logical pass in one shot (e.g. a sleep apply) can label it as one * commit; omitted, the `augment: snapshot …` default is used verbatim. */ export declare function commitMemoryChanges(dir: string, message?: string): Promise; /** A debounced, single-flight committer for one memory root. */ export interface GitCommitter { /** Request a snapshot; bursts coalesce into one commit after the debounce. */ notify(): void; /** Resolves once no commit is pending or in flight (for deterministic tests). */ idle(): Promise; /** Flush any pending commit and stop. */ close(): Promise; } /** * Wrap {@link commitMemoryChanges} in the shared debounced, single-flight * scheduler so a session-finish burst of writes yields exactly one snapshot and * two commits never run concurrently. */ export declare function createGitCommitter(memoryRoot: string, debounceMs?: number): GitCommitter;