Skip to content

You can now generate creatures directly within your project. Drop the open-source into your Agent, and start prompting what you want.

JavaScript
905 B
Raw Blame
// Regenerates engine/core/contract.js (CommonJS) from harness/glbcheck.mjs (ESM).
// One implementation of the contract, two module systems: the engine is CJS and
// dependency-free, the harness copy is importable by a server/Worker. Run this
// after editing glbcheck.mjs; synccheck.py fails the build if they drift.
import fs from 'fs';
const src = fs.readFileSync('harness/glbcheck.mjs', 'utf8');
const body = src.slice(src.indexOf("'use strict';"), src.indexOf('// ── CLI ──'))
  .replace('export function checkGLB', 'function checkGLB');
fs.writeFileSync('engine/core/contract.js',
  '// ACS engine — GLB output contract check (CommonJS mirror of harness/glbcheck.mjs).\n' +
  '// GENERATED by tools/sync-contract.mjs — do not edit; edit the harness copy.\n' +
  body + '\nmodule.exports = { checkGLB };\n');
console.log('engine/core/contract.js regenerated from harness/glbcheck.mjs');