import fs from "fs";
import path from "path";
export const head = (arr) => arr[0];
export const tail = (arr) => arr.slice(1);
export const empty = (arr) => arr.length === 0;
export function builtinRead(args) {
    const filePath = path.resolve(args.dirname, args.filename);
    const data = fs.readFileSync(filePath);
    const contents = data.toString("utf8");
    return contents;
}
export function builtinSleep(seconds) {
    return new Promise((resolve) => {
        setTimeout(resolve, seconds * 1000);
    });
}
export function readSkill(args) {
    return builtinRead({ filename: args.filepath, dirname: args.dirname });
}
