mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 23:11:37 +08:00
45 lines
1.3 KiB
PowerShell
45 lines
1.3 KiB
PowerShell
|
|
param(
|
||
|
|
[string]$Out = "$PSScriptRoot\..\gui\src-tauri\sidecars\hermes-runtime",
|
||
|
|
[string]$Python = "python"
|
||
|
|
)
|
||
|
|
|
||
|
|
$Root = Resolve-Path "$PSScriptRoot\..\.."
|
||
|
|
|
||
|
|
Write-Host "Bundling Hermes GUI runtime"
|
||
|
|
Write-Host "repo: $Root"
|
||
|
|
Write-Host "out: $Out"
|
||
|
|
|
||
|
|
if (Test-Path $Out) {
|
||
|
|
Remove-Item -Recurse -Force $Out
|
||
|
|
}
|
||
|
|
New-Item -ItemType Directory -Force -Path $Out | Out-Null
|
||
|
|
|
||
|
|
Write-Host "-> Building dashboard"
|
||
|
|
npm --prefix "$Root\web" ci
|
||
|
|
npm --prefix "$Root\web" run build
|
||
|
|
Copy-Item -Recurse "$Root\web\dist" "$Out\web_dist"
|
||
|
|
|
||
|
|
Write-Host "-> Building TUI"
|
||
|
|
npm --prefix "$Root\ui-tui" ci
|
||
|
|
npm --prefix "$Root\ui-tui" run build
|
||
|
|
New-Item -ItemType Directory -Force -Path "$Out\ui-tui" | Out-Null
|
||
|
|
Copy-Item -Recurse "$Root\ui-tui\dist" "$Out\ui-tui\dist"
|
||
|
|
Copy-Item "$Root\ui-tui\package.json" "$Out\ui-tui\package.json"
|
||
|
|
Copy-Item "$Root\ui-tui\package-lock.json" "$Out\ui-tui\package-lock.json"
|
||
|
|
Copy-Item -Recurse "$Root\ui-tui\node_modules" "$Out\ui-tui\node_modules"
|
||
|
|
|
||
|
|
Write-Host "-> Creating Python runtime"
|
||
|
|
& $Python -m venv "$Out\venv"
|
||
|
|
& "$Out\venv\Scripts\python.exe" -m pip install --upgrade pip
|
||
|
|
& "$Out\venv\Scripts\python.exe" -m pip install -e "$Root[web,pty]"
|
||
|
|
|
||
|
|
@"
|
||
|
|
# Hermes GUI Runtime
|
||
|
|
|
||
|
|
Generated by apps/shared/bundle-runtime.ps1.
|
||
|
|
|
||
|
|
Set HERMES_GUI_RUNTIME_DIR to this directory before launching the Tauri shell.
|
||
|
|
"@ | Set-Content "$Out\README.md"
|
||
|
|
|
||
|
|
Write-Host "Runtime bundle ready: $Out"
|