diff --git a/src/integration/assets/antigravity_cli/herdr-agent-state.ps1 b/src/integration/assets/antigravity_cli/herdr-agent-state.ps1 index aecb42a9ef..047177570f 100644 --- a/src/integration/assets/antigravity_cli/herdr-agent-state.ps1 +++ b/src/integration/assets/antigravity_cli/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=antigravity_cli -# HERDR_INTEGRATION_VERSION=1 +# HERDR_INTEGRATION_VERSION=2 # Session-only: this hook reports the Antigravity conversation so Herdr can # resume the pane. Lifecycle state comes from Herdr's screen detection. @@ -33,6 +33,7 @@ $conversationId = if ($payload.conversationId -is [string]) { $payload.conversat if ([string]::IsNullOrWhiteSpace($conversationId)) { Exit-Hook } $seq = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds() +$herdr = if ([string]::IsNullOrWhiteSpace($env:HERDR_BIN_PATH)) { "herdr" } else { $env:HERDR_BIN_PATH } try { $sessionArgs = @( "pane", @@ -50,7 +51,7 @@ try { if ($payload.transcriptPath -is [string] -and -not [string]::IsNullOrWhiteSpace($payload.transcriptPath)) { $sessionArgs += @("--agent-session-path", "$($payload.transcriptPath)") } - & herdr @sessionArgs 2>$null | Out-Null + & $herdr @sessionArgs 2>$null | Out-Null } catch { } diff --git a/src/integration/assets/antigravity_cli/herdr-agent-state.sh b/src/integration/assets/antigravity_cli/herdr-agent-state.sh index dd3db028b1..859ec37801 100644 --- a/src/integration/assets/antigravity_cli/herdr-agent-state.sh +++ b/src/integration/assets/antigravity_cli/herdr-agent-state.sh @@ -3,7 +3,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=antigravity_cli -# HERDR_INTEGRATION_VERSION=1 +# HERDR_INTEGRATION_VERSION=2 # Session-only: this hook reports the Antigravity conversation so Herdr can # resume the pane. Lifecycle state comes from Herdr's screen detection. diff --git a/src/integration/assets/claude/herdr-agent-state.ps1 b/src/integration/assets/claude/herdr-agent-state.ps1 index dcc9d4df34..d82a6fe3a5 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=7 +# HERDR_INTEGRATION_VERSION=8 param([string]$Action = "") @@ -24,6 +24,7 @@ $sessionId = $payload.session_id if ([string]::IsNullOrWhiteSpace($sessionId)) { exit 0 } $seq = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds() +$herdr = if ([string]::IsNullOrWhiteSpace($env:HERDR_BIN_PATH)) { "herdr" } else { $env:HERDR_BIN_PATH } try { $args = @( "pane", @@ -44,6 +45,6 @@ try { if ($payload.hook_event_name -eq "SessionStart" -and $payload.source -is [string] -and -not [string]::IsNullOrWhiteSpace($payload.source)) { $args += @("--session-start-source", "$($payload.source)") } - & herdr @args 2>$null | Out-Null + & $herdr @args 2>$null | Out-Null } catch { } diff --git a/src/integration/assets/claude/herdr-agent-state.sh b/src/integration/assets/claude/herdr-agent-state.sh index cb5e840d5e..9b9a7dfdc0 100644 --- a/src/integration/assets/claude/herdr-agent-state.sh +++ b/src/integration/assets/claude/herdr-agent-state.sh @@ -3,7 +3,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=7 +# HERDR_INTEGRATION_VERSION=8 set -eu diff --git a/src/integration/assets/codex/herdr-agent-state.ps1 b/src/integration/assets/codex/herdr-agent-state.ps1 index b578e7b9b9..81ed381b91 100644 --- a/src/integration/assets/codex/herdr-agent-state.ps1 +++ b/src/integration/assets/codex/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=codex -# HERDR_INTEGRATION_VERSION=7 +# HERDR_INTEGRATION_VERSION=8 param([string]$Action = "") @@ -25,6 +25,7 @@ if ([string]::IsNullOrWhiteSpace($payload.transcript_path)) { exit 0 } if (-not [string]::IsNullOrWhiteSpace($env:CODEX_THREAD_ID) -and $env:CODEX_THREAD_ID -ne $sessionId) { exit 0 } $seq = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds() +$herdr = if ([string]::IsNullOrWhiteSpace($env:HERDR_BIN_PATH)) { "herdr" } else { $env:HERDR_BIN_PATH } try { $args = @( "pane", @@ -42,6 +43,6 @@ try { if ($payload.hook_event_name -eq "SessionStart" -and $payload.source -is [string] -and -not [string]::IsNullOrWhiteSpace($payload.source)) { $args += @("--session-start-source", "$($payload.source)") } - & herdr @args 2>$null | Out-Null + & $herdr @args 2>$null | Out-Null } catch { } diff --git a/src/integration/assets/codex/herdr-agent-state.sh b/src/integration/assets/codex/herdr-agent-state.sh index 687a8181e8..2931936a18 100644 --- a/src/integration/assets/codex/herdr-agent-state.sh +++ b/src/integration/assets/codex/herdr-agent-state.sh @@ -3,7 +3,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=codex -# HERDR_INTEGRATION_VERSION=7 +# HERDR_INTEGRATION_VERSION=8 set -eu diff --git a/src/integration/assets/copilot/herdr-agent-state.ps1 b/src/integration/assets/copilot/herdr-agent-state.ps1 index 8951eacb90..f424f122ce 100644 --- a/src/integration/assets/copilot/herdr-agent-state.ps1 +++ b/src/integration/assets/copilot/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=copilot -# HERDR_INTEGRATION_VERSION=2 +# HERDR_INTEGRATION_VERSION=3 if ($env:HERDR_ENV -ne "1") { exit 0 } if ([string]::IsNullOrWhiteSpace($env:HERDR_PANE_ID)) { exit 0 } @@ -49,4 +49,5 @@ if ([string]::IsNullOrWhiteSpace($sessionId)) { if ([string]::IsNullOrWhiteSpace($sessionId)) { exit 0 } $seq = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds() -& herdr pane report-agent-session $env:HERDR_PANE_ID --source herdr:copilot --agent copilot --agent-session-id $sessionId --seq $seq 2>$null | Out-Null +$herdr = if ([string]::IsNullOrWhiteSpace($env:HERDR_BIN_PATH)) { "herdr" } else { $env:HERDR_BIN_PATH } +& $herdr pane report-agent-session $env:HERDR_PANE_ID --source herdr:copilot --agent copilot --agent-session-id $sessionId --seq $seq 2>$null | Out-Null diff --git a/src/integration/assets/copilot/herdr-agent-state.sh b/src/integration/assets/copilot/herdr-agent-state.sh index 1ae0362b40..82522ac1bf 100644 --- a/src/integration/assets/copilot/herdr-agent-state.sh +++ b/src/integration/assets/copilot/herdr-agent-state.sh @@ -3,7 +3,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=copilot -# HERDR_INTEGRATION_VERSION=2 +# HERDR_INTEGRATION_VERSION=3 set -eu diff --git a/src/integration/assets/droid/herdr-agent-state.ps1 b/src/integration/assets/droid/herdr-agent-state.ps1 index f3bb0f6889..fa6a4e2595 100644 --- a/src/integration/assets/droid/herdr-agent-state.ps1 +++ b/src/integration/assets/droid/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=droid -# HERDR_INTEGRATION_VERSION=2 +# HERDR_INTEGRATION_VERSION=3 param([string]$Action = "") @@ -20,7 +20,8 @@ try { if ($null -eq $payload -or [string]::IsNullOrWhiteSpace($payload.session_id)) { exit 0 } $seq = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds() +$herdr = if ([string]::IsNullOrWhiteSpace($env:HERDR_BIN_PATH)) { "herdr" } else { $env:HERDR_BIN_PATH } try { - & herdr pane report-agent-session $env:HERDR_PANE_ID --source herdr:droid --agent droid --agent-session-id $payload.session_id --seq $seq 2>$null | Out-Null + & $herdr pane report-agent-session $env:HERDR_PANE_ID --source herdr:droid --agent droid --agent-session-id $payload.session_id --seq $seq 2>$null | Out-Null } catch { } diff --git a/src/integration/assets/droid/herdr-agent-state.sh b/src/integration/assets/droid/herdr-agent-state.sh index ddab463e84..d777b2c113 100644 --- a/src/integration/assets/droid/herdr-agent-state.sh +++ b/src/integration/assets/droid/herdr-agent-state.sh @@ -3,7 +3,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=droid -# HERDR_INTEGRATION_VERSION=2 +# HERDR_INTEGRATION_VERSION=3 set -eu diff --git a/src/integration/assets/kimi/herdr-agent-state.ps1 b/src/integration/assets/kimi/herdr-agent-state.ps1 index c298dda4a3..3141326d1c 100644 --- a/src/integration/assets/kimi/herdr-agent-state.ps1 +++ b/src/integration/assets/kimi/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=kimi -# HERDR_INTEGRATION_VERSION=6 +# HERDR_INTEGRATION_VERSION=7 param([string]$Action = "") @@ -19,16 +19,17 @@ try { $seq = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds() $sessionId = if ($null -ne $payload -and -not [string]::IsNullOrWhiteSpace($payload.session_id)) { $payload.session_id } else { $null } +$herdr = if ([string]::IsNullOrWhiteSpace($env:HERDR_BIN_PATH)) { "herdr" } else { $env:HERDR_BIN_PATH } try { if ($Action -eq "session") { if ([string]::IsNullOrWhiteSpace($sessionId)) { exit 0 } - & herdr pane report-agent-session $env:HERDR_PANE_ID --source herdr:kimi --agent kimi --agent-session-id $sessionId --session-start-source startup --seq $seq 2>$null | Out-Null + & $herdr pane report-agent-session $env:HERDR_PANE_ID --source herdr:kimi --agent kimi --agent-session-id $sessionId --session-start-source startup --seq $seq 2>$null | Out-Null } else { if ([string]::IsNullOrWhiteSpace($sessionId)) { - & herdr pane report-agent $env:HERDR_PANE_ID --source herdr:kimi --agent kimi --state $Action --seq $seq 2>$null | Out-Null + & $herdr pane report-agent $env:HERDR_PANE_ID --source herdr:kimi --agent kimi --state $Action --seq $seq 2>$null | Out-Null } else { - & herdr pane report-agent $env:HERDR_PANE_ID --source herdr:kimi --agent kimi --state $Action --agent-session-id $sessionId --seq $seq 2>$null | Out-Null + & $herdr pane report-agent $env:HERDR_PANE_ID --source herdr:kimi --agent kimi --state $Action --agent-session-id $sessionId --seq $seq 2>$null | Out-Null } } } catch { diff --git a/src/integration/assets/kimi/herdr-agent-state.sh b/src/integration/assets/kimi/herdr-agent-state.sh index e919300f3d..c8ed8e239b 100644 --- a/src/integration/assets/kimi/herdr-agent-state.sh +++ b/src/integration/assets/kimi/herdr-agent-state.sh @@ -1,7 +1,7 @@ #!/bin/sh # managed by herdr; reinstalling the integration replaces this file. # HERDR_INTEGRATION_ID=kimi -# HERDR_INTEGRATION_VERSION=6 +# HERDR_INTEGRATION_VERSION=7 action="${1:-}" case "$action" in diff --git a/src/integration/assets/qodercli/herdr-agent-state.ps1 b/src/integration/assets/qodercli/herdr-agent-state.ps1 index df527f6df7..6d0e037b63 100644 --- a/src/integration/assets/qodercli/herdr-agent-state.ps1 +++ b/src/integration/assets/qodercli/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=qodercli -# HERDR_INTEGRATION_VERSION=2 +# HERDR_INTEGRATION_VERSION=3 param([string]$Action = "") @@ -20,7 +20,8 @@ try { if ($null -eq $payload -or [string]::IsNullOrWhiteSpace($payload.session_id)) { exit 0 } $seq = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds() +$herdr = if ([string]::IsNullOrWhiteSpace($env:HERDR_BIN_PATH)) { "herdr" } else { $env:HERDR_BIN_PATH } try { - & herdr pane report-agent-session $env:HERDR_PANE_ID --source herdr:qodercli --agent qodercli --agent-session-id $payload.session_id --seq $seq 2>$null | Out-Null + & $herdr pane report-agent-session $env:HERDR_PANE_ID --source herdr:qodercli --agent qodercli --agent-session-id $payload.session_id --seq $seq 2>$null | Out-Null } catch { } diff --git a/src/integration/assets/qodercli/herdr-agent-state.sh b/src/integration/assets/qodercli/herdr-agent-state.sh index 871549e6bd..8f03389a16 100644 --- a/src/integration/assets/qodercli/herdr-agent-state.sh +++ b/src/integration/assets/qodercli/herdr-agent-state.sh @@ -1,13 +1,12 @@ #!/bin/sh # managed by herdr; reinstalling the integration replaces this file. # HERDR_INTEGRATION_ID=qodercli -# HERDR_INTEGRATION_VERSION=2 +# HERDR_INTEGRATION_VERSION=3 [ "${1:-}" = "session" ] || exit 0 [ "${HERDR_ENV:-}" = "1" ] || exit 0 [ -n "${HERDR_SOCKET_PATH:-}" ] || exit 0 [ -n "${HERDR_PANE_ID:-}" ] || exit 0 -command -v herdr >/dev/null 2>&1 || exit 0 command -v python3 >/dev/null 2>&1 || exit 0 python3 -c ' @@ -24,7 +23,8 @@ try: raise ValueError subprocess.run( [ - "herdr", "pane", "report-agent-session", os.environ["HERDR_PANE_ID"], + os.environ.get("HERDR_BIN_PATH") or "herdr", + "pane", "report-agent-session", os.environ["HERDR_PANE_ID"], "--source", "herdr:qodercli", "--agent", "qodercli", "--agent-session-id", session_id, "--seq", str(time.time_ns()), ], diff --git a/src/integration/mod.rs b/src/integration/mod.rs index 9630b578a7..597aabc5f8 100644 --- a/src/integration/mod.rs +++ b/src/integration/mod.rs @@ -38,7 +38,7 @@ const CLAUDE_HOOK_ASSET: &str = if cfg!(windows) { } else { include_str!("assets/claude/herdr-agent-state.sh") }; -const CLAUDE_INTEGRATION_VERSION: u32 = 7; +const CLAUDE_INTEGRATION_VERSION: u32 = 8; const CODEX_HOOK_INSTALL_NAME: &str = if cfg!(windows) { "herdr-agent-state.ps1" } else { @@ -49,7 +49,7 @@ const CODEX_HOOK_ASSET: &str = if cfg!(windows) { } else { include_str!("assets/codex/herdr-agent-state.sh") }; -const CODEX_INTEGRATION_VERSION: u32 = 7; +const CODEX_INTEGRATION_VERSION: u32 = 8; const KIMI_HOOK_INSTALL_NAME: &str = if cfg!(windows) { "herdr-agent-state.ps1" } else { @@ -60,7 +60,7 @@ const KIMI_HOOK_ASSET: &str = if cfg!(windows) { } else { include_str!("assets/kimi/herdr-agent-state.sh") }; -const KIMI_INTEGRATION_VERSION: u32 = 6; +const KIMI_INTEGRATION_VERSION: u32 = 7; const KIMI_CONFIG_BLOCK_BEGIN: &str = "# >>> herdr kimi integration"; const KIMI_CONFIG_BLOCK_END: &str = "# <<< herdr kimi integration"; const KIMI_MIN_VERSION: &str = "0.14.0"; @@ -102,7 +102,7 @@ const COPILOT_HOOK_ASSET: &str = if cfg!(windows) { } else { include_str!("assets/copilot/herdr-agent-state.sh") }; -const COPILOT_INTEGRATION_VERSION: u32 = 2; +const COPILOT_INTEGRATION_VERSION: u32 = 3; const COPILOT_HOOK_EVENTS: [&str; 1] = ["SessionStart"]; const COPILOT_REMOVED_LIFECYCLE_HOOK_EVENTS: [&str; 9] = [ "UserPromptSubmit", @@ -152,7 +152,7 @@ const DROID_HOOK_ASSET: &str = if cfg!(windows) { } else { include_str!("assets/droid/herdr-agent-state.sh") }; -const DROID_INTEGRATION_VERSION: u32 = 2; +const DROID_INTEGRATION_VERSION: u32 = 3; const DROID_HOOK_EVENTS: [(&str, &str); 1] = [("SessionStart", "session")]; const DROID_REMOVED_LIFECYCLE_HOOK_EVENTS: [(&str, &str); 9] = [ ("SessionStart", "idle"), @@ -190,7 +190,7 @@ const QODERCLI_HOOK_ASSET: &str = if cfg!(windows) { } else { include_str!("assets/qodercli/herdr-agent-state.sh") }; -const QODERCLI_INTEGRATION_VERSION: u32 = 2; +const QODERCLI_INTEGRATION_VERSION: u32 = 3; const QODERCLI_HOOK_EVENTS: [(&str, &str); 1] = [("SessionStart", "session")]; const QODERCLI_REMOVED_LIFECYCLE_HOOK_EVENTS: [(&str, &str); 12] = [ ("SessionStart", "idle"), @@ -227,7 +227,7 @@ const ANTIGRAVITY_CLI_HOOK_ASSET: &str = #[cfg(not(windows))] const ANTIGRAVITY_CLI_HOOK_ASSET: &str = include_str!("assets/antigravity_cli/herdr-agent-state.sh"); -const ANTIGRAVITY_CLI_INTEGRATION_VERSION: u32 = 1; +const ANTIGRAVITY_CLI_INTEGRATION_VERSION: u32 = 2; /// Antigravity CLI keys `hooks.json` by hook name, so every Herdr entry lives /// under one Herdr-owned block that install rewrites and uninstall removes. const ANTIGRAVITY_CLI_HOOK_BLOCK_NAME: &str = "herdr"; diff --git a/src/integration/tests.rs b/src/integration/tests.rs index 6eaf7a3931..324ae6ce94 100644 --- a/src/integration/tests.rs +++ b/src/integration/tests.rs @@ -1058,7 +1058,7 @@ fn claude_v1_integration_status_is_outdated() { assert_eq!(claude.path, hook_path); assert_eq!(claude.installed_version, Some(1)); - assert_eq!(claude.expected_version, 7); + assert_eq!(claude.expected_version, 8); assert_eq!(claude.state, IntegrationStatusKind::Outdated); std::env::remove_var("HOME"); @@ -1088,7 +1088,7 @@ fn claude_v2_integration_status_is_outdated() { assert_eq!(claude.path, hook_path); assert_eq!(claude.installed_version, Some(2)); - assert_eq!(claude.expected_version, 7); + assert_eq!(claude.expected_version, 8); assert_eq!(claude.state, IntegrationStatusKind::Outdated); std::env::remove_var("HOME"); @@ -1221,7 +1221,7 @@ fn codex_v2_integration_status_is_outdated() { assert_eq!(codex.path, hook_path); assert_eq!(codex.installed_version, Some(2)); - assert_eq!(codex.expected_version, 7); + assert_eq!(codex.expected_version, 8); assert_eq!(codex.state, IntegrationStatusKind::Outdated); std::env::remove_var("HOME"); @@ -2724,6 +2724,11 @@ fn bundled_integration_asset_versions_match_expected_versions() { QODERCLI_INTEGRATION_VERSION, ), ("cursor", CURSOR_HOOK_ASSET, CURSOR_INTEGRATION_VERSION), + ( + "antigravity_cli", + ANTIGRAVITY_CLI_HOOK_ASSET, + ANTIGRAVITY_CLI_INTEGRATION_VERSION, + ), ( "mastracode", MASTRACODE_HOOK_ASSET,