UNPKG

@kya-os/cli

Version:

CLI for MCP-I setup and management

47 lines 2.12 kB
export declare const HOOK_MARKER = "# mcpi-dco-hook"; export interface GitIdentity { name: string; email: string; } export declare function isGitRepo(cwd: string): Promise<boolean>; export declare function getGitConfigValue(key: string, cwd: string, scope?: "local" | "global"): Promise<string | null>; export declare function setGitConfig(entries: Record<string, string>, options: { cwd: string; global?: boolean; }): Promise<void>; export interface SigningConflict { key: string; current: string; desired: string; } /** * Detect pre-existing signing configuration that our setup would silently * override, e.g. a user who already GPG-signs commits. Only differing values * count; matching values mean a previous run and are fine to reapply. * * `scope` selects which config layer to read: the default (undefined) reads * the effective value; "local" reads only repo-local entries, which is how a * `--global` write detects repo-local values that would still shadow it. */ export declare function detectSigningConflicts(cwd: string, desired: Record<string, string>, scope?: "local" | "global"): Promise<SigningConflict[]>; export interface HooksDirInfo { dir: string; source: "core.hooksPath" | "default"; } export declare function getHooksDir(cwd: string): Promise<HooksDirInfo>; export declare function buildTrailerHook(human: GitIdentity, agent: GitIdentity): string; export type HookInstallResult = "installed" | "updated" | "unchanged" | "foreign-hook" | "unsafe-hooks-path" | "would-change"; /** * Install (or refresh) the prepare-commit-msg trailer hook. A hook we did not * write is never modified, and a core.hooksPath pointing outside the repo is * never written to (a crafted repo config must not make us create files at * arbitrary locations); the caller falls back to instruction-based trailers * in both cases. */ export declare function installTrailerHook(cwd: string, human: GitIdentity, agent: GitIdentity, options?: { dryRun?: boolean; }): Promise<{ result: HookInstallResult; path: string; }>; //# sourceMappingURL=git-config.d.ts.map