"use strict";(()=>{var e={};e.id=4095,e.ids=[4095],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")},56660:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>g,patchFetch:()=>h,requestAsyncStorage:()=>y,routeModule:()=>m,serverHooks:()=>k,staticGenerationAsyncStorage:()=>f});var s={};t.r(s),t.d(s,{POST:()=>q});var o=t(49303),i=t(88716),a=t(60670),n=t(87070),p=t(83513),u=t(55837),l=t(30721),d=t(94925),c=t(85930);let x=(0,t(43895).h)("api/special-keys");async function q(e,{params:r}){let t;try{t=await e.json()}catch{return n.NextResponse.json({error:"Invalid request body"},{status:400})}try{let{cliToolId:e,keys:s}=t;if(!e||"string"!=typeof e||!(0,p._7)(e))return n.NextResponse.json({error:"Invalid cliToolId parameter"},{status:400});if(!Array.isArray(s)||0===s.length||!s.every(e=>"string"==typeof e)||s.length>10)return n.NextResponse.json({error:"Invalid keys parameter"},{status:400});for(let e of s)if(!(0,c.CJ)(e))return n.NextResponse.json({error:"Invalid special key"},{status:400});let o=(0,d.getDbInstance)();if(!(0,l.gU)(o,r.id))return n.NextResponse.json({error:"Worktree not found"},{status:404});let i=u.g.getInstance().getTool(e).getSessionName(r.id);if(!await (0,c.Hk)(i))return n.NextResponse.json({error:"Session not found"},{status:404});return await (0,c.VZ)(i,s),n.NextResponse.json({success:!0})}catch(e){return x.error("special-keys-api-error:",{error:e instanceof Error?e.message:String(e)}),n.NextResponse.json({error:"Failed to send special keys to terminal"},{status:500})}}let m=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/special-keys/route",pathname:"/api/worktrees/[id]/special-keys",filename:"route",bundlePath:"app/api/worktrees/[id]/special-keys/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/special-keys/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:y,staticGenerationAsyncStorage:f,serverHooks:k}=m,g="/api/worktrees/[id]/special-keys/route";function h(){return(0,a.patchFetch)({serverHooks:k,staticGenerationAsyncStorage:f})}}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8948,5972,3853,4893,3895,4925,721,9228],()=>t(56660));module.exports=s})();