/** * Hooks system: scripts del usuario que sq ejecuta en momentos específicos. * * Configuración en `~/.squeezr-code/settings.json` o `/sq.toml`: * * { * "hooks": { * "PreToolUse": [ * { "matcher": "Bash", "command": "echo 'Bash about to run: ${input.command}'" } * ], * "PostToolUse": [ * { "matcher": "Edit", "command": "prettier --write ${input.file_path}" } * ], * "UserPromptSubmit": [ * { "command": "echo \"$(date) $1\" >> ~/.squeezr-code/prompts.log" } * ], * "Stop": [ * { "command": "notify-send 'sq turn done'" } * ] * } * } * * El `matcher` es opcional (regex sobre el nombre del tool). Si no hay matcher, * el hook se ejecuta para todas las invocaciones. * * Variables disponibles: * - $1 primer arg (el prompt para UserPromptSubmit, etc) * - ${input.} accede a campos del tool input (Bash command, Edit file_path, etc) * - SQ_TOOL_NAME, SQ_CWD env vars * * Hooks se ejecutan async, no bloquean el agente. Failures son silenciosos * (a menos que DEBUG_HOOKS=1). */ export type HookEvent = 'PreToolUse' | 'PostToolUse' | 'UserPromptSubmit' | 'Stop' | 'Notification'; export interface HookSpec { matcher?: string; command: string; } export interface HooksConfig { PreToolUse?: HookSpec[]; PostToolUse?: HookSpec[]; UserPromptSubmit?: HookSpec[]; Stop?: HookSpec[]; Notification?: HookSpec[]; } export declare class HookRunner { private hooks; constructor(hooks: HooksConfig); /** Ejecuta todos los hooks configurados para un evento. Fire-and-forget. */ fire(event: HookEvent, opts: { toolName?: string; input?: Record; arg?: string; cwd?: string; }): void; private run; } /** Carga hooks desde settings.json del user-level. */ export declare function loadHooks(): HooksConfig; //# sourceMappingURL=hooks.d.ts.map