param(
    [string]$InstallDirectory = (Split-Path -Path $PSScriptRoot -Parent)
)

Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$agentExe = Join-Path $InstallDirectory "agent\IAUWP.Agent.exe"
if (-not (Test-Path -Path $agentExe)) { throw "Agent executable was not found at '$agentExe'." }
& $agentExe --supervision-reset-circuit
if ($LASTEXITCODE -ne 0) { throw "Supervision circuit reset failed with exit code $LASTEXITCODE." }
