diff --git a/packages/builder/src/vector/safety.ts b/packages/builder/src/vector/safety.ts index b06cfb9..179072e 100644 --- a/packages/builder/src/vector/safety.ts +++ b/packages/builder/src/vector/safety.ts @@ -8,7 +8,10 @@ const VECTOR_SPEND_LIMIT_DAILY = parseInt(process.env.VECTOR_SPEND_LIMIT_DAILY | const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); -const projectRoot = resolve(__dirname, '../..'); +// From the bundled entrypoint's directory (packages/builder/build), three levels +// up lands on the repo root, which is where .env.example and the README document +// the default audit log path (./vector-audit-log.json) as living. +const projectRoot = resolve(__dirname, '../../..'); export class SafetyLayer { private dailySpent: number = 0; diff --git a/packages/builder/src/vector/vector.ts b/packages/builder/src/vector/vector.ts index 5bef9e9..0b79e35 100644 --- a/packages/builder/src/vector/vector.ts +++ b/packages/builder/src/vector/vector.ts @@ -24,7 +24,9 @@ import type { // Direct .env loading const __filename = fileURLToPath(import.meta.url); -const projectRoot = resolve(__filename, '../../../../..'); +// From the bundled entrypoint at packages/builder/build/index.js, four levels +// up from the file lands on the repo root (build -> builder -> packages -> root). +const projectRoot = resolve(__filename, '../../../..'); const envPath = resolve(projectRoot, '.env'); if (existsSync(envPath)) {