@phren/cli
Version:
Knowledge layer for AI agents - CLI, MCP server, and data layer
32 lines (31 loc) • 1.72 kB
TypeScript
import type { RunStoreGit } from "./store-merge.js";
export declare const AUTH_BACKOFF_INITIAL_MS: number;
export declare const AUTH_BACKOFF_MAX_MS: number;
export declare const AUTH_UNREGISTER_AFTER_MS: number;
export interface StoreAuthFailure {
remote: string;
remoteName: string;
remoteFingerprint?: string;
firstFailedAt: number;
lastFailedAt: number;
failures: number;
retryAt: number;
firstError?: string;
environment?: string;
}
export declare function isGitAuthFailure(error: unknown): boolean;
export declare function readStoreAuthFailure(cwd: string): StoreAuthFailure | undefined;
export declare function clearStoreAuthFailure(cwd: string): void;
/** Read Git's effective URL, including insteadOf rewrites, without contacting it. */
export declare function storeSyncRemote(cwd: string, name?: string, push?: boolean): {
remoteName: string;
remote: string;
} | undefined;
/** Changing the configured remote immediately releases the old credential block. */
export declare function activeStoreAuthFailure(cwd: string, state?: StoreAuthFailure | undefined): StoreAuthFailure | undefined;
export declare function authBackoffActive(state: StoreAuthFailure | undefined, now?: number): boolean;
export declare function storeAuthDetail(state: StoreAuthFailure): string;
export declare function storeAuthDoctorDetail(state: StoreAuthFailure): string;
export declare function recordStoreAuthFailure(cwd: string, remoteName: string, remote: string, now?: number, error?: unknown): StoreAuthFailure;
/** Only transport failures affect credentials; local merge errors never do. */
export declare function withStoreAuthBackoff(git: RunStoreGit, now?: () => number): RunStoreGit;