"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,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>f,patchFetch:()=>j,requestAsyncStorage:()=>x,routeModule:()=>c,serverHooks:()=>I,staticGenerationAsyncStorage:()=>m});var o={};r.r(o),r.d(o,{PATCH:()=>d});var s=r(49303),i=r(88716),n=r(60670),a=r(87070),u=r(97425),l=r(75748),p=r(83513);async function d(e,{params:t}){try{let r=(0,u.getDbInstance)(),o=(0,l.gU)(r,t.id);if(!o)return a.NextResponse.json({error:`Worktree '${t.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,l.ly)(r,i),a.NextResponse.json(i,{status:200})}catch(e){return console.error("Error updating CLI tool:",e),a.NextResponse.json({error:"Failed to update CLI tool"},{status:500})}}let c=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:x,staticGenerationAsyncStorage:m,serverHooks:I}=c,f="/api/worktrees/[id]/cli-tool/route";function j(){return(0,n.patchFetch)({serverHooks:I,staticGenerationAsyncStorage:m})}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),o=t.X(0,[8948,5972,7425],()=>r(37514));module.exports=o})();