{"version":3,"file":"output-root-BK4pdjyz.mjs","names":[],"sources":["../src/workspace/output-root.ts"],"sourcesContent":["import path from 'node:path'\nimport { findActiveWorkspace } from './active.js'\n\nexport const NO_WORKSPACE_ERROR = 'No Chain Insights workspace found. Run: cia init .'\n\nexport interface WorkspaceOutputPaths {\n  root: string\n  metadataDir: string\n  schemaDir: string\n  runtimeDir: string\n  artifactsRoot: string\n  entitiesRoot: string\n  sessionsRoot: string\n  publishedRoot: string\n  reportsRoot: string\n  reportGraphsRoot: string\n  reportTablesRoot: string\n  logsRoot: string\n}\n\nexport function requireWorkspaceRoot(startDir = process.cwd()): string {\n  const workspace = findActiveWorkspace(startDir)\n  if (!workspace) throw new Error(NO_WORKSPACE_ERROR)\n  return workspace.root\n}\n\nexport function workspaceOutputPaths(workspaceRoot = requireWorkspaceRoot()): WorkspaceOutputPaths {\n  const root = path.resolve(workspaceRoot)\n  return {\n    root,\n    metadataDir: path.join(root, '.chain-insights'),\n    schemaDir: path.join(root, '.chain-insights', 'schema'),\n    runtimeDir: path.join(root, '.chain-insights', 'runtime'),\n    artifactsRoot: path.join(root, 'artifacts'),\n    entitiesRoot: path.join(root, 'entities'),\n    sessionsRoot: path.join(root, 'sessions'),\n    publishedRoot: path.join(root, 'published'),\n    reportsRoot: path.join(root, 'reports'),\n    reportGraphsRoot: path.join(root, 'reports', 'graphs'),\n    reportTablesRoot: path.join(root, 'reports', 'tables'),\n    logsRoot: path.join(root, '.chain-insights', 'runtime', 'logs'),\n  }\n}\n"],"mappings":";;;;;;;;;AAGA,MAAa,qBAAqB;AAiBlC,SAAgB,qBAAqB,WAAW,QAAQ,IAAI,GAAW;CACrE,MAAM,YAAY,oBAAoB,QAAQ;CAC9C,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,kBAAkB;CAClD,OAAO,UAAU;AACnB;AAEA,SAAgB,qBAAqB,gBAAgB,qBAAqB,GAAyB;CACjG,MAAM,OAAO,KAAK,QAAQ,aAAa;CACvC,OAAO;EACL;EACA,aAAa,KAAK,KAAK,MAAM,iBAAiB;EAC9C,WAAW,KAAK,KAAK,MAAM,mBAAmB,QAAQ;EACtD,YAAY,KAAK,KAAK,MAAM,mBAAmB,SAAS;EACxD,eAAe,KAAK,KAAK,MAAM,WAAW;EAC1C,cAAc,KAAK,KAAK,MAAM,UAAU;EACxC,cAAc,KAAK,KAAK,MAAM,UAAU;EACxC,eAAe,KAAK,KAAK,MAAM,WAAW;EAC1C,aAAa,KAAK,KAAK,MAAM,SAAS;EACtC,kBAAkB,KAAK,KAAK,MAAM,WAAW,QAAQ;EACrD,kBAAkB,KAAK,KAAK,MAAM,WAAW,QAAQ;EACrD,UAAU,KAAK,KAAK,MAAM,mBAAmB,WAAW,MAAM;CAChE;AACF"}