module.exports=[688947,(e,r,t)=>{r.exports=e.x("stream",()=>require("stream"))},449719,(e,r,t)=>{r.exports=e.x("assert",()=>require("assert"))},500874,(e,r,t)=>{r.exports=e.x("buffer",()=>require("buffer"))},406461,(e,r,t)=>{r.exports=e.x("zlib",()=>require("zlib"))},921517,(e,r,t)=>{r.exports=e.x("http",()=>require("http"))},504446,(e,r,t)=>{r.exports=e.x("net",()=>require("net"))},755004,(e,r,t)=>{r.exports=e.x("tls",()=>require("tls"))},792509,(e,r,t)=>{r.exports=e.x("url",()=>require("url"))},410430,(e,r,t)=>{r.exports=e.x("async_hooks",()=>require("async_hooks"))},145706,(e,r,t)=>{r.exports=e.x("querystring",()=>require("querystring"))},363890,(e,r,t)=>{r.exports=e.x("stream/web",()=>require("stream/web"))},37702,(e,r,t)=>{r.exports=e.x("worker_threads",()=>require("worker_threads"))},60438,(e,r,t)=>{r.exports=e.x("perf_hooks",()=>require("perf_hooks"))},178249,(e,r,t)=>{r.exports=e.x("util/types",()=>require("util/types"))},154993,(e,r,t)=>{r.exports=e.x("diagnostics_channel",()=>require("diagnostics_channel"))},925328,(e,r,t)=>{r.exports=e.x("http2",()=>require("http2"))},611913,(e,r,t)=>{r.exports=e.x("console",()=>require("console"))},675990,e=>{"use strict";var r=e.i(680717);async function t(e){let t=`workflows/${e.userId}/${e.timestamp}-${e.projectName}.json`,o=await (0,r.put)(t,JSON.stringify(e,null,2),{access:"public",addRandomSuffix:!1,allowOverwrite:!0});return console.log(`[Workflow Storage] Saved run to: ${o.url}`),o.url}async function o(e){let t=`workflows/${e}/`,{blobs:o}=await (0,r.list)({prefix:t});return(await Promise.all(o.map(async e=>{try{let r=await fetch(e.url);return await r.json()}catch(r){return console.error(`[Workflow Storage] Failed to fetch ${e.url}:`,r),null}}))).filter(e=>null!==e).sort((e,r)=>new Date(r.timestamp).getTime()-new Date(e.timestamp).getTime())}async function s(e,r){return(await o(e)).find(e=>e.id===r)||null}async function l(e,r,s,l,i,a,n){let u=(await o(e)).find(e=>e.id===r)||{id:r,userId:e,projectName:s,timestamp:l,status:"running"};u.stepNumber=i,u.currentStep=a,n&&(u.sandboxUrl=n),await t(u),console.log(`[Workflow Storage] Updated progress: Step ${i} - ${a}`)}async function i(e,t){let s=(await o(e)).filter(e=>t.includes(e.id)),l=[],i=0;for(let t of s){let o=[],s=`workflows/${e}/${t.timestamp}-${t.projectName}.json`,{blobs:a}=await (0,r.list)({prefix:s});for(let e of a)o.push(e.url);t.beforeScreenshotUrl&&o.push(t.beforeScreenshotUrl),t.afterScreenshotUrl&&o.push(t.afterScreenshotUrl),t.reportBlobUrl&&o.push(t.reportBlobUrl);try{o.length>0&&(await (0,r.del)(o),console.log(`[Workflow Storage] Deleted ${o.length} blobs for run ${t.id}`)),i++}catch(r){let e=`Failed to delete run ${t.id}: ${r instanceof Error?r.message:String(r)}`;console.error(`[Workflow Storage] ${e}`),l.push(e)}}return{deleted:i,errors:l}}e.s(["deleteWorkflowRuns",()=>i,"getWorkflowRun",()=>s,"listWorkflowRuns",()=>o,"saveWorkflowRun",()=>t,"updateWorkflowProgress",()=>l])}];

//# sourceMappingURL=%5Broot-of-the-server%5D__18ce35ee._.js.map