P-NP is the static patch pipeline that powers Play Origin (the browser-extension mod loader, formerly "Prodigy Origin"). It's maintained by ProdigyPXP. The repo name P-NP is kept as-is — the rebrand is to the extension/loader, not this patcher.
The repository no longer runs an HTTP server. Instead, a GitHub Action fetches current Prodigy assets, applies the patcher logic, and pushes the patched files to a dedicated patched branch so they can be served from raw.githubusercontent.com.
The patcher's primary artifact is dist/manifest.json — a small JSON file containing:
schemaVersion— manifest schema version for compatibility checks.patcherVersion— version of this patcher that produced the manifest.rules— ordered list of regex find/replace rules applied togame.min.js.prefix— pre-rendered JS string prepended to the patched game.suffix— pre-rendered JS string appended after the patched game.defaultMenuUrl— default menu/loader URL used by consumers when patching.hash— content hash of{rules, prefix, suffix, defaultMenuUrl}for cache invalidation.
The Play Origin extension fetches this manifest, fetches the original game.min.js
from code.prodigygame.com, applies the rules locally in its background service
worker, wraps with prefix/suffix, and caches the result in chrome.storage.local.
dist/game.min.js is still produced as a verification copy so this repo's history
stays auditable, but the extension no longer fetches it.
.github/workflows/patch.ymlruns every 2 hours (cron) and on manual dispatch.- The workflow builds this project with
pnpm+esbuild. src/patch.tsfetches:- loader HTML from
https://math.prodigygame.com/load game.min.jsfromhttps://code.prodigygame.com- the matching
public-game.min.js
- loader HTML from
- The patcher writes static output files:
game.min.jspublic-game.min.jsmetadata.json(includespatchDegradedflag if patches failed)
- The workflow commits those files to the
patchedbranch. - If the workflow fails, a GitHub issue is automatically created.
- 30-second fetch timeout on all network requests
- JavaScript validation before patching to catch unexpected responses
- Degraded patch detection - if core regex patterns fail,
patchDegraded: trueis set in metadata.json - Error handling throughout the build and patch pipeline
Requirements:
- Node.js 20+
- pnpm
Install and build:
pnpm install
pnpm buildRun patch locally:
pnpm run patchOptional custom output directory:
node dist/patch.js ./patched-outputAfter the Action publishes to the patched branch, files are available at:
https://raw.githubusercontent.com/ProdigyPXP/P-NP/patched/game.min.jshttps://raw.githubusercontent.com/ProdigyPXP/P-NP/patched/public-game.min.jshttps://raw.githubusercontent.com/ProdigyPXP/P-NP/patched/metadata.json
MPL-2.0