Skip to content

lainx06/hexorcist

v0.1.0MIT

Checks small ATmega328P programs with plain-English rules and seeded gremlins on an emulated chip, then reports a replayable trace.

commands

  • node
plugin.json
name
hexorcist
version
0.1.0
description
Checks small ATmega328P programs with plain-English rules and seeded gremlins on an emulated chip, then reports a replayable trace.
license
MIT
mcp.json
  • hexorciststdionode -e const fs=require('fs'),path=require('path'),os=require('os'),cp=require('child_process');const cwd=process.cwd();const root=process.env.HEXORCIST_ROOT?path.resolve(process.env.HEXORCIST_ROOT):cwd;function fail(m){try{fs.appendFileSync(path.join(os.tmpdir(),'hexorcist-launcher.log'),m+os.EOL)}catch(e){}process.exit(1)}const entry=path.join(root,'mcp','bin.ts');let tsx=path.join(root,'node_modules','tsx','dist','cli.mjs');if(!fs.existsSync(tsx)){try{const pj=path.join(root,'node_modules','tsx','package.json');const b=JSON.parse(fs.readFileSync(pj,'utf8')).bin;const rel=typeof b==='string'?b:b&&b.tsx;if(rel)tsx=path.join(path.dirname(pj),rel)}catch(e){}}if(!fs.existsSync(entry))fail('missing '+entry);if(!fs.existsSync(tsx))fail('missing '+tsx);const env=Object.assign({},process.env,{INIT_CWD:root});const child=cp.spawn(process.execPath,[tsx,'--no-deprecation',entry],{cwd:root,stdio:'inherit',env});child.on('error',function(e){fail('start failed: '+e.message)});child.on('exit',function(c){process.exit(c===null?1:c)});