{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hook-notify-telegram",
  "title": "Telegram Notification",
  "description": "Send a Telegram notification when Claude Code needs input or finishes a task.",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/default/blocks/hooks/notify-telegram/scripts/notify-telegram.sh",
      "content": "#!/usr/bin/env bash\n[[ -z \"$CLAUDE_HOOK_TELEGRAM_TOKEN\" || -z \"$CLAUDE_HOOK_TELEGRAM_CHAT_ID\" ]] && exit 0\n\nINPUT=$(cat)\nEVENT=$(echo \"$INPUT\" | python3 -c \"import sys,json; print(json.load(sys.stdin).get('hook_event_name',''))\" 2>/dev/null)\nMESSAGE=$(echo \"$INPUT\" | python3 -c \"import sys,json; print(json.load(sys.stdin).get('notification_message','Needs attention'))\" 2>/dev/null)\nCWD=$(echo \"$INPUT\" | python3 -c \"import sys,json; print(json.load(sys.stdin).get('cwd',''))\" 2>/dev/null)\nPROJECT=$(basename \"$CWD\")\n\ncurl -s -X POST \"https://api.telegram.org/bot${CLAUDE_HOOK_TELEGRAM_TOKEN}/sendMessage\" \\\n  -d \"chat_id=${CLAUDE_HOOK_TELEGRAM_CHAT_ID}\" \\\n  -d \"text=*Claude Code* (${PROJECT})\n${EVENT}: ${MESSAGE}\" \\\n  -d \"parse_mode=Markdown\" \\\n  >/dev/null 2>&1 &\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "hooks",
    "notification"
  ],
  "type": "registry:ui"
}