diff --git a/packages/core/src/bench.ts b/packages/core/src/bench.ts index cf6550fa..ec779f67 100644 --- a/packages/core/src/bench.ts +++ b/packages/core/src/bench.ts @@ -3,7 +3,7 @@ import { execFile } from "node:child_process"; import { cpSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; -import { join, relative, resolve } from "node:path"; +import { dirname, join, relative, resolve } from "node:path"; import { fileURLToPath } from "node:url"; /** Файлы задачи, которые агент не видит: в рабочую копию они не копируются. */ @@ -64,10 +64,8 @@ export interface BenchContext { needs?: { title: string; secret?: string | null }[]; } -const here = fileURLToPath(new URL(".", import.meta.url)); - export function benchDir(): string { - return process.env.PEPPA_BENCH_DIR ? resolve(process.env.PEPPA_BENCH_DIR) : resolve(here, "../../../bench"); + return process.env.PEPPA_BENCH_DIR ? resolve(process.env.PEPPA_BENCH_DIR) : resolve(dirname(fileURLToPath(import.meta.url)), "../../../bench"); } function templateDir(): string {