hermes-agent/apps/desktop/scripts
Harry Riddle f583c6ebd5 fix(desktop): recover from corrupt cached Electron download on build
hermes desktop failed on Linux with an ENOENT renaming
release/linux-unpacked/electron -> Hermes. Root cause is a corrupt
cached Electron zip (~/.cache/electron/electron-*.zip): app-builder
unpack-electron extracts a partial tree from the bad zip that is
missing the electron binary, so electron-builder dies on the final
rename. Re-running repeats the broken extraction, leaving the desktop
app permanently unlaunchable until the cache is manually purged.

- Add _electron_download_cache_dirs() + _purge_corrupt_electron_cache()
  to hermes_cli/main.py: validate every electron-*.zip via
  zipfile.testzip() and delete corrupt ones; honor electron_config_cache
  / ELECTRON_CACHE overrides with per-OS defaults.
- Wire purge + single retry into cmd_gui packaged-build failure path so
  a poisoned download self-heals (electron re-downloads clean).
- Add beforePack hook (apps/desktop/scripts/before-pack.cjs) to wipe the
  target unpacked dir before staging, making packaging idempotent across
  interrupted runs. Cross-platform, best-effort.
- Tests: corrupt-zip detector, cmd_gui purge/retry/launch path,
  no-retry-when-clean path, and node --test for the cleanup helper.
2026-06-04 07:17:33 -07:00
..
after-pack.cjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
assert-root-install.cjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
before-build.cjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
before-pack.cjs fix(desktop): recover from corrupt cached Electron download on build 2026-06-04 07:17:33 -07:00
before-pack.test.cjs fix(desktop): recover from corrupt cached Electron download on build 2026-06-04 07:17:33 -07:00
click-session.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
dev-no-hmr.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
diag-jump.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
diag-scroll-reset.mjs fix(desktop): stop chat scroll jumping by disabling native scroll anchoring 2026-06-02 23:08:01 -05:00
eval.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
leak-typing.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
measure-jump.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
measure-latency.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
measure-real-stream.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
measure-submit.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
measure-synthetic-stream.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
notarize-artifact.cjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
notarize.cjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
probe-renderer.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
probe-thread.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
profile-long-stream.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
profile-real-stream.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
profile-synth-stream.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
profile-typing-lag.md Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
profile-typing.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
reload-renderer.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
reload.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
set-exe-identity.cjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
stage-native-deps.cjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
test-desktop.mjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
write-build-stamp.cjs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00