import { fileURLToPath as __fileURLToPath } from 'url';
import { dirname as __pathDirname } from 'path';
const __filename = __fileURLToPath(import.meta.url);
const __dirname = __pathDirname(__filename);
function deriveProjectId(repoPath) {
  const id = repoPath.replace(/\/+$/, "").split("/").pop() || "project";
  return id.toLowerCase().replace(/[^a-z0-9-]/g, "-").slice(-50) || "project";
}
function compactPlan(plan) {
  try {
    const steps = Array.isArray(plan?.steps) ? plan.steps.map((s) => ({
      id: s.id,
      title: s.title,
      acceptanceCriteria: s.acceptanceCriteria
    })) : [];
    return { summary: plan?.summary, steps, risks: plan?.risks };
  } catch {
    return plan;
  }
}
export {
  compactPlan,
  deriveProjectId
};
//# sourceMappingURL=utils.js.map
