import { type HookBackend, type HookFilterValue, type HookResultMode, type HookRun, type HookSource } from './hook-registry.js'; /** The writable surface of a declaration: everything except `id` and `version`. */ export interface HookEntryDraft { event: string; matcher?: string | Record; run: HookRun; scope?: { backends?: HookBackend[]; requiresTool?: string; }; blocking?: { mode: 'webhook'; ttlMin: number; }; result?: HookResultMode; enabled?: boolean; } export interface HookStateResult { changed: boolean; filePath: string; source: HookSource; /** Set when the change is not durable — a managed entry restored by the next sync. */ warning?: string; } export interface HookCreateResult { id: string; filePath: string; } export interface HookRemoveResult { removed: boolean; } export declare const MANAGED_RESYNC_WARNING = "A managed hook sync that deploys a newer version will restore the shipped enabled state."; /** * Flip `enabled` on one registry declaration, preserving every other field including `version`. * Managed entries are allowed here (unlike edit/remove) because the toggle is the one change the * sync can meaningfully round-trip — but the caller is told the change is temporary. */ export declare function setHookEnabled(directory: string | undefined, id: string, enabled: boolean): HookStateResult; /** Write a new user declaration as `50-.json`. Never stamps a version. */ export declare function createHookEntry(directory: string | undefined, draft: HookEntryDraft & { id: string; }): HookCreateResult; /** * Replace the body of one user declaration in place. The draft is the complete desired state, so * omitted optional fields are removed rather than merged — the UI always holds the whole entry. */ export declare function updateHookEntry(directory: string | undefined, id: string, draft: HookEntryDraft): HookStateResult; /** Delete one user declaration file. */ export declare function removeHookEntry(directory: string | undefined, id: string): HookRemoveResult;