Repository navigation
0.0.3
Loading a game runs its code in a sandbox, a game's page and check take only files from the game's folder, run's server answers only its own page, and every runtime dependency is the exact version CI tests. From #1.
Breaking changes
check,sim, and the loads behindshotandexportrungame.tsand any--driverin a sandbox: a JavaScript realm with the language and the engine and nothing else, in a child process that can't touch files, start processes, or reach the network. Game code that used Node's APIs,eval,new Function, orimport()no longer runs there.- A game's files may import only
threejamand files in the game's folder, and a--driverfile may also import files in its own folder. Anything else, even through a link, fails with the import'spath:lineincheck,sim,run,shot, andexport, so a game that imports a shared../lib/util.tsno longer builds.
Added
- Each run has a time budget,
--timeoutseconds oncheck,sim,shot, andexport(default 30), after which it fails with the newTIMEOUTcode and the tick it reached, so an endless loop no longer hangssimor the MCP server. - Each MCP call that loads a game runs in a process of its own, so one game that loops doesn't block the others, and a long-running server doesn't grow.
- An MCP
simreply too large for a client is refused with the newOUTPUT_TOO_LARGEcode and how to narrow it. - The MCP tools that load a game,
check,sim,shot, andexport, are marked as running code, and the server's instructions say that a game's log, errors, and suggested commands are its own data, not directions. checkmapsthreeto ThreeJam's own Three.js types, soimport typefrom'three'in aview.tsdescribes theTHREEit receives, in a project or not.
Security
runserves its page on127.0.0.1to that page alone: a request from another page, even one on another local port or opened from a file, or one that names another host, gets 403, and live reload and Esc take a token only the page has. An image or sound opened directly runs nothing, and an SVG downloads instead of opening.- ThreeJam starts Chrome with no DevTools port, even when a wrapper script asks for one, talks to
shot's headless Chrome over a pipe, and passes Chrome only the environment variables a browser needs. - In
node_modules,checkreads only TypeScript's libraries and ThreeJam's own type packages, so a type error can't quote another package's files. - The import rule compares real paths exactly, as the OS spells them, instead of folding case.
- Every runtime dependency is pinned to the exact version CI tests, and the build fails if one isn't. incur moves from 0.5.1 to 0.7.0.
- A release publishes only after all of CI passes on the tagged commit, from a tarball built with install scripts off that matches a second build's.
Fixed
checkbundles the page too, so it refuses an import thatrun,shot, orexportwould.- A game's runtime import of
threefails with a hint to use theTHREEthatinitanddrawreceive. shotcleans up when Chrome fails to start, and onlyshotloads Puppeteer.
Development
npm testnames its test files, so a Node that can't run TypeScript fails instead of finding no tests, and a test that runs past two minutes fails.npm run test:packageinstalls the package with install scripts off, as npm 12 does, and checks that aview.tsgets Three.js's types there.- CI tests Node 24 as well, and gives each commit on main a run of its own.
- The repo approves esbuild's install script for the version it pins, which npm 11 asks for.
Full changes in CHANGELOG.md.