/**
 * Git sync module: all git/gh CLI interactions for GitHub docs backup.
 * Lifted from packages/openwriter/server/git-sync.ts into the github plugin.
 *
 * Uses child_process.execFile with an argv array and NO shell (MCP-1): values
 * are passed to git/gh as literal arguments, never interpreted by a shell.
 * The GitHub PAT is supplied to authenticated pushes out-of-band via an
 * inline credential helper reading from an env var (MCP-3) — it is never
 * embedded in the remote URL, written to .git/config, or placed in argv.
 * Server-internal modules (state, helpers, ws) accessed via getServerModules().
 */
export type SyncState = 'unconfigured' | 'synced' | 'pending' | 'syncing' | 'error';
export interface SyncStatus {
    state: SyncState;
    lastSyncTime?: string;
    pendingFiles?: number;
    error?: string;
}
export interface SyncCapabilities {
    gitInstalled: boolean;
    ghInstalled: boolean;
    ghAuthenticated: boolean;
    existingRepo: boolean;
    remoteUrl?: string;
}
/**
 * Strip any embedded credentials (PAT / user:pass) from a git remote URL so a
 * credential-bearing URL is never returned to a client or logged. SSH scp-style
 * remotes (git@github.com:owner/repo.git) carry no secret and are left as-is.
 */
export declare function sanitizeRemoteUrl(url: string): string;
export declare function isGitInstalled(): Promise<boolean>;
export declare function isGhInstalled(): Promise<boolean>;
export declare function isGhAuthenticated(): Promise<boolean>;
export declare function isGitRepo(): Promise<boolean>;
export interface PendingFile {
    status: 'added' | 'modified' | 'deleted' | 'renamed';
    file: string;
}
export declare function getPendingFiles(): Promise<PendingFile[]>;
export declare function getSyncStatus(): Promise<SyncStatus>;
export declare function getCapabilities(): Promise<SyncCapabilities>;
export declare function setupWithGh(repoName: string, isPrivate: boolean): Promise<void>;
export declare function setupWithPat(pat: string, repoName: string, isPrivate: boolean): Promise<void>;
export declare function connectExisting(remoteUrl: string, pat?: string): Promise<void>;
export declare function pushSync(onStatus: (status: SyncStatus) => void): Promise<SyncStatus>;
