"use strict";(()=>{var e={};e.id=541,e.ids=[541],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},21764:e=>{e.exports=require("util")},28841:(e,r,o)=>{o.r(r),o.d(r,{originalPathname:()=>j,patchFetch:()=>R,requestAsyncStorage:()=>g,routeModule:()=>d,serverHooks:()=>x,staticGenerationAsyncStorage:()=>m});var t={};o.r(t),o.d(t,{POST:()=>l});var s=o(49303),n=o(88716),a=o(60670),i=o(87070),c=o(97425),u=o(61318);let p="[Clone API]";async function l(e){try{let{cloneUrl:r,targetDir:o}=await e.json();if(!r||"string"!=typeof r||""===r.trim())return i.NextResponse.json({success:!1,error:{category:"validation",code:"EMPTY_URL",message:"Clone URL is required",recoverable:!0,suggestedAction:"Please enter a valid git clone URL"}},{status:400});let t=(0,c.n)(),s=new u.v(t);console.info(`${p} Starting clone job for: ${r}`);let n=await s.startCloneJob(r.trim(),o);if(!n.success){let e=400;return(n.error?.code==="DUPLICATE_CLONE_URL"||n.error?.code==="CLONE_IN_PROGRESS")&&(e=409),console.warn(`${p} Clone job failed: ${n.error?.code} - ${n.error?.message}`),i.NextResponse.json({success:!1,error:n.error,jobId:n.jobId},{status:e})}return console.info(`${p} Clone job created: ${n.jobId}`),i.NextResponse.json({success:!0,jobId:n.jobId,status:"pending",message:"Clone job started"},{status:202})}catch(e){return console.error(`${p} Unexpected error:`,e),i.NextResponse.json({success:!1,error:{category:"system",code:"INTERNAL_ERROR",message:"Failed to start clone job",recoverable:!1,suggestedAction:"Please try again later"}},{status:500})}}let d=new s.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/repositories/clone/route",pathname:"/api/repositories/clone",filename:"route",bundlePath:"app/api/repositories/clone/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/repositories/clone/route.ts",nextConfigOutput:"",userland:t}),{requestAsyncStorage:g,staticGenerationAsyncStorage:m,serverHooks:x}=d,j="/api/repositories/clone/route";function R(){return(0,a.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:m})}}};var r=require("../../../../webpack-runtime.js");r.C(e);var o=e=>r(r.s=e),t=r.X(0,[8948,5972,7425,1318],()=>o(28841));module.exports=t})();