Files
CyberGril/prototypes/hel-799/build.ps1
T
白栖知andmultica-agent 003d8c2cae HEL-822: land HEL-821 A1+A2 source onto PR#4 base (db571ba)
- 13 modified / 8 added / 1 deleted per CHANGES.json (author package 76bc120b)
- docs/requirements v1.10 + prototypes/hel-799 + PROVENANCE from bundle, verified byte-identical to 63799f0
- AGENTS.md + scripts/check_requirements.py restored from governance commit 63799f0

Co-authored-by: multica-agent <github@multica.ai>
2026-10-24 06:10:53 +08:00

18 lines
1.1 KiB
PowerShell

# Builds the single offline index.html (Windows PowerShell 5.1; no Python or Node needed).
# Inputs: src/shell.html, src/room.css, src/ambient.js, src/scene.js, src/talk.js and the two approved stills in web/public/assets.
$root = $PSScriptRoot
$src = Join-Path $root 'src'
$utf8 = New-Object System.Text.UTF8Encoding($false)
$read = { param($p) [System.IO.File]::ReadAllText((Join-Path $src $p), $utf8) }
$html = & $read 'shell.html'
$html = $html.Replace('{{STYLE}}', (& $read 'room.css'))
$html = $html.Replace('{{SCRIPT}}', (& $read 'ambient.js') + "`n" + (& $read 'scene.js') + "`n" + (& $read 'talk.js'))
$assets = Join-Path (Split-Path (Split-Path $root)) 'web\public\assets'
foreach ($pair in @(@('ROOM', 'her-room.jpg'), @('TALK', 'her-talk.jpg'))) {
$b64 = [Convert]::ToBase64String([System.IO.File]::ReadAllBytes((Join-Path $assets $pair[1])))
$html = $html.Replace('{{' + $pair[0] + '}}', 'data:image/jpeg;base64,' + $b64)
}
if ($html.Contains('{{')) { throw 'Unreplaced placeholder' }
[System.IO.File]::WriteAllText((Join-Path $root 'index.html'), $html, $utf8)
"Built offline index.html ($($utf8.GetByteCount($html)) bytes)"