module.exports=[704690,a=>{"use strict";var b=a.i(376527),c=a.i(473176),d=a.i(902157),e=a.i(844376),f=a.i(750227),g=a.i(912714),h=a.i(660526);let i=[".next/workflow-data",".workflow-data","workflow-data"];function j(a){let b=a.split(f.sep).filter(Boolean);return 0===b.length?"/":1===b.length?b[0]:b.slice(-2).join("/")}async function k(a){try{return await (0,g.access)(a),!0}catch{return!1}}async function l(a){let b,c=(b=a.startsWith("~")?(0,f.join)((0,h.homedir)(),a.slice(1)):a,(0,f.isAbsolute)(b)?(0,f.resolve)(b):(0,f.resolve)(process.cwd(),b));if(!await k(c))return{projectDir:c,dataDir:void 0,shortName:j(c),error:"Folder does not exist"};let d=function(a){for(let b of i){let c=b.split("/").join(f.sep);if(a.endsWith(c)){let c=b.split("/").length,d=a;for(let a=0;a<c;a++)d=(0,f.dirname)(d);return{suffix:b,projectDir:d}}}return null}(c);if(d&&await k(c))return{projectDir:d.projectDir,dataDir:c,shortName:j(d.projectDir)};for(let a of i){let b=(0,f.join)(c,a);if(await k(b))return{projectDir:c,dataDir:(0,f.resolve)(b),shortName:j(c)}}let e=c,g=(0,f.resolve)("/");for(;e!==g;){for(let a of i){let b=(0,f.join)(e,a);if(await k(b))return{projectDir:e,dataDir:(0,f.resolve)(b),shortName:j(e)}}let a=(0,f.dirname)(e);if(a===e)break;e=a}return{projectDir:c,dataDir:void 0,shortName:j(c)}}let m=[{id:"local",displayName:"Local",packageName:null,description:"Local file-based storage with no dependencies, ideal for development",isBuiltIn:!0},{id:"vercel",displayName:"Vercel",packageName:null,description:"Vercel-managed storage and queue",isBuiltIn:!0},{id:"postgres",displayName:"PostgreSQL",packageName:"@workflow/world-postgres",description:"PostgreSQL-based storage with pg-boss queue",isBuiltIn:!1}];var n=a.i(337825);let o=(0,e.createRequire)((0,f.join)(process.cwd(),"index.js"));async function p(){return m.map(a=>{let b={id:a.id,displayName:a.displayName,packageName:a.packageName,description:a.description,isBuiltIn:a.isBuiltIn,isInstalled:a.isBuiltIn};if(!a.isBuiltIn&&a.packageName)try{o.resolve(a.packageName),b.isInstalled=!0}catch{b.isInstalled=!1,b.installCommand=`npm install ${a.packageName}`}return b})}async function q(a){let b=[],c=a.backend||"local";if("local"===c){let c=(0,f.resolve)(a.dataDir);if((0,d.existsSync)(c)||b.push({field:"dataDir",message:`Data directory does not exist: ${c}`}),a.port){let c=Number.parseInt(a.port,10);(Number.isNaN(c)||c<1||c>65535)&&b.push({field:"port",message:"Port must be a number between 1 and 65535"})}}return"postgres"===c&&(a.postgresUrl?a.postgresUrl.startsWith("postgres://")||a.postgresUrl.startsWith("postgresql://")||b.push({field:"postgresUrl",message:"Invalid PostgreSQL connection string format (must start with postgres:// or postgresql://)"}):b.push({field:"postgresUrl",message:"PostgreSQL connection string is required"})),b}async function r(a){return l(a)}(0,n.ensureServerEntryExports)([p,q,r]),(0,c.registerServerReference)(p,"00c74fecd462e4785ba678ef7fe64a72f9282de1d1",null),(0,c.registerServerReference)(q,"40784059688af336a939f339286ea5068c5916e52e",null),(0,c.registerServerReference)(r,"40d77cb968ae837a7453b929c9c2a8d17cc7ac82a6",null),a.s([],950381),a.i(950381),a.s(["00ba2bf9c2323c35ab638314aaf28aef29b8ec5b3e",()=>b.getServerConfig,"00c74fecd462e4785ba678ef7fe64a72f9282de1d1",()=>p,"405976fa90d3a1da77c07f65c137108d3a556e7c2c",()=>b.fetchWorkflowsManifest,"40d77cb968ae837a7453b929c9c2a8d17cc7ac82a6",()=>r,"6007f0553343ad5e40d1ebc035bd79bc016f325697",()=>b.recreateRun,"602e23efa4eb2e9207d614a3f127ccdcd6fa85ffd7",()=>b.fetchHooks,"603e576d2c825dcea1507b4f388e431a427e2a166c",()=>b.fetchRuns,"6094c53ba3aa0c416d5b32e9b4ae9f5f5702cddd59",()=>b.reenqueueRun,"60ae420738a31345cb5341f066d5af1a38a555a6d2",()=>b.cancelRun,"60dbd9b993780cdc1d5cbbb9610bcee6c2f8cf1001",()=>b.fetchStreams,"700929883988fbd09eb25b8393633c22da4fe96a98",()=>b.fetchRun,"701d002af1d11192ec9ceadc9a578ecf2654b8d5c3",()=>b.wakeUpRun,"7021ae66deec17b92863da98e294076e4c493eacec",()=>b.fetchEventsByCorrelationId,"7021c8a5776d4181e536a39cd25778b1f07f659590",()=>b.resumeHook,"7025a0d2731d371ca9a659c56dbf3b2c37c356542d",()=>b.fetchEvents,"7060e89bb32ffd7454b75ad5defd523f9c28bce80e",()=>b.fetchHook,"70a60a1fd5c448306caa73fffedef6ab8999c0b619",()=>b.fetchSteps,"70bcedae4cb81d943b1d0e13e83e91e8be31d8b63a",()=>b.readStreamServerAction,"7882fa12bd113ace7680a0d76e0b49dca28cad1722",()=>b.fetchStep],704690)}];

//# sourceMappingURL=packages_web__next-internal_server_app_page_actions_b691008e.js.map