hydra/scripts
Chubby 57441a2885
feat: extract downloaded archives in place behind a feature flag (#3009)
* feat: extract downloaded archives in place behind a feature flag

Adds in-place extraction through hatchzip-core to the native addon. The
archive is cut back as its files come out, so extracting a download only
needs room for the game, not for the game and the archive side by side.

Only top-level archives that would be deleted after extraction are
consumed. Archives hatchzip refuses (solid RAR, files already in the way,
too little space) are left untouched and go to 7-Zip. An archive hatchzip
has started is never handed to 7-Zip and resumes from its journal.

The whole flow sits behind the IN_PLACE_ARCHIVE_EXTRACTION flag. With it
off, or with /features unreachable, archives go straight to 7-Zip and the
usual delete-or-prompt step runs afterwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014J6EZ4VGuJ6sWKrXDd67nW

* chore(eslint): mark the config as root

Git worktrees under .claude/worktrees sit inside the main checkout. ESLint 8
kept walking up into the outer .eslintrc.cjs, found eslint-plugin-prettier
in both node_modules folders, and crashed before linting anything, which
also broke the pre-push hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014J6EZ4VGuJ6sWKrXDd67nW

* chore: drop in-place extraction tests and RAR fixtures

Removes the Rust and JS tests for in-place extraction, the RAR 5 fixtures
they used, the zip dev-dependency, and the *.rar binary attribute that only
existed for those fixtures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014J6EZ4VGuJ6sWKrXDd67nW

* fix: keep extraction retryable after an in-place extraction

An archive extracted in place is gone, but the download still pointed at
it while nested archives were extracted. If a nested extraction failed,
retrying reported the archive as missing. The extracted folder is now
saved as soon as the archive is consumed, so a retry starts from it.

Also names the progress update step count in the native addon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014J6EZ4VGuJ6sWKrXDd67nW

* fix: keep nested archives intact when retrying after in-place extraction

The previous fix pointed the download at the extracted folder, so a retry
ran the directory extraction without the outer archive and could delete
nested archives the first attempt kept.

The download now keeps naming the archive and is marked extractedInPlace
once the archive is consumed. A retry skips the outer archive, extracts
the nested ones with the outer archive as context, and clears the mark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014J6EZ4VGuJ6sWKrXDd67nW

* fix: resume in-place extractions only from Hydra's own record

A progress file next to an archive can arrive with a download, so it is
no longer trusted on its own. Hydra now records each archive on the
download before hatchzip may consume it, and only those archives are
resumed. A progress file Hydra did not create leaves the archive to
7-Zip.

Resuming no longer depends on the feature flag. Only a new in-place
run asks the API, once per extraction, so an offline retry finishes a
half-consumed archive instead of handing it to 7-Zip. If the addon
cannot load for a new run, 7-Zip extracts instead, and a panic in the
addon still reports whether the archive was touched.

The record also covers a run that stopped after the archive was gone:
the retry lets hatchzip finish the links and progress files, or report
the archive done, instead of failing with a missing file. Folder
downloads pick up such archives too.

hatchzip-core moves to 0.1.8, which checks that a journal only names
the archive's own volumes and links inside the output folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014J6EZ4VGuJ6sWKrXDd67nW

* fix: record an in-place start only for runs hatchzip can begin

The start record was saved before hatchzip rejected a journal it did
not create. If 7-Zip then failed, the record survived and the retry
resumed from the journal that came with the download.

A new run now checks for a journal before saving the record and goes
to 7-Zip if one is there. The record is also dropped whenever hatchzip
reports the archive untouched, or the addon could not run, so it only
stays for a run hatchzip actually started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014J6EZ4VGuJ6sWKrXDd67nW

* feat: delete archive files after extraction by default

The "delete archive files after extraction" checkbox now starts
checked for anyone who has not set the preference, in the download
modal and settings of both the desktop UI and Big Picture. The main
process falls back to the same default. A preference someone already
saved keeps its value.

In-place extraction only runs for archives that are deleted afterwards,
so this lets new downloads use it without a settings change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014J6EZ4VGuJ6sWKrXDd67nW

---------

Co-authored-by: Chubby Granny Chaser <hydralauncher@proton.me>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:36:17 +00:00
..
build-epic-prerequisite-runner.cjs fix(epic): harden Linux validation and process guards 2026-10-15 01:57:11 -03:00
build-native-addon.cjs feat: extract downloaded archives in place behind a feature flag (#3009) 2026-10-29 18:36:17 +00:00
build-torrent-bridge.cjs ci: commit prebuilt torrent bridge binaries (#2878) 2026-10-10 02:02:37 +01:00
check-ota-bridge.mjs test: enhance checks for release branch formats and missing namespace calls 2026-10-01 19:46:27 -03:00
check-ota-bridge.test.mjs test: enhance checks for release branch formats and missing namespace calls 2026-10-01 19:46:27 -03:00
epic-prerequisite-runner.test.mjs fix(epic): harden Linux validation and process guards 2026-10-15 01:57:11 -03:00
inspect-ps1-memcard.cjs feat: add emulator support (#2231) 2026-06-11 01:19:26 +01:00
inspect-ps2-memcard.cjs feat: add emulator support (#2231) 2026-06-11 01:19:26 +01:00
legendary-after-pack.cjs Merge branch 'codex/epic-linux-download-launch' into codex/epic-download-latency 2026-10-15 13:23:51 -03:00
legendary-before-pack.cjs feat(epic): package the supervised Windows prerequisite runner 2026-10-15 01:57:11 -03:00
legendary-linux-runtime.cjs Merge branch 'codex/epic-linux-download-launch' into codex/epic-download-latency 2026-10-15 13:23:51 -03:00
legendary-mac-sign.cjs chore: enhance Linux Legendary integration with runtime scripts and resources 2026-10-08 10:20:40 -03:00
legendary-managed-fixture.py Merge branch 'feat/LBX-1180-epic-game-updates' into feat/LBX-1191-epic-download-granularity 2026-10-20 17:04:35 -03:00
legendary-managed-install-fixture.py test(epic): derive the offline fixture runtime locally 2026-10-15 01:24:43 -03:00
legendary-managed-install.test.mjs test(epic): derive the offline fixture runtime locally 2026-10-15 01:24:43 -03:00
legendary-managed-runtime.cjs feat(epic): add a pinned target-only Legendary runtime 2026-10-15 00:07:18 -03:00
legendary-managed.test.mjs feat(epic): inspect optional packs and install DLC in the managed adapter (LBX-1191) 2026-10-20 16:36:27 -03:00
postinstall.cjs feat: adding standalone aria2c 2025-05-13 01:24:29 +01:00
prepare-epic-process-supervisor.cjs perf(epic): precompile the Windows process supervisor 2026-10-15 00:06:53 -03:00
prepare-epic-process-supervisor.test.mjs perf(epic): precompile the Windows process supervisor 2026-10-15 00:06:53 -03:00
prepare-legendary.cjs feat(epic): add a pinned target-only Legendary runtime 2026-10-15 00:07:18 -03:00
register-ts-node.mjs fix: wait for JS downloader completion (#2229) 2026-06-11 02:21:02 +01:00
test-epic-linux-runtime.cjs fix(epic): harden Linux validation and process guards 2026-10-15 01:57:11 -03:00
test-epic-linux-runtime.test.mjs fix(epic): harden Linux validation and process guards 2026-10-15 01:57:11 -03:00
test-epic-prerequisite-wine.cjs test(epic): name supervisor and process test wait budgets 2026-10-15 13:51:19 -03:00
torrent-bridge-prebuilt.cjs ci: commit prebuilt torrent bridge binaries (#2878) 2026-10-10 02:02:37 +01:00
update-epic-umu-map.cjs feat(epic): prepare and supervise the Linux Proton runtime 2026-10-15 01:57:11 -03:00
upload-build.cjs Reduce artifact retention and add predictable release download URLs (#2830) 2026-09-23 18:04:04 +01:00
upload-build.test.cjs Reduce artifact retention and add predictable release download URLs (#2830) 2026-09-23 18:04:04 +01:00