/** Path to the project hooks manifest, resolved relative to a project root found by walking up from `cwd`. */ export declare const HOOKS_FILE = ".agents/hooks.json"; /** Timeout applied to a command hook when `.agents/hooks.json` omits `timeout`. */ export declare const DEFAULT_TIMEOUT_SECONDS = 60; /** Claude-Code-compatible lifecycle events this extension understands. */ export declare const HOOK_EVENT_NAMES: readonly ['SessionStart', 'PreToolUse', 'PostToolUse', 'Stop']; export type HookEventName = (typeof HOOK_EVENT_NAMES)[number]; /** A single `type: "command"` hook entry parsed from `.agents/hooks.json`. */ export interface HookCommand { type: 'command'; command: string; timeoutSeconds: number; statusMessage?: string | undefined; } /** A matcher plus the command hooks that run when it matches. */ export interface HookGroup { matcher?: string | undefined; hooks: HookCommand[]; } export type HookGroupsByEvent = Partial>; /** Parsed `.agents/hooks.json` state for the current project, reloaded on session start and `/hooks reload`. */ export interface HookRuntime { hooksFile?: string | undefined; projectRoot?: string | undefined; hooks: HookGroupsByEvent; loadError?: string | undefined; } /** * Loads and parses `.agents/hooks.json` for the project containing `cwd`. * Never throws - a missing file yields an empty runtime; a malformed file * yields one with `loadError` set so the extension warns instead of * crashing. */ export declare function loadHookRuntime(cwd: string): Promise; /** Walks up from `cwd` looking for `.agents/hooks.json`, stopping at the filesystem root. */ export declare function findHooksFile(cwd: string): Promise; /** Parses the `hooks` object of a `.agents/hooks.json` payload, dropping anything malformed rather than throwing. */ export declare function parseHooksJson(value: unknown): HookGroupsByEvent; /** Narrows to a plain (non-array, non-null) object record, the shape `.agents/hooks.json` parsing walks. */ export declare function asRecord(value: unknown): Record | undefined; export declare function isDefined(value: T | undefined): value is T; /** Extracts a human-readable message from a thrown value that may not be an `Error`. */ export declare function getErrorMessage(error: unknown): string;