aboutsummaryrefslogtreecommitdiff
path: root/src/integration/assets/qwen/herdr-agent-session.ps1
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-08-13 03:00:35 +0300
committerGitHub <noreply@github.com>2026-08-13 03:00:35 +0300
commita4d52ab60282b2ad021cb90978a7ed4d3898704b (patch)
treecdd5f55d6d392d54541b86da7f1a00a48c211d03 /src/integration/assets/qwen/herdr-agent-session.ps1
parent8b635c918066dd184bacc29b4c06c40a3efea3f5 (diff)
feat: add qwen code detection and restore (#2743)
refs #2730
Diffstat (limited to 'src/integration/assets/qwen/herdr-agent-session.ps1')
-rw-r--r--src/integration/assets/qwen/herdr-agent-session.ps137
1 files changed, 37 insertions, 0 deletions
diff --git a/src/integration/assets/qwen/herdr-agent-session.ps1 b/src/integration/assets/qwen/herdr-agent-session.ps1
new file mode 100644
index 00000000..882caf86
--- /dev/null
+++ b/src/integration/assets/qwen/herdr-agent-session.ps1
@@ -0,0 +1,37 @@
+# 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=qwen
+# HERDR_INTEGRATION_VERSION=1
+
+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 }
+if ([string]::IsNullOrWhiteSpace($env:HERDR_SOCKET_PATH)) { exit 0 }
+
+$inputText = [Console]::In.ReadToEnd()
+try {
+ $payload = if ([string]::IsNullOrWhiteSpace($inputText)) { $null } else { $inputText | ConvertFrom-Json }
+} catch {
+ $payload = $null
+}
+
+if ($null -eq $payload -or [string]::IsNullOrWhiteSpace($payload.session_id)) { exit 0 }
+
+$seq = [DateTime]::UtcNow.Ticks
+$herdr = if ([string]::IsNullOrWhiteSpace($env:HERDR_BIN_PATH)) { "herdr" } else { $env:HERDR_BIN_PATH }
+$commandArgs = @(
+ "pane", "report-agent-session", $env:HERDR_PANE_ID,
+ "--source", "herdr:qwen", "--agent", "qwen",
+ "--agent-session-id", [string]$payload.session_id,
+ "--seq", [string]$seq
+)
+if ($payload.source -in @("startup", "resume", "clear", "compact", "branch")) {
+ $commandArgs += @("--session-start-source", [string]$payload.source)
+}
+try {
+ & $herdr @commandArgs 2>$null | Out-Null
+} catch {
+}