From 3ec508bf99f5cb101c324c99a236365167c10153 Mon Sep 17 00:00:00 2001 From: p-sw Date: Sun, 28 Jun 2026 22:53:56 +0900 Subject: [PATCH] fix: remove dependency of bun --- src/openrouter/promptLoader.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/openrouter/promptLoader.ts b/src/openrouter/promptLoader.ts index 6229c09..9f2e78c 100644 --- a/src/openrouter/promptLoader.ts +++ b/src/openrouter/promptLoader.ts @@ -1,5 +1,6 @@ import { readFile } from "fs/promises"; -import path from "path"; +import path, { dirname } from "path"; +import { fileURLToPath } from "url"; const prompts = [ "PERSONA_INIT", @@ -19,7 +20,9 @@ function fileName(promptKey: PromptKey): string { return promptKey.toLowerCase() + ".md"; } -const PROMPTS_DIR = path.resolve(import.meta.dir, "../../prompts"); +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const PROMPTS_DIR = path.resolve(__dirname, "../../prompts"); export async function loadPrompt(promptKey: PromptKey): Promise { const filePath = path.join(PROMPTS_DIR, fileName(promptKey));