From c01b947d0bde1663980a15727938ac666ce31f61 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 7 Jun 2026 19:45:16 +0300 Subject: fix: support windows agent hooks and input paths --- src/integration/assets/codex/herdr-agent-state.ps1 | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/integration/assets/codex/herdr-agent-state.ps1 (limited to 'src/integration/assets/codex') diff --git a/src/integration/assets/codex/herdr-agent-state.ps1 b/src/integration/assets/codex/herdr-agent-state.ps1 new file mode 100644 index 00000000..e56948f5 --- /dev/null +++ b/src/integration/assets/codex/herdr-agent-state.ps1 @@ -0,0 +1,27 @@ +# installed by herdr +# 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=5 + +param([string]$Action = "") + +if ($Action -ne "session") { exit 0 } +if ($env:HERDR_ENV -ne "1") { exit 0 } +if ([string]::IsNullOrWhiteSpace($env:HERDR_PANE_ID)) { exit 0 } + +$inputText = [Console]::In.ReadToEnd() +try { + $payload = if ([string]::IsNullOrWhiteSpace($inputText)) { $null } else { $inputText | ConvertFrom-Json } +} catch { + exit 0 +} + +$sessionId = $payload.session_id +if ([string]::IsNullOrWhiteSpace($sessionId)) { exit 0 } + +$seq = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds() +try { + & herdr pane report-agent-session $env:HERDR_PANE_ID --source herdr:codex --agent codex --seq $seq --agent-session-id $sessionId 2>$null | Out-Null +} catch { +} -- cgit v1.2.3