@uploadista/core 1.0.0-beta.2 → 1.0.0-beta.4

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.
Files changed (117) hide show
  1. package/dist/{checksum-BRjFmTRk.mjs → checksum-BjBRZIT-.mjs} +2 -2
  2. package/dist/{checksum-BRjFmTRk.mjs.map → checksum-BjBRZIT-.mjs.map} +1 -1
  3. package/dist/checksum-MAHKDZRq.cjs +1 -0
  4. package/dist/errors/index.cjs +1 -1
  5. package/dist/errors/index.d.cts +1 -1
  6. package/dist/errors/index.d.mts +1 -1
  7. package/dist/errors/index.mjs +1 -1
  8. package/dist/flow/index.cjs +1 -1
  9. package/dist/flow/index.d.cts +3 -3
  10. package/dist/flow/index.d.mts +3 -8
  11. package/dist/flow/index.mjs +1 -1
  12. package/dist/flow-Ag6JbNS6.mjs +2 -0
  13. package/dist/flow-Ag6JbNS6.mjs.map +1 -0
  14. package/dist/flow-DA_u2lYT.cjs +1 -0
  15. package/dist/{generate-id-DuZwLm4m.d.mts → generate-id-ByeNC8nU.d.cts} +1 -1
  16. package/dist/generate-id-ByeNC8nU.d.cts.map +1 -0
  17. package/dist/{generate-id-BAMRQzMr.d.cts → generate-id-ByeNC8nU.d.mts} +1 -1
  18. package/dist/generate-id-ByeNC8nU.d.mts.map +1 -0
  19. package/dist/{throttle-3FRcr7MU.d.mts → index-BPvb7plJ.d.cts} +2 -2
  20. package/dist/index-BPvb7plJ.d.cts.map +1 -0
  21. package/dist/index-BVVgDSdq.d.cts +1 -0
  22. package/dist/index-BVVgDSdq.d.mts +1 -0
  23. package/dist/{resolve-upload-metadata-B2C5e1y1.d.cts → index-CTpuhufX.d.mts} +316 -309
  24. package/dist/index-CTpuhufX.d.mts.map +1 -0
  25. package/dist/{middleware-BlrOGKrp.d.cts → index-Ce8IxXxR.d.mts} +300 -300
  26. package/dist/index-Ce8IxXxR.d.mts.map +1 -0
  27. package/dist/{resolve-upload-metadata-DbkBzxm8.d.mts → index-Cwin1ALJ.d.cts} +316 -309
  28. package/dist/index-Cwin1ALJ.d.cts.map +1 -0
  29. package/dist/{throttle-BlH27EGu.d.cts → index-DIbUBwpn.d.mts} +2 -2
  30. package/dist/index-DIbUBwpn.d.mts.map +1 -0
  31. package/dist/{stream-limiter-7wkBVLWT.d.mts → index-DL2Q2cli.d.cts} +2 -2
  32. package/dist/index-DL2Q2cli.d.cts.map +1 -0
  33. package/dist/{stream-limiter-D1KC-6pK.d.cts → index-DUcqG0NR.d.mts} +2 -2
  34. package/dist/index-DUcqG0NR.d.mts.map +1 -0
  35. package/dist/{upload-strategy-negotiator-a2O28qPf.d.mts → index-DiZp8FJs.d.mts} +6 -6
  36. package/dist/index-DiZp8FJs.d.mts.map +1 -0
  37. package/dist/{middleware-BmRmwme_.d.mts → index-_Q4OxX9Y.d.cts} +300 -300
  38. package/dist/index-_Q4OxX9Y.d.cts.map +1 -0
  39. package/dist/{upload-strategy-negotiator-EmOrc2bn.d.cts → index-zjG37VoL.d.cts} +6 -6
  40. package/dist/index-zjG37VoL.d.cts.map +1 -0
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.d.cts +7 -7
  43. package/dist/index.d.mts +7 -13
  44. package/dist/index.mjs +1 -1
  45. package/dist/stream-limiter-BIS16qEm.cjs +1 -0
  46. package/dist/{stream-limiter-CvDuNIyd.mjs → stream-limiter-CnjPsRPU.mjs} +2 -2
  47. package/dist/{stream-limiter-CvDuNIyd.mjs.map → stream-limiter-CnjPsRPU.mjs.map} +1 -1
  48. package/dist/streams/index.cjs +1 -1
  49. package/dist/streams/index.d.cts +1 -1
  50. package/dist/streams/index.d.mts +1 -2
  51. package/dist/streams/index.mjs +1 -1
  52. package/dist/testing/index.cjs +3 -3
  53. package/dist/testing/index.d.cts +2 -2
  54. package/dist/testing/index.d.cts.map +1 -1
  55. package/dist/testing/index.d.mts +2 -9
  56. package/dist/testing/index.d.mts.map +1 -1
  57. package/dist/testing/index.mjs +1 -1
  58. package/dist/testing/index.mjs.map +1 -1
  59. package/dist/types/index.cjs +1 -1
  60. package/dist/types/index.d.cts +1 -1
  61. package/dist/types/index.d.mts +1 -2
  62. package/dist/types/index.mjs +2 -1
  63. package/dist/types/index.mjs.map +1 -0
  64. package/dist/upload/index.cjs +1 -1
  65. package/dist/upload/index.d.cts +1 -1
  66. package/dist/upload/index.d.mts +1 -4
  67. package/dist/upload/index.mjs +1 -1
  68. package/dist/upload-DiHATxK7.cjs +1 -0
  69. package/dist/upload-pYFcRQoJ.mjs +2 -0
  70. package/dist/upload-pYFcRQoJ.mjs.map +1 -0
  71. package/dist/{uploadista-error-DQ7V1FlX.mjs → uploadista-error-C2T7YDIc.mjs} +1 -1
  72. package/dist/{uploadista-error-DQ7V1FlX.mjs.map → uploadista-error-C2T7YDIc.mjs.map} +1 -1
  73. package/dist/{uploadista-error-CZx1JU_L.cjs → uploadista-error-C6mqvnK_.cjs} +2 -2
  74. package/dist/{uploadista-error-LtiZn-R_.d.mts → uploadista-error-CT_B4E7l.d.cts} +2 -4
  75. package/dist/uploadista-error-CT_B4E7l.d.cts.map +1 -0
  76. package/dist/{uploadista-error-eZtG4iyf.d.cts → uploadista-error-CT_B4E7l.d.mts} +2 -4
  77. package/dist/uploadista-error-CT_B4E7l.d.mts.map +1 -0
  78. package/dist/utils/index.cjs +1 -1
  79. package/dist/utils/index.d.cts +2 -2
  80. package/dist/utils/index.d.mts +2 -3
  81. package/dist/utils/index.mjs +1 -1
  82. package/dist/utils-BnznIfIx.mjs +2 -0
  83. package/dist/utils-BnznIfIx.mjs.map +1 -0
  84. package/dist/utils-DJcyg79C.cjs +1 -0
  85. package/package.json +6 -6
  86. package/src/flow/flow-engine.ts +3 -1
  87. package/src/types/data-store.ts +3 -3
  88. package/src/upload/write-to-store.ts +24 -29
  89. package/tsconfig.json +0 -1
  90. package/dist/checksum-BrjQ8GJL.cjs +0 -1
  91. package/dist/generate-id-BAMRQzMr.d.cts.map +0 -1
  92. package/dist/generate-id-DuZwLm4m.d.mts.map +0 -1
  93. package/dist/middleware-BlrOGKrp.d.cts.map +0 -1
  94. package/dist/middleware-BmRmwme_.d.mts.map +0 -1
  95. package/dist/resolve-upload-metadata-B2C5e1y1.d.cts.map +0 -1
  96. package/dist/resolve-upload-metadata-DbkBzxm8.d.mts.map +0 -1
  97. package/dist/run-args-C4no7Ny4.cjs +0 -1
  98. package/dist/run-args-CIqI4Zc7.mjs +0 -2
  99. package/dist/run-args-CIqI4Zc7.mjs.map +0 -1
  100. package/dist/stream-limiter-7wkBVLWT.d.mts.map +0 -1
  101. package/dist/stream-limiter-B-Y0DTgA.cjs +0 -1
  102. package/dist/stream-limiter-D1KC-6pK.d.cts.map +0 -1
  103. package/dist/throttle-3FRcr7MU.d.mts.map +0 -1
  104. package/dist/throttle-BlH27EGu.d.cts.map +0 -1
  105. package/dist/throttle-Dp59f37i.cjs +0 -1
  106. package/dist/throttle-TFY-V41R.mjs +0 -2
  107. package/dist/throttle-TFY-V41R.mjs.map +0 -1
  108. package/dist/upload-strategy-negotiator-5da9ZySO.cjs +0 -1
  109. package/dist/upload-strategy-negotiator-ChKvppnA.mjs +0 -2
  110. package/dist/upload-strategy-negotiator-ChKvppnA.mjs.map +0 -1
  111. package/dist/upload-strategy-negotiator-EmOrc2bn.d.cts.map +0 -1
  112. package/dist/upload-strategy-negotiator-a2O28qPf.d.mts.map +0 -1
  113. package/dist/uploadista-error-LtiZn-R_.d.mts.map +0 -1
  114. package/dist/uploadista-error-eZtG4iyf.d.cts.map +0 -1
  115. package/dist/websocket-Br0ijEZA.cjs +0 -1
  116. package/dist/websocket-DftnHFfN.mjs +0 -2
  117. package/dist/websocket-DftnHFfN.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- import{n as e}from"./uploadista-error-DQ7V1FlX.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-BRjFmTRk.mjs.map
1
+ import{n as e}from"./uploadista-error-C2T7YDIc.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-BjBRZIT-.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"checksum-BRjFmTRk.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
+ {"version":3,"file":"checksum-BjBRZIT-.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,6BAA6B,CAAC,CAGxE,CAAC,AAAC,CAAC,EAKL,MAAa,EAAoB,EAAW,QAM/B,EAAmB,EAAW,GAAG,CAC5C,eAAkB,EAAO,QAAQ,OAAO,WAAW,CAAC,CACtD,CAAC,EAEY,EAAiB,EAAM,QAAQ,EAAY,CAAgB,EAM3D,EAAsB,EAAW,GAAG,CAC/C,eACE,EAAO,QAAQ,GAAG,KAAK,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAG,EAAE,GAAG,CAC7E,CAAC,EC5BK,EAAuB,CAAC,QAAQ,EAMtC,SAAgB,EACd,EACgC,CAChC,OAAO,EAAqB,SAAS,CAA8B,CACrE,CAUA,SAAgB,EACd,EACA,EACwC,CACxC,OAAO,EAAO,IAAI,WAAa,CAE7B,GAAI,CAAC,EAAqB,CAAS,EACjC,OAAO,MAAO,EAAgB,SAAS,iCAAkC,CACvE,KAAM,uBAAuB,EAAU,4CAA4C,EAAqB,KAAK,IAAI,IACjH,QAAS,CAAE,YAAW,oBAAqB,CAAqB,CAClE,CAAC,CAAC,CAAC,SAAS,EAId,IAAM,EAAqB,EAAU,YAAY,CAAC,CAAC,QAAQ,MAAO,KAAK,EAIjE,EAAa,MAAO,EAAO,WAAW,CAC1C,QACE,OAAO,OAAO,OAAO,EAAoB,CAAqB,EAChE,MAAQ,GACN,EAAgB,SAAS,gBAAiB,CACxC,KAAM,+BAA+B,aAAiB,MAAQ,EAAM,QAAU,kBAC9E,MAAO,EACP,QAAS,CAAE,WAAU,CACvB,CAAC,CACL,CAAC,EAQD,OALkB,MAAM,KAAK,IAAI,WAAW,CAAU,CAC9B,CAAC,CACtB,IAAK,GAAS,EAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAG,GAAG,CAAC,CAAC,CACjD,KAAK,EAEK,CACf,CAAC,CACH"}
@@ -0,0 +1 @@
1
+ const e=require("./uploadista-error-C6mqvnK_.cjs");let t=require("effect");var n=class extends t.Context.Tag(`UploadistaGenerateIdService`)(){};const r=n.Service,i=n.of({generateId:()=>t.Effect.succeed(crypto.randomUUID())}),a=t.Layer.succeed(n,i),o=n.of({generateId:()=>t.Effect.succeed(`${Date.now()}-${Math.random().toString(36).slice(2,11)}`)}),s=[`sha256`];function c(e){return s.includes(e)}function l(n,r){return t.Effect.gen(function*(){if(!c(r))return yield*e.n.fromCode(`UNSUPPORTED_CHECKSUM_ALGORITHM`,{body:`Checksum algorithm '${r}' is not supported. Supported algorithms: ${s.join(`, `)}`,details:{algorithm:r,supportedAlgorithms:s}}).toEffect();let i=r.toUpperCase().replace(/\d+/,`-$&`),a=yield*t.Effect.tryPromise({try:()=>crypto.subtle.digest(i,n),catch:t=>e.n.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(``)})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../uploadista-error-CZx1JU_L.cjs`);exports.ERRORS=e.t,exports.ERROR_CATALOG=e.t,exports.UploadistaError=e.n,exports.httpFailure=e.r,exports.isUploadistaError=e.i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../uploadista-error-C6mqvnK_.cjs");exports.ERRORS=e.t,exports.ERROR_CATALOG=e.t,exports.UploadistaError=e.n,exports.httpFailure=e.r,exports.isUploadistaError=e.i;
@@ -1,2 +1,2 @@
1
- import { a as isUploadistaError, i as httpFailure, n as UploadistaError, r as UploadistaErrorCode, t as ERROR_CATALOG } from "../uploadista-error-eZtG4iyf.cjs";
1
+ import { a as isUploadistaError, i as httpFailure, n as UploadistaError, r as UploadistaErrorCode, t as ERROR_CATALOG } from "../uploadista-error-CT_B4E7l.cjs";
2
2
  export { ERROR_CATALOG as ERRORS, ERROR_CATALOG, UploadistaError, UploadistaErrorCode, httpFailure, isUploadistaError };
@@ -1,2 +1,2 @@
1
- import { a as isUploadistaError, i as httpFailure, n as UploadistaError, r as UploadistaErrorCode, t as ERROR_CATALOG } from "../uploadista-error-LtiZn-R_.mjs";
1
+ import { a as isUploadistaError, i as httpFailure, n as UploadistaError, r as UploadistaErrorCode, t as ERROR_CATALOG } from "../uploadista-error-CT_B4E7l.mjs";
2
2
  export { ERROR_CATALOG as ERRORS, ERROR_CATALOG, UploadistaError, UploadistaErrorCode, httpFailure, isUploadistaError };
@@ -1 +1 @@
1
- import{i as e,n as t,r as n,t as r}from"../uploadista-error-DQ7V1FlX.mjs";export{r as ERRORS,r as ERROR_CATALOG,t as UploadistaError,n as httpFailure,e as isUploadistaError};
1
+ import{i as e,n as t,r as n,t as r}from"../uploadista-error-C2T7YDIc.mjs";export{r as ERRORS,r as ERROR_CATALOG,t as UploadistaError,n as httpFailure,e as isUploadistaError};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../websocket-Br0ijEZA.cjs`);require(`../uploadista-error-CZx1JU_L.cjs`);const t=require(`../run-args-C4no7Ny4.cjs`);require(`../upload-strategy-negotiator-5da9ZySO.cjs`),require(`../checksum-BrjQ8GJL.cjs`),require(`../stream-limiter-B-Y0DTgA.cjs`),exports.AVAILABLE_TEMPLATE_VARIABLES=t.F,exports.CredentialProvider=t.N,exports.DEFAULT_CIRCUIT_BREAKER_CONFIG=t.en,exports.DEFAULT_QUEUE_CONFIG=t.X,exports.DEFAULT_RETRY_POLICY=t.vt,exports.DEFAULT_STREAMING_CONFIG=e.b,exports.DeadLetterQueueService=t.ht,exports.DistributedCircuitBreaker=t.Jt,exports.DistributedCircuitBreakerRegistry=t.Yt,exports.DocumentAiPlugin=t.M,exports.DocumentPlugin=t.j,exports.EventType=t.Kt,exports.FlowEngine=t.W,exports.FlowLifecycleHook=t.G,exports.FlowProvider=t.K,exports.FlowQueueDispatchMarker=t.H,exports.FlowQueueService=t.U,exports.FlowWaitUntil=t.q,exports.IMAGE_DESCRIPTION_OUTPUT_TYPE_ID=t.St,exports.ImageAiPlugin=t.A,exports.ImagePlugin=t.k,exports.InputTypeRegistry=t.Ut,exports.MemoryFlowQueueStore=t.Z,exports.NodeType=t.Lt,exports.OCR_OUTPUT_TYPE_ID=t.Ct,exports.OutputTypeRegistry=t.Bt,exports.ParallelScheduler=t.mt,exports.STORAGE_OUTPUT_TYPE_ID=t.wt,exports.STREAMING_INPUT_TYPE_ID=t.Tt,exports.VideoPlugin=t.a,exports.VirusScanPlugin=t.i,exports.ZipPlugin=t.r,exports.applyFileNaming=t.I,exports.blurTransformSchema=t.s,exports.brightnessTransformSchema=t.c,exports.buildNamingContext=t.L,exports.calculateBackoffDelay=t.yt,exports.calculateExpirationDate=t.bt,exports.completeNodeExecution=t.Mt,exports.contrastTransformSchema=t.l,exports.createDeadLetterQueueService=t.gt,exports.createFlow=t.n,exports.createFlowEdge=t.qt,exports.createFlowEngine=t.J,exports.createFlowNode=t.Rt,exports.createFlowWithSchema=t.Q,exports.createInputNode=t.Ot,exports.createOutputGuard=t.Nt,exports.createTransformNode=t.P,exports.createTypeGuard=t.et,exports.deadLetterQueueService=t._t,exports.describeImageParamsSchema=t.O,exports.describeVideoMetadataSchema=t.D,exports.extractFrameVideoParamsSchema=t.E,exports.filterOutputsByType=t.tt,exports.flipTransformSchema=t.u,exports.flowEngine=t.Y,exports.getBaseName=t.R,exports.getExtension=t.z,exports.getFirstOutputByType=t.nt,exports.getFlowData=t.$,exports.getNodeData=t.zt,exports.getOutputByNodeId=t.rt,exports.getSingleOutputByType=t.it,exports.grayscaleTransformSchema=t.d,exports.hasOutputOfType=t.at,exports.imageDescriptionOutputSchema=t.Et,exports.inputDataSchema=t.kt,exports.inputNodeParamsSchema=t.At,exports.inputTypeRegistry=t.Wt,exports.interpolateFileName=t.B,exports.isErrorRetryable=t.xt,exports.isFinalizeOperation=t.ot,exports.isImageDescriptionOutput=t.st,exports.isInitOperation=t.ct,exports.isOcrOutput=t.lt,exports.isStorageOutput=t.ut,exports.isStorageOutputV1=t.Pt,exports.isStreamingInputV1=t.Ft,exports.isUploadFile=t.dt,exports.isUploadOperation=t.ft,exports.isUrlOperation=t.pt,exports.kvCircuitBreakerStoreLayer=t.Xt,exports.logoTransformSchema=t.f,exports.makeKvCircuitBreakerStore=t.Zt,exports.makeMemoryCircuitBreakerStore=t.Qt,exports.memoryCircuitBreakerStoreLayer=t.$t,exports.ocrOutputSchema=t.Dt,exports.optimizeParamsSchema=t.T,exports.outputTypeRegistry=t.Vt,exports.removeBackgroundParamsSchema=t.w,exports.resizeParamsSchema=t.C,exports.resizeTransformSchema=t.p,exports.resizeVideoParamsSchema=t.S,exports.resolveUploadMetadata=t.jt,exports.rotateTransformSchema=t.m,exports.runArgsSchema=t.t,exports.sepiaTransformSchema=t.h,exports.sharpenTransformSchema=t.g,exports.textTransformSchema=t._,exports.transcodeVideoParamsSchema=t.x,exports.transformImageParamsSchema=t.v,exports.transformationSchema=t.y,exports.trimVideoParamsSchema=t.o,exports.validateFlowInput=t.Gt,exports.validateFlowOutput=t.Ht,exports.validatePattern=t.V,exports.waitingNodeExecution=t.It,exports.watermarkTransformSchema=t.b;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../flow-DA_u2lYT.cjs"),t=require("../types/index.cjs");exports.AVAILABLE_TEMPLATE_VARIABLES=e.F,exports.CredentialProvider=e.N,exports.DEFAULT_CIRCUIT_BREAKER_CONFIG=e.en,exports.DEFAULT_QUEUE_CONFIG=e.X,exports.DEFAULT_RETRY_POLICY=e.vt,exports.DEFAULT_STREAMING_CONFIG=t.DEFAULT_STREAMING_CONFIG,exports.DeadLetterQueueService=e.ht,exports.DistributedCircuitBreaker=e.Jt,exports.DistributedCircuitBreakerRegistry=e.Yt,exports.DocumentAiPlugin=e.M,exports.DocumentPlugin=e.j,exports.EventType=e.Kt,exports.FlowEngine=e.W,exports.FlowLifecycleHook=e.G,exports.FlowProvider=e.K,exports.FlowQueueDispatchMarker=e.H,exports.FlowQueueService=e.U,exports.FlowWaitUntil=e.q,exports.IMAGE_DESCRIPTION_OUTPUT_TYPE_ID=e.St,exports.ImageAiPlugin=e.A,exports.ImagePlugin=e.k,exports.InputTypeRegistry=e.Ut,exports.MemoryFlowQueueStore=e.Z,exports.NodeType=e.Lt,exports.OCR_OUTPUT_TYPE_ID=e.Ct,exports.OutputTypeRegistry=e.Bt,exports.ParallelScheduler=e.mt,exports.STORAGE_OUTPUT_TYPE_ID=e.wt,exports.STREAMING_INPUT_TYPE_ID=e.Tt,exports.VideoPlugin=e.a,exports.VirusScanPlugin=e.i,exports.ZipPlugin=e.r,exports.applyFileNaming=e.I,exports.blurTransformSchema=e.s,exports.brightnessTransformSchema=e.c,exports.buildNamingContext=e.L,exports.calculateBackoffDelay=e.yt,exports.calculateExpirationDate=e.bt,exports.completeNodeExecution=e.Mt,exports.contrastTransformSchema=e.l,exports.createDeadLetterQueueService=e.gt,exports.createFlow=e.n,exports.createFlowEdge=e.qt,exports.createFlowEngine=e.J,exports.createFlowNode=e.Rt,exports.createFlowWithSchema=e.Q,exports.createInputNode=e.Ot,exports.createOutputGuard=e.Nt,exports.createTransformNode=e.P,exports.createTypeGuard=e.et,exports.deadLetterQueueService=e._t,exports.describeImageParamsSchema=e.O,exports.describeVideoMetadataSchema=e.D,exports.extractFrameVideoParamsSchema=e.E,exports.filterOutputsByType=e.tt,exports.flipTransformSchema=e.u,exports.flowEngine=e.Y,exports.getBaseName=e.R,exports.getExtension=e.z,exports.getFirstOutputByType=e.nt,exports.getFlowData=e.$,exports.getNodeData=e.zt,exports.getOutputByNodeId=e.rt,exports.getSingleOutputByType=e.it,exports.grayscaleTransformSchema=e.d,exports.hasOutputOfType=e.at,exports.imageDescriptionOutputSchema=e.Et,exports.inputDataSchema=e.kt,exports.inputNodeParamsSchema=e.At,exports.inputTypeRegistry=e.Wt,exports.interpolateFileName=e.B,exports.isErrorRetryable=e.xt,exports.isFinalizeOperation=e.ot,exports.isImageDescriptionOutput=e.st,exports.isInitOperation=e.ct,exports.isOcrOutput=e.lt,exports.isStorageOutput=e.ut,exports.isStorageOutputV1=e.Pt,exports.isStreamingInputV1=e.Ft,exports.isUploadFile=e.dt,exports.isUploadOperation=e.ft,exports.isUrlOperation=e.pt,exports.kvCircuitBreakerStoreLayer=e.Xt,exports.logoTransformSchema=e.f,exports.makeKvCircuitBreakerStore=e.Zt,exports.makeMemoryCircuitBreakerStore=e.Qt,exports.memoryCircuitBreakerStoreLayer=e.$t,exports.ocrOutputSchema=e.Dt,exports.optimizeParamsSchema=e.T,exports.outputTypeRegistry=e.Vt,exports.removeBackgroundParamsSchema=e.w,exports.resizeParamsSchema=e.C,exports.resizeTransformSchema=e.p,exports.resizeVideoParamsSchema=e.S,exports.resolveUploadMetadata=e.jt,exports.rotateTransformSchema=e.m,exports.runArgsSchema=e.t,exports.sepiaTransformSchema=e.h,exports.sharpenTransformSchema=e.g,exports.textTransformSchema=e._,exports.transcodeVideoParamsSchema=e.x,exports.transformImageParamsSchema=e.v,exports.transformationSchema=e.y,exports.trimVideoParamsSchema=e.o,exports.validateFlowInput=e.Gt,exports.validateFlowOutput=e.Ht,exports.validatePattern=e.V,exports.waitingNodeExecution=e.It,exports.watermarkTransformSchema=e.b;
@@ -1,3 +1,3 @@
1
- import { $ as VideoPlugin, $n as MemoryFlowQueueStore, $t as ImageAiPluginLayer, A as isImageDescriptionOutput, An as ExtractLayerServices, Ar as DistributedCircuitBreaker, At as Transformation, B as describeImageParamsSchema, Bn as FlowQueueServiceShape, Br as CircuitBreakerState, Bt as rotateTransformSchema, C as createTypeGuard, Cn as StreamingTransformResult, Cr as FlowData, Ct as OverlayPosition, D as getSingleOutputByType, Dn as ExtractEffectError, Dr as FlowEdge, Dt as SharpenTransform, E as getOutputByNodeId, En as createTransformNode, Er as getFlowData, Et as SepiaTransform, F as isUploadOperation, Fn as createInputNode, Fr as memoryCircuitBreakerStoreLayer, Ft as contrastTransformSchema, G as ZipPlugin, Gn as FlowLifecycleHook, Gt as transformationSchema, H as PluginLayer, Hn as FlowEngineLayer, Ht as sharpenTransformSchema, I as isUrlOperation, In as inputDataSchema, Ir as CircuitBreakerConfig, It as flipTransformSchema, J as ScanMetadata, Jn as FlowWaitUntil, Jt as resizeParamsSchema, K as ZipPluginLayer, Kn as FlowProvider, Kt as watermarkTransformSchema, L as RemoveBackgroundParams, Ln as inputNodeParamsSchema, Lr as CircuitBreakerEvent, Lt as grayscaleTransformSchema, M as isOcrOutput, Mn as FlowCondition, Mr as kvCircuitBreakerStoreLayer, Mt as WatermarkTransform, N as isStorageOutput, Nn as InputData, Nr as makeKvCircuitBreakerStore, Nt as blurTransformSchema, O as hasOutputOfType, On as ExtractEffectRequirements, Or as createFlowEdge, Ot as TextTransform, P as isUploadFile, Pn as InputNodeParams, Pr as makeMemoryCircuitBreakerStore, Pt as brightnessTransformSchema, Q as VirusScanPluginShape, Qn as FlowQueueStore, Qt as ImageAiPlugin, R as removeBackgroundParamsSchema, Rn as FlowQueueDispatchMarker, Rr as CircuitBreakerEventHandler, Rt as logoTransformSchema, S as NarrowedTypedOutput, Sn as StreamingTransformFn, Sr as Flow, St as LogoTransform, T as getFirstOutputByType, Tn as TransformNodeConfig, Tr as createFlowWithSchema, Tt as RotateTransform, U as ZipInput, Un as FlowEngineOptions, Ut as textTransformSchema, V as Plugin, Vn as FlowEngine, Vr as DEFAULT_CIRCUIT_BREAKER_CONFIG, Vt as sepiaTransformSchema, W as ZipParams, Wn as FlowEngineShape, Wt as transformImageParamsSchema, X as VirusScanPlugin, Xn as createFlowEngine, Xt as optimizeParamsSchema, Y as ScanResult, Yn as WaitUntilCallback, Yt as OptimizeParams, Z as VirusScanPluginLayer, Zn as flowEngine, Zt as ImageAiContext, _ as NodeDefinitionsRecord, _n as CredentialProviderLayer, _r as InputTypeDefinition, _t as BlurTransform, a as buildNamingContext, an as MergePdfParams, ar as ImageDescriptionOutput, at as trimVideoParamsSchema, b as TypedFlowEdge, bn as ParallelScheduler, br as inputTypeRegistry, bt as FlipTransform, c as interpolateFileName, cn as DocumentAiContext, cr as STORAGE_OUTPUT_TYPE_ID, ct as ResizeVideoParams, d as runArgsSchema, dn as DocumentAiPluginShape, dr as ocrOutputSchema, dt as extractFrameVideoParamsSchema, en as ImageAiPluginShape, er as DeadLetterQueueService, et as VideoPluginLayer, f as FlowInputMap, fn as OcrParams, fr as OutputTypeDefinition, ft as DescribeVideoMetadata, g as NodeDefinition, gn as CredentialProvider, gr as validateFlowOutput, gt as ImagePluginShape, h as FlowRequirements, hn as OcrTaskType, hr as outputTypeRegistry, ht as ImagePluginLayer, i as applyFileNaming, in as DocumentPluginShape, ir as IMAGE_DESCRIPTION_OUTPUT_TYPE_ID, it as TrimVideoParams, j as isInitOperation, jn as ResolveEffect, jr as DistributedCircuitBreakerRegistry, jt as TransformationType, k as isFinalizeOperation, kn as ExtractLayerService, kr as AllowRequestResult, kt as TransformImageParams, l as validatePattern, ln as DocumentAiPlugin, lr as STREAMING_INPUT_TYPE_ID, lt as resizeVideoParamsSchema, m as FlowPluginRequirements, mn as OcrResult, mr as OutputValidationResult, mt as ImagePlugin, n as resolveUploadMetadata, nn as DocumentPlugin, nr as createDeadLetterQueueService, nt as VideoStreamInput, o as getBaseName, on as SplitPdfParams, or as OCR_OUTPUT_TYPE_ID, ot as TranscodeVideoParams, p as FlowOutputMap, pn as OcrResolution, pr as OutputTypeRegistry, pt as describeVideoMetadataSchema, q as ZipPluginShape, qn as FlowProviderShape, qt as ResizeParams, r as AVAILABLE_TEMPLATE_VARIABLES, rn as DocumentPluginLayer, rr as deadLetterQueueService, rt as VideoStreamOptions, s as getExtension, sn as SplitPdfResult, sr as OcrOutput, st as transcodeVideoParamsSchema, t as ResolvedUploadMetadata, tn as DocumentMetadata, tr as DeadLetterQueueServiceShape, tt as VideoPluginShape, u as RunArgs, un as DocumentAiPluginLayer, ur as imageDescriptionOutputSchema, ut as ExtractFrameVideoParams, v as TypedFlow, vn as CredentialProviderShape, vr as InputTypeRegistry, vt as BrightnessTransform, w as filterOutputsByType, wn as TransformMode, wr as FlowExecutionResult, wt as ResizeTransform, x as createFlow, xn as ParallelSchedulerConfig, xr as validateFlowInput, xt as GrayscaleTransform, y as TypedFlowConfig, yn as ExecutionLevel, yr as InputValidationResult, yt as ContrastTransform, z as DescribeImageParams, zn as FlowQueueService, zr as CircuitBreakerFallback, zt as resizeTransformSchema } from "../resolve-upload-metadata-B2C5e1y1.cjs";
2
- import { $t as calculateBackoffDelay, At as FlowDeadLetterQueueConfig, Bn as DeadLetterItemStatus, Bt as TypedOutput, Cn as FlowEventNodeStart, Ct as BuiltInTypedOutput, Dn as NodeType, Dt as FlowCircuitBreakerConfig, En as ConditionValue, Et as FileNamingFunction, Ft as NarrowTypedOutput, G as StreamingConfig, Gn as DeadLetterRetryAttempt, Gt as isStreamingInputV1, Hn as DeadLetterProcessResult, Ht as completeNodeExecution, In as DeadLetterCleanupOptions, It as NodeConnectionValidator, Jt as DEFAULT_RETRY_POLICY, Kt as waitingNodeExecution, Ln as DeadLetterCleanupResult, Lt as NodeExecutionResult, Mt as FlowNode, Nt as FlowNodeData, On as createFlowNode, Ot as FlowCircuitBreakerFallback, Pt as NamingContext, Qt as RetryPolicy, R as DEFAULT_STREAMING_CONFIG, Rn as DeadLetterError, Rt as NodeTypeMap, Sn as FlowEventNodeResume, St as BuiltInNodeType, Tn as ConditionOperator, Tt as FileNamingConfig, Un as DeadLetterQueueStats, Ut as createOutputGuard, Vn as DeadLetterListOptions, Vt as TypedOutputGuard, Wn as DeadLetterRetryAllResult, Wt as isStorageOutputV1, Xt as FixedBackoff, Yt as ExponentialBackoff, Zt as ImmediateBackoff, _n as FlowEventJobStart, _t as FlowJobStatus, an as FlowEventDlqItemAdded, bn as FlowEventNodePause, bt as FlowJobTraceContext, cn as FlowEventDlqRetryFailed, dn as FlowEventFlowCancel, dt as DEFAULT_QUEUE_CONFIG, en as calculateExpirationDate, fn as FlowEventFlowEnd, ft as FlowQueueConfig, gn as FlowEventJobEnd, gt as FlowJob, hn as FlowEventFlowStart, ht as FlowQueueStats, in as FlowEvent, kn as getNodeData, kt as FlowConfig, ln as FlowEventDlqRetryStart, mn as FlowEventFlowPause, mt as FlowQueueItemStatus, nn as DlqEvent, on as FlowEventDlqItemExhausted, pn as FlowEventFlowError, pt as FlowQueueItem, qt as BackoffStrategy, rn as EventType, sn as FlowEventDlqItemResolved, tn as isErrorRetryable, un as FlowEventDlqRetrySuccess, vn as FlowEventNodeEnd, vt as FlowJobTask, wn as ConditionField, wt as CustomTypedOutput, xn as FlowEventNodeResponse, xt as AutoNamingSuffixGenerator, yn as FlowEventNodeError, yt as FlowJobTaskStatus, zn as DeadLetterItem, zt as TypeCompatibilityChecker } from "../middleware-BlrOGKrp.cjs";
3
- export { AVAILABLE_TEMPLATE_VARIABLES, AllowRequestResult, AutoNamingSuffixGenerator, BackoffStrategy, BlurTransform, BrightnessTransform, BuiltInNodeType, BuiltInTypedOutput, CircuitBreakerConfig, CircuitBreakerEvent, CircuitBreakerEventHandler, CircuitBreakerFallback, CircuitBreakerState, ConditionField, ConditionOperator, ConditionValue, ContrastTransform, CredentialProvider, CredentialProviderLayer, CredentialProviderShape, CustomTypedOutput, DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_QUEUE_CONFIG, DEFAULT_RETRY_POLICY, DEFAULT_STREAMING_CONFIG, DeadLetterCleanupOptions, DeadLetterCleanupResult, DeadLetterError, DeadLetterItem, DeadLetterItemStatus, DeadLetterListOptions, DeadLetterProcessResult, DeadLetterQueueService, DeadLetterQueueServiceShape, DeadLetterQueueStats, DeadLetterRetryAllResult, DeadLetterRetryAttempt, DescribeImageParams, DescribeVideoMetadata, DistributedCircuitBreaker, DistributedCircuitBreakerRegistry, DlqEvent, DocumentAiContext, DocumentAiPlugin, DocumentAiPluginLayer, DocumentAiPluginShape, DocumentMetadata, DocumentPlugin, DocumentPluginLayer, DocumentPluginShape, EventType, ExecutionLevel, ExponentialBackoff, ExtractEffectError, ExtractEffectRequirements, ExtractFrameVideoParams, ExtractLayerService, ExtractLayerServices, FileNamingConfig, FileNamingFunction, FixedBackoff, FlipTransform, type Flow, FlowCircuitBreakerConfig, FlowCircuitBreakerFallback, FlowCondition, FlowConfig, type FlowData, FlowDeadLetterQueueConfig, type FlowEdge, FlowEngine, FlowEngineLayer, FlowEngineOptions, FlowEngineShape, FlowEvent, FlowEventDlqItemAdded, FlowEventDlqItemExhausted, FlowEventDlqItemResolved, FlowEventDlqRetryFailed, FlowEventDlqRetryStart, FlowEventDlqRetrySuccess, FlowEventFlowCancel, FlowEventFlowEnd, FlowEventFlowError, FlowEventFlowPause, FlowEventFlowStart, FlowEventJobEnd, FlowEventJobStart, FlowEventNodeEnd, FlowEventNodeError, FlowEventNodePause, FlowEventNodeResponse, FlowEventNodeResume, FlowEventNodeStart, FlowExecutionResult, FlowInputMap, FlowJob, FlowJobStatus, FlowJobTask, FlowJobTaskStatus, FlowJobTraceContext, FlowLifecycleHook, FlowNode, FlowNodeData, FlowOutputMap, FlowPluginRequirements, FlowProvider, FlowProviderShape, FlowQueueConfig, FlowQueueDispatchMarker, FlowQueueItem, FlowQueueItemStatus, FlowQueueService, FlowQueueServiceShape, FlowQueueStats, FlowQueueStore, FlowRequirements, FlowWaitUntil, GrayscaleTransform, IMAGE_DESCRIPTION_OUTPUT_TYPE_ID, ImageAiContext, ImageAiPlugin, ImageAiPluginLayer, ImageAiPluginShape, ImageDescriptionOutput, ImagePlugin, ImagePluginLayer, ImagePluginShape, ImmediateBackoff, InputData, InputNodeParams, InputTypeDefinition, InputTypeRegistry, InputValidationResult, LogoTransform, MemoryFlowQueueStore, MergePdfParams, NamingContext, NarrowTypedOutput, NarrowedTypedOutput, NodeConnectionValidator, NodeDefinition, NodeDefinitionsRecord, NodeExecutionResult, NodeType, NodeTypeMap, OCR_OUTPUT_TYPE_ID, OcrOutput, OcrParams, OcrResolution, OcrResult, OcrTaskType, OptimizeParams, OutputTypeDefinition, OutputTypeRegistry, OutputValidationResult, OverlayPosition, ParallelScheduler, ParallelSchedulerConfig, Plugin, PluginLayer, RemoveBackgroundParams, ResizeParams, ResizeTransform, ResizeVideoParams, ResolveEffect, ResolvedUploadMetadata, RetryPolicy, RotateTransform, RunArgs, STORAGE_OUTPUT_TYPE_ID, STREAMING_INPUT_TYPE_ID, ScanMetadata, ScanResult, SepiaTransform, SharpenTransform, SplitPdfParams, SplitPdfResult, type StreamingConfig, type StreamingTransformFn, type StreamingTransformResult, TextTransform, TranscodeVideoParams, TransformImageParams, type TransformMode, type TransformNodeConfig, Transformation, TransformationType, TrimVideoParams, TypeCompatibilityChecker, TypedFlow, TypedFlowConfig, TypedFlowEdge, TypedOutput, TypedOutputGuard, VideoPlugin, VideoPluginLayer, VideoPluginShape, VideoStreamInput, VideoStreamOptions, VirusScanPlugin, VirusScanPluginLayer, VirusScanPluginShape, WaitUntilCallback, WatermarkTransform, ZipInput, ZipParams, ZipPlugin, ZipPluginLayer, ZipPluginShape, applyFileNaming, blurTransformSchema, brightnessTransformSchema, buildNamingContext, calculateBackoffDelay, calculateExpirationDate, completeNodeExecution, contrastTransformSchema, createDeadLetterQueueService, createFlow, createFlowEdge, createFlowEngine, createFlowNode, createFlowWithSchema, createInputNode, createOutputGuard, createTransformNode, createTypeGuard, deadLetterQueueService, describeImageParamsSchema, describeVideoMetadataSchema, extractFrameVideoParamsSchema, filterOutputsByType, flipTransformSchema, flowEngine, getBaseName, getExtension, getFirstOutputByType, getFlowData, getNodeData, getOutputByNodeId, getSingleOutputByType, grayscaleTransformSchema, hasOutputOfType, imageDescriptionOutputSchema, inputDataSchema, inputNodeParamsSchema, inputTypeRegistry, interpolateFileName, isErrorRetryable, isFinalizeOperation, isImageDescriptionOutput, isInitOperation, isOcrOutput, isStorageOutput, isStorageOutputV1, isStreamingInputV1, isUploadFile, isUploadOperation, isUrlOperation, kvCircuitBreakerStoreLayer, logoTransformSchema, makeKvCircuitBreakerStore, makeMemoryCircuitBreakerStore, memoryCircuitBreakerStoreLayer, ocrOutputSchema, optimizeParamsSchema, outputTypeRegistry, removeBackgroundParamsSchema, resizeParamsSchema, resizeTransformSchema, resizeVideoParamsSchema, resolveUploadMetadata, rotateTransformSchema, runArgsSchema, sepiaTransformSchema, sharpenTransformSchema, textTransformSchema, transcodeVideoParamsSchema, transformImageParamsSchema, transformationSchema, trimVideoParamsSchema, validateFlowInput, validateFlowOutput, validatePattern, waitingNodeExecution, watermarkTransformSchema };
1
+ import { $ as VideoPlugin, $n as MemoryFlowQueueStore, $t as ImageAiPluginLayer, A as isImageDescriptionOutput, An as ExtractLayerServices, Ar as DistributedCircuitBreaker, At as Transformation, B as describeImageParamsSchema, Bn as FlowQueueServiceShape, Br as CircuitBreakerState, Bt as rotateTransformSchema, C as createTypeGuard, Cn as StreamingTransformResult, Cr as FlowData, Ct as OverlayPosition, D as getSingleOutputByType, Dn as ExtractEffectError, Dr as FlowEdge, Dt as SharpenTransform, E as getOutputByNodeId, En as createTransformNode, Er as getFlowData, Et as SepiaTransform, F as isUploadOperation, Fn as createInputNode, Fr as memoryCircuitBreakerStoreLayer, Ft as contrastTransformSchema, G as ZipPlugin, Gn as FlowLifecycleHook, Gt as transformationSchema, H as PluginLayer, Hn as FlowEngineLayer, Ht as sharpenTransformSchema, I as isUrlOperation, In as inputDataSchema, Ir as CircuitBreakerConfig, It as flipTransformSchema, J as ScanMetadata, Jn as FlowWaitUntil, Jt as resizeParamsSchema, K as ZipPluginLayer, Kn as FlowProvider, Kt as watermarkTransformSchema, L as RemoveBackgroundParams, Ln as inputNodeParamsSchema, Lr as CircuitBreakerEvent, Lt as grayscaleTransformSchema, M as isOcrOutput, Mn as FlowCondition, Mr as kvCircuitBreakerStoreLayer, Mt as WatermarkTransform, N as isStorageOutput, Nn as InputData, Nr as makeKvCircuitBreakerStore, Nt as blurTransformSchema, O as hasOutputOfType, On as ExtractEffectRequirements, Or as createFlowEdge, Ot as TextTransform, P as isUploadFile, Pn as InputNodeParams, Pr as makeMemoryCircuitBreakerStore, Pt as brightnessTransformSchema, Q as VirusScanPluginShape, Qn as FlowQueueStore, Qt as ImageAiPlugin, R as removeBackgroundParamsSchema, Rn as FlowQueueDispatchMarker, Rr as CircuitBreakerEventHandler, Rt as logoTransformSchema, S as NarrowedTypedOutput, Sn as StreamingTransformFn, Sr as Flow, St as LogoTransform, T as getFirstOutputByType, Tn as TransformNodeConfig, Tr as createFlowWithSchema, Tt as RotateTransform, U as ZipInput, Un as FlowEngineOptions, Ut as textTransformSchema, V as Plugin, Vn as FlowEngine, Vr as DEFAULT_CIRCUIT_BREAKER_CONFIG, Vt as sepiaTransformSchema, W as ZipParams, Wn as FlowEngineShape, Wt as transformImageParamsSchema, X as VirusScanPlugin, Xn as createFlowEngine, Xt as optimizeParamsSchema, Y as ScanResult, Yn as WaitUntilCallback, Yt as OptimizeParams, Z as VirusScanPluginLayer, Zn as flowEngine, Zt as ImageAiContext, _ as NodeDefinitionsRecord, _n as CredentialProviderLayer, _r as InputTypeDefinition, _t as BlurTransform, a as buildNamingContext, an as MergePdfParams, ar as ImageDescriptionOutput, at as trimVideoParamsSchema, b as TypedFlowEdge, bn as ParallelScheduler, br as inputTypeRegistry, bt as FlipTransform, c as interpolateFileName, cn as DocumentAiContext, cr as STORAGE_OUTPUT_TYPE_ID, ct as ResizeVideoParams, d as runArgsSchema, dn as DocumentAiPluginShape, dr as ocrOutputSchema, dt as extractFrameVideoParamsSchema, en as ImageAiPluginShape, er as DeadLetterQueueService, et as VideoPluginLayer, f as FlowInputMap, fn as OcrParams, fr as OutputTypeDefinition, ft as DescribeVideoMetadata, g as NodeDefinition, gn as CredentialProvider, gr as validateFlowOutput, gt as ImagePluginShape, h as FlowRequirements, hn as OcrTaskType, hr as outputTypeRegistry, ht as ImagePluginLayer, i as applyFileNaming, in as DocumentPluginShape, ir as IMAGE_DESCRIPTION_OUTPUT_TYPE_ID, it as TrimVideoParams, j as isInitOperation, jn as ResolveEffect, jr as DistributedCircuitBreakerRegistry, jt as TransformationType, k as isFinalizeOperation, kn as ExtractLayerService, kr as AllowRequestResult, kt as TransformImageParams, l as validatePattern, ln as DocumentAiPlugin, lr as STREAMING_INPUT_TYPE_ID, lt as resizeVideoParamsSchema, m as FlowPluginRequirements, mn as OcrResult, mr as OutputValidationResult, mt as ImagePlugin, n as resolveUploadMetadata, nn as DocumentPlugin, nr as createDeadLetterQueueService, nt as VideoStreamInput, o as getBaseName, on as SplitPdfParams, or as OCR_OUTPUT_TYPE_ID, ot as TranscodeVideoParams, p as FlowOutputMap, pn as OcrResolution, pr as OutputTypeRegistry, pt as describeVideoMetadataSchema, q as ZipPluginShape, qn as FlowProviderShape, qt as ResizeParams, r as AVAILABLE_TEMPLATE_VARIABLES, rn as DocumentPluginLayer, rr as deadLetterQueueService, rt as VideoStreamOptions, s as getExtension, sn as SplitPdfResult, sr as OcrOutput, st as transcodeVideoParamsSchema, t as ResolvedUploadMetadata, tn as DocumentMetadata, tr as DeadLetterQueueServiceShape, tt as VideoPluginShape, u as RunArgs, un as DocumentAiPluginLayer, ur as imageDescriptionOutputSchema, ut as ExtractFrameVideoParams, v as TypedFlow, vn as CredentialProviderShape, vr as InputTypeRegistry, vt as BrightnessTransform, w as filterOutputsByType, wn as TransformMode, wr as FlowExecutionResult, wt as ResizeTransform, x as createFlow, xn as ParallelSchedulerConfig, xr as validateFlowInput, xt as GrayscaleTransform, y as TypedFlowConfig, yn as ExecutionLevel, yr as InputValidationResult, yt as ContrastTransform, z as DescribeImageParams, zn as FlowQueueService, zr as CircuitBreakerFallback, zt as resizeTransformSchema } from "../index-Cwin1ALJ.cjs";
2
+ import { $t as calculateBackoffDelay, At as FlowDeadLetterQueueConfig, Bn as DeadLetterItemStatus, Bt as TypedOutput, Cn as FlowEventNodeStart, Ct as BuiltInTypedOutput, Dn as NodeType, Dt as FlowCircuitBreakerConfig, En as ConditionValue, Et as FileNamingFunction, Ft as NarrowTypedOutput, G as StreamingConfig, Gn as DeadLetterRetryAttempt, Gt as isStreamingInputV1, Hn as DeadLetterProcessResult, Ht as completeNodeExecution, In as DeadLetterCleanupOptions, It as NodeConnectionValidator, Jt as DEFAULT_RETRY_POLICY, Kt as waitingNodeExecution, Ln as DeadLetterCleanupResult, Lt as NodeExecutionResult, Mt as FlowNode, Nt as FlowNodeData, On as createFlowNode, Ot as FlowCircuitBreakerFallback, Pt as NamingContext, Qt as RetryPolicy, R as DEFAULT_STREAMING_CONFIG, Rn as DeadLetterError, Rt as NodeTypeMap, Sn as FlowEventNodeResume, St as BuiltInNodeType, Tn as ConditionOperator, Tt as FileNamingConfig, Un as DeadLetterQueueStats, Ut as createOutputGuard, Vn as DeadLetterListOptions, Vt as TypedOutputGuard, Wn as DeadLetterRetryAllResult, Wt as isStorageOutputV1, Xt as FixedBackoff, Yt as ExponentialBackoff, Zt as ImmediateBackoff, _n as FlowEventJobStart, _t as FlowJobStatus, an as FlowEventDlqItemAdded, bn as FlowEventNodePause, bt as FlowJobTraceContext, cn as FlowEventDlqRetryFailed, dn as FlowEventFlowCancel, dt as DEFAULT_QUEUE_CONFIG, en as calculateExpirationDate, fn as FlowEventFlowEnd, ft as FlowQueueConfig, gn as FlowEventJobEnd, gt as FlowJob, hn as FlowEventFlowStart, ht as FlowQueueStats, in as FlowEvent, kn as getNodeData, kt as FlowConfig, ln as FlowEventDlqRetryStart, mn as FlowEventFlowPause, mt as FlowQueueItemStatus, nn as DlqEvent, on as FlowEventDlqItemExhausted, pn as FlowEventFlowError, pt as FlowQueueItem, qt as BackoffStrategy, rn as EventType, sn as FlowEventDlqItemResolved, tn as isErrorRetryable, un as FlowEventDlqRetrySuccess, vn as FlowEventNodeEnd, vt as FlowJobTask, wn as ConditionField, wt as CustomTypedOutput, xn as FlowEventNodeResponse, xt as AutoNamingSuffixGenerator, yn as FlowEventNodeError, yt as FlowJobTaskStatus, zn as DeadLetterItem, zt as TypeCompatibilityChecker } from "../index-_Q4OxX9Y.cjs";
3
+ export { AVAILABLE_TEMPLATE_VARIABLES, AllowRequestResult, AutoNamingSuffixGenerator, BackoffStrategy, BlurTransform, BrightnessTransform, BuiltInNodeType, BuiltInTypedOutput, CircuitBreakerConfig, CircuitBreakerEvent, CircuitBreakerEventHandler, CircuitBreakerFallback, CircuitBreakerState, ConditionField, ConditionOperator, ConditionValue, ContrastTransform, CredentialProvider, CredentialProviderLayer, CredentialProviderShape, CustomTypedOutput, DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_QUEUE_CONFIG, DEFAULT_RETRY_POLICY, DEFAULT_STREAMING_CONFIG, DeadLetterCleanupOptions, DeadLetterCleanupResult, DeadLetterError, DeadLetterItem, DeadLetterItemStatus, DeadLetterListOptions, DeadLetterProcessResult, DeadLetterQueueService, DeadLetterQueueServiceShape, DeadLetterQueueStats, DeadLetterRetryAllResult, DeadLetterRetryAttempt, DescribeImageParams, DescribeVideoMetadata, DistributedCircuitBreaker, DistributedCircuitBreakerRegistry, DlqEvent, DocumentAiContext, DocumentAiPlugin, DocumentAiPluginLayer, DocumentAiPluginShape, DocumentMetadata, DocumentPlugin, DocumentPluginLayer, DocumentPluginShape, EventType, ExecutionLevel, ExponentialBackoff, ExtractEffectError, ExtractEffectRequirements, ExtractFrameVideoParams, ExtractLayerService, ExtractLayerServices, FileNamingConfig, FileNamingFunction, FixedBackoff, FlipTransform, Flow, FlowCircuitBreakerConfig, FlowCircuitBreakerFallback, FlowCondition, FlowConfig, FlowData, FlowDeadLetterQueueConfig, FlowEdge, FlowEngine, FlowEngineLayer, FlowEngineOptions, FlowEngineShape, FlowEvent, FlowEventDlqItemAdded, FlowEventDlqItemExhausted, FlowEventDlqItemResolved, FlowEventDlqRetryFailed, FlowEventDlqRetryStart, FlowEventDlqRetrySuccess, FlowEventFlowCancel, FlowEventFlowEnd, FlowEventFlowError, FlowEventFlowPause, FlowEventFlowStart, FlowEventJobEnd, FlowEventJobStart, FlowEventNodeEnd, FlowEventNodeError, FlowEventNodePause, FlowEventNodeResponse, FlowEventNodeResume, FlowEventNodeStart, FlowExecutionResult, FlowInputMap, FlowJob, FlowJobStatus, FlowJobTask, FlowJobTaskStatus, FlowJobTraceContext, FlowLifecycleHook, FlowNode, FlowNodeData, FlowOutputMap, FlowPluginRequirements, FlowProvider, FlowProviderShape, FlowQueueConfig, FlowQueueDispatchMarker, FlowQueueItem, FlowQueueItemStatus, FlowQueueService, FlowQueueServiceShape, FlowQueueStats, FlowQueueStore, FlowRequirements, FlowWaitUntil, GrayscaleTransform, IMAGE_DESCRIPTION_OUTPUT_TYPE_ID, ImageAiContext, ImageAiPlugin, ImageAiPluginLayer, ImageAiPluginShape, ImageDescriptionOutput, ImagePlugin, ImagePluginLayer, ImagePluginShape, ImmediateBackoff, InputData, InputNodeParams, InputTypeDefinition, InputTypeRegistry, InputValidationResult, LogoTransform, MemoryFlowQueueStore, MergePdfParams, NamingContext, NarrowTypedOutput, NarrowedTypedOutput, NodeConnectionValidator, NodeDefinition, NodeDefinitionsRecord, NodeExecutionResult, NodeType, NodeTypeMap, OCR_OUTPUT_TYPE_ID, OcrOutput, OcrParams, OcrResolution, OcrResult, OcrTaskType, OptimizeParams, OutputTypeDefinition, OutputTypeRegistry, OutputValidationResult, OverlayPosition, ParallelScheduler, ParallelSchedulerConfig, Plugin, PluginLayer, RemoveBackgroundParams, ResizeParams, ResizeTransform, ResizeVideoParams, ResolveEffect, ResolvedUploadMetadata, RetryPolicy, RotateTransform, RunArgs, STORAGE_OUTPUT_TYPE_ID, STREAMING_INPUT_TYPE_ID, ScanMetadata, ScanResult, SepiaTransform, SharpenTransform, SplitPdfParams, SplitPdfResult, type StreamingConfig, StreamingTransformFn, StreamingTransformResult, TextTransform, TranscodeVideoParams, TransformImageParams, TransformMode, TransformNodeConfig, Transformation, TransformationType, TrimVideoParams, TypeCompatibilityChecker, TypedFlow, TypedFlowConfig, TypedFlowEdge, TypedOutput, TypedOutputGuard, VideoPlugin, VideoPluginLayer, VideoPluginShape, VideoStreamInput, VideoStreamOptions, VirusScanPlugin, VirusScanPluginLayer, VirusScanPluginShape, WaitUntilCallback, WatermarkTransform, ZipInput, ZipParams, ZipPlugin, ZipPluginLayer, ZipPluginShape, applyFileNaming, blurTransformSchema, brightnessTransformSchema, buildNamingContext, calculateBackoffDelay, calculateExpirationDate, completeNodeExecution, contrastTransformSchema, createDeadLetterQueueService, createFlow, createFlowEdge, createFlowEngine, createFlowNode, createFlowWithSchema, createInputNode, createOutputGuard, createTransformNode, createTypeGuard, deadLetterQueueService, describeImageParamsSchema, describeVideoMetadataSchema, extractFrameVideoParamsSchema, filterOutputsByType, flipTransformSchema, flowEngine, getBaseName, getExtension, getFirstOutputByType, getFlowData, getNodeData, getOutputByNodeId, getSingleOutputByType, grayscaleTransformSchema, hasOutputOfType, imageDescriptionOutputSchema, inputDataSchema, inputNodeParamsSchema, inputTypeRegistry, interpolateFileName, isErrorRetryable, isFinalizeOperation, isImageDescriptionOutput, isInitOperation, isOcrOutput, isStorageOutput, isStorageOutputV1, isStreamingInputV1, isUploadFile, isUploadOperation, isUrlOperation, kvCircuitBreakerStoreLayer, logoTransformSchema, makeKvCircuitBreakerStore, makeMemoryCircuitBreakerStore, memoryCircuitBreakerStoreLayer, ocrOutputSchema, optimizeParamsSchema, outputTypeRegistry, removeBackgroundParamsSchema, resizeParamsSchema, resizeTransformSchema, resizeVideoParamsSchema, resolveUploadMetadata, rotateTransformSchema, runArgsSchema, sepiaTransformSchema, sharpenTransformSchema, textTransformSchema, transcodeVideoParamsSchema, transformImageParamsSchema, transformationSchema, trimVideoParamsSchema, validateFlowInput, validateFlowOutput, validatePattern, waitingNodeExecution, watermarkTransformSchema };
@@ -1,8 +1,3 @@
1
- import "../uploadista-error-LtiZn-R_.mjs";
2
- import { $ as VideoPlugin, $n as MemoryFlowQueueStore, $t as ImageAiPluginLayer, A as isImageDescriptionOutput, An as ExtractLayerServices, Ar as DistributedCircuitBreaker, At as Transformation, B as describeImageParamsSchema, Bn as FlowQueueServiceShape, Br as CircuitBreakerState, Bt as rotateTransformSchema, C as createTypeGuard, Cn as StreamingTransformResult, Cr as FlowData, Ct as OverlayPosition, D as getSingleOutputByType, Dn as ExtractEffectError, Dr as FlowEdge, Dt as SharpenTransform, E as getOutputByNodeId, En as createTransformNode, Er as getFlowData, Et as SepiaTransform, F as isUploadOperation, Fn as createInputNode, Fr as memoryCircuitBreakerStoreLayer, Ft as contrastTransformSchema, G as ZipPlugin, Gn as FlowLifecycleHook, Gt as transformationSchema, H as PluginLayer, Hn as FlowEngineLayer, Ht as sharpenTransformSchema, I as isUrlOperation, In as inputDataSchema, Ir as CircuitBreakerConfig, It as flipTransformSchema, J as ScanMetadata, Jn as FlowWaitUntil, Jt as resizeParamsSchema, K as ZipPluginLayer, Kn as FlowProvider, Kt as watermarkTransformSchema, L as RemoveBackgroundParams, Ln as inputNodeParamsSchema, Lr as CircuitBreakerEvent, Lt as grayscaleTransformSchema, M as isOcrOutput, Mn as FlowCondition, Mr as kvCircuitBreakerStoreLayer, Mt as WatermarkTransform, N as isStorageOutput, Nn as InputData, Nr as makeKvCircuitBreakerStore, Nt as blurTransformSchema, O as hasOutputOfType, On as ExtractEffectRequirements, Or as createFlowEdge, Ot as TextTransform, P as isUploadFile, Pn as InputNodeParams, Pr as makeMemoryCircuitBreakerStore, Pt as brightnessTransformSchema, Q as VirusScanPluginShape, Qn as FlowQueueStore, Qt as ImageAiPlugin, R as removeBackgroundParamsSchema, Rn as FlowQueueDispatchMarker, Rr as CircuitBreakerEventHandler, Rt as logoTransformSchema, S as NarrowedTypedOutput, Sn as StreamingTransformFn, Sr as Flow, St as LogoTransform, T as getFirstOutputByType, Tn as TransformNodeConfig, Tr as createFlowWithSchema, Tt as RotateTransform, U as ZipInput, Un as FlowEngineOptions, Ut as textTransformSchema, V as Plugin, Vn as FlowEngine, Vr as DEFAULT_CIRCUIT_BREAKER_CONFIG, Vt as sepiaTransformSchema, W as ZipParams, Wn as FlowEngineShape, Wt as transformImageParamsSchema, X as VirusScanPlugin, Xn as createFlowEngine, Xt as optimizeParamsSchema, Y as ScanResult, Yn as WaitUntilCallback, Yt as OptimizeParams, Z as VirusScanPluginLayer, Zn as flowEngine, Zt as ImageAiContext, _ as NodeDefinitionsRecord, _n as CredentialProviderLayer, _r as InputTypeDefinition, _t as BlurTransform, a as buildNamingContext, an as MergePdfParams, ar as ImageDescriptionOutput, at as trimVideoParamsSchema, b as TypedFlowEdge, bn as ParallelScheduler, br as inputTypeRegistry, bt as FlipTransform, c as interpolateFileName, cn as DocumentAiContext, cr as STORAGE_OUTPUT_TYPE_ID, ct as ResizeVideoParams, d as runArgsSchema, dn as DocumentAiPluginShape, dr as ocrOutputSchema, dt as extractFrameVideoParamsSchema, en as ImageAiPluginShape, er as DeadLetterQueueService, et as VideoPluginLayer, f as FlowInputMap, fn as OcrParams, fr as OutputTypeDefinition, ft as DescribeVideoMetadata, g as NodeDefinition, gn as CredentialProvider, gr as validateFlowOutput, gt as ImagePluginShape, h as FlowRequirements, hn as OcrTaskType, hr as outputTypeRegistry, ht as ImagePluginLayer, i as applyFileNaming, in as DocumentPluginShape, ir as IMAGE_DESCRIPTION_OUTPUT_TYPE_ID, it as TrimVideoParams, j as isInitOperation, jn as ResolveEffect, jr as DistributedCircuitBreakerRegistry, jt as TransformationType, k as isFinalizeOperation, kn as ExtractLayerService, kr as AllowRequestResult, kt as TransformImageParams, l as validatePattern, ln as DocumentAiPlugin, lr as STREAMING_INPUT_TYPE_ID, lt as resizeVideoParamsSchema, m as FlowPluginRequirements, mn as OcrResult, mr as OutputValidationResult, mt as ImagePlugin, n as resolveUploadMetadata, nn as DocumentPlugin, nr as createDeadLetterQueueService, nt as VideoStreamInput, o as getBaseName, on as SplitPdfParams, or as OCR_OUTPUT_TYPE_ID, ot as TranscodeVideoParams, p as FlowOutputMap, pn as OcrResolution, pr as OutputTypeRegistry, pt as describeVideoMetadataSchema, q as ZipPluginShape, qn as FlowProviderShape, qt as ResizeParams, r as AVAILABLE_TEMPLATE_VARIABLES, rn as DocumentPluginLayer, rr as deadLetterQueueService, rt as VideoStreamOptions, s as getExtension, sn as SplitPdfResult, sr as OcrOutput, st as transcodeVideoParamsSchema, t as ResolvedUploadMetadata, tn as DocumentMetadata, tr as DeadLetterQueueServiceShape, tt as VideoPluginShape, u as RunArgs, un as DocumentAiPluginLayer, ur as imageDescriptionOutputSchema, ut as ExtractFrameVideoParams, v as TypedFlow, vn as CredentialProviderShape, vr as InputTypeRegistry, vt as BrightnessTransform, w as filterOutputsByType, wn as TransformMode, wr as FlowExecutionResult, wt as ResizeTransform, x as createFlow, xn as ParallelSchedulerConfig, xr as validateFlowInput, xt as GrayscaleTransform, y as TypedFlowConfig, yn as ExecutionLevel, yr as InputValidationResult, yt as ContrastTransform, z as DescribeImageParams, zn as FlowQueueService, zr as CircuitBreakerFallback, zt as resizeTransformSchema } from "../resolve-upload-metadata-DbkBzxm8.mjs";
3
- import { $t as calculateBackoffDelay, At as FlowDeadLetterQueueConfig, Bn as DeadLetterItemStatus, Bt as TypedOutput, Cn as FlowEventNodeStart, Ct as BuiltInTypedOutput, Dn as NodeType, Dt as FlowCircuitBreakerConfig, En as ConditionValue, Et as FileNamingFunction, Ft as NarrowTypedOutput, G as StreamingConfig, Gn as DeadLetterRetryAttempt, Gt as isStreamingInputV1, Hn as DeadLetterProcessResult, Ht as completeNodeExecution, In as DeadLetterCleanupOptions, It as NodeConnectionValidator, Jt as DEFAULT_RETRY_POLICY, Kt as waitingNodeExecution, Ln as DeadLetterCleanupResult, Lt as NodeExecutionResult, Mt as FlowNode, Nt as FlowNodeData, On as createFlowNode, Ot as FlowCircuitBreakerFallback, Pt as NamingContext, Qt as RetryPolicy, R as DEFAULT_STREAMING_CONFIG, Rn as DeadLetterError, Rt as NodeTypeMap, Sn as FlowEventNodeResume, St as BuiltInNodeType, Tn as ConditionOperator, Tt as FileNamingConfig, Un as DeadLetterQueueStats, Ut as createOutputGuard, Vn as DeadLetterListOptions, Vt as TypedOutputGuard, Wn as DeadLetterRetryAllResult, Wt as isStorageOutputV1, Xt as FixedBackoff, Yt as ExponentialBackoff, Zt as ImmediateBackoff, _n as FlowEventJobStart, _t as FlowJobStatus, an as FlowEventDlqItemAdded, bn as FlowEventNodePause, bt as FlowJobTraceContext, cn as FlowEventDlqRetryFailed, dn as FlowEventFlowCancel, dt as DEFAULT_QUEUE_CONFIG, en as calculateExpirationDate, fn as FlowEventFlowEnd, ft as FlowQueueConfig, gn as FlowEventJobEnd, gt as FlowJob, hn as FlowEventFlowStart, ht as FlowQueueStats, in as FlowEvent, kn as getNodeData, kt as FlowConfig, ln as FlowEventDlqRetryStart, mn as FlowEventFlowPause, mt as FlowQueueItemStatus, nn as DlqEvent, on as FlowEventDlqItemExhausted, pn as FlowEventFlowError, pt as FlowQueueItem, qt as BackoffStrategy, rn as EventType, sn as FlowEventDlqItemResolved, tn as isErrorRetryable, un as FlowEventDlqRetrySuccess, vn as FlowEventNodeEnd, vt as FlowJobTask, wn as ConditionField, wt as CustomTypedOutput, xn as FlowEventNodeResponse, xt as AutoNamingSuffixGenerator, yn as FlowEventNodeError, yt as FlowJobTaskStatus, zn as DeadLetterItem, zt as TypeCompatibilityChecker } from "../middleware-BmRmwme_.mjs";
4
- import "../upload-strategy-negotiator-a2O28qPf.mjs";
5
- import "../generate-id-DuZwLm4m.mjs";
6
- import "../stream-limiter-7wkBVLWT.mjs";
7
- import "../throttle-3FRcr7MU.mjs";
8
- export { AVAILABLE_TEMPLATE_VARIABLES, AllowRequestResult, AutoNamingSuffixGenerator, BackoffStrategy, BlurTransform, BrightnessTransform, BuiltInNodeType, BuiltInTypedOutput, CircuitBreakerConfig, CircuitBreakerEvent, CircuitBreakerEventHandler, CircuitBreakerFallback, CircuitBreakerState, ConditionField, ConditionOperator, ConditionValue, ContrastTransform, CredentialProvider, CredentialProviderLayer, CredentialProviderShape, CustomTypedOutput, DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_QUEUE_CONFIG, DEFAULT_RETRY_POLICY, DEFAULT_STREAMING_CONFIG, DeadLetterCleanupOptions, DeadLetterCleanupResult, DeadLetterError, DeadLetterItem, DeadLetterItemStatus, DeadLetterListOptions, DeadLetterProcessResult, DeadLetterQueueService, DeadLetterQueueServiceShape, DeadLetterQueueStats, DeadLetterRetryAllResult, DeadLetterRetryAttempt, DescribeImageParams, DescribeVideoMetadata, DistributedCircuitBreaker, DistributedCircuitBreakerRegistry, DlqEvent, DocumentAiContext, DocumentAiPlugin, DocumentAiPluginLayer, DocumentAiPluginShape, DocumentMetadata, DocumentPlugin, DocumentPluginLayer, DocumentPluginShape, EventType, ExecutionLevel, ExponentialBackoff, ExtractEffectError, ExtractEffectRequirements, ExtractFrameVideoParams, ExtractLayerService, ExtractLayerServices, FileNamingConfig, FileNamingFunction, FixedBackoff, FlipTransform, type Flow, FlowCircuitBreakerConfig, FlowCircuitBreakerFallback, FlowCondition, FlowConfig, type FlowData, FlowDeadLetterQueueConfig, type FlowEdge, FlowEngine, FlowEngineLayer, FlowEngineOptions, FlowEngineShape, FlowEvent, FlowEventDlqItemAdded, FlowEventDlqItemExhausted, FlowEventDlqItemResolved, FlowEventDlqRetryFailed, FlowEventDlqRetryStart, FlowEventDlqRetrySuccess, FlowEventFlowCancel, FlowEventFlowEnd, FlowEventFlowError, FlowEventFlowPause, FlowEventFlowStart, FlowEventJobEnd, FlowEventJobStart, FlowEventNodeEnd, FlowEventNodeError, FlowEventNodePause, FlowEventNodeResponse, FlowEventNodeResume, FlowEventNodeStart, FlowExecutionResult, FlowInputMap, FlowJob, FlowJobStatus, FlowJobTask, FlowJobTaskStatus, FlowJobTraceContext, FlowLifecycleHook, FlowNode, FlowNodeData, FlowOutputMap, FlowPluginRequirements, FlowProvider, FlowProviderShape, FlowQueueConfig, FlowQueueDispatchMarker, FlowQueueItem, FlowQueueItemStatus, FlowQueueService, FlowQueueServiceShape, FlowQueueStats, FlowQueueStore, FlowRequirements, FlowWaitUntil, GrayscaleTransform, IMAGE_DESCRIPTION_OUTPUT_TYPE_ID, ImageAiContext, ImageAiPlugin, ImageAiPluginLayer, ImageAiPluginShape, ImageDescriptionOutput, ImagePlugin, ImagePluginLayer, ImagePluginShape, ImmediateBackoff, InputData, InputNodeParams, InputTypeDefinition, InputTypeRegistry, InputValidationResult, LogoTransform, MemoryFlowQueueStore, MergePdfParams, NamingContext, NarrowTypedOutput, NarrowedTypedOutput, NodeConnectionValidator, NodeDefinition, NodeDefinitionsRecord, NodeExecutionResult, NodeType, NodeTypeMap, OCR_OUTPUT_TYPE_ID, OcrOutput, OcrParams, OcrResolution, OcrResult, OcrTaskType, OptimizeParams, OutputTypeDefinition, OutputTypeRegistry, OutputValidationResult, OverlayPosition, ParallelScheduler, ParallelSchedulerConfig, Plugin, PluginLayer, RemoveBackgroundParams, ResizeParams, ResizeTransform, ResizeVideoParams, ResolveEffect, ResolvedUploadMetadata, RetryPolicy, RotateTransform, RunArgs, STORAGE_OUTPUT_TYPE_ID, STREAMING_INPUT_TYPE_ID, ScanMetadata, ScanResult, SepiaTransform, SharpenTransform, SplitPdfParams, SplitPdfResult, type StreamingConfig, type StreamingTransformFn, type StreamingTransformResult, TextTransform, TranscodeVideoParams, TransformImageParams, type TransformMode, type TransformNodeConfig, Transformation, TransformationType, TrimVideoParams, TypeCompatibilityChecker, TypedFlow, TypedFlowConfig, TypedFlowEdge, TypedOutput, TypedOutputGuard, VideoPlugin, VideoPluginLayer, VideoPluginShape, VideoStreamInput, VideoStreamOptions, VirusScanPlugin, VirusScanPluginLayer, VirusScanPluginShape, WaitUntilCallback, WatermarkTransform, ZipInput, ZipParams, ZipPlugin, ZipPluginLayer, ZipPluginShape, applyFileNaming, blurTransformSchema, brightnessTransformSchema, buildNamingContext, calculateBackoffDelay, calculateExpirationDate, completeNodeExecution, contrastTransformSchema, createDeadLetterQueueService, createFlow, createFlowEdge, createFlowEngine, createFlowNode, createFlowWithSchema, createInputNode, createOutputGuard, createTransformNode, createTypeGuard, deadLetterQueueService, describeImageParamsSchema, describeVideoMetadataSchema, extractFrameVideoParamsSchema, filterOutputsByType, flipTransformSchema, flowEngine, getBaseName, getExtension, getFirstOutputByType, getFlowData, getNodeData, getOutputByNodeId, getSingleOutputByType, grayscaleTransformSchema, hasOutputOfType, imageDescriptionOutputSchema, inputDataSchema, inputNodeParamsSchema, inputTypeRegistry, interpolateFileName, isErrorRetryable, isFinalizeOperation, isImageDescriptionOutput, isInitOperation, isOcrOutput, isStorageOutput, isStorageOutputV1, isStreamingInputV1, isUploadFile, isUploadOperation, isUrlOperation, kvCircuitBreakerStoreLayer, logoTransformSchema, makeKvCircuitBreakerStore, makeMemoryCircuitBreakerStore, memoryCircuitBreakerStoreLayer, ocrOutputSchema, optimizeParamsSchema, outputTypeRegistry, removeBackgroundParamsSchema, resizeParamsSchema, resizeTransformSchema, resizeVideoParamsSchema, resolveUploadMetadata, rotateTransformSchema, runArgsSchema, sepiaTransformSchema, sharpenTransformSchema, textTransformSchema, transcodeVideoParamsSchema, transformImageParamsSchema, transformationSchema, trimVideoParamsSchema, validateFlowInput, validateFlowOutput, validatePattern, waitingNodeExecution, watermarkTransformSchema };
1
+ import { $ as VideoPlugin, $n as MemoryFlowQueueStore, $t as ImageAiPluginLayer, A as isImageDescriptionOutput, An as ExtractLayerServices, Ar as DistributedCircuitBreaker, At as Transformation, B as describeImageParamsSchema, Bn as FlowQueueServiceShape, Br as CircuitBreakerState, Bt as rotateTransformSchema, C as createTypeGuard, Cn as StreamingTransformResult, Cr as FlowData, Ct as OverlayPosition, D as getSingleOutputByType, Dn as ExtractEffectError, Dr as FlowEdge, Dt as SharpenTransform, E as getOutputByNodeId, En as createTransformNode, Er as getFlowData, Et as SepiaTransform, F as isUploadOperation, Fn as createInputNode, Fr as memoryCircuitBreakerStoreLayer, Ft as contrastTransformSchema, G as ZipPlugin, Gn as FlowLifecycleHook, Gt as transformationSchema, H as PluginLayer, Hn as FlowEngineLayer, Ht as sharpenTransformSchema, I as isUrlOperation, In as inputDataSchema, Ir as CircuitBreakerConfig, It as flipTransformSchema, J as ScanMetadata, Jn as FlowWaitUntil, Jt as resizeParamsSchema, K as ZipPluginLayer, Kn as FlowProvider, Kt as watermarkTransformSchema, L as RemoveBackgroundParams, Ln as inputNodeParamsSchema, Lr as CircuitBreakerEvent, Lt as grayscaleTransformSchema, M as isOcrOutput, Mn as FlowCondition, Mr as kvCircuitBreakerStoreLayer, Mt as WatermarkTransform, N as isStorageOutput, Nn as InputData, Nr as makeKvCircuitBreakerStore, Nt as blurTransformSchema, O as hasOutputOfType, On as ExtractEffectRequirements, Or as createFlowEdge, Ot as TextTransform, P as isUploadFile, Pn as InputNodeParams, Pr as makeMemoryCircuitBreakerStore, Pt as brightnessTransformSchema, Q as VirusScanPluginShape, Qn as FlowQueueStore, Qt as ImageAiPlugin, R as removeBackgroundParamsSchema, Rn as FlowQueueDispatchMarker, Rr as CircuitBreakerEventHandler, Rt as logoTransformSchema, S as NarrowedTypedOutput, Sn as StreamingTransformFn, Sr as Flow, St as LogoTransform, T as getFirstOutputByType, Tn as TransformNodeConfig, Tr as createFlowWithSchema, Tt as RotateTransform, U as ZipInput, Un as FlowEngineOptions, Ut as textTransformSchema, V as Plugin, Vn as FlowEngine, Vr as DEFAULT_CIRCUIT_BREAKER_CONFIG, Vt as sepiaTransformSchema, W as ZipParams, Wn as FlowEngineShape, Wt as transformImageParamsSchema, X as VirusScanPlugin, Xn as createFlowEngine, Xt as optimizeParamsSchema, Y as ScanResult, Yn as WaitUntilCallback, Yt as OptimizeParams, Z as VirusScanPluginLayer, Zn as flowEngine, Zt as ImageAiContext, _ as NodeDefinitionsRecord, _n as CredentialProviderLayer, _r as InputTypeDefinition, _t as BlurTransform, a as buildNamingContext, an as MergePdfParams, ar as ImageDescriptionOutput, at as trimVideoParamsSchema, b as TypedFlowEdge, bn as ParallelScheduler, br as inputTypeRegistry, bt as FlipTransform, c as interpolateFileName, cn as DocumentAiContext, cr as STORAGE_OUTPUT_TYPE_ID, ct as ResizeVideoParams, d as runArgsSchema, dn as DocumentAiPluginShape, dr as ocrOutputSchema, dt as extractFrameVideoParamsSchema, en as ImageAiPluginShape, er as DeadLetterQueueService, et as VideoPluginLayer, f as FlowInputMap, fn as OcrParams, fr as OutputTypeDefinition, ft as DescribeVideoMetadata, g as NodeDefinition, gn as CredentialProvider, gr as validateFlowOutput, gt as ImagePluginShape, h as FlowRequirements, hn as OcrTaskType, hr as outputTypeRegistry, ht as ImagePluginLayer, i as applyFileNaming, in as DocumentPluginShape, ir as IMAGE_DESCRIPTION_OUTPUT_TYPE_ID, it as TrimVideoParams, j as isInitOperation, jn as ResolveEffect, jr as DistributedCircuitBreakerRegistry, jt as TransformationType, k as isFinalizeOperation, kn as ExtractLayerService, kr as AllowRequestResult, kt as TransformImageParams, l as validatePattern, ln as DocumentAiPlugin, lr as STREAMING_INPUT_TYPE_ID, lt as resizeVideoParamsSchema, m as FlowPluginRequirements, mn as OcrResult, mr as OutputValidationResult, mt as ImagePlugin, n as resolveUploadMetadata, nn as DocumentPlugin, nr as createDeadLetterQueueService, nt as VideoStreamInput, o as getBaseName, on as SplitPdfParams, or as OCR_OUTPUT_TYPE_ID, ot as TranscodeVideoParams, p as FlowOutputMap, pn as OcrResolution, pr as OutputTypeRegistry, pt as describeVideoMetadataSchema, q as ZipPluginShape, qn as FlowProviderShape, qt as ResizeParams, r as AVAILABLE_TEMPLATE_VARIABLES, rn as DocumentPluginLayer, rr as deadLetterQueueService, rt as VideoStreamOptions, s as getExtension, sn as SplitPdfResult, sr as OcrOutput, st as transcodeVideoParamsSchema, t as ResolvedUploadMetadata, tn as DocumentMetadata, tr as DeadLetterQueueServiceShape, tt as VideoPluginShape, u as RunArgs, un as DocumentAiPluginLayer, ur as imageDescriptionOutputSchema, ut as ExtractFrameVideoParams, v as TypedFlow, vn as CredentialProviderShape, vr as InputTypeRegistry, vt as BrightnessTransform, w as filterOutputsByType, wn as TransformMode, wr as FlowExecutionResult, wt as ResizeTransform, x as createFlow, xn as ParallelSchedulerConfig, xr as validateFlowInput, xt as GrayscaleTransform, y as TypedFlowConfig, yn as ExecutionLevel, yr as InputValidationResult, yt as ContrastTransform, z as DescribeImageParams, zn as FlowQueueService, zr as CircuitBreakerFallback, zt as resizeTransformSchema } from "../index-CTpuhufX.mjs";
2
+ import { $t as calculateBackoffDelay, At as FlowDeadLetterQueueConfig, Bn as DeadLetterItemStatus, Bt as TypedOutput, Cn as FlowEventNodeStart, Ct as BuiltInTypedOutput, Dn as NodeType, Dt as FlowCircuitBreakerConfig, En as ConditionValue, Et as FileNamingFunction, Ft as NarrowTypedOutput, G as StreamingConfig, Gn as DeadLetterRetryAttempt, Gt as isStreamingInputV1, Hn as DeadLetterProcessResult, Ht as completeNodeExecution, In as DeadLetterCleanupOptions, It as NodeConnectionValidator, Jt as DEFAULT_RETRY_POLICY, Kt as waitingNodeExecution, Ln as DeadLetterCleanupResult, Lt as NodeExecutionResult, Mt as FlowNode, Nt as FlowNodeData, On as createFlowNode, Ot as FlowCircuitBreakerFallback, Pt as NamingContext, Qt as RetryPolicy, R as DEFAULT_STREAMING_CONFIG, Rn as DeadLetterError, Rt as NodeTypeMap, Sn as FlowEventNodeResume, St as BuiltInNodeType, Tn as ConditionOperator, Tt as FileNamingConfig, Un as DeadLetterQueueStats, Ut as createOutputGuard, Vn as DeadLetterListOptions, Vt as TypedOutputGuard, Wn as DeadLetterRetryAllResult, Wt as isStorageOutputV1, Xt as FixedBackoff, Yt as ExponentialBackoff, Zt as ImmediateBackoff, _n as FlowEventJobStart, _t as FlowJobStatus, an as FlowEventDlqItemAdded, bn as FlowEventNodePause, bt as FlowJobTraceContext, cn as FlowEventDlqRetryFailed, dn as FlowEventFlowCancel, dt as DEFAULT_QUEUE_CONFIG, en as calculateExpirationDate, fn as FlowEventFlowEnd, ft as FlowQueueConfig, gn as FlowEventJobEnd, gt as FlowJob, hn as FlowEventFlowStart, ht as FlowQueueStats, in as FlowEvent, kn as getNodeData, kt as FlowConfig, ln as FlowEventDlqRetryStart, mn as FlowEventFlowPause, mt as FlowQueueItemStatus, nn as DlqEvent, on as FlowEventDlqItemExhausted, pn as FlowEventFlowError, pt as FlowQueueItem, qt as BackoffStrategy, rn as EventType, sn as FlowEventDlqItemResolved, tn as isErrorRetryable, un as FlowEventDlqRetrySuccess, vn as FlowEventNodeEnd, vt as FlowJobTask, wn as ConditionField, wt as CustomTypedOutput, xn as FlowEventNodeResponse, xt as AutoNamingSuffixGenerator, yn as FlowEventNodeError, yt as FlowJobTaskStatus, zn as DeadLetterItem, zt as TypeCompatibilityChecker } from "../index-Ce8IxXxR.mjs";
3
+ export { AVAILABLE_TEMPLATE_VARIABLES, AllowRequestResult, AutoNamingSuffixGenerator, BackoffStrategy, BlurTransform, BrightnessTransform, BuiltInNodeType, BuiltInTypedOutput, CircuitBreakerConfig, CircuitBreakerEvent, CircuitBreakerEventHandler, CircuitBreakerFallback, CircuitBreakerState, ConditionField, ConditionOperator, ConditionValue, ContrastTransform, CredentialProvider, CredentialProviderLayer, CredentialProviderShape, CustomTypedOutput, DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_QUEUE_CONFIG, DEFAULT_RETRY_POLICY, DEFAULT_STREAMING_CONFIG, DeadLetterCleanupOptions, DeadLetterCleanupResult, DeadLetterError, DeadLetterItem, DeadLetterItemStatus, DeadLetterListOptions, DeadLetterProcessResult, DeadLetterQueueService, DeadLetterQueueServiceShape, DeadLetterQueueStats, DeadLetterRetryAllResult, DeadLetterRetryAttempt, DescribeImageParams, DescribeVideoMetadata, DistributedCircuitBreaker, DistributedCircuitBreakerRegistry, DlqEvent, DocumentAiContext, DocumentAiPlugin, DocumentAiPluginLayer, DocumentAiPluginShape, DocumentMetadata, DocumentPlugin, DocumentPluginLayer, DocumentPluginShape, EventType, ExecutionLevel, ExponentialBackoff, ExtractEffectError, ExtractEffectRequirements, ExtractFrameVideoParams, ExtractLayerService, ExtractLayerServices, FileNamingConfig, FileNamingFunction, FixedBackoff, FlipTransform, Flow, FlowCircuitBreakerConfig, FlowCircuitBreakerFallback, FlowCondition, FlowConfig, FlowData, FlowDeadLetterQueueConfig, FlowEdge, FlowEngine, FlowEngineLayer, FlowEngineOptions, FlowEngineShape, FlowEvent, FlowEventDlqItemAdded, FlowEventDlqItemExhausted, FlowEventDlqItemResolved, FlowEventDlqRetryFailed, FlowEventDlqRetryStart, FlowEventDlqRetrySuccess, FlowEventFlowCancel, FlowEventFlowEnd, FlowEventFlowError, FlowEventFlowPause, FlowEventFlowStart, FlowEventJobEnd, FlowEventJobStart, FlowEventNodeEnd, FlowEventNodeError, FlowEventNodePause, FlowEventNodeResponse, FlowEventNodeResume, FlowEventNodeStart, FlowExecutionResult, FlowInputMap, FlowJob, FlowJobStatus, FlowJobTask, FlowJobTaskStatus, FlowJobTraceContext, FlowLifecycleHook, FlowNode, FlowNodeData, FlowOutputMap, FlowPluginRequirements, FlowProvider, FlowProviderShape, FlowQueueConfig, FlowQueueDispatchMarker, FlowQueueItem, FlowQueueItemStatus, FlowQueueService, FlowQueueServiceShape, FlowQueueStats, FlowQueueStore, FlowRequirements, FlowWaitUntil, GrayscaleTransform, IMAGE_DESCRIPTION_OUTPUT_TYPE_ID, ImageAiContext, ImageAiPlugin, ImageAiPluginLayer, ImageAiPluginShape, ImageDescriptionOutput, ImagePlugin, ImagePluginLayer, ImagePluginShape, ImmediateBackoff, InputData, InputNodeParams, InputTypeDefinition, InputTypeRegistry, InputValidationResult, LogoTransform, MemoryFlowQueueStore, MergePdfParams, NamingContext, NarrowTypedOutput, NarrowedTypedOutput, NodeConnectionValidator, NodeDefinition, NodeDefinitionsRecord, NodeExecutionResult, NodeType, NodeTypeMap, OCR_OUTPUT_TYPE_ID, OcrOutput, OcrParams, OcrResolution, OcrResult, OcrTaskType, OptimizeParams, OutputTypeDefinition, OutputTypeRegistry, OutputValidationResult, OverlayPosition, ParallelScheduler, ParallelSchedulerConfig, Plugin, PluginLayer, RemoveBackgroundParams, ResizeParams, ResizeTransform, ResizeVideoParams, ResolveEffect, ResolvedUploadMetadata, RetryPolicy, RotateTransform, RunArgs, STORAGE_OUTPUT_TYPE_ID, STREAMING_INPUT_TYPE_ID, ScanMetadata, ScanResult, SepiaTransform, SharpenTransform, SplitPdfParams, SplitPdfResult, type StreamingConfig, StreamingTransformFn, StreamingTransformResult, TextTransform, TranscodeVideoParams, TransformImageParams, TransformMode, TransformNodeConfig, Transformation, TransformationType, TrimVideoParams, TypeCompatibilityChecker, TypedFlow, TypedFlowConfig, TypedFlowEdge, TypedOutput, TypedOutputGuard, VideoPlugin, VideoPluginLayer, VideoPluginShape, VideoStreamInput, VideoStreamOptions, VirusScanPlugin, VirusScanPluginLayer, VirusScanPluginShape, WaitUntilCallback, WatermarkTransform, ZipInput, ZipParams, ZipPlugin, ZipPluginLayer, ZipPluginShape, applyFileNaming, blurTransformSchema, brightnessTransformSchema, buildNamingContext, calculateBackoffDelay, calculateExpirationDate, completeNodeExecution, contrastTransformSchema, createDeadLetterQueueService, createFlow, createFlowEdge, createFlowEngine, createFlowNode, createFlowWithSchema, createInputNode, createOutputGuard, createTransformNode, createTypeGuard, deadLetterQueueService, describeImageParamsSchema, describeVideoMetadataSchema, extractFrameVideoParamsSchema, filterOutputsByType, flipTransformSchema, flowEngine, getBaseName, getExtension, getFirstOutputByType, getFlowData, getNodeData, getOutputByNodeId, getSingleOutputByType, grayscaleTransformSchema, hasOutputOfType, imageDescriptionOutputSchema, inputDataSchema, inputNodeParamsSchema, inputTypeRegistry, interpolateFileName, isErrorRetryable, isFinalizeOperation, isImageDescriptionOutput, isInitOperation, isOcrOutput, isStorageOutput, isStorageOutputV1, isStreamingInputV1, isUploadFile, isUploadOperation, isUrlOperation, kvCircuitBreakerStoreLayer, logoTransformSchema, makeKvCircuitBreakerStore, makeMemoryCircuitBreakerStore, memoryCircuitBreakerStoreLayer, ocrOutputSchema, optimizeParamsSchema, outputTypeRegistry, removeBackgroundParamsSchema, resizeParamsSchema, resizeTransformSchema, resizeVideoParamsSchema, resolveUploadMetadata, rotateTransformSchema, runArgsSchema, sepiaTransformSchema, sharpenTransformSchema, textTransformSchema, transcodeVideoParamsSchema, transformImageParamsSchema, transformationSchema, trimVideoParamsSchema, validateFlowInput, validateFlowOutput, validatePattern, waitingNodeExecution, watermarkTransformSchema };
@@ -1 +1 @@
1
- import"../uploadista-error-DQ7V1FlX.mjs";import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Ct as s,D as c,Dt as l,E as u,Et as d,F as f,Ft as p,G as m,Gt as h,H as g,Ht as _,I as v,It as y,J as b,Jt as x,K as S,Kt as C,L as w,Lt as T,M as E,Mt as D,N as O,Nt as k,O as A,Ot as j,P as M,Pt as N,Q as P,Qt as F,R as I,Rt as L,S as R,St as z,T as B,Tt as V,U as H,Ut as U,V as W,Vt as G,W as K,Wt as q,X as J,Xt as Y,Y as X,Yt as Z,Z as Q,Zt as $,_ as ee,_t as te,a as ne,at as re,b as ie,bt as ae,c as oe,ct as se,d as ce,dt as le,en as ue,et as de,f as fe,ft as pe,g as me,gt as he,h as ge,ht as _e,i as ve,it as ye,j as be,jt as xe,k as Se,kt as Ce,l as we,lt as Te,m as Ee,mt as De,n as Oe,nt as ke,o as Ae,ot as je,p as Me,pt as Ne,q as Pe,qt as Fe,r as Ie,rt as Le,s as Re,st as ze,t as Be,tt as Ve,u as He,ut as Ue,v as We,vt as Ge,w as Ke,wt as qe,x as Je,xt as Ye,y as Xe,yt as Ze,z as Qe,zt as $e}from"../run-args-CIqI4Zc7.mjs";import{b as et}from"../websocket-DftnHFfN.mjs";import"../upload-strategy-negotiator-ChKvppnA.mjs";import"../checksum-BRjFmTRk.mjs";import"../stream-limiter-CvDuNIyd.mjs";export{f as AVAILABLE_TEMPLATE_VARIABLES,O as CredentialProvider,ue as DEFAULT_CIRCUIT_BREAKER_CONFIG,J as DEFAULT_QUEUE_CONFIG,Ge as DEFAULT_RETRY_POLICY,et as DEFAULT_STREAMING_CONFIG,_e as DeadLetterQueueService,x as DistributedCircuitBreaker,Z as DistributedCircuitBreakerRegistry,E as DocumentAiPlugin,be as DocumentPlugin,C as EventType,K as FlowEngine,m as FlowLifecycleHook,S as FlowProvider,g as FlowQueueDispatchMarker,H as FlowQueueService,Pe as FlowWaitUntil,z as IMAGE_DESCRIPTION_OUTPUT_TYPE_ID,n as ImageAiPlugin,Se as ImagePlugin,U as InputTypeRegistry,Q as MemoryFlowQueueStore,T as NodeType,s as OCR_OUTPUT_TYPE_ID,a as OutputTypeRegistry,De as ParallelScheduler,qe as STORAGE_OUTPUT_TYPE_ID,V as STREAMING_INPUT_TYPE_ID,ne as VideoPlugin,ve as VirusScanPlugin,Ie as ZipPlugin,v as applyFileNaming,Re as blurTransformSchema,oe as brightnessTransformSchema,w as buildNamingContext,Ze as calculateBackoffDelay,ae as calculateExpirationDate,D as completeNodeExecution,we as contrastTransformSchema,he as createDeadLetterQueueService,Oe as createFlow,Fe as createFlowEdge,b as createFlowEngine,L as createFlowNode,P as createFlowWithSchema,j as createInputNode,k as createOutputGuard,M as createTransformNode,de as createTypeGuard,te as deadLetterQueueService,A as describeImageParamsSchema,c as describeVideoMetadataSchema,u as extractFrameVideoParamsSchema,Ve as filterOutputsByType,He as flipTransformSchema,X as flowEngine,I as getBaseName,Qe as getExtension,ke as getFirstOutputByType,e as getFlowData,$e as getNodeData,Le as getOutputByNodeId,ye as getSingleOutputByType,ce as grayscaleTransformSchema,re as hasOutputOfType,d as imageDescriptionOutputSchema,Ce as inputDataSchema,r as inputNodeParamsSchema,q as inputTypeRegistry,i as interpolateFileName,Ye as isErrorRetryable,je as isFinalizeOperation,ze as isImageDescriptionOutput,se as isInitOperation,Te as isOcrOutput,Ue as isStorageOutput,N as isStorageOutputV1,p as isStreamingInputV1,le as isUploadFile,pe as isUploadOperation,Ne as isUrlOperation,Y as kvCircuitBreakerStoreLayer,fe as logoTransformSchema,$ as makeKvCircuitBreakerStore,F as makeMemoryCircuitBreakerStore,t as memoryCircuitBreakerStoreLayer,l as ocrOutputSchema,B as optimizeParamsSchema,G as outputTypeRegistry,Ke as removeBackgroundParamsSchema,o as resizeParamsSchema,Me as resizeTransformSchema,R as resizeVideoParamsSchema,xe as resolveUploadMetadata,Ee as rotateTransformSchema,Be as runArgsSchema,ge as sepiaTransformSchema,me as sharpenTransformSchema,ee as textTransformSchema,Je as transcodeVideoParamsSchema,We as transformImageParamsSchema,Xe as transformationSchema,Ae as trimVideoParamsSchema,h as validateFlowInput,_ as validateFlowOutput,W as validatePattern,y as waitingNodeExecution,ie as watermarkTransformSchema};
1
+ import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Ct as s,D as c,Dt as l,E as u,Et as d,F as f,Ft as p,G as m,Gt as h,H as g,Ht as _,I as v,It as y,J as b,Jt as x,K as S,Kt as C,L as w,Lt as T,M as E,Mt as D,N as O,Nt as k,O as A,Ot as j,P as M,Pt as N,Q as P,Qt as F,R as I,Rt as L,S as R,St as z,T as B,Tt as V,U as H,Ut as U,V as W,Vt as G,W as K,Wt as q,X as J,Xt as Y,Y as X,Yt as Z,Z as Q,Zt as $,_ as ee,_t as te,a as ne,at as re,b as ie,bt as ae,c as oe,ct as se,d as ce,dt as le,en as ue,et as de,f as fe,ft as pe,g as me,gt as he,h as ge,ht as _e,i as ve,it as ye,j as be,jt as xe,k as Se,kt as Ce,l as we,lt as Te,m as Ee,mt as De,n as Oe,nt as ke,o as Ae,ot as je,p as Me,pt as Ne,q as Pe,qt as Fe,r as Ie,rt as Le,s as Re,st as ze,t as Be,tt as Ve,u as He,ut as Ue,v as We,vt as Ge,w as Ke,wt as qe,x as Je,xt as Ye,y as Xe,yt as Ze,z as Qe,zt as $e}from"../flow-Ag6JbNS6.mjs";import{DEFAULT_STREAMING_CONFIG as et}from"../types/index.mjs";export{f as AVAILABLE_TEMPLATE_VARIABLES,O as CredentialProvider,ue as DEFAULT_CIRCUIT_BREAKER_CONFIG,J as DEFAULT_QUEUE_CONFIG,Ge as DEFAULT_RETRY_POLICY,et as DEFAULT_STREAMING_CONFIG,_e as DeadLetterQueueService,x as DistributedCircuitBreaker,Z as DistributedCircuitBreakerRegistry,E as DocumentAiPlugin,be as DocumentPlugin,C as EventType,K as FlowEngine,m as FlowLifecycleHook,S as FlowProvider,g as FlowQueueDispatchMarker,H as FlowQueueService,Pe as FlowWaitUntil,z as IMAGE_DESCRIPTION_OUTPUT_TYPE_ID,n as ImageAiPlugin,Se as ImagePlugin,U as InputTypeRegistry,Q as MemoryFlowQueueStore,T as NodeType,s as OCR_OUTPUT_TYPE_ID,a as OutputTypeRegistry,De as ParallelScheduler,qe as STORAGE_OUTPUT_TYPE_ID,V as STREAMING_INPUT_TYPE_ID,ne as VideoPlugin,ve as VirusScanPlugin,Ie as ZipPlugin,v as applyFileNaming,Re as blurTransformSchema,oe as brightnessTransformSchema,w as buildNamingContext,Ze as calculateBackoffDelay,ae as calculateExpirationDate,D as completeNodeExecution,we as contrastTransformSchema,he as createDeadLetterQueueService,Oe as createFlow,Fe as createFlowEdge,b as createFlowEngine,L as createFlowNode,P as createFlowWithSchema,j as createInputNode,k as createOutputGuard,M as createTransformNode,de as createTypeGuard,te as deadLetterQueueService,A as describeImageParamsSchema,c as describeVideoMetadataSchema,u as extractFrameVideoParamsSchema,Ve as filterOutputsByType,He as flipTransformSchema,X as flowEngine,I as getBaseName,Qe as getExtension,ke as getFirstOutputByType,e as getFlowData,$e as getNodeData,Le as getOutputByNodeId,ye as getSingleOutputByType,ce as grayscaleTransformSchema,re as hasOutputOfType,d as imageDescriptionOutputSchema,Ce as inputDataSchema,r as inputNodeParamsSchema,q as inputTypeRegistry,i as interpolateFileName,Ye as isErrorRetryable,je as isFinalizeOperation,ze as isImageDescriptionOutput,se as isInitOperation,Te as isOcrOutput,Ue as isStorageOutput,N as isStorageOutputV1,p as isStreamingInputV1,le as isUploadFile,pe as isUploadOperation,Ne as isUrlOperation,Y as kvCircuitBreakerStoreLayer,fe as logoTransformSchema,$ as makeKvCircuitBreakerStore,F as makeMemoryCircuitBreakerStore,t as memoryCircuitBreakerStoreLayer,l as ocrOutputSchema,B as optimizeParamsSchema,G as outputTypeRegistry,Ke as removeBackgroundParamsSchema,o as resizeParamsSchema,Me as resizeTransformSchema,R as resizeVideoParamsSchema,xe as resolveUploadMetadata,Ee as rotateTransformSchema,Be as runArgsSchema,ge as sepiaTransformSchema,me as sharpenTransformSchema,ee as textTransformSchema,Je as transcodeVideoParamsSchema,We as transformImageParamsSchema,Xe as transformationSchema,Ae as trimVideoParamsSchema,h as validateFlowInput,_ as validateFlowOutput,W as validatePattern,y as waitingNodeExecution,ie as watermarkTransformSchema};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./uploadista-error-C2T7YDIc.mjs";import"./errors/index.mjs";import{BaseKvStoreService as t,CircuitBreakerStoreService as n,DEFAULT_STREAMING_CONFIG as r,DeadLetterQueueKVStore as i,FlowEventEmitter as a,FlowJobKVStore as o,FlowQueueKVStore as s,UploadFileDataStores as c,createInitialCircuitBreakerState as l,flowQueueKvStore as u,jsonSerializer as d,uploadFileSchema as f}from"./types/index.mjs";import{a as p,n as m,o as h}from"./upload-pYFcRQoJ.mjs";import{Context as g,Duration as _,Effect as v,Layer as y,Option as b,Ref as x,Runtime as S,Schedule as C,Stream as w,Tracer as T}from"effect";import{z as E}from"zod";import{render as ee}from"micromustache";const D={enabled:!1,failureThreshold:5,resetTimeout:3e4,halfOpenRequests:3,windowDuration:6e4,fallback:{type:`fail`}},O=`uploadista:circuit-breaker:`;function k(e){let t=e=>`${O}${e}`,n=n=>v.gen(function*(){let r=t(n),i=yield*e.get(r);if(i===null)return null;try{return d.deserialize(i)}catch{return yield*e.delete(r),null}}),r=(n,r)=>{let i=t(n),a=d.serialize(r);return e.set(i,a)};return{getState:n,setState:r,incrementFailures:(e,t)=>v.gen(function*(){let i=Date.now(),a=yield*n(e);return a===null&&(a=l({failureThreshold:5,resetTimeout:3e4,halfOpenRequests:3,windowDuration:t})),a=i-a.windowStart>t?{...a,failureCount:1,windowStart:i}:{...a,failureCount:a.failureCount+1},yield*r(e,a),a.failureCount}),resetFailures:e=>v.gen(function*(){let t=yield*n(e);t!==null&&(yield*r(e,{...t,failureCount:0,windowStart:Date.now()}))}),incrementHalfOpenSuccesses:e=>v.gen(function*(){let t=yield*n(e);if(t===null)return 1;let i={...t,halfOpenSuccesses:t.halfOpenSuccesses+1};return yield*r(e,i),i.halfOpenSuccesses}),getAllStats:()=>v.gen(function*(){let t=new Map;if(!e.list)return t;let r=yield*e.list(O),i=Date.now();for(let e of r){let r=e,a=yield*n(r);if(a!==null){let e=i-a.lastStateChange;t.set(r,{nodeType:r,state:a.state,failureCount:a.failureCount,halfOpenSuccesses:a.halfOpenSuccesses,timeSinceLastStateChange:e,timeUntilHalfOpen:a.state===`open`?Math.max(0,a.config.resetTimeout-e):void 0})}}return t}),delete:n=>e.delete(t(n))}}function A(){let e=new Map;return{getState:t=>v.succeed(e.get(t)??null),setState:(t,n)=>v.sync(()=>{e.set(t,n)}),incrementFailures:(t,n)=>v.sync(()=>{let r=Date.now(),i=e.get(t);return i===void 0&&(i=l({failureThreshold:5,resetTimeout:3e4,halfOpenRequests:3,windowDuration:n})),i=r-i.windowStart>n?{...i,failureCount:1,windowStart:r}:{...i,failureCount:i.failureCount+1},e.set(t,i),i.failureCount}),resetFailures:t=>v.sync(()=>{let n=e.get(t);n!==void 0&&e.set(t,{...n,failureCount:0,windowStart:Date.now()})}),incrementHalfOpenSuccesses:t=>v.sync(()=>{let n=e.get(t);if(n===void 0)return 1;let r={...n,halfOpenSuccesses:n.halfOpenSuccesses+1};return e.set(t,r),r.halfOpenSuccesses}),getAllStats:()=>v.sync(()=>{let t=new Map,n=Date.now();for(let[r,i]of e){let e=n-i.lastStateChange;t.set(r,{nodeType:r,state:i.state,failureCount:i.failureCount,halfOpenSuccesses:i.halfOpenSuccesses,timeSinceLastStateChange:e,timeUntilHalfOpen:i.state===`open`?Math.max(0,i.config.resetTimeout-e):void 0})}return t}),delete:t=>v.sync(()=>{e.delete(t)})}}const j=y.effect(n,v.gen(function*(){return k(yield*t)})),M=y.succeed(n,A());var N=class{eventHandler;nodeType;config;store;constructor(e,t,n){this.nodeType=e,this.config={enabled:t.enabled??D.enabled,failureThreshold:t.failureThreshold??D.failureThreshold,resetTimeout:t.resetTimeout??D.resetTimeout,halfOpenRequests:t.halfOpenRequests??D.halfOpenRequests,windowDuration:t.windowDuration??D.windowDuration,fallback:t.fallback??D.fallback},this.store=n}setEventHandler(e){this.eventHandler=e}allowRequest(){let e=this;return v.gen(function*(){if(!e.config.enabled)return{allowed:!0,state:`closed`,failureCount:0};let t=yield*e.store.getState(e.nodeType),n=Date.now();if(t===null&&(t=l({failureThreshold:e.config.failureThreshold,resetTimeout:e.config.resetTimeout,halfOpenRequests:e.config.halfOpenRequests,windowDuration:e.config.windowDuration}),yield*e.store.setState(e.nodeType,t)),t.state===`open`&&n-t.lastStateChange>=e.config.resetTimeout){let r=t.state;t={...t,state:`half-open`,halfOpenSuccesses:0,lastStateChange:n},yield*e.store.setState(e.nodeType,t),yield*e.emitEvent(r,`half-open`,t.failureCount)}return{allowed:t.state!==`open`,state:t.state,failureCount:t.failureCount}})}getState(){let e=this;return v.gen(function*(){return(yield*e.store.getState(e.nodeType))?.state??`closed`})}getFailureCount(){let e=this;return v.gen(function*(){return(yield*e.store.getState(e.nodeType))?.failureCount??0})}recordSuccess(){let e=this;return v.gen(function*(){if(!e.config.enabled)return;let t=yield*e.store.getState(e.nodeType);t!==null&&(t.state===`half-open`?(yield*e.store.incrementHalfOpenSuccesses(e.nodeType))>=e.config.halfOpenRequests&&(yield*e.transitionTo(`closed`,t.failureCount)):t.state===`closed`&&(yield*e.store.resetFailures(e.nodeType)))})}recordFailure(e){let t=this;return v.gen(function*(){if(!t.config.enabled)return;let e=yield*t.store.getState(t.nodeType);if(e===null||e.state===`closed`){let e=yield*t.store.incrementFailures(t.nodeType,t.config.windowDuration);e>=t.config.failureThreshold&&(yield*t.transitionTo(`open`,e))}else e.state===`half-open`&&(yield*t.transitionTo(`open`,e.failureCount))})}getFallback(){return this.config.fallback}reset(){let e=this;return v.gen(function*(){let t=(yield*e.store.getState(e.nodeType))?.state??`closed`;yield*e.store.setState(e.nodeType,l({failureThreshold:e.config.failureThreshold,resetTimeout:e.config.resetTimeout,halfOpenRequests:e.config.halfOpenRequests,windowDuration:e.config.windowDuration})),t!==`closed`&&(yield*e.emitEvent(t,`closed`,0))})}transitionTo(e,t){let n=this;return v.gen(function*(){let r=yield*n.store.getState(n.nodeType),i=r?.state??`closed`;if(i===e)return;let a=Date.now(),o={state:e,failureCount:e===`closed`?0:t,lastStateChange:a,halfOpenSuccesses:0,windowStart:e===`closed`?a:r?.windowStart??a,config:{failureThreshold:n.config.failureThreshold,resetTimeout:n.config.resetTimeout,halfOpenRequests:n.config.halfOpenRequests,windowDuration:n.config.windowDuration}};yield*n.store.setState(n.nodeType,o),yield*n.emitEvent(i,e,t)})}emitEvent(e,t,n){let r=this;return v.gen(function*(){r.eventHandler&&(yield*r.eventHandler({nodeType:r.nodeType,previousState:e,newState:t,timestamp:Date.now(),failureCount:n}))})}},te=class{store;breakers=new Map;eventHandler;constructor(e){this.store=e}setEventHandler(e){this.eventHandler=e;for(let t of this.breakers.values())t.setEventHandler(e)}getOrCreate(e,t){let n=this.breakers.get(e);return n||(n=new N(e,t,this.store),this.eventHandler&&n.setEventHandler(this.eventHandler),this.breakers.set(e,n)),n}get(e){return this.breakers.get(e)}getAllStats(){return this.store.getAllStats()}resetAll(){let e=this;return v.gen(function*(){for(let t of e.breakers.values())yield*t.reset()})}clear(){this.breakers.clear()}};function ne({source:e,target:t,sourcePort:n,targetPort:r}){return{source:e,target:t,sourcePort:n,targetPort:r}}let re=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.DlqItemAdded=`dlq-item-added`,e.DlqRetryStart=`dlq-retry-start`,e.DlqRetrySuccess=`dlq-retry-success`,e.DlqRetryFailed=`dlq-retry-failed`,e.DlqItemExhausted=`dlq-item-exhausted`,e.DlqItemResolved=`dlq-item-resolved`,e}({});var ie=class{types;constructor(){this.types=new Map}register(t){if(this.types.has(t.id))throw e.fromCode(`VALIDATION_ERROR`,{body:`Input type "${t.id}" is already registered. Types cannot be modified or re-registered.`,details:{typeId:t.id}});this.types.set(t.id,t)}get(e){return this.types.get(e)}list(){return Array.from(this.types.values())}validate(t,n){let r=this.types.get(t);if(!r)return{success:!1,error:e.fromCode(`VALIDATION_ERROR`,{body:`Input type "${t}" is not registered`,details:{typeId:t}})};try{return{success:!0,data:r.schema.parse(n)}}catch(n){return{success:!1,error:e.fromCode(`VALIDATION_ERROR`,{body:`Data validation failed for input type "${t}"`,cause:n,details:{typeId:t,validationErrors:n}})}}}has(e){return this.types.has(e)}size(){return this.types.size}};const P=new ie;function ae(e,t){return P.validate(e,t)}var oe=class{types;constructor(){this.types=new Map}register(t){if(this.types.has(t.id))throw e.fromCode(`VALIDATION_ERROR`,{body:`Output type "${t.id}" is already registered. Types cannot be modified or re-registered.`,details:{typeId:t.id}});this.types.set(t.id,t)}get(e){return this.types.get(e)}list(){return Array.from(this.types.values())}validate(t,n){let r=this.types.get(t);if(!r)return{success:!1,error:e.fromCode(`VALIDATION_ERROR`,{body:`Output type "${t}" is not registered`,details:{typeId:t}})};try{return{success:!0,data:r.schema.parse(n)}}catch(n){return{success:!1,error:e.fromCode(`VALIDATION_ERROR`,{body:`Data validation failed for output type "${t}"`,cause:n,details:{typeId:t,validationErrors:n}})}}}has(e){return this.types.has(e)}size(){return this.types.size}};const F=new oe;function se(e,t){return F.validate(e,t)}let ce=function(e){return e.input=`input`,e.process=`process`,e.conditional=`conditional`,e.multiplex=`multiplex`,e.merge=`merge`,e}({});function I({id:t,name:n,description:r,type:i,inputSchema:a,outputSchema:o,run:s,condition:c,multiInput:l=!1,multiOutput:u=!1,pausable:d=!1,retry:f,inputTypeId:p,outputTypeId:m,keepOutput:h=!1,circuitBreaker:g,nodeTypeId:_}){return v.gen(function*(){return p&&!P.get(p)?yield*e.fromCode(`INVALID_INPUT_TYPE`,{body:`Input type "${p}" is not registered in inputTypeRegistry`,details:{inputTypeId:p,nodeId:t}}).toEffect():m&&!F.get(m)?yield*e.fromCode(`INVALID_OUTPUT_TYPE`,{body:`Output type "${m}" is not registered in outputTypeRegistry`,details:{outputTypeId:m,nodeId:t}}).toEffect():{id:t,name:n,description:r,type:i,inputTypeId:p,outputTypeId:m,keepOutput:h,inputSchema:a,outputSchema:o,pausable:d,run:({data:r,jobId:i,flowId:c,storageId:l,clientId:u})=>v.gen(function*(){let d=yield*s({data:yield*v.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:l,flowId:c,clientId:u});return d.type===`waiting`?{type:`waiting`,partialData:d.partialData,nodeType:m,nodeId:t}:{type:`complete`,data:yield*v.try({try:()=>o.parse(d.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})}}),nodeType:m,nodeId:t}}),condition:c,multiInput:l,multiOutput:u,retry:f,circuitBreaker:g,nodeTypeId:_}})}const le=e=>({id:e.id,name:e.name,description:e.description,type:e.type,inputTypeId:e.inputTypeId,outputTypeId:e.outputTypeId,nodeTypeId:e.nodeTypeId}),L=e=>t=>t.nodeType===e,ue=L(`storage-output-v1`),de=L(`streaming-input-v1`),R=e=>({type:`complete`,data:e}),fe=e=>({type:`waiting`,partialData:e}),pe=(e,t)=>{if(e===t)return!0;try{return!!(e&&t&&typeof e==`object`&&typeof t==`object`)}catch{return!0}};var me=class{typeChecker;constructor(e=pe){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`]}}}};function z(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 he=E.object({operation:E.literal(`init`),storageId:E.string(),metadata:E.record(E.string(),E.any()).optional()}),ge=E.object({operation:E.literal(`finalize`),uploadId:E.string()}),_e=E.object({operation:E.literal(`url`),url:E.string(),storageId:E.string().optional(),metadata:E.record(E.string(),E.any()).optional()}),B=E.union([he,ge,_e]),ve=E.object({allowedMimeTypes:E.array(E.string()).optional(),minSize:E.number().positive().optional(),maxSize:E.number().positive().optional()});function ye(t,n){return v.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 be(t,n,r){let i=r?.keepOutput??!1;return v.gen(function*(){let r=yield*m;return yield*I({id:t,name:`Input`,description:`Handles file input through multiple methods - streaming upload (init/finalize) or direct URL fetch`,type:`input`,nodeTypeId:`input`,inputSchema:B,outputSchema:f,keepOutput:i,inputTypeId:W,outputTypeId:V,run:({data:i,flowId:a,jobId:o,clientId:s})=>v.gen(function*(){switch(i.operation){case`init`:{let e={storageId:i.storageId,size:i.metadata?.size||0,type:i.metadata?.mimeType||`application/octet-stream`,fileName:i.metadata?.originalName,lastModified:i.metadata?.size?Date.now():void 0,metadata:i.metadata?JSON.stringify(i.metadata):void 0,flow:{flowId:a,nodeId:t,jobId:o}};return fe(yield*r.createUpload(e,s))}case`finalize`:{let e=yield*r.getUpload(i.uploadId),{type:t}=z(e.metadata);return yield*ye({type:t,size:e.size||0},n),R(e)}case`url`:{let e=yield*h(i.url),c=yield*p(e),l=i.metadata?.mimeType||e.headers.get(`content-type`)||`application/octet-stream`,u=i.metadata?.size||Number(e.headers.get(`content-length`)||0),d=i.metadata?.originalName||i.url.split(`/`).pop()||`file`;yield*ye({type:l,size:u},n);let f=new ReadableStream({start(e){e.enqueue(new Uint8Array(c)),e.close()}}),m={storageId:i.storageId||`buffer`,size:u,type:l,fileName:d,lastModified:Date.now(),metadata:i.metadata?JSON.stringify(i.metadata):void 0};return R({...yield*r.upload(m,s,f),flow:{flowId:a,nodeId:t,jobId:o}})}default:throw yield*e.fromCode(`VALIDATION_ERROR`,{cause:Error(`Invalid operation`)}).toEffect()}})})})}const V=`storage-output-v1`,H=`ocr-output-v1`,U=`image-description-output-v1`,W=`streaming-input-v1`,xe=E.object({extractedText:E.string(),format:E.enum([`markdown`,`plain`,`structured`]),taskType:E.enum([`convertToMarkdown`,`freeOcr`,`parseFigure`,`locateObject`]),confidence:E.number().min(0).max(1).optional()}),Se=E.object({description:E.string(),confidence:E.number().min(0).max(1).optional(),metadata:E.record(E.string(),E.unknown()).optional()});P.register({id:W,schema:B,version:`1.0.0`,description:`Streaming file input with init/finalize/url operations for flexible file ingestion`}),F.register({id:V,schema:f,version:`1.0.0`,description:`Storage output node that saves files to configured storage backend`}),F.register({id:H,schema:xe,version:`1.0.0`,description:`OCR output node that extracts structured text from documents using AI`}),F.register({id:U,schema:Se,version:`1.0.0`,description:`Image description output node that generates AI-powered descriptions of images`});const G={enabled:!0,maxRetries:3,backoff:{type:`exponential`,initialDelayMs:1e3,maxDelayMs:3e5,multiplier:2,jitter:!0},ttlMs:6048e5};function K(e,t){switch(e.type){case`immediate`:return 0;case`fixed`:return e.delayMs;case`exponential`:{let n=e.initialDelayMs*e.multiplier**t,r=Math.min(n,e.maxDelayMs);if(e.jitter){let e=.5+Math.random();return Math.floor(r*e)}return r}default:return 0}}function Ce(e,t){return!t.enabled||t.nonRetryableErrors?.includes(e)?!1:t.retryableErrors&&t.retryableErrors.length>0?t.retryableErrors.includes(e):!0}function we(e,t){if(!(t===void 0||t<=0))return new Date(e.getTime()+t)}var q=class e extends g.Tag(`DeadLetterQueueService`)(){static optional=v.serviceOption(e)};function Te(){return v.gen(function*(){let e=yield*i,t=()=>`dlq_${crypto.randomUUID()}`,n=e=>({...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),expiresAt:e.expiresAt?new Date(e.expiresAt):void 0,nextRetryAt:e.nextRetryAt?new Date(e.nextRetryAt):void 0,retryHistory:e.retryHistory.map(e=>({...e,attemptedAt:new Date(e.attemptedAt)}))}),r=()=>v.gen(function*(){if(!e.list)return[];let t=yield*e.list(),r=[];for(let i of t){let t=yield*v.catchAll(e.get(i),()=>v.succeed(null));t&&r.push(n(t))}return r});return{add:(n,r,i=G)=>v.gen(function*(){let a=t(),o=new Date,s={code:r.code||`UNKNOWN_ERROR`,message:r.body||r.message||`Unknown error`,nodeId:void 0,stack:r.stack},c=n.tasks.find(e=>e.status===`failed`);c&&(s.nodeId=c.nodeId);let l={};for(let e of n.tasks)e.result!==void 0&&(l[e.nodeId]=e.result);let u=Ce(s.code,i),d;if(i.enabled&&u&&i.maxRetries>0){let e=K(i.backoff,0);d=new Date(o.getTime()+e)}let f={id:a,jobId:n.id,flowId:n.flowId,storageId:n.storageId,clientId:n.clientId,error:s,inputs:n.executionState?.inputs||{},nodeResults:l,failedAtNodeId:s.nodeId,retryCount:0,maxRetries:i.maxRetries,nextRetryAt:d,retryHistory:[],createdAt:o,updatedAt:o,expiresAt:we(o,i.ttlMs),status:u&&i.enabled?`pending`:`exhausted`};return yield*e.set(a,f),f}),get:t=>v.gen(function*(){return n(yield*e.get(t))}),getOption:t=>v.gen(function*(){let r=yield*v.either(e.get(t));return r._tag===`Left`?r.left.code===`FILE_NOT_FOUND`?b.none():yield*v.fail(r.left):b.some(n(r.right))}),delete:t=>e.delete(t),list:(e={})=>v.gen(function*(){let t=yield*r(),{status:n,flowId:i,clientId:a,limit:o=50,offset:s=0}=e,c=t;n&&(c=c.filter(e=>e.status===n)),i&&(c=c.filter(e=>e.flowId===i)),a&&(c=c.filter(e=>e.clientId===a)),c.sort((e,t)=>t.createdAt.getTime()-e.createdAt.getTime());let l=c.length;return{items:c.slice(s,s+o),total:l}}),update:(t,r)=>v.gen(function*(){let i={...n(yield*e.get(t)),...r,updatedAt:new Date};return yield*e.set(t,i),i}),markRetrying:t=>v.gen(function*(){let r={...n(yield*e.get(t)),status:`retrying`,updatedAt:new Date};return yield*e.set(t,r),r}),recordRetryFailure:(t,r,i)=>v.gen(function*(){let a=n(yield*e.get(t)),o=new Date,s=a.retryCount+1,c=[...a.retryHistory,{attemptedAt:o,error:r,durationMs:i}],l=`pending`,u;if(s>=a.maxRetries)l=`exhausted`,u=void 0;else{let e=K(G.backoff,s);u=new Date(o.getTime()+e)}let d={...a,retryCount:s,retryHistory:c,status:l,nextRetryAt:u,updatedAt:o};return yield*e.set(t,d),d}),markResolved:t=>v.gen(function*(){let r={...n(yield*e.get(t)),status:`resolved`,nextRetryAt:void 0,updatedAt:new Date};return yield*e.set(t,r),r}),getScheduledRetries:(e=100)=>v.gen(function*(){let t=yield*r(),n=new Date;return t.filter(e=>e.status===`pending`&&e.nextRetryAt&&e.nextRetryAt<=n).sort((e,t)=>(e.nextRetryAt?.getTime()||0)-(t.nextRetryAt?.getTime()||0)).slice(0,e)}),cleanup:(t={})=>v.gen(function*(){let n=yield*r(),{olderThan:i,status:a}=t,o=new Date,s=0;for(let t of n){let n=!1;t.expiresAt&&t.expiresAt<=o&&(n=!0),i&&t.createdAt<=i&&(a?n=t.status===a:(t.status===`exhausted`||t.status===`resolved`)&&(n=!0)),n&&(yield*v.catchAll(e.delete(t.id),()=>v.succeed(void 0)),s++)}return{deleted:s}}),getStats:()=>v.gen(function*(){let e=yield*r(),t={pending:0,retrying:0,exhausted:0,resolved:0},n={},i,a=0;for(let r of e)t[r.status]++,n[r.flowId]=(n[r.flowId]||0)+1,(!i||r.createdAt<i)&&(i=r.createdAt),a+=r.retryCount;let o=e.length>0?a/e.length:0;return{totalItems:e.length,byStatus:t,byFlow:n,oldestItem:i,averageRetryCount:o}})}})}const Ee=y.effect(q,Te());var De=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 v.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}}};function J(e){return t=>{if(t.nodeType!==e)return!1;let n=F.get(e);return n?n.schema.safeParse(t.data).success:!1}}function Oe(e){return!e||typeof e!=`object`?!1:f.safeParse(e).success}const ke=J(`storage-output-v1`),Ae=J(H),je=J(U);function Y(e,t){return e.filter(t)}function Me(t,n){return v.gen(function*(){let r=Y(t,n);return r.length===0?yield*e.fromCode(`OUTPUT_NOT_FOUND`,{body:`No output of the specified type was found in the flow results`}).toEffect():r.length>1?yield*e.fromCode(`MULTIPLE_OUTPUTS_FOUND`,{body:`Found ${r.length} outputs of the specified type, expected exactly one`,details:{foundCount:r.length,nodeIds:r.map(e=>e.nodeId)}}).toEffect():r[0]})}function Ne(e,t){return Y(e,t)[0]}function Pe(e,t){return e.find(e=>e.nodeId===t)}function Fe(e,t){return e.some(t)}function Ie(e){return e.operation===`init`}function Le(e){return e.operation===`finalize`}function Re(e){return e.operation===`url`}function ze(e){return e.operation===`init`||e.operation===`url`}const Be=e=>({id:e.id,name:e.name,nodes:e.nodes.map(le),edges:e.edges});function X(t){return v.gen(function*(){let r=yield*v.all(t.nodes.map(e=>v.isEffect(e)?e:v.succeed(e))),{flowId:i,name:a,onEvent:o,checkJobStatus:s,edges:l,inputSchema:u,outputSchema:d,typeChecker:f,circuitBreaker:p}=t,m=r,h=new me(f),g=e=>{let t=e.circuitBreaker,n=e.nodeTypeId?p?.nodeTypeOverrides?.[e.nodeTypeId]:void 0,r=p?.defaults;if(!(!t&&!n&&!r))return{...r,...n,...t}},_=()=>{let e={},t={},n={};return m.forEach(r=>{e[r.id]=[],n[r.id]=[],t[r.id]=0}),l.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}},y=new Map;l.forEach(e=>{let t=y.get(e.target)||[];t.push({source:e.source,sourcePort:e.sourcePort,targetPort:e.targetPort}),y.set(e.target,t)});let b=new Map,x=()=>{let{graph:e,inDegree:t}=_(),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},S=(e,t)=>{if(!e.condition)return v.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 v.succeed(s)},C=(e,t)=>{let n=y.get(e)||[],r={};return n.forEach(e=>{let n=e.source,i=t.get(n);if(i!==void 0){if(m.find(e=>e.id===n)?.type===`conditional`&&e.sourcePort){let t=b.get(n)?`true`:`false`;if(e.sourcePort!==t)return}r[n]=i}}),r},T=(e,t,n)=>{let r=y.get(e)||[];if(m.find(t=>t.id===e)?.type===`input`||r.length===0)return`execute`;let i=!1,a=!1,o=!1,s=!1;for(let e of r){let r=e.source;if(n.has(r)){a=!0;continue}if(t.get(r)===void 0){s=!0;continue}if(m.find(e=>e.id===r)?.type===`conditional`&&e.sourcePort){let t=b.get(r);if(t===void 0){s=!0;continue}let n=t?`true`:`false`;e.sourcePort===n?o=!0:i=!0}else o=!0}return o?`execute`:(i||a)&&!s?`skip`:s?`wait`:`execute`},ee=e=>{let t=m.filter(e=>e.type===`input`),n={};return t.forEach(t=>{e&&typeof e==`object`&&t.id in e&&(n[t.id]=u.parse(e[t.id]))}),n},D=e=>!l.some(t=>t.source===e),O=e=>{let t=m.find(t=>t.id===e);return D(e)||t?.keepOutput===!0},k=e=>{let t=m.filter(e=>O(e.id)),n={};return t.forEach(t=>{let r=e.get(t.id);r!==void 0&&(n[t.id]=r)}),n},A=(e,t)=>{let n=m.filter(e=>O(e.id)),r=[];return n.forEach(n=>{let i=e.get(n.id);if(i!==void 0){let e=t.get(n.id);r.push({nodeId:n.id,nodeType:e,data:i,timestamp:new Date().toISOString()})}}),r},j=(e,t,n)=>v.gen(function*(){if(e.storage.id===t)return e;let r=yield*c,i=yield*r.getDataStore(e.storage.id,n),a=yield*r.getDataStore(t,n),o=yield*i.read(e.id),s=w.make(o),l={...e,storage:{id:t,type:e.storage.type}},u=yield*a.create(l);return yield*a.write({file_id:u.id,stream:s,offset:0},{}),u}),M=(n,r,a,c,l,u,d,f)=>v.gen(function*(){let p=l.get(n);if(!p)return yield*e.fromCode(`FLOW_NODE_NOT_FOUND`).toEffect();if(s){let t=yield*s(u);if(t===`paused`)return yield*e.fromCode(`FLOW_PAUSED`,{cause:`Flow ${i} was paused by user at job ${u}`}).toEffect();if(t===`cancelled`)return yield*e.fromCode(`FLOW_CANCELLED`,{cause:`Flow ${i} was cancelled by user at job ${u}`}).toEffect()}o&&(yield*o({jobId:u,flowId:i,nodeId:n,eventType:`node-start`,nodeName:p.name,nodeType:p.type}));let m=p.retry?.maxRetries??0,h=p.retry?.retryDelay??1e3,_=p.retry?.exponentialBackoff??!0,y=g(p),x=y?.enabled&&p.nodeTypeId&&f?f.getOrCreate(p.nodeTypeId,y):null;if(x){let{allowed:t,state:r,failureCount:s}=yield*x.allowRequest();if(!t){let t=x.getFallback();return yield*v.logWarning(`Circuit breaker OPEN for node type "${p.nodeTypeId}" - applying fallback`),t.type===`skip`?(o&&(yield*o({jobId:u,flowId:i,nodeId:n,eventType:`node-end`,nodeName:p.name})),{nodeId:n,result:a[n],success:!0,waiting:!1}):t.type==="default"?(o&&(yield*o({jobId:u,flowId:i,nodeId:n,eventType:`node-end`,nodeName:p.name,result:t.value})),{nodeId:n,result:t.value,success:!0,waiting:!1}):yield*e.fromCode(`CIRCUIT_BREAKER_OPEN`,{body:`Circuit breaker is open for node type "${p.name}"`,details:{nodeType:p.name,nodeId:n,state:r,failureCount:s}}).toEffect()}}let w=0,T=null;for(;w<=m;)try{let s,l={};if(p.type===`input`){if(s=a[n],s===void 0)return yield*v.logError(`Input node ${n} has no input data`),yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Input node ${n} has no input data`)}).toEffect()}else{if(l=C(n,c),Object.keys(l).length===0)return yield*v.logError(`Node ${n} has no input data`),yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Node ${n} has no input data`)}).toEffect();if(p.multiInput)s=l;else{let t=Object.keys(l)[0];if(!t)return yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Node ${n} has no input data`)}).toEffect();s=l[t]}}if(p.type===`conditional`){let e=yield*S(p,s);b.set(n,e)}let f=yield*p.run({data:s,inputs:l,jobId:u,flowId:i,storageId:r,clientId:d});if(f.type===`waiting`){let e=f.partialData;return o&&(yield*o({jobId:u,flowId:i,nodeId:n,eventType:`node-pause`,nodeName:p.name,partialData:e})),{nodeId:n,result:e,success:!0,waiting:!0,nodeType:f.nodeType}}let m=f.data;if(O(n)&&(Oe(m)&&m.storage.id!==r&&(yield*v.logDebug(`Auto-persisting output node ${n} output from ${m.storage.id} to ${r}`),m=yield*j(m,r,d)),t.hooks?.onNodeOutput)){yield*v.logDebug(`Calling onNodeOutput hook for sink node ${n}`);let e=t.hooks.onNodeOutput({output:m,nodeId:n,flowId:i,jobId:u,storageId:r,clientId:d});m=yield*v.isEffect(e)?e:v.promise(()=>e)}return x&&(yield*x.recordSuccess()),o&&(yield*o({jobId:u,flowId:i,nodeId:n,eventType:`node-end`,nodeName:p.name,result:m})),{nodeId:n,result:m,success:!0,waiting:!1,nodeType:f.nodeType}}catch(t){if(T=t instanceof e?t:e.fromCode(`FLOW_NODE_ERROR`,{cause:t}),x&&(yield*x.recordFailure(T.body)),w<m){w++;let e=_?h*2**(w-1):h;yield*v.logWarning(`Node ${n} (${p.name}) failed, retrying (${w}/${m}) after ${e}ms`),yield*v.sleep(e);continue}return o&&(yield*o({jobId:u,flowId:i,nodeId:n,eventType:`node-error`,nodeName:p.name,error:T.body,retryCount:w})),yield*T.toEffect()}return T?yield*T.toEffect():yield*e.fromCode(`FLOW_NODE_ERROR`,{cause:Error(`Unexpected error in retry loop`)}).toEffect()}).pipe((()=>{let e=l.get(n),t=e?.nodeTypeId??e?.type??`unknown`;return v.withSpan(`node-${t}`,{attributes:{"node.id":n,"node.type":e?.type??`unknown`,"node.type_id":e?.nodeTypeId??`unknown`,"node.name":e?.name??`unknown`,"flow.id":i,"flow.job_id":u}})})()),N=({inputs:r,storageId:a,jobId:s,resumeFrom:c,clientId:u})=>v.gen(function*(){let f=yield*v.serviceOption(n),p=f._tag===`Some`?new te(f.value):null;!c&&o&&(yield*o({jobId:s,eventType:`flow-start`,flowId:i}));let h=ee(r||{}),g,_,y;c?(g=c.executionOrder,_=c.nodeResults,y=c.currentIndex):(g=x(),_=new Map,y=0);let b=new Map;if(g.length!==m.length)return yield*e.fromCode(`FLOW_CYCLE_ERROR`).toEffect();let S=new Map(m.map(e=>[e.id,e])),C=new Set;if(t.parallelExecution?.enabled??!1){yield*v.logDebug(`Flow ${i}: Executing in parallel mode (maxConcurrency: ${t.parallelExecution?.maxConcurrency??4})`);let e=new De({maxConcurrency:t.parallelExecution?.maxConcurrency??4}),n=e.groupNodesByExecutionLevel(m,l);yield*v.logDebug(`Flow ${i}: Grouped nodes into ${n.length} execution levels`);let r={};m.forEach(e=>{r[e.id]=[]}),l.forEach(e=>{r[e.target]?.push(e.source)});for(let t of n){yield*v.logDebug(`Flow ${i}: Executing level ${t.level} with nodes: ${t.nodes.join(`, `)}`);let n=[],r=[];for(let e of t.nodes)T(e,_,C)===`skip`?(r.push(e),C.add(e)):n.push(e);if(r.length>0&&(yield*v.logDebug(`Flow ${i}: Skipping nodes due to conditional routing: ${r.join(`, `)}`)),n.length===0){yield*v.logDebug(`Flow ${i}: All nodes in level ${t.level} skipped due to conditional routing`);continue}let l=n.map(e=>()=>v.gen(function*(){if(c&&e===c.executionOrder[y]&&o){let t=S.get(e);t&&(yield*o({jobId:s,flowId:i,nodeId:e,eventType:`node-resume`,nodeName:t.name,nodeType:t.type}))}return{nodeId:e,nodeResult:yield*M(e,a,h,_,S,s,u,p)}})),d=yield*e.executeNodesInParallel(l);for(let{nodeId:e,nodeResult:t}of d){if(t.waiting)return t.result!==void 0&&(_.set(e,t.result),t.nodeType&&b.set(e,t.nodeType)),{type:`paused`,nodeId:e,executionState:{executionOrder:g,currentIndex:g.indexOf(e),inputs:h}};t.success&&(_.set(e,t.result),t.nodeType&&b.set(e,t.nodeType))}}}else{yield*v.logDebug(`Flow ${i}: Executing in sequential mode`);for(let t=y;t<g.length;t++){let n=g[t];if(!n)return yield*e.fromCode(`FLOW_NODE_NOT_FOUND`).toEffect();if(T(n,_,C)===`skip`){yield*v.logDebug(`Flow ${i}: Skipping node ${n} due to conditional routing`),C.add(n);continue}if(c&&t===y&&o){let e=S.get(n);e&&(yield*o({jobId:s,flowId:i,nodeId:n,eventType:`node-resume`,nodeName:e.name,nodeType:e.type}))}let r=yield*M(n,a,h,_,S,s,u,p);if(r.waiting)return r.result!==void 0&&(_.set(r.nodeId,r.result),r.nodeType&&b.set(r.nodeId,r.nodeType)),{type:`paused`,nodeId:r.nodeId,executionState:{executionOrder:g,currentIndex:t,inputs:h}};r.success&&(_.set(r.nodeId,r.result),r.nodeType&&b.set(r.nodeId,r.nodeType))}}let w=k(_),D=A(_,b),j=E.record(E.string(),d).safeParse(w);if(!j.success){let t=`Flow output validation failed: ${j.error.message}. Expected outputs: ${JSON.stringify(Object.keys(k(_)))}. Output nodes (sinks + keepOutput): ${m.filter(e=>O(e.id)).map(e=>e.id).join(`, `)}`;return o&&(yield*o({jobId:s,eventType:`flow-error`,flowId:i,error:t})),yield*e.fromCode(`FLOW_OUTPUT_VALIDATION_ERROR`,{body:t,cause:j.error}).toEffect()}let N=j.data;return o&&(yield*o({jobId:s,eventType:`flow-end`,flowId:i,outputs:D,result:N})),{type:`completed`,result:N,outputs:D}});return{id:i,name:a,nodes:m,edges:l,inputSchema:u,outputSchema:d,onEvent:o,checkJobStatus:s,hooks:t.hooks,run:({inputs:e,storageId:t,jobId:n,clientId:r})=>N({inputs:e,storageId:t,jobId:n,clientId:r}),resume:({jobId:e,storageId:t,nodeResults:n,executionState:r,clientId:i})=>N({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=m;return h.validateFlow(e,l)},validateInputs:e=>h.validateData(e,u),validateOutputs:e=>h.validateData(e,d)}})}var Ve=class{items=new Map;createItem(e){return v.sync(()=>(this.items.set(e.id,{...e}),e))}getItem(e){return v.sync(()=>this.items.get(e)??null)}updateItem(t,n){let r=this;return v.suspend(()=>{let i=r.items.get(t);if(!i)return v.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{body:`Queue item ${t} not found`}));let a={...i,...n};return r.items.set(t,a),v.succeed(a)})}listByStatus(e){return v.sync(()=>{let t=[];for(let n of this.items.values())n.status===e&&t.push({...n});return e===`pending`&&t.sort((e,t)=>e.enqueuedAt.getTime()-t.enqueuedAt.getTime()),t})}deleteItem(e){return v.sync(()=>{this.items.delete(e)})}};const He={maxConcurrency:4,dlqRetryIntervalMs:3e4,dlqRetryBatchSize:10};var Z=class e extends g.Tag(`FlowWaitUntil`)(){static optional=v.serviceOption(e)},Ue=class e extends g.Tag(`FlowLifecycleHook`)(){static optional=v.serviceOption(e)},We=class extends g.Tag(`FlowProvider`)(){},Q=class extends g.Tag(`FlowEngine`)(){};const Ge=e=>typeof e==`object`&&!!e&&`id`in e,Ke=e=>typeof e==`object`&&e&&`nodeId`in e&&`data`in e&&`timestamp`in e?e.data:e;function qe(t,n,r){let i=e=>{let i=t=>v.gen(function*(){let n=yield*r.get(e);n&&(yield*r.set(e,{...n,...t,updatedAt:new Date}))});return a=>v.gen(function*(){switch(t.onEvent&&(yield*v.catchAll(t.onEvent(a),e=>(v.logError(`Original onEvent failed`,e),v.succeed({eventId:null})))),yield*n.emit(e,a),v.logInfo(`Updating job ${e} with event ${a.eventType}`),a.eventType){case`flow-start`:yield*i({status:`running`});break;case`flow-end`:yield*v.gen(function*(){let t=yield*r.get(e);t&&a.outputs&&(yield*r.set(e,{...t,result:a.outputs,updatedAt:new Date}))});break;case`flow-error`:yield*i({status:`failed`,error:a.error});break;case`node-start`:yield*v.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`node-pause`:yield*v.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}],i=a.partialData?.id,o=i?[...t.activeUploads||[],i]:t.activeUploads;yield*r.set(e,{...t,tasks:n,activeUploads:o,updatedAt:new Date})}});break;case`node-resume`:yield*v.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`node-end`:yield*v.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.edges.some(e=>e.source===a.nodeId),s=t.nodes.find(e=>e.id===a.nodeId)?.keepOutput===!0,c=a.result,l=Ke(c),u=n.intermediateFiles||[],d=o||s;d&&Ge(l)&&l.id?(u=u.filter(e=>e!==l.id),s&&!o&&v.logInfo(`Preserving output from node ${a.nodeId} due to keepOutput flag`)):!d&&Ge(l)&&l.id&&(u.includes(l.id)||u.push(l.id));let f=n.activeUploads||[];Ge(l)&&l.id&&(f=f.filter(e=>e!==l.id)),yield*r.set(e,{...n,tasks:i,intermediateFiles:u,activeUploads:f,updatedAt:new Date})}});break;case`node-error`:yield*v.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=>v.gen(function*(){let n=yield*r.get(t);return n?n.status===`paused`?`paused`:n.status===`cancelled`?`cancelled`:`running`:yield*v.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}))});return{...t,run:e=>v.gen(function*(){let n=e.jobId||crypto.randomUUID(),r=i(n),o=a(n);return yield*(yield*X({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=>v.gen(function*(){let n=e.jobId,r=i(n),o=a(n);return yield*(yield*X({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 Je(){return v.gen(function*(){let t=yield*We,n=yield*a,r=yield*o,i=yield*m,s=yield*q.optional,c=yield*Ue.optional,l=(t,n)=>v.gen(function*(){let i=yield*r.get(t);return i?yield*r.set(t,{...i,...n}):yield*v.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}))}),u=(e,t)=>v.gen(function*(){let n=yield*r.get(e);!n||!n.intermediateFiles||n.intermediateFiles.length===0||(yield*v.logInfo(`Cleaning up ${n.intermediateFiles.length} intermediate files for job ${e}`),yield*v.all(n.intermediateFiles.map(e=>v.gen(function*(){yield*i.delete(e,t),yield*v.logDebug(`Deleted intermediate file ${e}`)}).pipe(v.catchAll(t=>v.gen(function*(){return yield*v.logWarning(`Failed to delete intermediate file ${e}: ${t}`),v.succeed(void 0)})))),{concurrency:5}),yield*l(e,{intermediateFiles:[]}))}),d=(e,t)=>v.gen(function*(){if(b.isNone(s)){yield*v.logDebug(`[FlowServer] DLQ not configured, skipping for job: ${e}`);return}let n=s.value,i=yield*v.catchAll(r.get(e),()=>v.succeed(null));if(!i){yield*v.logWarning(`[FlowServer] Job ${e} not found when adding to DLQ`);return}yield*v.catchAll(n.add(i,t),t=>v.gen(function*(){return yield*v.logError(`[FlowServer] Failed to add job ${e} to DLQ`,t),v.succeed(void 0)})),yield*v.logInfo(`[FlowServer] Added job ${e} to Dead Letter Queue`)}),f=e=>b.isSome(c)?c.value.onComplete(e).pipe(v.catchAll(e=>v.logWarning(`FlowLifecycleHook.onComplete failed: ${e}`))):v.void,p=v.gen(function*(){let e=yield*v.currentSpan.pipe(v.option);return b.match(e,{onNone:()=>void 0,onSome:e=>({traceId:e.traceId,spanId:e.spanId,traceFlags:+!!e.sampled})})}),h=({jobId:t,flow:a,storageId:o,clientId:s,inputs:c})=>v.gen(function*(){return console.log(`[FlowServer] executeFlowInBackground started for job: ${t}`),yield*l(t,{status:`running`,traceContext:yield*p}),yield*v.gen(function*(){console.log(`[FlowServer] Creating flowWithEvents for job: ${t}`);let e=qe(a,n,r);console.log(`[FlowServer] Running flow for job: ${t}`);let i=yield*e.run({inputs:c,storageId:o,jobId:t,clientId:s});return console.log(`[FlowServer] Flow completed for job: ${t}, result type: ${i.type}`),i.type===`paused`?yield*l(t,{status:`paused`,pausedAt:i.nodeId,executionState:i.executionState,updatedAt:new Date}):(yield*l(t,{status:`completed`,updatedAt:new Date,endedAt:new Date}),yield*u(t,s),yield*f({jobId:t,flowId:a.id,clientId:s,status:`completed`})),i}).pipe(v.withSpan(`flow-execution`,{attributes:{"flow.id":a.id,"flow.name":a.name,"flow.job_id":t,"flow.storage_id":o,"flow.node_count":a.nodes.length}}))}).pipe(v.withSpan(`flow`,{attributes:{"flow.id":a.id,"flow.name":a.name,"flow.job_id":t,"flow.storage_id":o,"flow.node_count":a.nodes.length}}),v.catchAll(o=>v.gen(function*(){yield*v.logError(`Flow execution failed`,o);let c=o instanceof e?o.body:String(o);yield*v.logInfo(`Updating job ${t} to failed status with error: ${c}`),yield*l(t,{status:`failed`,error:c,updatedAt:new Date}).pipe(v.catchAll(e=>v.gen(function*(){return yield*v.logError(`Failed to update job ${t}`,e),v.succeed(void 0)})));let p=yield*r.get(t);throw p&&(yield*n.emit(t,{jobId:t,eventType:`flow-error`,flowId:p.flowId,error:c}).pipe(v.catchAll(e=>v.gen(function*(){return yield*v.logError(`Failed to emit FlowError event for job ${t}`,e),v.succeed(void 0)})))),a.onEvent&&(yield*a.onEvent({jobId:t,eventType:`flow-error`,flowId:a.id,error:c}).pipe(v.catchAll(e=>v.gen(function*(){return yield*v.logError(`Failed to call flow.onEvent for FlowError event for job ${t}`,e),v.succeed({eventId:null})})))),yield*u(t,s).pipe(v.catchAll(e=>v.gen(function*(){return yield*v.logWarning(`Failed to cleanup intermediate files for job ${t}`,e),v.succeed(void 0)}))),yield*v.gen(function*(){let e=yield*r.get(t);e&&e.activeUploads&&e.activeUploads.length>0&&(yield*v.logInfo(`Cleaning up ${e.activeUploads.length} active uploads for failed job ${t}`),yield*v.all(e.activeUploads.map(e=>v.gen(function*(){yield*i.delete(e,s),yield*v.logDebug(`Aborted active upload ${e} for failed job ${t}`)}).pipe(v.catchAll(t=>v.gen(function*(){return yield*v.logWarning(`Failed to abort active upload ${e}: ${t}`),v.succeed(void 0)})))),{concurrency:5}),yield*l(t,{activeUploads:[]}))}).pipe(v.catchAll(e=>v.gen(function*(){return yield*v.logWarning(`Failed to cleanup active uploads for job ${t}`,e),v.succeed(void 0)}))),yield*d(t,o instanceof e?o:new e({code:`UNKNOWN_ERROR`,status:500,body:String(o),cause:o})),yield*f({jobId:t,flowId:a.id,clientId:s,status:`failed`}),o})));return{getFlow:(e,n)=>v.gen(function*(){return yield*t.getFlow(e,n)}),getFlowData:(e,n)=>v.gen(function*(){return Be(yield*t.getFlow(e,n))}),runFlow:({flowId:n,storageId:i,clientId:a,inputs:o,jobId:s})=>v.gen(function*(){let c=yield*v.serviceOption(Xe),l=yield*Qe.optional;if(b.isSome(l)&&b.isNone(c)){let e=yield*l.value.enqueue({flowId:n,storageId:i,input:o,clientId:a}),t=e.enqueuedAt,s={id:e.id,flowId:n,storageId:i,clientId:a,status:`pending`,tasks:[],createdAt:t,updatedAt:t};return yield*r.set(e.id,s),s}let u=yield*Z.optional,d=yield*v.try({try:()=>Vt.parse({inputs:o}),catch:t=>e.fromCode(`FLOW_INPUT_VALIDATION_ERROR`,{cause:t})}),f=s??crypto.randomUUID(),p=new Date,m={id:f,flowId:n,storageId:i,clientId:a,status:`started`,createdAt:p,updatedAt:p,tasks:[]};yield*r.set(f,m);let g=yield*t.getFlow(n,a);console.log(`[FlowServer] About to fork flow execution for job: ${f}`);let _=h({jobId:f,flow:g,storageId:i,clientId:a,inputs:d.inputs}).pipe(v.tapErrorCause(e=>v.logError(`Flow execution failed`,e)));if(b.isSome(u)){console.log(`[FlowServer] Using waitUntil for job: ${f}`);let e=yield*v.runtime(),t=S.runPromise(e)(_);u.value(t)}else console.log(`[FlowServer] Using Effect.forkDaemon for job: ${f}`),yield*v.forkDaemon(_);return console.log(`[FlowServer] Flow execution started for job: ${f}`),m}),getJobStatus:t=>v.gen(function*(){return(yield*r.get(t))||(yield*v.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`})))}),resumeFlow:({jobId:a,nodeId:o,newData:s,clientId:c})=>v.gen(function*(){let p=yield*Z.optional,m=yield*r.get(a);if(!m)return console.error(`Job not found`),yield*v.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${a} not found`}));if(m.status!==`paused`)return console.error(`Job is not paused`),yield*v.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${a} is not paused (status: ${m.status})`}));if(m.pausedAt!==o)return console.error(`Job is not paused at the expected node`),yield*v.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${a} is paused at node ${m.pausedAt}, not ${o}`}));if(!m.executionState)return console.error(`Job has no execution state`),yield*v.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${a} has no execution state`}));let h={...m.tasks.reduce((e,t)=>(t.result!==void 0&&(e[t.nodeId]=t.result),e),{}),[o]:s},g={...m.executionState.inputs,[o]:s};yield*l(a,{status:`running`});let _=yield*t.getFlow(m.flowId,m.clientId),y=m.traceContext?T.externalSpan({traceId:m.traceContext.traceId,spanId:m.traceContext.spanId,sampled:m.traceContext.traceFlags===1}):void 0,x=v.gen(function*(){let t=qe(_,n,r);if(!m.executionState)return yield*v.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${a} has no execution state`}));let i=yield*t.resume({jobId:a,storageId:m.storageId,nodeResults:h,executionState:{...m.executionState,inputs:g},clientId:m.clientId});return i.type===`paused`?yield*l(a,{status:`paused`,pausedAt:i.nodeId,executionState:i.executionState,updatedAt:new Date}):(yield*l(a,{status:`completed`,pausedAt:void 0,executionState:void 0,updatedAt:new Date,endedAt:new Date}),yield*u(a,c),yield*f({jobId:a,flowId:_.id,clientId:m.clientId,status:`completed`})),i}).pipe(v.withSpan(`flow-execution-resume`,{attributes:{"flow.id":_.id,"flow.name":_.name,"flow.job_id":a,"flow.storage_id":m.storageId,"flow.resumed_from_node":o},parent:y})).pipe(v.catchAll(t=>v.gen(function*(){yield*v.logError(`Flow resume failed`,t);let o=t instanceof e?t.body:String(t);yield*v.logInfo(`Updating job ${a} to failed status with error: ${o}`),yield*l(a,{status:`failed`,error:o,updatedAt:new Date}).pipe(v.catchAll(e=>v.gen(function*(){return yield*v.logError(`Failed to update job ${a}`,e),v.succeed(void 0)})));let s=yield*r.get(a);throw s&&(yield*n.emit(a,{jobId:a,eventType:`flow-error`,flowId:s.flowId,error:o}).pipe(v.catchAll(e=>v.gen(function*(){return yield*v.logError(`Failed to emit FlowError event for job ${a}`,e),v.succeed(void 0)})))),yield*u(a,c).pipe(v.catchAll(e=>v.gen(function*(){return yield*v.logWarning(`Failed to cleanup intermediate files for job ${a}`,e),v.succeed(void 0)}))),yield*v.gen(function*(){let e=yield*r.get(a);e&&e.activeUploads&&e.activeUploads.length>0&&(yield*v.logInfo(`Cleaning up ${e.activeUploads.length} active uploads for failed job ${a}`),yield*v.all(e.activeUploads.map(e=>v.gen(function*(){yield*i.delete(e,c),yield*v.logDebug(`Aborted active upload ${e} for failed job ${a}`)}).pipe(v.catchAll(t=>v.gen(function*(){return yield*v.logWarning(`Failed to abort active upload ${e}: ${t}`),v.succeed(void 0)})))),{concurrency:5}),yield*l(a,{activeUploads:[]}))}).pipe(v.catchAll(e=>v.gen(function*(){return yield*v.logWarning(`Failed to cleanup active uploads for job ${a}`,e),v.succeed(void 0)}))),yield*d(a,t instanceof e?t:new e({code:`UNKNOWN_ERROR`,status:500,body:String(t),cause:t})),yield*f({jobId:a,flowId:_.id,clientId:m.clientId,status:`failed`}),t}))).pipe(v.tapErrorCause(e=>v.logError(`Flow resume failed`,e)));if(b.isSome(p)){console.log(`[FlowServer] Using waitUntil for resume job: ${a}`);let e=yield*v.runtime(),t=S.runPromise(e)(x);p.value(t)}else console.log(`[FlowServer] Using Effect.forkDaemon for resume job: ${a}`),yield*v.forkDaemon(x);return(yield*r.get(a))||(yield*v.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${a} not found after update`})))}),pauseFlow:(t,i)=>v.gen(function*(){let a=yield*r.get(t);if(!a)return yield*v.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}));if(i!==null&&a.clientId!==i)return yield*v.fail(e.fromCode(`FLOW_NOT_AUTHORIZED`,{cause:`Client ${i} is not authorized to pause job ${t}`}));if(a.status!==`running`)return yield*v.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} cannot be paused (current status: ${a.status})`}));let o=a.tasks.find(e=>e.status===`running`)?.nodeId;return yield*l(t,{status:`paused`,pausedAt:o,updatedAt:new Date}),yield*n.emit(t,{jobId:t,flowId:a.flowId,eventType:`flow-pause`,pausedAt:o}),(yield*r.get(t))||(yield*v.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found after pause`})))}),cancelFlow:(t,a)=>v.gen(function*(){let o=yield*r.get(t);return o?a!==null&&o.clientId!==a?yield*v.fail(e.fromCode(`FLOW_NOT_AUTHORIZED`,{cause:`Client ${a} is not authorized to cancel job ${t}`})):o.status!==`running`&&o.status!==`paused`&&o.status!==`started`?yield*v.fail(e.fromCode(`FLOW_JOB_ERROR`,{cause:`Job ${t} cannot be cancelled (current status: ${o.status})`})):(yield*l(t,{status:`cancelled`,updatedAt:new Date,endedAt:new Date}),yield*n.emit(t,{jobId:t,flowId:o.flowId,eventType:`flow-cancel`}),o.activeUploads&&o.activeUploads.length>0&&(yield*v.logInfo(`Cleaning up ${o.activeUploads.length} active uploads for job ${t}`),yield*v.all(o.activeUploads.map(e=>v.gen(function*(){yield*i.delete(e,a),yield*v.logDebug(`Aborted active upload ${e} for job ${t}`)}).pipe(v.catchAll(t=>v.gen(function*(){return yield*v.logWarning(`Failed to abort active upload ${e}: ${t}`),v.succeed(void 0)})))),{concurrency:5}),yield*l(t,{activeUploads:[]})),yield*u(t,a),(yield*r.get(t))||(yield*v.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found after cancellation`})))):yield*v.fail(e.fromCode(`FLOW_JOB_NOT_FOUND`,{cause:`Job ${t} not found`}))}),subscribeToFlowEvents:(e,t)=>v.gen(function*(){yield*n.subscribe(e,t)}),unsubscribeFromFlowEvents:e=>v.gen(function*(){yield*n.unsubscribe(e)})}})}const Ye=y.effect(Q,Je());var Xe=class extends g.Tag(`FlowQueueDispatchMarker`)(){};function Ze(t){let n=e=>({...e,enqueuedAt:new Date(e.enqueuedAt),startedAt:e.startedAt?new Date(e.startedAt):void 0,completedAt:e.completedAt?new Date(e.completedAt):void 0});return{createItem:e=>t.set(e.id,e).pipe(v.map(()=>e)),getItem:e=>t.get(e).pipe(v.map(e=>n(e)),v.catchAll(()=>v.succeed(null))),updateItem:(r,i)=>v.gen(function*(){let a={...yield*t.get(r).pipe(v.map(n),v.mapError(()=>e.fromCode(`FLOW_JOB_NOT_FOUND`,{body:`Queue item ${r} not found`}))),...i};return yield*t.set(r,a),a}),listByStatus:e=>v.gen(function*(){if(!t.list)return[];let r=yield*t.list(),i=[];for(let a of r){let r=yield*t.get(a).pipe(v.map(e=>n(e)),v.catchAll(()=>v.succeed(null)));r&&r.status===e&&i.push(r)}return e===`pending`&&i.sort((e,t)=>e.enqueuedAt.getTime()-t.enqueuedAt.getTime()),i}),deleteItem:e=>t.delete(e)}}var Qe=class e extends g.Tag(`FlowQueueService`)(){static optional=v.serviceOption(e);static Default(t){return e.make(t??{},new Ve)}static make(t,n){return y.effect(e,$e(t,n))}static fromKvStore(t={}){return y.effect(e,v.gen(function*(){return yield*$e(t,Ze(yield*s))}))}static fromBaseKvStore(t={}){return e.fromKvStore(t).pipe(y.provide(u))}};function $e(t,n){return v.gen(function*(){let{maxConcurrency:r,dlqRetryIntervalMs:i,dlqRetryBatchSize:a}={...He,...t},o=yield*x.make(0),s=yield*Q,c=yield*q.optional,l=()=>`q_${crypto.randomUUID()}`,u=t=>{let r=Date.now(),i=v.gen(function*(){yield*v.catchAll(n.updateItem(t.id,{status:`running`,startedAt:new Date}),e=>v.logError(`FlowQueue: failed to mark item running`,e)),yield*x.update(o,e=>e+1)}),a=s.runFlow({flowId:t.flowId,storageId:t.storageId,clientId:t.clientId,inputs:t.input,jobId:t.id}).pipe(v.provideService(Xe,!0)).pipe(v.andThen(()=>v.gen(function*(){yield*v.catchAll(n.updateItem(t.id,{status:`completed`,completedAt:new Date}),e=>v.logError(`FlowQueue: failed to mark item completed`,e)),t.dlqItemId&&b.isSome(c)&&(yield*v.catchAll(c.value.markResolved(t.dlqItemId),e=>v.logError(`FlowQueue: failed to mark DLQ item resolved`,e)))})),v.catchAll(i=>v.gen(function*(){let a=i instanceof e?i.body:String(i);if(yield*v.catchAll(n.updateItem(t.id,{status:`failed`,completedAt:new Date,error:a}),e=>v.logError(`FlowQueue: failed to mark item failed`,e)),t.dlqItemId&&b.isSome(c)){let e=Date.now()-r;yield*v.catchAll(c.value.recordRetryFailure(t.dlqItemId,a,e),e=>v.logError(`FlowQueue: failed to record DLQ retry failure`,e))}}))),l=x.update(o,e=>Math.max(0,e-1));return i.pipe(v.andThen(()=>a.pipe(v.ensuring(l))),v.catchAllCause(e=>v.logError(`FlowQueue: unexpected error in dispatchItem`,e)))},d=v.gen(function*(){let e=r-(yield*x.get(o));if(e<=0)return;let t=(yield*v.catchAll(n.listByStatus(`pending`),()=>v.succeed([]))).slice(0,e);for(let e of t)yield*v.forkDaemon(u(e))});if(yield*v.forkDaemon(d.pipe(v.repeat(C.spaced(_.millis(500))),v.catchAllCause(e=>v.logError(`FlowQueue: worker loop crashed`,e)))),b.isSome(c)){let e=c.value,t=v.gen(function*(){let t=yield*v.catchAll(e.getScheduledRetries(a),e=>v.logError(`FlowQueue: failed to fetch DLQ scheduled retries`,e).pipe(v.as([])));for(let r of t){yield*v.catchAll(e.markRetrying(r.id),e=>v.logError(`FlowQueue: failed to mark DLQ item retrying`,e));let t={id:l(),flowId:r.flowId,storageId:r.storageId,input:r.inputs,clientId:r.clientId,status:`pending`,dlqItemId:r.id,enqueuedAt:new Date};yield*v.catchAll(n.createItem(t),e=>v.logError(`FlowQueue: failed to enqueue DLQ retry item`,e))}});yield*v.forkDaemon(v.sleep(_.millis(i)).pipe(v.andThen(t.pipe(v.repeat(C.spaced(_.millis(i))))),v.catchAllCause(e=>v.logError(`FlowQueue: DLQ retry loop crashed`,e))))}return{enqueue:({flowId:e,storageId:t,input:r,clientId:i,dlqItemId:a})=>v.gen(function*(){let o={id:l(),flowId:e,storageId:t,input:r,clientId:i,status:`pending`,dlqItemId:a,enqueuedAt:new Date};return yield*n.createItem(o)}),getStatus:t=>v.gen(function*(){return(yield*n.getItem(t))||(yield*v.fail(e.fromCode(`QUEUE_ITEM_NOT_FOUND`)))}),cancel:t=>v.gen(function*(){let r=yield*n.getItem(t);if(!r)return yield*v.fail(e.fromCode(`QUEUE_ITEM_NOT_FOUND`));if(r.status===`running`)return yield*v.fail(e.fromCode(`QUEUE_ITEM_ALREADY_RUNNING`));r.status===`pending`&&(yield*n.deleteItem(t))}),list:e=>v.gen(function*(){if(e?.status)return yield*n.listByStatus(e.status);let[t,r,i,a]=yield*v.all([n.listByStatus(`pending`),n.listByStatus(`running`),n.listByStatus(`completed`),n.listByStatus(`failed`)]);return[...t,...r,...i,...a]}),getStats:()=>v.gen(function*(){let[e,t,i,a]=yield*v.all([n.listByStatus(`pending`),n.listByStatus(`running`),n.listByStatus(`completed`),n.listByStatus(`failed`)]),s=yield*x.get(o);return{pending:e.length,running:t.length,completed:i.length,failed:a.length,maxConcurrency:r,currentConcurrency:s}})}})}function et(e){let t=e.lastIndexOf(`.`);return t===-1||t===0?e:e.substring(0,t)}function tt(e){let t=e.lastIndexOf(`.`);return t===-1||t===0?``:e.substring(t+1)}function nt(e,t,n){let r=e.metadata??{},i=r.fileName??r.originalName??r.name??`unnamed`;return{baseName:et(i),extension:tt(i),fileName:i,nodeType:t.nodeType,nodeId:t.nodeId,flowId:t.flowId,jobId:t.jobId,timestamp:new Date().toISOString(),...n}}function rt(e,t){try{let n={};for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=String(r));return ee(e,n)}catch{return e}}function it(e,t,n){let r=t.fileName;if(!n)return r;try{if(n.mode===`auto`){if(n.autoSuffix){let e=n.autoSuffix(t);if(e){let{baseName:n,extension:r}=t;return r?`${n}-${e}.${r}`:`${n}-${e}`}}return r}if(n.mode===`custom`){if(n.rename)return n.rename(e,t)||r;if(n.pattern)return rt(n.pattern,t)||r}return r}catch{return r}}function at(e){if(!e||e.trim()===``)return{isValid:!1,error:`Pattern cannot be empty`};let t=(e.match(/\{\{/g)||[]).length,n=(e.match(/\}\}/g)||[]).length;if(t!==n)return{isValid:!1,error:`Unbalanced braces: ${t} opening, ${n} closing`};let r=e.match(/\{\{[^}]*[^a-zA-Z0-9_}][^}]*\}\}/g);return r?{isValid:!1,error:`Invalid variable syntax: ${r[0]}`}:{isValid:!0}}const ot=[{name:`baseName`,description:`Filename without extension`,example:`photo`},{name:`extension`,description:`File extension without dot`,example:`jpg`},{name:`fileName`,description:`Full original filename`,example:`photo.jpg`},{name:`nodeType`,description:`Type of processing node`,example:`resize`},{name:`nodeId`,description:`Specific node instance ID`,example:`resize-1`},{name:`flowId`,description:`Flow identifier`,example:`flow-abc`},{name:`jobId`,description:`Execution job ID`,example:`job-123`},{name:`timestamp`,description:`ISO 8601 processing time`,example:`2024-01-15T10:30:00Z`},{name:`width`,description:`Output width (image/video)`,example:`800`},{name:`height`,description:`Output height (image/video)`,example:`600`},{name:`format`,description:`Output format`,example:`webp`},{name:`quality`,description:`Quality setting`,example:`80`},{name:`pageNumber`,description:`Page number (documents)`,example:`1`}];function $(e){return!(`stream`in e)}function st({id:e,name:t,description:n,outputTypeId:i,keepOutput:a,naming:o,nodeType:s=`transform`,nodeTypeId:c,namingVars:l,circuitBreaker:u,mode:d=`auto`,streamingConfig:p,transform:h,streamingTransform:g}){if(d===`streaming`&&!g)throw Error(`Transform node "${e}": mode is "streaming" but no streamingTransform function provided`);if(d===`buffered`&&!h)throw Error(`Transform node "${e}": mode is "buffered" but no transform function provided`);if(d===`auto`&&!h&&!g)throw Error(`Transform node "${e}": mode is "auto" but neither transform nor streamingTransform provided`);let _={...r,...p};return v.gen(function*(){let r=yield*m;return yield*I({id:e,name:t,description:n,type:`process`,outputTypeId:i,keepOutput:a,nodeTypeId:c,circuitBreaker:u,inputSchema:f,outputSchema:f,run:({data:t,storageId:n,flowId:i,jobId:a,clientId:c})=>v.gen(function*(){let u={flowId:i,nodeId:e,jobId:a},f=yield*v.gen(function*(){if(d===`buffered`)return!1;if(d===`streaming`)return!0;let e=t.size??0,i=_.fileSizeThreshold;return e>0&&e<i?(yield*v.logDebug(`File ${t.id} (${e} bytes) below threshold (${i}), using buffered mode`),!1):g?(yield*r.getCapabilities(n,c)).supportsStreamingRead?(yield*v.logDebug(`File ${t.id} qualifies for streaming mode`),!0):(yield*v.logDebug(`DataStore doesn't support streaming read, using buffered mode`),!1):(yield*v.logDebug(`No streamingTransform function, using buffered mode`),!1)}),{type:p,fileName:m,metadata:y,metadataJson:b}=z(t.metadata);if(f&&g){yield*v.logDebug(`Using streaming transform for ${t.id}`);let d=yield*g(yield*r.readStream(t.id,c,_),t),f=$(d)?d:d.stream,h=$(d)?void 0:d.type,x=$(d)?void 0:d.estimatedSize,S=$(d)?void 0:d.fileName;!S&&o&&(S=it(t,nt(t,{flowId:i,jobId:a,nodeId:e,nodeType:s},l),o));let C=yield*r.getCapabilities(n,c),T;if(C.supportsStreamingWrite)yield*v.logDebug(`Using streaming write for ${t.id} - no intermediate buffering`),T=yield*r.uploadStream({storageId:n,uploadLengthDeferred:!0,sizeHint:x,type:h??p,fileName:S??m,lastModified:0,metadata:b,flow:u},c,f);else{yield*v.logDebug(`Falling back to buffered upload for ${t.id} (streaming write not supported)`);let e=[];yield*w.runForEach(f,t=>v.sync(()=>{e.push(t)}));let i=e.reduce((e,t)=>e+t.byteLength,0),a=new Uint8Array(i),o=0;for(let t of e)a.set(t,o),o+=t.byteLength;let s=new ReadableStream({start(e){e.enqueue(a),e.close()}});T=yield*r.upload({storageId:n,size:a.byteLength,type:h??p,fileName:S??m,lastModified:0,metadata:b,flow:u},c,s)}let E=y?{...y,...h&&{mimeType:h,type:h,"content-type":h},...S&&{fileName:S,originalName:S,name:S,extension:S.split(`.`).pop()||y.extension}}:T.metadata;return R(E?{...T,metadata:E}:T)}if(!h)throw Error(`Transform node "${e}": buffered mode selected but no transform function provided`);let x=yield*h(yield*r.read(t.id,c),t),S=x instanceof Uint8Array?x:x.bytes,C=x instanceof Uint8Array?void 0:x.type,T=x instanceof Uint8Array?void 0:x.fileName,E=x instanceof Uint8Array?void 0:x.metadata;!T&&o&&(T=it(t,nt(t,{flowId:i,jobId:a,nodeId:e,nodeType:s},l),o));let ee=new ReadableStream({start(e){e.enqueue(S),e.close()}}),D=yield*r.upload({storageId:n,size:S.byteLength,type:C??p,fileName:T??m,lastModified:0,metadata:b,flow:u},c,ee),O=y?{...y,...E,...C&&{mimeType:C,type:C,"content-type":C},...T&&{fileName:T,originalName:T,name:T,extension:T.split(`.`).pop()||y.extension}}:D.metadata;return R(O?{...D,metadata:O}:D)})})})}var ct=class extends g.Tag(`CredentialProvider`)(){},lt=class extends g.Tag(`DocumentAiPlugin`)(){},ut=class extends g.Tag(`DocumentPlugin`)(){},dt=class extends g.Tag(`ImageAiPlugin`)(){},ft=class extends g.Tag(`ImagePlugin`)(){};const pt=E.object({serviceType:E.enum([`replicate`]).optional()}),mt=E.object({duration:E.number().nonnegative(),width:E.number().positive(),height:E.number().positive(),codec:E.string(),format:E.string(),bitrate:E.number().nonnegative(),frameRate:E.number().positive(),aspectRatio:E.string(),hasAudio:E.boolean(),audioCodec:E.string().optional(),audioBitrate:E.number().nonnegative().optional(),size:E.number().nonnegative()}),ht=E.object({timestamp:E.number().nonnegative(),format:E.enum([`png`,`jpeg`]).optional(),quality:E.number().min(1).max(100).optional()}),gt=E.object({quality:E.number().min(0).max(100),format:E.enum([`jpeg`,`webp`,`png`,`avif`])}),_t=E.object({serviceType:E.enum([`replicate`]).optional()}),vt=E.object({width:E.number().positive().optional(),height:E.number().positive().optional(),fit:E.enum([`contain`,`cover`,`fill`])}).refine(e=>e.width||e.height,`Either width or height must be specified for resize`),yt=E.object({width:E.number().positive().optional(),height:E.number().positive().optional(),aspectRatio:E.enum([`keep`,`ignore`]).optional(),scaling:E.enum([`bicubic`,`bilinear`,`lanczos`]).optional()}).refine(e=>e.width||e.height,`Either width or height must be specified for video resize`),bt=E.object({format:E.enum([`mp4`,`webm`,`mov`,`avi`]),codec:E.enum([`h264`,`h265`,`vp9`,`av1`]).optional(),videoBitrate:E.string().optional(),audioBitrate:E.string().optional(),audioCodec:E.enum([`aac`,`mp3`,`opus`,`vorbis`]).optional()}),xt=E.object({type:E.literal(`resize`),width:E.number().positive().optional(),height:E.number().positive().optional(),fit:E.enum([`contain`,`cover`,`fill`])}),St=E.object({type:E.literal(`blur`),sigma:E.number().min(.3).max(1e3)}),Ct=E.object({type:E.literal(`rotate`),angle:E.number(),background:E.string().optional()}),wt=E.object({type:E.literal(`flip`),direction:E.enum([`horizontal`,`vertical`])}),Tt=E.object({type:E.literal(`grayscale`)}),Et=E.object({type:E.literal(`sepia`)}),Dt=E.object({type:E.literal(`brightness`),value:E.number().min(-100).max(100)}),Ot=E.object({type:E.literal(`contrast`),value:E.number().min(-100).max(100)}),kt=E.object({type:E.literal(`sharpen`),sigma:E.number().positive().optional()}),At=E.object({type:E.literal(`watermark`),imagePath:E.string().min(1).url(),position:E.enum([`top-left`,`top-right`,`bottom-left`,`bottom-right`,`center`]),opacity:E.number().min(0).max(1),offsetX:E.number().optional(),offsetY:E.number().optional()}),jt=E.object({type:E.literal(`logo`),imagePath:E.string().min(1).url(),position:E.enum([`top-left`,`top-right`,`bottom-left`,`bottom-right`,`center`]),scale:E.number().min(.1).max(2),offsetX:E.number().optional(),offsetY:E.number().optional()}),Mt=E.object({type:E.literal(`text`),text:E.string().min(1),position:E.enum([`top-left`,`top-right`,`bottom-left`,`bottom-right`,`center`]),fontSize:E.number().positive(),color:E.string().min(1),fontFamily:E.string().optional(),offsetX:E.number().optional(),offsetY:E.number().optional()}),Nt=E.discriminatedUnion(`type`,[xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt]),Pt=E.object({transformations:E.array(Nt).min(1)}),Ft=E.object({startTime:E.number().nonnegative(),endTime:E.number().positive().optional(),duration:E.number().positive().optional()}).refine(e=>!e.endTime||!e.duration,`Cannot specify both endTime and duration`).refine(e=>!e.endTime||e.endTime>e.startTime,`endTime must be greater than startTime`);var It=class extends g.Tag(`VideoPlugin`)(){},Lt=class extends g.Tag(`VirusScanPlugin`)(){},Rt=class extends g.Tag(`ZipPlugin`)(){};const zt=(e,t)=>{if(e.length===0)return t;let[n,...r]=e;return r.reduce((e,t)=>E.union([e,t]),n)};function Bt(t){return v.gen(function*(){let n=Object.entries(t.nodes),r=e=>v.isEffect(e)?e:v.succeed(e),i=yield*v.forEach(n,([t,n])=>v.flatMap(r(n),n=>n.id===t?v.succeed([t,n]):v.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===`input`).map(([,e])=>e.inputSchema),c=t.edges.map(e=>({source:a[e.source]?.id??e.source,target:a[e.target]?.id??e.target,sourcePort:e.sourcePort,targetPort:e.targetPort})),l=new Set(i.map(([e])=>a[e]?.id).filter(e=>e&&!c.some(t=>t.source===e))),u=i.filter(([,e])=>l.has(e.id)||e.keepOutput===!0).map(([,e])=>e.outputSchema),d=t.inputSchema??zt(s,E.unknown()),f=t.outputSchema??zt(u,E.unknown());return yield*X({flowId:t.flowId,name:t.name,nodes:o,edges:c,inputSchema:d,outputSchema:f,typeChecker:t.typeChecker,onEvent:t.onEvent,parallelExecution:t.parallelExecution,hooks:t.hooks,circuitBreaker:t.circuitBreaker})})}const Vt=E.object({inputs:E.record(E.string(),E.any())});export{Be as $,M as $t,dt as A,ve as At,rt as B,oe as Bt,vt as C,H as Ct,mt as D,xe as Dt,ht as E,Se as Et,ot as F,de as Ft,Ue as G,ae as Gt,Xe as H,se as Ht,it as I,fe as It,Je as J,N as Jt,We as K,re as Kt,nt as L,ce as Lt,lt as M,R as Mt,ct as N,L as Nt,pt as O,be as Ot,st as P,ue as Pt,X as Q,A as Qt,et as R,I as Rt,yt as S,U as St,gt as T,W as Tt,Qe as U,ie as Ut,at as V,F as Vt,Q as W,P as Wt,He as X,j as Xt,Ye as Y,te as Yt,Ve as Z,k as Zt,Mt as _,Ee as _t,It as a,Fe as at,At as b,we as bt,Dt as c,Ie as ct,Tt as d,Oe as dt,D as en,J as et,jt as f,ze as ft,kt as g,Te as gt,Et as h,q as ht,Lt as i,Me as it,ut as j,z as jt,ft as k,B as kt,Ot as l,Ae as lt,Ct as m,De as mt,Bt as n,Ne as nt,Ft as o,Le as ot,xt as p,Re as pt,Z as q,ne as qt,Rt as r,Pe as rt,St as s,je as st,Vt as t,Y as tt,wt as u,ke as ut,Pt as v,G as vt,_t as w,V as wt,bt as x,Ce as xt,Nt as y,K as yt,tt as z,le as zt};
2
+ //# sourceMappingURL=flow-Ag6JbNS6.mjs.map