Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

1.2 KB
Raw Blame
import {test} from 'node:test';import assert from 'node:assert/strict';import {mkdtemp,cp,symlink,readFile,rm} from 'node:fs/promises';import {join} from 'node:path';import {tmpdir} from 'node:os';import {fileURLToPath} from 'node:url';import {execFileSync} from 'node:child_process';
const pkg=fileURLToPath(new URL('..',import.meta.url));
test('real command entry points run through a symlinked workspace path',async()=>{const dir=await mkdtemp(join(tmpdir(),'relay-entry-')),root=join(dir,'real'),link=join(dir,'shortcut');await cp(join(pkg,'template'),root,{recursive:true});await symlink(root,link,'dir');const env={...process.env,GAME_DSH_DIR:pkg};try{const built=JSON.parse(execFileSync(process.execPath,[join(link,'tools/build.mjs')],{cwd:link,env,encoding:'utf8'}));assert.equal(built.title,'Pocket Conservatory');const checked=JSON.parse(execFileSync(process.execPath,[join(link,'tools/check.mjs'),'--seeds','2'],{cwd:link,env,encoding:'utf8'}));assert.equal(checked.completed,2);assert.equal(checked.repeated,true);assert.equal(JSON.parse(await readFile(join(root,'.harness/game-check.json'),'utf8')).games.length,2);}finally{await rm(dir,{recursive:true,force:true});}});