import { type HookAuthority, HookEventKind, type HookExecutionContract, HookSourceConvention } from "./events"; export declare const HookDiagnosticSeverity: { readonly Error: "error"; readonly Warning: "warning"; }; export type HookDiagnosticSeverity = (typeof HookDiagnosticSeverity)[keyof typeof HookDiagnosticSeverity]; export declare const HookDiagnosticCode: { readonly UnsupportedConventionEvent: "unsupported_convention_event"; readonly UnrecognizedPluginEvent: "unrecognized_plugin_event"; readonly InvalidPluginPhase: "invalid_plugin_phase"; readonly InvalidToolMatcher: "invalid_tool_matcher"; readonly InvalidSource: "invalid_source"; readonly InvalidCommand: "invalid_command"; readonly DuplicateHook: "duplicate_hook"; readonly InProcessEventOutsideIr: "in_process_event_outside_hook_ir"; readonly SemanticMismatch: "semantic_mismatch"; }; export type HookDiagnosticCode = (typeof HookDiagnosticCode)[keyof typeof HookDiagnosticCode]; export interface HookNormalizationDiagnostic { severity: HookDiagnosticSeverity; code: HookDiagnosticCode; message: string; convention: HookSourceConvention; externalEvent?: string; canonicalKind?: HookEventKind; source?: string; } export interface NormalizedHook { kind: HookEventKind; authority: HookAuthority; convention: HookSourceConvention; runtimeEvent: string; toolName: string; source: string; contract: HookExecutionContract; } export interface NormalizeHookResult { hook: NormalizedHook | null; diagnostics: HookNormalizationDiagnostic[]; } export declare function resolveExecutionContract(convention: HookSourceConvention, kind: HookEventKind): HookExecutionContract | null; export declare function resolveAuthority(convention: HookSourceConvention, kind: HookEventKind): HookAuthority | null; export declare function resolveCanonicalKind(externalEvent: string): HookEventKind | null; export declare function unsupportedEventDiagnostic(convention: HookSourceConvention, externalEvent: string, canonicalKind: HookEventKind | null, source?: string): HookNormalizationDiagnostic; /** Tool identifiers are logical, case-sensitive runtime names, not filesystem paths. */ export declare function normalizeToolMatcher(toolName: unknown): string | null; export interface DirectoryHookInput { convention: HookSourceConvention; phase: "pre" | "post"; toolName: string; source: string; /** Original discovered filename, when normalization participates in discovery. */ externalName?: string; } /** Normalize discovery metadata for native, Claude, or Codex hook modules. */ export declare function normalizeDirectoryHook(input: DirectoryHookInput): NormalizeHookResult; export interface ManagedJsonHookInput { externalEvent: string; command: string; source: string; } /** Normalize the two GJC-managed Codex hooks.json entries. */ export declare function normalizeManagedJsonHook(input: ManagedJsonHookInput): NormalizeHookResult; export interface PluginHookInput { declaredEvent: string; target?: unknown; phase?: unknown; plugin: string; source: string; } /** Normalize only manifest shapes that the constrained plugin compiler accepts. */ export declare function normalizePluginHook(input: PluginHookInput): NormalizeHookResult; export interface InProcessHookInput { registeredEvent: string; source: string; } export declare function normalizeInProcessHook(input: InProcessHookInput): NormalizeHookResult; export interface BatchNormalizeResult { hooks: NormalizedHook[]; diagnostics: HookNormalizationDiagnostic[]; } /** Stable first-wins deduplication; rejected and duplicate entries remain visible as diagnostics. */ export declare function normalizeHookBatch(results: ReadonlyArray): BatchNormalizeResult;