export declare const filename = "example-hook.ts";
export declare const content = "/**\n* Example Hook Script\n* \n* Usage: \n* 1. Attach to 'patch' or 'overwrite_file' tool as a 'before' hook.\n* 2. It will block edits to any file with 'lock' in the name.\n*/\n// --- Type Definitions ---\n\nexport interface HookAction {\n  tool_name: string;\n  args: Record<string, any>;\n  // Only present for 'after' hooks\n  result?: {\n    status: 'SUCCESS' | 'FAILURE';\n    output?: string;\n    error?: string;\n  };\n}\n\nexport interface HookContext {\n  hook_type: 'before' | 'after';\n  action: HookAction;\n  plan_context: any; // Shared state of current AI plan\n}\n\nexport interface HookOutput {\n  // If true, AI plan stops immediately.\n  should_halt_plan?: boolean;\n  \n  // Optional message to log in UI\n  message?: string;\n  \n  // Optional data to merge back into plan context\n  update_context?: Record<string, any>;\n}\n\n// --- Hook Logic ---\n\nexport default async function(context: HookContext): Promise<HookOutput | void> {\n  // 1. Extract Data\n  const filePath = context.action?.args?.file_path || '';\n  \n  // Log to console (appears in backend logs)\n  console.log(`[Hook] analyzing action on: ${filePath}`);\n\n  // 2. Logic\n  if (filePath.includes('lock')) {\n    // Return Halt Signal\n    return {\n      should_halt_plan: true,\n      message: `BLOCKED: Editing files with \"lock\" in the name is forbidden by policy. File: ${filePath}`\n    };\n  } else {\n    // Return Pass Signal\n    return {\n      should_halt_plan: false,\n      message: `Hook allowed action on ${filePath}`\n    };\n  }\n}\n";
