- prototypes/hel-799/ 逐字节保全(23 文件+PROVENANCE 哈希清单;独立重建与交付 HTML 逐字节一致) - sources 新增 comment-evidence-shared-space-20261023.json 与 shared-space-static-acceptance-20261023.md(原话经平台逐条核验) - baseline/current/changes/coverage 升版 v1.9:VIS-011 边界注明交流静图认可,严格限定范围 - 新增 docs/requirements/handoff-HEL-811.json(总工机械校验版;原作者 handoff 原样保留) - check_requirements --base-ref origin/main 与 --handoff 通过;git diff --check 干净 Co-authored-by: multica-agent <github@multica.ai>
18 lines
1.1 KiB
PowerShell
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)"
|