import * as readline from 'node:readline/promises';
export declare const TOTEM_HOOK_MARKER = "[totem] post-merge hook";
export declare const TOTEM_HOOK_END = "[totem] end post-merge";
export declare const TOTEM_CHECKOUT_MARKER = "[totem] post-checkout hook";
export declare const TOTEM_CHECKOUT_END = "[totem] end post-checkout";
export declare const TOTEM_PRECOMMIT_MARKER = "[totem] pre-commit hook";
export declare const TOTEM_PREPUSH_MARKER = "[totem] pre-push hook";
/**
 * Determine the package-manager fallback command for invoking totem.
 * Used inside the runtime resolve block when `totem` is not on PATH.
 *
 * Priority: pnpm > yarn > bun > npx (with package.json) > bare totem.
 */
export declare function getFallbackCommand(cwd: string): string;
/** @deprecated Use {@link getFallbackCommand} instead. Kept for backwards compatibility. */
export declare function detectTotemPrefix(cwd: string): string;
/**
 * Build a POSIX shell block that resolves the totem command at runtime.
 *
 * Prefers the lockfile-pinned / in-tree build over a volatile ambient global
 * (mmnto-ai/totem#2053; Tenet 14 — never tie governance to volatile state). Order:
 * workspace-HEAD > pinned `node_modules/@mmnto/cli` > `pnpm exec` > PATH global > dlx fallback.
 * Each pinned tier is identity-guarded on the `@mmnto/cli` package (not a bare `totem` bin name,
 * which a colliding package could shadow).
 * A stale global shadowing a newer workspace build is the `lesson-1ef06d16` foot-gun this
 * order prevents. Sets TOTEM_CMD="" when unavailable — callers must guard with
 * `[ -n "$TOTEM_CMD" ]`. Never exits early, to avoid killing chained user hooks.
 */
export declare function buildResolveBlock(fallbackCmd: string): string;
export declare function buildHookContent(fallbackCmd: string): string;
export declare function buildPostCheckoutHookContent(fallbackCmd: string): string;
/**
 * Generate helper shell scripts under `.totem/hooks/` for hook manager integration.
 * These scripts contain the full guard logic (diff checks, null-SHA guards) that
 * bare inline commands would skip.
 */
export declare function generateHookHelpers(gitRoot: string, fallbackCmd: string, options?: {
    tier?: 'strict' | 'standard';
}): void;
export declare function installPostMergeHook(cwd: string, rl: readline.Interface, options?: {
    tier?: 'strict' | 'standard';
}): Promise<void>;
export declare function buildPreCommitHook(tier?: 'strict' | 'standard'): string;
export declare function buildPrePushHook(fallbackCmd: string, tier?: 'strict' | 'standard'): string;
/**
 * Install a single git hook with idempotency and chain preservation.
 * Returns the action taken.
 */
export declare function installGitHook(hooksDir: string, hookName: string, hookContent: string, marker: string, force?: boolean): 'installed' | 'exists' | 'appended' | 'skipped-non-shell' | 'overwritten';
export interface EnforcementHookResult {
    preCommit: 'installed' | 'exists' | 'appended' | 'skipped' | 'skipped-non-shell' | 'overwritten';
    prePush: 'installed' | 'exists' | 'appended' | 'skipped' | 'skipped-non-shell' | 'overwritten';
}
/**
 * Install pre-commit (block main) and pre-push (totem lint) hooks.
 * Respects hook managers by printing guidance instead of writing raw hooks.
 * Returns actions taken for reporting in init summary.
 */
export declare function installEnforcementHooks(cwd: string, rl: readline.Interface, options?: {
    tier?: 'strict' | 'standard';
}): Promise<EnforcementHookResult>;
export declare function installHooksCommand(): Promise<void>;
export interface HooksCommandResult {
    preCommit: 'installed' | 'exists' | 'appended' | 'skipped-non-shell' | 'overwritten';
    prePush: 'installed' | 'exists' | 'appended' | 'skipped-non-shell' | 'overwritten';
    postMerge: 'installed' | 'exists' | 'appended' | 'skipped-non-shell' | 'overwritten';
    postCheckout: 'installed' | 'exists' | 'appended' | 'skipped-non-shell' | 'overwritten';
}
/**
 * Non-interactive hook installer for `totem hooks` and `prepare` scripts.
 * Installs pre-commit, pre-push, and post-merge hooks without prompting.
 */
export declare function installHooksNonInteractive(cwd: string, force?: boolean, options?: {
    tier?: 'strict' | 'standard';
}): HooksCommandResult | null;
/**
 * Check that all Totem hooks are installed. Returns true if all present.
 */
export declare function checkHooksInstalled(cwd: string): boolean;
/**
 * CLI entrypoint for `totem hooks [--check]`.
 */
export declare function hooksCommand(opts: {
    check?: boolean;
    force?: boolean;
    strict?: boolean;
    standard?: boolean;
}): Promise<void>;
/**
 * Silently upgrade the pre-push hook if it was installed by Totem but uses
 * an old format (flag-checking or command-executing) instead of the new
 * stateless format that runs verify-manifest + lint directly.
 *
 * Returns true if the hook was upgraded, false otherwise.
 */
export declare function upgradePrePushHookIfNeeded(cwd: string): boolean;
//# sourceMappingURL=install-hooks.d.ts.map