@uploadista/core 0.0.12 → 0.0.13-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{checksum-Do_Vh-tB.mjs → checksum-P9C2JlRk.mjs} +2 -2
- package/dist/checksum-P9C2JlRk.mjs.map +1 -0
- package/dist/{checksum-DgutVB-2.cjs → checksum-jmKtZ9W8.cjs} +1 -1
- package/dist/errors/index.cjs +1 -1
- package/dist/errors/index.d.cts +1 -1
- package/dist/errors/index.d.mts +1 -1
- package/dist/errors/index.mjs +1 -1
- package/dist/flow/index.cjs +1 -1
- package/dist/flow/index.d.cts +5 -5
- package/dist/flow/index.d.mts +5 -5
- package/dist/flow/index.mjs +1 -1
- package/dist/{flow-CpDQ8dgf.mjs → flow-CmDU90LK.mjs} +2 -2
- package/dist/flow-CmDU90LK.mjs.map +1 -0
- package/dist/{flow-wZzF8vml.cjs → flow-mOCq3uEl.cjs} +1 -1
- package/dist/{index-6oHIyVO9.d.cts → index-BPBI84iT.d.mts} +2 -2
- package/dist/{index-6oHIyVO9.d.cts.map → index-BPBI84iT.d.mts.map} +1 -1
- package/dist/{index-C2nrn_49.d.mts → index-BteFEg-c.d.mts} +2 -2
- package/dist/index-BteFEg-c.d.mts.map +1 -0
- package/dist/{index-DdT18SQi.d.mts → index-CyxM7UiT.d.mts} +163 -10
- package/dist/index-CyxM7UiT.d.mts.map +1 -0
- package/dist/{index-CsLVxsad.d.mts → index-DMfADSSJ.d.cts} +2 -2
- package/dist/{index-CsLVxsad.d.mts.map → index-DMfADSSJ.d.cts.map} +1 -1
- package/dist/{index-DHOYyzYt.d.cts → index-DpnmoaRn.d.cts} +165 -12
- package/dist/index-DpnmoaRn.d.cts.map +1 -0
- package/dist/{index-eLYBkDBH.d.cts → index-DubOIur4.d.cts} +2 -2
- package/dist/index-DubOIur4.d.cts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +1 -1
- package/dist/{stream-limiter-Bj_iImMm.cjs → stream-limiter-D9rrsvAT.cjs} +1 -1
- package/dist/{stream-limiter-CEpDLQVB.mjs → stream-limiter-DFtRZczp.mjs} +2 -2
- package/dist/{stream-limiter-CEpDLQVB.mjs.map → stream-limiter-DFtRZczp.mjs.map} +1 -1
- package/dist/streams/index.cjs +1 -1
- package/dist/streams/index.d.cts +2 -2
- package/dist/streams/index.d.mts +2 -2
- package/dist/streams/index.mjs +1 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +1 -1
- package/dist/{types-BYfvxhhG.mjs → types-DGZ892my.mjs} +2 -2
- package/dist/{types-BYfvxhhG.mjs.map → types-DGZ892my.mjs.map} +1 -1
- package/dist/{types-C80hlY_o.cjs → types-f08UsX4E.cjs} +1 -1
- package/dist/upload/index.cjs +1 -1
- package/dist/upload/index.d.cts +4 -4
- package/dist/upload/index.d.mts +4 -4
- package/dist/upload/index.mjs +1 -1
- package/dist/{upload-IZuHoQqL.cjs → upload-D-eiOIVG.cjs} +1 -1
- package/dist/{upload-CcmxSO5u.mjs → upload-DJTptYqV.mjs} +2 -2
- package/dist/upload-DJTptYqV.mjs.map +1 -0
- package/dist/{uploadista-error-DHajuvP1.d.mts → uploadista-error-9yLWP7TC.d.cts} +3 -3
- package/dist/uploadista-error-9yLWP7TC.d.cts.map +1 -0
- package/dist/{uploadista-error-CQ1ADme7.cjs → uploadista-error-B-n8Kfyh.cjs} +6 -1
- package/dist/{uploadista-error-B4dn0Ch6.d.cts → uploadista-error-CBkvsyZ3.d.mts} +3 -3
- package/dist/uploadista-error-CBkvsyZ3.d.mts.map +1 -0
- package/dist/{uploadista-error-U9YxwNtM.mjs → uploadista-error-nZ_q-EZy.mjs} +6 -1
- package/dist/uploadista-error-nZ_q-EZy.mjs.map +1 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.cts +2 -2
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/{utils-C6k-Fs99.mjs → utils-BicUw_lt.mjs} +2 -2
- package/dist/{utils-C6k-Fs99.mjs.map → utils-BicUw_lt.mjs.map} +1 -1
- package/dist/{utils-DzDTNMnq.cjs → utils-_StwBtxT.cjs} +1 -1
- package/package.json +3 -3
- package/src/errors/__tests__/uploadista-error.test.ts +1 -2
- package/src/errors/uploadista-error.ts +28 -3
- package/src/flow/flow.ts +40 -33
- package/src/flow/index.ts +1 -0
- package/src/flow/nodes/input-node.ts +8 -8
- package/src/flow/nodes/storage-node.ts +7 -7
- package/src/flow/nodes/transform-node.ts +3 -3
- package/src/flow/plugins/plugins.ts +3 -0
- package/src/flow/plugins/types/resize-node.ts +1 -1
- package/src/flow/plugins/video-plugin.ts +181 -0
- package/src/flow/typed-flow.ts +52 -52
- package/src/flow/types/index.ts +1 -3
- package/src/flow/utils/resolve-upload-metadata.ts +2 -2
- package/src/types/upload-event.ts +7 -5
- package/src/types/upload-file.ts +19 -11
- package/src/upload/convert-to-stream.ts +1 -1
- package/src/upload/create-upload.ts +11 -11
- package/src/upload/mime.ts +12 -13
- package/src/upload/upload-chunk.ts +13 -13
- package/src/upload/upload-strategy-negotiator.ts +15 -15
- package/src/upload/upload-url.ts +14 -14
- package/src/upload/write-to-store.ts +10 -10
- package/src/utils/checksum.ts +5 -2
- package/vitest.config.ts +16 -10
- package/dist/checksum-Do_Vh-tB.mjs.map +0 -1
- package/dist/flow-CpDQ8dgf.mjs.map +0 -1
- package/dist/index-C2nrn_49.d.mts.map +0 -1
- package/dist/index-DHOYyzYt.d.cts.map +0 -1
- package/dist/index-DdT18SQi.d.mts.map +0 -1
- package/dist/index-eLYBkDBH.d.cts.map +0 -1
- package/dist/upload-CcmxSO5u.mjs.map +0 -1
- package/dist/uploadista-error-B4dn0Ch6.d.cts.map +0 -1
- package/dist/uploadista-error-DHajuvP1.d.mts.map +0 -1
- package/dist/uploadista-error-U9YxwNtM.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./uploadista-error-
|
|
2
|
-
//# sourceMappingURL=checksum-
|
|
1
|
+
import{n as e}from"./uploadista-error-nZ_q-EZy.mjs";import{Context as t,Effect as n,Layer as r}from"effect";var i=class extends t.Tag(`UploadistaGenerateIdService`)(){};const a=i.Service,o=i.of({generateId:()=>n.succeed(crypto.randomUUID())}),s=r.succeed(i,o),c=i.of({generateId:()=>n.succeed(`${Date.now()}-${Math.random().toString(36).slice(2,11)}`)}),l=[`sha256`];function u(e){return l.includes(e)}function d(t,r){return n.gen(function*(){if(!u(r))return yield*e.fromCode(`UNSUPPORTED_CHECKSUM_ALGORITHM`,{body:`Checksum algorithm '${r}' is not supported. Supported algorithms: ${l.join(`, `)}`,details:{algorithm:r,supportedAlgorithms:l}}).toEffect();let i=r.toUpperCase().replace(/\d+/,`-$&`),a=yield*n.tryPromise({try:()=>crypto.subtle.digest(i,t),catch:t=>e.fromCode(`UNKNOWN_ERROR`,{body:`Failed to compute checksum: ${t instanceof Error?t.message:`Unknown error`}`,cause:t,details:{algorithm:r}})});return Array.from(new Uint8Array(a)).map(e=>e.toString(16).padStart(2,`0`)).join(``)})}export{o as a,s as i,u as n,a as o,i as r,c as s,d as t};
|
|
2
|
+
//# sourceMappingURL=checksum-P9C2JlRk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checksum-P9C2JlRk.mjs","names":[],"sources":["../src/utils/generate-id.ts","../src/utils/checksum.ts"],"sourcesContent":["import { Context, Effect, Layer } from \"effect\";\n\nexport type GenerateIdShape = {\n generateId: () => Effect.Effect<string>;\n};\n\n// Declaring a tag for a service that generates random id\nexport class GenerateId extends Context.Tag(\"UploadistaGenerateIdService\")<\n GenerateId,\n { readonly generateId: () => Effect.Effect<string> }\n>() {}\n\n/**\n * Effect-based ID generation services\n */\nexport const GenerateIdService = GenerateId.Service;\n\n/**\n * Generates a random UUID using Effect\n * @returns Effect that produces a random UUID string\n */\nexport const GenerateIdRandom = GenerateId.of({\n generateId: () => Effect.succeed(crypto.randomUUID()),\n});\n\nexport const GenerateIdLive = Layer.succeed(GenerateId, GenerateIdRandom);\n\n/**\n * Generates a timestamp-based ID using Effect\n * @returns Effect that produces a timestamp-based ID\n */\nexport const GenerateIdTimestamp = GenerateId.of({\n generateId: () =>\n Effect.succeed(`${Date.now()}-${Math.random().toString(36).slice(2, 11)}`),\n});\n","import { Effect } from \"effect\";\nimport { UploadistaError } from \"../errors/uploadista-error\";\n\n/**\n * Supported checksum algorithms\n */\nconst SUPPORTED_ALGORITHMS = [\"sha256\"] as const;\nexport type ChecksumAlgorithm = (typeof SUPPORTED_ALGORITHMS)[number];\n\n/**\n * Check if a checksum algorithm is supported\n */\nexport function isSupportedAlgorithm(\n algorithm: string,\n): algorithm is ChecksumAlgorithm {\n return SUPPORTED_ALGORITHMS.includes(algorithm as ChecksumAlgorithm);\n}\n\n/**\n * Compute checksum of file bytes using the Web Crypto API.\n * This works across all modern platforms: browsers, Node.js 15+, Deno, Bun, and Cloudflare Workers.\n *\n * @param bytes - File content as Uint8Array\n * @param algorithm - Hashing algorithm to use (currently only 'sha256' is supported)\n * @returns Effect that resolves to hex-encoded checksum string\n */\nexport function computeChecksum(\n bytes: Uint8Array,\n algorithm: string,\n): Effect.Effect<string, UploadistaError> {\n return Effect.gen(function* () {\n // Validate algorithm is supported\n if (!isSupportedAlgorithm(algorithm)) {\n return yield* UploadistaError.fromCode(\"UNSUPPORTED_CHECKSUM_ALGORITHM\", {\n body: `Checksum algorithm '${algorithm}' is not supported. Supported algorithms: ${SUPPORTED_ALGORITHMS.join(\", \")}`,\n details: { algorithm, supportedAlgorithms: SUPPORTED_ALGORITHMS },\n }).toEffect();\n }\n\n // Map algorithm name to Web Crypto API algorithm name\n const webCryptoAlgorithm = algorithm.toUpperCase().replace(/\\d+/, \"-$&\"); // \"sha256\" -> \"SHA-256\"\n\n // Compute hash using Web Crypto API (available in browsers, Node.js 15+, Deno, Bun, Cloudflare Workers)\n // Pass Uint8Array directly - it's a valid BufferSource\n const hashBuffer = yield* Effect.tryPromise({\n try: () =>\n crypto.subtle.digest(webCryptoAlgorithm, bytes as BufferSource),\n catch: (error) =>\n UploadistaError.fromCode(\"UNKNOWN_ERROR\", {\n body: `Failed to compute checksum: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n cause: error,\n details: { algorithm },\n }),\n });\n\n // Convert ArrayBuffer to hex string\n const hashArray = Array.from(new Uint8Array(hashBuffer));\n const hashHex = hashArray\n .map((byte) => byte.toString(16).padStart(2, \"0\"))\n .join(\"\");\n\n return hashHex;\n });\n}\n"],"mappings":"4GAOA,IAAa,EAAb,cAAgC,EAAQ,IAAI,8BAA8B,EAGvE,AAAC,GAKJ,MAAa,EAAoB,EAAW,QAM/B,EAAmB,EAAW,GAAG,CAC5C,eAAkB,EAAO,QAAQ,OAAO,YAAY,CAAC,CACtD,CAAC,CAEW,EAAiB,EAAM,QAAQ,EAAY,EAAiB,CAM5D,EAAsB,EAAW,GAAG,CAC/C,eACE,EAAO,QAAQ,GAAG,KAAK,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAG,GAAG,GAAG,CAC7E,CAAC,CC5BI,EAAuB,CAAC,SAAS,CAMvC,SAAgB,EACd,EACgC,CAChC,OAAO,EAAqB,SAAS,EAA+B,CAWtE,SAAgB,EACd,EACA,EACwC,CACxC,OAAO,EAAO,IAAI,WAAa,CAE7B,GAAI,CAAC,EAAqB,EAAU,CAClC,OAAO,MAAO,EAAgB,SAAS,iCAAkC,CACvE,KAAM,uBAAuB,EAAU,4CAA4C,EAAqB,KAAK,KAAK,GAClH,QAAS,CAAE,YAAW,oBAAqB,EAAsB,CAClE,CAAC,CAAC,UAAU,CAIf,IAAM,EAAqB,EAAU,aAAa,CAAC,QAAQ,MAAO,MAAM,CAIlE,EAAa,MAAO,EAAO,WAAW,CAC1C,QACE,OAAO,OAAO,OAAO,EAAoB,EAAsB,CACjE,MAAQ,GACN,EAAgB,SAAS,gBAAiB,CACxC,KAAM,+BAA+B,aAAiB,MAAQ,EAAM,QAAU,kBAC9E,MAAO,EACP,QAAS,CAAE,YAAW,CACvB,CAAC,CACL,CAAC,CAQF,OALkB,MAAM,KAAK,IAAI,WAAW,EAAW,CAAC,CAErD,IAAK,GAAS,EAAK,SAAS,GAAG,CAAC,SAAS,EAAG,IAAI,CAAC,CACjD,KAAK,GAAG,EAGX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./types-
|
|
1
|
+
const e=require(`./types-f08UsX4E.cjs`),t=require(`./uploadista-error-B-n8Kfyh.cjs`);let n=require(`effect`);var r=class extends n.Context.Tag(`UploadistaGenerateIdService`)(){};const i=r.Service,a=r.of({generateId:()=>n.Effect.succeed(crypto.randomUUID())}),o=n.Layer.succeed(r,a),s=r.of({generateId:()=>n.Effect.succeed(`${Date.now()}-${Math.random().toString(36).slice(2,11)}`)}),c=[`sha256`];function l(e){return c.includes(e)}function u(e,r){return n.Effect.gen(function*(){if(!l(r))return yield*t.n.fromCode(`UNSUPPORTED_CHECKSUM_ALGORITHM`,{body:`Checksum algorithm '${r}' is not supported. Supported algorithms: ${c.join(`, `)}`,details:{algorithm:r,supportedAlgorithms:c}}).toEffect();let i=r.toUpperCase().replace(/\d+/,`-$&`),a=yield*n.Effect.tryPromise({try:()=>crypto.subtle.digest(i,e),catch:e=>t.n.fromCode(`UNKNOWN_ERROR`,{body:`Failed to compute checksum: ${e instanceof Error?e.message:`Unknown error`}`,cause:e,details:{algorithm:r}})});return Array.from(new Uint8Array(a)).map(e=>e.toString(16).padStart(2,`0`)).join(``)})}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
|
package/dist/errors/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../uploadista-error-
|
|
1
|
+
const e=require(`../uploadista-error-B-n8Kfyh.cjs`);require(`../errors-CRm1FHHT.cjs`),exports.ERRORS=e.t,exports.ERROR_CATALOG=e.t,exports.UploadistaError=e.n,exports.httpFailure=e.r,exports.isUploadistaError=e.i;
|
package/dist/errors/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as isUploadistaError, i as httpFailure, n as UploadistaError, r as UploadistaErrorCode, t as ERROR_CATALOG } from "../uploadista-error-
|
|
1
|
+
import { a as isUploadistaError, i as httpFailure, n as UploadistaError, r as UploadistaErrorCode, t as ERROR_CATALOG } from "../uploadista-error-9yLWP7TC.cjs";
|
|
2
2
|
import "../index-BtBZHVmz.cjs";
|
|
3
3
|
export { ERROR_CATALOG as ERRORS, ERROR_CATALOG, UploadistaError, UploadistaErrorCode, httpFailure, isUploadistaError };
|
package/dist/errors/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as isUploadistaError, i as httpFailure, n as UploadistaError, r as UploadistaErrorCode, t as ERROR_CATALOG } from "../uploadista-error-
|
|
1
|
+
import { a as isUploadistaError, i as httpFailure, n as UploadistaError, r as UploadistaErrorCode, t as ERROR_CATALOG } from "../uploadista-error-CBkvsyZ3.mjs";
|
|
2
2
|
import "../index-DEHBdV_z.mjs";
|
|
3
3
|
export { ERROR_CATALOG as ERRORS, ERROR_CATALOG, UploadistaError, UploadistaErrorCode, httpFailure, isUploadistaError };
|
package/dist/errors/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,t as r}from"../uploadista-error-
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"../uploadista-error-nZ_q-EZy.mjs";import"../errors-C0zLx77t.mjs";export{r as ERRORS,r as ERROR_CATALOG,t as UploadistaError,n as httpFailure,e as isUploadistaError};
|
package/dist/flow/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../types-
|
|
1
|
+
require(`../types-f08UsX4E.cjs`),require(`../uploadista-error-B-n8Kfyh.cjs`),require(`../errors-CRm1FHHT.cjs`);const e=require(`../flow-mOCq3uEl.cjs`);require(`../upload-D-eiOIVG.cjs`),require(`../checksum-jmKtZ9W8.cjs`),require(`../stream-limiter-D9rrsvAT.cjs`),exports.CredentialProvider=e.T,exports.EventType=e.K,exports.FlowProvider=e.F,exports.FlowServer=e.I,exports.FlowWaitUntil=e.L,exports.ImageAiPlugin=e.w,exports.ImagePlugin=e.C,exports.NodeType=e.U,exports.ParallelScheduler=e.H,exports.VideoPlugin=e.i,exports.ZipPlugin=e.r,exports.blurTransformSchema=e.a,exports.brightnessTransformSchema=e.o,exports.completeNodeExecution=e.N,exports.contrastTransformSchema=e.s,exports.createFlow=e.n,exports.createFlowEdge=e.q,exports.createFlowNode=e.W,exports.createFlowServer=e.R,exports.createFlowWithSchema=e.B,exports.createInputNode=e.k,exports.createStorageNode=e.D,exports.createTransformNode=e.E,exports.describeImageParamsSchema=e.S,exports.flipTransformSchema=e.c,exports.flowServer=e.z,exports.getFlowData=e.V,exports.getNodeData=e.G,exports.grayscaleTransformSchema=e.l,exports.inputDataSchema=e.A,exports.inputNodeParamsSchema=e.j,exports.logoTransformSchema=e.u,exports.optimizeParamsSchema=e.x,exports.removeBackgroundParamsSchema=e.b,exports.resizeParamsSchema=e.y,exports.resizeTransformSchema=e.d,exports.resolveUploadMetadata=e.M,exports.rotateTransformSchema=e.f,exports.runArgsSchema=e.t,exports.sepiaTransformSchema=e.p,exports.sharpenTransformSchema=e.m,exports.storageParamsSchema=e.O,exports.textTransformSchema=e.h,exports.transformImageParamsSchema=e.g,exports.transformationSchema=e._,exports.waitingNodeExecution=e.P,exports.watermarkTransformSchema=e.v;
|
package/dist/flow/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../uploadista-error-
|
|
1
|
+
import "../uploadista-error-9yLWP7TC.cjs";
|
|
2
2
|
import "../index-BtBZHVmz.cjs";
|
|
3
|
-
import { $ as
|
|
4
|
-
import "../index-
|
|
5
|
-
import "../index-
|
|
6
|
-
export { BlurTransform, BrightnessTransform, ConditionField, ConditionOperator, ConditionValue, ContrastTransform, CredentialProvider, CredentialProviderLayer, CredentialProviderShape, DescribeImageParams, EventType, ExecutionLevel, ExtractEffectError, ExtractEffectRequirements, ExtractLayerService, ExtractLayerServices, FlipTransform, Flow, FlowCondition, FlowConfig, FlowData, FlowEdge, FlowEvent, FlowEventFlowCancel, FlowEventFlowEnd, FlowEventFlowError, FlowEventFlowPause, FlowEventFlowStart, FlowEventJobEnd, FlowEventJobStart, FlowEventNodeEnd, FlowEventNodeError, FlowEventNodePause, FlowEventNodeResponse, FlowEventNodeResume, FlowEventNodeStart, FlowExecutionResult, FlowInputMap, FlowJob, FlowJobStatus, FlowJobTask, FlowJobTaskStatus, FlowNode, FlowNodeData, FlowOutputMap, FlowPluginRequirements, FlowProvider, FlowProviderShape, FlowRequirements, FlowServer, FlowServerLayer, FlowServerOptions, FlowServerShape, FlowWaitUntil, GrayscaleTransform, ImageAiContext, ImageAiPlugin, ImageAiPluginLayer, ImageAiPluginShape, ImagePlugin, ImagePluginLayer, ImagePluginShape, InputData, InputNodeParams, LogoTransform, NodeConnectionValidator, NodeDefinition, NodeDefinitionsRecord, NodeExecutionResult, NodeType, NodeTypeMap, OptimizeParams, OverlayPosition, ParallelScheduler, ParallelSchedulerConfig, Plugin, PluginLayer, RemoveBackgroundParams, ResizeParams, ResizeTransform, ResolveEffect, ResolvedUploadMetadata, RotateTransform, RunArgs, SepiaTransform, SharpenTransform, StorageParams, TextTransform, TransformImageParams, TransformNodeConfig, Transformation, TransformationType, TypeCompatibilityChecker, TypedFlow, TypedFlowConfig, TypedFlowEdge, WaitUntilCallback, WatermarkTransform, ZipInput, ZipParams, ZipPlugin, ZipPluginLayer, ZipPluginShape, blurTransformSchema, brightnessTransformSchema, completeNodeExecution, contrastTransformSchema, createFlow, createFlowEdge, createFlowNode, createFlowServer, createFlowWithSchema, createInputNode, createStorageNode, createTransformNode, describeImageParamsSchema, flipTransformSchema, flowServer, getFlowData, getNodeData, grayscaleTransformSchema, inputDataSchema, inputNodeParamsSchema, logoTransformSchema, optimizeParamsSchema, removeBackgroundParamsSchema, resizeParamsSchema, resizeTransformSchema, resolveUploadMetadata, rotateTransformSchema, runArgsSchema, sepiaTransformSchema, sharpenTransformSchema, storageParamsSchema, textTransformSchema, transformImageParamsSchema, transformationSchema, waitingNodeExecution, watermarkTransformSchema };
|
|
3
|
+
import { $ as SharpenTransform, $t as FlowJob, A as ZipPluginLayer, Ar as FlowEventNodeEnd, At as ExecutionLevel, B as ImagePlugin, Br as createFlowNode, Bt as createInputNode, C as DescribeImageParams, Cr as FlowEventFlowCancel, Ct as ImageAiContext, D as ZipInput, Dr as FlowEventFlowStart, Dt as CredentialProvider, E as PluginLayer, Er as FlowEventFlowPause, Et as ImageAiPluginShape, F as VideoMetadata, Fr as FlowEventNodeStart, Ft as StorageParams, G as ContrastTransform, Gt as FlowServer, H as ImagePluginShape, Ht as inputNodeParamsSchema, I as VideoPlugin, Ir as ConditionField, It as createStorageNode, J as LogoTransform, Jt as FlowServerShape, K as FlipTransform, Kt as FlowServerLayer, L as VideoPluginLayer, Lr as ConditionOperator, Lt as storageParamsSchema, M as ExtractFrameParams, Mr as FlowEventNodePause, Mt as ParallelSchedulerConfig, N as TranscodeParams, Nr as FlowEventNodeResponse, Nt as TransformNodeConfig, O as ZipParams, Or as FlowEventJobEnd, Ot as CredentialProviderLayer, P as TrimParams, Pr as FlowEventNodeResume, Pt as createTransformNode, Q as SepiaTransform, Qt as flowServer, R as VideoPluginShape, Rr as ConditionValue, Rt as InputData, S as removeBackgroundParamsSchema, Sr as FlowEvent, St as optimizeParamsSchema, T as Plugin, Tr as FlowEventFlowError, Tt as ImageAiPluginLayer, U as BlurTransform, Ut as FlowProvider, V as ImagePluginLayer, Vr as getNodeData, Vt as inputDataSchema, W as BrightnessTransform, Wt as FlowProviderShape, X as ResizeTransform, Xt as WaitUntilCallback, Y as OverlayPosition, Yt as FlowWaitUntil, Z as RotateTransform, Zt as createFlowServer, _ as ExtractLayerService, _r as NodeTypeMap, _t as transformationSchema, a as FlowInputMap, ar as Flow, at as blurTransformSchema, b as FlowCondition, br as waitingNodeExecution, bt as resizeParamsSchema, c as FlowRequirements, cr as createFlowWithSchema, ct as flipTransformSchema, d as TypedFlow, dr as createFlowEdge, dt as resizeTransformSchema, en as FlowJobStatus, et as TextTransform, f as TypedFlowConfig, fr as FlowConfig, ft as rotateTransformSchema, g as ExtractEffectRequirements, gr as NodeExecutionResult, gt as transformImageParamsSchema, h as ExtractEffectError, hr as NodeConnectionValidator, ht as textTransformSchema, i as runArgsSchema, it as WatermarkTransform, j as ZipPluginShape, jr as FlowEventNodeError, jt as ParallelScheduler, k as ZipPlugin, kr as FlowEventJobStart, kt as CredentialProviderShape, l as NodeDefinition, lr as getFlowData, lt as grayscaleTransformSchema, m as createFlow, mr as FlowNodeData, mt as sharpenTransformSchema, n as resolveUploadMetadata, nn as FlowJobTaskStatus, nt as Transformation, o as FlowOutputMap, or as FlowData, ot as brightnessTransformSchema, p as TypedFlowEdge, pr as FlowNode, pt as sepiaTransformSchema, q as GrayscaleTransform, qt as FlowServerOptions, r as RunArgs, rt as TransformationType, s as FlowPluginRequirements, sr as FlowExecutionResult, st as contrastTransformSchema, t as ResolvedUploadMetadata, tn as FlowJobTask, tt as TransformImageParams, u as NodeDefinitionsRecord, ur as FlowEdge, ut as logoTransformSchema, v as ExtractLayerServices, vr as TypeCompatibilityChecker, vt as watermarkTransformSchema, w as describeImageParamsSchema, wr as FlowEventFlowEnd, wt as ImageAiPlugin, x as RemoveBackgroundParams, xr as EventType, xt as OptimizeParams, y as ResolveEffect, yr as completeNodeExecution, yt as ResizeParams, z as VideoResizeParams, zr as NodeType, zt as InputNodeParams } from "../index-DpnmoaRn.cjs";
|
|
4
|
+
import "../index-DubOIur4.cjs";
|
|
5
|
+
import "../index-DMfADSSJ.cjs";
|
|
6
|
+
export { BlurTransform, BrightnessTransform, ConditionField, ConditionOperator, ConditionValue, ContrastTransform, CredentialProvider, CredentialProviderLayer, CredentialProviderShape, DescribeImageParams, EventType, ExecutionLevel, ExtractEffectError, ExtractEffectRequirements, ExtractFrameParams, ExtractLayerService, ExtractLayerServices, FlipTransform, Flow, FlowCondition, FlowConfig, FlowData, FlowEdge, FlowEvent, FlowEventFlowCancel, FlowEventFlowEnd, FlowEventFlowError, FlowEventFlowPause, FlowEventFlowStart, FlowEventJobEnd, FlowEventJobStart, FlowEventNodeEnd, FlowEventNodeError, FlowEventNodePause, FlowEventNodeResponse, FlowEventNodeResume, FlowEventNodeStart, FlowExecutionResult, FlowInputMap, FlowJob, FlowJobStatus, FlowJobTask, FlowJobTaskStatus, FlowNode, FlowNodeData, FlowOutputMap, FlowPluginRequirements, FlowProvider, FlowProviderShape, FlowRequirements, FlowServer, FlowServerLayer, FlowServerOptions, FlowServerShape, FlowWaitUntil, GrayscaleTransform, ImageAiContext, ImageAiPlugin, ImageAiPluginLayer, ImageAiPluginShape, ImagePlugin, ImagePluginLayer, ImagePluginShape, InputData, InputNodeParams, LogoTransform, NodeConnectionValidator, NodeDefinition, NodeDefinitionsRecord, NodeExecutionResult, NodeType, NodeTypeMap, OptimizeParams, OverlayPosition, ParallelScheduler, ParallelSchedulerConfig, Plugin, PluginLayer, RemoveBackgroundParams, ResizeParams, ResizeTransform, ResolveEffect, ResolvedUploadMetadata, RotateTransform, RunArgs, SepiaTransform, SharpenTransform, StorageParams, TextTransform, TranscodeParams, TransformImageParams, TransformNodeConfig, Transformation, TransformationType, TrimParams, TypeCompatibilityChecker, TypedFlow, TypedFlowConfig, TypedFlowEdge, VideoMetadata, VideoPlugin, VideoPluginLayer, VideoPluginShape, VideoResizeParams, WaitUntilCallback, WatermarkTransform, ZipInput, ZipParams, ZipPlugin, ZipPluginLayer, ZipPluginShape, blurTransformSchema, brightnessTransformSchema, completeNodeExecution, contrastTransformSchema, createFlow, createFlowEdge, createFlowNode, createFlowServer, createFlowWithSchema, createInputNode, createStorageNode, createTransformNode, describeImageParamsSchema, flipTransformSchema, flowServer, getFlowData, getNodeData, grayscaleTransformSchema, inputDataSchema, inputNodeParamsSchema, logoTransformSchema, optimizeParamsSchema, removeBackgroundParamsSchema, resizeParamsSchema, resizeTransformSchema, resolveUploadMetadata, rotateTransformSchema, runArgsSchema, sepiaTransformSchema, sharpenTransformSchema, storageParamsSchema, textTransformSchema, transformImageParamsSchema, transformationSchema, waitingNodeExecution, watermarkTransformSchema };
|
package/dist/flow/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../uploadista-error-
|
|
1
|
+
import "../uploadista-error-CBkvsyZ3.mjs";
|
|
2
2
|
import "../index-DEHBdV_z.mjs";
|
|
3
|
-
import { $ as
|
|
4
|
-
import "../index-
|
|
5
|
-
import "../index-
|
|
6
|
-
export { BlurTransform, BrightnessTransform, ConditionField, ConditionOperator, ConditionValue, ContrastTransform, CredentialProvider, CredentialProviderLayer, CredentialProviderShape, DescribeImageParams, EventType, ExecutionLevel, ExtractEffectError, ExtractEffectRequirements, ExtractLayerService, ExtractLayerServices, FlipTransform, Flow, FlowCondition, FlowConfig, FlowData, FlowEdge, FlowEvent, FlowEventFlowCancel, FlowEventFlowEnd, FlowEventFlowError, FlowEventFlowPause, FlowEventFlowStart, FlowEventJobEnd, FlowEventJobStart, FlowEventNodeEnd, FlowEventNodeError, FlowEventNodePause, FlowEventNodeResponse, FlowEventNodeResume, FlowEventNodeStart, FlowExecutionResult, FlowInputMap, FlowJob, FlowJobStatus, FlowJobTask, FlowJobTaskStatus, FlowNode, FlowNodeData, FlowOutputMap, FlowPluginRequirements, FlowProvider, FlowProviderShape, FlowRequirements, FlowServer, FlowServerLayer, FlowServerOptions, FlowServerShape, FlowWaitUntil, GrayscaleTransform, ImageAiContext, ImageAiPlugin, ImageAiPluginLayer, ImageAiPluginShape, ImagePlugin, ImagePluginLayer, ImagePluginShape, InputData, InputNodeParams, LogoTransform, NodeConnectionValidator, NodeDefinition, NodeDefinitionsRecord, NodeExecutionResult, NodeType, NodeTypeMap, OptimizeParams, OverlayPosition, ParallelScheduler, ParallelSchedulerConfig, Plugin, PluginLayer, RemoveBackgroundParams, ResizeParams, ResizeTransform, ResolveEffect, ResolvedUploadMetadata, RotateTransform, RunArgs, SepiaTransform, SharpenTransform, StorageParams, TextTransform, TransformImageParams, TransformNodeConfig, Transformation, TransformationType, TypeCompatibilityChecker, TypedFlow, TypedFlowConfig, TypedFlowEdge, WaitUntilCallback, WatermarkTransform, ZipInput, ZipParams, ZipPlugin, ZipPluginLayer, ZipPluginShape, blurTransformSchema, brightnessTransformSchema, completeNodeExecution, contrastTransformSchema, createFlow, createFlowEdge, createFlowNode, createFlowServer, createFlowWithSchema, createInputNode, createStorageNode, createTransformNode, describeImageParamsSchema, flipTransformSchema, flowServer, getFlowData, getNodeData, grayscaleTransformSchema, inputDataSchema, inputNodeParamsSchema, logoTransformSchema, optimizeParamsSchema, removeBackgroundParamsSchema, resizeParamsSchema, resizeTransformSchema, resolveUploadMetadata, rotateTransformSchema, runArgsSchema, sepiaTransformSchema, sharpenTransformSchema, storageParamsSchema, textTransformSchema, transformImageParamsSchema, transformationSchema, waitingNodeExecution, watermarkTransformSchema };
|
|
3
|
+
import { $ as SharpenTransform, $t as FlowJob, A as ZipPluginLayer, Ar as FlowEventNodeEnd, At as ExecutionLevel, B as ImagePlugin, Br as createFlowNode, Bt as createInputNode, C as DescribeImageParams, Cr as FlowEventFlowCancel, Ct as ImageAiContext, D as ZipInput, Dr as FlowEventFlowStart, Dt as CredentialProvider, E as PluginLayer, Er as FlowEventFlowPause, Et as ImageAiPluginShape, F as VideoMetadata, Fr as FlowEventNodeStart, Ft as StorageParams, G as ContrastTransform, Gt as FlowServer, H as ImagePluginShape, Ht as inputNodeParamsSchema, I as VideoPlugin, Ir as ConditionField, It as createStorageNode, J as LogoTransform, Jt as FlowServerShape, K as FlipTransform, Kt as FlowServerLayer, L as VideoPluginLayer, Lr as ConditionOperator, Lt as storageParamsSchema, M as ExtractFrameParams, Mr as FlowEventNodePause, Mt as ParallelSchedulerConfig, N as TranscodeParams, Nr as FlowEventNodeResponse, Nt as TransformNodeConfig, O as ZipParams, Or as FlowEventJobEnd, Ot as CredentialProviderLayer, P as TrimParams, Pr as FlowEventNodeResume, Pt as createTransformNode, Q as SepiaTransform, Qt as flowServer, R as VideoPluginShape, Rr as ConditionValue, Rt as InputData, S as removeBackgroundParamsSchema, Sr as FlowEvent, St as optimizeParamsSchema, T as Plugin, Tr as FlowEventFlowError, Tt as ImageAiPluginLayer, U as BlurTransform, Ut as FlowProvider, V as ImagePluginLayer, Vr as getNodeData, Vt as inputDataSchema, W as BrightnessTransform, Wt as FlowProviderShape, X as ResizeTransform, Xt as WaitUntilCallback, Y as OverlayPosition, Yt as FlowWaitUntil, Z as RotateTransform, Zt as createFlowServer, _ as ExtractLayerService, _r as NodeTypeMap, _t as transformationSchema, a as FlowInputMap, ar as Flow, at as blurTransformSchema, b as FlowCondition, br as waitingNodeExecution, bt as resizeParamsSchema, c as FlowRequirements, cr as createFlowWithSchema, ct as flipTransformSchema, d as TypedFlow, dr as createFlowEdge, dt as resizeTransformSchema, en as FlowJobStatus, et as TextTransform, f as TypedFlowConfig, fr as FlowConfig, ft as rotateTransformSchema, g as ExtractEffectRequirements, gr as NodeExecutionResult, gt as transformImageParamsSchema, h as ExtractEffectError, hr as NodeConnectionValidator, ht as textTransformSchema, i as runArgsSchema, it as WatermarkTransform, j as ZipPluginShape, jr as FlowEventNodeError, jt as ParallelScheduler, k as ZipPlugin, kr as FlowEventJobStart, kt as CredentialProviderShape, l as NodeDefinition, lr as getFlowData, lt as grayscaleTransformSchema, m as createFlow, mr as FlowNodeData, mt as sharpenTransformSchema, n as resolveUploadMetadata, nn as FlowJobTaskStatus, nt as Transformation, o as FlowOutputMap, or as FlowData, ot as brightnessTransformSchema, p as TypedFlowEdge, pr as FlowNode, pt as sepiaTransformSchema, q as GrayscaleTransform, qt as FlowServerOptions, r as RunArgs, rt as TransformationType, s as FlowPluginRequirements, sr as FlowExecutionResult, st as contrastTransformSchema, t as ResolvedUploadMetadata, tn as FlowJobTask, tt as TransformImageParams, u as NodeDefinitionsRecord, ur as FlowEdge, ut as logoTransformSchema, v as ExtractLayerServices, vr as TypeCompatibilityChecker, vt as watermarkTransformSchema, w as describeImageParamsSchema, wr as FlowEventFlowEnd, wt as ImageAiPlugin, x as RemoveBackgroundParams, xr as EventType, xt as OptimizeParams, y as ResolveEffect, yr as completeNodeExecution, yt as ResizeParams, z as VideoResizeParams, zr as NodeType, zt as InputNodeParams } from "../index-CyxM7UiT.mjs";
|
|
4
|
+
import "../index-BteFEg-c.mjs";
|
|
5
|
+
import "../index-BPBI84iT.mjs";
|
|
6
|
+
export { BlurTransform, BrightnessTransform, ConditionField, ConditionOperator, ConditionValue, ContrastTransform, CredentialProvider, CredentialProviderLayer, CredentialProviderShape, DescribeImageParams, EventType, ExecutionLevel, ExtractEffectError, ExtractEffectRequirements, ExtractFrameParams, ExtractLayerService, ExtractLayerServices, FlipTransform, Flow, FlowCondition, FlowConfig, FlowData, FlowEdge, FlowEvent, FlowEventFlowCancel, FlowEventFlowEnd, FlowEventFlowError, FlowEventFlowPause, FlowEventFlowStart, FlowEventJobEnd, FlowEventJobStart, FlowEventNodeEnd, FlowEventNodeError, FlowEventNodePause, FlowEventNodeResponse, FlowEventNodeResume, FlowEventNodeStart, FlowExecutionResult, FlowInputMap, FlowJob, FlowJobStatus, FlowJobTask, FlowJobTaskStatus, FlowNode, FlowNodeData, FlowOutputMap, FlowPluginRequirements, FlowProvider, FlowProviderShape, FlowRequirements, FlowServer, FlowServerLayer, FlowServerOptions, FlowServerShape, FlowWaitUntil, GrayscaleTransform, ImageAiContext, ImageAiPlugin, ImageAiPluginLayer, ImageAiPluginShape, ImagePlugin, ImagePluginLayer, ImagePluginShape, InputData, InputNodeParams, LogoTransform, NodeConnectionValidator, NodeDefinition, NodeDefinitionsRecord, NodeExecutionResult, NodeType, NodeTypeMap, OptimizeParams, OverlayPosition, ParallelScheduler, ParallelSchedulerConfig, Plugin, PluginLayer, RemoveBackgroundParams, ResizeParams, ResizeTransform, ResolveEffect, ResolvedUploadMetadata, RotateTransform, RunArgs, SepiaTransform, SharpenTransform, StorageParams, TextTransform, TranscodeParams, TransformImageParams, TransformNodeConfig, Transformation, TransformationType, TrimParams, TypeCompatibilityChecker, TypedFlow, TypedFlowConfig, TypedFlowEdge, VideoMetadata, VideoPlugin, VideoPluginLayer, VideoPluginShape, VideoResizeParams, WaitUntilCallback, WatermarkTransform, ZipInput, ZipParams, ZipPlugin, ZipPluginLayer, ZipPluginShape, blurTransformSchema, brightnessTransformSchema, completeNodeExecution, contrastTransformSchema, createFlow, createFlowEdge, createFlowNode, createFlowServer, createFlowWithSchema, createInputNode, createStorageNode, createTransformNode, describeImageParamsSchema, flipTransformSchema, flowServer, getFlowData, getNodeData, grayscaleTransformSchema, inputDataSchema, inputNodeParamsSchema, logoTransformSchema, optimizeParamsSchema, removeBackgroundParamsSchema, resizeParamsSchema, resizeTransformSchema, resolveUploadMetadata, rotateTransformSchema, runArgsSchema, sepiaTransformSchema, sharpenTransformSchema, storageParamsSchema, textTransformSchema, transformImageParamsSchema, transformationSchema, waitingNodeExecution, watermarkTransformSchema };
|
package/dist/flow/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../uploadista-error-
|
|
1
|
+
import"../uploadista-error-nZ_q-EZy.mjs";import"../errors-C0zLx77t.mjs";import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,K as l,L as u,M as d,N as f,O as p,P as m,R as h,S as g,T as _,U as v,V as y,W as b,_ as x,a as S,b as C,c as w,d as T,f as E,g as D,h as O,i as k,j as A,k as j,l as M,m as N,n as P,o as F,p as I,q as L,r as R,s as z,t as B,u as V,v as H,w as U,x as W,y as G,z as K}from"../flow-CmDU90LK.mjs";import"../types-DGZ892my.mjs";import"../upload-DJTptYqV.mjs";import"../checksum-P9C2JlRk.mjs";import"../stream-limiter-DFtRZczp.mjs";export{_ as CredentialProvider,l as EventType,a as FlowProvider,c as FlowServer,u as FlowWaitUntil,U as ImageAiPlugin,n as ImagePlugin,v as NodeType,s as ParallelScheduler,k as VideoPlugin,R as ZipPlugin,S as blurTransformSchema,F as brightnessTransformSchema,f as completeNodeExecution,z as contrastTransformSchema,P as createFlow,L as createFlowEdge,b as createFlowNode,h as createFlowServer,t as createFlowWithSchema,j as createInputNode,r as createStorageNode,i as createTransformNode,g as describeImageParamsSchema,w as flipTransformSchema,K as flowServer,y as getFlowData,o as getNodeData,M as grayscaleTransformSchema,e as inputDataSchema,A as inputNodeParamsSchema,V as logoTransformSchema,W as optimizeParamsSchema,C as removeBackgroundParamsSchema,G as resizeParamsSchema,T as resizeTransformSchema,d as resolveUploadMetadata,E as rotateTransformSchema,B as runArgsSchema,I as sepiaTransformSchema,N as sharpenTransformSchema,p as storageParamsSchema,O as textTransformSchema,D as transformImageParamsSchema,x as transformationSchema,m as waitingNodeExecution,H as watermarkTransformSchema};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./uploadista-error-U9YxwNtM.mjs";import{c as t,g as n,i as r}from"./types-BYfvxhhG.mjs";import{a as i,n as a,o}from"./upload-CcmxSO5u.mjs";import{Context as s,Effect as c,Layer as l,Option as u,Runtime as d}from"effect";import{z as f}from"zod";function p({source:e,target:t,sourcePort:n,targetPort:r}){return{source:e,target:t,sourcePort:n,targetPort:r}}let m=function(e){return e.JobStart=`job-start`,e.JobEnd=`job-end`,e.FlowStart=`flow-start`,e.FlowEnd=`flow-end`,e.FlowError=`flow-error`,e.FlowPause=`flow-pause`,e.FlowCancel=`flow-cancel`,e.NodeStart=`node-start`,e.NodeEnd=`node-end`,e.NodePause=`node-pause`,e.NodeResume=`node-resume`,e.NodeError=`node-error`,e.NodeStream=`node-stream`,e.NodeResponse=`node-response`,e}({}),h=function(e){return e.input=`input`,e.process=`process`,e.output=`output`,e.conditional=`conditional`,e.multiplex=`multiplex`,e.merge=`merge`,e}({});function g({id:t,name:n,description:r,type:i,inputSchema:a,outputSchema:o,run:s,condition:l,multiInput:u=!1,multiOutput:d=!1,pausable:f=!1,retry:p}){return c.succeed({id:t,name:n,description:r,type:i,inputSchema:a,outputSchema:o,pausable:f,run:({data:r,jobId:i,flowId:l,storageId:u,clientId:d})=>c.gen(function*(){let f=yield*s({data:yield*c.try({try:()=>a.parse(r),catch:r=>{let i=r instanceof Error?r.message:String(r);return e.fromCode(`FLOW_INPUT_VALIDATION_ERROR`,{body:`Node '${n}' (${t}) input validation failed: ${i}`,cause:r})}}),jobId:i,storageId:u,flowId:l,clientId:d});return f.type===`waiting`?f:{type:`complete`,data:yield*c.try({try:()=>o.parse(f.data),catch:r=>{let i=r instanceof Error?r.message:String(r);return e.fromCode(`FLOW_OUTPUT_VALIDATION_ERROR`,{body:`Node '${n}' (${t}) output validation failed: ${i}`,cause:r})}})}}),condition:l,multiInput:u,multiOutput:d,retry:p})}const _=e=>({id:e.id,name:e.name,description:e.description,type:e.type});var v=class{maxConcurrency;constructor(e={}){this.maxConcurrency=e.maxConcurrency??4}groupNodesByExecutionLevel(e,t){let n={},r={};e.forEach(e=>{n[e.id]=[],r[e.id]=0}),t.forEach(e=>{n[e.source]?.push(e.target),r[e.target]=(r[e.target]||0)+1});let i=[],a=new Set,o=0;for(;a.size<e.length;){let e=Object.keys(r).filter(e=>r[e]===0&&!a.has(e));if(e.length===0)throw Error(`Cycle detected in flow graph - cannot execute in parallel`);i.push({level:o++,nodes:e}),e.forEach(e=>{a.add(e),delete r[e],n[e]?.forEach(e=>{r[e]!==void 0&&r[e]--})})}return i}executeNodesInParallel(e){return c.all(e.map(e=>e()),{concurrency:this.maxConcurrency})}canExecuteInParallel(e,t,n){return e.every(e=>(n[e]||[]).every(e=>t.has(e)))}getStats(){return{maxConcurrency:this.maxConcurrency}}};const y=(e,t)=>{if(e===t)return!0;try{return!!(e&&t&&typeof e==`object`&&typeof t==`object`)}catch{return!0}};var b=class{typeChecker;constructor(e=y){this.typeChecker=e}validateConnection(e,t,n){return this.getCompatibleTypes(e.outputSchema,t.inputSchema)}getCompatibleTypes(e,t){return this.typeChecker(e,t)}validateFlow(e,t){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=r.get(e.source),i=r.get(e.target);if(!t){n.push(`Source node ${e.source} not found`);continue}if(!i){n.push(`Target node ${e.target} not found`);continue}this.validateConnection(t,i,e)||n.push(`Schema mismatch: ${t.id} output schema incompatible with ${i.id} input schema`)}return{isValid:n.length===0,errors:n}}getExpectedInputSchemas(e,t,n){let r=new Map(t.map(e=>[e.id,e])),i={};for(let t of n)if(t.target===e){let e=r.get(t.source);if(e){let n=t.sourcePort||t.source;i[n]=e.outputSchema}}return i}getActualOutputSchemas(e,t,n){let r=new Map(t.map(e=>[e.id,e])),i={};for(let t of n)if(t.source===e){let e=r.get(t.target);if(e){let n=t.targetPort||t.target;i[n]=e.inputSchema}}return i}validateData(e,t){try{return t.parse(e),{isValid:!0,errors:[]}}catch(e){return e instanceof Error&&`errors`in e?{isValid:!1,errors:e.errors.map(e=>`${e.path.join(`.`)}: ${e.message}`)}:{isValid:!1,errors:[e instanceof Error?e.message:`Validation failed`]}}}};const x=e=>({id:e.id,name:e.name,nodes:e.nodes.map(_),edges:e.edges});function S(t){return c.gen(function*(){let n=yield*c.all(t.nodes.map(e=>c.isEffect(e)?e:c.succeed(e))),{flowId:r,name:i,onEvent:a,checkJobStatus:o,edges:s,inputSchema:l,outputSchema:u,typeChecker:d}=t,p=n,h=new b(d),g=()=>{let e={},t={},n={};return p.forEach(r=>{e[r.id]=[],n[r.id]=[],t[r.id]=0}),s.forEach(r=>{e[r.source]?.push(r.target),n[r.target]?.push(r.source),t[r.target]=(t[r.target]||0)+1}),{graph:e,reverseGraph:n,inDegree:t}},_=()=>{let{graph:e,inDegree:t}=g(),n=[],r=[];for(Object.keys(t).forEach(e=>{t[e]===0&&n.push(e)});n.length>0;){let i=n.shift();if(!i)throw Error(`No current node found`);r.push(i),e[i]?.forEach(e=>{t[e]=(t[e]||0)-1,t[e]===0&&n.push(e)})}return r},y=(e,t)=>{if(!e.condition)return c.succeed(!0);let{field:n,operator:r,value:i}=e.condition,a=t,o=a?.metadata?.[n]||a?.[n],s=(()=>{switch(r){case`equals`:return o===i;case`notEquals`:return o!==i;case`greaterThan`:return Number(o)>Number(i);case`lessThan`:return Number(o)<Number(i);case`contains`:return String(o).includes(String(i));case`startsWith`:return String(o).startsWith(String(i));default:return!0}})();return c.succeed(s)},x=(e,t)=>{let{reverseGraph:n}=g(),r=n[e]||[],i={};return r.forEach(e=>{let n=t.get(e);n!==void 0&&(i[e]=n)}),i},S=e=>{let t=p.filter(e=>e.type===`input`),n={};return t.forEach(t=>{e&&typeof e==`object`&&t.id in e&&(n[t.id]=l.parse(e[t.id]))}),n},C=e=>{let t=p.filter(e=>e.type===`output`),n={};return t.forEach(t=>{let r=e.get(t.id);r!==void 0&&(n[t.id]=r)}),n},w=(t,n,i,s,l,u,d)=>c.gen(function*(){let f=l.get(t);if(!f)return yield*e.fromCode(`FLOW_NODE_NOT_FOUND`).toEffect();if(o){let t=yield*o(u);if(t===`paused`)return yield*e.fromCode(`FLOW_PAUSED`,{cause:`Flow ${r} was paused by user at job ${u}`}).toEffect();if(t===`cancelled`)return yield*e.fromCode(`FLOW_CANCELLED`,{cause:`Flow ${r} was cancelled by user at job ${u}`}).toEffect()}a&&(yield*a({jobId:u,flowId:r,nodeId:t,eventType:m.NodeStart,nodeName:f.name,nodeType:f.type}));let p=f.retry?.maxRetries??0,h=f.retry?.retryDelay??1e3,g=f.retry?.exponentialBackoff??!0,_=0,v=null;for(;_<=p;)try{let o,l={};if(f.type===`input`){if(o=i[t],o===void 0)return yield*c.logError(`Input node ${t} has no input data`),yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Input node ${t} has no input data`)}).toEffect()}else{if(l=x(t,s),Object.keys(l).length===0)return yield*c.logError(`Node ${t} has no input data`),yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Node ${t} has no input data`)}).toEffect();if(f.multiInput)o=l;else{let n=Object.keys(l)[0];if(!n)return yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Node ${t} has no input data`)}).toEffect();o=l[n]}}if(f.type===`conditional`&&!(yield*y(f,o)))return a&&(yield*a({jobId:u,flowId:r,nodeId:t,eventType:m.NodeEnd,nodeName:f.name})),{nodeId:t,result:o,success:!0,waiting:!1};let p=yield*f.run({data:o,inputs:l,jobId:u,flowId:r,storageId:n,clientId:d});if(p.type===`waiting`){let e=p.partialData;return a&&(yield*a({jobId:u,flowId:r,nodeId:t,eventType:m.NodePause,nodeName:f.name,partialData:e})),{nodeId:t,result:e,success:!0,waiting:!0}}let h=p.data;return a&&(yield*a({jobId:u,flowId:r,nodeId:t,eventType:m.NodeEnd,nodeName:f.name,result:h})),{nodeId:t,result:h,success:!0,waiting:!1}}catch(n){if(v=n instanceof e?n:e.fromCode(`FLOW_NODE_ERROR`,{cause:n}),_<p){_++;let e=g?h*2**(_-1):h;yield*c.logWarning(`Node ${t} (${f.name}) failed, retrying (${_}/${p}) after ${e}ms`),yield*c.sleep(e);continue}return a&&(yield*a({jobId:u,flowId:r,nodeId:t,eventType:m.NodeError,nodeName:f.name,error:v.body,retryCount:_})),yield*v.toEffect()}return v?yield*v.toEffect():yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Unexpected error in retry loop`)}).toEffect()}),T=({inputs:n,storageId:i,jobId:o,resumeFrom:l,clientId:d})=>c.gen(function*(){!l&&a&&(yield*a({jobId:o,eventType:m.FlowStart,flowId:r}));let h=S(n||{}),g,y,b;if(l)g=l.executionOrder,y=l.nodeResults,b=l.currentIndex;else if(g=_(),y=new Map,b=0,g.length!==p.length)return yield*e.fromCode(`FLOW_CYCLE_ERROR`).toEffect();let x=new Map(p.map(e=>[e.id,e]));if(t.parallelExecution?.enabled??!1){yield*c.logDebug(`Flow ${r}: Executing in parallel mode (maxConcurrency: ${t.parallelExecution?.maxConcurrency??4})`);let e=new v({maxConcurrency:t.parallelExecution?.maxConcurrency??4}),n=e.groupNodesByExecutionLevel(p,s);yield*c.logDebug(`Flow ${r}: Grouped nodes into ${n.length} execution levels`);let u={};p.forEach(e=>{u[e.id]=[]}),s.forEach(e=>{u[e.target]?.push(e.source)});for(let t of n){yield*c.logDebug(`Flow ${r}: Executing level ${t.level} with nodes: ${t.nodes.join(`, `)}`);let n=t.nodes.map(e=>()=>c.gen(function*(){if(l&&e===l.executionOrder[b]&&a){let t=x.get(e);t&&(yield*a({jobId:o,flowId:r,nodeId:e,eventType:m.NodeResume,nodeName:t.name,nodeType:t.type}))}return{nodeId:e,nodeResult:yield*w(e,i,h,y,x,o,d)}})),s=yield*e.executeNodesInParallel(n);for(let{nodeId:e,nodeResult:t}of s){if(t.waiting)return t.result!==void 0&&y.set(e,t.result),{type:`paused`,nodeId:e,executionState:{executionOrder:g,currentIndex:g.indexOf(e),inputs:h}};t.success&&y.set(e,t.result)}}}else{yield*c.logDebug(`Flow ${r}: Executing in sequential mode`);for(let t=b;t<g.length;t++){let n=g[t];if(!n)return yield*e.fromCode(`FLOW_NODE_NOT_FOUND`).toEffect();if(l&&t===b&&a){let e=x.get(n);e&&(yield*a({jobId:o,flowId:r,nodeId:n,eventType:m.NodeResume,nodeName:e.name,nodeType:e.type}))}let s=yield*w(n,i,h,y,x,o,d);if(s.waiting)return s.result!==void 0&&y.set(s.nodeId,s.result),{type:`paused`,nodeId:s.nodeId,executionState:{executionOrder:g,currentIndex:t,inputs:h}};s.success&&y.set(s.nodeId,s.result)}}let T=C(y),E=f.record(f.string(),u).safeParse(T);if(!E.success){let t=`Flow output validation failed: ${E.error.message}. Expected outputs: ${JSON.stringify(Object.keys(C(y)))}. Output nodes: ${p.filter(e=>e.type===`output`).map(e=>e.id).join(`, `)}`;return a&&(yield*a({jobId:o,eventType:m.FlowError,flowId:r,error:t})),yield*e.fromCode(`FLOW_OUTPUT_VALIDATION_ERROR`,{body:t,cause:E.error}).toEffect()}let D=E.data;return a&&(yield*a({jobId:o,eventType:m.FlowEnd,flowId:r,result:D})),{type:`completed`,result:D}});return{id:r,name:i,nodes:p,edges:s,inputSchema:l,outputSchema:u,onEvent:a,checkJobStatus:o,run:({inputs:e,storageId:t,jobId:n,clientId:r})=>T({inputs:e,storageId:t,jobId:n,clientId:r}),resume:({jobId:e,storageId:t,nodeResults:n,executionState:r,clientId:i})=>T({inputs:r.inputs,storageId:t,jobId:e,resumeFrom:{executionOrder:r.executionOrder,nodeResults:new Map(Object.entries(n)),currentIndex:r.currentIndex},clientId:i}),validateTypes:()=>{let e=p;return h.validateFlow(e,s)},validateInputs:e=>h.validateData(e,l),validateOutputs:e=>h.validateData(e,u)}})}var C=class e extends s.Tag(`FlowWaitUntil`)(){static optional=c.serviceOption(e)},w=class extends s.Tag(`FlowProvider`)(){},T=class extends s.Tag(`FlowServer`)(){};const E=e=>typeof e==`object`&&!!e&&`id`in e;function D(t,n,r){let i=e=>{let i=t=>c.gen(function*(){let n=yield*r.get(e);n&&(yield*r.set(e,{...n,...t,updatedAt:new Date}))});return a=>c.gen(function*(){switch(t.onEvent&&(yield*c.catchAll(t.onEvent(a),e=>(c.logError(`Original onEvent failed`,e),c.succeed({eventId:null})))),yield*n.emit(e,a),c.logInfo(`Updating job ${e} with event ${a.eventType}`),a.eventType){case m.FlowStart:yield*i({status:`running`});break;case m.FlowEnd:break;case m.FlowError:yield*i({status:`failed`,error:a.error});break;case m.NodeStart:yield*c.gen(function*(){let t=yield*r.get(e);if(t){let n=t.tasks.find(e=>e.nodeId===a.nodeId)?t.tasks.map(e=>e.nodeId===a.nodeId?{...e,status:`running`,updatedAt:new Date}:e):[...t.tasks,{nodeId:a.nodeId,status:`running`,createdAt:new Date,updatedAt:new Date}];yield*r.set(e,{...t,tasks:n,updatedAt:new Date})}});break;case m.NodePause:yield*c.gen(function*(){let t=yield*r.get(e);if(t){let n=t.tasks.find(e=>e.nodeId===a.nodeId)?t.tasks.map(e=>e.nodeId===a.nodeId?{...e,status:`paused`,result:a.partialData,updatedAt:new Date}:e):[...t.tasks,{nodeId:a.nodeId,status:`paused`,result:a.partialData,createdAt:new Date,updatedAt:new Date}];yield*r.set(e,{...t,tasks:n,updatedAt:new Date})}});break;case m.NodeResume:yield*c.gen(function*(){let t=yield*r.get(e);if(t){let n=t.tasks.map(e=>e.nodeId===a.nodeId?{...e,status:`running`,updatedAt:new Date}:e);yield*r.set(e,{...t,tasks:n,updatedAt:new Date})}});break;case m.NodeEnd:yield*c.gen(function*(){let n=yield*r.get(e);if(n){let i=n.tasks.map(e=>e.nodeId===a.nodeId?{...e,status:`completed`,result:a.result,updatedAt:new Date}:e),o=t.nodes.find(e=>e.id===a.nodeId)?.type===`output`,s=a.result,c=n.intermediateFiles||[];o&&E(s)&&s.id?c=c.filter(e=>e!==s.id):!o&&E(s)&&s.id&&(c.includes(s.id)||c.push(s.id)),yield*r.set(e,{...n,tasks:i,intermediateFiles:c,updatedAt:new Date})}});break;case m.NodeError:yield*c.gen(function*(){let t=yield*r.get(e);if(t){let n=t.tasks.map(e=>e.nodeId===a.nodeId?{...e,status:`failed`,error:a.error,retryCount:a.retryCount,updatedAt:new Date}:e);yield*r.set(e,{...t,tasks:n,error:a.error,updatedAt:new Date})}});break}return{eventId:e}})},a=t=>t=>c.gen(function*(){let n=yield*r.get(t);return n?n.status===`paused`?`paused`:n.status===`cancelled`?`cancelled`:`running`:yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}))});return{...t,run:e=>c.gen(function*(){let n=e.jobId||crypto.randomUUID(),r=i(n),o=a(n);return yield*(yield*S({flowId:t.id,name:t.name,nodes:t.nodes,edges:t.edges,inputSchema:t.inputSchema,outputSchema:t.outputSchema,onEvent:r,checkJobStatus:o})).run({...e,jobId:n,clientId:e.clientId})}),resume:e=>c.gen(function*(){let n=e.jobId,r=i(n),o=a(n);return yield*(yield*S({flowId:t.id,name:t.name,nodes:t.nodes,edges:t.edges,inputSchema:t.inputSchema,outputSchema:t.outputSchema,onEvent:r,checkJobStatus:o})).resume(e)})}}function O(){return c.gen(function*(){let r=yield*w,i=yield*n,o=yield*t,s=yield*a,l=(t,n)=>c.gen(function*(){let r=yield*o.get(t);return r?yield*o.set(t,{...r,...n}):yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}))}),f=(e,t)=>c.gen(function*(){let n=yield*o.get(e);!n||!n.intermediateFiles||n.intermediateFiles.length===0||(yield*c.logInfo(`Cleaning up ${n.intermediateFiles.length} intermediate files for job ${e}`),yield*c.all(n.intermediateFiles.map(e=>c.gen(function*(){yield*s.delete(e,t),yield*c.logDebug(`Deleted intermediate file ${e}`)}).pipe(c.catchAll(t=>c.gen(function*(){return yield*c.logWarning(`Failed to delete intermediate file ${e}: ${t}`),c.succeed(void 0)})))),{concurrency:5}),yield*l(e,{intermediateFiles:[]}))}),p=({jobId:t,flow:n,storageId:r,clientId:a,inputs:s})=>c.gen(function*(){console.log(`[FlowServer] executeFlowInBackground started for job: ${t}`),yield*l(t,{status:`running`}),console.log(`[FlowServer] Creating flowWithEvents for job: ${t}`);let e=D(n,i,o);console.log(`[FlowServer] Running flow for job: ${t}`);let c=yield*e.run({inputs:s,storageId:r,jobId:t,clientId:a});return console.log(`[FlowServer] Flow completed for job: ${t}, result type: ${c.type}`),c.type===`paused`?yield*l(t,{status:`paused`,pausedAt:c.nodeId,executionState:c.executionState,updatedAt:new Date}):(yield*l(t,{status:`completed`,result:c.result,updatedAt:new Date,endedAt:new Date}),yield*f(t,a)),c}).pipe(c.catchAll(n=>c.gen(function*(){yield*c.logError(`Flow execution failed`,n);let r=n instanceof e?n.body:String(n);yield*c.logInfo(`Updating job ${t} to failed status with error: ${r}`),yield*l(t,{status:`failed`,error:r,updatedAt:new Date}).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logError(`Failed to update job ${t}`,e),c.succeed(void 0)})));let s=yield*o.get(t);throw s&&(yield*i.emit(t,{jobId:t,eventType:m.FlowError,flowId:s.flowId,error:r}).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logError(`Failed to emit FlowError event for job ${t}`,e),c.succeed(void 0)})))),yield*f(t,a).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logWarning(`Failed to cleanup intermediate files for job ${t}`,e),c.succeed(void 0)}))),n})));return{getFlow:(e,t)=>c.gen(function*(){return yield*r.getFlow(e,t)}),getFlowData:(e,t)=>c.gen(function*(){return x(yield*r.getFlow(e,t))}),runFlow:({flowId:t,storageId:n,clientId:i,inputs:a})=>c.gen(function*(){let s=yield*C.optional,l=yield*c.try({try:()=>$.parse({inputs:a}),catch:t=>e.fromCode(`FLOW_INPUT_VALIDATION_ERROR`,{cause:t})}),f=crypto.randomUUID(),m=new Date,h={id:f,flowId:t,storageId:n,clientId:i,status:`started`,createdAt:m,updatedAt:m,tasks:[]};yield*o.set(f,h);let g=yield*r.getFlow(t,i);console.log(`[FlowServer] About to fork flow execution for job: ${f}`);let _=p({jobId:f,flow:g,storageId:n,clientId:i,inputs:l.inputs}).pipe(c.tapErrorCause(e=>c.logError(`Flow execution failed`,e)));if(u.isSome(s)){console.log(`[FlowServer] Using waitUntil for job: ${f}`);let e=yield*c.runtime(),t=d.runPromise(e)(_);s.value(t)}else console.log(`[FlowServer] Using Effect.forkDaemon for job: ${f}`),yield*c.forkDaemon(_);return console.log(`[FlowServer] Flow execution started for job: ${f}`),h}),getJobStatus:t=>c.gen(function*(){return(yield*o.get(t))||(yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`})))}),resumeFlow:({jobId:t,nodeId:n,newData:a,clientId:s})=>c.gen(function*(){let p=yield*C.optional,h=yield*o.get(t);if(!h)return console.error(`Job not found`),yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}));if(h.status!==`paused`)return console.error(`Job is not paused`),yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} is not paused (status: ${h.status})`}));if(h.pausedAt!==n)return console.error(`Job is not paused at the expected node`),yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} is paused at node ${h.pausedAt}, not ${n}`}));if(!h.executionState)return console.error(`Job has no execution state`),yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} has no execution state`}));let g={...h.tasks.reduce((e,t)=>(t.result!==void 0&&(e[t.nodeId]=t.result),e),{}),[n]:a},_={...h.executionState.inputs,[n]:a};yield*l(t,{status:`running`});let v=yield*r.getFlow(h.flowId,h.clientId),y=c.gen(function*(){let n=D(v,i,o);if(!h.executionState)return yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} has no execution state`}));let r=yield*n.resume({jobId:t,storageId:h.storageId,nodeResults:g,executionState:{...h.executionState,inputs:_},clientId:h.clientId});return r.type===`paused`?yield*l(t,{status:`paused`,pausedAt:r.nodeId,executionState:r.executionState,updatedAt:new Date}):(yield*l(t,{status:`completed`,pausedAt:void 0,executionState:void 0,result:r.result,updatedAt:new Date,endedAt:new Date}),yield*f(t,s)),r}).pipe(c.catchAll(n=>c.gen(function*(){yield*c.logError(`Flow resume failed`,n);let r=n instanceof e?n.body:String(n);yield*c.logInfo(`Updating job ${t} to failed status with error: ${r}`),yield*l(t,{status:`failed`,error:r,updatedAt:new Date}).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logError(`Failed to update job ${t}`,e),c.succeed(void 0)})));let a=yield*o.get(t);throw a&&(yield*i.emit(t,{jobId:t,eventType:m.FlowError,flowId:a.flowId,error:r}).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logError(`Failed to emit FlowError event for job ${t}`,e),c.succeed(void 0)})))),yield*f(t,s).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logWarning(`Failed to cleanup intermediate files for job ${t}`,e),c.succeed(void 0)}))),n}))).pipe(c.tapErrorCause(e=>c.logError(`Flow resume failed`,e)));if(u.isSome(p)){console.log(`[FlowServer] Using waitUntil for resume job: ${t}`);let e=yield*c.runtime(),n=d.runPromise(e)(y);p.value(n)}else console.log(`[FlowServer] Using Effect.forkDaemon for resume job: ${t}`),yield*c.forkDaemon(y);return(yield*o.get(t))||(yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found after update`})))}),pauseFlow:(t,n)=>c.gen(function*(){let r=yield*o.get(t);if(!r)return yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}));if(n!==null&&r.clientId!==n)return yield*c.fail(e.fromCode(`FLOW_NOT_AUTHORIZED`,{cause:`Client ${n} is not authorized to pause job ${t}`}));if(r.status!==`running`)return yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} cannot be paused (current status: ${r.status})`}));let a=r.tasks.find(e=>e.status===`running`)?.nodeId;return yield*l(t,{status:`paused`,pausedAt:a,updatedAt:new Date}),yield*i.emit(t,{jobId:t,flowId:r.flowId,eventType:m.FlowPause,pausedAt:a}),(yield*o.get(t))||(yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found after pause`})))}),cancelFlow:(t,n)=>c.gen(function*(){let r=yield*o.get(t);return r?n!==null&&r.clientId!==n?yield*c.fail(e.fromCode(`FLOW_NOT_AUTHORIZED`,{cause:`Client ${n} is not authorized to cancel job ${t}`})):r.status!==`running`&&r.status!==`paused`&&r.status!==`started`?yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} cannot be cancelled (current status: ${r.status})`})):(yield*l(t,{status:`cancelled`,updatedAt:new Date,endedAt:new Date}),yield*i.emit(t,{jobId:t,flowId:r.flowId,eventType:m.FlowCancel}),yield*f(t,n),(yield*o.get(t))||(yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found after cancellation`})))):yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}))}),subscribeToFlowEvents:(e,t)=>c.gen(function*(){yield*i.subscribe(e,t)}),unsubscribeFromFlowEvents:e=>c.gen(function*(){yield*i.unsubscribe(e)})}})}const k=l.effect(T,O()),A=e=>({type:`complete`,data:e}),j=e=>({type:`waiting`,partialData:e});function M(e){if(!e)return{type:``,fileName:``,metadata:void 0,metadataJson:void 0};let t={...e},n=String(t.type||t.mimeType||t[`content-type`]||``);n&&(t.type||=n,t.mimeType||=n);let r=String(t.fileName||t.originalName||t.name||``);return r&&(t.fileName||=r,t.originalName||=r,t.name||=r),{type:n,fileName:r,metadata:t,metadataJson:JSON.stringify(t)}}const N=f.object({operation:f.literal(`init`),storageId:f.string(),metadata:f.record(f.string(),f.any()).optional()}),P=f.object({operation:f.literal(`finalize`),uploadId:f.string()}),F=f.object({operation:f.literal(`url`),url:f.string(),storageId:f.string().optional(),metadata:f.record(f.string(),f.any()).optional()}),I=f.union([N,P,F]),L=f.object({allowedMimeTypes:f.array(f.string()).optional(),minSize:f.number().positive().optional(),maxSize:f.number().positive().optional()});function R(t,n){return c.gen(function*(){if(n){if(n.allowedMimeTypes&&n.allowedMimeTypes.length>0&&!n.allowedMimeTypes.some(e=>{if(e.endsWith(`/*`)){let n=e.slice(0,-2);return t.type.startsWith(n)}return t.type===e}))throw yield*e.fromCode(`VALIDATION_ERROR`,{cause:Error(`File type "${t.type}" is not allowed. Allowed types: ${n.allowedMimeTypes.join(`, `)}`)}).toEffect();if(n.minSize!==void 0&&t.size<n.minSize)throw yield*e.fromCode(`VALIDATION_ERROR`,{cause:Error(`File size (${t.size} bytes) is below minimum (${n.minSize} bytes)`)}).toEffect();if(n.maxSize!==void 0&&t.size>n.maxSize)throw yield*e.fromCode(`VALIDATION_ERROR`,{cause:Error(`File size (${t.size} bytes) exceeds maximum (${n.maxSize} bytes)`)}).toEffect()}})}function ee(t,n){return c.gen(function*(){let s=yield*a;return yield*g({id:t,name:`Input`,description:`Handles file input through multiple methods - streaming upload (init/finalize) or direct URL fetch`,type:h.input,inputSchema:I,outputSchema:r,run:({data:r,flowId:a,jobId:l,clientId:u})=>c.gen(function*(){switch(r.operation){case`init`:{let e={storageId:r.storageId,size:r.metadata?.size||0,type:r.metadata?.mimeType||`application/octet-stream`,fileName:r.metadata?.originalName,lastModified:r.metadata?.size?Date.now():void 0,metadata:r.metadata?JSON.stringify(r.metadata):void 0,flow:{flowId:a,nodeId:t,jobId:l}};return j(yield*s.createUpload(e,u))}case`finalize`:{let e=yield*s.getUpload(r.uploadId),{type:t}=M(e.metadata);return yield*R({type:t,size:e.size||0},n),A(e)}case`url`:{let e=yield*o(r.url),c=yield*i(e),d=r.metadata?.mimeType||e.headers.get(`content-type`)||`application/octet-stream`,f=r.metadata?.size||Number(e.headers.get(`content-length`)||0),p=r.metadata?.originalName||r.url.split(`/`).pop()||`file`;yield*R({type:d,size:f},n);let m=new ReadableStream({start(e){e.enqueue(new Uint8Array(c)),e.close()}}),h={storageId:r.storageId||`buffer`,size:f,type:d,fileName:p,lastModified:Date.now(),metadata:r.metadata?JSON.stringify(r.metadata):void 0};return A({...yield*s.upload(h,u,m),flow:{flowId:a,nodeId:t,jobId:l}})}default:throw yield*e.fromCode(`VALIDATION_ERROR`,{cause:Error(`Invalid operation`)}).toEffect()}})})})}const te=f.object({});function ne(t,n=e=>c.succeed(e)){return c.gen(function*(){let i=yield*a;return yield*g({id:t,name:`Storage`,description:`Stores a file in the storage`,type:h.output,inputSchema:r,outputSchema:r,run:({data:r,storageId:a,flowId:o,jobId:s,clientId:l})=>c.gen(function*(){let{type:u,fileName:d,metadata:f,metadataJson:p}=M(r.metadata),m={flowId:o,nodeId:t,jobId:s},h=f?{...r,metadata:f}:r,g=yield*i.getUpload(r.id);if(!g.id)return yield*c.fail(e.fromCode(`FILE_READ_ERROR`,Error(`Upload Key is undefined`)));if(g.storage.id===a)return A(yield*n({...h,flow:m}));let _=yield*i.read(r.id,l),v=new ReadableStream({start(e){e.enqueue(_),e.close()}}),y=yield*i.upload({storageId:a,size:_.byteLength,type:u,fileName:d,lastModified:0,metadata:p,flow:m},l,v),b=M(y.metadata);return A(yield*n(b.metadata?{...y,metadata:b.metadata}:y))})})})}function re({id:e,name:t,description:n,transform:i}){return c.gen(function*(){let o=yield*a;return yield*g({id:e,name:t,description:n,type:h.process,inputSchema:r,outputSchema:r,run:({data:t,storageId:n,flowId:r,jobId:a,clientId:s})=>c.gen(function*(){let c={flowId:r,nodeId:e,jobId:a},l=yield*i(yield*o.read(t.id,s),t),u=l instanceof Uint8Array?l:l.bytes,d=l instanceof Uint8Array?void 0:l.type,f=l instanceof Uint8Array?void 0:l.fileName,p=new ReadableStream({start(e){e.enqueue(u),e.close()}}),{type:m,fileName:h,metadata:g,metadataJson:_}=M(t.metadata),v=yield*o.upload({storageId:n,size:u.byteLength,type:d??m,fileName:f??h,lastModified:0,metadata:_,flow:c},s,p);return A(g?{...v,metadata:g}:v)})})})}var ie=class extends s.Tag(`CredentialProvider`)(){},ae=class extends s.Tag(`ImageAiPlugin`)(){},oe=class extends s.Tag(`ImagePlugin`)(){};const se=f.object({serviceType:f.enum([`replicate`]).optional()}),ce=f.object({quality:f.number().min(0).max(100),format:f.enum([`jpeg`,`webp`,`png`,`avif`])}),le=f.object({serviceType:f.enum([`replicate`]).optional()}),ue=f.object({width:f.number().positive().optional(),height:f.number().positive().optional(),fit:f.enum([`contain`,`cover`,`fill`])}).refine(e=>e.width||e.height,`Either width or height must be specified for resize`),z=f.object({type:f.literal(`resize`),width:f.number().positive().optional(),height:f.number().positive().optional(),fit:f.enum([`contain`,`cover`,`fill`])}),B=f.object({type:f.literal(`blur`),sigma:f.number().min(.3).max(1e3)}),V=f.object({type:f.literal(`rotate`),angle:f.number(),background:f.string().optional()}),H=f.object({type:f.literal(`flip`),direction:f.enum([`horizontal`,`vertical`])}),U=f.object({type:f.literal(`grayscale`)}),W=f.object({type:f.literal(`sepia`)}),G=f.object({type:f.literal(`brightness`),value:f.number().min(-100).max(100)}),K=f.object({type:f.literal(`contrast`),value:f.number().min(-100).max(100)}),q=f.object({type:f.literal(`sharpen`),sigma:f.number().positive().optional()}),J=f.object({type:f.literal(`watermark`),imagePath:f.string().min(1).url(),position:f.enum([`top-left`,`top-right`,`bottom-left`,`bottom-right`,`center`]),opacity:f.number().min(0).max(1),offsetX:f.number().optional(),offsetY:f.number().optional()}),Y=f.object({type:f.literal(`logo`),imagePath:f.string().min(1).url(),position:f.enum([`top-left`,`top-right`,`bottom-left`,`bottom-right`,`center`]),scale:f.number().min(.1).max(2),offsetX:f.number().optional(),offsetY:f.number().optional()}),X=f.object({type:f.literal(`text`),text:f.string().min(1),position:f.enum([`top-left`,`top-right`,`bottom-left`,`bottom-right`,`center`]),fontSize:f.number().positive(),color:f.string().min(1),fontFamily:f.string().optional(),offsetX:f.number().optional(),offsetY:f.number().optional()}),Z=f.discriminatedUnion(`type`,[z,B,V,H,U,W,G,K,q,J,Y,X]),de=f.object({transformations:f.array(Z).min(1)});var fe=class extends s.Tag(`ZipPlugin`)(){};const Q=(e,t)=>{if(e.length===0)return t;let[n,...r]=e;return r.reduce((e,t)=>f.union([e,t]),n)};function pe(t){return c.gen(function*(){let n=Object.entries(t.nodes),r=e=>c.isEffect(e)?e:c.succeed(e),i=yield*c.forEach(n,([t,n])=>c.flatMap(r(n),n=>n.id===t?c.succeed([t,n]):c.fail(e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Node key ${t} does not match node id ${n.id}`)})))),a=Object.fromEntries(i),o=i.map(([,e])=>e),s=i.filter(([,e])=>e.type===h.input).map(([,e])=>e.inputSchema),l=i.filter(([,e])=>e.type===h.output).map(([,e])=>e.outputSchema),u=t.inputSchema??Q(s,f.unknown()),d=t.outputSchema??Q(l,f.unknown()),p=t.edges.map(e=>({source:a[e.source]?.id??e.source,target:a[e.target]?.id??e.target,sourcePort:e.sourcePort,targetPort:e.targetPort}));return yield*S({flowId:t.flowId,name:t.name,nodes:o,edges:p,inputSchema:u,outputSchema:d,typeChecker:t.typeChecker,onEvent:t.onEvent,parallelExecution:t.parallelExecution})})}const $=f.object({inputs:f.record(f.string(),f.any())});export{L as A,x as B,ae as C,te as D,ne as E,T as F,m as G,h as H,C as I,p as K,O as L,A as M,j as N,ee as O,w as P,k as R,oe as S,re as T,g as U,v as V,_ as W,J as _,G as a,ce as b,U as c,V as d,W as f,Z as g,de as h,B as i,M as j,I as k,Y as l,X as m,pe as n,K as o,q as p,fe as r,H as s,$ as t,z as u,ue as v,ie as w,se as x,le as y,S as z};
|
|
2
|
-
//# sourceMappingURL=flow-
|
|
1
|
+
import{n as e}from"./uploadista-error-nZ_q-EZy.mjs";import{c as t,g as n,i as r}from"./types-DGZ892my.mjs";import{a as i,n as a,o}from"./upload-DJTptYqV.mjs";import{Context as s,Effect as c,Layer as l,Option as u,Runtime as d}from"effect";import{z as f}from"zod";function p({source:e,target:t,sourcePort:n,targetPort:r}){return{source:e,target:t,sourcePort:n,targetPort:r}}let m=function(e){return e.JobStart=`job-start`,e.JobEnd=`job-end`,e.FlowStart=`flow-start`,e.FlowEnd=`flow-end`,e.FlowError=`flow-error`,e.FlowPause=`flow-pause`,e.FlowCancel=`flow-cancel`,e.NodeStart=`node-start`,e.NodeEnd=`node-end`,e.NodePause=`node-pause`,e.NodeResume=`node-resume`,e.NodeError=`node-error`,e.NodeStream=`node-stream`,e.NodeResponse=`node-response`,e}({}),h=function(e){return e.input=`input`,e.process=`process`,e.output=`output`,e.conditional=`conditional`,e.multiplex=`multiplex`,e.merge=`merge`,e}({});function g({id:t,name:n,description:r,type:i,inputSchema:a,outputSchema:o,run:s,condition:l,multiInput:u=!1,multiOutput:d=!1,pausable:f=!1,retry:p}){return c.succeed({id:t,name:n,description:r,type:i,inputSchema:a,outputSchema:o,pausable:f,run:({data:r,jobId:i,flowId:l,storageId:u,clientId:d})=>c.gen(function*(){let f=yield*s({data:yield*c.try({try:()=>a.parse(r),catch:r=>{let i=r instanceof Error?r.message:String(r);return e.fromCode(`FLOW_INPUT_VALIDATION_ERROR`,{body:`Node '${n}' (${t}) input validation failed: ${i}`,cause:r})}}),jobId:i,storageId:u,flowId:l,clientId:d});return f.type===`waiting`?f:{type:`complete`,data:yield*c.try({try:()=>o.parse(f.data),catch:r=>{let i=r instanceof Error?r.message:String(r);return e.fromCode(`FLOW_OUTPUT_VALIDATION_ERROR`,{body:`Node '${n}' (${t}) output validation failed: ${i}`,cause:r})}})}}),condition:l,multiInput:u,multiOutput:d,retry:p})}const _=e=>({id:e.id,name:e.name,description:e.description,type:e.type});var v=class{maxConcurrency;constructor(e={}){this.maxConcurrency=e.maxConcurrency??4}groupNodesByExecutionLevel(e,t){let n={},r={};e.forEach(e=>{n[e.id]=[],r[e.id]=0}),t.forEach(e=>{n[e.source]?.push(e.target),r[e.target]=(r[e.target]||0)+1});let i=[],a=new Set,o=0;for(;a.size<e.length;){let e=Object.keys(r).filter(e=>r[e]===0&&!a.has(e));if(e.length===0)throw Error(`Cycle detected in flow graph - cannot execute in parallel`);i.push({level:o++,nodes:e}),e.forEach(e=>{a.add(e),delete r[e],n[e]?.forEach(e=>{r[e]!==void 0&&r[e]--})})}return i}executeNodesInParallel(e){return c.all(e.map(e=>e()),{concurrency:this.maxConcurrency})}canExecuteInParallel(e,t,n){return e.every(e=>(n[e]||[]).every(e=>t.has(e)))}getStats(){return{maxConcurrency:this.maxConcurrency}}};const y=(e,t)=>{if(e===t)return!0;try{return!!(e&&t&&typeof e==`object`&&typeof t==`object`)}catch{return!0}};var b=class{typeChecker;constructor(e=y){this.typeChecker=e}validateConnection(e,t,n){return this.getCompatibleTypes(e.outputSchema,t.inputSchema)}getCompatibleTypes(e,t){return this.typeChecker(e,t)}validateFlow(e,t){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=r.get(e.source),i=r.get(e.target);if(!t){n.push(`Source node ${e.source} not found`);continue}if(!i){n.push(`Target node ${e.target} not found`);continue}this.validateConnection(t,i,e)||n.push(`Schema mismatch: ${t.id} output schema incompatible with ${i.id} input schema`)}return{isValid:n.length===0,errors:n}}getExpectedInputSchemas(e,t,n){let r=new Map(t.map(e=>[e.id,e])),i={};for(let t of n)if(t.target===e){let e=r.get(t.source);if(e){let n=t.sourcePort||t.source;i[n]=e.outputSchema}}return i}getActualOutputSchemas(e,t,n){let r=new Map(t.map(e=>[e.id,e])),i={};for(let t of n)if(t.source===e){let e=r.get(t.target);if(e){let n=t.targetPort||t.target;i[n]=e.inputSchema}}return i}validateData(e,t){try{return t.parse(e),{isValid:!0,errors:[]}}catch(e){return e instanceof Error&&`errors`in e?{isValid:!1,errors:e.errors.map(e=>`${e.path.join(`.`)}: ${e.message}`)}:{isValid:!1,errors:[e instanceof Error?e.message:`Validation failed`]}}}};const x=e=>({id:e.id,name:e.name,nodes:e.nodes.map(_),edges:e.edges});function S(t){return c.gen(function*(){let n=yield*c.all(t.nodes.map(e=>c.isEffect(e)?e:c.succeed(e))),{flowId:r,name:i,onEvent:a,checkJobStatus:o,edges:s,inputSchema:l,outputSchema:u,typeChecker:d}=t,p=n,h=new b(d),g=()=>{let e={},t={},n={};return p.forEach(r=>{e[r.id]=[],n[r.id]=[],t[r.id]=0}),s.forEach(r=>{e[r.source]?.push(r.target),n[r.target]?.push(r.source),t[r.target]=(t[r.target]||0)+1}),{graph:e,reverseGraph:n,inDegree:t}},_=()=>{let{graph:e,inDegree:t}=g(),n=[],r=[];for(Object.keys(t).forEach(e=>{t[e]===0&&n.push(e)});n.length>0;){let i=n.shift();if(!i)throw Error(`No current node found`);r.push(i),e[i]?.forEach(e=>{t[e]=(t[e]||0)-1,t[e]===0&&n.push(e)})}return r},y=(e,t)=>{if(!e.condition)return c.succeed(!0);let{field:n,operator:r,value:i}=e.condition,a=t,o=a?.metadata?.[n]||a?.[n],s=(()=>{switch(r){case`equals`:return o===i;case`notEquals`:return o!==i;case`greaterThan`:return Number(o)>Number(i);case`lessThan`:return Number(o)<Number(i);case`contains`:return String(o).includes(String(i));case`startsWith`:return String(o).startsWith(String(i));default:return!0}})();return c.succeed(s)},x=(e,t)=>{let{reverseGraph:n}=g(),r=n[e]||[],i={};return r.forEach(e=>{let n=t.get(e);n!==void 0&&(i[e]=n)}),i},S=e=>{let t=p.filter(e=>e.type===`input`),n={};return t.forEach(t=>{e&&typeof e==`object`&&t.id in e&&(n[t.id]=l.parse(e[t.id]))}),n},C=e=>{let t=p.filter(e=>e.type===`output`),n={};return t.forEach(t=>{let r=e.get(t.id);r!==void 0&&(n[t.id]=r)}),n},w=(t,n,i,s,l,u,d)=>c.gen(function*(){let f=l.get(t);if(!f)return yield*e.fromCode(`FLOW_NODE_NOT_FOUND`).toEffect();if(o){let t=yield*o(u);if(t===`paused`)return yield*e.fromCode(`FLOW_PAUSED`,{cause:`Flow ${r} was paused by user at job ${u}`}).toEffect();if(t===`cancelled`)return yield*e.fromCode(`FLOW_CANCELLED`,{cause:`Flow ${r} was cancelled by user at job ${u}`}).toEffect()}a&&(yield*a({jobId:u,flowId:r,nodeId:t,eventType:m.NodeStart,nodeName:f.name,nodeType:f.type}));let p=f.retry?.maxRetries??0,h=f.retry?.retryDelay??1e3,g=f.retry?.exponentialBackoff??!0,_=0,v=null;for(;_<=p;)try{let o,l={};if(f.type===`input`){if(o=i[t],o===void 0)return yield*c.logError(`Input node ${t} has no input data`),yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Input node ${t} has no input data`)}).toEffect()}else{if(l=x(t,s),Object.keys(l).length===0)return yield*c.logError(`Node ${t} has no input data`),yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Node ${t} has no input data`)}).toEffect();if(f.multiInput)o=l;else{let n=Object.keys(l)[0];if(!n)return yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Node ${t} has no input data`)}).toEffect();o=l[n]}}if(f.type===`conditional`&&!(yield*y(f,o)))return a&&(yield*a({jobId:u,flowId:r,nodeId:t,eventType:m.NodeEnd,nodeName:f.name})),{nodeId:t,result:o,success:!0,waiting:!1};let p=yield*f.run({data:o,inputs:l,jobId:u,flowId:r,storageId:n,clientId:d});if(p.type===`waiting`){let e=p.partialData;return a&&(yield*a({jobId:u,flowId:r,nodeId:t,eventType:m.NodePause,nodeName:f.name,partialData:e})),{nodeId:t,result:e,success:!0,waiting:!0}}let h=p.data;return a&&(yield*a({jobId:u,flowId:r,nodeId:t,eventType:m.NodeEnd,nodeName:f.name,result:h})),{nodeId:t,result:h,success:!0,waiting:!1}}catch(n){if(v=n instanceof e?n:e.fromCode(`FLOW_NODE_ERROR`,{cause:n}),_<p){_++;let e=g?h*2**(_-1):h;yield*c.logWarning(`Node ${t} (${f.name}) failed, retrying (${_}/${p}) after ${e}ms`),yield*c.sleep(e);continue}return a&&(yield*a({jobId:u,flowId:r,nodeId:t,eventType:m.NodeError,nodeName:f.name,error:v.body,retryCount:_})),yield*v.toEffect()}return v?yield*v.toEffect():yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Unexpected error in retry loop`)}).toEffect()}),T=({inputs:n,storageId:i,jobId:o,resumeFrom:l,clientId:d})=>c.gen(function*(){!l&&a&&(yield*a({jobId:o,eventType:m.FlowStart,flowId:r}));let h=S(n||{}),g,y,b;if(l)g=l.executionOrder,y=l.nodeResults,b=l.currentIndex;else if(g=_(),y=new Map,b=0,g.length!==p.length)return yield*e.fromCode(`FLOW_CYCLE_ERROR`).toEffect();let x=new Map(p.map(e=>[e.id,e]));if(t.parallelExecution?.enabled??!1){yield*c.logDebug(`Flow ${r}: Executing in parallel mode (maxConcurrency: ${t.parallelExecution?.maxConcurrency??4})`);let e=new v({maxConcurrency:t.parallelExecution?.maxConcurrency??4}),n=e.groupNodesByExecutionLevel(p,s);yield*c.logDebug(`Flow ${r}: Grouped nodes into ${n.length} execution levels`);let u={};p.forEach(e=>{u[e.id]=[]}),s.forEach(e=>{u[e.target]?.push(e.source)});for(let t of n){yield*c.logDebug(`Flow ${r}: Executing level ${t.level} with nodes: ${t.nodes.join(`, `)}`);let n=t.nodes.map(e=>()=>c.gen(function*(){if(l&&e===l.executionOrder[b]&&a){let t=x.get(e);t&&(yield*a({jobId:o,flowId:r,nodeId:e,eventType:m.NodeResume,nodeName:t.name,nodeType:t.type}))}return{nodeId:e,nodeResult:yield*w(e,i,h,y,x,o,d)}})),s=yield*e.executeNodesInParallel(n);for(let{nodeId:e,nodeResult:t}of s){if(t.waiting)return t.result!==void 0&&y.set(e,t.result),{type:`paused`,nodeId:e,executionState:{executionOrder:g,currentIndex:g.indexOf(e),inputs:h}};t.success&&y.set(e,t.result)}}}else{yield*c.logDebug(`Flow ${r}: Executing in sequential mode`);for(let t=b;t<g.length;t++){let n=g[t];if(!n)return yield*e.fromCode(`FLOW_NODE_NOT_FOUND`).toEffect();if(l&&t===b&&a){let e=x.get(n);e&&(yield*a({jobId:o,flowId:r,nodeId:n,eventType:m.NodeResume,nodeName:e.name,nodeType:e.type}))}let s=yield*w(n,i,h,y,x,o,d);if(s.waiting)return s.result!==void 0&&y.set(s.nodeId,s.result),{type:`paused`,nodeId:s.nodeId,executionState:{executionOrder:g,currentIndex:t,inputs:h}};s.success&&y.set(s.nodeId,s.result)}}let T=C(y),E=f.record(f.string(),u).safeParse(T);if(!E.success){let t=`Flow output validation failed: ${E.error.message}. Expected outputs: ${JSON.stringify(Object.keys(C(y)))}. Output nodes: ${p.filter(e=>e.type===`output`).map(e=>e.id).join(`, `)}`;return a&&(yield*a({jobId:o,eventType:m.FlowError,flowId:r,error:t})),yield*e.fromCode(`FLOW_OUTPUT_VALIDATION_ERROR`,{body:t,cause:E.error}).toEffect()}let D=E.data;return a&&(yield*a({jobId:o,eventType:m.FlowEnd,flowId:r,result:D})),{type:`completed`,result:D}});return{id:r,name:i,nodes:p,edges:s,inputSchema:l,outputSchema:u,onEvent:a,checkJobStatus:o,run:({inputs:e,storageId:t,jobId:n,clientId:r})=>T({inputs:e,storageId:t,jobId:n,clientId:r}),resume:({jobId:e,storageId:t,nodeResults:n,executionState:r,clientId:i})=>T({inputs:r.inputs,storageId:t,jobId:e,resumeFrom:{executionOrder:r.executionOrder,nodeResults:new Map(Object.entries(n)),currentIndex:r.currentIndex},clientId:i}),validateTypes:()=>{let e=p;return h.validateFlow(e,s)},validateInputs:e=>h.validateData(e,l),validateOutputs:e=>h.validateData(e,u)}})}var C=class e extends s.Tag(`FlowWaitUntil`)(){static optional=c.serviceOption(e)},w=class extends s.Tag(`FlowProvider`)(){},T=class extends s.Tag(`FlowServer`)(){};const E=e=>typeof e==`object`&&!!e&&`id`in e;function D(t,n,r){let i=e=>{let i=t=>c.gen(function*(){let n=yield*r.get(e);n&&(yield*r.set(e,{...n,...t,updatedAt:new Date}))});return a=>c.gen(function*(){switch(t.onEvent&&(yield*c.catchAll(t.onEvent(a),e=>(c.logError(`Original onEvent failed`,e),c.succeed({eventId:null})))),yield*n.emit(e,a),c.logInfo(`Updating job ${e} with event ${a.eventType}`),a.eventType){case m.FlowStart:yield*i({status:`running`});break;case m.FlowEnd:break;case m.FlowError:yield*i({status:`failed`,error:a.error});break;case m.NodeStart:yield*c.gen(function*(){let t=yield*r.get(e);if(t){let n=t.tasks.find(e=>e.nodeId===a.nodeId)?t.tasks.map(e=>e.nodeId===a.nodeId?{...e,status:`running`,updatedAt:new Date}:e):[...t.tasks,{nodeId:a.nodeId,status:`running`,createdAt:new Date,updatedAt:new Date}];yield*r.set(e,{...t,tasks:n,updatedAt:new Date})}});break;case m.NodePause:yield*c.gen(function*(){let t=yield*r.get(e);if(t){let n=t.tasks.find(e=>e.nodeId===a.nodeId)?t.tasks.map(e=>e.nodeId===a.nodeId?{...e,status:`paused`,result:a.partialData,updatedAt:new Date}:e):[...t.tasks,{nodeId:a.nodeId,status:`paused`,result:a.partialData,createdAt:new Date,updatedAt:new Date}];yield*r.set(e,{...t,tasks:n,updatedAt:new Date})}});break;case m.NodeResume:yield*c.gen(function*(){let t=yield*r.get(e);if(t){let n=t.tasks.map(e=>e.nodeId===a.nodeId?{...e,status:`running`,updatedAt:new Date}:e);yield*r.set(e,{...t,tasks:n,updatedAt:new Date})}});break;case m.NodeEnd:yield*c.gen(function*(){let n=yield*r.get(e);if(n){let i=n.tasks.map(e=>e.nodeId===a.nodeId?{...e,status:`completed`,result:a.result,updatedAt:new Date}:e),o=t.nodes.find(e=>e.id===a.nodeId)?.type===`output`,s=a.result,c=n.intermediateFiles||[];o&&E(s)&&s.id?c=c.filter(e=>e!==s.id):!o&&E(s)&&s.id&&(c.includes(s.id)||c.push(s.id)),yield*r.set(e,{...n,tasks:i,intermediateFiles:c,updatedAt:new Date})}});break;case m.NodeError:yield*c.gen(function*(){let t=yield*r.get(e);if(t){let n=t.tasks.map(e=>e.nodeId===a.nodeId?{...e,status:`failed`,error:a.error,retryCount:a.retryCount,updatedAt:new Date}:e);yield*r.set(e,{...t,tasks:n,error:a.error,updatedAt:new Date})}});break}return{eventId:e}})},a=t=>t=>c.gen(function*(){let n=yield*r.get(t);return n?n.status===`paused`?`paused`:n.status===`cancelled`?`cancelled`:`running`:yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}))});return{...t,run:e=>c.gen(function*(){let n=e.jobId||crypto.randomUUID(),r=i(n),o=a(n);return yield*(yield*S({flowId:t.id,name:t.name,nodes:t.nodes,edges:t.edges,inputSchema:t.inputSchema,outputSchema:t.outputSchema,onEvent:r,checkJobStatus:o})).run({...e,jobId:n,clientId:e.clientId})}),resume:e=>c.gen(function*(){let n=e.jobId,r=i(n),o=a(n);return yield*(yield*S({flowId:t.id,name:t.name,nodes:t.nodes,edges:t.edges,inputSchema:t.inputSchema,outputSchema:t.outputSchema,onEvent:r,checkJobStatus:o})).resume(e)})}}function O(){return c.gen(function*(){let r=yield*w,i=yield*n,o=yield*t,s=yield*a,l=(t,n)=>c.gen(function*(){let r=yield*o.get(t);return r?yield*o.set(t,{...r,...n}):yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}))}),f=(e,t)=>c.gen(function*(){let n=yield*o.get(e);!n||!n.intermediateFiles||n.intermediateFiles.length===0||(yield*c.logInfo(`Cleaning up ${n.intermediateFiles.length} intermediate files for job ${e}`),yield*c.all(n.intermediateFiles.map(e=>c.gen(function*(){yield*s.delete(e,t),yield*c.logDebug(`Deleted intermediate file ${e}`)}).pipe(c.catchAll(t=>c.gen(function*(){return yield*c.logWarning(`Failed to delete intermediate file ${e}: ${t}`),c.succeed(void 0)})))),{concurrency:5}),yield*l(e,{intermediateFiles:[]}))}),p=({jobId:t,flow:n,storageId:r,clientId:a,inputs:s})=>c.gen(function*(){console.log(`[FlowServer] executeFlowInBackground started for job: ${t}`),yield*l(t,{status:`running`}),console.log(`[FlowServer] Creating flowWithEvents for job: ${t}`);let e=D(n,i,o);console.log(`[FlowServer] Running flow for job: ${t}`);let c=yield*e.run({inputs:s,storageId:r,jobId:t,clientId:a});return console.log(`[FlowServer] Flow completed for job: ${t}, result type: ${c.type}`),c.type===`paused`?yield*l(t,{status:`paused`,pausedAt:c.nodeId,executionState:c.executionState,updatedAt:new Date}):(yield*l(t,{status:`completed`,result:c.result,updatedAt:new Date,endedAt:new Date}),yield*f(t,a)),c}).pipe(c.catchAll(n=>c.gen(function*(){yield*c.logError(`Flow execution failed`,n);let r=n instanceof e?n.body:String(n);yield*c.logInfo(`Updating job ${t} to failed status with error: ${r}`),yield*l(t,{status:`failed`,error:r,updatedAt:new Date}).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logError(`Failed to update job ${t}`,e),c.succeed(void 0)})));let s=yield*o.get(t);throw s&&(yield*i.emit(t,{jobId:t,eventType:m.FlowError,flowId:s.flowId,error:r}).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logError(`Failed to emit FlowError event for job ${t}`,e),c.succeed(void 0)})))),yield*f(t,a).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logWarning(`Failed to cleanup intermediate files for job ${t}`,e),c.succeed(void 0)}))),n})));return{getFlow:(e,t)=>c.gen(function*(){return yield*r.getFlow(e,t)}),getFlowData:(e,t)=>c.gen(function*(){return x(yield*r.getFlow(e,t))}),runFlow:({flowId:t,storageId:n,clientId:i,inputs:a})=>c.gen(function*(){let s=yield*C.optional,l=yield*c.try({try:()=>$.parse({inputs:a}),catch:t=>e.fromCode(`FLOW_INPUT_VALIDATION_ERROR`,{cause:t})}),f=crypto.randomUUID(),m=new Date,h={id:f,flowId:t,storageId:n,clientId:i,status:`started`,createdAt:m,updatedAt:m,tasks:[]};yield*o.set(f,h);let g=yield*r.getFlow(t,i);console.log(`[FlowServer] About to fork flow execution for job: ${f}`);let _=p({jobId:f,flow:g,storageId:n,clientId:i,inputs:l.inputs}).pipe(c.tapErrorCause(e=>c.logError(`Flow execution failed`,e)));if(u.isSome(s)){console.log(`[FlowServer] Using waitUntil for job: ${f}`);let e=yield*c.runtime(),t=d.runPromise(e)(_);s.value(t)}else console.log(`[FlowServer] Using Effect.forkDaemon for job: ${f}`),yield*c.forkDaemon(_);return console.log(`[FlowServer] Flow execution started for job: ${f}`),h}),getJobStatus:t=>c.gen(function*(){return(yield*o.get(t))||(yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`})))}),resumeFlow:({jobId:t,nodeId:n,newData:a,clientId:s})=>c.gen(function*(){let p=yield*C.optional,h=yield*o.get(t);if(!h)return console.error(`Job not found`),yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}));if(h.status!==`paused`)return console.error(`Job is not paused`),yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} is not paused (status: ${h.status})`}));if(h.pausedAt!==n)return console.error(`Job is not paused at the expected node`),yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} is paused at node ${h.pausedAt}, not ${n}`}));if(!h.executionState)return console.error(`Job has no execution state`),yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} has no execution state`}));let g={...h.tasks.reduce((e,t)=>(t.result!==void 0&&(e[t.nodeId]=t.result),e),{}),[n]:a},_={...h.executionState.inputs,[n]:a};yield*l(t,{status:`running`});let v=yield*r.getFlow(h.flowId,h.clientId),y=c.gen(function*(){let n=D(v,i,o);if(!h.executionState)return yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} has no execution state`}));let r=yield*n.resume({jobId:t,storageId:h.storageId,nodeResults:g,executionState:{...h.executionState,inputs:_},clientId:h.clientId});return r.type===`paused`?yield*l(t,{status:`paused`,pausedAt:r.nodeId,executionState:r.executionState,updatedAt:new Date}):(yield*l(t,{status:`completed`,pausedAt:void 0,executionState:void 0,result:r.result,updatedAt:new Date,endedAt:new Date}),yield*f(t,s)),r}).pipe(c.catchAll(n=>c.gen(function*(){yield*c.logError(`Flow resume failed`,n);let r=n instanceof e?n.body:String(n);yield*c.logInfo(`Updating job ${t} to failed status with error: ${r}`),yield*l(t,{status:`failed`,error:r,updatedAt:new Date}).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logError(`Failed to update job ${t}`,e),c.succeed(void 0)})));let a=yield*o.get(t);throw a&&(yield*i.emit(t,{jobId:t,eventType:m.FlowError,flowId:a.flowId,error:r}).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logError(`Failed to emit FlowError event for job ${t}`,e),c.succeed(void 0)})))),yield*f(t,s).pipe(c.catchAll(e=>c.gen(function*(){return yield*c.logWarning(`Failed to cleanup intermediate files for job ${t}`,e),c.succeed(void 0)}))),n}))).pipe(c.tapErrorCause(e=>c.logError(`Flow resume failed`,e)));if(u.isSome(p)){console.log(`[FlowServer] Using waitUntil for resume job: ${t}`);let e=yield*c.runtime(),n=d.runPromise(e)(y);p.value(n)}else console.log(`[FlowServer] Using Effect.forkDaemon for resume job: ${t}`),yield*c.forkDaemon(y);return(yield*o.get(t))||(yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found after update`})))}),pauseFlow:(t,n)=>c.gen(function*(){let r=yield*o.get(t);if(!r)return yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}));if(n!==null&&r.clientId!==n)return yield*c.fail(e.fromCode(`FLOW_NOT_AUTHORIZED`,{cause:`Client ${n} is not authorized to pause job ${t}`}));if(r.status!==`running`)return yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} cannot be paused (current status: ${r.status})`}));let a=r.tasks.find(e=>e.status===`running`)?.nodeId;return yield*l(t,{status:`paused`,pausedAt:a,updatedAt:new Date}),yield*i.emit(t,{jobId:t,flowId:r.flowId,eventType:m.FlowPause,pausedAt:a}),(yield*o.get(t))||(yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found after pause`})))}),cancelFlow:(t,n)=>c.gen(function*(){let r=yield*o.get(t);return r?n!==null&&r.clientId!==n?yield*c.fail(e.fromCode(`FLOW_NOT_AUTHORIZED`,{cause:`Client ${n} is not authorized to cancel job ${t}`})):r.status!==`running`&&r.status!==`paused`&&r.status!==`started`?yield*c.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} cannot be cancelled (current status: ${r.status})`})):(yield*l(t,{status:`cancelled`,updatedAt:new Date,endedAt:new Date}),yield*i.emit(t,{jobId:t,flowId:r.flowId,eventType:m.FlowCancel}),yield*f(t,n),(yield*o.get(t))||(yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found after cancellation`})))):yield*c.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}))}),subscribeToFlowEvents:(e,t)=>c.gen(function*(){yield*i.subscribe(e,t)}),unsubscribeFromFlowEvents:e=>c.gen(function*(){yield*i.unsubscribe(e)})}})}const k=l.effect(T,O()),A=e=>({type:`complete`,data:e}),j=e=>({type:`waiting`,partialData:e});function M(e){if(!e)return{type:``,fileName:``,metadata:void 0,metadataJson:void 0};let t={...e},n=String(t.type||t.mimeType||t[`content-type`]||``);n&&(t.type||=n,t.mimeType||=n);let r=String(t.fileName||t.originalName||t.name||``);return r&&(t.fileName||=r,t.originalName||=r,t.name||=r),{type:n,fileName:r,metadata:t,metadataJson:JSON.stringify(t)}}const N=f.object({operation:f.literal(`init`),storageId:f.string(),metadata:f.record(f.string(),f.any()).optional()}),P=f.object({operation:f.literal(`finalize`),uploadId:f.string()}),F=f.object({operation:f.literal(`url`),url:f.string(),storageId:f.string().optional(),metadata:f.record(f.string(),f.any()).optional()}),I=f.union([N,P,F]),L=f.object({allowedMimeTypes:f.array(f.string()).optional(),minSize:f.number().positive().optional(),maxSize:f.number().positive().optional()});function R(t,n){return c.gen(function*(){if(n){if(n.allowedMimeTypes&&n.allowedMimeTypes.length>0&&!n.allowedMimeTypes.some(e=>{if(e.endsWith(`/*`)){let n=e.slice(0,-2);return t.type.startsWith(n)}return t.type===e}))throw yield*e.fromCode(`VALIDATION_ERROR`,{cause:Error(`File type "${t.type}" is not allowed. Allowed types: ${n.allowedMimeTypes.join(`, `)}`)}).toEffect();if(n.minSize!==void 0&&t.size<n.minSize)throw yield*e.fromCode(`VALIDATION_ERROR`,{cause:Error(`File size (${t.size} bytes) is below minimum (${n.minSize} bytes)`)}).toEffect();if(n.maxSize!==void 0&&t.size>n.maxSize)throw yield*e.fromCode(`VALIDATION_ERROR`,{cause:Error(`File size (${t.size} bytes) exceeds maximum (${n.maxSize} bytes)`)}).toEffect()}})}function ee(t,n){return c.gen(function*(){let s=yield*a;return yield*g({id:t,name:`Input`,description:`Handles file input through multiple methods - streaming upload (init/finalize) or direct URL fetch`,type:h.input,inputSchema:I,outputSchema:r,run:({data:r,flowId:a,jobId:l,clientId:u})=>c.gen(function*(){switch(r.operation){case`init`:{let e={storageId:r.storageId,size:r.metadata?.size||0,type:r.metadata?.mimeType||`application/octet-stream`,fileName:r.metadata?.originalName,lastModified:r.metadata?.size?Date.now():void 0,metadata:r.metadata?JSON.stringify(r.metadata):void 0,flow:{flowId:a,nodeId:t,jobId:l}};return j(yield*s.createUpload(e,u))}case`finalize`:{let e=yield*s.getUpload(r.uploadId),{type:t}=M(e.metadata);return yield*R({type:t,size:e.size||0},n),A(e)}case`url`:{let e=yield*o(r.url),c=yield*i(e),d=r.metadata?.mimeType||e.headers.get(`content-type`)||`application/octet-stream`,f=r.metadata?.size||Number(e.headers.get(`content-length`)||0),p=r.metadata?.originalName||r.url.split(`/`).pop()||`file`;yield*R({type:d,size:f},n);let m=new ReadableStream({start(e){e.enqueue(new Uint8Array(c)),e.close()}}),h={storageId:r.storageId||`buffer`,size:f,type:d,fileName:p,lastModified:Date.now(),metadata:r.metadata?JSON.stringify(r.metadata):void 0};return A({...yield*s.upload(h,u,m),flow:{flowId:a,nodeId:t,jobId:l}})}default:throw yield*e.fromCode(`VALIDATION_ERROR`,{cause:Error(`Invalid operation`)}).toEffect()}})})})}const te=f.object({});function ne(t,n=e=>c.succeed(e)){return c.gen(function*(){let i=yield*a;return yield*g({id:t,name:`Storage`,description:`Stores a file in the storage`,type:h.output,inputSchema:r,outputSchema:r,run:({data:r,storageId:a,flowId:o,jobId:s,clientId:l})=>c.gen(function*(){let{type:u,fileName:d,metadata:f,metadataJson:p}=M(r.metadata),m={flowId:o,nodeId:t,jobId:s},h=f?{...r,metadata:f}:r,g=yield*i.getUpload(r.id);if(!g.id)return yield*c.fail(e.fromCode(`FILE_READ_ERROR`,Error(`Upload Key is undefined`)));if(g.storage.id===a)return A(yield*n({...h,flow:m}));let _=yield*i.read(r.id,l),v=new ReadableStream({start(e){e.enqueue(_),e.close()}}),y=yield*i.upload({storageId:a,size:_.byteLength,type:u,fileName:d,lastModified:0,metadata:p,flow:m},l,v),b=M(y.metadata);return A(yield*n(b.metadata?{...y,metadata:b.metadata}:y))})})})}function re({id:e,name:t,description:n,transform:i}){return c.gen(function*(){let o=yield*a;return yield*g({id:e,name:t,description:n,type:h.process,inputSchema:r,outputSchema:r,run:({data:t,storageId:n,flowId:r,jobId:a,clientId:s})=>c.gen(function*(){let c={flowId:r,nodeId:e,jobId:a},l=yield*i(yield*o.read(t.id,s),t),u=l instanceof Uint8Array?l:l.bytes,d=l instanceof Uint8Array?void 0:l.type,f=l instanceof Uint8Array?void 0:l.fileName,p=new ReadableStream({start(e){e.enqueue(u),e.close()}}),{type:m,fileName:h,metadata:g,metadataJson:_}=M(t.metadata),v=yield*o.upload({storageId:n,size:u.byteLength,type:d??m,fileName:f??h,lastModified:0,metadata:_,flow:c},s,p);return A(g?{...v,metadata:g}:v)})})})}var ie=class extends s.Tag(`CredentialProvider`)(){},ae=class extends s.Tag(`ImageAiPlugin`)(){},oe=class extends s.Tag(`ImagePlugin`)(){};const se=f.object({serviceType:f.enum([`replicate`]).optional()}),ce=f.object({quality:f.number().min(0).max(100),format:f.enum([`jpeg`,`webp`,`png`,`avif`])}),le=f.object({serviceType:f.enum([`replicate`]).optional()}),ue=f.object({width:f.number().positive().optional(),height:f.number().positive().optional(),fit:f.enum([`contain`,`cover`,`fill`])}).refine(e=>e.width||e.height,`Either width or height must be specified for resize`),z=f.object({type:f.literal(`resize`),width:f.number().positive().optional(),height:f.number().positive().optional(),fit:f.enum([`contain`,`cover`,`fill`])}),B=f.object({type:f.literal(`blur`),sigma:f.number().min(.3).max(1e3)}),V=f.object({type:f.literal(`rotate`),angle:f.number(),background:f.string().optional()}),H=f.object({type:f.literal(`flip`),direction:f.enum([`horizontal`,`vertical`])}),U=f.object({type:f.literal(`grayscale`)}),W=f.object({type:f.literal(`sepia`)}),G=f.object({type:f.literal(`brightness`),value:f.number().min(-100).max(100)}),K=f.object({type:f.literal(`contrast`),value:f.number().min(-100).max(100)}),q=f.object({type:f.literal(`sharpen`),sigma:f.number().positive().optional()}),J=f.object({type:f.literal(`watermark`),imagePath:f.string().min(1).url(),position:f.enum([`top-left`,`top-right`,`bottom-left`,`bottom-right`,`center`]),opacity:f.number().min(0).max(1),offsetX:f.number().optional(),offsetY:f.number().optional()}),Y=f.object({type:f.literal(`logo`),imagePath:f.string().min(1).url(),position:f.enum([`top-left`,`top-right`,`bottom-left`,`bottom-right`,`center`]),scale:f.number().min(.1).max(2),offsetX:f.number().optional(),offsetY:f.number().optional()}),X=f.object({type:f.literal(`text`),text:f.string().min(1),position:f.enum([`top-left`,`top-right`,`bottom-left`,`bottom-right`,`center`]),fontSize:f.number().positive(),color:f.string().min(1),fontFamily:f.string().optional(),offsetX:f.number().optional(),offsetY:f.number().optional()}),Z=f.discriminatedUnion(`type`,[z,B,V,H,U,W,G,K,q,J,Y,X]),de=f.object({transformations:f.array(Z).min(1)});var fe=class extends s.Tag(`VideoPlugin`)(){},pe=class extends s.Tag(`ZipPlugin`)(){};const Q=(e,t)=>{if(e.length===0)return t;let[n,...r]=e;return r.reduce((e,t)=>f.union([e,t]),n)};function me(t){return c.gen(function*(){let n=Object.entries(t.nodes),r=e=>c.isEffect(e)?e:c.succeed(e),i=yield*c.forEach(n,([t,n])=>c.flatMap(r(n),n=>n.id===t?c.succeed([t,n]):c.fail(e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Node key ${t} does not match node id ${n.id}`)})))),a=Object.fromEntries(i),o=i.map(([,e])=>e),s=i.filter(([,e])=>e.type===h.input).map(([,e])=>e.inputSchema),l=i.filter(([,e])=>e.type===h.output).map(([,e])=>e.outputSchema),u=t.inputSchema??Q(s,f.unknown()),d=t.outputSchema??Q(l,f.unknown()),p=t.edges.map(e=>({source:a[e.source]?.id??e.source,target:a[e.target]?.id??e.target,sourcePort:e.sourcePort,targetPort:e.targetPort}));return yield*S({flowId:t.flowId,name:t.name,nodes:o,edges:p,inputSchema:u,outputSchema:d,typeChecker:t.typeChecker,onEvent:t.onEvent,parallelExecution:t.parallelExecution})})}const $=f.object({inputs:f.record(f.string(),f.any())});export{I as A,S as B,oe as C,ne as D,re as E,w as F,_ as G,v as H,T as I,m as K,C as L,M,A as N,te as O,j as P,O as R,se as S,ie as T,h as U,x as V,g as W,Z as _,B as a,le as b,H as c,z as d,V as f,de as g,X as h,fe as i,L as j,ee as k,U as l,q as m,me as n,G as o,W as p,p as q,pe as r,K as s,$ as t,Y as u,J as v,ae as w,ce as x,ue as y,k as z};
|
|
2
|
+
//# sourceMappingURL=flow-CmDU90LK.mjs.map
|