import path from 'path';

// @ts-expect-error
const source = await Bun.file(
	path.join(__dirname, 'static', 'llms.txt'),
).text();

const output = Bun.file(
	path.join(__dirname, 'src', 'helpers', 'system-prompt.ts'),
);

const tsText =
	[
		'// Auto-generated by bun update-prompt.ts',
		'',
		'export const SYSTEM_PROMPT = `',
		source.replaceAll('`', '\\`'),
		'`.trimStart();',
	].join('\n') + '\n';

// @ts-expect-error
await Bun.write(output, tsText);
