feat: add seat firmware workbench and OTA delivery

This commit is contained in:
vee
2026-09-16 17:55:30 +08:00
parent 3eeca2ea75
commit ab8e43050c
70 changed files with 22594 additions and 316 deletions
+30
View File
@@ -0,0 +1,30 @@
$ErrorActionPreference = "Stop"
$repositoryRoot = Split-Path -Parent $PSScriptRoot
$venvPython = Join-Path $repositoryRoot ".venv\Scripts\python.exe"
$logRoot = Join-Path $repositoryRoot "artifacts\logs"
$logPath = Join-Path $logRoot "n7web-autostart.log"
if (-not (Test-Path -LiteralPath $venvPython -PathType Leaf)) {
throw "N7Web Python executable not found: $venvPython"
}
New-Item -ItemType Directory -Path $logRoot -Force | Out-Null
$python = (& $venvPython -c "import sys; print(sys._base_executable)").Trim()
if ($LASTEXITCODE -ne 0 -or -not (Test-Path -LiteralPath $python -PathType Leaf)) {
throw "N7Web base Python executable could not be resolved."
}
$env:PYTHONPATH = @(
(Join-Path $repositoryRoot "src")
(Join-Path $repositoryRoot "domains\seat\src")
) -join [System.IO.Path]::PathSeparator
while ($true) {
& $python -m cognitive_agent.firmware_ota_server --host 127.0.0.1 --port 8012 *>> $logPath
$exitCode = $LASTEXITCODE
$timestamp = Get-Date -Format "yyyy-MM-ddTHH:mm:ssK"
Add-Content -LiteralPath $logPath -Value (
"[$timestamp] OTA service exited with code $exitCode; restarting in 2 seconds."
)
Start-Sleep -Seconds 2
}