"use strict";(()=>{var e={};e.id=2469,e.ids=[2469],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")},33731:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>y,patchFetch:()=>v,requestAsyncStorage:()=>x,routeModule:()=>h,serverHooks:()=>m,staticGenerationAsyncStorage:()=>g});var o={};r.r(o),r.d(o,{GET:()=>f});var n=r(49303),i=r(88716),s=r(60670),a=r(87070),u=r(94925),l=r(30721),c=r(46155),d=r(95614);let p=(0,r(43895).h)("api/execution-logs");async function f(e,{params:t}){try{if(!(0,c.m$)(t.id))return a.NextResponse.json({error:"Invalid worktree ID format"},{status:400});if(!(0,d.wx)(t.logId))return a.NextResponse.json({error:"Invalid log ID format"},{status:400});let e=(0,u.getDbInstance)();if(!(0,l.gU)(e,t.id))return a.NextResponse.json({error:`Worktree '${t.id}' not found`},{status:404});let r=e.prepare("SELECT * FROM execution_logs WHERE id = ? AND worktree_id = ?").get(t.logId,t.id);if(!r)return a.NextResponse.json({error:"Execution log not found"},{status:404});return a.NextResponse.json({log:r},{status:200})}catch(e){return p.error("error-fetching-execution-log:",{error:e instanceof Error?e.message:String(e)}),a.NextResponse.json({error:"Failed to fetch execution log"},{status:500})}}let h=new n.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/execution-logs/[logId]/route",pathname:"/api/worktrees/[id]/execution-logs/[logId]",filename:"route",bundlePath:"app/api/worktrees/[id]/execution-logs/[logId]/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/execution-logs/[logId]/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:x,staticGenerationAsyncStorage:g,serverHooks:m}=h,y="/api/worktrees/[id]/execution-logs/[logId]/route";function v(){return(0,s.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:g})}},95614:(e,t,r)=>{r.d(t,{ME:()=>o,wx:()=>s,xT:()=>n});let o=100,n=1e4,i=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function s(e){return i.test(e)}},46155:(e,t,r)=>{r.d(t,{iH:()=>p,jj:()=>c,kz:()=>d,m$:()=>u});var o=r(55315),n=r.n(o),i=r(92048);let s=(0,r(43895).h)("path-validator"),a=/^[a-zA-Z0-9_-]+$/;function u(e){return!!e&&0!==e.length&&a.test(e)}function l(e,t){return e===t||e.startsWith(t+n().sep)}function c(e,t){if(!e||""===e.trim()||e.includes("\0"))return!1;let r=e;try{r=decodeURIComponent(e)}catch{r=e}if(r.includes("\0"))return!1;let o=n().resolve(t),i=n().resolve(t,r),s=n().relative(o,i);return!(s.startsWith("..")||n().isAbsolute(s))}function d(e,t){if(!e||""===e.trim())throw Error("Invalid path: Path cannot be empty");if(e.includes("\0"))throw Error("Invalid path: Null bytes not allowed");if(!c(e,t))throw Error(`Path is outside allowed directory: ${e} (allowed root: ${t})`);let r=e;try{r=decodeURIComponent(e)}catch{r=e}return n().resolve(t,r)}function p(e,t){let r;try{r=(0,i.realpathSync)(t)}catch{return!1}let o=n().resolve(t,e);if((0,i.existsSync)(o))try{let t=(0,i.realpathSync)(o),n=l(t,r);return n||s.warn("security:symlink-rejected",{targetPath:e,resolvedTarget:t}),n}catch{return!1}try{if((0,i.lstatSync)(o).isSymbolicLink())try{let t=(0,i.readlinkSync)(o),a=n().resolve(n().dirname(o),t),u=l(a,r);return u||s.warn("security:dangling-symlink-rejected",{targetPath:e,resolvedLinkTarget:a}),u}catch{return!1}}catch{}let a=n().dirname(o);for(;a!==n().dirname(a);){if((0,i.existsSync)(a))try{let e=(0,i.realpathSync)(a),t=l(e,r);return t||s.warn("security:symlink-ancestor-rejected",{currentPath:a,resolvedAncestor:e}),t}catch{break}a=n().dirname(a)}return!1}}};var t=require("../../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),o=t.X(0,[8948,5972,3895,4925,721],()=>r(33731));module.exports=o})();