feat: implemented supporters

This commit is contained in:
2026-06-02 23:42:38 +09:00
parent 4ed6264aed
commit 6c8ea50f31
7 changed files with 166 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
import { readFile } from "fs/promises";
import path from "path";
const prompts = ["PERSONA_INIT", "PERSONA_BASE_SYSTEM_PROMPT"] as const;
export type PromptKey = (typeof prompts)[number];
function fileName(promptKey: PromptKey): string {
return promptKey.toLowerCase() + ".md";
}
const PROMPTS_DIR = path.resolve(import.meta.dir, "../../prompts");
export async function loadPrompt(promptKey: PromptKey): Promise<string> {
const filePath = path.join(PROMPTS_DIR, fileName(promptKey));
return readFile(filePath, "utf-8");
}