/** * adapters/cursor/hooks — Cursor hook definitions and config helpers. * * Cursor native hook config lives in `.cursor/hooks.json` or `~/.cursor/hooks.json`. * Unlike Claude/Gemini/VS Code Copilot, each hook entry is a flat object rather * than a `{ matcher, hooks: [...] }` wrapper. */ /** Cursor hook type names. */ export declare const HOOK_TYPES: { readonly PRE_TOOL_USE: "preToolUse"; readonly POST_TOOL_USE: "postToolUse"; readonly SESSION_START: "sessionStart"; readonly STOP: "stop"; readonly AFTER_AGENT_RESPONSE: "afterAgentResponse"; }; export type HookType = (typeof HOOK_TYPES)[keyof typeof HOOK_TYPES]; /** Map of hook types that have actual script files. */ export declare const HOOK_SCRIPTS: Partial>; /** Canonical Cursor-native matchers for tools context-mode routes proactively. */ export declare const PRE_TOOL_USE_MATCHERS: readonly ["Shell", "Read", "Grep", "WebFetch", "mcp_web_fetch", "mcp_fetch_tool", "Task", "MCP:ctx_execute", "MCP:ctx_execute_file", "MCP:ctx_batch_execute"]; export declare const PRE_TOOL_USE_MATCHER_PATTERN: string; /** Required hooks for native Cursor support. */ export declare const REQUIRED_HOOKS: HookType[]; /** Optional hooks that improve behavior but aren't strictly required. */ export declare const OPTIONAL_HOOKS: HookType[]; /** Minimal native Cursor hook entry shape. */ export interface CursorHookCommandEntry { type?: string; command?: string; matcher?: string; timeout?: number; loop_limit?: number | null; failClosed?: boolean; } /** Check whether a native Cursor hook entry points to context-mode. */ export declare function isContextModeHook(entry: CursorHookCommandEntry | { hooks?: Array<{ command?: string; }>; }, hookType: HookType): boolean; /** Build the CLI dispatcher command for a Cursor hook type. */ export declare function buildHookCommand(hookType: HookType): string;