diff --git a/apps/trigger/src/tasks/analyst-agent-task/analyst-agent-task.ts b/apps/trigger/src/tasks/analyst-agent-task/analyst-agent-task.ts index f74bdc6aa..76e821fc7 100644 --- a/apps/trigger/src/tasks/analyst-agent-task/analyst-agent-task.ts +++ b/apps/trigger/src/tasks/analyst-agent-task/analyst-agent-task.ts @@ -357,7 +357,7 @@ export const analystAgentTask: ReturnType< dataSourceId: dataSource.dataSourceId, dataSourceSyntax: dataSource.dataSourceSyntax, datasetsCount: datasets.length, - datasets: datasets.map((d) => ({ + datasets: datasets.map((d: PermissionedDataset) => ({ id: d.id, name: d.name, })), diff --git a/packages/env-utils/src/index.ts b/packages/env-utils/src/index.ts index f242675ac..6a0807c22 100644 --- a/packages/env-utils/src/index.ts +++ b/packages/env-utils/src/index.ts @@ -7,16 +7,19 @@ import { config } from 'dotenv'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); -// Find the root of the monorepo (where turbo.json is) +// Find the root of the monorepo (where turbo.json and pnpm-workspace.yaml are) function findMonorepoRoot(): string { let currentDir = __dirname; while (currentDir !== '/') { - if (existsSync(path.join(currentDir, 'turbo.json'))) { + const turboPath = path.join(currentDir, 'turbo.json'); + const pnpmWorkspacePath = path.join(currentDir, 'pnpm-workspace.yaml'); + // Look for both turbo.json AND pnpm-workspace.yaml to ensure we find the actual root + if (existsSync(turboPath) && existsSync(pnpmWorkspacePath)) { return currentDir; } currentDir = path.dirname(currentDir); } - throw new Error('Could not find monorepo root (turbo.json)'); + throw new Error('Could not find monorepo root (turbo.json + pnpm-workspace.yaml)'); } // Load environment variables from root .env file