@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
18 lines • 1.27 kB
TypeScript
export declare const REPOSITORY_IDENTITY_ENTRY_TYPE = "repository-identity";
export interface RepositoryIdentity {
readonly rootCommits: readonly string[];
readonly originUrl?: string;
}
export type RepositoryMatch = "same" | "different" | "unknown";
export type GitRunner = (dir: string, args: readonly string[]) => Promise<string | undefined>;
export declare function readRepositoryIdentity(dir: string, run?: GitRunner): Promise<RepositoryIdentity | undefined>;
/** `git@host:owner/repo.git`, `ssh://git@host:22/owner/repo`, and `https://host/owner/repo` all become `host/owner/repo`. */
export declare function normalizeRemoteUrl(url: string): string;
/**
* Two checkouts are the same repository when their histories share a root commit. Without commits on
* either side the origin remote decides. Anything less is "unknown", never a guess.
*/
export declare function compareRepositoryIdentities(a: RepositoryIdentity | undefined, b: RepositoryIdentity | undefined): RepositoryMatch;
export declare function parseRepositoryIdentity(value: unknown): RepositoryIdentity | undefined;
export declare function sameRepositoryIdentity(a: RepositoryIdentity | undefined, b: RepositoryIdentity | undefined): boolean;
//# sourceMappingURL=repository-identity.d.ts.map