export const IMAGES = { moshell: 'ghcr.io/moshell-lang/moshell:master', }; /** * Prepares a buffer to be sent to the runner. * * @param jobId The job unique identifier. * @param code The code to be executed. * @param image The image to be used. */ export function allocateBuffer(jobId: string, code: string, image: string): Buffer { let cur = 0; const buffer = Buffer.allocUnsafe(jobId.length + image.length + code.length + 9); cur = buffer.writeUInt8(0, cur); cur += buffer.write(jobId, cur); cur = buffer.writeUInt32BE(image.length, cur); cur = buffer.writeUInt32BE(code.length, cur); cur += buffer.write(image, cur); buffer.write(code, cur); return buffer; }