open, interoperable sandbox platform for agents and humans 📦 ✨ pocketenv.io
claude-code atproto sandbox openclaw agent
at main 35 lines 888 B view raw
1import chalk from "chalk"; 2import { readdirSync, statSync } from "fs"; 3import { join } from "path"; 4import { $ } from "zx"; 5import { consola } from "consola"; 6 7function getPklFilesRecursive(dir: string): string[] { 8 const entries = readdirSync(dir); 9 const files: string[] = []; 10 11 for (const entry of entries) { 12 const fullPath = join(dir, entry); 13 const stats = statSync(fullPath); 14 15 if (stats.isDirectory()) { 16 files.push(...getPklFilesRecursive(fullPath)); 17 continue; 18 } 19 20 if (entry.endsWith(".pkl")) { 21 files.push(fullPath); 22 } 23 } 24 25 return files; 26} 27 28const files = getPklFilesRecursive(join("pkl", "defs")); 29 30await Promise.all( 31 files.map(async (fullPath) => { 32 consola.info(`pkl eval ${chalk.cyan(fullPath)}`); 33 await $`pkl eval -f json ${fullPath} > ${fullPath.replace(/\.pkl$/, ".json").replace(/pkl[\\\/]defs/g, "lexicons")}`; 34 }), 35);