import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; import { dirname } from "node:path"; import type { WebUiPaths } from "../config/paths.ts"; export function readSystemPrompt(paths: WebUiPaths): string { if (!existsSync(paths.systemPromptFile)) return ""; return readFileSync(paths.systemPromptFile, "utf8"); } export function writeSystemPrompt(paths: WebUiPaths, content: string): void { mkdirSync(dirname(paths.systemPromptFile), { recursive: true }); writeFileSync(paths.systemPromptFile, content, "utf8"); }