export declare const MIGRATOR_IDENTITY: { readonly name: "quonfig migrator"; readonly email: "migrator@quonfig.com"; }; export interface PushIdentity { email: string; name: string; } /** * A single commit to apply on top of the cloned local tree. `apply` writes/deletes * files; it must NOT commit. cloneAndStackPush stages and commits with the given * author + optional author date. */ export interface CommitSpec { /** File operations to perform in `localDir` before this commit is staged. */ apply: (localDir: string) => Promise | void; /** Commit author. Defaults to the migrator identity. */ author?: PushIdentity; /** * Optional author/committer date. Passed via GIT_AUTHOR_DATE + * GIT_COMMITTER_DATE. Any value `new Date(...)` accepts. Omit to use "now". */ authorDate?: Date | number | string; /** * Commit message. May be a function when the message depends on counts that * are only known after `apply` runs (qfg-7eig). */ message: string | (() => string); } export interface CloneAndStackPushOptions { /** Branch to track and push. Defaults to `main`. */ branch?: string; /** * One or more commits to layer onto the clone. Commits are applied + committed * in order; commits whose `apply` produces no staged changes are silently * skipped (no empty commits). All non-empty commits are pushed in a single * `git push`. */ commits: CommitSpec[]; /** Where to clone into, or an existing clone to reuse. */ localDir: string; /** Gitea repo URL (may include token). */ remoteUrl: string; } export interface CloneAndStackPushResult { /** `'cloned'` if we had to clone fresh, `'reused'` if the local dir was already a clone of the remote. */ action: 'cloned' | 'reused'; /** SHA of the LAST commit landed (back-compat alias for the final entry in commitShas). Null when no commit landed. */ commitSha: string | null; /** SHAs of every commit landed, in order. Empty when no commit landed. */ commitShas: string[]; /** `false` if every commit's `apply` produced no changes — nothing was committed or pushed. */ committed: boolean; } export declare class PushConflictError extends Error { constructor(message: string); } export declare class PushHookRejectedError extends Error { constructor(message: string); } /** * Apply + commit a sequence of CommitSpecs against an existing repo at `localDir`. * Per-commit author/date come from each spec (defaults to migrator identity, "now"). * Empty commits — where `apply` produces no staged changes — are silently skipped. * Does NOT clone, fetch, or push: callers handle network I/O. Used by * `cloneAndStackPush` for cloud pushes and by the local migrator for `--full-summary` * imports into a `git init`-ed dir. */ export declare const stackCommits: (localDir: string, commits: CommitSpec[]) => Promise<{ commitShas: string[]; }>; export declare const cloneAndStackPush: (opts: CloneAndStackPushOptions) => Promise;