import {
  init_dist
} from "./chunk-4DWOMGUM.js";
import {
  Err,
  Ok
} from "./chunk-RL4VMEXL.js";

// src/mcp/utils/config-resolver.ts
init_dist();
import * as fs from "fs";
import * as path from "path";
function resolveProjectConfig(projectPath) {
  const configPath = path.join(projectPath, "harness.config.json");
  if (!fs.existsSync(configPath)) {
    return Err(new Error(`No harness.config.json found in ${projectPath}`));
  }
  try {
    const raw = fs.readFileSync(configPath, "utf-8");
    const config = JSON.parse(raw);
    return Ok(config);
  } catch (error) {
    return Err(
      new Error(`Failed to parse config: ${error instanceof Error ? error.message : String(error)}`)
    );
  }
}

export {
  resolveProjectConfig
};
