1
0
Эх сурвалжийг харах

Delete webnovel-writer/hooks directory

lingfengQAQ 1 сар өмнө
parent
commit
8917a6a617

+ 0 - 182
webnovel-writer/hooks/hooks.json

@@ -1,182 +0,0 @@
-{
-  "description": "Monitor Claude Code lifecycle and tool-call events for the webnovel-writer plugin.",
-  "hooks": {
-    "SessionStart": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "InstructionsLoaded": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "UserPromptSubmit": [
-      {
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "PreToolUse": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "PostToolUse": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "PostToolUseFailure": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "PermissionRequest": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "PermissionDenied": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "SubagentStart": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "SubagentStop": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "TaskCreated": [
-      {
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "TaskCompleted": [
-      {
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "PreCompact": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "PostCompact": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ],
-    "SessionEnd": [
-      {
-        "matcher": "*",
-        "hooks": [
-          {
-            "type": "command",
-            "shell": "powershell",
-            "command": "& \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\log-hook-event.ps1\""
-          }
-        ]
-      }
-    ]
-  }
-}

+ 0 - 52
webnovel-writer/hooks/log-hook-event.ps1

@@ -1,52 +0,0 @@
-$ErrorActionPreference = "Stop"
-
-$raw = [Console]::In.ReadToEnd()
-if ([string]::IsNullOrWhiteSpace($raw)) {
-    exit 0
-}
-
-$pluginData = $env:CLAUDE_PLUGIN_DATA
-if ([string]::IsNullOrWhiteSpace($pluginData)) {
-    $pluginRoot = $env:CLAUDE_PLUGIN_ROOT
-    if ([string]::IsNullOrWhiteSpace($pluginRoot)) {
-        exit 0
-    }
-    $pluginData = Join-Path $pluginRoot ".tmp_plugin_data"
-}
-
-$logDir = Join-Path $pluginData "logs"
-New-Item -ItemType Directory -Force -Path $logDir | Out-Null
-
-$payload = $null
-try {
-    $payload = $raw | ConvertFrom-Json -Depth 100
-} catch {
-    $payload = $null
-}
-
-if ($null -ne $payload) {
-    $eventName = [string]$payload.hook_event_name
-    if ([string]::IsNullOrWhiteSpace($eventName)) {
-        $eventName = "unknown"
-    }
-
-    $record = [ordered]@{
-        observed_at = (Get-Date).ToString("o")
-        event = $eventName
-        session_id = [string]$payload.session_id
-        cwd = [string]$payload.cwd
-        transcript_path = [string]$payload.transcript_path
-        payload = $payload
-    }
-} else {
-    $record = [ordered]@{
-        observed_at = (Get-Date).ToString("o")
-        event = "invalid_json"
-        raw = $raw
-    }
-    $eventName = "invalid_json"
-}
-
-$json = $record | ConvertTo-Json -Depth 100 -Compress
-Add-Content -LiteralPath (Join-Path $logDir "hook-events.jsonl") -Value $json
-Add-Content -LiteralPath (Join-Path $logDir ("{0}.jsonl" -f $eventName)) -Value $json