/** The wrapper script's repo-relative install path. */ export declare const GATE_WRAPPER_REL = ".claude/hooks/gate-wrapper.cjs"; /** Enforcement tier baked into the installed command at install time. */ export type GateTier = 'strict' | 'pilot'; /** * Collision-safe gate-identity probe: does `command` install the gate for * EXACTLY this `event`? * * Tokenize on whitespace and require BOTH the wrapper basename AND the token * immediately after `--event` to equal `event`. A loose substring `includes` * would let `--event freeze-check` spuriously match a future * `--event freeze-check-extended`. The probe is tier-INDEPENDENT (it ignores * the baked `--strict` / `--pilot` flag), so it identifies the single existing * entry for a gate REGARDLESS of tier — the upsert then either no-ops (same * tier) or rewrites that one entry's command (tier switch), never duplicating. */ export declare function commandInstallsGate(command: string, event: string): boolean; /** * Outcome of a single gate install operation. * * Gate-specific (decoupled from `ScaffoldOutcome['action']`): it adds * `'updated'`, which the wrapper-scaffold step can never produce but the * tier-aware entry upsert can (re-installing a gate at a DIFFERENT tier * rewrites the one existing entry's command in place). * * - `created` — fresh file / wrapper written * - `merged` — a new entry appended to existing settings * - `updated` — an existing gate entry's command rewritten in place (tier * switch) — exactly one entry per gate, never duplicated * - `skipped` — idempotent no-op (same-tier re-install, or the wrapper's * `exists` outcome normalized at the boundary; both mean "no * change") */ export type GateInstallAction = 'created' | 'merged' | 'updated' | 'skipped'; export interface GateInstallResult { /** Repo-relative file the result pertains to. */ file: string; /** Outcome of the operation (see {@link GateInstallAction}). */ action: GateInstallAction; /** The gate event this result is for (entry results only). */ event?: string; err?: string; } /** * Install the gate wrapper script + one PreToolUse entry per `event` into the * given repo `cwd`. Returns one result per filesystem operation (the wrapper * scaffold, then one entry merge per gate) for caller-side summary reporting. * * `tier` (default `'strict'`) is BAKED into the installed command string at * install time — the wrapper reads it ONLY from argv (no env-var override), so * a default install is enforcement-immune to a consumer's environment. `pilot` * is an explicit install-time opt-in. * * `events` MUST already be validated against `knownGateEvents()` by the * caller (the verb / `--gates=` parser) — no default-install, fail-loud on * unknown happens upstream. */ export declare function installGates(cwd: string, events: string[], tier?: GateTier): GateInstallResult[]; //# sourceMappingURL=gate-install.d.ts.map