Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

$appData = $env:APPDATA
$localAppData = $env:LOCALAPPDATA
if ([string]::IsNullOrWhiteSpace($appData)) {
    $appData = Join-Path $HOME "AppData\\Roaming"
}
if ([string]::IsNullOrWhiteSpace($localAppData)) {
    $localAppData = Join-Path $HOME "AppData\\Local"
}

$storageRoot = Join-Path $appData "IuVeConnectAgent"
$installRoot = Join-Path $localAppData "IuVeConnectAgent"
$logsRoot = Join-Path $storageRoot "logs"

# User-level skeleton only: create local folders, do not elevate, no service registration.
New-Item -ItemType Directory -Path $storageRoot -Force | Out-Null
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
New-Item -ItemType Directory -Path $logsRoot -Force | Out-Null

@{
    ok = $true
    adapter = "windows"
    mode = "skeleton"
    install_scope = "user"
    service_install = "disabled"
    admin_required = $false
    storage_root = $storageRoot
    install_root = $installRoot
    logs_root = $logsRoot
} | ConvertTo-Json -Depth 5 -Compress
