import type { GuardReport, GuardWarning, VersionGuardConfig } from './types'; export type { GuardReport, GuardWarning } from './types'; /** * Checks whether git hooks have been redirected away from the repository. * * @remarks * When `core.hooksPath` is set to a non-default location, git hooks installed * in `.git/hooks/` are silently ignored. This is a common bypass vector. * * @param cwd - Repository directory to inspect. * @returns A guard warning when a hooksPath override is detected. * * @example * ```ts * import { checkHooksPathOverride } from './guard'; * * const warning = checkHooksPathOverride(process.cwd()); * if (warning) console.warn(warning.message); * ``` * * @public * @since 0.2.0 */ export declare function checkHooksPathOverride(cwd: string): GuardWarning | null; /** * Checks whether the HUSKY environment variable is disabling hooks. * * @remarks * Setting `HUSKY=0` is a documented way to disable Husky hooks. Since * VersionGuard hooks may run alongside or through Husky, this bypass * can silently disable enforcement. * * @returns A guard warning when the HUSKY bypass is detected. * * @example * ```ts * import { checkHuskyBypass } from './guard'; * * const warning = checkHuskyBypass(); * if (warning) console.warn(warning.message); * ``` * * @public * @since 0.2.0 */ export declare function checkHuskyBypass(): GuardWarning | null; /** * Verifies that installed hook scripts match the expected content. * * @remarks * This compares each hook file against what `generateHookScript` would produce. * Tampered hooks that still contain "versionguard" pass `areHooksInstalled` but * may have had critical lines removed or modified. * * @param config - VersionGuard configuration that defines which hooks should exist. * @param cwd - Repository directory to inspect. * @returns Guard warnings for each hook that has been tampered with. * * @example * ```ts * import { checkHookIntegrity } from './guard'; * * const warnings = checkHookIntegrity(config, process.cwd()); * for (const w of warnings) console.warn(w.code, w.message); * ``` * * @public * @since 0.2.0 */ export declare function checkHookIntegrity(config: VersionGuardConfig, cwd: string): GuardWarning[]; /** * Checks whether hooks are configured as required but not enforced. * * @remarks * When hooks are enabled in the config but `enforceHooks` is false, validation * will not fail for missing hooks. In strict mode this is a policy gap. * * @param config - VersionGuard configuration to inspect. * @returns A guard warning when hooks are enabled but not enforced. * * @example * ```ts * import { checkEnforceHooksPolicy } from './guard'; * * const warning = checkEnforceHooksPolicy(config); * if (warning) console.warn(warning.message); * ``` * * @public * @since 0.2.0 */ export declare function checkEnforceHooksPolicy(config: VersionGuardConfig): GuardWarning | null; /** * Runs all guard checks and returns a consolidated report. * * @remarks * This is the primary entry point for strict mode. It runs every detection * check and returns a report indicating whether the repository is safe from * known bypass patterns. * * @param config - VersionGuard configuration. * @param cwd - Repository directory to inspect. * @returns A guard report with all findings. * * @example * ```ts * import { runGuardChecks } from './guard'; * * const report = runGuardChecks(config, process.cwd()); * if (!report.safe) console.error('Guard check failed:', report.warnings); * ``` * * @public * @since 0.2.0 */ export declare function runGuardChecks(config: VersionGuardConfig, cwd: string): GuardReport; //# sourceMappingURL=guard.d.ts.map