"use strict";(()=>{var e={};e.id=3096,e.ids=[3096],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")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},37514:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>I,patchFetch:()=>h,requestAsyncStorage:()=>m,routeModule:()=>x,serverHooks:()=>g,staticGenerationAsyncStorage:()=>f});var o={};t.r(o),t.d(o,{PATCH:()=>c});var s=t(49303),i=t(88716),n=t(60670),a=t(87070),l=t(94925),u=t(30721),p=t(83513);let d=(0,t(43895).h)("api/cli-tool");async function c(e,{params:r}){try{let t=(0,l.getDbInstance)(),o=(0,u.gU)(t,r.id);if(!o)return a.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let s=await e.json();if(!s||"object"!=typeof s||Array.isArray(s))return a.NextResponse.json({error:"Request body must be a JSON object"},{status:400});if(!("cliToolId"in s)||"string"!=typeof s.cliToolId||0===s.cliToolId.length)return a.NextResponse.json({error:"CLI tool ID is required"},{status:400});if(!(0,p._7)(s.cliToolId))return a.NextResponse.json({error:`Invalid CLI tool ID: ${s.cliToolId}. Valid values are: ${p.tK.join(", ")}`},{status:400});let i={...o,cliToolId:s.cliToolId,updatedAt:new Date};return(0,u.ly)(t,i),a.NextResponse.json(i,{status:200})}catch(e){return d.error("error-updating-cli-tool:",{error:e instanceof Error?e.message:String(e)}),a.NextResponse.json({error:"Failed to update CLI tool"},{status:500})}}let x=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/cli-tool/route",pathname:"/api/worktrees/[id]/cli-tool",filename:"route",bundlePath:"app/api/worktrees/[id]/cli-tool/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/cli-tool/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:m,staticGenerationAsyncStorage:f,serverHooks:g}=x,I="/api/worktrees/[id]/cli-tool/route";function h(){return(0,n.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:f})}}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8948,5972,3895,4925,721],()=>t(37514));module.exports=o})();