Skip to content
MCP ve Eklentiler Orta

Eklenti Hook'ları

Bir eklentiye yaşam döngüsü hook'ları ekleyin — güvenlik için http ve prompt tipleriyle kısıtlıdır

Komut

"color:#9CA3AF;font-style:italic"># hooks/hooks.json (at plugin root)
$ {
    "PreToolUse": [{
      "matcher": "Bash",
      "hooks": [{
        "type": "prompt",
        "prompt": "Check ">if this bash command is safe: $ARGUMENTS",
        "timeout": 15
      }]
    }]
  }

Yanıt

// Plugin hooks fire alongside project hooks
// Project hooks run first, then plugin hooks

Ayrıştırma Kodu

059669">">// Security restriction 059669">">for plugin hooks:
059669">">// Allowed types: http, prompt
059669">">// Blocked types: command, agent
059669">">// This prevents third-party plugins from executing arbitrary code

Tuzaklar

! Eklenti hook'ları YALNIZCA 'http' ve 'prompt' tiplerini kullanabilir — 'command' ve 'agent' güvenlik için engellenmiştir
! Bu, üçüncü taraf eklentilerden rastgele kod çalıştırılmasını önler

İlgili Tarifler