aboutsummaryrefslogtreecommitdiff
path: root/src/integration/assets/claude/herdr-agent-state.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'src/integration/assets/claude/herdr-agent-state.ps1')
-rw-r--r--src/integration/assets/claude/herdr-agent-state.ps16
1 files changed, 4 insertions, 2 deletions
diff --git a/src/integration/assets/claude/herdr-agent-state.ps1 b/src/integration/assets/claude/herdr-agent-state.ps1
index d82a6fe3..fc596865 100644
--- a/src/integration/assets/claude/herdr-agent-state.ps1
+++ b/src/integration/assets/claude/herdr-agent-state.ps1
@@ -2,7 +2,7 @@
# managed by herdr; reinstalling or updating the integration overwrites this file.
# add custom hooks beside this file instead of editing it.
# HERDR_INTEGRATION_ID=claude
-# HERDR_INTEGRATION_VERSION=8
+# HERDR_INTEGRATION_VERSION=9
param([string]$Action = "")
@@ -17,8 +17,10 @@ try {
exit 0
}
+$propertyNames = @($payload.PSObject.Properties.Name)
+if ((Test-Path Env:CURSOR_VERSION) -or $propertyNames -ccontains "cursor_version") { exit 0 }
+if (-not ($propertyNames -ccontains "hook_event_name") -or $payload.hook_event_name -isnot [string] -or $payload.hook_event_name -cne "SessionStart") { exit 0 }
if (-not [string]::IsNullOrWhiteSpace($payload.agent_id)) { exit 0 }
-if ($payload.hook_event_name -eq "SubagentStop") { exit 0 }
$sessionId = $payload.session_id
if ([string]::IsNullOrWhiteSpace($sessionId)) { exit 0 }