"use strict";(()=>{var e={};e.id=9086,e.ids=[9086],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")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},51057:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>m,patchFetch:()=>f,requestAsyncStorage:()=>x,routeModule:()=>c,serverHooks:()=>q,staticGenerationAsyncStorage:()=>g});var o={};t.r(o),t.d(o,{POST:()=>d});var s=t(49303),i=t(88716),n=t(60670),p=t(87070),u=t(97425),a=t(75748),l=t(59991);async function d(e,{params:r}){try{let t=(0,u.n)();if(!(0,a.gU)(t,r.id))return p.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let o=await e.json(),s=["claude","codex","gemini"];if(!o.cliToolId||!s.includes(o.cliToolId))return p.NextResponse.json({error:`Invalid CLI tool ID. Must be one of: ${s.join(", ")}`},{status:400});return console.log(`[API] Manually starting polling for ${r.id} (${o.cliToolId})`),(0,l.cn)(r.id,o.cliToolId),p.NextResponse.json({success:!0,message:`Started polling for ${o.cliToolId} session`})}catch(e){return console.error("Error starting polling:",e),p.NextResponse.json({error:"Failed to start polling"},{status:500})}}let c=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/start-polling/route",pathname:"/api/worktrees/[id]/start-polling",filename:"route",bundlePath:"app/api/worktrees/[id]/start-polling/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/start-polling/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:x,staticGenerationAsyncStorage:g,serverHooks:q}=c,m="/api/worktrees/[id]/start-polling/route";function f(){return(0,n.patchFetch)({serverHooks:q,staticGenerationAsyncStorage:g})}}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8948,5972,3853,4893,7425,7213,1528,9723],()=>t(51057));module.exports=o})();