"use strict";(()=>{var e={};e.id=9542,e.ids=[9542],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")},82935:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>h,patchFetch:()=>g,requestAsyncStorage:()=>x,routeModule:()=>c,serverHooks:()=>q,staticGenerationAsyncStorage:()=>m});var o={};t.r(o),t.d(o,{GET:()=>d});var s=t(49303),i=t(88716),u=t(60670),n=t(87070),a=t(97425),p=t(75748),l=t(38693);async function d(e,{params:r}){try{if(!(0,l.m$)(r.id))return n.NextResponse.json({error:"Invalid worktree ID format"},{status:400});let e=(0,a.getDbInstance)();if(!(0,p.gU)(e,r.id))return n.NextResponse.json({error:`Worktree '${r.id}' not found`},{status:404});let t=e.prepare(`
      SELECT el.id, el.schedule_id, el.worktree_id, el.message, el.exit_code, el.status, el.started_at, el.completed_at, el.created_at,
             se.name AS schedule_name
      FROM execution_logs el
      LEFT JOIN scheduled_executions se ON el.schedule_id = se.id
      WHERE el.worktree_id = ?
      ORDER BY el.created_at DESC
      LIMIT 100
    `).all(r.id);return n.NextResponse.json({logs:t},{status:200})}catch(e){return console.error("Error fetching execution logs:",e),n.NextResponse.json({error:"Failed to fetch execution logs"},{status:500})}}let c=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/execution-logs/route",pathname:"/api/worktrees/[id]/execution-logs",filename:"route",bundlePath:"app/api/worktrees/[id]/execution-logs/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/execution-logs/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:x,staticGenerationAsyncStorage:m,serverHooks:q}=c,h="/api/worktrees/[id]/execution-logs/route";function g(){return(0,u.patchFetch)({serverHooks:q,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,2509,7425,7566,4952,8693],()=>t(82935));module.exports=o})();