import type { HookCache, HookCacheConfig, HookMatches } from '../types.js';
/**
 * Parse a `cache:` value from hooks.yaml into the canonical config form.
 * Accepts the shorthand string ("5m", "30s-bg") or the full object form.
 * Returns null if the value is missing or unparseable.
 */
export declare function parseCacheConfig(raw: HookCache | undefined): HookCacheConfig | null;
/** Parse "30s" | "5m" | "1h" | "7d" | plain seconds. Returns seconds, or null on failure. */
export declare function parseDuration(d: number | string | undefined): number | null;
/**
 * Reject hook names that could escape the shims directory when interpolated
 * into a filename. Mirrors the containment gate on hook script resolution in
 * hooks.ts (`resolveContainedHookPath`).
 */
export declare function isValidHookShimName(name: string): boolean;
/** Absolute path of the generated shim for a hook name. */
export declare function getHookShimPath(name: string): string;
/**
 * Optional path overrides for tests that need to redirect cache + logs to a
 * temp dir. Production callers omit `paths`; the shim uses real state.ts dirs.
 * (state.ts captures HOME at module load, so mutating process.env.HOME in a
 * test's beforeEach doesn't reach getHookCacheDir() — this is the explicit
 * seam.)
 */
export interface HookShimPaths {
    shimsDir?: string;
    cacheDir?: string;
    logsDir?: string;
    /** Directory for the disposable perf warehouse + spool (default ~/.agents/.cache/perf). */
    perfDir?: string;
}
/**
 * Generate (or refresh) the shim script for a hook. Idempotent — only writes
 * when the content differs from what's on disk. Returns the absolute shim path.
 *
 * A shim is generated when the hook opts into caching (`cache`) and/or declares
 * `matches:` predicates. When `matches` is present the shim gates execution on
 * those predicates before running the underlying script (see `renderShim`);
 * when `cache` is absent the shim is a thin pass-through wrapper that only
 * applies the gate and forwards stdin/stdout unchanged.
 */
export declare function generateHookShim(args: {
    name: string;
    scriptPath: string;
    cache?: HookCacheConfig | null;
    matches?: HookMatches;
    paths?: HookShimPaths;
}): string;
/**
 * Remove a hook's shim. Called by the registrar's garbage collection when a
 * hook is renamed/deleted or has its `cache:` field removed.
 */
export declare function removeHookShim(name: string, shimsDir?: string): void;
