fix(schematics): handle PMC download countdown page and ZIP-wrapped schematics
All checks were successful
Deploy to Docker / deploy (push) Successful in 1m21s

The download pipeline was getting HTML instead of the binary file because
PMC's /download/schematic/ returns a countdown confirmation page. Added
downloadSchematic() that uses a full browser flow (project visit → download
page → extract static URL → capture file). Also added ZIP extraction via
adm-zip for schematics wrapped in ZIP archives.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-17 01:33:56 +00:00
parent a739e44ecc
commit a30671c44c
4 changed files with 171 additions and 16 deletions

10
package-lock.json generated
View File

@@ -9,6 +9,7 @@
"version": "1.0.0",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.27.1",
"adm-zip": "^0.5.16",
"express": "^4.21.2",
"minecraft-data": "^3.105.0",
"playwright": "^1.58.2",
@@ -382,6 +383,15 @@
"node": ">= 0.6"
}
},
"node_modules/adm-zip": {
"version": "0.5.16",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz",
"integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==",
"license": "MIT",
"engines": {
"node": ">=12.0"
}
},
"node_modules/ajv": {
"version": "8.18.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz",