"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:()=>h,patchFetch:()=>v,requestAsyncStorage:()=>q,routeModule:()=>g,serverHooks:()=>f,staticGenerationAsyncStorage:()=>m});var o={};t.r(o),t.d(o,{POST:()=>x});var s=t(49303),i=t(88716),n=t(60670),p=t(87070),a=t(94925),u=t(30721),l=t(83350),d=t(83513);let c=(0,t(43895).h)("api/start-polling");async function x(e,{params:r}){try{let t=(0,a.getDbInstance)();if(!(0,u.gU)(t,r.id))return p.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let o=await e.json();if(!o.cliToolId||!d.tK.includes(o.cliToolId))return p.NextResponse.json({error:`Invalid CLI tool ID. Must be one of: ${d.tK.join(", ")}`},{status:400});return c.info("manually-starting-polling-for"),(0,l.cn)(r.id,o.cliToolId),p.NextResponse.json({success:!0,message:`Started polling for ${o.cliToolId} session`})}catch(e){return c.error("error-starting-polling:",{error:e instanceof Error?e.message:String(e)}),p.NextResponse.json({error:"Failed to start polling"},{status:500})}}let g=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:q,staticGenerationAsyncStorage:m,serverHooks:f}=g,h="/api/worktrees/[id]/start-polling/route";function v(){return(0,n.patchFetch)({serverHooks:f,staticGenerationAsyncStorage:m})}}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8948,5972,3853,4893,3895,4925,721,9228],()=>t(51057));module.exports=o})();