alchemy 2.0.0-beta.65 → 2.0.0-beta.66

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 (950) hide show
  1. package/bin/exec.js +433 -181
  2. package/bin/exec.js.map +1 -1
  3. package/lib/AWS/ApiGateway/common.d.ts.map +1 -1
  4. package/lib/AWS/ApiGateway/common.js +8 -1
  5. package/lib/AWS/ApiGateway/common.js.map +1 -1
  6. package/lib/AWS/Bedrock/LanguageModel.d.ts +208 -0
  7. package/lib/AWS/Bedrock/LanguageModel.d.ts.map +1 -0
  8. package/lib/AWS/Bedrock/LanguageModel.js +508 -0
  9. package/lib/AWS/Bedrock/LanguageModel.js.map +1 -0
  10. package/lib/AWS/Bedrock/LanguageModelHttp.d.ts +10 -0
  11. package/lib/AWS/Bedrock/LanguageModelHttp.d.ts.map +1 -0
  12. package/lib/AWS/Bedrock/LanguageModelHttp.js +26 -0
  13. package/lib/AWS/Bedrock/LanguageModelHttp.js.map +1 -0
  14. package/lib/AWS/Bedrock/index.d.ts +2 -0
  15. package/lib/AWS/Bedrock/index.d.ts.map +1 -1
  16. package/lib/AWS/Bedrock/index.js +2 -0
  17. package/lib/AWS/Bedrock/index.js.map +1 -1
  18. package/lib/AWS/CloudFront/Distribution.d.ts +24 -0
  19. package/lib/AWS/CloudFront/Distribution.d.ts.map +1 -1
  20. package/lib/AWS/CloudFront/Distribution.js +89 -4
  21. package/lib/AWS/CloudFront/Distribution.js.map +1 -1
  22. package/lib/AWS/CostExplorer/AnomalyMonitor.d.ts +1 -1
  23. package/lib/AWS/CostExplorer/AnomalyMonitor.d.ts.map +1 -1
  24. package/lib/AWS/CostExplorer/AnomalySubscription.d.ts +1 -1
  25. package/lib/AWS/CostExplorer/AnomalySubscription.d.ts.map +1 -1
  26. package/lib/AWS/CostExplorer/BindingHttp.d.ts +3 -3
  27. package/lib/AWS/CostExplorer/BindingHttp.d.ts.map +1 -1
  28. package/lib/AWS/CostExplorer/CostCategory.d.ts +1 -1
  29. package/lib/AWS/CostExplorer/CostCategory.d.ts.map +1 -1
  30. package/lib/AWS/CostExplorer/GetAnomaliesHttp.d.ts +1 -1
  31. package/lib/AWS/CostExplorer/GetAnomaliesHttp.d.ts.map +1 -1
  32. package/lib/AWS/CostExplorer/GetApproximateUsageRecordsHttp.d.ts +1 -1
  33. package/lib/AWS/CostExplorer/GetApproximateUsageRecordsHttp.d.ts.map +1 -1
  34. package/lib/AWS/CostExplorer/GetCommitmentPurchaseAnalysisHttp.d.ts +1 -1
  35. package/lib/AWS/CostExplorer/GetCommitmentPurchaseAnalysisHttp.d.ts.map +1 -1
  36. package/lib/AWS/CostExplorer/GetCostAndUsageComparisonsHttp.d.ts +1 -1
  37. package/lib/AWS/CostExplorer/GetCostAndUsageComparisonsHttp.d.ts.map +1 -1
  38. package/lib/AWS/CostExplorer/GetCostAndUsageHttp.d.ts +1 -1
  39. package/lib/AWS/CostExplorer/GetCostAndUsageHttp.d.ts.map +1 -1
  40. package/lib/AWS/CostExplorer/GetCostAndUsageWithResourcesHttp.d.ts +1 -1
  41. package/lib/AWS/CostExplorer/GetCostAndUsageWithResourcesHttp.d.ts.map +1 -1
  42. package/lib/AWS/CostExplorer/GetCostCategoriesHttp.d.ts +1 -1
  43. package/lib/AWS/CostExplorer/GetCostCategoriesHttp.d.ts.map +1 -1
  44. package/lib/AWS/CostExplorer/GetCostComparisonDriversHttp.d.ts +1 -1
  45. package/lib/AWS/CostExplorer/GetCostComparisonDriversHttp.d.ts.map +1 -1
  46. package/lib/AWS/CostExplorer/GetCostForecastHttp.d.ts +1 -1
  47. package/lib/AWS/CostExplorer/GetCostForecastHttp.d.ts.map +1 -1
  48. package/lib/AWS/CostExplorer/GetDimensionValuesHttp.d.ts +1 -1
  49. package/lib/AWS/CostExplorer/GetDimensionValuesHttp.d.ts.map +1 -1
  50. package/lib/AWS/CostExplorer/GetReservationCoverageHttp.d.ts +1 -1
  51. package/lib/AWS/CostExplorer/GetReservationCoverageHttp.d.ts.map +1 -1
  52. package/lib/AWS/CostExplorer/GetReservationPurchaseRecommendationHttp.d.ts +1 -1
  53. package/lib/AWS/CostExplorer/GetReservationPurchaseRecommendationHttp.d.ts.map +1 -1
  54. package/lib/AWS/CostExplorer/GetReservationUtilizationHttp.d.ts +1 -1
  55. package/lib/AWS/CostExplorer/GetReservationUtilizationHttp.d.ts.map +1 -1
  56. package/lib/AWS/CostExplorer/GetRightsizingRecommendationHttp.d.ts +1 -1
  57. package/lib/AWS/CostExplorer/GetRightsizingRecommendationHttp.d.ts.map +1 -1
  58. package/lib/AWS/CostExplorer/GetSavingsPlanPurchaseRecommendationDetailsHttp.d.ts +1 -1
  59. package/lib/AWS/CostExplorer/GetSavingsPlanPurchaseRecommendationDetailsHttp.d.ts.map +1 -1
  60. package/lib/AWS/CostExplorer/GetSavingsPlansCoverageHttp.d.ts +1 -1
  61. package/lib/AWS/CostExplorer/GetSavingsPlansCoverageHttp.d.ts.map +1 -1
  62. package/lib/AWS/CostExplorer/GetSavingsPlansPurchaseRecommendationHttp.d.ts +1 -1
  63. package/lib/AWS/CostExplorer/GetSavingsPlansPurchaseRecommendationHttp.d.ts.map +1 -1
  64. package/lib/AWS/CostExplorer/GetSavingsPlansUtilizationDetailsHttp.d.ts +1 -1
  65. package/lib/AWS/CostExplorer/GetSavingsPlansUtilizationDetailsHttp.d.ts.map +1 -1
  66. package/lib/AWS/CostExplorer/GetSavingsPlansUtilizationHttp.d.ts +1 -1
  67. package/lib/AWS/CostExplorer/GetSavingsPlansUtilizationHttp.d.ts.map +1 -1
  68. package/lib/AWS/CostExplorer/GetTagsHttp.d.ts +1 -1
  69. package/lib/AWS/CostExplorer/GetTagsHttp.d.ts.map +1 -1
  70. package/lib/AWS/CostExplorer/GetUsageForecastHttp.d.ts +1 -1
  71. package/lib/AWS/CostExplorer/GetUsageForecastHttp.d.ts.map +1 -1
  72. package/lib/AWS/CostExplorer/ListCommitmentPurchaseAnalysesHttp.d.ts +1 -1
  73. package/lib/AWS/CostExplorer/ListCommitmentPurchaseAnalysesHttp.d.ts.map +1 -1
  74. package/lib/AWS/CostExplorer/ListCostAllocationTagBackfillHistoryHttp.d.ts +1 -1
  75. package/lib/AWS/CostExplorer/ListCostAllocationTagBackfillHistoryHttp.d.ts.map +1 -1
  76. package/lib/AWS/CostExplorer/ListCostAllocationTagsHttp.d.ts +1 -1
  77. package/lib/AWS/CostExplorer/ListCostAllocationTagsHttp.d.ts.map +1 -1
  78. package/lib/AWS/CostExplorer/ListCostCategoryResourceAssociationsHttp.d.ts +1 -1
  79. package/lib/AWS/CostExplorer/ListCostCategoryResourceAssociationsHttp.d.ts.map +1 -1
  80. package/lib/AWS/CostExplorer/ListSavingsPlansPurchaseRecommendationGenerationHttp.d.ts +1 -1
  81. package/lib/AWS/CostExplorer/ListSavingsPlansPurchaseRecommendationGenerationHttp.d.ts.map +1 -1
  82. package/lib/AWS/CostExplorer/ProvideAnomalyFeedbackHttp.d.ts +1 -1
  83. package/lib/AWS/CostExplorer/ProvideAnomalyFeedbackHttp.d.ts.map +1 -1
  84. package/lib/AWS/CostExplorer/StartCommitmentPurchaseAnalysisHttp.d.ts +1 -1
  85. package/lib/AWS/CostExplorer/StartCommitmentPurchaseAnalysisHttp.d.ts.map +1 -1
  86. package/lib/AWS/CostExplorer/StartCostAllocationTagBackfillHttp.d.ts +1 -1
  87. package/lib/AWS/CostExplorer/StartCostAllocationTagBackfillHttp.d.ts.map +1 -1
  88. package/lib/AWS/CostExplorer/StartSavingsPlansPurchaseRecommendationGenerationHttp.d.ts +1 -1
  89. package/lib/AWS/CostExplorer/StartSavingsPlansPurchaseRecommendationGenerationHttp.d.ts.map +1 -1
  90. package/lib/AWS/CostExplorer/UpdateCostAllocationTagsStatusHttp.d.ts +1 -1
  91. package/lib/AWS/CostExplorer/UpdateCostAllocationTagsStatusHttp.d.ts.map +1 -1
  92. package/lib/AWS/CostExplorer/common.d.ts +5 -3
  93. package/lib/AWS/CostExplorer/common.d.ts.map +1 -1
  94. package/lib/AWS/CostExplorer/common.js +16 -1
  95. package/lib/AWS/CostExplorer/common.js.map +1 -1
  96. package/lib/AWS/DataSync/Task.d.ts.map +1 -1
  97. package/lib/AWS/DataSync/Task.js +16 -2
  98. package/lib/AWS/DataSync/Task.js.map +1 -1
  99. package/lib/AWS/EC2/Vpc.d.ts.map +1 -1
  100. package/lib/AWS/EC2/Vpc.js +15 -2
  101. package/lib/AWS/EC2/Vpc.js.map +1 -1
  102. package/lib/AWS/EC2/hosted.d.ts.map +1 -1
  103. package/lib/AWS/EC2/hosted.js +10 -2
  104. package/lib/AWS/EC2/hosted.js.map +1 -1
  105. package/lib/AWS/ECR/Image.d.ts +132 -13
  106. package/lib/AWS/ECR/Image.d.ts.map +1 -1
  107. package/lib/AWS/ECR/ImageSource.d.ts.map +1 -1
  108. package/lib/AWS/ECR/ImageSource.js +10 -2
  109. package/lib/AWS/ECR/ImageSource.js.map +1 -1
  110. package/lib/AWS/ECR/Repository.d.ts +2 -0
  111. package/lib/AWS/ECR/Repository.d.ts.map +1 -1
  112. package/lib/AWS/ECR/Repository.js +28 -3
  113. package/lib/AWS/ECR/Repository.js.map +1 -1
  114. package/lib/AWS/ECS/Service.d.ts +27 -1
  115. package/lib/AWS/ECS/Service.d.ts.map +1 -1
  116. package/lib/AWS/ECS/Service.js +184 -22
  117. package/lib/AWS/ECS/Service.js.map +1 -1
  118. package/lib/AWS/ECS/Task.d.ts +32 -8
  119. package/lib/AWS/ECS/Task.d.ts.map +1 -1
  120. package/lib/AWS/ECS/Task.js +62 -29
  121. package/lib/AWS/ECS/Task.js.map +1 -1
  122. package/lib/AWS/EKS/Deployment.d.ts.map +1 -1
  123. package/lib/AWS/EKS/Deployment.js +10 -2
  124. package/lib/AWS/EKS/Deployment.js.map +1 -1
  125. package/lib/AWS/EKS/Job.d.ts.map +1 -1
  126. package/lib/AWS/EKS/Job.js +10 -2
  127. package/lib/AWS/EKS/Job.js.map +1 -1
  128. package/lib/AWS/Lambda/Function.d.ts +15 -0
  129. package/lib/AWS/Lambda/Function.d.ts.map +1 -1
  130. package/lib/AWS/Lambda/Function.js +67 -29
  131. package/lib/AWS/Lambda/Function.js.map +1 -1
  132. package/lib/AWS/Lambda/HttpServer.d.ts.map +1 -1
  133. package/lib/AWS/Lambda/HttpServer.js +7 -1
  134. package/lib/AWS/Lambda/HttpServer.js.map +1 -1
  135. package/lib/AWS/Lambda/LayerVersion.d.ts +176 -0
  136. package/lib/AWS/Lambda/LayerVersion.d.ts.map +1 -0
  137. package/lib/AWS/Lambda/LayerVersion.js +288 -0
  138. package/lib/AWS/Lambda/LayerVersion.js.map +1 -0
  139. package/lib/AWS/Lambda/MicrovmBundle.d.ts.map +1 -1
  140. package/lib/AWS/Lambda/MicrovmBundle.js +10 -2
  141. package/lib/AWS/Lambda/MicrovmBundle.js.map +1 -1
  142. package/lib/AWS/Lambda/index.d.ts +1 -0
  143. package/lib/AWS/Lambda/index.d.ts.map +1 -1
  144. package/lib/AWS/Lambda/index.js +1 -0
  145. package/lib/AWS/Lambda/index.js.map +1 -1
  146. package/lib/AWS/Providers.d.ts.map +1 -1
  147. package/lib/AWS/Providers.js +6 -1
  148. package/lib/AWS/Providers.js.map +1 -1
  149. package/lib/AWS/SES/ActiveReceiptRuleSet.d.ts +40 -0
  150. package/lib/AWS/SES/ActiveReceiptRuleSet.d.ts.map +1 -0
  151. package/lib/AWS/SES/ActiveReceiptRuleSet.js +58 -0
  152. package/lib/AWS/SES/ActiveReceiptRuleSet.js.map +1 -0
  153. package/lib/AWS/SES/ReceiptFilter.d.ts +67 -0
  154. package/lib/AWS/SES/ReceiptFilter.d.ts.map +1 -0
  155. package/lib/AWS/SES/ReceiptFilter.js +92 -0
  156. package/lib/AWS/SES/ReceiptFilter.js.map +1 -0
  157. package/lib/AWS/SES/ReceiptRule.d.ts +133 -0
  158. package/lib/AWS/SES/ReceiptRule.d.ts.map +1 -0
  159. package/lib/AWS/SES/ReceiptRule.js +178 -0
  160. package/lib/AWS/SES/ReceiptRule.js.map +1 -0
  161. package/lib/AWS/SES/ReceiptRuleSet.d.ts +55 -0
  162. package/lib/AWS/SES/ReceiptRuleSet.d.ts.map +1 -0
  163. package/lib/AWS/SES/ReceiptRuleSet.js +112 -0
  164. package/lib/AWS/SES/ReceiptRuleSet.js.map +1 -0
  165. package/lib/AWS/SES/SendBounce.d.ts +37 -0
  166. package/lib/AWS/SES/SendBounce.d.ts.map +1 -0
  167. package/lib/AWS/SES/SendBounce.js +3 -0
  168. package/lib/AWS/SES/SendBounce.js.map +1 -0
  169. package/lib/AWS/SES/SendBounceHttp.d.ts +4 -0
  170. package/lib/AWS/SES/SendBounceHttp.d.ts.map +1 -0
  171. package/lib/AWS/SES/SendBounceHttp.js +10 -0
  172. package/lib/AWS/SES/SendBounceHttp.js.map +1 -0
  173. package/lib/AWS/SES/index.d.ts +6 -0
  174. package/lib/AWS/SES/index.d.ts.map +1 -1
  175. package/lib/AWS/SES/index.js +6 -0
  176. package/lib/AWS/SES/index.js.map +1 -1
  177. package/lib/AWS/StateStore/State.d.ts +11 -0
  178. package/lib/AWS/StateStore/State.d.ts.map +1 -1
  179. package/lib/AWS/StateStore/State.js +117 -38
  180. package/lib/AWS/StateStore/State.js.map +1 -1
  181. package/lib/Apply.d.ts +37 -1
  182. package/lib/Apply.d.ts.map +1 -1
  183. package/lib/Apply.js +270 -194
  184. package/lib/Apply.js.map +1 -1
  185. package/lib/Axiom/Telemetry.d.ts +66 -0
  186. package/lib/Axiom/Telemetry.d.ts.map +1 -0
  187. package/lib/Axiom/Telemetry.js +69 -0
  188. package/lib/Axiom/Telemetry.js.map +1 -0
  189. package/lib/Axiom/index.d.ts +1 -0
  190. package/lib/Axiom/index.d.ts.map +1 -1
  191. package/lib/Axiom/index.js +1 -0
  192. package/lib/Axiom/index.js.map +1 -1
  193. package/lib/Bundle/Bundle.d.ts +1 -1
  194. package/lib/Bundle/Bundle.d.ts.map +1 -1
  195. package/lib/Bundle/Bundle.js +14 -6
  196. package/lib/Bundle/Bundle.js.map +1 -1
  197. package/lib/Bundle/BundleAnalyzerPlugin.d.ts +1 -1
  198. package/lib/Bundle/BundleAnalyzerPlugin.d.ts.map +1 -1
  199. package/lib/Bundle/BundleAnalyzerPlugin.js +10 -5
  200. package/lib/Bundle/BundleAnalyzerPlugin.js.map +1 -1
  201. package/lib/Bundle/PurePlugin.d.ts +1 -1
  202. package/lib/Bundle/PurePlugin.d.ts.map +1 -1
  203. package/lib/Bundle/PurePlugin.js +15 -7
  204. package/lib/Bundle/PurePlugin.js.map +1 -1
  205. package/lib/Cli/checkVersion.d.ts +11 -5
  206. package/lib/Cli/checkVersion.d.ts.map +1 -1
  207. package/lib/Cli/checkVersion.js +73 -12
  208. package/lib/Cli/checkVersion.js.map +1 -1
  209. package/lib/Cli/commands/cloudflare.d.ts +1 -1
  210. package/lib/Cli/commands/deploy.d.ts.map +1 -1
  211. package/lib/Cli/commands/deploy.js +3 -11
  212. package/lib/Cli/commands/deploy.js.map +1 -1
  213. package/lib/Cli/commands/logs.d.ts.map +1 -1
  214. package/lib/Cli/commands/logs.js +3 -1
  215. package/lib/Cli/commands/logs.js.map +1 -1
  216. package/lib/Cli/commands/tail.d.ts.map +1 -1
  217. package/lib/Cli/commands/tail.js +3 -1
  218. package/lib/Cli/commands/tail.js.map +1 -1
  219. package/lib/Cli/main.d.ts.map +1 -1
  220. package/lib/Cli/main.js +5 -4
  221. package/lib/Cli/main.js.map +1 -1
  222. package/lib/Cloudflare/AI/Search.d.ts +4 -15
  223. package/lib/Cloudflare/AI/Search.d.ts.map +1 -1
  224. package/lib/Cloudflare/AI/Search.js +4 -6
  225. package/lib/Cloudflare/AI/Search.js.map +1 -1
  226. package/lib/Cloudflare/AI/SearchInstance.d.ts +7 -26
  227. package/lib/Cloudflare/AI/SearchInstance.d.ts.map +1 -1
  228. package/lib/Cloudflare/AI/SearchInstance.js +7 -26
  229. package/lib/Cloudflare/AI/SearchInstance.js.map +1 -1
  230. package/lib/Cloudflare/ApiToken/AccountApiToken.d.ts +3 -0
  231. package/lib/Cloudflare/ApiToken/AccountApiToken.d.ts.map +1 -1
  232. package/lib/Cloudflare/ApiToken/AccountApiToken.js +3 -0
  233. package/lib/Cloudflare/ApiToken/AccountApiToken.js.map +1 -1
  234. package/lib/Cloudflare/Auth/AuthProvider.d.ts +2 -1
  235. package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
  236. package/lib/Cloudflare/Auth/AuthProvider.js +8 -3
  237. package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
  238. package/lib/Cloudflare/Auth/OAuthClient.d.ts +5 -0
  239. package/lib/Cloudflare/Auth/OAuthClient.d.ts.map +1 -1
  240. package/lib/Cloudflare/Auth/OAuthClient.js +50 -4
  241. package/lib/Cloudflare/Auth/OAuthClient.js.map +1 -1
  242. package/lib/Cloudflare/Containers/Container.d.ts +81 -3
  243. package/lib/Cloudflare/Containers/Container.d.ts.map +1 -1
  244. package/lib/Cloudflare/Containers/Container.js +70 -0
  245. package/lib/Cloudflare/Containers/Container.js.map +1 -1
  246. package/lib/Cloudflare/Containers/ContainerApplication.d.ts +22 -1
  247. package/lib/Cloudflare/Containers/ContainerApplication.d.ts.map +1 -1
  248. package/lib/Cloudflare/Containers/ContainerApplication.js +4 -1
  249. package/lib/Cloudflare/Containers/ContainerApplication.js.map +1 -1
  250. package/lib/Cloudflare/Containers/ContainerBundle.d.ts.map +1 -1
  251. package/lib/Cloudflare/Containers/ContainerBundle.js +10 -2
  252. package/lib/Cloudflare/Containers/ContainerBundle.js.map +1 -1
  253. package/lib/Cloudflare/Containers/ContainerProvider.d.ts.map +1 -1
  254. package/lib/Cloudflare/Containers/ContainerProvider.js +43 -0
  255. package/lib/Cloudflare/Containers/ContainerProvider.js.map +1 -1
  256. package/lib/Cloudflare/Credentials.d.ts +21 -1
  257. package/lib/Cloudflare/Credentials.d.ts.map +1 -1
  258. package/lib/Cloudflare/Credentials.js +52 -9
  259. package/lib/Cloudflare/Credentials.js.map +1 -1
  260. package/lib/Cloudflare/D1/ApplyMigrations.d.ts +30 -5
  261. package/lib/Cloudflare/D1/ApplyMigrations.d.ts.map +1 -1
  262. package/lib/Cloudflare/D1/ApplyMigrations.js +36 -26
  263. package/lib/Cloudflare/D1/ApplyMigrations.js.map +1 -1
  264. package/lib/Cloudflare/D1/Database.d.ts +18 -1
  265. package/lib/Cloudflare/D1/Database.d.ts.map +1 -1
  266. package/lib/Cloudflare/D1/Database.js +134 -2
  267. package/lib/Cloudflare/D1/Database.js.map +1 -1
  268. package/lib/Cloudflare/D1/LocalD1Gateway.d.ts +39 -0
  269. package/lib/Cloudflare/D1/LocalD1Gateway.d.ts.map +1 -0
  270. package/lib/Cloudflare/D1/LocalD1Gateway.js +100 -0
  271. package/lib/Cloudflare/D1/LocalD1Gateway.js.map +1 -0
  272. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.d.ts +31 -0
  273. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.d.ts.map +1 -1
  274. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.js +13 -6
  275. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.js.map +1 -1
  276. package/lib/Cloudflare/D1/QueryDatabaseLocal.d.ts.map +1 -1
  277. package/lib/Cloudflare/D1/QueryDatabaseLocal.js +21 -2
  278. package/lib/Cloudflare/D1/QueryDatabaseLocal.js.map +1 -1
  279. package/lib/Cloudflare/Email/Address.d.ts.map +1 -1
  280. package/lib/Cloudflare/Email/Address.js +15 -1
  281. package/lib/Cloudflare/Email/Address.js.map +1 -1
  282. package/lib/Cloudflare/Email/SendBinding.d.ts.map +1 -1
  283. package/lib/Cloudflare/Email/SendBinding.js +1 -0
  284. package/lib/Cloudflare/Email/SendBinding.js.map +1 -1
  285. package/lib/Cloudflare/Email/SendEmail.d.ts +12 -0
  286. package/lib/Cloudflare/Email/SendEmail.d.ts.map +1 -1
  287. package/lib/Cloudflare/Email/SendEmail.js +1 -0
  288. package/lib/Cloudflare/Email/SendEmail.js.map +1 -1
  289. package/lib/Cloudflare/Flagship/App.d.ts.map +1 -1
  290. package/lib/Cloudflare/Flagship/App.js +8 -3
  291. package/lib/Cloudflare/Flagship/App.js.map +1 -1
  292. package/lib/Cloudflare/KV/LocalKVGateway.d.ts +15 -0
  293. package/lib/Cloudflare/KV/LocalKVGateway.d.ts.map +1 -0
  294. package/lib/Cloudflare/KV/LocalKVGateway.js +64 -0
  295. package/lib/Cloudflare/KV/LocalKVGateway.js.map +1 -0
  296. package/lib/Cloudflare/KV/Namespace.d.ts +9 -1
  297. package/lib/Cloudflare/KV/Namespace.d.ts.map +1 -1
  298. package/lib/Cloudflare/KV/Namespace.js +45 -1
  299. package/lib/Cloudflare/KV/Namespace.js.map +1 -1
  300. package/lib/Cloudflare/KV/NamespaceLocal.d.ts +16 -5
  301. package/lib/Cloudflare/KV/NamespaceLocal.d.ts.map +1 -1
  302. package/lib/Cloudflare/KV/NamespaceLocal.js +21 -4
  303. package/lib/Cloudflare/KV/NamespaceLocal.js.map +1 -1
  304. package/lib/Cloudflare/KV/ReadNamespaceLocal.d.ts.map +1 -1
  305. package/lib/Cloudflare/KV/ReadNamespaceLocal.js +5 -1
  306. package/lib/Cloudflare/KV/ReadNamespaceLocal.js.map +1 -1
  307. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.d.ts.map +1 -1
  308. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.js +5 -1
  309. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.js.map +1 -1
  310. package/lib/Cloudflare/KV/WriteNamespaceLocal.d.ts.map +1 -1
  311. package/lib/Cloudflare/KV/WriteNamespaceLocal.js +5 -1
  312. package/lib/Cloudflare/KV/WriteNamespaceLocal.js.map +1 -1
  313. package/lib/Cloudflare/LocalGateway.d.ts +25 -0
  314. package/lib/Cloudflare/LocalGateway.d.ts.map +1 -0
  315. package/lib/Cloudflare/LocalGateway.js +70 -0
  316. package/lib/Cloudflare/LocalGateway.js.map +1 -0
  317. package/lib/Cloudflare/LocalRuntime.d.ts +14 -1
  318. package/lib/Cloudflare/LocalRuntime.d.ts.map +1 -1
  319. package/lib/Cloudflare/LocalRuntime.js +16 -1
  320. package/lib/Cloudflare/LocalRuntime.js.map +1 -1
  321. package/lib/Cloudflare/Logs.d.ts.map +1 -1
  322. package/lib/Cloudflare/Logs.js +18 -6
  323. package/lib/Cloudflare/Logs.js.map +1 -1
  324. package/lib/Cloudflare/Providers.d.ts +1 -1
  325. package/lib/Cloudflare/Providers.d.ts.map +1 -1
  326. package/lib/Cloudflare/Providers.js +6 -2
  327. package/lib/Cloudflare/Providers.js.map +1 -1
  328. package/lib/Cloudflare/Queues/Consumer.d.ts +16 -3
  329. package/lib/Cloudflare/Queues/Consumer.d.ts.map +1 -1
  330. package/lib/Cloudflare/Queues/Consumer.js +51 -3
  331. package/lib/Cloudflare/Queues/Consumer.js.map +1 -1
  332. package/lib/Cloudflare/Queues/Queue.d.ts +4 -3
  333. package/lib/Cloudflare/Queues/Queue.d.ts.map +1 -1
  334. package/lib/Cloudflare/Queues/Queue.js +7 -17
  335. package/lib/Cloudflare/Queues/Queue.js.map +1 -1
  336. package/lib/Cloudflare/Queues/QueueBinding.d.ts.map +1 -1
  337. package/lib/Cloudflare/Queues/QueueBinding.js +19 -0
  338. package/lib/Cloudflare/Queues/QueueBinding.js.map +1 -1
  339. package/lib/Cloudflare/Queues/QueueShim.d.ts +55 -0
  340. package/lib/Cloudflare/Queues/QueueShim.d.ts.map +1 -0
  341. package/lib/Cloudflare/Queues/QueueShim.js +177 -0
  342. package/lib/Cloudflare/Queues/QueueShim.js.map +1 -0
  343. package/lib/Cloudflare/R2/Bucket.d.ts +14 -1
  344. package/lib/Cloudflare/R2/Bucket.d.ts.map +1 -1
  345. package/lib/Cloudflare/R2/Bucket.js +53 -1
  346. package/lib/Cloudflare/R2/Bucket.js.map +1 -1
  347. package/lib/Cloudflare/R2/BucketBinding.d.ts +10 -0
  348. package/lib/Cloudflare/R2/BucketBinding.d.ts.map +1 -1
  349. package/lib/Cloudflare/R2/BucketBinding.js +14 -3
  350. package/lib/Cloudflare/R2/BucketBinding.js.map +1 -1
  351. package/lib/Cloudflare/R2/BucketLocal.d.ts +13 -6
  352. package/lib/Cloudflare/R2/BucketLocal.d.ts.map +1 -1
  353. package/lib/Cloudflare/R2/BucketLocal.js +19 -6
  354. package/lib/Cloudflare/R2/BucketLocal.js.map +1 -1
  355. package/lib/Cloudflare/R2/LocalR2Gateway.d.ts +15 -0
  356. package/lib/Cloudflare/R2/LocalR2Gateway.d.ts.map +1 -0
  357. package/lib/Cloudflare/R2/LocalR2Gateway.js +65 -0
  358. package/lib/Cloudflare/R2/LocalR2Gateway.js.map +1 -0
  359. package/lib/Cloudflare/R2/ReadBucketLocal.d.ts.map +1 -1
  360. package/lib/Cloudflare/R2/ReadBucketLocal.js +5 -1
  361. package/lib/Cloudflare/R2/ReadBucketLocal.js.map +1 -1
  362. package/lib/Cloudflare/R2/ReadWriteBucketLocal.d.ts.map +1 -1
  363. package/lib/Cloudflare/R2/ReadWriteBucketLocal.js +5 -1
  364. package/lib/Cloudflare/R2/ReadWriteBucketLocal.js.map +1 -1
  365. package/lib/Cloudflare/R2/WriteBucketLocal.d.ts.map +1 -1
  366. package/lib/Cloudflare/R2/WriteBucketLocal.js +5 -1
  367. package/lib/Cloudflare/R2/WriteBucketLocal.js.map +1 -1
  368. package/lib/Cloudflare/Ruleset/AccountEntrypoint.d.ts.map +1 -1
  369. package/lib/Cloudflare/Ruleset/AccountEntrypoint.js +5 -1
  370. package/lib/Cloudflare/Ruleset/AccountEntrypoint.js.map +1 -1
  371. package/lib/Cloudflare/Ruleset/Ruleset.d.ts.map +1 -1
  372. package/lib/Cloudflare/Ruleset/Ruleset.js +19 -6
  373. package/lib/Cloudflare/Ruleset/Ruleset.js.map +1 -1
  374. package/lib/Cloudflare/Rum/Site.js +10 -2
  375. package/lib/Cloudflare/Rum/Site.js.map +1 -1
  376. package/lib/Cloudflare/StateStore/Api.d.ts +31 -2
  377. package/lib/Cloudflare/StateStore/Api.js +1 -1
  378. package/lib/Cloudflare/StateStore/Api.js.map +1 -1
  379. package/lib/Cloudflare/StateStore/State.d.ts +1 -1
  380. package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
  381. package/lib/Cloudflare/Tunnel/Tunnel.d.ts.map +1 -1
  382. package/lib/Cloudflare/Tunnel/Tunnel.js +20 -1
  383. package/lib/Cloudflare/Tunnel/Tunnel.js.map +1 -1
  384. package/lib/Cloudflare/Website/StaticSite.d.ts +34 -7
  385. package/lib/Cloudflare/Website/StaticSite.d.ts.map +1 -1
  386. package/lib/Cloudflare/Website/StaticSite.js +108 -24
  387. package/lib/Cloudflare/Website/StaticSite.js.map +1 -1
  388. package/lib/Cloudflare/Website/Vite.d.ts +33 -19
  389. package/lib/Cloudflare/Website/Vite.d.ts.map +1 -1
  390. package/lib/Cloudflare/Website/Vite.js +33 -19
  391. package/lib/Cloudflare/Website/Vite.js.map +1 -1
  392. package/lib/Cloudflare/Workers/Compatibility.d.ts.map +1 -1
  393. package/lib/Cloudflare/Workers/Compatibility.js +26 -7
  394. package/lib/Cloudflare/Workers/Compatibility.js.map +1 -1
  395. package/lib/Cloudflare/Workers/DurableObject.d.ts +22 -0
  396. package/lib/Cloudflare/Workers/DurableObject.d.ts.map +1 -1
  397. package/lib/Cloudflare/Workers/DurableObject.js +22 -0
  398. package/lib/Cloudflare/Workers/DurableObject.js.map +1 -1
  399. package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
  400. package/lib/Cloudflare/Workers/DurableObjectBridge.js +20 -5
  401. package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
  402. package/lib/Cloudflare/Workers/InferEnv.d.ts +4 -2
  403. package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
  404. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts +7 -3
  405. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
  406. package/lib/Cloudflare/Workers/LocalWorkerProvider.js +483 -298
  407. package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
  408. package/lib/Cloudflare/Workers/Worker.d.ts +612 -13
  409. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  410. package/lib/Cloudflare/Workers/Worker.js +222 -1
  411. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  412. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts +13 -1
  413. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
  414. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +171 -21
  415. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
  416. package/lib/Cloudflare/Workers/WorkerBinding.d.ts +130 -28
  417. package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
  418. package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
  419. package/lib/Cloudflare/Workers/WorkerBridge.d.ts +6 -2
  420. package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
  421. package/lib/Cloudflare/Workers/WorkerBridge.js +18 -2
  422. package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
  423. package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
  424. package/lib/Cloudflare/Workers/WorkerBundle.js +4 -1
  425. package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
  426. package/lib/Cloudflare/Workers/WorkerProvider.d.ts +186 -11
  427. package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -1
  428. package/lib/Cloudflare/Workers/WorkerProvider.js +1765 -236
  429. package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
  430. package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts +7 -1
  431. package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts.map +1 -1
  432. package/lib/Cloudflare/Workflows/WorkflowBridge.js +14 -4
  433. package/lib/Cloudflare/Workflows/WorkflowBridge.js.map +1 -1
  434. package/lib/Command/Build.d.ts +2 -2
  435. package/lib/Command/Build.d.ts.map +1 -1
  436. package/lib/Command/Build.js +4 -7
  437. package/lib/Command/Build.js.map +1 -1
  438. package/lib/Command/Command.d.ts +34 -4
  439. package/lib/Command/Command.d.ts.map +1 -1
  440. package/lib/Command/Command.js +125 -30
  441. package/lib/Command/Command.js.map +1 -1
  442. package/lib/Command/Dev.d.ts +2 -2
  443. package/lib/Command/Dev.d.ts.map +1 -1
  444. package/lib/Command/Dev.js +51 -73
  445. package/lib/Command/Dev.js.map +1 -1
  446. package/lib/Command/Exec.d.ts +11 -2
  447. package/lib/Command/Exec.d.ts.map +1 -1
  448. package/lib/Command/Exec.js +9 -0
  449. package/lib/Command/Exec.js.map +1 -1
  450. package/lib/Command/Memo.d.ts +9 -1
  451. package/lib/Command/Memo.d.ts.map +1 -1
  452. package/lib/Command/Memo.js +14 -2
  453. package/lib/Command/Memo.js.map +1 -1
  454. package/lib/Command/Providers.d.ts +1 -1
  455. package/lib/Command/Providers.d.ts.map +1 -1
  456. package/lib/Command/Redaction.d.ts +10 -0
  457. package/lib/Command/Redaction.d.ts.map +1 -0
  458. package/lib/Command/Redaction.js +119 -0
  459. package/lib/Command/Redaction.js.map +1 -0
  460. package/lib/Deploy.d.ts +2 -1
  461. package/lib/Deploy.d.ts.map +1 -1
  462. package/lib/Destroy.d.ts +2 -1
  463. package/lib/Destroy.d.ts.map +1 -1
  464. package/lib/Destroy.js +1 -9
  465. package/lib/Destroy.js.map +1 -1
  466. package/lib/Docker/Container.d.ts +15 -1
  467. package/lib/Docker/Container.d.ts.map +1 -1
  468. package/lib/Docker/Container.js +34 -11
  469. package/lib/Docker/Container.js.map +1 -1
  470. package/lib/Docker/Context.d.ts +84 -0
  471. package/lib/Docker/Context.d.ts.map +1 -0
  472. package/lib/Docker/Context.js +145 -0
  473. package/lib/Docker/Context.js.map +1 -0
  474. package/lib/Docker/Docker.d.ts +190 -14
  475. package/lib/Docker/Docker.d.ts.map +1 -1
  476. package/lib/Docker/Docker.js +149 -28
  477. package/lib/Docker/Docker.js.map +1 -1
  478. package/lib/Docker/Image.d.ts +12 -0
  479. package/lib/Docker/Image.d.ts.map +1 -1
  480. package/lib/Docker/Image.js +24 -7
  481. package/lib/Docker/Image.js.map +1 -1
  482. package/lib/Docker/Network.d.ts +7 -0
  483. package/lib/Docker/Network.d.ts.map +1 -1
  484. package/lib/Docker/Network.js +16 -7
  485. package/lib/Docker/Network.js.map +1 -1
  486. package/lib/Docker/Providers.d.ts +1 -1
  487. package/lib/Docker/Providers.d.ts.map +1 -1
  488. package/lib/Docker/Providers.js +13 -1
  489. package/lib/Docker/Providers.js.map +1 -1
  490. package/lib/Docker/RemoteImage.d.ts +12 -0
  491. package/lib/Docker/RemoteImage.d.ts.map +1 -1
  492. package/lib/Docker/RemoteImage.js +22 -8
  493. package/lib/Docker/RemoteImage.js.map +1 -1
  494. package/lib/Docker/Service.d.ts +445 -0
  495. package/lib/Docker/Service.d.ts.map +1 -0
  496. package/lib/Docker/Service.js +578 -0
  497. package/lib/Docker/Service.js.map +1 -0
  498. package/lib/Docker/ServiceImage.d.ts +78 -0
  499. package/lib/Docker/ServiceImage.d.ts.map +1 -0
  500. package/lib/Docker/ServiceImage.js +232 -0
  501. package/lib/Docker/ServiceImage.js.map +1 -0
  502. package/lib/Docker/Swarm.d.ts +117 -0
  503. package/lib/Docker/Swarm.d.ts.map +1 -0
  504. package/lib/Docker/Swarm.js +149 -0
  505. package/lib/Docker/Swarm.js.map +1 -0
  506. package/lib/Docker/Volume.d.ts +11 -0
  507. package/lib/Docker/Volume.d.ts.map +1 -1
  508. package/lib/Docker/Volume.js +21 -6
  509. package/lib/Docker/Volume.js.map +1 -1
  510. package/lib/Docker/index.d.ts +3 -0
  511. package/lib/Docker/index.d.ts.map +1 -1
  512. package/lib/Docker/index.js +3 -0
  513. package/lib/Docker/index.js.map +1 -1
  514. package/lib/Http.d.ts +8 -1
  515. package/lib/Http.d.ts.map +1 -1
  516. package/lib/Http.js +7 -2
  517. package/lib/Http.js.map +1 -1
  518. package/lib/Local/LocalProvider.d.ts +182 -0
  519. package/lib/Local/LocalProvider.d.ts.map +1 -0
  520. package/lib/Local/LocalProvider.js +226 -0
  521. package/lib/Local/LocalProvider.js.map +1 -0
  522. package/lib/Local/ProviderLayer.d.ts +43 -2
  523. package/lib/Local/ProviderLayer.d.ts.map +1 -1
  524. package/lib/Local/ProviderLayer.js +80 -2
  525. package/lib/Local/ProviderLayer.js.map +1 -1
  526. package/lib/Local/RpcProvider.d.ts +7 -0
  527. package/lib/Local/RpcProvider.d.ts.map +1 -1
  528. package/lib/Local/RpcProvider.js +8 -3
  529. package/lib/Local/RpcProvider.js.map +1 -1
  530. package/lib/Local/RpcProviderProxy.d.ts.map +1 -1
  531. package/lib/Local/RpcProviderProxy.js +3 -0
  532. package/lib/Local/RpcProviderProxy.js.map +1 -1
  533. package/lib/Local/RpcServer.d.ts +8 -1
  534. package/lib/Local/RpcServer.d.ts.map +1 -1
  535. package/lib/Local/RpcServer.js +4 -1
  536. package/lib/Local/RpcServer.js.map +1 -1
  537. package/lib/Plan.d.ts +34 -0
  538. package/lib/Plan.d.ts.map +1 -1
  539. package/lib/Plan.js +127 -40
  540. package/lib/Plan.js.map +1 -1
  541. package/lib/Planetscale/AuthProvider.d.ts.map +1 -1
  542. package/lib/Planetscale/AuthProvider.js +6 -2
  543. package/lib/Planetscale/AuthProvider.js.map +1 -1
  544. package/lib/Planetscale/Branch.d.ts.map +1 -1
  545. package/lib/Planetscale/Branch.js +36 -6
  546. package/lib/Planetscale/Branch.js.map +1 -1
  547. package/lib/Planetscale/MySQL/MySQLDatabase.d.ts.map +1 -1
  548. package/lib/Planetscale/MySQL/MySQLDatabase.js +31 -6
  549. package/lib/Planetscale/MySQL/MySQLDatabase.js.map +1 -1
  550. package/lib/Planetscale/OAuthClient.d.ts +7 -1
  551. package/lib/Planetscale/OAuthClient.d.ts.map +1 -1
  552. package/lib/Planetscale/OAuthClient.js +51 -4
  553. package/lib/Planetscale/OAuthClient.js.map +1 -1
  554. package/lib/Planetscale/Postgres/PostgresDatabase.d.ts.map +1 -1
  555. package/lib/Planetscale/Postgres/PostgresDatabase.js +30 -5
  556. package/lib/Planetscale/Postgres/PostgresDatabase.js.map +1 -1
  557. package/lib/Platform.d.ts.map +1 -1
  558. package/lib/Platform.js +25 -14
  559. package/lib/Platform.js.map +1 -1
  560. package/lib/Prisma/App.d.ts +80 -0
  561. package/lib/Prisma/App.d.ts.map +1 -0
  562. package/lib/Prisma/App.js +238 -0
  563. package/lib/Prisma/App.js.map +1 -0
  564. package/lib/Prisma/AuthProvider.d.ts +28 -0
  565. package/lib/Prisma/AuthProvider.d.ts.map +1 -0
  566. package/lib/Prisma/AuthProvider.js +131 -0
  567. package/lib/Prisma/AuthProvider.js.map +1 -0
  568. package/lib/Prisma/Branch.d.ts +75 -0
  569. package/lib/Prisma/Branch.d.ts.map +1 -0
  570. package/lib/Prisma/Branch.js +216 -0
  571. package/lib/Prisma/Branch.js.map +1 -0
  572. package/lib/Prisma/Client.d.ts +178 -0
  573. package/lib/Prisma/Client.d.ts.map +1 -0
  574. package/lib/Prisma/Client.js +562 -0
  575. package/lib/Prisma/Client.js.map +1 -0
  576. package/lib/Prisma/Compute.d.ts +583 -0
  577. package/lib/Prisma/Compute.d.ts.map +1 -0
  578. package/lib/Prisma/Compute.js +1543 -0
  579. package/lib/Prisma/Compute.js.map +1 -0
  580. package/lib/Prisma/ComputeArchive.d.ts +63 -0
  581. package/lib/Prisma/ComputeArchive.d.ts.map +1 -0
  582. package/lib/Prisma/ComputeArchive.js +227 -0
  583. package/lib/Prisma/ComputeArchive.js.map +1 -0
  584. package/lib/Prisma/ComputeBuild.d.ts +106 -0
  585. package/lib/Prisma/ComputeBuild.d.ts.map +1 -0
  586. package/lib/Prisma/ComputeBuild.js +987 -0
  587. package/lib/Prisma/ComputeBuild.js.map +1 -0
  588. package/lib/Prisma/ComputeLifecycle.d.ts +84 -0
  589. package/lib/Prisma/ComputeLifecycle.d.ts.map +1 -0
  590. package/lib/Prisma/ComputeLifecycle.js +186 -0
  591. package/lib/Prisma/ComputeLifecycle.js.map +1 -0
  592. package/lib/Prisma/Connect.d.ts +99 -0
  593. package/lib/Prisma/Connect.d.ts.map +1 -0
  594. package/lib/Prisma/Connect.js +187 -0
  595. package/lib/Prisma/Connect.js.map +1 -0
  596. package/lib/Prisma/Connection.d.ts +202 -0
  597. package/lib/Prisma/Connection.d.ts.map +1 -0
  598. package/lib/Prisma/Connection.js +346 -0
  599. package/lib/Prisma/Connection.js.map +1 -0
  600. package/lib/Prisma/CustomDomain.d.ts +81 -0
  601. package/lib/Prisma/CustomDomain.d.ts.map +1 -0
  602. package/lib/Prisma/CustomDomain.js +175 -0
  603. package/lib/Prisma/CustomDomain.js.map +1 -0
  604. package/lib/Prisma/Database.d.ts +208 -0
  605. package/lib/Prisma/Database.d.ts.map +1 -0
  606. package/lib/Prisma/Database.js +405 -0
  607. package/lib/Prisma/Database.js.map +1 -0
  608. package/lib/Prisma/Deployment.d.ts +135 -0
  609. package/lib/Prisma/Deployment.d.ts.map +1 -0
  610. package/lib/Prisma/Deployment.js +348 -0
  611. package/lib/Prisma/Deployment.js.map +1 -0
  612. package/lib/Prisma/EnvironmentVariable.d.ts +89 -0
  613. package/lib/Prisma/EnvironmentVariable.d.ts.map +1 -0
  614. package/lib/Prisma/EnvironmentVariable.js +213 -0
  615. package/lib/Prisma/EnvironmentVariable.js.map +1 -0
  616. package/lib/Prisma/Internal/AppIdentity.d.ts +10 -0
  617. package/lib/Prisma/Internal/AppIdentity.d.ts.map +1 -0
  618. package/lib/Prisma/Internal/AppIdentity.js +6 -0
  619. package/lib/Prisma/Internal/AppIdentity.js.map +1 -0
  620. package/lib/Prisma/Internal/AppPromotion.d.ts +19 -0
  621. package/lib/Prisma/Internal/AppPromotion.d.ts.map +1 -0
  622. package/lib/Prisma/Internal/AppPromotion.js +107 -0
  623. package/lib/Prisma/Internal/AppPromotion.js.map +1 -0
  624. package/lib/Prisma/Internal/ArchivePlatform.d.ts +42 -0
  625. package/lib/Prisma/Internal/ArchivePlatform.d.ts.map +1 -0
  626. package/lib/Prisma/Internal/ArchivePlatform.js +214 -0
  627. package/lib/Prisma/Internal/ArchivePlatform.js.map +1 -0
  628. package/lib/Prisma/Internal/ArtifactFile.d.ts +58 -0
  629. package/lib/Prisma/Internal/ArtifactFile.d.ts.map +1 -0
  630. package/lib/Prisma/Internal/ArtifactFile.js +134 -0
  631. package/lib/Prisma/Internal/ArtifactFile.js.map +1 -0
  632. package/lib/Prisma/Internal/ArtifactUpload.d.ts +5 -0
  633. package/lib/Prisma/Internal/ArtifactUpload.d.ts.map +1 -0
  634. package/lib/Prisma/Internal/ArtifactUpload.js +51 -0
  635. package/lib/Prisma/Internal/ArtifactUpload.js.map +1 -0
  636. package/lib/Prisma/Internal/BundlePaths.d.ts +4 -0
  637. package/lib/Prisma/Internal/BundlePaths.d.ts.map +1 -0
  638. package/lib/Prisma/Internal/BundlePaths.js +16 -0
  639. package/lib/Prisma/Internal/BundlePaths.js.map +1 -0
  640. package/lib/Prisma/Internal/CleanupFailure.d.ts +8 -0
  641. package/lib/Prisma/Internal/CleanupFailure.d.ts.map +1 -0
  642. package/lib/Prisma/Internal/CleanupFailure.js +8 -0
  643. package/lib/Prisma/Internal/CleanupFailure.js.map +1 -0
  644. package/lib/Prisma/Internal/DatabaseSecrets.d.ts +35 -0
  645. package/lib/Prisma/Internal/DatabaseSecrets.d.ts.map +1 -0
  646. package/lib/Prisma/Internal/DatabaseSecrets.js +85 -0
  647. package/lib/Prisma/Internal/DatabaseSecrets.js.map +1 -0
  648. package/lib/Prisma/Internal/DeploymentActions.d.ts +5 -0
  649. package/lib/Prisma/Internal/DeploymentActions.d.ts.map +1 -0
  650. package/lib/Prisma/Internal/DeploymentActions.js +16 -0
  651. package/lib/Prisma/Internal/DeploymentActions.js.map +1 -0
  652. package/lib/Prisma/Internal/DeploymentIdentity.d.ts +8 -0
  653. package/lib/Prisma/Internal/DeploymentIdentity.d.ts.map +1 -0
  654. package/lib/Prisma/Internal/DeploymentIdentity.js +12 -0
  655. package/lib/Prisma/Internal/DeploymentIdentity.js.map +1 -0
  656. package/lib/Prisma/Internal/DeploymentObserve.d.ts +3 -0
  657. package/lib/Prisma/Internal/DeploymentObserve.d.ts.map +1 -0
  658. package/lib/Prisma/Internal/DeploymentObserve.js +2 -0
  659. package/lib/Prisma/Internal/DeploymentObserve.js.map +1 -0
  660. package/lib/Prisma/Internal/EnvName.d.ts +7 -0
  661. package/lib/Prisma/Internal/EnvName.d.ts.map +1 -0
  662. package/lib/Prisma/Internal/EnvName.js +23 -0
  663. package/lib/Prisma/Internal/EnvName.js.map +1 -0
  664. package/lib/Prisma/Internal/HttpClient.d.ts +21 -0
  665. package/lib/Prisma/Internal/HttpClient.d.ts.map +1 -0
  666. package/lib/Prisma/Internal/HttpClient.js +23 -0
  667. package/lib/Prisma/Internal/HttpClient.js.map +1 -0
  668. package/lib/Prisma/Operations.d.ts +143 -0
  669. package/lib/Prisma/Operations.d.ts.map +1 -0
  670. package/lib/Prisma/Operations.js +75 -0
  671. package/lib/Prisma/Operations.js.map +1 -0
  672. package/lib/Prisma/Postgres.d.ts +24 -0
  673. package/lib/Prisma/Postgres.d.ts.map +1 -0
  674. package/lib/Prisma/Postgres.js +23 -0
  675. package/lib/Prisma/Postgres.js.map +1 -0
  676. package/lib/Prisma/PostgresOrigin.d.ts +31 -0
  677. package/lib/Prisma/PostgresOrigin.d.ts.map +1 -0
  678. package/lib/Prisma/PostgresOrigin.js +30 -0
  679. package/lib/Prisma/PostgresOrigin.js.map +1 -0
  680. package/lib/Prisma/PrismaDevDatabase.d.ts +25 -0
  681. package/lib/Prisma/PrismaDevDatabase.d.ts.map +1 -0
  682. package/lib/Prisma/PrismaDevDatabase.js +280 -0
  683. package/lib/Prisma/PrismaDevDatabase.js.map +1 -0
  684. package/lib/Prisma/PrismaEnvironment.d.ts +14 -0
  685. package/lib/Prisma/PrismaEnvironment.d.ts.map +1 -0
  686. package/lib/Prisma/PrismaEnvironment.js +50 -0
  687. package/lib/Prisma/PrismaEnvironment.js.map +1 -0
  688. package/lib/Prisma/PrismaLogs.d.ts +42 -0
  689. package/lib/Prisma/PrismaLogs.d.ts.map +1 -0
  690. package/lib/Prisma/PrismaLogs.js +318 -0
  691. package/lib/Prisma/PrismaLogs.js.map +1 -0
  692. package/lib/Prisma/Project.d.ts +117 -0
  693. package/lib/Prisma/Project.d.ts.map +1 -0
  694. package/lib/Prisma/Project.js +361 -0
  695. package/lib/Prisma/Project.js.map +1 -0
  696. package/lib/Prisma/Providers.d.ts +61 -0
  697. package/lib/Prisma/Providers.d.ts.map +1 -0
  698. package/lib/Prisma/Providers.js +282 -0
  699. package/lib/Prisma/Providers.js.map +1 -0
  700. package/lib/Prisma/Refs.d.ts +19 -0
  701. package/lib/Prisma/Refs.d.ts.map +1 -0
  702. package/lib/Prisma/Refs.js +25 -0
  703. package/lib/Prisma/Refs.js.map +1 -0
  704. package/lib/Prisma/SourceRepository.d.ts +104 -0
  705. package/lib/Prisma/SourceRepository.d.ts.map +1 -0
  706. package/lib/Prisma/SourceRepository.js +221 -0
  707. package/lib/Prisma/SourceRepository.js.map +1 -0
  708. package/lib/Prisma/Types.d.ts +539 -0
  709. package/lib/Prisma/Types.d.ts.map +1 -0
  710. package/lib/Prisma/Types.js +13 -0
  711. package/lib/Prisma/Types.js.map +1 -0
  712. package/lib/Prisma/index.d.ts +25 -0
  713. package/lib/Prisma/index.d.ts.map +1 -0
  714. package/lib/Prisma/index.js +24 -0
  715. package/lib/Prisma/index.js.map +1 -0
  716. package/lib/Provider.d.ts +57 -5
  717. package/lib/Provider.d.ts.map +1 -1
  718. package/lib/Provider.js +54 -30
  719. package/lib/Provider.js.map +1 -1
  720. package/lib/ProviderMode.d.ts +93 -0
  721. package/lib/ProviderMode.d.ts.map +1 -0
  722. package/lib/ProviderMode.js +77 -0
  723. package/lib/ProviderMode.js.map +1 -0
  724. package/lib/Resource.d.ts +8 -0
  725. package/lib/Resource.d.ts.map +1 -1
  726. package/lib/Resource.js +31 -0
  727. package/lib/Resource.js.map +1 -1
  728. package/lib/RuntimeContext.d.ts +7 -0
  729. package/lib/RuntimeContext.d.ts.map +1 -1
  730. package/lib/RuntimeContext.js.map +1 -1
  731. package/lib/Server/Process.d.ts +8 -0
  732. package/lib/Server/Process.d.ts.map +1 -1
  733. package/lib/Server/Process.js +29 -0
  734. package/lib/Server/Process.js.map +1 -1
  735. package/lib/State/InMemoryState.d.ts.map +1 -1
  736. package/lib/State/InMemoryState.js +2 -0
  737. package/lib/State/InMemoryState.js.map +1 -1
  738. package/lib/State/ResourceState.d.ts +18 -0
  739. package/lib/State/ResourceState.d.ts.map +1 -1
  740. package/lib/Sync.d.ts.map +1 -1
  741. package/lib/Sync.js +8 -2
  742. package/lib/Sync.js.map +1 -1
  743. package/lib/Telemetry.d.ts +150 -0
  744. package/lib/Telemetry.d.ts.map +1 -0
  745. package/lib/Telemetry.js +512 -0
  746. package/lib/Telemetry.js.map +1 -0
  747. package/lib/Test/Alchemy.d.ts.map +1 -1
  748. package/lib/Test/Alchemy.js +3 -1
  749. package/lib/Test/Alchemy.js.map +1 -1
  750. package/lib/Test/Core.d.ts +2 -2
  751. package/lib/Test/Core.d.ts.map +1 -1
  752. package/lib/Test/Core.js +1 -8
  753. package/lib/Test/Core.js.map +1 -1
  754. package/lib/Util/Clank.d.ts +11 -6
  755. package/lib/Util/Clank.d.ts.map +1 -1
  756. package/lib/Util/Clank.js +22 -9
  757. package/lib/Util/Clank.js.map +1 -1
  758. package/lib/Util/zip.d.ts +11 -0
  759. package/lib/Util/zip.d.ts.map +1 -1
  760. package/lib/Util/zip.js +30 -0
  761. package/lib/Util/zip.js.map +1 -1
  762. package/lib/index.d.ts +3 -0
  763. package/lib/index.d.ts.map +1 -1
  764. package/lib/index.js +3 -0
  765. package/lib/index.js.map +1 -1
  766. package/package.json +46 -13
  767. package/src/AWS/ApiGateway/common.ts +9 -0
  768. package/src/AWS/Bedrock/LanguageModel.ts +883 -0
  769. package/src/AWS/Bedrock/LanguageModelHttp.ts +36 -0
  770. package/src/AWS/Bedrock/index.ts +2 -0
  771. package/src/AWS/CloudFront/Distribution.ts +116 -6
  772. package/src/AWS/CostExplorer/common.ts +23 -2
  773. package/src/AWS/DataSync/Task.ts +30 -15
  774. package/src/AWS/EC2/Vpc.ts +35 -21
  775. package/src/AWS/EC2/hosted.ts +10 -2
  776. package/src/AWS/ECR/ImageSource.ts +10 -2
  777. package/src/AWS/ECR/Repository.ts +39 -4
  778. package/src/AWS/ECS/Service.ts +322 -22
  779. package/src/AWS/ECS/Task.ts +82 -32
  780. package/src/AWS/EKS/Deployment.ts +10 -2
  781. package/src/AWS/EKS/Job.ts +10 -2
  782. package/src/AWS/Lambda/Function.ts +101 -43
  783. package/src/AWS/Lambda/HttpServer.ts +7 -1
  784. package/src/AWS/Lambda/LayerVersion.ts +490 -0
  785. package/src/AWS/Lambda/MicrovmBundle.ts +10 -2
  786. package/src/AWS/Lambda/index.ts +1 -0
  787. package/src/AWS/Providers.ts +10 -0
  788. package/src/AWS/SES/ActiveReceiptRuleSet.ts +88 -0
  789. package/src/AWS/SES/ReceiptFilter.ts +169 -0
  790. package/src/AWS/SES/ReceiptRule.ts +300 -0
  791. package/src/AWS/SES/ReceiptRuleSet.ts +164 -0
  792. package/src/AWS/SES/SendBounce.ts +44 -0
  793. package/src/AWS/SES/SendBounceHttp.ts +13 -0
  794. package/src/AWS/SES/index.ts +6 -0
  795. package/src/AWS/StateStore/State.ts +159 -42
  796. package/src/Apply.ts +199 -83
  797. package/src/Axiom/Telemetry.ts +119 -0
  798. package/src/Axiom/index.ts +1 -0
  799. package/src/Bundle/Bundle.ts +17 -7
  800. package/src/Bundle/BundleAnalyzerPlugin.ts +9 -4
  801. package/src/Bundle/PurePlugin.ts +19 -9
  802. package/src/Cli/checkVersion.ts +102 -16
  803. package/src/Cli/commands/deploy.ts +3 -14
  804. package/src/Cli/commands/logs.ts +6 -1
  805. package/src/Cli/commands/tail.ts +6 -1
  806. package/src/Cli/main.ts +5 -4
  807. package/src/Cloudflare/AI/Search.ts +4 -18
  808. package/src/Cloudflare/AI/SearchInstance.ts +7 -26
  809. package/src/Cloudflare/ApiToken/AccountApiToken.ts +3 -0
  810. package/src/Cloudflare/Auth/AuthProvider.ts +17 -3
  811. package/src/Cloudflare/Auth/OAuthClient.ts +58 -2
  812. package/src/Cloudflare/Containers/Container.ts +92 -3
  813. package/src/Cloudflare/Containers/ContainerApplication.ts +31 -5
  814. package/src/Cloudflare/Containers/ContainerBundle.ts +10 -2
  815. package/src/Cloudflare/Containers/ContainerProvider.ts +62 -0
  816. package/src/Cloudflare/Credentials.ts +69 -9
  817. package/src/Cloudflare/D1/ApplyMigrations.ts +72 -77
  818. package/src/Cloudflare/D1/Database.ts +154 -2
  819. package/src/Cloudflare/D1/LocalD1Gateway.ts +150 -0
  820. package/src/Cloudflare/D1/QueryDatabaseHttpClient.ts +49 -11
  821. package/src/Cloudflare/D1/QueryDatabaseLocal.ts +44 -2
  822. package/src/Cloudflare/Email/Address.ts +18 -1
  823. package/src/Cloudflare/Email/SendBinding.ts +1 -0
  824. package/src/Cloudflare/Email/SendEmail.ts +13 -0
  825. package/src/Cloudflare/Flagship/App.ts +18 -6
  826. package/src/Cloudflare/KV/LocalKVGateway.ts +86 -0
  827. package/src/Cloudflare/KV/Namespace.ts +47 -1
  828. package/src/Cloudflare/KV/NamespaceLocal.ts +29 -6
  829. package/src/Cloudflare/KV/ReadNamespaceLocal.ts +5 -1
  830. package/src/Cloudflare/KV/ReadWriteNamespaceLocal.ts +5 -1
  831. package/src/Cloudflare/KV/WriteNamespaceLocal.ts +5 -1
  832. package/src/Cloudflare/LocalGateway.ts +86 -0
  833. package/src/Cloudflare/LocalRuntime.ts +21 -1
  834. package/src/Cloudflare/Logs.ts +58 -28
  835. package/src/Cloudflare/Providers.ts +4 -2
  836. package/src/Cloudflare/Queues/Consumer.ts +70 -2
  837. package/src/Cloudflare/Queues/Queue.ts +7 -16
  838. package/src/Cloudflare/Queues/QueueBinding.ts +21 -0
  839. package/src/Cloudflare/Queues/QueueShim.ts +193 -0
  840. package/src/Cloudflare/R2/Bucket.ts +55 -1
  841. package/src/Cloudflare/R2/BucketBinding.ts +17 -3
  842. package/src/Cloudflare/R2/BucketLocal.ts +25 -8
  843. package/src/Cloudflare/R2/LocalR2Gateway.ts +84 -0
  844. package/src/Cloudflare/R2/ReadBucketLocal.ts +7 -1
  845. package/src/Cloudflare/R2/ReadWriteBucketLocal.ts +7 -1
  846. package/src/Cloudflare/R2/WriteBucketLocal.ts +7 -1
  847. package/src/Cloudflare/Ruleset/AccountEntrypoint.ts +5 -1
  848. package/src/Cloudflare/Ruleset/Ruleset.ts +20 -6
  849. package/src/Cloudflare/Rum/Site.ts +11 -4
  850. package/src/Cloudflare/StateStore/Api.ts +1 -1
  851. package/src/Cloudflare/Tunnel/Tunnel.ts +23 -1
  852. package/src/Cloudflare/Website/StaticSite.ts +117 -28
  853. package/src/Cloudflare/Website/Vite.ts +33 -19
  854. package/src/Cloudflare/Workers/Compatibility.ts +27 -7
  855. package/src/Cloudflare/Workers/DurableObject.ts +22 -0
  856. package/src/Cloudflare/Workers/DurableObjectBridge.ts +29 -10
  857. package/src/Cloudflare/Workers/InferEnv.ts +74 -59
  858. package/src/Cloudflare/Workers/LocalWorkerProvider.ts +619 -401
  859. package/src/Cloudflare/Workers/Worker.ts +676 -28
  860. package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +209 -25
  861. package/src/Cloudflare/Workers/WorkerBinding.ts +67 -3
  862. package/src/Cloudflare/Workers/WorkerBridge.ts +26 -4
  863. package/src/Cloudflare/Workers/WorkerBundle.ts +6 -1
  864. package/src/Cloudflare/Workers/WorkerProvider.ts +2269 -277
  865. package/src/Cloudflare/Workflows/WorkflowBridge.ts +31 -13
  866. package/src/Command/Build.ts +8 -8
  867. package/src/Command/Command.ts +217 -42
  868. package/src/Command/Dev.ts +79 -107
  869. package/src/Command/Exec.ts +11 -2
  870. package/src/Command/Memo.ts +27 -3
  871. package/src/Command/Redaction.ts +181 -0
  872. package/src/Destroy.ts +1 -10
  873. package/src/Docker/Container.ts +55 -15
  874. package/src/Docker/Context.ts +236 -0
  875. package/src/Docker/Docker.ts +393 -43
  876. package/src/Docker/Image.ts +28 -7
  877. package/src/Docker/Network.ts +38 -14
  878. package/src/Docker/Providers.ts +16 -1
  879. package/src/Docker/RemoteImage.ts +23 -7
  880. package/src/Docker/Service.ts +1119 -0
  881. package/src/Docker/ServiceImage.ts +331 -0
  882. package/src/Docker/Swarm.ts +226 -0
  883. package/src/Docker/Volume.ts +25 -6
  884. package/src/Docker/index.ts +3 -0
  885. package/src/Http.ts +15 -2
  886. package/src/Local/LocalProvider.ts +518 -0
  887. package/src/Local/ProviderLayer.ts +113 -11
  888. package/src/Local/RpcProvider.ts +10 -5
  889. package/src/Local/RpcProviderProxy.ts +4 -1
  890. package/src/Local/RpcServer.ts +20 -2
  891. package/src/Plan.ts +182 -54
  892. package/src/Planetscale/AuthProvider.ts +15 -2
  893. package/src/Planetscale/Branch.ts +39 -6
  894. package/src/Planetscale/MySQL/MySQLDatabase.ts +34 -6
  895. package/src/Planetscale/OAuthClient.ts +59 -3
  896. package/src/Planetscale/Postgres/PostgresDatabase.ts +33 -5
  897. package/src/Platform.ts +29 -17
  898. package/src/Prisma/App.ts +420 -0
  899. package/src/Prisma/AuthProvider.ts +260 -0
  900. package/src/Prisma/Branch.ts +396 -0
  901. package/src/Prisma/Client.ts +1337 -0
  902. package/src/Prisma/Compute.ts +2876 -0
  903. package/src/Prisma/ComputeArchive.ts +432 -0
  904. package/src/Prisma/ComputeBuild.ts +1652 -0
  905. package/src/Prisma/ComputeLifecycle.ts +391 -0
  906. package/src/Prisma/Connect.ts +410 -0
  907. package/src/Prisma/Connection.ts +626 -0
  908. package/src/Prisma/CustomDomain.ts +363 -0
  909. package/src/Prisma/Database.ts +836 -0
  910. package/src/Prisma/Deployment.ts +655 -0
  911. package/src/Prisma/EnvironmentVariable.ts +401 -0
  912. package/src/Prisma/Internal/AppIdentity.ts +19 -0
  913. package/src/Prisma/Internal/AppPromotion.ts +172 -0
  914. package/src/Prisma/Internal/ArchivePlatform.ts +320 -0
  915. package/src/Prisma/Internal/ArtifactFile.ts +242 -0
  916. package/src/Prisma/Internal/ArtifactUpload.ts +86 -0
  917. package/src/Prisma/Internal/BundlePaths.ts +28 -0
  918. package/src/Prisma/Internal/CleanupFailure.ts +17 -0
  919. package/src/Prisma/Internal/DatabaseSecrets.ts +175 -0
  920. package/src/Prisma/Internal/DeploymentActions.ts +59 -0
  921. package/src/Prisma/Internal/DeploymentIdentity.ts +25 -0
  922. package/src/Prisma/Internal/DeploymentObserve.ts +6 -0
  923. package/src/Prisma/Internal/EnvName.ts +24 -0
  924. package/src/Prisma/Internal/HttpClient.ts +30 -0
  925. package/src/Prisma/Operations.ts +259 -0
  926. package/src/Prisma/Postgres.ts +24 -0
  927. package/src/Prisma/PostgresOrigin.ts +52 -0
  928. package/src/Prisma/PrismaDevDatabase.ts +395 -0
  929. package/src/Prisma/PrismaEnvironment.ts +89 -0
  930. package/src/Prisma/PrismaLogs.ts +434 -0
  931. package/src/Prisma/Project.ts +681 -0
  932. package/src/Prisma/Providers.ts +411 -0
  933. package/src/Prisma/Refs.ts +69 -0
  934. package/src/Prisma/SourceRepository.ts +432 -0
  935. package/src/Prisma/Types.ts +611 -0
  936. package/src/Prisma/index.ts +24 -0
  937. package/src/Provider.ts +155 -39
  938. package/src/ProviderMode.ts +123 -0
  939. package/src/Resource.ts +46 -0
  940. package/src/RuntimeContext.ts +7 -0
  941. package/src/Server/Process.ts +33 -0
  942. package/src/State/InMemoryState.ts +2 -0
  943. package/src/State/ResourceState.ts +18 -0
  944. package/src/Sync.ts +14 -2
  945. package/src/Telemetry.ts +736 -0
  946. package/src/Test/Alchemy.ts +3 -1
  947. package/src/Test/Core.ts +1 -8
  948. package/src/Util/Clank.ts +37 -11
  949. package/src/Util/zip.ts +39 -0
  950. package/src/index.ts +3 -0
@@ -0,0 +1,1543 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Duration from "effect/Duration";
3
+ import * as Exit from "effect/Exit";
4
+ import * as FileSystem from "effect/FileSystem";
5
+ import * as Option from "effect/Option";
6
+ import * as Path from "effect/Path";
7
+ import * as Redacted from "effect/Redacted";
8
+ import * as Result from "effect/Result";
9
+ import * as Schedule from "effect/Schedule";
10
+ import * as Stream from "effect/Stream";
11
+ import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
12
+ import * as HttpClient from "effect/unstable/http/HttpClient";
13
+ import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest";
14
+ import * as ChildProcess from "effect/unstable/process/ChildProcess";
15
+ import { AlchemyContext } from "../AlchemyContext.js";
16
+ import { Unowned } from "../AdoptPolicy.js";
17
+ import * as Bundle from "../Bundle/Bundle.js";
18
+ import { findCwdForBundle } from "../Bundle/TempRoot.js";
19
+ import { createPhysicalName } from "../PhysicalName.js";
20
+ import { isResolved } from "../Diff.js";
21
+ import { HttpServer } from "../Http.js";
22
+ import * as Output from "../Output.js";
23
+ import { Platform } from "../Platform.js";
24
+ import * as Provider from "../Provider.js";
25
+ import { Resource } from "../Resource.js";
26
+ import { RuntimeContext } from "../RuntimeContext.js";
27
+ import { Self } from "../Self.js";
28
+ import { Stack } from "../Stack.js";
29
+ import { sha256Object } from "../Util/sha256.js";
30
+ import { PrismaApiError, PrismaClient, isNotFound, } from "./Client.js";
31
+ import { runBuildCommand, runComputeAutoBuild, } from "./ComputeBuild.js";
32
+ import { createComputeArchive, normalizeEntrypoint } from "./ComputeArchive.js";
33
+ import { destroyApp, destroyDeployment, isConflict, toDeploymentUrl, waitForDeploymentStatus, } from "./ComputeLifecycle.js";
34
+ import { startDeploymentIdempotent, stopDeploymentIdempotent, } from "./Internal/DeploymentActions.js";
35
+ import { ensureAppImmutableIdentity } from "./Internal/AppIdentity.js";
36
+ import { promoteAppObserved, waitForAppDeploymentTarget, } from "./Internal/AppPromotion.js";
37
+ import { normalizeBundleFilePath } from "./Internal/BundlePaths.js";
38
+ import { aggregateCleanupFailure } from "./Internal/CleanupFailure.js";
39
+ import { ensureDeploymentMembership } from "./Internal/DeploymentIdentity.js";
40
+ import { observeDeployment } from "./Internal/DeploymentObserve.js";
41
+ import { tailDeploymentLogs } from "./PrismaLogs.js";
42
+ import { concreteIdsChanged, isInputObject, isPrismaDevId, resolveProjectId, unresolvedProjectIdOf, } from "./Refs.js";
43
+ import { readUploadArtifact, uploadArtifact } from "./Deployment.js";
44
+ const ComputeTypeId = "Prisma.Compute";
45
+ export const isCompute = (value) => typeof value === "object" &&
46
+ value !== null &&
47
+ "Type" in value &&
48
+ value.Type === ComputeTypeId;
49
+ const hasEffectNativeComputeInput = (props) => props.isExternal !== true &&
50
+ (props.main !== undefined || props.exports !== undefined);
51
+ const isEffectNativeCompute = (props) => hasEffectNativeComputeInput(props);
52
+ /**
53
+ * A Prisma Compute deployment resource.
54
+ *
55
+ * Prisma's create-deployment API exposes neither an idempotency key nor a
56
+ * caller-defined recovery key. If the API commits a deployment but its create
57
+ * response is lost before Alchemy persists the returned ID, that deployment
58
+ * can remain orphaned and a later deploy may create another one. Alchemy does
59
+ * not guess that the App's latest deployment is owned, because it could belong
60
+ * to another actor. Use a durable, locked state backend and inspect the App's
61
+ * deployment history after an interrupted create.
62
+ *
63
+ * @section Deploying an App
64
+ * @example Deploy a directory with an entrypoint
65
+ * ```typescript
66
+ * const app = yield* Prisma.Compute("api", {
67
+ * project: project.projectId,
68
+ * path: "./apps/api",
69
+ * entrypoint: "server.ts",
70
+ * port: 3000,
71
+ * });
72
+ * ```
73
+ *
74
+ * @example Deploy an Effect-native HTTP app
75
+ * ```typescript
76
+ * export default Prisma.Compute(
77
+ * "api",
78
+ * {
79
+ * project,
80
+ * appName: "api",
81
+ * main: import.meta.filename,
82
+ * port: 8080,
83
+ * },
84
+ * Effect.gen(function* () {
85
+ * return {
86
+ * fetch: HttpServerResponse.text("ok"),
87
+ * };
88
+ * }),
89
+ * );
90
+ * ```
91
+ *
92
+ * @section Runtime Bindings
93
+ * @example Bind a Prisma Connection
94
+ * ```typescript
95
+ * export default Prisma.Compute(
96
+ * "api",
97
+ * {
98
+ * project,
99
+ * appName: "api",
100
+ * main: import.meta.filename,
101
+ * },
102
+ * Effect.gen(function* () {
103
+ * const db = yield* Prisma.Connect(connection);
104
+ * const sql = yield* SQL.Postgres({ url: db.databaseUrl });
105
+ *
106
+ * return {
107
+ * fetch: Effect.gen(function* () {
108
+ * const users = yield* sql`SELECT * FROM users`;
109
+ * return HttpServerResponse.json(users);
110
+ * }),
111
+ * };
112
+ * }).pipe(Effect.provide(Prisma.ConnectBinding)),
113
+ * );
114
+ * ```
115
+ *
116
+ * @example Build before upload and replace old versions
117
+ * ```typescript
118
+ * const app = yield* Prisma.Compute("api", {
119
+ * project: project.projectId,
120
+ * path: "./apps/api",
121
+ * build: {
122
+ * command: "bun build src/server.ts --target bun --outdir dist",
123
+ * outdir: "dist",
124
+ * entrypoint: "server.js",
125
+ * },
126
+ * port: 8080,
127
+ * env: {
128
+ * DATABASE_URL: database.directConnectionString,
129
+ * },
130
+ * destroyOldDeployment: true,
131
+ * });
132
+ * ```
133
+ *
134
+ * @example Auto-build a framework app
135
+ * ```typescript
136
+ * const app = yield* Prisma.Compute("api", {
137
+ * project: project.projectId,
138
+ * path: "./apps/web",
139
+ * build: "auto",
140
+ * destroyOldDeployment: true,
141
+ * });
142
+ * ```
143
+ *
144
+ * @example Deploy a prebuilt tar.gz artifact
145
+ * ```typescript
146
+ * const app = yield* Prisma.Compute("api", {
147
+ * project: project.projectId,
148
+ * artifactPath: "./dist/app.tar.gz",
149
+ * port: 8080,
150
+ * });
151
+ * ```
152
+ *
153
+ * @section Deployment Health
154
+ * @example Require application readiness before promotion
155
+ * ```typescript
156
+ * const app = yield* Prisma.Compute("api", {
157
+ * project,
158
+ * path: "./apps/api",
159
+ * entrypoint: "server.ts",
160
+ * healthCheck: {
161
+ * path: "/api/health",
162
+ * // Defaults to any 2xx response when omitted.
163
+ * statusCodes: [200, 204],
164
+ * },
165
+ * });
166
+ * ```
167
+ *
168
+ * @section Local Development
169
+ * @example Run locally during alchemy dev
170
+ * ```typescript
171
+ * const app = yield* Prisma.Compute("api", {
172
+ * project: project.projectId,
173
+ * path: "./apps/api",
174
+ * entrypoint: "server.ts",
175
+ * dev: {
176
+ * command: "bun run dev",
177
+ * port: 3000,
178
+ * },
179
+ * });
180
+ * ```
181
+ *
182
+ * @resource
183
+ */
184
+ export const Compute = Platform(ComputeTypeId, {
185
+ createRuntimeContext: (id) => {
186
+ const runners = [];
187
+ const env = {};
188
+ let runtimeContext;
189
+ const run = (effect) => Effect.sync(() => {
190
+ runners.push(effect);
191
+ });
192
+ const serve = (handler) => Effect.sync(() => {
193
+ runners.push(Effect.gen(function* () {
194
+ const httpServer = yield* Effect.serviceOption(HttpServer).pipe(Effect.map(Option.getOrUndefined));
195
+ if (httpServer) {
196
+ yield* httpServer.serve(handler.pipe(Effect.provideService(RuntimeContext, runtimeContext)));
197
+ yield* Effect.never;
198
+ }
199
+ }).pipe(Effect.catch((error) => Effect.die(error))));
200
+ });
201
+ runtimeContext = {
202
+ Type: ComputeTypeId,
203
+ id,
204
+ env,
205
+ set: (bindingId, output) => Effect.sync(() => {
206
+ const key = bindingId.replaceAll(/[^a-zA-Z0-9]/g, "_");
207
+ env[key] = output.pipe(Output.map((value) => Redacted.isRedacted(value)
208
+ ? Redacted.make(JSON.stringify({
209
+ _tag: "Redacted",
210
+ value: Redacted.value(value),
211
+ }))
212
+ : JSON.stringify(value)));
213
+ return key;
214
+ }),
215
+ get: (key) =>
216
+ // Runtime ConfigProvider lookups call back into RuntimeContext.get.
217
+ // Read the process env directly here to avoid re-entering that path.
218
+ Effect.sync(() => {
219
+ const value = process.env[key];
220
+ if (value === undefined) {
221
+ return undefined;
222
+ }
223
+ try {
224
+ const parsed = JSON.parse(value);
225
+ if (parsed !== null &&
226
+ typeof parsed === "object" &&
227
+ parsed._tag === "Redacted" &&
228
+ "value" in parsed) {
229
+ return Redacted.make(parsed.value);
230
+ }
231
+ return parsed;
232
+ }
233
+ catch {
234
+ return value;
235
+ }
236
+ }),
237
+ run,
238
+ serve,
239
+ exports: Effect.sync(() => ({
240
+ default: Effect.all(runners.map((effect) => Effect.forever(effect.pipe(Effect.tapError((error) => Effect.logError(error)), Effect.ignore))), { concurrency: "unbounded" }),
241
+ })),
242
+ };
243
+ return runtimeContext;
244
+ },
245
+ });
246
+ const devProcesses = new Map();
247
+ const stopTrackedDevProcess = Effect.fn(function* (processKey) {
248
+ const existing = devProcesses.get(processKey);
249
+ if (!existing)
250
+ return;
251
+ const running = yield* existing.isRunning;
252
+ if (running) {
253
+ // Keep the handle tracked when termination fails so a later reconcile or
254
+ // destroy can retry instead of losing the only reference to the process.
255
+ yield* existing.kill();
256
+ }
257
+ devProcesses.delete(processKey);
258
+ });
259
+ const projectConsistencySchedule = Schedule.max([
260
+ Schedule.exponential(Duration.millis(500)),
261
+ Schedule.recurs(6),
262
+ ]);
263
+ const isAppProvisioningNotFound = (error) => error instanceof PrismaApiError &&
264
+ error.status === 404 &&
265
+ (error.path.startsWith("/v1/projects/") ||
266
+ error.path === "/v1/apps" ||
267
+ error.path.startsWith("/v1/apps/"));
268
+ const desiredComputeBranchId = Effect.fn(function* (client, projectId, props) {
269
+ if (props.branchId !== undefined && !isPrismaDevId(props.branchId)) {
270
+ return { resolved: true, id: props.branchId };
271
+ }
272
+ const branches = yield* client.listBranches(projectId, props.branchGitName === undefined
273
+ ? { limit: 100 }
274
+ : { gitName: props.branchGitName, limit: 100 });
275
+ const matchingBranches = props.branchGitName === undefined
276
+ ? branches.filter((branch) => branch.isDefault)
277
+ : branches;
278
+ if (matchingBranches.length > 1) {
279
+ return yield* Effect.fail(new Error(props.branchGitName === undefined
280
+ ? `Prisma returned multiple default branches for project '${projectId}'; refusing an ambiguous Compute App match.`
281
+ : `Prisma returned multiple branches named '${props.branchGitName}' in project '${projectId}'; refusing an ambiguous Compute App match.`));
282
+ }
283
+ const branch = matchingBranches[0];
284
+ return branch
285
+ ? { resolved: true, id: branch.id }
286
+ : { resolved: false };
287
+ });
288
+ const createAppName = (id, appName) => appName === undefined ? createPhysicalName({ id }) : Effect.succeed(appName);
289
+ const findApp = Effect.fn(function* (client, projectId, appName, props) {
290
+ const candidates = (yield* client.listApps({
291
+ projectId,
292
+ limit: 100,
293
+ })).filter((app) => app.name === appName);
294
+ if (candidates.length === 0)
295
+ return undefined;
296
+ const branch = yield* desiredComputeBranchId(client, projectId, props);
297
+ if (!branch.resolved)
298
+ return undefined;
299
+ const matches = candidates.filter((app) => app.branchId === branch.id);
300
+ if (matches.length > 1) {
301
+ return yield* Effect.fail(new Error(`Prisma returned multiple Apps named '${appName}' on branch '${branch.id}' in project '${projectId}'; refusing an ambiguous ownership match.`));
302
+ }
303
+ return matches[0];
304
+ });
305
+ const createApp = (client, projectId, props, branchId) => client.createApp({
306
+ projectId,
307
+ displayName: props.appName,
308
+ regionId: props.regionId,
309
+ branchId,
310
+ branchGitName: undefined,
311
+ });
312
+ const plainEnv = (env = {}) => Object.fromEntries(Object.entries(env).flatMap(([key, value]) => value === undefined
313
+ ? []
314
+ : [[key, Redacted.isRedacted(value) ? Redacted.value(value) : value]]));
315
+ const persistedArtifactHashValue = (value) => (Redacted.isRedacted(value) ? Redacted.value(value) : value);
316
+ const managedEnvKeys = (env = {}) => Object.entries(plainEnv(env))
317
+ .flatMap(([key, value]) => (value === null ? [] : [key]))
318
+ .sort();
319
+ const ENV_KEY_PATTERN = /^[A-Z_][A-Z0-9_]*$/;
320
+ const ENV_VALUE_MAX_BYTES = 8 * 1024;
321
+ const EXPORT_IDENTIFIER_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
322
+ const computeEnvValue = (value) => Redacted.isRedacted(value) ? Redacted.value(value) : value;
323
+ const validateComputeEnvironmentKey = (key) => Effect.gen(function* () {
324
+ if (key.length < 1 || key.length > 256 || !ENV_KEY_PATTERN.test(key)) {
325
+ return yield* Effect.fail(new Error(`Prisma environment variable key '${key}' must match POSIX env-var key shape: [A-Z_][A-Z0-9_]* and be at most 256 characters.`));
326
+ }
327
+ });
328
+ const validateComputeEnvironmentWrite = (key, value) => Effect.gen(function* () {
329
+ yield* validateComputeEnvironmentKey(key);
330
+ const raw = computeEnvValue(value);
331
+ if (raw.length === 0) {
332
+ return yield* Effect.fail(new Error(`Prisma environment variable '${key}' value must be non-empty.`));
333
+ }
334
+ const byteLength = yield* Effect.sync(() => new TextEncoder().encode(raw).byteLength);
335
+ if (byteLength > ENV_VALUE_MAX_BYTES) {
336
+ return yield* Effect.fail(new Error(`Prisma environment variable '${key}' value exceeds ${ENV_VALUE_MAX_BYTES} bytes.`));
337
+ }
338
+ });
339
+ const validateComputeHealthCheck = (healthCheck) => Effect.gen(function* () {
340
+ if (healthCheck === undefined)
341
+ return;
342
+ if (!healthCheck.path.startsWith("/") ||
343
+ healthCheck.path.startsWith("//") ||
344
+ healthCheck.path.includes("\\") ||
345
+ /\s/.test(healthCheck.path)) {
346
+ return yield* Effect.fail(new Error("healthCheck.path must be an absolute application path beginning with one '/'."));
347
+ }
348
+ if (healthCheck.statusCodes !== undefined &&
349
+ healthCheck.statusCodes.length === 0) {
350
+ return yield* Effect.fail(new Error("healthCheck.statusCodes must contain at least one status."));
351
+ }
352
+ for (const status of healthCheck.statusCodes ?? []) {
353
+ if (!Number.isInteger(status) || status < 100 || status > 599) {
354
+ return yield* Effect.fail(new Error("healthCheck.statusCodes must contain HTTP status integers from 100 through 599."));
355
+ }
356
+ }
357
+ });
358
+ const validateComputeProps = (props) => Effect.gen(function* () {
359
+ yield* validateComputeHealthCheck(props.healthCheck);
360
+ if (props.healthCheck !== undefined && props.verifyUrl === false) {
361
+ return yield* Effect.fail(new Error("healthCheck cannot be combined with verifyUrl: false."));
362
+ }
363
+ if (props.healthCheck !== undefined && props.start === false) {
364
+ return yield* Effect.fail(new Error("healthCheck requires start to be enabled."));
365
+ }
366
+ for (const [name, value] of [
367
+ ["timeoutSeconds", props.timeoutSeconds],
368
+ ["pollIntervalMs", props.pollIntervalMs],
369
+ ["urlReadinessTimeoutSeconds", props.urlReadinessTimeoutSeconds],
370
+ ]) {
371
+ if (value !== undefined && (!Number.isFinite(value) || value <= 0)) {
372
+ return yield* Effect.fail(new Error(`${name} must be a positive finite number.`));
373
+ }
374
+ }
375
+ for (const [name, value] of [
376
+ ["port", props.port],
377
+ ["dev.port", props.dev?.port],
378
+ ]) {
379
+ if (value !== undefined &&
380
+ (!Number.isInteger(value) || value < 1 || value > 65_535)) {
381
+ return yield* Effect.fail(new Error(`${name} must be an integer between 1 and 65535.`));
382
+ }
383
+ }
384
+ for (const [key, value] of Object.entries(props.env ?? {})) {
385
+ if (value === undefined)
386
+ continue;
387
+ if (value === null) {
388
+ yield* validateComputeEnvironmentKey(key);
389
+ }
390
+ else {
391
+ yield* validateComputeEnvironmentWrite(key, value);
392
+ }
393
+ }
394
+ if ((props.skipPromote ?? false) && (props.destroyOldDeployment ?? false)) {
395
+ return yield* Effect.fail(new Error("destroyOldDeployment cannot be combined with skipPromote because the previous deployment stays active when promotion is skipped."));
396
+ }
397
+ if (props.start === false && !(props.skipPromote ?? false)) {
398
+ return yield* Effect.fail(new Error("start: false requires skipPromote: true because Prisma Compute promotion requires a running deployment."));
399
+ }
400
+ if (props.branchId !== undefined && props.branchGitName !== undefined) {
401
+ return yield* Effect.fail(new Error("branchId and branchGitName are mutually exclusive."));
402
+ }
403
+ if (props.branchId === null || props.branchGitName === null) {
404
+ return yield* Effect.fail(new Error("Prisma.Compute requires an attached branch because deployment creation resolves environment variables from the App branch. Omit branchGitName to use the project's default branch, or set branchId/branchGitName."));
405
+ }
406
+ if ((props.skipCodeUpload ?? false) && props.artifactPath !== undefined) {
407
+ return yield* Effect.fail(new Error("skipCodeUpload cannot be combined with artifactPath."));
408
+ }
409
+ if ((props.skipCodeUpload ?? false) && props.build !== undefined) {
410
+ return yield* Effect.fail(new Error("skipCodeUpload cannot be combined with build."));
411
+ }
412
+ if (hasEffectNativeComputeInput(props)) {
413
+ const handler = props.handler ?? "default";
414
+ if (handler !== "default" && !EXPORT_IDENTIFIER_PATTERN.test(handler)) {
415
+ return yield* Effect.fail(new Error("Effect-native Prisma Compute handler must be `default` or a valid JavaScript export identifier."));
416
+ }
417
+ if (props.main === undefined) {
418
+ return yield* Effect.fail(new Error("Effect-native Prisma Compute apps require `main`. Set `main: import.meta.filename`."));
419
+ }
420
+ if (props.artifactPath !== undefined) {
421
+ return yield* Effect.fail(new Error("Effect-native Prisma Compute apps cannot use artifactPath."));
422
+ }
423
+ if (props.build !== undefined) {
424
+ return yield* Effect.fail(new Error("Effect-native Prisma Compute apps cannot use build."));
425
+ }
426
+ if (props.skipCodeUpload) {
427
+ return yield* Effect.fail(new Error("Effect-native Prisma Compute apps cannot skip code upload."));
428
+ }
429
+ }
430
+ });
431
+ const processEnv = (env = {}) => Object.fromEntries(Object.entries(env).flatMap(([key, value]) => value === undefined || value === null
432
+ ? []
433
+ : [[key, Redacted.isRedacted(value) ? Redacted.value(value) : value]]));
434
+ const isPrismaEdgeServiceNotFound = (status, body) => status === 404 &&
435
+ (body.includes("There is no service on this URL") ||
436
+ body.includes("<title>Service not found</title>"));
437
+ const URL_READINESS_BODY_PREFIX_BYTES = 64 * 1024;
438
+ const readResponseBodyPrefix = (response) => Effect.gen(function* () {
439
+ const chunks = [];
440
+ let bytes = 0;
441
+ yield* Stream.runForEachWhile(response.stream, (chunk) => Effect.sync(() => {
442
+ const remaining = URL_READINESS_BODY_PREFIX_BYTES - bytes;
443
+ if (remaining <= 0)
444
+ return false;
445
+ const kept = chunk.byteLength > remaining ? chunk.slice(0, remaining) : chunk;
446
+ chunks.push(kept);
447
+ bytes += kept.byteLength;
448
+ return bytes < URL_READINESS_BODY_PREFIX_BYTES;
449
+ }));
450
+ const prefix = new Uint8Array(bytes);
451
+ let offset = 0;
452
+ for (const chunk of chunks) {
453
+ prefix.set(chunk, offset);
454
+ offset += chunk.byteLength;
455
+ }
456
+ return new TextDecoder().decode(prefix);
457
+ });
458
+ export const waitForDeploymentUrl = Effect.fn(function* (url, props) {
459
+ yield* validateComputeHealthCheck(props.healthCheck);
460
+ if (props.healthCheck !== undefined && props.verifyUrl === false) {
461
+ return yield* Effect.fail(new Error("healthCheck cannot be combined with verifyUrl: false."));
462
+ }
463
+ if (props.verifyUrl === false)
464
+ return;
465
+ if (!url) {
466
+ return yield* Effect.fail(new Error(props.healthCheck === undefined
467
+ ? "Prisma Compute did not return a public URL for readiness verification."
468
+ : "Prisma Compute did not return a public URL for the configured healthCheck."));
469
+ }
470
+ const httpOption = yield* Effect.serviceOption(HttpClient.HttpClient);
471
+ if (Option.isNone(httpOption)) {
472
+ return props.healthCheck === undefined
473
+ ? undefined
474
+ : yield* Effect.fail(new Error("Prisma Compute healthCheck requires an HTTP client service."));
475
+ }
476
+ const http = httpOption.value;
477
+ const probeUrl = props.healthCheck === undefined
478
+ ? url
479
+ : new URL(props.healthCheck.path, url).toString();
480
+ const acceptsStatus = (status) => props.healthCheck === undefined ||
481
+ (props.healthCheck.statusCodes === undefined
482
+ ? status >= 200 && status <= 299
483
+ : props.healthCheck.statusCodes.includes(status));
484
+ const timeoutSeconds = props.urlReadinessTimeoutSeconds ?? 60;
485
+ const intervalMs = props.pollIntervalMs ?? 1_000;
486
+ if (!Number.isFinite(timeoutSeconds) || timeoutSeconds <= 0) {
487
+ return yield* Effect.fail(new Error("urlReadinessTimeoutSeconds must be a positive finite number."));
488
+ }
489
+ if (!Number.isFinite(intervalMs) || intervalMs <= 0) {
490
+ return yield* Effect.fail(new Error("pollIntervalMs must be a positive finite number."));
491
+ }
492
+ const timeoutMs = timeoutSeconds * 1_000;
493
+ const startedAt = yield* Effect.sync(() => Date.now());
494
+ let lastStatus;
495
+ let lastBody = "";
496
+ while (true) {
497
+ const beforeRequest = yield* Effect.sync(() => Date.now());
498
+ const remainingBeforeRequest = timeoutMs - (beforeRequest - startedAt);
499
+ if (remainingBeforeRequest <= 0) {
500
+ return yield* Effect.fail(deploymentUrlTimeoutError(probeUrl, lastStatus, lastBody));
501
+ }
502
+ const requestTimeoutMs = Math.min(5_000, remainingBeforeRequest);
503
+ const response = yield* http.execute(HttpClientRequest.get(probeUrl)).pipe(Effect.provideService(FetchHttpClient.RequestInit, {
504
+ redirect: "manual",
505
+ }), Effect.timeoutOption(Duration.millis(requestTimeoutMs)), Effect.map(Option.getOrUndefined), Effect.catch(() => Effect.succeed(undefined)));
506
+ if (response) {
507
+ lastStatus = response.status;
508
+ // Without an application health check, any non-404 response proves that
509
+ // edge routing is live. A configured health check must also match its
510
+ // status contract. Do not consume non-404 bodies: application responses
511
+ // may intentionally stream.
512
+ if (response.status !== 404 && acceptsStatus(response.status)) {
513
+ return;
514
+ }
515
+ const beforeBody = yield* Effect.sync(() => Date.now());
516
+ const remainingBeforeBody = timeoutMs - (beforeBody - startedAt);
517
+ if (remainingBeforeBody > 0) {
518
+ const bodyPrefix = yield* readResponseBodyPrefix(response).pipe(Effect.timeoutOption(Duration.millis(Math.min(2_000, remainingBeforeBody))), Effect.catch(() => Effect.succeed(Option.none())));
519
+ if (Option.isSome(bodyPrefix)) {
520
+ lastBody = bodyPrefix.value;
521
+ if (!isPrismaEdgeServiceNotFound(response.status, lastBody) &&
522
+ acceptsStatus(response.status)) {
523
+ return;
524
+ }
525
+ }
526
+ }
527
+ }
528
+ const elapsed = yield* Effect.sync(() => Date.now() - startedAt);
529
+ if (elapsed >= timeoutMs) {
530
+ return yield* Effect.fail(deploymentUrlTimeoutError(probeUrl, lastStatus, lastBody));
531
+ }
532
+ yield* Effect.sleep(Duration.millis(Math.min(intervalMs, timeoutMs - elapsed)));
533
+ }
534
+ });
535
+ const deploymentUrlTimeoutError = (url, lastStatus, lastBody) => new Error([
536
+ `Timed out waiting for Prisma Compute URL '${url}' to become reachable.`,
537
+ lastStatus
538
+ ? `Last response: HTTP ${lastStatus}.`
539
+ : "No HTTP response was received.",
540
+ lastBody.includes("There is no service on this URL")
541
+ ? "The Prisma edge returned: There is no service on this URL."
542
+ : undefined,
543
+ ]
544
+ .filter((line) => line !== undefined)
545
+ .join(" "));
546
+ const isAutoBuild = (build) => build === "auto" ||
547
+ (typeof build === "object" &&
548
+ build !== null &&
549
+ "type" in build &&
550
+ build.type === "auto");
551
+ const readPackageMain = Effect.fn(function* (directory) {
552
+ const fs = yield* FileSystem.FileSystem;
553
+ const path = yield* Path.Path;
554
+ const text = yield* fs
555
+ .readFileString(path.join(directory, "package.json"))
556
+ .pipe(Effect.catchIf((error) => error._tag === "PlatformError" && error.reason._tag === "NotFound", () => Effect.succeed(undefined)));
557
+ if (!text)
558
+ return undefined;
559
+ return yield* Effect.try({
560
+ try: () => {
561
+ const parsed = JSON.parse(text);
562
+ return typeof parsed.main === "string" ? parsed.main : undefined;
563
+ },
564
+ catch: (cause) => new Error(`Failed to parse package.json in ${directory}: ${cause}`),
565
+ });
566
+ });
567
+ const writeBundleDirectory = Effect.fn(function* (bundle) {
568
+ const fs = yield* FileSystem.FileSystem;
569
+ const path = yield* Path.Path;
570
+ if (bundle.files.length === 0) {
571
+ return yield* Effect.fail(new Error("Effect-native Compute bundler produced no output files."));
572
+ }
573
+ const normalizedFiles = yield* Effect.forEach(bundle.files, (file) => normalizeBundleFilePath(file.path).pipe(Effect.map((normalizedPath) => ({ file, normalizedPath }))));
574
+ const seen = new Set();
575
+ for (const { normalizedPath } of normalizedFiles) {
576
+ if (seen.has(normalizedPath)) {
577
+ return yield* Effect.fail(new Error(`Effect-native Compute bundler produced duplicate output path '${normalizedPath}'.`));
578
+ }
579
+ seen.add(normalizedPath);
580
+ }
581
+ const directory = yield* fs.makeTempDirectory({
582
+ prefix: "alchemy-prisma-compute-",
583
+ });
584
+ return yield* Effect.gen(function* () {
585
+ for (const { file, normalizedPath } of normalizedFiles) {
586
+ const target = path.join(directory, normalizedPath);
587
+ yield* fs.makeDirectory(path.dirname(target), { recursive: true });
588
+ if (typeof file.content === "string") {
589
+ yield* fs.writeFileString(target, file.content);
590
+ }
591
+ else {
592
+ yield* fs.writeFile(target, file.content);
593
+ }
594
+ }
595
+ return {
596
+ directory,
597
+ entrypoint: normalizedFiles[0].normalizedPath,
598
+ cleanup: fs
599
+ .remove(directory, { recursive: true })
600
+ .pipe(Effect.catch(() => Effect.void)),
601
+ };
602
+ }).pipe(Effect.onError(() => fs.remove(directory, { recursive: true }).pipe(Effect.ignore)));
603
+ });
604
+ const bundleEffectCompute = Effect.fn(function* (props) {
605
+ if (!props.main) {
606
+ return yield* Effect.fail(new Error("Effect-native Prisma Compute apps require `main`. Set `main: import.meta.filename`."));
607
+ }
608
+ const fs = yield* FileSystem.FileSystem;
609
+ const stack = yield* Effect.serviceOption(Stack).pipe(Effect.map(Option.getOrElse(() => ({
610
+ name: "alchemy",
611
+ stage: "dev",
612
+ bindings: {},
613
+ resources: {},
614
+ }))));
615
+ const virtualEntryPlugin = yield* Bundle.virtualEntryPlugin;
616
+ const realMain = yield* fs.realPath(props.main);
617
+ const cwd = yield* findCwdForBundle(realMain);
618
+ const handler = props.handler ?? "default";
619
+ const defaultPort = props.port ?? 8080;
620
+ const importEntrypoint = handler === "default"
621
+ ? "import entrypoint"
622
+ : `import { ${handler} as entrypoint }`;
623
+ const bundle = yield* Bundle.build({
624
+ ...props.bundle?.input,
625
+ input: realMain,
626
+ cwd,
627
+ platform: "node",
628
+ plugins: [
629
+ props.bundle?.input?.plugins,
630
+ virtualEntryPlugin((importPath) => `
631
+ import { BunServices } from "@effect/platform-bun";
632
+ import { BunHttpServer } from "alchemy/Http";
633
+ import { Stack } from "alchemy/Stack";
634
+ import { Stage } from "alchemy/Stage";
635
+ import { makeEntrypointLayer } from "alchemy/Runtime";
636
+ import * as ConfigProvider from "effect/ConfigProvider";
637
+ import * as Context from "effect/Context";
638
+ import * as Effect from "effect/Effect";
639
+ import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
640
+ import * as Layer from "effect/Layer";
641
+ import * as Logger from "effect/Logger";
642
+ import { MinimumLogLevel } from "effect/References";
643
+
644
+ ${importEntrypoint} from ${JSON.stringify(importPath)};
645
+
646
+ process.env.PORT ??= ${JSON.stringify(String(defaultPort))};
647
+
648
+ const tag = Context.Service("${Self.key}");
649
+ const layer = makeEntrypointLayer(tag, entrypoint);
650
+
651
+ const platform = Layer.mergeAll(
652
+ BunServices.layer,
653
+ FetchHttpClient.layer,
654
+ Logger.layer([Logger.consolePretty()]),
655
+ );
656
+
657
+ const stack = Layer.mergeAll(
658
+ Layer.succeed(Stack, {
659
+ name: ${JSON.stringify(stack.name)},
660
+ stage: ${JSON.stringify(stack.stage)},
661
+ bindings: {},
662
+ resources: {},
663
+ }),
664
+ Layer.succeed(Stage, ${JSON.stringify(stack.stage)}),
665
+ );
666
+
667
+ const program = tag.pipe(
668
+ Effect.flatMap((app) => app.RuntimeContext.exports),
669
+ Effect.flatMap((exports) => exports.default),
670
+ Effect.provide(
671
+ layer.pipe(
672
+ Layer.provideMerge(stack),
673
+ Layer.provideMerge(BunHttpServer({ hostname: "0.0.0.0" })),
674
+ Layer.provideMerge(platform),
675
+ Layer.provideMerge(
676
+ Layer.succeed(
677
+ ConfigProvider.ConfigProvider,
678
+ ConfigProvider.orElse(
679
+ ConfigProvider.fromUnknown({ ALCHEMY_PHASE: "runtime" }),
680
+ ConfigProvider.fromEnv(),
681
+ ),
682
+ ),
683
+ ),
684
+ Layer.provideMerge(
685
+ Layer.succeed(
686
+ MinimumLogLevel,
687
+ process.env.DEBUG ? "Debug" : "Info",
688
+ ),
689
+ ),
690
+ ),
691
+ ),
692
+ Effect.scoped,
693
+ );
694
+
695
+ console.log("Prisma Compute bootstrap starting...");
696
+ await Effect.runPromise(program).catch((error) => {
697
+ console.error("Prisma Compute bootstrap failed:", error);
698
+ process.exit(1);
699
+ });
700
+ `),
701
+ ],
702
+ checks: {
703
+ unresolvedImport: false,
704
+ ineffectiveDynamicImport: false,
705
+ },
706
+ }, {
707
+ ...props.bundle?.output,
708
+ format: "esm",
709
+ sourcemap: props.bundle?.output?.sourcemap ?? "hidden",
710
+ minify: props.bundle?.output?.minify ?? true,
711
+ entryFileNames: "index.js",
712
+ }, props.bundle?.extra);
713
+ const artifact = yield* writeBundleDirectory(bundle);
714
+ const file = yield* createComputeArchive({
715
+ directory: artifact.directory,
716
+ entrypoint: artifact.entrypoint,
717
+ ignore: props.archiveIgnore,
718
+ output: "file",
719
+ }).pipe(Effect.ensuring(artifact.cleanup));
720
+ return {
721
+ file,
722
+ bundleHash: bundle.hash,
723
+ };
724
+ });
725
+ const resolveArtifact = Effect.fn(function* (props) {
726
+ const env = plainEnv(props.env);
727
+ const envClass = props.envClass ?? "production";
728
+ const defaultPort = props.port ?? 8080;
729
+ if (isEffectNativeCompute(props)) {
730
+ if (props.artifactPath !== undefined) {
731
+ return yield* Effect.fail(new Error("Effect-native Prisma Compute apps cannot use artifactPath."));
732
+ }
733
+ if (props.skipCodeUpload) {
734
+ return yield* Effect.fail(new Error("Effect-native Prisma Compute apps cannot skip code upload."));
735
+ }
736
+ if (props.build !== undefined) {
737
+ return yield* Effect.fail(new Error("Effect-native Prisma Compute apps cannot use build."));
738
+ }
739
+ const artifact = yield* bundleEffectCompute(props);
740
+ return {
741
+ file: artifact.file,
742
+ hash: yield* sha256Object({
743
+ bundle: artifact.bundleHash,
744
+ env,
745
+ envClass,
746
+ port: defaultPort,
747
+ }),
748
+ port: defaultPort,
749
+ };
750
+ }
751
+ if (props.skipCodeUpload) {
752
+ return {
753
+ file: undefined,
754
+ hash: yield* sha256Object({
755
+ skipCodeUpload: true,
756
+ env,
757
+ envClass,
758
+ port: defaultPort,
759
+ }),
760
+ port: defaultPort,
761
+ };
762
+ }
763
+ if (props.artifactPath !== undefined) {
764
+ const file = yield* readUploadArtifact({
765
+ artifactPath: props.artifactPath,
766
+ output: "file",
767
+ });
768
+ return {
769
+ file: file,
770
+ hash: yield* sha256Object({
771
+ artifact: file.sha256,
772
+ env,
773
+ envClass,
774
+ port: defaultPort,
775
+ }),
776
+ port: defaultPort,
777
+ };
778
+ }
779
+ const path = yield* Path.Path;
780
+ const appPath = path.resolve(props.path ?? ".");
781
+ let directory = appPath;
782
+ let entrypoint = props.entrypoint;
783
+ let port = defaultPort;
784
+ if (isAutoBuild(props.build)) {
785
+ const auto = props.build === "auto" ? undefined : props.build;
786
+ const artifact = yield* runComputeAutoBuild({
787
+ appPath,
788
+ entrypoint,
789
+ framework: auto?.framework,
790
+ env: auto?.env,
791
+ outputLimitBytes: auto?.outputLimitBytes,
792
+ timeoutSeconds: auto?.timeoutSeconds,
793
+ });
794
+ const file = yield* createComputeArchive({
795
+ directory: artifact.directory,
796
+ entrypoint: artifact.entrypoint,
797
+ ignore: props.archiveIgnore,
798
+ output: "file",
799
+ }).pipe(Effect.ensuring(artifact.cleanup));
800
+ port = props.port ?? artifact.defaultPort ?? 8080;
801
+ return {
802
+ file,
803
+ hash: yield* sha256Object({
804
+ artifact: file.sha256,
805
+ env,
806
+ envClass,
807
+ port,
808
+ }),
809
+ port,
810
+ };
811
+ }
812
+ if (props.build) {
813
+ const cwd = props.build.cwd ? path.resolve(props.build.cwd) : appPath;
814
+ yield* runBuildCommand({
815
+ command: props.build.command,
816
+ cwd,
817
+ env: processEnv(props.build.env),
818
+ outputLimitBytes: props.build.outputLimitBytes,
819
+ timeoutSeconds: props.build.timeoutSeconds,
820
+ });
821
+ directory = path.resolve(cwd, props.build.outdir);
822
+ entrypoint = props.build.entrypoint ?? entrypoint;
823
+ }
824
+ entrypoint ??= yield* readPackageMain(directory);
825
+ if (!entrypoint) {
826
+ return yield* Effect.fail(new Error("Prisma Compute app entrypoint is required. Set `entrypoint` or package.json `main`."));
827
+ }
828
+ const normalizedEntrypoint = yield* normalizeEntrypoint(entrypoint);
829
+ const file = yield* createComputeArchive({
830
+ directory,
831
+ entrypoint: normalizedEntrypoint,
832
+ ignore: props.archiveIgnore,
833
+ output: "file",
834
+ });
835
+ return {
836
+ file,
837
+ hash: yield* sha256Object({
838
+ artifact: file.sha256,
839
+ env,
840
+ envClass,
841
+ port,
842
+ }),
843
+ port,
844
+ };
845
+ });
846
+ const findExistingApp = Effect.fn(function* (client, output) {
847
+ const appId = output?.appId && !isPrismaDevId(output.appId) ? output.appId : undefined;
848
+ return appId
849
+ ? yield* client
850
+ .getApp(appId)
851
+ .pipe(Effect.catchIf(isNotFound, () => Effect.succeed(undefined)))
852
+ : undefined;
853
+ });
854
+ const ensureApp = Effect.fn(function* (client, projectId, props, output, observedApp) {
855
+ let app = observedApp ?? (yield* findExistingApp(client, output));
856
+ const branch = yield* desiredComputeBranchId(client, projectId, props);
857
+ if (!branch.resolved) {
858
+ return yield* Effect.fail(new Error(props.branchGitName === undefined
859
+ ? `Prisma project '${projectId}' has no default branch to attach Compute App '${props.appName}'. Create or promote a default branch, or specify branchId/branchGitName.`
860
+ : `Prisma project '${projectId}' has no branch named '${props.branchGitName}' to attach Compute App '${props.appName}'.`));
861
+ }
862
+ let createdApp = false;
863
+ if (!app) {
864
+ const result = yield* createApp(client, projectId, props, branch.id).pipe(Effect.map((app) => ({ app, created: true })), Effect.catchIf(isConflict, (conflict) => findApp(client, projectId, props.appName, props).pipe(Effect.flatMap((app) => app && output?.appId !== undefined && app.id === output.appId
865
+ ? Effect.succeed({ app, created: false })
866
+ : Effect.fail(new Error(`Prisma App '${props.appName}' already exists on the requested branch but is not owned by this Compute resource. Import it with explicit adoption or choose a different App name.`, { cause: conflict }))))));
867
+ app = result.app;
868
+ createdApp = result.created;
869
+ }
870
+ yield* ensureAppImmutableIdentity(app, projectId, props.regionId ?? output?.regionId ?? app.region.id);
871
+ if (app.name !== props.appName || app.branchId !== branch.id) {
872
+ app = yield* client.updateApp(app.id, {
873
+ displayName: props.appName,
874
+ branchId: branch.id,
875
+ branchGitName: undefined,
876
+ });
877
+ }
878
+ return { app, created: createdApp };
879
+ });
880
+ const ensureSkipCodeUploadCanFork = (props, app) => Effect.gen(function* () {
881
+ if (!(props.skipCodeUpload ?? false))
882
+ return;
883
+ if (app?.latestDeploymentId)
884
+ return;
885
+ return yield* Effect.fail(new Error("skipCodeUpload requires an existing Prisma deployment to fork from. Upload and start a deployment first, or remove skipCodeUpload."));
886
+ });
887
+ const findEnvironmentVariable = (client, projectId, cls, key, branchId) => client
888
+ .listEnvironmentVariables({
889
+ projectId,
890
+ class: cls,
891
+ key,
892
+ ...(branchId ? { branchId } : {}),
893
+ limit: 100,
894
+ })
895
+ .pipe(Effect.map((variables) => variables.find((variable) => variable.branchId === (branchId ?? null))));
896
+ const systemManagedEnvironmentVariableError = (key) => new Error(`Prisma environment variable '${key}' is managed by Prisma and cannot be managed by Alchemy.`);
897
+ const ensureUserManagedEnvironmentVariable = (variable) => Effect.gen(function* () {
898
+ if (variable.isManagedBySystem) {
899
+ return yield* Effect.fail(systemManagedEnvironmentVariableError(variable.key));
900
+ }
901
+ });
902
+ const environmentVariableOwnershipError = (key, variableId) => new Error(`Prisma environment variable '${key}' (${variableId}) already exists in this branch/class scope but is not owned by this Compute resource. It may be foreign or left by an interrupted prior Compute deploy; the Management API exposes no ownership marker or plaintext value that would make takeover safe. Use one standalone Prisma.EnvironmentVariable resource as the independently manageable owner, choose a different key, explicitly adopt that resource, or remove the existing variable before deploying.`);
903
+ const environmentScope = (cls, branchId) => ({
904
+ class: cls,
905
+ branchId: branchId ?? null,
906
+ });
907
+ const sameEnvironmentScope = (left, right) => left.class === right.class && left.branchId === right.branchId;
908
+ const resolveComputeEnvironmentScope = Effect.fn(function* (client, app, props) {
909
+ if (!app.branchId) {
910
+ return yield* Effect.fail(new Error("Prisma.Compute requires an attached branch because deployment creation resolves environment variables from the App branch."));
911
+ }
912
+ const branch = yield* client.getBranch(app.branchId);
913
+ const inferredClass = branch.role;
914
+ if (props.envClass !== undefined && props.envClass !== inferredClass) {
915
+ return yield* Effect.fail(new Error(`Prisma.Compute envClass '${props.envClass}' does not match attached branch role '${inferredClass}'. Omit envClass to let Alchemy infer the correct environment variable scope.`));
916
+ }
917
+ return environmentScope(inferredClass, inferredClass === "preview" ? app.branchId : null);
918
+ });
919
+ const rollbackCreatedEnvironmentVariables = Effect.fn(function* (client, createdIds, originalError) {
920
+ if (createdIds.length === 0) {
921
+ return yield* Effect.fail(originalError);
922
+ }
923
+ const cleanupErrors = [];
924
+ for (const created of [...createdIds].reverse()) {
925
+ const result = yield* Effect.result(client
926
+ .deleteEnvironmentVariable(created.id)
927
+ .pipe(Effect.catchIf(isNotFound, () => Effect.void)));
928
+ if (Result.isFailure(result)) {
929
+ cleanupErrors.push(result.failure);
930
+ }
931
+ }
932
+ if (cleanupErrors.length > 0) {
933
+ return yield* Effect.fail(new AggregateError([originalError, ...cleanupErrors], `Failed to roll back newly created Prisma environment variables after reconcile failed. Manual cleanup: ${createdIds.map(({ id }) => `DELETE /v1/environment-variables/${id}`).join(", ")}.`));
934
+ }
935
+ return yield* Effect.fail(originalError);
936
+ });
937
+ const syncComputeEnvironmentInternal = Effect.fn(function* (client, projectId, cls, env = {}, branchId, ownedIds = {}) {
938
+ const synced = [];
939
+ const deleted = [];
940
+ const nextOwnedIds = {};
941
+ const createdIds = [];
942
+ const plans = [];
943
+ // Observe and validate the entire scope before the first write. In
944
+ // particular, a foreign/system-owned key discovered late in the input must
945
+ // not leave earlier keys partially created.
946
+ for (const [key, value] of Object.entries(plainEnv(env))) {
947
+ if (value === null) {
948
+ yield* validateComputeEnvironmentKey(key);
949
+ }
950
+ else {
951
+ yield* validateComputeEnvironmentWrite(key, value);
952
+ }
953
+ const variable = yield* findEnvironmentVariable(client, projectId, cls, key, branchId);
954
+ if (variable) {
955
+ yield* ensureUserManagedEnvironmentVariable(variable);
956
+ if (ownedIds[key] !== variable.id) {
957
+ return yield* Effect.fail(environmentVariableOwnershipError(key, variable.id));
958
+ }
959
+ }
960
+ plans.push({ key, value, variable });
961
+ }
962
+ const apply = Effect.gen(function* () {
963
+ for (const { key, value, variable } of plans) {
964
+ if (value === null)
965
+ continue;
966
+ if (variable) {
967
+ yield* client.updateEnvironmentVariable(variable.id, { value });
968
+ nextOwnedIds[key] = variable.id;
969
+ }
970
+ else {
971
+ const created = yield* client.createEnvironmentVariable({
972
+ projectId,
973
+ ...(branchId ? { branchId } : {}),
974
+ class: cls,
975
+ key,
976
+ value,
977
+ });
978
+ createdIds.push({ key, id: created.id });
979
+ nextOwnedIds[key] = created.id;
980
+ }
981
+ synced.push(key);
982
+ }
983
+ // Apply explicit deletions only after all ownership checks and upserts.
984
+ for (const { key, value, variable } of plans) {
985
+ if (value !== null || !variable)
986
+ continue;
987
+ yield* client
988
+ .deleteEnvironmentVariable(variable.id)
989
+ .pipe(Effect.catchIf(isNotFound, () => Effect.void));
990
+ deleted.push(key);
991
+ }
992
+ return { synced, deleted, ownedIds: nextOwnedIds, createdIds };
993
+ });
994
+ return yield* apply.pipe(Effect.catch((error) => rollbackCreatedEnvironmentVariables(client, createdIds, error)));
995
+ });
996
+ export const syncComputeEnvironment = Effect.fn(function* (client, projectId, cls, env = {}, branchId, ownedIds = {}) {
997
+ const result = yield* syncComputeEnvironmentInternal(client, projectId, cls, env, branchId, ownedIds);
998
+ return {
999
+ synced: result.synced,
1000
+ deleted: result.deleted,
1001
+ ownedIds: result.ownedIds,
1002
+ };
1003
+ });
1004
+ const destroyComputeEnvironment = Effect.fn(function* (client, projectId, scope, ownedIds = {}) {
1005
+ const deleted = [];
1006
+ for (const [key, ownedId] of Object.entries(ownedIds)) {
1007
+ const variable = yield* findEnvironmentVariable(client, projectId, scope.class, key, scope.branchId).pipe(Effect.catchIf(isNotFound, () => Effect.succeed(undefined)));
1008
+ if (!variable)
1009
+ continue;
1010
+ if (variable.id !== ownedId || variable.isManagedBySystem)
1011
+ continue;
1012
+ yield* client
1013
+ .deleteEnvironmentVariable(variable.id)
1014
+ .pipe(Effect.catchIf(isNotFound, () => Effect.void));
1015
+ deleted.push(key);
1016
+ }
1017
+ return { deleted };
1018
+ });
1019
+ const cleanupRemovedComputeEnvironment = Effect.fn(function* (client, projectId, oldScope, oldOwnedIds, newScope, newEnv) {
1020
+ const newValues = plainEnv(newEnv);
1021
+ const deleted = [];
1022
+ for (const [key, ownedId] of Object.entries(oldOwnedIds)) {
1023
+ if (sameEnvironmentScope(oldScope, newScope) && key in newValues)
1024
+ continue;
1025
+ const variable = yield* findEnvironmentVariable(client, projectId, oldScope.class, key, oldScope.branchId);
1026
+ if (!variable)
1027
+ continue;
1028
+ if (variable.id !== ownedId || variable.isManagedBySystem)
1029
+ continue;
1030
+ yield* client
1031
+ .deleteEnvironmentVariable(variable.id)
1032
+ .pipe(Effect.catchIf(isNotFound, () => Effect.void));
1033
+ deleted.push(key);
1034
+ }
1035
+ return { deleted };
1036
+ });
1037
+ const startDev = Effect.fn(function* (id, props) {
1038
+ const path = yield* Path.Path;
1039
+ const dev = props.dev;
1040
+ const processKey = `dev:${id}`;
1041
+ const localUrl = dev?.url ??
1042
+ ((dev?.port ?? props.port)
1043
+ ? `http://localhost:${dev?.port ?? props.port}`
1044
+ : undefined);
1045
+ if (!dev?.command) {
1046
+ return localUrl;
1047
+ }
1048
+ yield* stopTrackedDevProcess(processKey);
1049
+ const cwd = dev.cwd ? path.resolve(dev.cwd) : path.resolve(props.path ?? ".");
1050
+ const env = {
1051
+ ...processEnv(props.env),
1052
+ ...processEnv(dev.env),
1053
+ ...((dev.port ?? props.port)
1054
+ ? { PORT: String(dev.port ?? props.port) }
1055
+ : {}),
1056
+ };
1057
+ const handle = yield* ChildProcess.make(dev.command, [], {
1058
+ shell: true,
1059
+ cwd,
1060
+ env,
1061
+ extendEnv: true,
1062
+ stdin: "inherit",
1063
+ stdout: "inherit",
1064
+ stderr: "inherit",
1065
+ detached: false,
1066
+ });
1067
+ devProcesses.set(processKey, handle);
1068
+ return localUrl;
1069
+ });
1070
+ const activeBindingEnv = (bindings) => bindings
1071
+ .filter((binding) => binding.action !== "delete")
1072
+ .map((binding) => binding.data?.env)
1073
+ .reduce((acc, env) => (env ? { ...acc, ...env } : acc), {});
1074
+ export const ComputeProvider = () => Provider.effect(Compute, Effect.gen(function* () {
1075
+ const client = yield* PrismaClient;
1076
+ return {
1077
+ stables: ["appId"],
1078
+ // Compute is a composite over App + Deployment. AppProvider owns nuke
1079
+ // enumeration to avoid deleting the same canonical App twice.
1080
+ list: () => Effect.succeed([]),
1081
+ diff: Effect.fn(function* ({ olds, news, output }) {
1082
+ if (!isInputObject(news))
1083
+ return undefined;
1084
+ if (output?.local || isPrismaDevId(output?.appId)) {
1085
+ return { action: "update" };
1086
+ }
1087
+ const oldProjectId = output?.projectId ?? unresolvedProjectIdOf(olds.project);
1088
+ const newProjectId = isResolved(news.project)
1089
+ ? unresolvedProjectIdOf(news.project)
1090
+ : undefined;
1091
+ if (concreteIdsChanged(oldProjectId, newProjectId)) {
1092
+ // A different project is a distinct API uniqueness scope, so the
1093
+ // old and replacement Apps can safely coexist.
1094
+ return { action: "replace" };
1095
+ }
1096
+ if (isResolved(news.regionId) && news.regionId !== undefined) {
1097
+ const currentRegionId = output?.regionId ?? olds.regionId;
1098
+ if (currentRegionId !== undefined &&
1099
+ news.regionId !== currentRegionId) {
1100
+ return yield* Effect.fail(new Error(`Prisma Compute App region is immutable and cannot be changed atomically without deleting the live App first. Deploy a second Compute App under a different appName in the target region, cut traffic over, then remove the original.`));
1101
+ }
1102
+ }
1103
+ // Source files/build output can change with no prop change, so
1104
+ // reconcile must rerun and decide from the computed artifact hash.
1105
+ return { action: "update" };
1106
+ }),
1107
+ read: Effect.fn(function* ({ id, output, olds }) {
1108
+ if (output?.local)
1109
+ return output;
1110
+ const appId = output?.appId && !isPrismaDevId(output.appId)
1111
+ ? output.appId
1112
+ : undefined;
1113
+ const app = appId
1114
+ ? yield* client
1115
+ .getApp(appId)
1116
+ .pipe(Effect.catchIf(isNotFound, () => Effect.succeed(undefined)))
1117
+ : yield* Effect.gen(function* () {
1118
+ const projectId = unresolvedProjectIdOf(olds.project);
1119
+ return projectId
1120
+ ? yield* findApp(client, projectId, yield* createAppName(id, olds.appName), olds)
1121
+ : undefined;
1122
+ });
1123
+ if (!app)
1124
+ return undefined;
1125
+ const readDeployment = (id) => observeDeployment(client, id).pipe(Effect.catchIf(isNotFound, () => Effect.succeed(undefined)));
1126
+ const outputDeployment = output?.deploymentId
1127
+ ? yield* readDeployment(output.deploymentId)
1128
+ : undefined;
1129
+ if (outputDeployment) {
1130
+ yield* ensureDeploymentMembership(client, app.id, outputDeployment, app.latestDeploymentId);
1131
+ }
1132
+ const latestDeployment = !outputDeployment && app.latestDeploymentId
1133
+ ? yield* readDeployment(app.latestDeploymentId)
1134
+ : undefined;
1135
+ const deployment = outputDeployment ?? latestDeployment;
1136
+ const deploymentUrl = toDeploymentUrl(deployment?.previewDomain ?? undefined);
1137
+ const appUrl = toDeploymentUrl(app.appEndpointDomain);
1138
+ const promoted = app.latestDeploymentId !== null &&
1139
+ deployment?.id === app.latestDeploymentId;
1140
+ const attrs = {
1141
+ appId: app.id,
1142
+ deploymentId: deployment?.id,
1143
+ projectId: app.projectId ?? output?.projectId,
1144
+ appName: app.name,
1145
+ regionId: app.region.id,
1146
+ deploymentEndpointDomain: deployment?.previewDomain ?? undefined,
1147
+ deploymentUrl,
1148
+ appEndpointDomain: app.appEndpointDomain ?? output?.appEndpointDomain,
1149
+ url: promoted ? (appUrl ?? deploymentUrl) : deploymentUrl,
1150
+ promoted,
1151
+ previousDeploymentId: output?.previousDeploymentId,
1152
+ previousDeploymentAction: output?.previousDeploymentAction,
1153
+ readinessStatus: output?.readinessStatus,
1154
+ pendingDeploymentCleanup: output?.pendingDeploymentCleanup,
1155
+ environmentKeys: output?.environmentKeys,
1156
+ environmentVariableIds: output?.environmentVariableIds,
1157
+ environmentClass: output?.environmentClass ?? olds.envClass,
1158
+ environmentBranchId: output?.environmentBranchId,
1159
+ // A latest-deployment fallback is unrelated to a missing saved
1160
+ // deployment. Never transfer its artifact identity to other code.
1161
+ artifactHash: outputDeployment ? output?.artifactHash : undefined,
1162
+ local: false,
1163
+ };
1164
+ return appId ? attrs : Unowned(attrs);
1165
+ }),
1166
+ reconcile: Effect.fn(function* ({ id, news, olds, output, bindings }) {
1167
+ const bindingEnv = activeBindingEnv(bindings);
1168
+ const effectiveNews = {
1169
+ ...news,
1170
+ appName: yield* createAppName(id, news.appName),
1171
+ env: {
1172
+ ...bindingEnv,
1173
+ ...news.env,
1174
+ },
1175
+ };
1176
+ yield* validateComputeProps(effectiveNews);
1177
+ const projectId = yield* resolveProjectId(effectiveNews.project);
1178
+ const artifact = yield* resolveArtifact(effectiveNews);
1179
+ const cleanupArtifact = artifact.file?.cleanup ?? Effect.void;
1180
+ const releaseArtifactOnFailure = (effect) => effect.pipe(Effect.onExit((exit) => Exit.isSuccess(exit) ? Effect.void : cleanupArtifact));
1181
+ const observedApp = effectiveNews.skipCodeUpload
1182
+ ? yield* releaseArtifactOnFailure(findExistingApp(client, output).pipe(Effect.retry({
1183
+ while: isAppProvisioningNotFound,
1184
+ schedule: projectConsistencySchedule,
1185
+ })))
1186
+ : undefined;
1187
+ yield* releaseArtifactOnFailure(ensureSkipCodeUploadCanFork(effectiveNews, observedApp));
1188
+ const ensuredApp = yield* releaseArtifactOnFailure(ensureApp(client, projectId, effectiveNews, output, observedApp).pipe(Effect.retry({
1189
+ while: isAppProvisioningNotFound,
1190
+ schedule: projectConsistencySchedule,
1191
+ })));
1192
+ let app = ensuredApp.app;
1193
+ let preserveCreatedAppOnFailure = false;
1194
+ const cleanupCreatedAppOnFailure = (error) => ensuredApp.created && !preserveCreatedAppOnFailure
1195
+ ? destroyApp(client, app.id).pipe(Effect.catch((cleanupError) => Effect.fail(aggregateCleanupFailure("App", app.id, `/v1/apps/${app.id}`, error, cleanupError))), Effect.andThen(() => Effect.fail(error)))
1196
+ : Effect.fail(error);
1197
+ let createdEnvironmentVariableIds = [];
1198
+ let deploymentConverged = false;
1199
+ return yield* Effect.gen(function* () {
1200
+ const currentEnvironmentScope = yield* resolveComputeEnvironmentScope(client, app, effectiveNews);
1201
+ const deploymentHash = yield* sha256Object({
1202
+ artifact: artifact.hash,
1203
+ branchId: app.branchId,
1204
+ environmentClass: currentEnvironmentScope.class,
1205
+ environmentBranchId: currentEnvironmentScope.branchId,
1206
+ });
1207
+ const outputArtifactHash = persistedArtifactHashValue(output?.artifactHash);
1208
+ const persistedDeployment = output?.deploymentId
1209
+ ? yield* observeDeployment(client, output.deploymentId).pipe(Effect.catchIf(isNotFound, () => Effect.succeed(undefined)))
1210
+ : undefined;
1211
+ const terminalFailedDeploymentId = persistedDeployment?.status === "failed"
1212
+ ? persistedDeployment.id
1213
+ : undefined;
1214
+ const promotionRequested = !(effectiveNews.skipPromote ?? false);
1215
+ let persistedPendingCleanup = output?.pendingDeploymentCleanup;
1216
+ const cleanupPreviousDeployment = Effect.fn(function* (deploymentId, action) {
1217
+ const observed = yield* observeDeployment(client, deploymentId).pipe(Effect.catchIf(isNotFound, () => Effect.succeed(undefined)));
1218
+ if (!observed) {
1219
+ return (action === "destroy" ? "destroyed" : "stopped");
1220
+ }
1221
+ yield* ensureDeploymentMembership(client, app.id, observed, app.latestDeploymentId);
1222
+ if (action === "destroy") {
1223
+ yield* destroyDeployment(client, deploymentId, effectiveNews);
1224
+ return "destroyed";
1225
+ }
1226
+ yield* stopDeploymentIdempotent(client, deploymentId).pipe(Effect.catchIf(isNotFound, () => Effect.void));
1227
+ yield* waitForDeploymentStatus(client, deploymentId, "stopped", effectiveNews).pipe(Effect.catchIf(isNotFound, () => Effect.succeed(undefined)));
1228
+ return "stopped";
1229
+ });
1230
+ if (terminalFailedDeploymentId !== undefined &&
1231
+ promotionRequested &&
1232
+ output?.promoted === true &&
1233
+ app.latestDeploymentId !== null &&
1234
+ app.latestDeploymentId !== terminalFailedDeploymentId) {
1235
+ return yield* Effect.fail(new AggregateError([], `Prisma Compute state preserves terminal failed deployment '${terminalFailedDeploymentId}', but App '${app.id}' reports deployment '${app.latestDeploymentId}' as latest. Alchemy cannot prove that the live deployment is the interrupted replacement, and the persisted failed deployment is not a safe rollback target. No new deployment was created and neither deployment was deleted.`));
1236
+ }
1237
+ // Apply persists the previous stable Attributes before reconcile.
1238
+ // If a prior attempt promoted a new generation, failed its stable
1239
+ // health check, and could not roll back, that durable output still
1240
+ // identifies the deployment we must restore while the App points
1241
+ // at the displaced unhealthy generation. Recover that transition
1242
+ // before changing env or creating another deployment, otherwise a
1243
+ // retry would use the unhealthy generation as its rollback target.
1244
+ if (promotionRequested &&
1245
+ output?.promoted === true &&
1246
+ output.deploymentId !== undefined &&
1247
+ terminalFailedDeploymentId === undefined &&
1248
+ outputArtifactHash !== deploymentHash &&
1249
+ app.latestDeploymentId !== null &&
1250
+ app.latestDeploymentId !== output.deploymentId) {
1251
+ const persistedDeploymentId = output.deploymentId;
1252
+ const displacedDeploymentId = app.latestDeploymentId;
1253
+ const rollback = yield* client
1254
+ .rollbackApp(app.id, {
1255
+ deploymentId: persistedDeploymentId,
1256
+ })
1257
+ .pipe(Effect.result);
1258
+ const observedAfterRollback = yield* waitForAppDeploymentTarget(client, app.id, persistedDeploymentId, effectiveNews).pipe(Effect.result);
1259
+ if (Result.isFailure(observedAfterRollback)) {
1260
+ return yield* Effect.fail(new AggregateError([
1261
+ ...(Result.isFailure(rollback) ? [rollback.failure] : []),
1262
+ ...(Result.isFailure(observedAfterRollback)
1263
+ ? [observedAfterRollback.failure]
1264
+ : []),
1265
+ ], `Prisma App '${app.id}' has live deployment '${displacedDeploymentId}', while Alchemy state preserves deployment '${persistedDeploymentId}' as the prior promoted generation. Recovery via POST /v1/apps/${app.id}/rollback did not converge, so no environment variables or new deployment were changed and neither deployment was deleted.`));
1266
+ }
1267
+ app = observedAfterRollback.success;
1268
+ yield* destroyDeployment(client, displacedDeploymentId, effectiveNews).pipe(Effect.catch((cleanupError) => Effect.fail(new AggregateError([
1269
+ ...(Result.isFailure(rollback)
1270
+ ? [rollback.failure]
1271
+ : []),
1272
+ cleanupError,
1273
+ ], `Prisma App '${app.id}' was restored to deployment '${persistedDeploymentId}', but displaced deployment '${displacedDeploymentId}' could not be deleted. No new deployment was created; retry cleanup with DELETE /v1/deployments/${displacedDeploymentId}.`))));
1274
+ }
1275
+ if (output?.readinessStatus === "pending" &&
1276
+ outputArtifactHash !== deploymentHash) {
1277
+ return yield* Effect.fail(new Error(`Prisma Compute deployment '${output.deploymentId ?? "unknown"}' still has pending stable-endpoint readiness. Reconcile the existing generation before changing code or environment inputs.`));
1278
+ }
1279
+ // Keep one cleanup candidate. A non-live older candidate is
1280
+ // drained before any env/deploy mutation; a candidate that is
1281
+ // still live is derived from app.latestDeploymentId below.
1282
+ if (persistedPendingCleanup !== undefined &&
1283
+ output?.readinessStatus !== "pending" &&
1284
+ persistedPendingCleanup.deploymentId !== app.latestDeploymentId) {
1285
+ yield* cleanupPreviousDeployment(persistedPendingCleanup.deploymentId, persistedPendingCleanup.action);
1286
+ persistedPendingCleanup = undefined;
1287
+ }
1288
+ else if (persistedPendingCleanup?.deploymentId === app.latestDeploymentId) {
1289
+ persistedPendingCleanup = undefined;
1290
+ }
1291
+ const previousEnvironmentScope = environmentScope(olds?.envClass ?? output?.environmentClass ?? "production", output?.environmentBranchId);
1292
+ const previousEnvironmentVariableIds = output?.environmentVariableIds ?? {};
1293
+ const environmentResult = yield* syncComputeEnvironmentInternal(client, projectId, currentEnvironmentScope.class, effectiveNews.env, currentEnvironmentScope.branchId, sameEnvironmentScope(previousEnvironmentScope, currentEnvironmentScope)
1294
+ ? previousEnvironmentVariableIds
1295
+ : {});
1296
+ createdEnvironmentVariableIds = environmentResult.createdIds;
1297
+ // Deployment creation snapshots the App branch environment. Remove
1298
+ // formerly-owned keys before creating it so deleted keys cannot be
1299
+ // captured into the new runtime. Any failure here happens before
1300
+ // deployment creation and rolls back newly-created variables.
1301
+ yield* cleanupRemovedComputeEnvironment(client, projectId, previousEnvironmentScope, previousEnvironmentVariableIds, currentEnvironmentScope, effectiveNews.env);
1302
+ let deployment = outputArtifactHash === deploymentHash
1303
+ ? persistedDeployment
1304
+ : undefined;
1305
+ // A failed deployment is terminal and cannot be repaired by
1306
+ // replaying start/promotion. Preserve it as the cleanup target,
1307
+ // but create a fresh generation and do not delete the failed one
1308
+ // until the replacement has passed preview + stable readiness and
1309
+ // promotion is observed.
1310
+ if (persistedDeployment !== undefined &&
1311
+ (deployment !== undefined ||
1312
+ terminalFailedDeploymentId !== undefined)) {
1313
+ yield* ensureDeploymentMembership(client, app.id, persistedDeployment, app.latestDeploymentId);
1314
+ }
1315
+ if (terminalFailedDeploymentId !== undefined) {
1316
+ deployment = undefined;
1317
+ }
1318
+ let createdDeploymentId;
1319
+ const cleanupCreatedDeploymentOnFailure = (failedDeploymentId, error) => createdDeploymentId === failedDeploymentId
1320
+ ? destroyDeployment(client, failedDeploymentId, effectiveNews).pipe(Effect.catch((cleanupError) => Effect.fail(aggregateCleanupFailure("deployment", failedDeploymentId, `/v1/deployments/${failedDeploymentId}`, error, cleanupError))), Effect.andThen(() => Effect.fail(error)))
1321
+ : Effect.fail(error);
1322
+ if (!deployment) {
1323
+ const created = yield* client.createAppDeployment(app.id, {
1324
+ portMapping: { http: artifact.port },
1325
+ skipCodeUpload: effectiveNews.skipCodeUpload,
1326
+ });
1327
+ createdDeploymentId = created.id;
1328
+ if (artifact.file !== undefined && !created.uploadUrl) {
1329
+ return yield* cleanupCreatedDeploymentOnFailure(created.id, new Error("Prisma deployment creation did not return an upload URL."));
1330
+ }
1331
+ if (created.uploadUrl && artifact.file !== undefined) {
1332
+ yield* uploadArtifact(created.uploadUrl, artifact.file, "application/gzip").pipe(Effect.catch((error) => cleanupCreatedDeploymentOnFailure(created.id, error)));
1333
+ }
1334
+ deployment = yield* observeDeployment(client, created.id).pipe(Effect.catchIf(isNotFound, () => Effect.succeed({
1335
+ id: created.id,
1336
+ type: "deployment",
1337
+ url: created.url,
1338
+ foundryVersionId: created.foundryVersionId,
1339
+ status: "new",
1340
+ previewDomain: null,
1341
+ createdAt: undefined,
1342
+ })), Effect.catch((error) => cleanupCreatedDeploymentOnFailure(created.id, error)));
1343
+ }
1344
+ if (!deployment) {
1345
+ return yield* Effect.fail(new Error("Prisma deployment could not be resolved after creation."));
1346
+ }
1347
+ const previousDeploymentId = terminalFailedDeploymentId ??
1348
+ persistedPendingCleanup?.deploymentId ??
1349
+ (app.latestDeploymentId !== null &&
1350
+ app.latestDeploymentId !== deployment.id
1351
+ ? app.latestDeploymentId
1352
+ : null);
1353
+ const rollbackDeploymentId = previousDeploymentId === terminalFailedDeploymentId
1354
+ ? null
1355
+ : previousDeploymentId;
1356
+ if (effectiveNews.start ?? true) {
1357
+ const currentDeployment = deployment;
1358
+ const currentDeploymentId = currentDeployment.id;
1359
+ deployment = yield* Effect.gen(function* () {
1360
+ if (currentDeployment.status !== "running" &&
1361
+ currentDeployment.status !== "provisioning") {
1362
+ yield* startDeploymentIdempotent(client, currentDeployment.id);
1363
+ }
1364
+ const running = yield* waitForDeploymentStatus(client, currentDeployment.id, "running", effectiveNews);
1365
+ yield* waitForDeploymentUrl(toDeploymentUrl(running.previewDomain), effectiveNews);
1366
+ return running;
1367
+ }).pipe(Effect.catch((error) => cleanupCreatedDeploymentOnFailure(currentDeploymentId, error)));
1368
+ }
1369
+ let appEndpointDomain = app.appEndpointDomain;
1370
+ let previousDeploymentAction = previousDeploymentId ? "still-active" : null;
1371
+ let promoted = app.latestDeploymentId === deployment.id;
1372
+ if (promotionRequested) {
1373
+ // Replay promotion even when latestDeploymentId already matches.
1374
+ // Promotion also repairs endpoint/custom-domain routing drift.
1375
+ preserveCreatedAppOnFailure = true;
1376
+ const promotedApp = yield* promoteAppObserved(client, app.id, deployment.id, effectiveNews);
1377
+ appEndpointDomain = promotedApp.appEndpointDomain;
1378
+ promoted = true;
1379
+ }
1380
+ const deploymentUrl = toDeploymentUrl(deployment.previewDomain);
1381
+ const appUrl = toDeploymentUrl(appEndpointDomain) ??
1382
+ toDeploymentUrl(deployment.previewDomain);
1383
+ let readinessStatus = "skipped";
1384
+ if (promoted && effectiveNews.verifyUrl !== false) {
1385
+ const readiness = yield* waitForDeploymentUrl(appUrl, effectiveNews).pipe(Effect.result);
1386
+ if (Result.isSuccess(readiness)) {
1387
+ readinessStatus = "ready";
1388
+ }
1389
+ else if (rollbackDeploymentId) {
1390
+ const rollback = yield* client
1391
+ .rollbackApp(app.id, {
1392
+ deploymentId: rollbackDeploymentId,
1393
+ })
1394
+ .pipe(Effect.result);
1395
+ const observedAfterRollback = yield* waitForAppDeploymentTarget(client, app.id, rollbackDeploymentId, effectiveNews).pipe(Effect.result);
1396
+ if (Result.isSuccess(observedAfterRollback)) {
1397
+ return yield* cleanupCreatedDeploymentOnFailure(deployment.id, Result.isSuccess(rollback)
1398
+ ? readiness.failure
1399
+ : new AggregateError([readiness.failure, rollback.failure], `Prisma App '${app.id}' endpoint was restored to deployment '${rollbackDeploymentId}', but the rollback response was lost.`));
1400
+ }
1401
+ return yield* Effect.fail(new AggregateError([
1402
+ readiness.failure,
1403
+ ...(Result.isFailure(rollback) ? [rollback.failure] : []),
1404
+ observedAfterRollback.failure,
1405
+ ], `Prisma App '${app.id}' promoted deployment '${deployment.id}', but its stable endpoint failed readiness and rollback to deployment '${rollbackDeploymentId}' did not converge. Alchemy preserved the prior deployment in state and deleted neither deployment; the next reconcile will retry recovery via POST /v1/apps/${app.id}/rollback before making any new cloud changes.`));
1406
+ }
1407
+ else {
1408
+ // A first deployment has no safe rollback target. Never report
1409
+ // a successful stack deployment while the production endpoint
1410
+ // is unreachable. A newly created App can be fully cleaned up;
1411
+ // a pre-existing App is preserved for observed-state recovery.
1412
+ if (ensuredApp.created) {
1413
+ preserveCreatedAppOnFailure = false;
1414
+ }
1415
+ else {
1416
+ deploymentConverged = true;
1417
+ }
1418
+ if (terminalFailedDeploymentId !== undefined) {
1419
+ return yield* Effect.fail(new AggregateError([readiness.failure], `Prisma App '${app.id}' promoted replacement deployment '${deployment.id}', but stable readiness failed and persisted deployment '${terminalFailedDeploymentId}' is terminal failed, so no safe rollback target exists. Neither deployment was deleted; a retry will refuse to create another generation while the live target differs from persisted state.`));
1420
+ }
1421
+ return yield* Effect.fail(readiness.failure);
1422
+ }
1423
+ }
1424
+ deploymentConverged = true;
1425
+ let pendingDeploymentCleanup = promoted &&
1426
+ previousDeploymentId &&
1427
+ previousDeploymentId !== deployment.id
1428
+ ? {
1429
+ deploymentId: previousDeploymentId,
1430
+ action: persistedPendingCleanup?.deploymentId ===
1431
+ previousDeploymentId
1432
+ ? persistedPendingCleanup.action
1433
+ : previousDeploymentId === terminalFailedDeploymentId
1434
+ ? "destroy"
1435
+ : effectiveNews.destroyOldDeployment
1436
+ ? "destroy"
1437
+ : "stop",
1438
+ }
1439
+ : undefined;
1440
+ if (promoted && pendingDeploymentCleanup) {
1441
+ const cleanup = yield* cleanupPreviousDeployment(pendingDeploymentCleanup.deploymentId, pendingDeploymentCleanup.action).pipe(Effect.result);
1442
+ if (Result.isSuccess(cleanup)) {
1443
+ previousDeploymentAction = cleanup.success;
1444
+ pendingDeploymentCleanup = undefined;
1445
+ }
1446
+ else {
1447
+ yield* Effect.logWarning(`Prisma deployment '${pendingDeploymentCleanup.deploymentId}' cleanup is pending and will be retried before another Compute generation is created.`);
1448
+ }
1449
+ }
1450
+ return {
1451
+ appId: app.id,
1452
+ deploymentId: deployment.id,
1453
+ projectId,
1454
+ appName: app.name,
1455
+ regionId: app.region.id,
1456
+ deploymentEndpointDomain: deployment.previewDomain ?? undefined,
1457
+ deploymentUrl,
1458
+ appEndpointDomain,
1459
+ url: promoted ? appUrl : deploymentUrl,
1460
+ promoted,
1461
+ previousDeploymentId,
1462
+ previousDeploymentAction,
1463
+ readinessStatus,
1464
+ pendingDeploymentCleanup,
1465
+ environmentKeys: managedEnvKeys(effectiveNews.env),
1466
+ environmentVariableIds: environmentResult.ownedIds,
1467
+ environmentClass: currentEnvironmentScope.class,
1468
+ environmentBranchId: currentEnvironmentScope.branchId,
1469
+ artifactHash: Redacted.make(deploymentHash),
1470
+ local: false,
1471
+ };
1472
+ }).pipe(Effect.catch((error) => deploymentConverged
1473
+ ? Effect.fail(error)
1474
+ : rollbackCreatedEnvironmentVariables(client, createdEnvironmentVariableIds, error)), Effect.catch(cleanupCreatedAppOnFailure), Effect.ensuring(cleanupArtifact));
1475
+ }),
1476
+ delete: Effect.fn(function* ({ olds, output }) {
1477
+ if (output.local || isPrismaDevId(output.appId)) {
1478
+ yield* stopTrackedDevProcess(output.appId);
1479
+ return;
1480
+ }
1481
+ yield* destroyComputeEnvironment(client, output.projectId, environmentScope(olds?.envClass ?? output.environmentClass ?? "production", output.environmentBranchId), output.environmentVariableIds);
1482
+ yield* destroyApp(client, output.appId);
1483
+ }),
1484
+ tail: ({ output }) => output.deploymentId
1485
+ ? tailDeploymentLogs(client, output.deploymentId)
1486
+ : Stream.empty,
1487
+ };
1488
+ }));
1489
+ export const ComputeDevProvider = () => Provider.effect(Compute, Effect.gen(function* () {
1490
+ const ctx = yield* AlchemyContext;
1491
+ return {
1492
+ stables: ["appId"],
1493
+ list: () => Effect.succeed([]),
1494
+ diff: Effect.fn(function* () {
1495
+ return { action: "update" };
1496
+ }),
1497
+ read: Effect.fn(function* ({ output }) {
1498
+ return output?.local ? output : undefined;
1499
+ }),
1500
+ reconcile: Effect.fn(function* ({ id, news, output, bindings }) {
1501
+ const bindingEnv = activeBindingEnv(bindings);
1502
+ const effectiveNews = {
1503
+ ...news,
1504
+ env: {
1505
+ ...bindingEnv,
1506
+ ...news.env,
1507
+ },
1508
+ };
1509
+ yield* validateComputeProps(effectiveNews);
1510
+ const projectId = yield* resolveProjectId(effectiveNews.project);
1511
+ if (!ctx.dev) {
1512
+ return yield* Effect.fail(new Error("ComputeDevProvider requires Alchemy dev mode."));
1513
+ }
1514
+ const localUrl = yield* startDev(id, effectiveNews);
1515
+ return {
1516
+ appId: output?.appId ?? `dev:${id}`,
1517
+ deploymentId: undefined,
1518
+ projectId,
1519
+ appName: effectiveNews.appName ?? id,
1520
+ regionId: effectiveNews.regionId ?? "us-east-1",
1521
+ deploymentEndpointDomain: localUrl,
1522
+ deploymentUrl: localUrl,
1523
+ appEndpointDomain: localUrl,
1524
+ url: localUrl,
1525
+ promoted: false,
1526
+ previousDeploymentId: undefined,
1527
+ previousDeploymentAction: undefined,
1528
+ readinessStatus: "skipped",
1529
+ pendingDeploymentCleanup: undefined,
1530
+ environmentKeys: managedEnvKeys(effectiveNews.env),
1531
+ environmentVariableIds: {},
1532
+ environmentClass: effectiveNews.envClass ?? "production",
1533
+ environmentBranchId: null,
1534
+ artifactHash: undefined,
1535
+ local: true,
1536
+ };
1537
+ }),
1538
+ delete: Effect.fn(function* ({ output }) {
1539
+ yield* stopTrackedDevProcess(output.appId);
1540
+ }),
1541
+ };
1542
+ }));
1543
+ //# sourceMappingURL=Compute.js.map