// Collect every direction from runs/ into one static site: // site//... the agent's files, untouched // site/content/ shared posts.json (directions fetch ../content/posts.json) // site/index.html a list of the directions // node scripts/build-site.mjs [out=site] import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; import { join, resolve } from 'node:path'; const ROOT = resolve(import.meta.dirname, '..'); const RUNS = join(ROOT, 'runs'); const OUT = resolve(ROOT, process.argv[2] ?? 'site'); const RESERVED = new Set(['content', 'inspo']); rmSync(OUT, { recursive: true, force: true }); mkdirSync(OUT, { recursive: true }); const directions = []; for (const run of readdirSync(RUNS).sort()) { const dir = join(RUNS, run); if (!existsSync(join(dir, 'meta.json'))) continue; const meta = JSON.parse(readFileSync(join(dir, 'meta.json'), 'utf8')); if (!existsSync(join(OUT, 'content'))) cpSync(join(dir, 'content'), join(OUT, 'content'), { recursive: true }); for (const name of readdirSync(dir)) { if (RESERVED.has(name) || name.startsWith('.') || name.startsWith('_')) continue; if (!existsSync(join(dir, name, 'index.html'))) continue; if (existsSync(join(OUT, name))) throw new Error(`direction name collision: ${name}`); cpSync(join(dir, name), join(OUT, name), { recursive: true }); directions.push({ name, run: run.slice(0, 19), model: meta.model }); } } const rows = directions.map(d => `
  • ${d.name}${d.run} ยท ${d.model}
  • `).join('\n'); writeFileSync(join(OUT, 'index.html'), ` stylize

    stylize

    Blog redesign directions generated by opus-5-5 from one prompt and a set of inspo images.

    `); console.log(`${directions.length} directions -> ${OUT}`);